diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-05-07 15:40:57 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-05-07 23:07:45 +0200 |
commit | a640676e06bdab3471f5c9f04dd9403bc66ddc22 (patch) | |
tree | 9b85d9b3a2edeb84f689b193e186daed56423183 /svx | |
parent | dcd1795c4934e66378d4b88c914f8e9bb1678ba7 (diff) |
tdf#101181: store glow radius in 100ths of mm instead of EMUs
... as we do for all metric values. This fixes storing values like
"190.5cm" in ODF for 15 pt (should be "0.529cm").
Change-Id: I382756af56464424dcb24ed8801d0a4203658c11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93640
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sdr/primitive2d/sdrdecompositiontools.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/glow/GlowPropertyPanel.cxx | 13 |
2 files changed, 3 insertions, 12 deletions
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index 193d94492756..e4f67c0ed665 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -540,7 +540,7 @@ namespace drawinglayer::primitive2d const uno::Sequence< beans::PropertyValue > xViewParameters; geometry::ViewInformation2D aViewInformation2D(xViewParameters); aRetval[0] = Primitive2DReference( - new GlowPrimitive2D(rGlow.getColor(), rGlow.getRadius() / 360.0, rContent)); + new GlowPrimitive2D(rGlow.getColor(), rGlow.getRadius(), rContent)); aRetval[1] = Primitive2DReference(new GroupPrimitive2D(rContent)); return aRetval; } diff --git a/svx/source/sidebar/glow/GlowPropertyPanel.cxx b/svx/source/sidebar/glow/GlowPropertyPanel.cxx index ef3a1951e128..74a3d26d84ba 100644 --- a/svx/source/sidebar/glow/GlowPropertyPanel.cxx +++ b/svx/source/sidebar/glow/GlowPropertyPanel.cxx @@ -21,15 +21,6 @@ #include <svx/xcolit.hxx> #include <rtl/math.hxx> -namespace -{ -sal_Int32 EMU2Pt(sal_Int32 nEMU) -{ - return static_cast<sal_Int32>(rtl::math::round(nEMU / 12700.0)); -} -sal_Int32 Pt2EMU(sal_Int32 nPt) { return nPt * 12700; } -} - namespace svx::sidebar { GlowPropertyPanel::GlowPropertyPanel(vcl::Window* pParent, @@ -96,7 +87,7 @@ IMPL_LINK_NOARG(GlowPropertyPanel, ModifyGlowColorHdl, ColorListBox&, void) IMPL_LINK_NOARG(GlowPropertyPanel, ModifyGlowRadiusHdl, weld::MetricSpinButton&, void) { - SdrMetricItem aItem(SDRATTR_GLOW_RAD, Pt2EMU(mxGlowRadius->get_value(FieldUnit::POINT))); + SdrMetricItem aItem(SDRATTR_GLOW_RAD, mxGlowRadius->get_value(FieldUnit::MM_100TH)); mpBindings->GetDispatcher()->ExecuteList(SID_ATTR_GLOW_RADIUS, SfxCallMode::RECORD, { &aItem }); } @@ -159,7 +150,7 @@ void GlowPropertyPanel::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState eState, const SdrMetricItem* pRadiusItem = dynamic_cast<const SdrMetricItem*>(pState); if (pRadiusItem) { - mxGlowRadius->set_value(EMU2Pt(pRadiusItem->GetValue()), FieldUnit::POINT); + mxGlowRadius->set_value(pRadiusItem->GetValue(), FieldUnit::MM_100TH); } } } |