From b3375a273e8030fd576e8094fe0890fab23362ea Mon Sep 17 00:00:00 2001 From: Andrzej Hunt Date: Tue, 29 Jul 2014 17:00:56 +0200 Subject: Impress/Tiled Rendering: implement setPartMode. Change-Id: I831953ac3fa1d0a15b64aa008cc3bfb79e72575a --- sd/source/ui/inc/unomodel.hxx | 1 + sd/source/ui/unoidl/unomodel.cxx | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) (limited to 'sd') diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 8fa1904da7f1..e620ca5d96cb 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -234,6 +234,7 @@ public: virtual int getPart() SAL_OVERRIDE; virtual int getParts() SAL_OVERRIDE; virtual OUString getPartName( int nPart ) SAL_OVERRIDE; + virtual void setPartMode( LibreOfficeKitPartMode ePartMode ) SAL_OVERRIDE; // XComponent diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 7726de407768..6c1661be179f 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2239,7 +2239,6 @@ void SdXImpressDocument::setPart( int nPart ) // only possible to select page 0 in this mode, I have no idea how you // then actually select what is on the handout page, which defaults to // a 4x4 grid of empty pages). - pViewSh->SetPageKind( PK_STANDARD ); pViewSh->SwitchPage( nPart ); } } @@ -2269,6 +2268,40 @@ OUString SdXImpressDocument::getPartName( int nPart ) return pPage->GetName(); } +void SdXImpressDocument::setPartMode( LibreOfficeKitPartMode ePartMode ) +{ + DrawViewShell* pViewSh = dynamic_cast< DrawViewShell* >( mpDoc->GetDocSh()->GetViewShell() ); + if (!pViewSh) + { + return; + } + + PageKind aPageKind; + switch ( ePartMode ) + { + case LOK_PARTMODE_EMBEDDEDOBJ: + // This will probably be handled higher up, i.e. + // we probably shouldn't be handling this here. + // (However we don't offer embedded object-only + // rendering anywhere yet, so this may be a + // completely incorrect comment.) + assert( false ); + // And let's fall through in a normal build. + case LOK_PARTMODE_DEFAULT: + case LOK_PARTMODE_SLIDE: + aPageKind = PK_STANDARD; + break; + case LOK_PARTMODE_SLIDENOTES: + aPageKind = PK_NOTES; + break; + case LOK_PARTMODE_NOTES: + // TODO: this shows combined slides + notes + aPageKind = PK_NOTES; + break; + } + pViewSh->SetPageKind( aPageKind ); +} + Size SdXImpressDocument::getDocumentSize() { SdrPageView* pCurPageView = mpDoc->GetDocSh()->GetViewShell()->GetView()->GetSdrPageView(); -- cgit