[Libreoffice-commits] core.git: sw/source

Caolán McNamara caolanm at redhat.com
Mon Jan 20 04:38:25 PST 2014


 sw/source/ui/utlui/attrdesc.cxx |   22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

New commits:
commit 96c0f5b1c712e72e4a5ad6b69e744d6187afdc83
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 20 12:36:32 2014 +0000

    Related: #i56998# use locale rules to format percentage
    
    Change-Id: I26af0abee94c911fd0d2b84e829f4489e625c0b2

diff --git a/sw/source/ui/utlui/attrdesc.cxx b/sw/source/ui/utlui/attrdesc.cxx
index 65278f5..48e2e13 100644
--- a/sw/source/ui/utlui/attrdesc.cxx
+++ b/sw/source/ui/utlui/attrdesc.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <i18nutil/unicode.hxx>
 #include <svl/itemiter.hxx>
 #include <vcl/svapp.hxx>
 #include <editeng/itemtype.hxx>
@@ -336,7 +337,8 @@ SfxItemPresentation SwFmtFrmSize::GetPresentation
             rText = SW_RESSTR( STR_FRM_WIDTH ) + " ";
             if ( GetWidthPercent() )
             {
-                rText = rText + OUString::number(GetWidthPercent()) + "%";
+                rText = rText + unicode::formatPercent(GetWidthPercent(),
+                    Application::GetSettings().GetUILanguageTag());
             }
             else
             {
@@ -350,7 +352,8 @@ SfxItemPresentation SwFmtFrmSize::GetPresentation
                 rText = rText + ", " + SW_RESSTR( nId ) + " ";
                 if ( GetHeightPercent() )
                 {
-                    rText = rText + OUString::number(GetHeightPercent()) + "%";
+                    rText = rText + unicode::formatPercent(GetHeightPercent(),
+                        Application::GetSettings().GetUILanguageTag());
                 }
                 else
                 {
@@ -1042,7 +1045,8 @@ SfxItemPresentation SwLuminanceGrf::GetPresentation(
             rText = SW_RESSTR( STR_LUMINANCE );
         else if( rText.getLength() )
             rText = OUString();
-        rText = rText + OUString::number( GetValue() ) + "%";
+        rText = rText + unicode::formatPercent(GetValue(),
+            Application::GetSettings().GetUILanguageTag());
         break;
 
     default:
@@ -1065,7 +1069,8 @@ SfxItemPresentation SwContrastGrf::GetPresentation(
             rText = SW_RESSTR( STR_CONTRAST );
         else if( rText.getLength() )
             rText = OUString();
-        rText = rText + OUString::number( GetValue() ) + "%";
+        rText = rText + unicode::formatPercent(GetValue(),
+            Application::GetSettings().GetUILanguageTag());
         break;
 
     default:
@@ -1101,7 +1106,8 @@ SfxItemPresentation SwChannelGrf::GetPresentation(
         }
         else if( rText.getLength() )
             rText = OUString();
-        rText = rText + OUString::number( GetValue() ) + "%";
+        rText = rText + unicode::formatPercent(GetValue(),
+            Application::GetSettings().GetUILanguageTag());
         break;
 
     default:
@@ -1123,7 +1129,8 @@ SfxItemPresentation SwGammaGrf::GetPresentation(
     case SFX_ITEM_PRESENTATION_COMPLETE:
         if( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
             aText.append(SW_RESSTR(STR_GAMMA));
-        aText.append(GetValue()).append('%');
+        aText.append(unicode::formatPercent(GetValue(),
+            Application::GetSettings().GetUILanguageTag()));
         break;
 
     default:
@@ -1169,7 +1176,8 @@ SfxItemPresentation SwTransparencyGrf::GetPresentation(
             rText = SW_RESSTR( STR_TRANSPARENCY );
         else if( rText.getLength() )
             rText = OUString();
-        rText = rText + OUString::number( GetValue() ) + "%";
+        rText = rText + unicode::formatPercent(GetValue(),
+            Application::GetSettings().GetUILanguageTag());
         break;
 
     default:


More information about the Libreoffice-commits mailing list