diff options
author | Valentin Kettner <vakevk+libreoffice@gmail.com> | 2014-08-06 16:21:14 +0200 |
---|---|---|
committer | Valentin Kettner <vakevk+libreoffice@gmail.com> | 2014-08-12 23:26:38 +0200 |
commit | 5494954b269267f6ee3bdd5ac73e7513fa69978f (patch) | |
tree | bd6569e5b82a7c771062b2e2e5f6db7666913597 /sw/source/core/unocore/unodraw.cxx | |
parent | 64e13a1456c44ef3461c2941bb3be15c3eaf478e (diff) |
Refactored IDocumentLayoutAccess out of SwDoc.
Into the new class DocumentLayoutManager.
Change-Id: I02d0cfcc63633d0bdab380508b2ef563187fd269
Diffstat (limited to 'sw/source/core/unocore/unodraw.cxx')
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 09dd5cb57e10..9640704ebf12 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -34,6 +34,7 @@ #include <docary.hxx> #include <IDocumentUndoRedo.hxx> #include <IDocumentDrawModelAccess.hxx> +#include <IDocumentLayoutAccess.hxx> #include <fmtcntnt.hxx> #include <fmtflcnt.hxx> #include <txtatr.hxx> @@ -703,11 +704,11 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) else throw uno::RuntimeException(); } - else if ((aAnchor.GetAnchorId() != FLY_AT_PAGE) && pDoc->GetCurrentLayout()) + else if ((aAnchor.GetAnchorId() != FLY_AT_PAGE) && pDoc->getIDocumentLayoutAccess().GetCurrentLayout()) { SwCrsrMoveState aState( MV_SETONLYTEXT ); Point aTmp(convertMm100ToTwip(aMM100Pos.X), convertMm100ToTwip(aMM100Pos.Y)); - pDoc->GetCurrentLayout()->GetCrsrOfst( pPam->GetPoint(), aTmp, &aState ); + pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetCrsrOfst( pPam->GetPoint(), aTmp, &aState ); aAnchor.SetAnchor( pPam->GetPoint() ); // #i32349# - adjustment of vertical positioning @@ -1216,7 +1217,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a aValue >>= nPositionLayoutDir; pFmt->SetPositionLayoutDir( nPositionLayoutDir ); } - else if( pDoc->GetCurrentLayout()) + else if( pDoc->getIDocumentLayoutAccess().GetCurrentLayout()) { UnoActionContext aCtx(pDoc); if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == pEntry->nMemberId) @@ -1310,11 +1311,11 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a //if the fly has been anchored at page then it needs to be connected //to the content position SwPaM aPam(pDoc->GetNodes().GetEndOfContent()); - if( pDoc->GetCurrentLayout() ) + if( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ) { SwCrsrMoveState aState( MV_SETONLYTEXT ); Point aTmp( pObj->GetSnapRect().TopLeft() ); - pDoc->GetCurrentLayout()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState ); + pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState ); } else { @@ -1331,11 +1332,11 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a (FLY_AS_CHAR != eOldAnchorId)) { SwPaM aPam(pDoc->GetNodes().GetEndOfContent()); - if( pDoc->GetCurrentLayout() ) + if( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ) { SwCrsrMoveState aState( MV_SETONLYTEXT ); Point aTmp( pObj->GetSnapRect().TopLeft() ); - pDoc->GetCurrentLayout()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState ); + pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState ); } else { @@ -1444,7 +1445,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a { aKeepedPosition = getPosition(); } - if( pFmt && pFmt->GetDoc()->GetCurrentViewShell() ) + if( pFmt && pFmt->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell() ) { UnoActionContext aCtx(pFmt->GetDoc()); xPrSet->setPropertyValue(rPropertyName, aValue); @@ -2156,7 +2157,7 @@ void SwXShape::dispose(void) throw( uno::RuntimeException, std::exception ) pTxtNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx ); } else - pFmt->GetDoc()->DelLayoutFmt( pFmt ); + pFmt->GetDoc()->getIDocumentLayoutAccess().DelLayoutFmt( pFmt ); } } if(xShapeAgg.is()) |