summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svtools/source/misc/templatefoldercache.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index 41f0af0839cd..d5325f448c9c 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -695,6 +695,17 @@ namespace svt
{
String sTemplatePath( aDirs.GetToken( i, ';' ) );
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();