diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-29 10:47:31 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-29 11:08:03 +0200 |
commit | d355207b45755cfe1eef0147bc25ead931741684 (patch) | |
tree | cc3bf2d9f6d45c35dfebe46ad4fd1424052dd795 /sw | |
parent | 264c6e4c522d828e7f3f6ac106763278f30c7e9b (diff) |
lok: add Document::getPartPageRectangles()
Change-Id: I20acd44f7a81471982ba96ad3894a9124e035c5f
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/crsrsh.hxx | 2 | ||||
-rw-r--r-- | sw/inc/unotxdoc.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 14 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 11 |
4 files changed, 29 insertions, 0 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 0cdeee5860c2..0629a04a9299 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -847,6 +847,8 @@ public: OUString GetCrsrDescr() const; virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const SAL_OVERRIDE; + /// Implementation of lok::Document::getPartPageRectangles() for Writer. + OUString getPageRectangles(); }; // Cursor Inlines: diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index 8306b83f5616..1edefc4c82be 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -428,6 +428,8 @@ public: virtual void setGraphicSelection(int nType, int nX, int nY) SAL_OVERRIDE; /// @see vcl::ITiledRenderable::resetSelection(). virtual void resetSelection() SAL_OVERRIDE; + /// @see vcl::ITiledRenderable::getPartPageRectangles(). + virtual OUString getPartPageRectangles() SAL_OVERRIDE; // ::com::sun::star::tiledrendering::XTiledRenderable virtual void SAL_CALL paintTile( const ::css::uno::Any& Parent, ::sal_Int32 nOutputWidth, ::sal_Int32 nOutputHeight, ::sal_Int32 nTilePosX, ::sal_Int32 nTilePosY, ::sal_Int32 nTileWidth, ::sal_Int32 nTileHeight ) throw (::css::uno::RuntimeException, ::std::exception) SAL_OVERRIDE; diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 06aed4f369b6..fee18190fdaf 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1200,6 +1200,20 @@ sal_uInt16 SwCrsrShell::GetPageCnt() return GetLayout()->GetPageNum(); } +OUString SwCrsrShell::getPageRectangles() +{ + CurrShell aCurr(this); + SwRootFrm* pLayout = GetLayout(); + std::stringstream ss; + for (const SwFrm* pFrm = pLayout->GetLower(); pFrm; pFrm = pFrm->GetNext()) + { + if (pFrm != pLayout->GetLower()) + ss << "; "; + ss << pFrm->Frm().Left() << ", " << pFrm->Frm().Top() << ", " << pFrm->Frm().Width() << ", " << pFrm->Frm().Height(); + } + return OUString::fromUtf8(ss.str().c_str()); +} + /// go to the next SSelection bool SwCrsrShell::GoNextCrsr() { diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index ab5b8281e29e..8a0471fa06da 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3176,6 +3176,17 @@ int SwXTextDocument::getParts() return pWrtShell->GetPageCnt(); } +OUString SwXTextDocument::getPartPageRectangles() +{ + SolarMutexGuard aGuard; + + SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); + if (!pWrtShell) + return OUString(); + + return pWrtShell->getPageRectangles(); +} + int SwXTextDocument::getPart() { SolarMutexGuard aGuard; |