diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2017-09-20 01:15:54 +0200 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@libreoffice.org> | 2017-09-21 00:06:00 +0200 |
commit | 4ac6a70524eb1383b8dab5e10bd3532434fe08a0 (patch) | |
tree | e678e6e713be3c35ee037e4aeb27b4915c0433be | |
parent | 86f256596c8566e80993e1cf6035bc3534b6f816 (diff) |
inline lcl_ObjConnected and lcl_InHeaderOrFooter
- lcl_ObjConnected repeatedly fetched an invariant: pRoot
- lcl_InHeaderOrFooter just checked for FLY_AT_PAGE, which was never the
case in the one client of the function
Change-Id: I38aa54d3d51f7dcdee015588a9043824a7703c5c
Reviewed-on: https://gerrit.libreoffice.org/42509
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
-rw-r--r-- | sw/source/core/layout/frmtool.cxx | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index e45e558f20ee..44cee9648ad9 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1067,27 +1067,6 @@ void AppendObjs( const SwFrameFormats *pTable, sal_uLong nIndex, #endif } -static inline bool lcl_ObjConnected(const SwFrameFormat* pFormat, const SwFrame* pSib) -{ - const SwRootFrame* pRoot = pSib ? pSib->getRootFrame() : nullptr; - bool isConnected(false); - pFormat->CallSwClientNotify(sw::GetObjectConnectedHint(isConnected, pRoot)); - return isConnected; -} - -/** helper method to determine, if a <SwFrameFormat>, which has an object connected, - is located in header or footer. - - OD 23.06.2003 #108784# -*/ -static inline bool lcl_InHeaderOrFooter(const SwFrameFormat& rFormat) -{ - const SwFormatAnchor& rAnch = rFormat.GetAnchor(); - if (rAnch.GetAnchorId() == RndStdIds::FLY_AT_PAGE) - return false; - return rFormat.GetDoc()->IsInHeaderFooter(rAnch.GetContentAnchor()->nNode); -} - void AppendAllObjs(const SwFrameFormats* pTable, const SwFrame* pSib) { //Connecting of all Objects, which are described in the SpzTable with the @@ -1101,17 +1080,21 @@ void AppendAllObjs(const SwFrameFormats* pTable, const SwFrame* pSib) // frames nor objects which are anchored to character bounds. if ((rAnch.GetAnchorId() != RndStdIds::FLY_AT_PAGE) && (rAnch.GetAnchorId() != RndStdIds::FLY_AS_CHAR)) { - if(lcl_InHeaderOrFooter(*pFormat)) + // formats in header/footer have no dependencies + if(pFormat->GetDoc()->IsInHeaderFooter(rAnch.GetContentAnchor()->nNode)) pFormat->MakeFrames(); else vFormatsToConnect.push_back(pFormat); } } + const SwRootFrame* pRoot = pSib ? pSib->getRootFrame() : nullptr; const SwFrameFormat* pFirstRequeued(nullptr); while(!vFormatsToConnect.empty()) { auto& pFormat = vFormatsToConnect.front(); - if(!lcl_ObjConnected(pFormat, pSib)) + bool isConnected(false); + pFormat->CallSwClientNotify(sw::GetObjectConnectedHint(isConnected, pRoot)); + if(!isConnected) { pFormat->MakeFrames(); pFirstRequeued = nullptr; |