summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorAshod Nakashian <ashodnakashian@yahoo.com>2015-08-29 21:02:39 -0400
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-18 10:21:48 +0100
commitd8bc8f1d6bd9d84d624d1a21955ed5fbf96f80e3 (patch)
tree3ca08266a4daf1c276732f720193a6eb67937a3e /filter
parent6559276d85fcc54d52e291b8ae09436418e7709d (diff)
tdf#39080 Hide white space between pages in 'print layout'
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 <jbfaure@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 2b8e62f7b6e0a45a9ff1ec530b2e941f3fbcf1a0)
Diffstat (limited to 'filter')
-rw-r--r--filter/source/pdf/pdfexport.cxx27
1 files changed, 23 insertions, 4 deletions
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 7c065a4d6d51..045b0bde9d26 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& )
+ {
+ }
+ }
}
}
}