summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-08-29 11:15:57 +0200
committerEike Rathke <erack@redhat.com>2017-08-29 12:42:52 +0200
commit8c0c897c8cb92285e6461cc99ab0f2bbe15be65f (patch)
treeda305d87a78b972b391e06d18ebb0dc461fb1b8b /svtools
parentd34fa1fc643cc49253e7340b3de1c87a49875e8a (diff)
Export to PNG: init DPI with screen resolution, tdf#108317
This whole concept of "use a JPG dialog for PNG export" is nonsense anyway, but.. as long as there isn't anything better at least have sensible defaults. Change-Id: I0c074f7bb2989122aed039c739fd1813f371cbca
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/filter/GraphicExportOptionsDialog.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/svtools/source/filter/GraphicExportOptionsDialog.cxx b/svtools/source/filter/GraphicExportOptionsDialog.cxx
index cb7928ad104e..cb7cb64c919e 100644
--- a/svtools/source/filter/GraphicExportOptionsDialog.cxx
+++ b/svtools/source/filter/GraphicExportOptionsDialog.cxx
@@ -18,6 +18,7 @@
*/
#include <svtools/GraphicExportOptionsDialog.hxx>
+#include <vcl/svapp.hxx>
using namespace css::beans;
using namespace css::lang;
@@ -61,6 +62,12 @@ void GraphicExportOptionsDialog::initialize()
{
mCurrentPage = mRenderer.getCurrentPageWriter();
mSize100mm = mRenderer.getDocumentSizeIn100mm(mCurrentPage);
+ // Init DPI with screen resolution, taking width. This may lead to unusual
+ // DPI values but ensures a size in pixels that matches the actual screen
+ // content, which is vital for example for Calc with drawing layer and
+ // pixel images.
+ Size aSizePixels = Application::GetDefaultDevice()->LogicToPixel( mSize100mm, MapUnit::Map100thMM );
+ mResolution = aSizePixels.Width() / getViewWidthInch();
}
IMPL_LINK_NOARG( GraphicExportOptionsDialog, widthModifiedHandle, Edit&, void )