diff options
author | Eike Rathke <erack@redhat.com> | 2017-08-29 11:15:57 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-08-29 12:42:52 +0200 |
commit | 8c0c897c8cb92285e6461cc99ab0f2bbe15be65f (patch) | |
tree | da305d87a78b972b391e06d18ebb0dc461fb1b8b | |
parent | Export to PNG: export selected cell range only, not as page, tdf#108317 (diff) | |
download | core-8c0c897c8cb92285e6461cc99ab0f2bbe15be65f.tar.gz core-8c0c897c8cb92285e6461cc99ab0f2bbe15be65f.zip |
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
-rw-r--r-- | svtools/source/filter/GraphicExportOptionsDialog.cxx | 7 |
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 ) |