summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-09-06 12:16:37 +0200
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2024-09-06 19:11:34 +0200
commit10523d1e9ff6d6464c37864b7d79ee4b372a7aad (patch)
treedaea2b22a10078c29fbafe6b934f09c8fa412cec /sd
parentbb6ad4cd2815e071b8ae177a482dd3054e18ba3a (diff)
tdf#162467: fix measurement units in impress/draw
Regression from commit 055e7d866680390dca6e18864ca4297cc0ebda84 Author: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Date: Tue Apr 23 20:04:43 2024 +0200 Use less SdOptionsLayout->GetMetric/SetMetric in favor of officecfg This code was removed for no apparent reason. Reintroduce it and adapt it Change-Id: Iea23ba824cdc20e59edbc316fefc7325c73926a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172946 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/app/sdmod.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index bb4d30f9e1df..df2fd5c50eee 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -42,6 +42,10 @@
#include <DrawDocShell.hxx>
#include <drawdoc.hxx>
#include <errhdl.hrc>
+#include <unotools/syslocale.hxx>
+
+#include <officecfg/Office/Draw.hxx>
+#include <officecfg/Office/Impress.hxx>
#define ShellClass_SdModule
#include <sdslots.hxx>
@@ -141,6 +145,20 @@ SdOptions* SdModule::GetSdOptions(DocumentType eDocType)
pOptions = pImpressOptions;
}
+ if( pOptions )
+ {
+ SvtSysLocale aSysLocale;
+ if (eDocType == DocumentType::Impress)
+ if (aSysLocale.GetLocaleData().getMeasurementSystemEnum() == MeasurementSystem::Metric)
+ PutItem( SfxUInt16Item( SID_ATTR_METRIC, officecfg::Office::Impress::Layout::Other::MeasureUnit::Metric::get() ) );
+ else
+ PutItem( SfxUInt16Item( SID_ATTR_METRIC, officecfg::Office::Impress::Layout::Other::MeasureUnit::NonMetric::get() ) );
+ else
+ if (aSysLocale.GetLocaleData().getMeasurementSystemEnum() == MeasurementSystem::Metric)
+ PutItem( SfxUInt16Item( SID_ATTR_METRIC, officecfg::Office::Draw::Layout::Other::MeasureUnit::Metric::get() ) );
+ else
+ PutItem( SfxUInt16Item( SID_ATTR_METRIC, officecfg::Office::Draw::Layout::Other::MeasureUnit::NonMetric::get() ) );
+ }
return pOptions;
}