Resolves: rhbz#895690 failure saving to gvfs mounts

f41
Stephan Bergmann 12 years ago
parent 65ac10476f
commit eadd0e48d4

@ -0,0 +1,143 @@
From 8722f0e7ef690205d042c8a6b1fdf342a34ecbe1 Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Wed, 13 Mar 2013 08:59:42 +0100
Subject: [PATCH] rhbz#895690: Make GIO UCP less brittle, so saving docs works
again
966d20e35d5a2be2fce6c204af5c156c3ead7063 "CMIS ucp: write documents back to CMIS
server" had introduced changes to sfx2/source/doc/docfile.cxx in LO 3.6 that
changed the exact commands that this code issued for UCP content nodes. The GIO
UCP was not prepared to handle that, causing saving of documents via it to fail
with rather obscure error messages:
* For one, docfile.cxx started to call "getPropertyValues" to obtain the "Title"
of a non-existent content. That lead to an InteractiveAugmentedIOException
instead of silently returning a void value.
* For another, docfile.cxx started to call "transfer" on a folder content whose
URL did not have a trailing slash, so the code computed a wrong URL for the
child element, resulting in various problems depending on context.
Change-Id: I1a9c0c094f5320456940e3af4c802711828ab5ac
---
ucb/source/ucp/gio/gio_content.cxx | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx
index e08b727..6584bc5 100644
--- a/ucb/source/ucp/gio/gio_content.cxx
+++ b/ucb/source/ucp/gio/gio_content.cxx
@@ -405,7 +405,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
@@ -413,45 +413,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 );
@@ -463,14 +463,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 );
@@ -481,7 +481,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 );
@@ -506,11 +506,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_xContext, xEnv, rProperties);
}
@@ -1063,6 +1059,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
--
1.8.1.4

@ -47,7 +47,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice Name: libreoffice
Epoch: 1 Epoch: 1
Version: %{libo_version}.2 Version: %{libo_version}.2
Release: 3%{?libo_prerelease}%{?dist} Release: 4%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0
Group: Applications/Productivity Group: Applications/Productivity
URL: http://www.documentfoundation.org/develop URL: http://www.documentfoundation.org/develop
@ -258,6 +258,7 @@ Patch24: 0001-Resolves-fdo-61241-force-area-page-to-size-itself-fo.patch
Patch25: 0001-Resolves-fdo-61656-use-order-and-orientation-combobo.patch Patch25: 0001-Resolves-fdo-61656-use-order-and-orientation-combobo.patch
Patch26: 0001-Resolves-fdo-56031-RSID-attr-changes-drop-content-ch.patch Patch26: 0001-Resolves-fdo-56031-RSID-attr-changes-drop-content-ch.patch
Patch27: 0001-Resolves-rhbz-920697-i110881-rhbz-623191-presentatio.patch Patch27: 0001-Resolves-rhbz-920697-i110881-rhbz-623191-presentatio.patch
Patch28: 0001-rhbz-895690-Make-GIO-UCP-less-brittle-so-saving-docs.patch
%define instdir %{_libdir} %define instdir %{_libdir}
%define baseinstdir %{instdir}/libreoffice %define baseinstdir %{instdir}/libreoffice
@ -1008,6 +1009,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
%patch25 -p1 -b .fdo-61656-use-order-and-orientation-combobo.patch %patch25 -p1 -b .fdo-61656-use-order-and-orientation-combobo.patch
%patch26 -p1 -b .fdo-56031-RSID-attr-changes-drop-content-ch.patch %patch26 -p1 -b .fdo-56031-RSID-attr-changes-drop-content-ch.patch
%patch27 -p1 -b .rhbz-920697-i110881-rhbz-623191-presentatio.patch %patch27 -p1 -b .rhbz-920697-i110881-rhbz-623191-presentatio.patch
%patch28 -p1 -b .rhbz-895690-Make-GIO-UCP-less-brittle-so-saving-docs.patch
# TODO: check this # TODO: check this
# these are horribly incomplete--empty translations and copied english # these are horribly incomplete--empty translations and copied english
@ -2075,6 +2077,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%endif %endif
%changelog %changelog
* Wed Mar 13 2013 Stephan Bergmann <sbergman@redhat.com> - 1:4.0.1.2-4
- Resolves: rhbz#895690 failure saving to gvfs mounts
* Tue Mar 12 2013 Caolán McNamara <caolanm@redhat.com> - 1:4.0.1.2-3 * Tue Mar 12 2013 Caolán McNamara <caolanm@redhat.com> - 1:4.0.1.2-3
- Resolves: rhbz#920697 presentation not always full-screen - Resolves: rhbz#920697 presentation not always full-screen

Loading…
Cancel
Save