diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-09-18 16:21:44 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-09-19 12:08:11 +0200 |
commit | 049e522490129123a120704a001528a61cf088ec (patch) | |
tree | 6eb34059497b094ed1fa0312785b3eeeb76605be /sw/source/core/doc/docfld.cxx | |
parent | fee5b79543de5e35299b1e3576209c77ef64a4d6 (diff) |
sw: rework annoying GetFrameOfModify/getLayoutFrame parameters
The bCalcFrame is only evaluated if a pPoint is given; this is
surprising and should be more visible in the interface, so people don't
go on a goose chase to find places that may do formatting in
inappropriate places.
So put these parameters into a pair instead, which doesn't have
particularly good ergonomics in C++, particularly since compilers
warn about taking the address of a temporary object...
Change-Id: I101c6eeb5bd6baf83c2bd9a6cb91ccaa04036cc3
Reviewed-on: https://gerrit.libreoffice.org/60695
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sw/source/core/doc/docfld.cxx')
-rw-r--r-- | sw/source/core/doc/docfld.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index c017172eed6d..873a69b62cbe 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -997,7 +997,9 @@ void SwDocUpdateField::GetBodyNode( const SwTextField& rTField, SwFieldIds nFiel // always the first! (in tab headline, header-/footer) Point aPt; - const SwContentFrame* pFrame = rTextNd.getLayoutFrame( rDoc.getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, nullptr, false ); + std::pair<Point, bool> const tmp(aPt, false); + const SwContentFrame* pFrame = rTextNd.getLayoutFrame( + rDoc.getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, &tmp); SetGetExpField* pNew = nullptr; bool bIsInBody = false; @@ -1061,7 +1063,10 @@ void SwDocUpdateField::GetBodyNode( const SwSectionNode& rSectNd ) // always the first! (in tab headline, header-/footer) Point aPt; - const SwContentFrame* pFrame = pCNd->getLayoutFrame( rDoc.getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, nullptr, false ); + std::pair<Point, bool> const tmp(aPt, false); + const SwContentFrame* pFrame = pCNd->getLayoutFrame( + rDoc.getIDocumentLayoutAccess().GetCurrentLayout(), + nullptr, &tmp); if( !pFrame ) break; |