sc/source/core/data/column3.cxx  |   62 ++++++++++++++++++---------------------
 sw/source/core/fields/reffld.cxx |    4 +-
 2 files changed, 32 insertions(+), 34 deletions(-)

New commits:
commit d43e4cf2fdcc01e626174c3fe8aa11d538351e52
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Dec 17 09:50:48 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Dec 17 11:12:06 2024 +0100

    sw: fix log messages
    
    After
    commit 285b66443303b8e240a6af48adb1f58bf4f8644e
    Author: Noel Grandin <noel.gran...@collabora.co.uk>
    Date:   Wed Dec 4 15:57:14 2024 +0200
    
        split up SwGetRefFieldType::FindAnchor method
    
    and
    commit 75d734698347565253571978fd585f1681229a97
    Author: Noel Grandin <noel.gran...@collabora.co.uk>
    Date:   Wed Dec 4 16:14:35 2024 +0200
    
        split up SwGetRefFieldType::FindAnchor method some more
    
    Change-Id: I77fb86a384f53c74586bc05e4cb3bcbebf225acf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178641
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 56b819c3d8dc..3229764e1495 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -1484,7 +1484,7 @@ SwTextNode* SwGetRefFieldType::FindAnchorRefStyle(SwDoc* 
pDoc, const OUString& r
                                           pStt, pEnd, pSelf, pReference, 
styleName);
             break;
         default:
-            OSL_FAIL("<SwGetRefFieldType::FindAnchor(..)> - unknown getref 
element type");
+            OSL_FAIL("<SwGetRefFieldType::FindAnchorRefStyle(..)> - unknown 
getref element type");
     }
     return pTextNd;
 }
@@ -1505,7 +1505,7 @@ SwTextNode* 
SwGetRefFieldType::FindAnchorRefStyleMarginal(SwDoc* pDoc,
     Point aPt;
     std::pair<Point, bool> const tmp(aPt, false);
 
-    if (!pContentFrame) SAL_WARN("xmloff.text", 
"<SwGetRefFieldType::FindAnchor(..)>: Missing content frame for marginal 
styleref");
+    if (!pContentFrame) SAL_WARN("xmloff.text", 
"<SwGetRefFieldType::FindAnchorRefStyleMarginal(..)>: Missing content frame for 
marginal styleref");
     const SwPageFrame* pPageFrame = nullptr;
 
     if (pContentFrame)
commit 85b7a25135eb96919d62a108fea18eab5531a4da
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon Dec 16 23:03:22 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Dec 17 11:11:58 2024 +0100

    sc: Dereference after null check
    
    
C:/cygwin64/home/tdf/jenkins/workspace/gerrit_windows/sc/source/core/data/column3.cxx(2821):
 error C2220: the following warning is treated as an error
    C:    make[1]: *** 
[C:/cygwin64/home/tdf/jenkins/workspace/gerrit_windows/solenv/gbuild/LinkTarget.mk:339:
 
C:/cygwin64/home/tdf/jenkins/workspace/gerrit_windows/workdir/CxxObject/sc/source/core/data/column3.o]
 Error 2
    
    After
    commit 2c613da01d02d45a140b94b391a142aede46e8b8
    Author: Noel Grandin <noel.gran...@collabora.co.uk>
    Date:   Wed Dec 4 11:20:01 2024 +0200
    
        tdf#163010 inline and cache rDoc.GetCondFormat call
    
    Change-Id: If9093d5b43ae63e059b3f0597c85b326599e9ed0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178621
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 7c2cd876f906..8d9a4e9731b2 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2731,7 +2731,6 @@ void ScColumn::GetBackColorFilterEntries(SCROW nRow1, 
SCROW nRow2, ScFilterEntri
     ScRefCellValue aPrevCellValue;
     Color aPrevPatternColor;
     Color aPrevInsertColor;
-    const ScPatternAttr* pPattern = nullptr;
     ScConditionalFormat* pCondFormat = nullptr;
     const ScCondFormatIndexes* pCondFormats = nullptr;
     Color aBackgroundBrushColor;
@@ -2748,42 +2747,41 @@ void ScColumn::GetBackColorFilterEntries(SCROW nRow1, 
SCROW nRow2, ScFilterEntri
             ; // then the previous value of pPattern and pCondFormat and 
pCondFormats and aBackgroundBrushColor is still valid
         else
         {
-            pPattern = pAttrArray->GetPatternRange(nPatternStartRow, 
nPatternEndRow, nRow1);
-            pCondFormats = 
&pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData();
-            sal_uInt32 nIndex = 0;
-            if(!pCondFormats->empty())
-                nIndex = (*pCondFormats)[0];
-            if (nIndex)
+            if (const ScPatternAttr* pPattern = 
pAttrArray->GetPatternRange(nPatternStartRow, nPatternEndRow, nRow1))
             {
-                assert(pCondFormList);
-                pCondFormat = pCondFormList->GetFormat( nIndex );
-            }
-            else
-                pCondFormat = nullptr;
-            aBackgroundBrushColor = 
pPattern->GetItem(ATTR_BACKGROUND).GetColor();
-        }
-
-        if (pPattern)
-        {
-            if (!pCondFormats->empty())
-            {
-                // Speed up processing when dealing with runs of identical 
cells. This avoids
-                // an expensive GetCondResult call.
-                ScRefCellValue aCellValue = GetCellValue(nRow1);
-                if (pPrevPattern == pPattern && aCellValue == aPrevCellValue)
+                pCondFormats = 
&pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData();
+                sal_uInt32 nIndex = 0;
+                if(!pCondFormats->empty())
+                    nIndex = (*pCondFormats)[0];
+                if (nIndex)
                 {
-                    aBackColor = aPrevPatternColor;
-                    bCondBackColor = true;
+                    assert(pCondFormList);
+                    pCondFormat = pCondFormList->GetFormat( nIndex );
                 }
                 else
+                    pCondFormat = nullptr;
+                aBackgroundBrushColor = 
pPattern->GetItem(ATTR_BACKGROUND).GetColor();
+
+                if (!pCondFormats->empty())
                 {
-                    const SfxItemSet* pCondSet = rDoc.GetCondResult(GetCol(), 
nRow1, GetTab());
-                    const SvxBrushItem* pCondBrush = 
&pPattern->GetItem(ATTR_BACKGROUND, pCondSet);
-                    aBackColor = pCondBrush->GetColor();
-                    bCondBackColor = true;
-                    aPrevCellValue = aCellValue;
-                    pPrevPattern = pPattern;
-                    aPrevPatternColor = aBackColor;
+                    // Speed up processing when dealing with runs of identical 
cells. This avoids
+                    // an expensive GetCondResult call.
+                    ScRefCellValue aCellValue = GetCellValue(nRow1);
+                    if (pPrevPattern == pPattern && aCellValue == 
aPrevCellValue)
+                    {
+                        aBackColor = aPrevPatternColor;
+                        bCondBackColor = true;
+                    }
+                    else
+                    {
+                        const SfxItemSet* pCondSet = 
rDoc.GetCondResult(GetCol(), nRow1, GetTab());
+                        const SvxBrushItem* pCondBrush = 
&pPattern->GetItem(ATTR_BACKGROUND, pCondSet);
+                        aBackColor = pCondBrush->GetColor();
+                        bCondBackColor = true;
+                        aPrevCellValue = aCellValue;
+                        pPrevPattern = pPattern;
+                        aPrevPatternColor = aBackColor;
+                    }
                 }
             }
         }

Reply via email to