diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2025-01-28 01:37:07 +0100 |
---|---|---|
committer | Balazs Varga <balazs.varga.extern@allotropia.de> | 2025-01-28 09:33:26 +0100 |
commit | 4354919a9e5bea6182b23c7fbc93ce082111a44c (patch) | |
tree | 3c75dd47474dc5fd1f5ca1a7e7502a0cf24d62c5 | |
parent | eabe32cb1822f1150abdb4c44a9ca19d551c2ecf (diff) |
tdf#164855 sd - fix crash while centering table contents
regression from: 1d9ce0a67a71e51569cd33c26270eeece587a354
(tdf#162571 - sd: Text box expands or shrinks on left or right...)
Change-Id: I75425dc15f40a32c353284f0a1338e117b8db018
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180809
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Tested-by: Jenkins
-rw-r--r-- | sd/source/ui/view/drtxtob1.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index b0fbe31bc984..370fa9dffb06 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -616,14 +616,17 @@ SET_ADJUST: { aNewAttr.Put(SvxAdjustItem(eAdjst, EE_PARA_JUST)); // set anchor - ESelection aSel = pOLV->GetSelection(); - aSel.Adjust(); - sal_Int32 nStartPara = aSel.start.nPara; - if (!aSel.HasRange()) - nStartPara = 0; - - if (nStartPara == 0) - aNewAttr.Put(SdrTextHorzAdjustItem(eAnchor)); + if (pOLV) + { + ESelection aSel = pOLV->GetSelection(); + aSel.Adjust(); + sal_Int32 nStartPara = aSel.start.nPara; + if (!aSel.HasRange()) + nStartPara = 0; + + if (nStartPara == 0) + aNewAttr.Put(SdrTextHorzAdjustItem(eAnchor)); + } } break; |