compilerplugins/clang/test/unnecessaryoverride-dtor.cxx | 2 +- compilerplugins/clang/unnecessaryoverride.cxx | 7 ------- sw/source/core/docnode/ndtbl1.cxx | 2 ++ sw/source/uibase/shells/basesh.cxx | 3 ++- 4 files changed, 5 insertions(+), 9 deletions(-)
New commits: commit e299f1f5e6097d9e5857dba65a65c33ac31974ae Author: Armin Le Grand (Allotropia) <armin.le.gr...@me.com> AuthorDate: Thu Oct 14 17:56:22 2021 +0200 Commit: Armin Le Grand <armin.le.gr...@me.com> CommitDate: Fri Oct 15 17:15:31 2021 +0200 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 <noel.gran...@collabora.co.uk> Reviewed-by: Armin Le Grand <armin.le.gr...@me.com> 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<SfxPoolItem>& 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<SvxBrushItem> aBrush; + // tdf#144843 calling GetBoxBackground *requires* an incarnation to be handed over + std::unique_ptr<SvxBrushItem> aBrush(std::make_unique<SvxBrushItem>(RES_BACKGROUND)); rSh.GetBoxBackground( aBrush ); pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet)); aSet.Put( *aBrush ); commit 7dc2ac46be574b59cac7923ac55cf650c4fd1168 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Fri Oct 15 15:01:00 2021 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Fri Oct 15 17:15:21 2021 +0200 loplugin:unnecessaryoverride corner case is subsumed now ...by modifications done to the plugin in af908d9f18fbb83a5c393f856026cebefd821f18 "Avoid usage of incomplete types in member functions defined in-class" (if the dtor's definition is spelled `= default;` rather than `{}`, but which should always be possible) Change-Id: Iddce2baf3635a12131854e86a609951309ffbc26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123656 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx b/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx index 8ed472749105..960909b4ea4c 100644 --- a/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx +++ b/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx @@ -125,7 +125,7 @@ struct CompleteBase { // a class defined in a .hxx with the dtor declared (but not defined) as inline in the .hxx, // and then defined in the cxx (making it effectively only callable from within the cxx); // removing the dtor declaration from the class definition would change the dtor to be callable from everywhere -MarkedInlineButNotDefined::~MarkedInlineButNotDefined() {} +MarkedInlineButNotDefined::~MarkedInlineButNotDefined() = default; // avoid loplugin:unreffun: int main() { diff --git a/compilerplugins/clang/unnecessaryoverride.cxx b/compilerplugins/clang/unnecessaryoverride.cxx index 0641339d4e6f..7e7d39a0a5d8 100644 --- a/compilerplugins/clang/unnecessaryoverride.cxx +++ b/compilerplugins/clang/unnecessaryoverride.cxx @@ -193,13 +193,6 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl) return true; } } - // corner case - if (methodDecl->isInlined() - && compiler.getSourceManager().isInMainFile(methodDecl->getLocation()) - && !compiler.getSourceManager().isInMainFile(methodDecl->getCanonicalDecl()->getLocation())) - { - return true; - } if (methodDecl->isExplicitlyDefaulted()) { if (methodDecl->getPreviousDecl() != nullptr) { return true;