[Libreoffice-commits] core.git: sd/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 8 15:41:33 UTC 2021


 sd/source/ui/view/drviewsj.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 36e1f1f5e7da5563ba721874e15a92b874ae1c5f
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 8 14:15:12 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jul 8 17:40:58 2021 +0200

    Resolves: tdf#143153 null-deref on grouping fit-to-frame obj with another
    
    Change-Id: I134d15ac980aa34ff274abd03966cd7948390542
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118642
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx
index 47cbb175ddf4..9eebdbc57c29 100644
--- a/sd/source/ui/view/drviewsj.cxx
+++ b/sd/source/ui/view/drviewsj.cxx
@@ -271,7 +271,8 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
         if( SfxItemState::DEFAULT == rSet.GetItemState( SID_OUTLINE_TEXT_AUTOFIT ) )
         {
             const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-            const bool bSet = pObj->GetMergedItemSet().GetItem<SdrTextFitToSizeTypeItem>(SDRATTR_TEXT_FITTOSIZE)->GetValue() != drawing::TextFitToSizeType_NONE;
+            const SdrTextFitToSizeTypeItem* pItem = pObj->GetMergedItemSet().GetItem<SdrTextFitToSizeTypeItem>(SDRATTR_TEXT_FITTOSIZE);
+            const bool bSet = pItem && pItem->GetValue() != drawing::TextFitToSizeType_NONE;
             rSet.Put(SfxBoolItem(SID_OUTLINE_TEXT_AUTOFIT, bSet));
         }
 


More information about the Libreoffice-commits mailing list