summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/Palette.cxx
diff options
context:
space:
mode:
authorKrisztian Pinter <pin.terminator@gmail.com>2014-07-31 10:56:58 +0200
committerKrisztian Pinter <pin.terminator@gmail.com>2014-07-31 10:56:58 +0200
commit771b951a806d956c2ae2dc7b64cb6e15f4839630 (patch)
tree595ba6dae1ddba5739ad75b96cd58b6830c9acba /svx/source/tbxctrls/Palette.cxx
parentd1cd50957750a534d6ec1ba8a21bca1e3b8fe931 (diff)
Make .soc loading lazy
Change-Id: If7475d6c46faaa6f6f6cde494990e6573b3aadff
Diffstat (limited to 'svx/source/tbxctrls/Palette.cxx')
-rw-r--r--svx/source/tbxctrls/Palette.cxx19
1 files changed, 13 insertions, 6 deletions
diff --git a/svx/source/tbxctrls/Palette.cxx b/svx/source/tbxctrls/Palette.cxx
index 95ebb589735c..496e0fcc678e 100644
--- a/svx/source/tbxctrls/Palette.cxx
+++ b/svx/source/tbxctrls/Palette.cxx
@@ -173,11 +173,11 @@ OString lcl_getToken(const OString& rStr, sal_Int32& index)
// PaletteSOC ------------------------------------------------------------------
-PaletteSOC::PaletteSOC( const OUString &rFPath, const OUString &rFName )
+PaletteSOC::PaletteSOC( const OUString &rFPath, const OUString &rFName ) :
+ mbLoadedPalette( false ),
+ maFPath( rFPath ),
+ maName( rFName )
{
- maName = rFName;
- mpColorList = XPropertyList::AsColorList(XPropertyList::CreatePropertyListFromURL(XCOLOR_LIST, rFPath));
- mpColorList->Load();
}
PaletteSOC::~PaletteSOC()
@@ -191,13 +191,20 @@ const OUString& PaletteSOC::GetName()
void PaletteSOC::LoadColorSet( SvxColorValueSet& rColorSet )
{
+ if( !mbLoadedPalette )
+ {
+ mbLoadedPalette = true;
+ mpColorList = XPropertyList::AsColorList(XPropertyList::CreatePropertyListFromURL(XCOLOR_LIST, maFPath));
+ mpColorList->Load();
+ }
rColorSet.Clear();
- rColorSet.addEntriesForXColorList( *mpColorList );
+ if( mpColorList.is() )
+ rColorSet.addEntriesForXColorList( *mpColorList );
}
bool PaletteSOC::IsValid()
{
- return mpColorList.is();
+ return true;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */