summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorAshod Nakashian <ashodnakashian@yahoo.com>2015-08-29 21:02:39 -0400
committerCaolán McNamara <caolanm@redhat.com>2015-09-03 08:45:07 +0000
commit2b8e62f7b6e0a45a9ff1ec530b2e941f3fbcf1a0 (patch)
tree2536a965821cd4ce454b8b93b59fa9582b4fa94e /filter
parenta1fd97308d7fc7a35a5def1e15a05099dba90f91 (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>
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 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& )
+ {
+ }
+ }
}
}
}