diff options
Diffstat (limited to 'sd/source/ui/view/DocumentRenderer.cxx')
-rwxr-xr-x | sd/source/ui/view/DocumentRenderer.cxx | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 0689dc0e3851..1660c05a124f 100755 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -27,6 +27,8 @@ #include "precompiled_sd.hxx" +#include <com/sun/star/beans/XPropertySet.hpp> + #include "DocumentRenderer.hxx" #include "DocumentRenderer.hrc" @@ -997,6 +999,9 @@ namespace { { SdPage& rHandoutPage (*rDocument.GetSdPage(0, PK_HANDOUT)); + Reference< com::sun::star::beans::XPropertySet > xHandoutPage( rHandoutPage.getUnoPage(), UNO_QUERY ); + const rtl::OUString sPageNumber( RTL_CONSTASCII_USTRINGPARAM( "Number" ) ); + // Collect the page objects of the handout master. std::vector<SdrPageObj*> aHandoutPageObjects; SdrObjListIter aShapeIter (rHandoutPage); @@ -1051,7 +1056,15 @@ namespace { } } - rViewShell.SetPrintedHandoutPageNum(mnHandoutPageIndex + 1); + if( xHandoutPage.is() ) try + { + xHandoutPage->setPropertyValue( sPageNumber, Any( static_cast<sal_Int16>(mnHandoutPageIndex) ) ); + } + catch( Exception& ) + { + } + rViewShell.SetPrintedHandoutPageNum( mnHandoutPageIndex + 1 ); + MapMode aMap (rPrinter.GetMapMode()); rPrinter.SetMapMode(maMap); @@ -1068,6 +1081,13 @@ namespace { msPageString, maPageStringOffset); + if( xHandoutPage.is() ) try + { + xHandoutPage->setPropertyValue( sPageNumber, Any( static_cast<sal_Int16>(0) ) ); + } + catch( Exception& ) + { + } rViewShell.SetPrintedHandoutPageNum(1); // Restore outlines. @@ -1081,7 +1101,8 @@ namespace { pPathObj->SetMergedItem(XLineStyleItem(XLINE_SOLID)); } } - } + + } private: const USHORT mnHandoutPageIndex; @@ -1887,12 +1908,17 @@ private: ++nShapeCount; } + const USHORT nPageCount = mrBase.GetDocument()->GetSdPageCount(PK_STANDARD); + const USHORT nHandoutPageCount = nShapeCount ? (nPageCount + nShapeCount - 1) / nShapeCount : 0; + pViewShell->SetPrintedHandoutPageCount( nHandoutPageCount ); + mrBase.GetDocument()->setHandoutPageCount( nHandoutPageCount ); + // Distribute pages to handout pages. ::std::vector<USHORT> aPageIndices; std::vector<SdPage*> aPagesVector; for (USHORT nIndex=0, - nCount=mrBase.GetDocument()->GetSdPageCount(PK_STANDARD), + nCount= nPageCount, nHandoutPageIndex=0; nIndex <= nCount; ++nIndex) |