Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2107

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/07/2107/1

Fixed SfxDocTplService_Impl::setTitleForURL to keep all streams.

After commit 117fdb98, the setTitleForURL only wrote the meta.xml file
to the odf container, dropping all the other streams. Use storeToStorage
as in the old implementation to fix the problem.

Even though marginal, this problem is important for templates renaming.

Change-Id: Ia9b6abfc112f102e2bd2ae9d3080c4ed827200df
---
M sfx2/source/doc/doctemplates.cxx
1 file changed, 13 insertions(+), 2 deletions(-)



diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 1313fee..9720fab 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -32,6 +32,7 @@
 #include <comphelper/componentcontext.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/storagehelper.hxx>
 #include <comphelper/string.hxx>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
@@ -646,8 +647,18 @@
         try
         {
             m_xDocProps->loadFromMedium(rURL, Sequence<PropertyValue>());
-            m_xDocProps->setTitle(aTitle );
-            m_xDocProps->storeToMedium(rURL, Sequence<PropertyValue>());
+            m_xDocProps->setTitle(aTitle);
+
+            uno::Reference< embed::XStorage > xStorage = 
::comphelper::OStorageHelper::GetStorageFromURL(
+                    rURL, embed::ElementModes::READWRITE);
+
+            uno::Sequence<beans::PropertyValue> medium(2);
+            medium[0].Name = ::rtl::OUString("DocumentBaseURL");
+            medium[0].Value <<= rURL;
+            medium[1].Name = ::rtl::OUString("URL");
+            medium[1].Value <<= rURL;
+
+            m_xDocProps->storeToStorage(xStorage, medium);
             return true;
         }
         catch ( Exception& )

-- 
To view, visit https://gerrit.libreoffice.org/2107
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9b6abfc112f102e2bd2ae9d3080c4ed827200df
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Bosdonnat Cedric <cedric.bosdonnat@free.fr>

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.