From 9fc76fd59cb632faa3b9b8467caccfac87d15838 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Wed, 4 Jan 2017 23:11:56 +0100 Subject: use GetZOrnderHint instead of duplication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I78f428e9ddc50df60f7e9652015d49f3cf7b3286 Reviewed-on: https://gerrit.libreoffice.org/32746 Reviewed-by: Björn Michaelsen Tested-by: Björn Michaelsen --- sw/source/core/layout/flypos.cxx | 40 +++++++--------------------------------- 1 file changed, 7 insertions(+), 33 deletions(-) (limited to 'sw') diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx index 38ab540e451a..0503f5adf247 100644 --- a/sw/source/core/layout/flypos.cxx +++ b/sw/source/core/layout/flypos.cxx @@ -36,41 +36,15 @@ bool SwPosFlyFrameCmp::operator()(const SwPosFlyFramePtr& rA, const SwPosFlyFram return rA->GetNdIndex() < rB->GetNdIndex(); } -SwPosFlyFrame::SwPosFlyFrame( const SwNodeIndex& rIdx, const SwFrameFormat* pFormat, - sal_uInt16 nArrPos ) - : m_pFrameFormat( pFormat ), m_pNodeIndex( const_cast(&rIdx) ) +SwPosFlyFrame::SwPosFlyFrame(const SwNodeIndex& rIdx, const SwFrameFormat* pFormat, sal_uInt16 nArrPos) + : m_pFrameFormat(pFormat), m_pNodeIndex(const_cast(&rIdx)), m_nOrdNum(SAL_MAX_UINT32) { - bool bFnd = false; const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); - if (FLY_AT_PAGE == rAnchor.GetAnchorId()) - { - m_pNodeIndex = new SwNodeIndex( rIdx ); - } - else if( pFormat->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell() ) - { - if( RES_FLYFRMFMT == pFormat->Which() ) - { - // Let's see if we have an SdrObject for this - SwFlyFrame* pFly = SwIterator(*pFormat).First(); - if( pFly ) - { - m_nOrdNum = pFly->GetVirtDrawObj()->GetOrdNum(); - bFnd = true; - } - } - else if( RES_DRAWFRMFMT == pFormat->Which() ) - { - // Let's see if we have an SdrObject for this - SwDrawContact* pContact = SwIterator(*pFormat).First(); - if( pContact ) - { - m_nOrdNum = pContact->GetMaster()->GetOrdNum(); - bFnd = true; - } - } - } - - if( !bFnd ) + if(FLY_AT_PAGE == rAnchor.GetAnchorId()) + m_pNodeIndex = new SwNodeIndex(rIdx); + else if(pFormat->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell()) + pFormat->CallSwClientNotify(sw::GetZOrderHint(m_nOrdNum)); + if(m_nOrdNum == SAL_MAX_UINT32) { m_nOrdNum = pFormat->GetDoc()->GetSpzFrameFormats()->size(); m_nOrdNum += nArrPos; -- cgit