Blame SOURCES/0001-Resolves-tdf-89905-don-t-copy-palettes-from-shared-t.patch

f325b2
From f47aa0dbb17a998bdeb01036b9fd9ba0b74b8704 Mon Sep 17 00:00:00 2001
f325b2
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
f325b2
Date: Sat, 6 Jun 2015 14:24:46 +0100
f325b2
Subject: [PATCH] Resolves: tdf#89905 don't copy palettes from shared to user
f325b2
f325b2
make this a multi-path element with a shared read-only location
f325b2
and a user read/write location and don't copy the presets, instead
f325b2
just keep them in the shared location
f325b2
f325b2
Now an admin can copy extra palettes into the shared location
f325b2
and they magically appear in the user deployments
f325b2
f325b2
Change-Id: I7585789c0c59941094f6128368df94b834d3c2a2
f325b2
(cherry picked from commit 29202a16d9f1934684c7d0978112849f2a21fe2f)
f325b2
f325b2
Related: tdf#89905 these PalettePath uses appear to really be UserConfigPath
f325b2
f325b2
which is the same path at the moment
f325b2
f325b2
Change-Id: Ifdefa478003a2b5cc5c065b1942194dda1275f5e
f325b2
(cherry picked from commit 2c3bf6bfc244517a0134e320acaa1f720703d8f2)
f325b2
---
f325b2
 cui/source/tabpages/tabarea.cxx                    |  9 ++-
f325b2
 cui/source/tabpages/tabline.cxx                    | 10 +++-
f325b2
 cui/source/tabpages/tpbitmap.cxx                   | 22 ++++++-
f325b2
 cui/source/tabpages/tpcolor.cxx                    | 22 ++++++-
f325b2
 cui/source/tabpages/tpgradnt.cxx                   | 22 ++++++-
f325b2
 cui/source/tabpages/tphatch.cxx                    | 22 ++++++-
f325b2
 cui/source/tabpages/tplnedef.cxx                   | 22 ++++++-
f325b2
 cui/source/tabpages/tplneend.cxx                   | 23 +++++++-
f325b2
 extras/Package_palettes.mk                         |  2 +-
f325b2
 offapi/com/sun/star/util/XPathSettings.idl         |  3 +-
f325b2
 .../registry/data/org/openoffice/Office/Paths.xcu  |  3 +
f325b2
 .../schema/org/openoffice/Office/Common.xcs        |  7 ++-
f325b2
 sd/source/ui/dlg/PhotoAlbumDialog.cxx              |  2 +-
f325b2
 svx/source/sidebar/nbdtmg.cxx                      |  4 +-
f325b2
 svx/source/tbxctrls/PaletteManager.cxx             | 67 +++++++++++++++-------
f325b2
 svx/source/xoutdev/xtable.cxx                      | 54 ++++++++++++-----
f325b2
 16 files changed, 237 insertions(+), 57 deletions(-)
f325b2
f325b2
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
f325b2
index 7ecc836..1bdaa17 100644
f325b2
--- a/cui/source/tabpages/tabarea.cxx
f325b2
+++ b/cui/source/tabpages/tabarea.cxx
f325b2
@@ -142,7 +142,14 @@ void SvxAreaTabDialog::SavePalettes()
f325b2
 
f325b2
     // save the tables when they have been changed
f325b2
 
f325b2
-    const OUString aPath( SvtPathOptions().GetPalettePath() );
f325b2
+    OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+    OUString aPath;
f325b2
+    sal_Int32 nIndex = 0;
f325b2
+    do
f325b2
+    {
f325b2
+        aPath = aPalettePath.getToken(0, ';', nIndex);
f325b2
+    }
f325b2
+    while (nIndex >= 0);
f325b2
 
f325b2
     if( mnHatchingListState & ChangeType::MODIFIED )
f325b2
     {
f325b2
diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx
f325b2
index aa99b2c..6049c8c 100644
f325b2
--- a/cui/source/tabpages/tabline.cxx
f325b2
+++ b/cui/source/tabpages/tabline.cxx
f325b2
@@ -130,8 +130,14 @@ void SvxLineTabDialog::SavePalettes()
f325b2
     }
f325b2
 
f325b2
     // Save the tables when they have been changed
f325b2
-
f325b2
-    const OUString aPath( SvtPathOptions().GetPalettePath() );
f325b2
+    OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+    OUString aPath;
f325b2
+    sal_Int32 nIndex = 0;
f325b2
+    do
f325b2
+    {
f325b2
+        aPath = aPalettePath.getToken(0, ';', nIndex);
f325b2
+    }
f325b2
+    while (nIndex >= 0);
f325b2
 
f325b2
     if( nDashListState & ChangeType::MODIFIED )
f325b2
     {
f325b2
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
f325b2
index 0d11116..71c23e6 100644
f325b2
--- a/cui/source/tabpages/tpbitmap.cxx
f325b2
+++ b/cui/source/tabpages/tpbitmap.cxx
f325b2
@@ -795,7 +795,16 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickLoadHdl_Impl)
f325b2
         ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 );
f325b2
         OUString aStrFilterType( "*.sob" );
f325b2
         aDlg.AddFilter( aStrFilterType, aStrFilterType );
f325b2
-        INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+        OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+        OUString aLastDir;
f325b2
+        sal_Int32 nIndex = 0;
f325b2
+        do
f325b2
+        {
f325b2
+            aLastDir = aPalettePath.getToken(0, ';', nIndex);
f325b2
+        }
f325b2
+        while (nIndex >= 0);
f325b2
+
f325b2
+        INetURLObject aFile(aLastDir);
f325b2
         aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
f325b2
 
f325b2
         if ( aDlg.Execute() == ERRCODE_NONE )
f325b2
@@ -875,7 +884,16 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickSaveHdl_Impl)
f325b2
     OUString aStrFilterType( "*.sob" );
f325b2
     aDlg.AddFilter( aStrFilterType, aStrFilterType );
f325b2
 
f325b2
-    INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+    OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+    OUString aLastDir;
f325b2
+    sal_Int32 nIndex = 0;
f325b2
+    do
f325b2
+    {
f325b2
+        aLastDir = aPalettePath.getToken(0, ';', nIndex);
f325b2
+    }
f325b2
+    while (nIndex >= 0);
f325b2
+
f325b2
+    INetURLObject aFile(aLastDir);
f325b2
     DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
f325b2
 
f325b2
     if( !pBitmapList->GetName().isEmpty() )
f325b2
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
f325b2
index 94231c5..50b74de 100644
f325b2
--- a/cui/source/tabpages/tpcolor.cxx
f325b2
+++ b/cui/source/tabpages/tpcolor.cxx
f325b2
@@ -142,7 +142,16 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickLoadHdl_Impl)
f325b2
         OUString aStrFilterType( XPropertyList::GetDefaultExtFilter( meType ) );
f325b2
         aDlg.AddFilter( aStrFilterType, aStrFilterType );
f325b2
 
f325b2
-        INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+        OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+        OUString aLastDir;
f325b2
+        sal_Int32 nIndex = 0;
f325b2
+        do
f325b2
+        {
f325b2
+            aLastDir = aPalettePath.getToken(0, ';', nIndex);
f325b2
+        }
f325b2
+        while (nIndex >= 0);
f325b2
+
f325b2
+        INetURLObject aFile(aLastDir);
f325b2
         aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
f325b2
 
f325b2
         if ( aDlg.Execute() == ERRCODE_NONE )
f325b2
@@ -202,7 +211,16 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickSaveHdl_Impl)
f325b2
     OUString aStrFilterType( XPropertyList::GetDefaultExtFilter( meType ) );
f325b2
     aDlg.AddFilter( aStrFilterType, aStrFilterType );
f325b2
 
f325b2
-    INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+    OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+    OUString aLastDir;
f325b2
+    sal_Int32 nIndex = 0;
f325b2
+    do
f325b2
+    {
f325b2
+        aLastDir = aPalettePath.getToken(0, ';', nIndex);
f325b2
+    }
f325b2
+    while (nIndex >= 0);
f325b2
+
f325b2
+    INetURLObject aFile(aLastDir);
f325b2
     DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
f325b2
 
f325b2
     XPropertyListRef pList = GetList();
f325b2
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
f325b2
index e737410..380f36a 100644
f325b2
--- a/cui/source/tabpages/tpgradnt.cxx
f325b2
+++ b/cui/source/tabpages/tpgradnt.cxx
f325b2
@@ -655,7 +655,16 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickLoadHdl_Impl)
f325b2
         ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 );
f325b2
         OUString aStrFilterType( "*.sog" );
f325b2
         aDlg.AddFilter( aStrFilterType, aStrFilterType );
f325b2
-        INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+        OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+        OUString aLastDir;
f325b2
+        sal_Int32 nIndex = 0;
f325b2
+        do
f325b2
+        {
f325b2
+            aLastDir = aPalettePath.getToken(0, ';', nIndex);
f325b2
+        }
f325b2
+        while (nIndex >= 0);
f325b2
+
f325b2
+        INetURLObject aFile(aLastDir);
f325b2
         aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
f325b2
 
f325b2
         if( aDlg.Execute() == ERRCODE_NONE )
f325b2
@@ -739,7 +748,16 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickSaveHdl_Impl)
f325b2
     OUString aStrFilterType( "*.sog" );
f325b2
     aDlg.AddFilter( aStrFilterType, aStrFilterType );
f325b2
 
f325b2
-    INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+    OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+    OUString aLastDir;
f325b2
+    sal_Int32 nIndex = 0;
f325b2
+    do
f325b2
+    {
f325b2
+        aLastDir = aPalettePath.getToken(0, ';', nIndex);
f325b2
+    }
f325b2
+    while (nIndex >= 0);
f325b2
+
f325b2
+    INetURLObject aFile(aLastDir);
f325b2
     DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
f325b2
 
f325b2
     if( !pGradientList->GetName().isEmpty() )
f325b2
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
f325b2
index bad1e71..0060b36 100644
f325b2
--- a/cui/source/tabpages/tphatch.cxx
f325b2
+++ b/cui/source/tabpages/tphatch.cxx
f325b2
@@ -692,7 +692,16 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickLoadHdl_Impl)
f325b2
         ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,  0 );
f325b2
         OUString aStrFilterType( "*.soh" );
f325b2
         aDlg.AddFilter( aStrFilterType, aStrFilterType );
f325b2
-        INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+        OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+        OUString aLastDir;
f325b2
+        sal_Int32 nIndex = 0;
f325b2
+        do
f325b2
+        {
f325b2
+            aLastDir = aPalettePath.getToken(0, ';', nIndex);
f325b2
+        }
f325b2
+        while (nIndex >= 0);
f325b2
+
f325b2
+        INetURLObject aFile(aLastDir);
f325b2
         aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
f325b2
 
f325b2
         if( aDlg.Execute() == ERRCODE_NONE )
f325b2
@@ -765,7 +774,16 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickSaveHdl_Impl)
f325b2
     OUString aStrFilterType( "*.soh" );
f325b2
     aDlg.AddFilter( aStrFilterType, aStrFilterType );
f325b2
 
f325b2
-    INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+    OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+    OUString aLastDir;
f325b2
+    sal_Int32 nIndex = 0;
f325b2
+    do
f325b2
+    {
f325b2
+        aLastDir = aPalettePath.getToken(0, ';', nIndex);
f325b2
+    }
f325b2
+    while (nIndex >= 0);
f325b2
+
f325b2
+    INetURLObject aFile(aLastDir);
f325b2
     DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
f325b2
 
f325b2
     if( !pHatchingList->GetName().isEmpty() )
f325b2
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
f325b2
index 6694a54..38a7c7f 100644
f325b2
--- a/cui/source/tabpages/tplnedef.cxx
f325b2
+++ b/cui/source/tabpages/tplnedef.cxx
f325b2
@@ -761,7 +761,16 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickLoadHdl_Impl)
f325b2
         ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 );
f325b2
         OUString aStrFilterType( "*.sod" );
f325b2
         aDlg.AddFilter( aStrFilterType, aStrFilterType );
f325b2
-        INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+        OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+        OUString aLastDir;
f325b2
+        sal_Int32 nIndex = 0;
f325b2
+        do
f325b2
+        {
f325b2
+            aLastDir = aPalettePath.getToken(0, ';', nIndex);
f325b2
+        }
f325b2
+        while (nIndex >= 0);
f325b2
+
f325b2
+        INetURLObject aFile(aLastDir);
f325b2
         aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
f325b2
 
f325b2
         if( aDlg.Execute() == ERRCODE_NONE )
f325b2
@@ -821,7 +830,16 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickSaveHdl_Impl)
f325b2
     OUString aStrFilterType( "*.sod" );
f325b2
     aDlg.AddFilter( aStrFilterType, aStrFilterType );
f325b2
 
f325b2
-    INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+    OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+    OUString aLastDir;
f325b2
+    sal_Int32 nIndex = 0;
f325b2
+    do
f325b2
+    {
f325b2
+        aLastDir = aPalettePath.getToken(0, ';', nIndex);
f325b2
+    }
f325b2
+    while (nIndex >= 0);
f325b2
+
f325b2
+    INetURLObject aFile(aLastDir);
f325b2
     DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
f325b2
 
f325b2
     if( !pDashList->GetName().isEmpty() )
f325b2
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
f325b2
index aff55b9..478ab46 100644
f325b2
--- a/cui/source/tabpages/tplneend.cxx
f325b2
+++ b/cui/source/tabpages/tplneend.cxx
f325b2
@@ -573,7 +573,17 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl)
f325b2
         ::sfx2::FileDialogHelper aDlg(com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 );
f325b2
         OUString aStrFilterType( "*.soe" );
f325b2
         aDlg.AddFilter( aStrFilterType, aStrFilterType );
f325b2
-        INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+
f325b2
+        OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+        OUString aLastDir;
f325b2
+        sal_Int32 nIndex = 0;
f325b2
+        do
f325b2
+        {
f325b2
+            aLastDir = aPalettePath.getToken(0, ';', nIndex);
f325b2
+        }
f325b2
+        while (nIndex >= 0);
f325b2
+
f325b2
+        INetURLObject aFile(aLastDir);
f325b2
         aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
f325b2
 
f325b2
         if( aDlg.Execute() == ERRCODE_NONE )
f325b2
@@ -633,7 +643,16 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl)
f325b2
     OUString aStrFilterType( "*.soe" );
f325b2
     aDlg.AddFilter( aStrFilterType, aStrFilterType );
f325b2
 
f325b2
-    INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+    OUString aPalettePath(SvtPathOptions().GetPalettePath());
f325b2
+    OUString aLastDir;
f325b2
+    sal_Int32 nIndex = 0;
f325b2
+    do
f325b2
+    {
f325b2
+        aLastDir = aPalettePath.getToken(0, ';', nIndex);
f325b2
+    }
f325b2
+    while (nIndex >= 0);
f325b2
+
f325b2
+    INetURLObject aFile(aLastDir);
f325b2
     DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
f325b2
 
f325b2
     if( !pLineEndList->GetName().isEmpty() )
f325b2
diff --git a/extras/Package_palettes.mk b/extras/Package_palettes.mk
f325b2
index bc317e2..5cf4c61 100644
f325b2
--- a/extras/Package_palettes.mk
f325b2
+++ b/extras/Package_palettes.mk
f325b2
@@ -9,7 +9,7 @@
f325b2
 
f325b2
 $(eval $(call gb_Package_Package,extras_palettes,$(SRCDIR)/extras/source/palettes))
f325b2
 
f325b2
-$(eval $(call gb_Package_add_files,extras_palettes,$(LIBO_SHARE_PRESETS_FOLDER)/config,\
f325b2
+$(eval $(call gb_Package_add_files,extras_palettes,$(LIBO_SHARE_FOLDER)/palette,\
f325b2
 	arrowhd.soe \
f325b2
 	classic.sog \
f325b2
 	cmyk.soc \
f325b2
diff --git a/offapi/com/sun/star/util/XPathSettings.idl b/offapi/com/sun/star/util/XPathSettings.idl
f325b2
index 5f202a3..d54c122 100644
f325b2
--- a/offapi/com/sun/star/util/XPathSettings.idl
f325b2
+++ b/offapi/com/sun/star/util/XPathSettings.idl
f325b2
@@ -89,7 +89,8 @@ published interface XPathSettings
f325b2
   [attribute] string Module;
f325b2
 
f325b2
   /** This is the path to the palette files *.SOB to *.SOF containing
f325b2
-      user-defined colors and patterns. */
f325b2
+      user-defined colors and patterns. The value can be more than
f325b2
+      one path separated by a semicolon.*/
f325b2
   [attribute] string Palette;
f325b2
 
f325b2
   /** Plugins are saved in these directories. The value can be more than
f325b2
diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
f325b2
index 6d739e6..965a629 100644
f325b2
--- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu
f325b2
+++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
f325b2
@@ -124,6 +124,9 @@
f325b2
       </node>
f325b2
     </node>
f325b2
     <node oor:name="Palette" oor:op="fuse" oor:mandatory="true">
f325b2
+      <node oor:name="InternalPaths">
f325b2
+        <node oor:name="$(insturl)/@LIBO_SHARE_FOLDER@/palette" oor:op="fuse"/>
f325b2
+      </node>
f325b2
       <prop oor:name="WritePath">
f325b2
         <value>$(userurl)/config</value>
f325b2
       </prop>
f325b2
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
f325b2
index 0bc0dc8..8922889 100644
f325b2
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
f325b2
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
f325b2
@@ -1642,12 +1642,15 @@
f325b2
           </info>
f325b2
           <value>$(progpath)</value>
f325b2
         </prop>
f325b2
-        <prop oor:name="Palette" oor:type="xs:string" oor:nillable="false">
f325b2
+        <prop oor:name="Palette" oor:type="oor:string-list" oor:nillable="false">
f325b2
           <info>
f325b2
             <desc>Specifies the path to the palette files *.SOB to *.SOF
f325b2
             containing user-defined colors and patterns.</desc>
f325b2
           </info>
f325b2
-          <value>$(userurl)/config</value>
f325b2
+          <value>
f325b2
+            <it>$(insturl)/@LIBO_SHARE_FOLDER@/palette</it>
f325b2
+            <it>$(userurl)/config</it>
f325b2
+          </value>
f325b2
         </prop>
f325b2
         <prop oor:name="Plugin" oor:type="oor:string-list" oor:nillable="false">
f325b2
           <info>
f325b2
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
f325b2
index d5dcd09..b29ea21 100644
f325b2
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
f325b2
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
f325b2
@@ -480,7 +480,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, FileHdl)
f325b2
     // Read configuration
f325b2
     OUString sUrl(officecfg::Office::Impress::Pictures::Path::get());
f325b2
 
f325b2
-    INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+    INetURLObject aFile( SvtPathOptions().GetUserConfigPath() );
f325b2
     if (!sUrl.isEmpty())
f325b2
         aDlg.SetDisplayDirectory(sUrl);
f325b2
     else
f325b2
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
f325b2
index 7c7e2c4..9570c2b 100644
f325b2
--- a/svx/source/sidebar/nbdtmg.cxx
f325b2
+++ b/svx/source/sidebar/nbdtmg.cxx
f325b2
@@ -157,7 +157,7 @@ void NBOTypeMgrBase::ImplLoad(const OUString& filename)
f325b2
     bIsLoading = true;
f325b2
     SfxMapUnit      eOldCoreUnit=eCoreUnit;
f325b2
     eCoreUnit = SFX_MAPUNIT_100TH_MM;
f325b2
-    INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+    INetURLObject aFile( SvtPathOptions().GetUserConfigPath() );
f325b2
     aFile.Append( filename);
f325b2
     std::unique_ptr<SvStream> xIStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ));
f325b2
     if( xIStm ) {
f325b2
@@ -196,7 +196,7 @@ void NBOTypeMgrBase::ImplStore(const OUString& filename)
f325b2
     if (bIsLoading) return;
f325b2
     SfxMapUnit      eOldCoreUnit=eCoreUnit;
f325b2
     eCoreUnit = SFX_MAPUNIT_100TH_MM;
f325b2
-    INetURLObject aFile( SvtPathOptions().GetPalettePath() );
f325b2
+    INetURLObject aFile( SvtPathOptions().GetUserConfigPath() );
f325b2
     aFile.Append( filename);
f325b2
     std::unique_ptr<SvStream> xOStm(::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::WRITE ));
f325b2
     if( xOStm ) {
f325b2
diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx
f325b2
index 109f934..3334afc 100644
f325b2
--- a/svx/source/tbxctrls/PaletteManager.cxx
f325b2
+++ b/svx/source/tbxctrls/PaletteManager.cxx
f325b2
@@ -27,6 +27,8 @@
f325b2
 #include <svtools/colrdlg.hxx>
f325b2
 #include <vcl/svapp.hxx>
f325b2
 #include <vcl/settings.hxx>
f325b2
+#include <stack>
f325b2
+#include <set>
f325b2
 
f325b2
 PaletteManager::PaletteManager() :
f325b2
     mnMaxRecentColors(Application::GetSettings().GetStyleSettings().GetColorValueSetColumnCount()),
f325b2
@@ -47,31 +49,52 @@ PaletteManager::~PaletteManager()
f325b2
 void PaletteManager::LoadPalettes()
f325b2
 {
f325b2
     maPalettes.clear();
f325b2
-    OUString aPalPath = SvtPathOptions().GetPalettePath();
f325b2
-
f325b2
-    osl::Directory aDir(aPalPath);
f325b2
-    osl::DirectoryItem aDirItem;
f325b2
-    osl::FileStatus aFileStat( osl_FileStatus_Mask_FileName |
f325b2
-                               osl_FileStatus_Mask_FileURL  |
f325b2
-                               osl_FileStatus_Mask_Type     );
f325b2
-    if( aDir.open() == osl::FileBase::E_None )
f325b2
+    OUString aPalPaths = SvtPathOptions().GetPalettePath();
f325b2
+
f325b2
+    std::stack<OUString> aDirs;
f325b2
+    sal_Int32 nIndex = 0;
f325b2
+    do
f325b2
+    {
f325b2
+        aDirs.push(aPalPaths.getToken(0, ';', nIndex));
f325b2
+    }
f325b2
+    while (nIndex >= 0);
f325b2
+
f325b2
+    std::set<OUString> aNames;
f325b2
+    //try all entries palette path list user first, then
f325b2
+    //system, ignoring duplicate file names
f325b2
+    while (!aDirs.empty())
f325b2
     {
f325b2
-        while( aDir.getNextItem(aDirItem) == osl::FileBase::E_None )
f325b2
+        OUString aPalPath = aDirs.top();
f325b2
+        aDirs.pop();
f325b2
+
f325b2
+        osl::Directory aDir(aPalPath);
f325b2
+        osl::DirectoryItem aDirItem;
f325b2
+        osl::FileStatus aFileStat( osl_FileStatus_Mask_FileName |
f325b2
+                                   osl_FileStatus_Mask_FileURL  |
f325b2
+                                   osl_FileStatus_Mask_Type     );
f325b2
+        if( aDir.open() == osl::FileBase::E_None )
f325b2
         {
f325b2
-            aDirItem.getFileStatus(aFileStat);
f325b2
-            if(aFileStat.isRegular() || aFileStat.isLink())
f325b2
+            while( aDir.getNextItem(aDirItem) == osl::FileBase::E_None )
f325b2
             {
f325b2
-                OUString aFName = aFileStat.getFileName();
f325b2
-                Palette* pPalette = 0;
f325b2
-                if( aFName.endsWithIgnoreAsciiCase(".gpl") )
f325b2
-                    pPalette = new PaletteGPL( aFileStat.getFileURL(), aFName );
f325b2
-                else if( aFName.endsWithIgnoreAsciiCase(".soc") )
f325b2
-                    pPalette = new PaletteSOC( aFileStat.getFileURL(), aFName );
f325b2
-                else if ( aFName.endsWithIgnoreAsciiCase(".ase") )
f325b2
-                    pPalette = new PaletteASE( aFileStat.getFileURL(), aFName );
f325b2
-
f325b2
-                if( pPalette && pPalette->IsValid() )
f325b2
-                    maPalettes.push_back( pPalette );
f325b2
+                aDirItem.getFileStatus(aFileStat);
f325b2
+                if(aFileStat.isRegular() || aFileStat.isLink())
f325b2
+                {
f325b2
+                    OUString aFName = aFileStat.getFileName();
f325b2
+                    if (aNames.find(aFName) == aNames.end())
f325b2
+                    {
f325b2
+                        Palette* pPalette = 0;
f325b2
+                        if( aFName.endsWithIgnoreAsciiCase(".gpl") )
f325b2
+                            pPalette = new PaletteGPL( aFileStat.getFileURL(), aFName );
f325b2
+                        else if( aFName.endsWithIgnoreAsciiCase(".soc") )
f325b2
+                            pPalette = new PaletteSOC( aFileStat.getFileURL(), aFName );
f325b2
+                        else if ( aFName.endsWithIgnoreAsciiCase(".ase") )
f325b2
+                            pPalette = new PaletteASE( aFileStat.getFileURL(), aFName );
f325b2
+
f325b2
+                        if( pPalette && pPalette->IsValid() )
f325b2
+                            maPalettes.push_back( pPalette );
f325b2
+                        aNames.insert(aFName);
f325b2
+                    }
f325b2
+                }
f325b2
             }
f325b2
         }
f325b2
     }
f325b2
diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx
f325b2
index 5e35be9..b3f1416d 100644
f325b2
--- a/svx/source/xoutdev/xtable.cxx
f325b2
+++ b/svx/source/xoutdev/xtable.cxx
f325b2
@@ -25,6 +25,7 @@
f325b2
 #include <svx/xpool.hxx>
f325b2
 #include <svx/svdobj.hxx>
f325b2
 #include <svx/svdpool.hxx>
f325b2
+#include <stack>
f325b2
 
f325b2
 using namespace com::sun::star;
f325b2
 
f325b2
@@ -224,23 +225,41 @@ bool XPropertyList::Load()
f325b2
     if( mbListDirty )
f325b2
     {
f325b2
         mbListDirty = false;
f325b2
+        std::stack<OUString> aDirs;
f325b2
 
f325b2
-        INetURLObject aURL( maPath );
f325b2
-
f325b2
-        if( INetProtocol::NotValid == aURL.GetProtocol() )
f325b2
+        sal_Int32 nIndex = 0;
f325b2
+        do
f325b2
         {
f325b2
-            DBG_ASSERT( maPath.isEmpty(), "invalid URL" );
f325b2
-            return false;
f325b2
+            aDirs.push(maPath.getToken(0, ';', nIndex));
f325b2
         }
f325b2
+        while (nIndex >= 0);
f325b2
+
f325b2
+        //try all entries palette path list working back to front until one
f325b2
+        //succeeds
f325b2
+        while (!aDirs.empty())
f325b2
+        {
f325b2
+            OUString aPath(aDirs.top());
f325b2
+            aDirs.pop();
f325b2
+
f325b2
+            INetURLObject aURL(aPath);
f325b2
+
f325b2
+            if( INetProtocol::NotValid == aURL.GetProtocol() )
f325b2
+            {
f325b2
+                DBG_ASSERT( aPath.isEmpty(), "invalid URL" );
f325b2
+                return false;
f325b2
+            }
f325b2
 
f325b2
-        aURL.Append( maName );
f325b2
+            aURL.Append( maName );
f325b2
 
f325b2
-        if( aURL.getExtension().isEmpty() )
f325b2
-            aURL.setExtension( GetDefaultExt() );
f325b2
+            if( aURL.getExtension().isEmpty() )
f325b2
+                aURL.setExtension( GetDefaultExt() );
f325b2
 
f325b2
-        return SvxXMLXTableImport::load( aURL.GetMainURL( INetURLObject::NO_DECODE ), maReferer,
f325b2
-                                         uno::Reference < embed::XStorage >(),
f325b2
-                                         createInstance(), NULL );
f325b2
+            bool bRet = SvxXMLXTableImport::load(aURL.GetMainURL(INetURLObject::NO_DECODE),
f325b2
+                                             maReferer, uno::Reference < embed::XStorage >(),
f325b2
+                                             createInstance(), NULL );
f325b2
+            if (bRet)
f325b2
+                return bRet;
f325b2
+        }
f325b2
     }
f325b2
     return false;
f325b2
 }
f325b2
@@ -256,11 +275,20 @@ bool XPropertyList::LoadFrom( const uno::Reference < embed::XStorage > &xStorage
f325b2
 
f325b2
 bool XPropertyList::Save()
f325b2
 {
f325b2
-    INetURLObject aURL( maPath );
f325b2
+    //save to the last path in the palette path list
f325b2
+    OUString aLastDir;
f325b2
+    sal_Int32 nIndex = 0;
f325b2
+    do
f325b2
+    {
f325b2
+        aLastDir = maPath.getToken(0, ';', nIndex);
f325b2
+    }
f325b2
+    while (nIndex >= 0);
f325b2
+
f325b2
+    INetURLObject aURL(aLastDir);
f325b2
 
f325b2
     if( INetProtocol::NotValid == aURL.GetProtocol() )
f325b2
     {
f325b2
-        DBG_ASSERT( maPath.isEmpty(), "invalid URL" );
f325b2
+        DBG_ASSERT( aLastDir.isEmpty(), "invalid URL" );
f325b2
         return false;
f325b2
     }
f325b2
 
f325b2
-- 
f325b2
2.4.0
f325b2