summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-02-20 13:28:10 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-02-20 13:23:27 +0100
commit3fcf374de426102da36f5b07fda5b0534de62233 (patch)
treea1eec8352d51103c3aa473fabcb179d05149f773
parent5f4366236537b7e44afd5b559c826db8ce35d404 (diff)
tdf#115874: show non-zero fraction part for pts
Change-Id: I6183d9d7e28b76bb4da0229c42573ee833f2520a Reviewed-on: https://gerrit.libreoffice.org/50033 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--editeng/source/items/itemtype.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/editeng/source/items/itemtype.cxx b/editeng/source/items/itemtype.cxx
index 6019ddc220c8..f3b26da98e09 100644
--- a/editeng/source/items/itemtype.cxx
+++ b/editeng/source/items/itemtype.cxx
@@ -32,6 +32,7 @@
OUString GetMetricText( long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const IntlWrapper* pIntl )
{
bool bNeg = false;
+ bool bShowAtLeastOneDecimalDigit = true;
sal_Int32 nRet = 0;
if ( nVal < 0 )
@@ -77,6 +78,11 @@ OUString GetMetricText( long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const In
}
case MapUnit::MapPoint:
+ // fractions of a point are used, e.g., for font size
+ nRet = OutputDevice::LogicToLogic(nVal, eSrcUnit, MapUnit::MapTwip) * 50;
+ bShowAtLeastOneDecimalDigit = false;
+ break;
+
case MapUnit::MapTwip:
case MapUnit::MapPixel:
return OUString::number( OutputDevice::LogicToLogic(
@@ -110,7 +116,7 @@ OUString GetMetricText( long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const In
else
sRet.append(nRet / nDiff);
nRet %= nDiff;
- if( 4 == nDigits )
+ if( 4 == nDigits && (bShowAtLeastOneDecimalDigit || nRet) )
{
if(pIntl)
sRet.append(pIntl->getLocaleData()->getNumDecimalSep());