[Libreoffice-commits] core.git: Branch 'libreoffice-5-3-1' - svx/source

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Mar 1 13:03:11 UTC 2017


 svx/source/tbxctrls/PaletteManager.cxx |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 9b4c2e40ac081e1f8834b1d831b393917fb19df5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Feb 24 18:08:39 2017 +0100

    prevent crash in PaletteManager
    
    Found by the crashreporter:
    http://crashreport.libreoffice.org/stats/signature/PaletteManager::ReloadColorSet(SvxColorValueSet%20&)
    
    Change-Id: I82c5e3f7588615700ec3b5540ac94e331df783bb
    Reviewed-on: https://gerrit.libreoffice.org/34627
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit ece3c97ca6c9aaffbf9dd51785ae2f1d4d3e2c9b)
    Reviewed-on: https://gerrit.libreoffice.org/34634
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 5b76c743488b1e206cfe40a5ed087b3a0ceaa1d8)
    Reviewed-on: https://gerrit.libreoffice.org/34720
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx
index 1dc3a46..bdd9701 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
     {


More information about the Libreoffice-commits mailing list