diff options
Diffstat (limited to 'svx/source/tbxctrls/PaletteManager.cxx')
-rw-r--r-- | svx/source/tbxctrls/PaletteManager.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index 1dc3a46ac7b7..bdd97018135e 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -120,8 +120,6 @@ void PaletteManager::LoadPalettes() void PaletteManager::ReloadColorSet(SvxColorValueSet &rColorSet) { - SfxObjectShell* pDocSh = SfxObjectShell::Current(); - if( mnCurrentPalette == 0) { rColorSet.Clear(); @@ -138,10 +136,14 @@ void PaletteManager::ReloadColorSet(SvxColorValueSet &rColorSet) else if( mnCurrentPalette == mnNumOfPalettes - 1 ) { // Add doc colors to palette - std::set<Color> aColors = pDocSh->GetDocColors(); - mnColorCount = aColors.size(); - rColorSet.Clear(); - rColorSet.addEntriesForColorSet(aColors, SVX_RESSTR( RID_SVXSTR_DOC_COLOR_PREFIX ) + " " ); + SfxObjectShell* pDocSh = SfxObjectShell::Current(); + if (pDocSh) + { + std::set<Color> aColors = pDocSh->GetDocColors(); + mnColorCount = aColors.size(); + rColorSet.Clear(); + rColorSet.addEntriesForColorSet(aColors, SVX_RESSTR( RID_SVXSTR_DOC_COLOR_PREFIX ) + " " ); + } } else { |