Kaydet (Commit) 8c0c897c authored tarafından Eike Rathke's avatar Eike Rathke

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
üst d34fa1fc
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment