[libreoffice/f18] Resolves: rhbz#895690 failure saving to gvfs mounts

sbergmann sbergmann at fedoraproject.org
Wed Mar 13 10:33:12 UTC 2013


commit a0cb803eff4926ae78b5d6eb44af7020ba43b97b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 13 11:32:55 2013 +0100

    Resolves: rhbz#895690 failure saving to gvfs mounts

 ...-Make-GIO-UCP-less-brittle-so-saving-docs.patch |  147 ++++++++++++++++++++
 libreoffice.spec                                   |    5 +-
 2 files changed, 151 insertions(+), 1 deletions(-)
---
diff --git a/0001-rhbz-895690-Make-GIO-UCP-less-brittle-so-saving-docs.patch b/0001-rhbz-895690-Make-GIO-UCP-less-brittle-so-saving-docs.patch
new file mode 100644
index 0000000..2c636a8
--- /dev/null
+++ b/0001-rhbz-895690-Make-GIO-UCP-less-brittle-so-saving-docs.patch
@@ -0,0 +1,147 @@
+From 966159db621417f7973e7f57ceafe3d600487a5c Mon Sep 17 00:00:00 2001
+From: Stephan Bergmann <sbergman at 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.
+
+(cherry picked from commit 8722f0e7ef690205d042c8a6b1fdf342a34ecbe1)
+Conflicts:
+	ucb/source/ucp/gio/gio_content.cxx
+
+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 5029e06..b8900f8 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
+-- 
+1.8.1.4
+
diff --git a/libreoffice.spec b/libreoffice.spec
index afe8c1a..6e15b19 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -265,6 +265,7 @@ Patch43: 0001-odf-export-arcangleto-commands-in-enhanced-path-use-.patch
 Patch44: 0001-Related-rhbz-902884-check-for-GetSelectedMasterPage-.patch
 Patch45: 0001-Resolves-fdo-56031-RSID-attr-changes-drop-content-ch.patch
 Patch46: 0001-Resolves-rhbz-920697-i110881-rhbz-623191-presentatio.patc
+Patch47: 0001-rhbz-895690-Make-GIO-UCP-less-brittle-so-saving-docs.patch
 
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 %define instdir %{_libdir}
@@ -1023,6 +1024,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
 %patch44 -p1 -b .rhbz-902884-check-for-GetSelectedMasterPage-.patch
 %patch45 -p1 -b .fdo-56031-RSID-attr-changes-drop-content-ch.patc
 %patch46 -p1 -b .rhbz-920697-i110881-rhbz-623191-presentatio.patc
+%patch47 -p1 -b .rhbz-895690-Make-GIO-UCP-less-brittle-so-saving-docs.patch
 
 # TODO: check this
 # these are horribly incomplete--empty translations and copied english
@@ -2292,8 +2294,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
 %endif
 
 %changelog
-* Tue Mar 12 2013 Caolán McNamara <caolanm at redhat.com> - 1:3.6.5.2-7-UNBUILT
+* Tue Mar 12 2013 Caolán McNamara <caolanm at redhat.com> - 1:3.6.5.2-7
 - Resolves: rhbz#920697 presentation not always full screen
+- Resolves: rhbz#895690 failure saving to gvfs mounts
 
 * Thu Mar 07 2013 David Tardon <dtardon at redhat.com> - 1:3.6.5.2-6
 - Resolves: rhbz#906386 impress conversion from pptx to odp breaks some shapes


More information about the scm-commits mailing list