sw/source/core/layout/trvlfrm.cxx    |    5 ++++-
 sw/source/uibase/docvw/PostItMgr.cxx |   10 +++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 4d381b54d1c598c181b4a21a8bf0db86eb4668d1
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Feb 4 10:02:32 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Feb 4 13:13:44 2024 +0100

    cid#1591491 Big parameter passed by value
    
    Change-Id: Ia08747a92018355809970b0dc85b1dc258f38eba
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162968
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index 73f48a9f4165..e10b74671819 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -1718,16 +1718,16 @@ void SwPostItMgr::ExecuteFormatAllDialog(SwView& rView)
     OutlinerView* pOLV = pWin->GetOutlinerView();
     SfxItemSet aEditAttr(pOLV->GetAttribs());
     SfxItemPool* pPool(SwAnnotationShell::GetAnnotationPool(rView));
-    SfxItemSetFixed<XATTR_FILLSTYLE, XATTR_FILLCOLOR, EE_ITEMS_START, 
EE_ITEMS_END> aDlgAttr(*pPool);
-    aDlgAttr.Put(aEditAttr);
+    auto xDlgAttr = std::make_shared<SfxItemSetFixed<XATTR_FILLSTYLE, 
XATTR_FILLCOLOR, EE_ITEMS_START, EE_ITEMS_END>>(*pPool);
+    xDlgAttr->Put(aEditAttr);
     SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-    VclPtr<SfxAbstractTabDialog> 
pDlg(pFact->CreateSwCharDlg(rView.GetFrameWeld(), rView, aDlgAttr, 
SwCharDlgMode::Ann));
+    VclPtr<SfxAbstractTabDialog> 
pDlg(pFact->CreateSwCharDlg(rView.GetFrameWeld(), rView, *xDlgAttr, 
SwCharDlgMode::Ann));
     pDlg->StartExecuteAsync(
-        [this, pDlg, aDlgAttr, pOrigActiveWin] (sal_Int32 nResult)->void
+        [this, pDlg, xDlgAttr, pOrigActiveWin] (sal_Int32 nResult)->void
         {
             if (nResult == RET_OK)
             {
-                auto aNewAttr = aDlgAttr;
+                auto aNewAttr = *xDlgAttr;
                 aNewAttr.Put(*pDlg->GetOutputItemSet());
                 FormatAll(aNewAttr);
             }
commit 409746b90af5ad9b07f1a7df1005279f8dede1ba
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Feb 4 10:37:51 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Feb 4 13:13:34 2024 +0100

    cid#1591484 Dereference after null check
    
    Change-Id: Id3ea18587cf3bccd808de48af6cd4a502d67cef8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162973
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/core/layout/trvlfrm.cxx 
b/sw/source/core/layout/trvlfrm.cxx
index 77ebde80cfe1..8d8da2a3b724 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -234,13 +234,16 @@ bool SwPageFrame::GetModelPositionForViewPoint( 
SwPosition *pPos, Point &rPoint,
                 }
             }
 
+            SAL_WARN_IF(!pCnt, "sw.layout", "Cursor is gone to a Black hole");
+            if (!pCnt)
+                return false;
+
             // GetContentPos may have modified pCMS
             if ( pCMS && pCMS->m_bStop )
                 return false;
 
             bool bTextRet = false;
 
-            OSL_ENSURE( pCnt, "Cursor is gone to a Black hole" );
             if( pCMS && pCMS->m_pFill && pCnt->IsTextFrame() )
                 bTextRet = pCnt->GetModelPositionForViewPoint( &aTextPos, 
rPoint, pCMS );
             else

Reply via email to