diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-12-19 22:31:31 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-01-05 10:13:59 +0100 |
commit | 5f25ea47a7c98956189d4239d617094f0a34ccca (patch) | |
tree | 248331fae7f9fe3f40926697ebf936e3878448a8 /svx | |
parent | 438dbaf2b7e9007820c5f02c7ab1cb3764393169 (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.
This adds to SfxTabPage a new member maAdditionalProperties, to
make it easier to transfer additional properties into a tab page.
This is then used to transfer the preferred DPI into the tab page,
which was previously done by user data, which is less than ideal
and always doesn't work.
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127096
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit e34067483ef78c1569641becfe99b79a97600aed)
Change-Id: I50806f194032e228ee2cf56a39e5735a57358d46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127240
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/grafctrl.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index 10fc939395c3..f5dbb6620f57 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -658,6 +658,8 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView ) SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_GRFCROP ); std::unique_ptr<SfxTabPage> xTabPage = (*fnCreatePage)(aCropDialog.get_content_area(), &aCropDialog, &aCropDlgAttr); + sal_Int32 nPreferredDPI = rView.getSdrModelFromSdrView().getImagePreferredDPI(); + xTabPage->getAdditionalProperties().emplace("PreferredDPI", css::uno::makeAny(nPreferredDPI)); xTabPage->SetPageTitle(aCropStr); aCropDialog.SetTabPage(std::move(xTabPage)); |