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


Please consider the below fix for <https://bugs.freedesktop.org/show_bug.cgi?id=37593> "'File > New > Template' no longer remembers my last open folder" for inclusion in libreoffice-3-5.

Stephan

On 03/16/2012 03:03 PM, Stephan Bergmann wrote:
commit 32a5ad89a505be22fb8ca0b990a8991a7de6453a
Author: Stephan Bergmann<sbergman@redhat.com>
Date:   Fri Mar 16 14:57:51 2012 +0100

     fdo#37593 Make sure needsUpdate compares canonicalized paths

     ...so that it does not erroneously always claim an update is needed, so that
     SvtDocumentTemplateDialog::UpdateHdl_Impl does not always jump back to
     OpenTemplateRoot() shortly after opening the dialog (and thus jumps away from
     the last remembered folder).

diff --git a/svtools/source/misc/templatefoldercache.cxx 
b/svtools/source/misc/templatefoldercache.cxx
index d7a5679..1486fb2 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -693,6 +693,17 @@ namespace svt
          {
              String sTemplatePath( aDirs.getToken(0, ';', nIndex) );
              sTemplatePath = aPathOptions.ExpandMacros( sTemplatePath );
+
+            // Make sure excess ".." path segments (from expanding bootstrap
+            // variables in paths) are normalized in the same way they are
+            // normalized for paths read from the .templdir.cache file (where
+            // paths have gone through makeRelocatable URL on writing out and
+            // then through makeAbsoluteURL when reading back in), as otherwise
+            // equalStates() in needsUpdate() could erroneously consider
+            // m_aCurrentState and m_aPreviousState as different:
+            sTemplatePath = getOfficeInstDirs()->makeAbsoluteURL(
+                getOfficeInstDirs()->makeRelocatableURL(sTemplatePath));
+
              // create a new entry
              m_aCurrentState.push_back( new TemplateContent( INetURLObject( sTemplatePath ) ) );
              TemplateFolderContent::iterator aCurrentRoot = m_aCurrentState.end();

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.