summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-12-19 22:31:31 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-12-20 06:21:49 +0100
commite34067483ef78c1569641becfe99b79a97600aed (patch)
tree2878b9477b25623e19795fa02c446027aa439ee2 /sw
parent046e6cfa544d2ffd67fd29ba7dde41b495744618 (diff)
Set the original size in crop dialog to preferred DPI calc. size
If we have the document setting preferred image size set, then use that as the default DPI and recalcualte the logical image size using the DPI and the size in pixels. This is useful so we have the preferred DPI size as 100% in the crop dialog, so we can adjust the size in relation to that value. Change-Id: I50806f194032e228ee2cf56a39e5735a57358d46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127096 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/frmdlg/frmdlg.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx
index ffb5a8ed76c9..fbb27c7d5f94 100644
--- a/sw/source/ui/frmdlg/frmdlg.cxx
+++ b/sw/source/ui/frmdlg/frmdlg.cxx
@@ -31,6 +31,7 @@
#include <wrap.hxx>
#include <column.hxx>
#include <macassgn.hxx>
+#include <IDocumentSettingAccess.hxx>
#include <strings.hrc>
#include <svl/eitem.hxx>
@@ -189,6 +190,12 @@ void SwFrameDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
{
rPage.PageCreated(m_rSet);
}
+ else if (rId == "crop")
+ {
+ sal_Int32 nDPI = m_pWrtShell->GetDoc()->getIDocumentSettingAccess().getImagePreferredDPI();
+ if (nDPI)
+ rPage.SetUserData(OUString::number(nDPI));
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */