diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-06-06 14:24:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-06-07 15:39:22 +0100 |
commit | 29202a16d9f1934684c7d0978112849f2a21fe2f (patch) | |
tree | f72219d0804dd6ba45e0f1e5b02603be5ef5d5c3 /cui | |
parent | 2c3bf6bfc244517a0134e320acaa1f720703d8f2 (diff) |
Resolves: tdf#89905 don't copy palettes from shared to user
make this a multi-path element with a shared read-only location
and a user read/write location and don't copy the presets, instead
just keep them in the shared location
Now an admin can copy extra palettes into the shared location
and they magically appear in the user deployments
Change-Id: I7585789c0c59941094f6128368df94b834d3c2a2
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/tabarea.cxx | 9 | ||||
-rw-r--r-- | cui/source/tabpages/tabline.cxx | 10 | ||||
-rw-r--r-- | cui/source/tabpages/tpbitmap.cxx | 22 | ||||
-rw-r--r-- | cui/source/tabpages/tpcolor.cxx | 22 | ||||
-rw-r--r-- | cui/source/tabpages/tpgradnt.cxx | 22 | ||||
-rw-r--r-- | cui/source/tabpages/tphatch.cxx | 22 | ||||
-rw-r--r-- | cui/source/tabpages/tplnedef.cxx | 22 | ||||
-rw-r--r-- | cui/source/tabpages/tplneend.cxx | 23 |
8 files changed, 137 insertions, 15 deletions
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx index 7ecc83618bbd..1bdaa179baf2 100644 --- a/cui/source/tabpages/tabarea.cxx +++ b/cui/source/tabpages/tabarea.cxx @@ -142,7 +142,14 @@ void SvxAreaTabDialog::SavePalettes() // save the tables when they have been changed - const OUString aPath( SvtPathOptions().GetPalettePath() ); + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aPath; + sal_Int32 nIndex = 0; + do + { + aPath = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); if( mnHatchingListState & ChangeType::MODIFIED ) { diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx index aa99b2cd447b..6049c8cdd1df 100644 --- a/cui/source/tabpages/tabline.cxx +++ b/cui/source/tabpages/tabline.cxx @@ -130,8 +130,14 @@ void SvxLineTabDialog::SavePalettes() } // Save the tables when they have been changed - - const OUString aPath( SvtPathOptions().GetPalettePath() ); + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aPath; + sal_Int32 nIndex = 0; + do + { + aPath = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); if( nDashListState & ChangeType::MODIFIED ) { diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index 0d11116b9533..71c23e614918 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -795,7 +795,16 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickLoadHdl_Impl) ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); OUString aStrFilterType( "*.sob" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aLastDir; + sal_Int32 nIndex = 0; + do + { + aLastDir = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); + + INetURLObject aFile(aLastDir); aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); if ( aDlg.Execute() == ERRCODE_NONE ) @@ -875,7 +884,16 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickSaveHdl_Impl) OUString aStrFilterType( "*.sob" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aLastDir; + sal_Int32 nIndex = 0; + do + { + aLastDir = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); + + INetURLObject aFile(aLastDir); DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); if( !pBitmapList->GetName().isEmpty() ) diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index 94231c5f0f32..50b74de0b673 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -142,7 +142,16 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickLoadHdl_Impl) OUString aStrFilterType( XPropertyList::GetDefaultExtFilter( meType ) ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aLastDir; + sal_Int32 nIndex = 0; + do + { + aLastDir = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); + + INetURLObject aFile(aLastDir); aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); if ( aDlg.Execute() == ERRCODE_NONE ) @@ -202,7 +211,16 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickSaveHdl_Impl) OUString aStrFilterType( XPropertyList::GetDefaultExtFilter( meType ) ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aLastDir; + sal_Int32 nIndex = 0; + do + { + aLastDir = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); + + INetURLObject aFile(aLastDir); DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); XPropertyListRef pList = GetList(); diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index e737410c36cb..380f36a625ea 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -655,7 +655,16 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickLoadHdl_Impl) ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); OUString aStrFilterType( "*.sog" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aLastDir; + sal_Int32 nIndex = 0; + do + { + aLastDir = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); + + INetURLObject aFile(aLastDir); aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); if( aDlg.Execute() == ERRCODE_NONE ) @@ -739,7 +748,16 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickSaveHdl_Impl) OUString aStrFilterType( "*.sog" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aLastDir; + sal_Int32 nIndex = 0; + do + { + aLastDir = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); + + INetURLObject aFile(aLastDir); DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); if( !pGradientList->GetName().isEmpty() ) diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index bad1e714cbf6..0060b36d848e 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -692,7 +692,16 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickLoadHdl_Impl) ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); OUString aStrFilterType( "*.soh" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aLastDir; + sal_Int32 nIndex = 0; + do + { + aLastDir = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); + + INetURLObject aFile(aLastDir); aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); if( aDlg.Execute() == ERRCODE_NONE ) @@ -765,7 +774,16 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickSaveHdl_Impl) OUString aStrFilterType( "*.soh" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aLastDir; + sal_Int32 nIndex = 0; + do + { + aLastDir = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); + + INetURLObject aFile(aLastDir); DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); if( !pHatchingList->GetName().isEmpty() ) diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx index 6694a549ce5a..38a7c7f246be 100644 --- a/cui/source/tabpages/tplnedef.cxx +++ b/cui/source/tabpages/tplnedef.cxx @@ -761,7 +761,16 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickLoadHdl_Impl) ::sfx2::FileDialogHelper aDlg( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); OUString aStrFilterType( "*.sod" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aLastDir; + sal_Int32 nIndex = 0; + do + { + aLastDir = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); + + INetURLObject aFile(aLastDir); aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); if( aDlg.Execute() == ERRCODE_NONE ) @@ -821,7 +830,16 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickSaveHdl_Impl) OUString aStrFilterType( "*.sod" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aLastDir; + sal_Int32 nIndex = 0; + do + { + aLastDir = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); + + INetURLObject aFile(aLastDir); DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); if( !pDashList->GetName().isEmpty() ) diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index aff55b93eefa..478ab46c529b 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -573,7 +573,17 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl) ::sfx2::FileDialogHelper aDlg(com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); OUString aStrFilterType( "*.soe" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); + + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aLastDir; + sal_Int32 nIndex = 0; + do + { + aLastDir = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); + + INetURLObject aFile(aLastDir); aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); if( aDlg.Execute() == ERRCODE_NONE ) @@ -633,7 +643,16 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl) OUString aStrFilterType( "*.soe" ); aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); + OUString aPalettePath(SvtPathOptions().GetPalettePath()); + OUString aLastDir; + sal_Int32 nIndex = 0; + do + { + aLastDir = aPalettePath.getToken(0, ';', nIndex); + } + while (nIndex >= 0); + + INetURLObject aFile(aLastDir); DBG_ASSERT( aFile.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); if( !pLineEndList->GetName().isEmpty() ) |