summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2015-10-19 14:04:21 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-10-20 10:09:39 +0000
commitb424ffd2a1233cf0832f05cde88ecf988585290e (patch)
tree60bae35d18240c0656b0a32241b6a15d2bdc56ad /filter
parentc7f1f2274479fe926666dffe82fa322fe64a9f5c (diff)
Writer image export: cmd. line, default to white background
This commit fixes the writer image export (jpeg, png) that didn't work because the export pixel size was set to 0 by default. Now the default is set to document size (which depends on system DPI). When exporting to a PNG the background was transparent, which may not be desired. The background color is now by default white and can be changed for DocumentToGraphicRenderer, but the dialog or command line don't support such an option - for now. Change-Id: I16ffd3cd60c47b52768f43ae4c4c170fc821033b Reviewed-on: https://gerrit.libreoffice.org/19478 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphic/GraphicExportFilter.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/filter/source/graphic/GraphicExportFilter.cxx b/filter/source/graphic/GraphicExportFilter.cxx
index 2f4caba5060d..604e4b3a3994 100644
--- a/filter/source/graphic/GraphicExportFilter.cxx
+++ b/filter/source/graphic/GraphicExportFilter.cxx
@@ -112,7 +112,10 @@ sal_Bool SAL_CALL GraphicExportFilter::filter( const Sequence<PropertyValue>& rD
Size aTargetSizePixel(mTargetWidth, mTargetHeight);
- Graphic aGraphic = aRenderer.renderToGraphic( aCurrentPage, aDocumentSizePixel, aTargetSizePixel );
+ if (mTargetWidth == 0 || mTargetHeight == 0)
+ aTargetSizePixel = aDocumentSizePixel;
+
+ Graphic aGraphic = aRenderer.renderToGraphic(aCurrentPage, aDocumentSizePixel, aTargetSizePixel, COL_WHITE);
GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();