summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ucb/source/ucp/gio/gio_content.cxx31
1 files changed, 15 insertions, 16 deletions
diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx
index 5029e06bf026..b8900f8df8d8 100644
--- a/ucb/source/ucp/gio/gio_content.cxx
+++ b/ucb/source/ucp/gio/gio_content.cxx
@@ -416,7 +416,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValuesFromGFileInfo(GFileInfo *
if ( rProp.Name == "IsDocument" )
{
- if (g_file_info_has_attribute(pInfo, G_FILE_ATTRIBUTE_STANDARD_TYPE))
+ if (pInfo != 0 && g_file_info_has_attribute(pInfo, G_FILE_ATTRIBUTE_STANDARD_TYPE))
xRow->appendBoolean( rProp, ( g_file_info_get_file_type( pInfo ) == G_FILE_TYPE_REGULAR ||
g_file_info_get_file_type( pInfo ) == G_FILE_TYPE_UNKNOWN ) );
else
@@ -424,45 +424,45 @@ uno::Reference< sdbc::XRow > Content::getPropertyValuesFromGFileInfo(GFileInfo *
}
else if ( rProp.Name == "IsFolder" )
{
- if( g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_STANDARD_TYPE) )
+ if (pInfo != 0 && g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_STANDARD_TYPE) )
xRow->appendBoolean( rProp, ( g_file_info_get_file_type( pInfo ) == G_FILE_TYPE_DIRECTORY ));
else
xRow->appendVoid( rProp );
}
else if ( rProp.Name == "Title" )
{
- if (g_file_info_has_attribute(pInfo, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME))
+ if (pInfo != 0 && g_file_info_has_attribute(pInfo, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME))
{
const char *pName = g_file_info_get_display_name(pInfo);
xRow->appendString( rProp, rtl::OUString(pName, strlen(pName), RTL_TEXTENCODING_UTF8) );
}
else
- xRow->appendVoid( rProp );
+ xRow->appendVoid(rProp);
}
else if ( rProp.Name == "IsReadOnly" )
{
- if( g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE ) )
+ if (pInfo != 0 && g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE ) )
xRow->appendBoolean( rProp, !g_file_info_get_attribute_boolean( pInfo, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE) );
else
xRow->appendVoid( rProp );
}
else if ( rProp.Name == "DateCreated" )
{
- if( g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_TIME_CREATED ) )
+ if (pInfo != 0 && g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_TIME_CREATED ) )
xRow->appendTimestamp( rProp, getDateFromUnix(g_file_info_get_attribute_uint64(pInfo, G_FILE_ATTRIBUTE_TIME_CREATED)) );
else
xRow->appendVoid( rProp );
}
else if ( rProp.Name == "DateModified" )
{
- if( g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_TIME_CHANGED ) )
+ if (pInfo != 0 && g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_TIME_CHANGED ) )
xRow->appendTimestamp( rProp, getDateFromUnix(g_file_info_get_attribute_uint64(pInfo, G_FILE_ATTRIBUTE_TIME_CHANGED)) );
else
xRow->appendVoid( rProp );
}
else if ( rProp.Name == "Size" )
{
- if( g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_STANDARD_SIZE) )
+ if (pInfo != 0 && g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_STANDARD_SIZE) )
xRow->appendLong( rProp, ( g_file_info_get_size( pInfo ) ));
else
xRow->appendVoid( rProp );
@@ -474,14 +474,14 @@ uno::Reference< sdbc::XRow > Content::getPropertyValuesFromGFileInfo(GFileInfo *
}
else if ( rProp.Name == "IsCompactDisc" )
{
- if( g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT ) )
+ if (pInfo != 0 && g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT ) )
xRow->appendBoolean( rProp, g_file_info_get_attribute_boolean(pInfo, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT) );
else
xRow->appendVoid( rProp );
}
else if ( rProp.Name == "IsRemoveable" )
{
- if( g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT ) )
+ if (pInfo != 0 && g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT ) )
xRow->appendBoolean( rProp, g_file_info_get_attribute_boolean(pInfo, G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT ) );
else
xRow->appendVoid( rProp );
@@ -492,7 +492,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValuesFromGFileInfo(GFileInfo *
}
else if ( rProp.Name == "IsHidden" )
{
- if( g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN) )
+ if (pInfo != 0 && g_file_info_has_attribute( pInfo, G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN) )
xRow->appendBoolean( rProp, ( g_file_info_get_is_hidden ( pInfo ) ) );
else
xRow->appendVoid( rProp );
@@ -517,11 +517,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
const uno::Sequence< beans::Property >& rProperties,
const uno::Reference< ucb::XCommandEnvironment >& xEnv )
{
- GError *pError = NULL;
- GFileInfo *pInfo = getGFileInfo(xEnv, &pError);
- if (!pInfo)
- ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv);
-
+ GFileInfo *pInfo = getGFileInfo(xEnv);
return getPropertyValuesFromGFileInfo(pInfo, m_xSMgr, xEnv, rProperties);
}
@@ -1074,6 +1070,9 @@ void Content::transfer( const ucb::TransferInfo& aTransferInfo, const uno::Refer
throw( uno::Exception )
{
rtl::OUString sDest = m_xIdentifier->getContentIdentifier();
+ if (!sDest.endsWith("/")) {
+ sDest += "/";
+ }
if (aTransferInfo.NewTitle.getLength())
sDest += aTransferInfo.NewTitle;
else