diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-08-30 08:34:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-08-30 11:23:35 +0200 |
commit | f9d2326fe5264a079dde623d99c20195a029fbbe (patch) | |
tree | b9ecb394a32059ef11fb8a53ceaef63eb536ab36 /svx/source/sdr | |
parent | bf878dd7c8aabd975f7ba99daba3fa9e959d1d2c (diff) |
cid#1618704 Dereference after null check
and
cid#1618705 Dereference after null check
cid#1618707 Dereference after null check
Change-Id: I942a9d67d127fa965730a5c38ea8e71397397e0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172631
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'svx/source/sdr')
-rw-r--r-- | svx/source/sdr/primitive2d/sdrattributecreator.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 06dabd314649..f1628354283d 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -207,7 +207,7 @@ namespace drawinglayer return glowAttr; } - attribute::SdrGlowTextAttribute createNewSdrGlowTextAttribute(const SfxItemSet& rSet, const SdrTextObj& rTextObj) + attribute::SdrGlowTextAttribute createNewSdrGlowTextAttribute(const SfxItemSet& rSet, const OutlinerParaObject* pOutliner) { sal_Int32 nTextRadius = rSet.Get(SDRATTR_GLOW_TEXT_RADIUS).GetValue(); @@ -226,9 +226,9 @@ namespace drawinglayer if (const SvxFontHeightItem* pItem = rSet.GetItemIfSet(EE_CHAR_FONTHEIGHT)) nFontSize = pItem->GetHeight(); - if (rTextObj.GetOutlinerParaObject()) + if (pOutliner) { - const EditTextObject& aEdit = rTextObj.GetOutlinerParaObject()->GetTextObject(); + const EditTextObject& aEdit = pOutliner->GetTextObject(); for (sal_Int32 i = 0; i < aEdit.GetParagraphCount(); i++) { std::vector<EECharAttrib> aAttribs; @@ -808,7 +808,8 @@ namespace drawinglayer::primitive2d // try shadow const attribute::SdrShadowAttribute aShadow(createNewSdrShadowAttribute(rSet)); const attribute::SdrGlowAttribute aGlow(createNewSdrGlowAttribute(rSet)); - const attribute::SdrGlowTextAttribute aGlowText(createNewSdrGlowTextAttribute(rSet, pText->GetObject())); + const OutlinerParaObject* pOutliner = pText ? pText->GetObject().GetOutlinerParaObject() : nullptr; + const attribute::SdrGlowTextAttribute aGlowText(createNewSdrGlowTextAttribute(rSet, pOutliner)); const sal_Int32 nSoftEdgeRadius(getSoftEdgeRadius(rSet)); return attribute::SdrEffectsTextAttribute(aShadow, std::move(aText), @@ -856,7 +857,8 @@ namespace drawinglayer::primitive2d // try shadow attribute::SdrShadowAttribute aShadow(createNewSdrShadowAttribute(rSet)); attribute::SdrGlowAttribute aGlow = createNewSdrGlowAttribute(rSet); - attribute::SdrGlowTextAttribute aGlowText = createNewSdrGlowTextAttribute(rSet, pText->GetObject()); + const OutlinerParaObject* pOutliner = pText ? pText->GetObject().GetOutlinerParaObject() : nullptr; + attribute::SdrGlowTextAttribute aGlowText = createNewSdrGlowTextAttribute(rSet, pOutliner); const sal_Int32 nSoftEdgeRadius(getSoftEdgeRadius(rSet)); return attribute::SdrLineEffectsTextAttribute(std::move(aLine), @@ -931,7 +933,8 @@ namespace drawinglayer::primitive2d const attribute::SdrGlowAttribute aGlow = createNewSdrGlowAttribute(rSet); // text glow - const attribute::SdrGlowTextAttribute aGlowText = createNewSdrGlowTextAttribute(rSet, pText->GetObject()); + const OutlinerParaObject* pOutliner = pText ? pText->GetObject().GetOutlinerParaObject() : nullptr; + const attribute::SdrGlowTextAttribute aGlowText = createNewSdrGlowTextAttribute(rSet, pOutliner); const sal_Int32 nSoftEdgeRadius(getSoftEdgeRadius(rSet)); |