From 2b8e62f7b6e0a45a9ff1ec530b2e941f3fbcf1a0 Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Sat, 29 Aug 2015 21:02:39 -0400 Subject: tdf#39080 Hide white space between pages in 'print layout' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merged Hide Whitespace with Browser Mode and hooked the former with the UI. In Hide Whitespace mode the headers and footers are removed and page margins as well as between-page gaps are reduced to minimum. In single-page view the side margins are left as-is. In multi-page and book-view the sides are removed, however, they have twice the width of the top and bottom. Printing and PDF export disable this mode. The usable screen real-estate is greatly improved in this mode, which is controlled from the View menu. Change-Id: I2d0075ae9a76162c26c78e9eb23a71920cdfc522 Reviewed-on: https://gerrit.libreoffice.org/17281 Reviewed-by: Jean-Baptiste Faure Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- filter/source/pdf/pdfexport.cxx | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'filter') diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 455e2bccaef5..d2b511bd3e5d 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -844,10 +844,12 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& aSelection = Any(); aSelection <<= mxSrcDoc; } - bool bSecondPassForImpressNotes = false; + bool bSecondPassForImpressNotes = false; bool bReChangeToNormalView = false; - OUString sShowOnlineLayout( "ShowOnlineLayout" ); - uno::Reference< beans::XPropertySet > xViewProperties; + const OUString sShowOnlineLayout( "ShowOnlineLayout" ); + bool bReHideWhitespace = false; + const OUString sHideWhitespace("HideWhitespace"); + uno::Reference< beans::XPropertySet > xViewProperties; if ( aCreator == "Writer" ) { @@ -855,12 +857,19 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& try { Reference< view::XViewSettingsSupplier > xVSettingsSupplier( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - xViewProperties = xVSettingsSupplier->getViewSettings(); + xViewProperties = xVSettingsSupplier->getViewSettings(); xViewProperties->getPropertyValue( sShowOnlineLayout ) >>= bReChangeToNormalView; if( bReChangeToNormalView ) { xViewProperties->setPropertyValue( sShowOnlineLayout, uno::makeAny( false ) ); } + + // Also, disable hide-whitespace during export. + xViewProperties->getPropertyValue(sHideWhitespace) >>= bReHideWhitespace; + if (bReHideWhitespace) + { + xViewProperties->setPropertyValue(sHideWhitespace, uno::makeAny(false)); + } } catch( const uno::Exception& ) { @@ -930,6 +939,16 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& { } } + if( bReHideWhitespace ) + { + try + { + xViewProperties->setPropertyValue( sHideWhitespace, uno::makeAny( true ) ); + } + catch( const uno::Exception& ) + { + } + } } } } -- cgit