diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-01-20 13:55:03 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-20 14:46:21 +0000 |
commit | d33b4c311e3b9c0b8f50080cb38a31c19f587a16 (patch) | |
tree | bbb66c18dfe5dcdffbfa7d358d6a111bf8e5f518 /editeng | |
parent | c6c70c93461d5da4464ef38c8420b53ee609a4d1 (diff) |
Related: #i56998# use locale rules to format percentage
Change-Id: I4b744cf10165383153d2a71c05df0c0ed327c641
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/frmitems.cxx | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 6fd91136ec60..69bdcf16f630 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -43,6 +43,7 @@ #include <com/sun/star/frame/status/UpperLowerMarginScale.hpp> #include <com/sun/star/drawing/ShadingPattern.hpp> +#include <i18nutil/unicode.hxx> #include <unotools/securityoptions.hxx> #include <unotools/ucbstreamhelper.hxx> #include <limits.h> @@ -56,6 +57,7 @@ #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> #include <vcl/graphicfilter.hxx> +#include <vcl/svapp.hxx> #include <editeng/editids.hrc> #include <editeng/editrids.hrc> #include <editeng/pbinitem.hxx> @@ -600,19 +602,28 @@ SfxItemPresentation SvxLRSpaceItem::GetPresentation case SFX_ITEM_PRESENTATION_NAMELESS: { if ( 100 != nPropLeftMargin ) - rText = OUString::number( nPropLeftMargin ) + "%"; + { + rText = unicode::formatPercent(nPropLeftMargin, + Application::GetSettings().GetUILanguageTag()); + } else rText = GetMetricText( (long)nLeftMargin, eCoreUnit, ePresUnit, pIntl ); rText += OUString(cpDelim); if ( 100 != nPropFirstLineOfst ) - rText = rText + OUString::number( nPropFirstLineOfst ) + "%"; + { + rText += unicode::formatPercent(nPropFirstLineOfst, + Application::GetSettings().GetUILanguageTag()); + } else rText += GetMetricText( (long)nFirstLineOfst, eCoreUnit, ePresUnit, pIntl ); rText += OUString(cpDelim); if ( 100 != nRightMargin ) - rText = rText + OUString::number( nRightMargin ) + "%"; + { + rText += unicode::formatPercent(nRightMargin, + Application::GetSettings().GetUILanguageTag()); + } else rText += GetMetricText( (long)nRightMargin, eCoreUnit, ePresUnit, pIntl ); @@ -622,7 +633,8 @@ SfxItemPresentation SvxLRSpaceItem::GetPresentation { rText = EE_RESSTR(RID_SVXITEMS_LRSPACE_LEFT); if ( 100 != nPropLeftMargin ) - rText += OUString::number( nPropLeftMargin ) + "%"; + rText += unicode::formatPercent(nPropLeftMargin, + Application::GetSettings().GetUILanguageTag()); else { rText = rText + @@ -634,7 +646,8 @@ SfxItemPresentation SvxLRSpaceItem::GetPresentation { rText += EE_RESSTR(RID_SVXITEMS_LRSPACE_FLINE); if ( 100 != nPropFirstLineOfst ) - rText = rText + OUString::number( nPropFirstLineOfst ) + "%"; + rText = rText + unicode::formatPercent(nPropFirstLineOfst, + Application::GetSettings().GetUILanguageTag()); else { rText = rText + @@ -646,7 +659,8 @@ SfxItemPresentation SvxLRSpaceItem::GetPresentation } rText += EE_RESSTR(RID_SVXITEMS_LRSPACE_RIGHT); if ( 100 != nPropRightMargin ) - rText = rText + OUString::number( nPropRightMargin ) + "%"; + rText = rText + unicode::formatPercent(nPropRightMargin, + Application::GetSettings().GetUILanguageTag()); else { rText = rText + @@ -961,12 +975,18 @@ SfxItemPresentation SvxULSpaceItem::GetPresentation case SFX_ITEM_PRESENTATION_NAMELESS: { if ( 100 != nPropUpper ) - rText = OUString::number( nPropUpper ) + "%"; + { + rText = unicode::formatPercent(nPropUpper, + Application::GetSettings().GetUILanguageTag()); + } else rText = GetMetricText( (long)nUpper, eCoreUnit, ePresUnit, pIntl ); rText += OUString(cpDelim); if ( 100 != nPropLower ) - rText += OUString::number( nPropLower ) + "%"; + { + rText += unicode::formatPercent(nPropLower, + Application::GetSettings().GetUILanguageTag()); + } else rText += GetMetricText( (long)nLower, eCoreUnit, ePresUnit, pIntl ); return SFX_ITEM_PRESENTATION_NAMELESS; @@ -975,7 +995,10 @@ SfxItemPresentation SvxULSpaceItem::GetPresentation { rText = EE_RESSTR(RID_SVXITEMS_ULSPACE_UPPER); if ( 100 != nPropUpper ) - rText += OUString::number( nPropUpper ) + "%"; + { + rText += unicode::formatPercent(nPropUpper, + Application::GetSettings().GetUILanguageTag()); + } else { rText = rText + @@ -984,7 +1007,10 @@ SfxItemPresentation SvxULSpaceItem::GetPresentation } rText = rText + OUString(cpDelim) + EE_RESSTR(RID_SVXITEMS_ULSPACE_LOWER); if ( 100 != nPropLower ) - rText += OUString::number( nPropLower ) + "%"; + { + rText += unicode::formatPercent(nPropLower, + Application::GetSettings().GetUILanguageTag()); + } else { rText = rText + |