From e299f1f5e6097d9e5857dba65a65c33ac31974ae Mon Sep 17 00:00:00 2001 From: "Armin Le Grand (Allotropia)" Date: Thu, 14 Oct 2021 17:56:22 +0200 Subject: tdf#144843 call to GetBoxBackground requires incarnated item Change-Id: Id47f26a762804cd8c1b5742966ec54b71a26ab09 Added assert/warning to SwDoc::GetBoxAttr - that is the method used by GetBoxBackground && GetBoxDirection Change-Id: I59e8dfb790e3872810885a8f888cea57be27e80c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123619 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Armin Le Grand --- sw/source/core/docnode/ndtbl1.cxx | 2 ++ sw/source/uibase/shells/basesh.cxx | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'sw/source') diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index ef44f23ca57f..964b2cb610f2 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -1250,6 +1250,8 @@ void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew ) bool SwDoc::GetBoxAttr( const SwCursor& rCursor, std::unique_ptr& rToFill ) { + // tdf#144843 calling GetBoxAttr *requires* object + assert(rToFill && "requires object here"); bool bRet = false; SwTableNode* pTableNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); SwSelBoxes aBoxes; diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 292b1f10c851..da474db91901 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2713,7 +2713,8 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) if ( rSh.IsTableMode() ) { // Get background attributes of the table and put it in the set - std::unique_ptr aBrush; + // tdf#144843 calling GetBoxBackground *requires* an incarnation to be handed over + std::unique_ptr aBrush(std::make_unique(RES_BACKGROUND)); rSh.GetBoxBackground( aBrush ); pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet)); aSet.Put( *aBrush ); -- cgit