summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2020-04-16 22:24:23 -0400
committerHenry Castro <hcastro@collabora.com>2020-05-21 00:42:29 +0200
commit45ce9bf4413cf1fc65da01c758f7f9bed9b8df99 (patch)
tree43d0c6b017b33b93ada03563393e0ce9e6062d56 /svx
parent400fc54e4288bfef1e3020f338df74fb5ae55e5b (diff)
lok: fix wrong metric conversion of the metric input control
The client side does not work well if the browser has different locale, and the input element conversion fails or change to a different value, so the value is converted to a neutral locale. Change-Id: I89f96844603a8552609d486590c7de752cb5a95c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92395 Reviewed-by: Henry Castro <hcastro@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93069 Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94519 Tested-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 8965f38b56cf..69b4739ede2c 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -35,6 +35,7 @@
#include <unotools/localedatawrapper.hxx>
#include <unotools/viewoptions.hxx>
#include <vcl/button.hxx>
+#include <unotools/localedatawrapper.hxx>
#include <vcl/canvastools.hxx>
#include <vcl/virdev.hxx>
#include <vcl/svapp.hxx>
@@ -819,26 +820,28 @@ void PosSizePropertyPanel::NotifyItemUpdate(
void PosSizePropertyPanel::GetControlState(const sal_uInt16 nSID, boost::property_tree::ptree& rState)
{
- weld::MetricSpinButton* pControl = nullptr;
+ VclPtr<MetricField> pControl = nullptr;
switch (nSID)
{
case SID_ATTR_TRANSFORM_POS_X:
- pControl = mxMtrPosX.get();
+ pControl = mpMtrPosX;
break;
case SID_ATTR_TRANSFORM_POS_Y:
- pControl = mxMtrPosY.get();
+ pControl = mpMtrPosY;
break;
case SID_ATTR_TRANSFORM_WIDTH:
- pControl = mxMtrWidth.get();
+ pControl = mpMtrWidth;
break;
case SID_ATTR_TRANSFORM_HEIGHT:
- pControl = mxMtrHeight.get();
+ pControl = mpMtrHeight;
break;
}
- if (pControl && !pControl->get_text().isEmpty())
+ if (pControl && !pControl->GetText().isEmpty())
{
- rState.put(pControl->get_buildable_name().getStr(), pControl->get_text().toUtf8().getStr());
+ OUString sValue = Application::GetSettings().GetNeutralLocaleDataWrapper().
+ getNum(pControl->GetValue(pControl->GetUnit()), pControl->GetDecimalDigits(), false, false);
+ rState.put(pControl->get_id().toUtf8().getStr(), sValue.toUtf8().getStr());
}
}