sw/source/core/table/swtable.cxx |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 6104df6e8be61e25361ff6f8bb8505a6d60e3dd3
Author:     Michael Weghorn <[email protected]>
AuthorDate: Wed Mar 4 11:55:47 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Wed Mar 4 14:58:12 2026 +0100

    sw: Only convert sal_uInt16 to string when used
    
    `sTmp` is unused in the `if` branch, so only
    do the sal_uInt16 -> OUString conversion for the
    case where it's actually used.
    
    Change-Id: I151ab00816c8d6f7a351d7565e4986b9b2456263
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200942
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 0e47cfa9a590..58ecc0896bdb 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2258,12 +2258,16 @@ OUString SwTableBox::GetName() const
             sNm = sTmp;
 
         nPos = pBox->GetUpper()->GetBoxPos( pBox );
-        sTmp = OUString::number(nPos + 1);
         pBox = pLine->GetUpper();
-        if( nullptr != pBox )
+        if (pBox)
+        {
+            sTmp = OUString::number(nPos + 1);
             sNm = sTmp + "." + sNm;
+        }
         else
+        {
             sNm = sw_GetTableBoxColStr(nPos) + sNm;
+        }
 
     } while( pBox );
     return sNm;
commit 4b8d43632426f7a8adbdb291690cb62a2783b057
Author:     Michael Weghorn <[email protected]>
AuthorDate: Wed Mar 4 11:23:13 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Wed Mar 4 14:58:05 2026 +0100

    sw: Use ref instead of pointer for local var
    
    Change-Id: I8e4070e0eae5fb8fb4a0ad9b171693ca44f3f7c9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200941
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 313d597408e2..0e47cfa9a590 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2223,10 +2223,10 @@ Point SwTableBox::GetCoordinates() const
     do {
         const SwTableLine* pLine = pBox->GetUpper();
         // at the first level?
-        const SwTableLines* pLines = pLine->GetUpper()
-                ? &pLine->GetUpper()->GetTabLines() : &rTable.GetTabLines();
+        const SwTableLines& rLines
+            = pLine->GetUpper() ? pLine->GetUpper()->GetTabLines() : 
rTable.GetTabLines();
 
-        nY = pLines->GetPos( pLine ) + 1 ;
+        nY = rLines.GetPos(pLine) + 1;
         nX = pBox->GetUpper()->GetBoxPos( pBox ) + 1;
         pBox = pLine->GetUpper();
     } while( pBox );

Reply via email to