sd/source/ui/view/drtxtob1.cxx |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit a2309c06c6e9205b837387335a76af6533826e8a
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Tue Jan 28 01:37:07 2025 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Jan 28 11:18:01 2025 +0100

    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.ext...@allotropia.de>
    Tested-by: Jenkins
    (cherry picked from commit 4354919a9e5bea6182b23c7fbc93ce082111a44c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180814
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index c4763de8dd3f..f6a0762835bf 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;
 

Reply via email to