summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2017-01-04 23:11:56 +0100
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2017-01-05 14:38:55 +0000
commit9fc76fd59cb632faa3b9b8467caccfac87d15838 (patch)
tree3d39e997e85ab329fee8d47713b8721c4d91f338 /sw
parentfbf10700c5cd174955821e0e2ab8b4c1d87010c1 (diff)
use GetZOrnderHint instead of duplication
Change-Id: I78f428e9ddc50df60f7e9652015d49f3cf7b3286 Reviewed-on: https://gerrit.libreoffice.org/32746 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/flypos.cxx40
1 files changed, 7 insertions, 33 deletions
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<SwNodeIndex*>(&rIdx) )
+SwPosFlyFrame::SwPosFlyFrame(const SwNodeIndex& rIdx, const SwFrameFormat* pFormat, sal_uInt16 nArrPos)
+ : m_pFrameFormat(pFormat), m_pNodeIndex(const_cast<SwNodeIndex*>(&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<SwFlyFrame,SwFormat>(*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<SwDrawContact,SwFormat>(*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;