[Libreoffice-commits] .: sc/inc sc/source

Andras Timar timar at kemper.freedesktop.org
Thu Oct 21 02:30:06 PDT 2010


 sc/inc/globstr.hrc             |    5 +++--
 sc/source/ui/src/globstr.src   |    4 ++++
 sc/source/ui/view/gridwin4.cxx |    8 +++-----
 3 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 9fe87047580c7a2893ac290fb90edb67b76b3a90
Author: Andras Timar <timar at fsf.hu>
Date:   Thu Oct 21 11:19:47 2010 +0200

    fixed an i18n problem
    
    Constructing "string + ordinal number" terms programmatically is
    an i18n issue, because in some languages (e.g. in Hungarian)
    ordinal number should precede the string. The patch solves
    http://bug.openscope.org/browse/OOO-85 reported by a Hungarian
    localizer ("Oldal 1" should be "1. oldal"). There are more
    occurences of this construction in the code of LibreOffice
    but this was highly visible and it is correct in Hungarian Excel.

diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 1f16de3..70f1c9a 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -595,7 +595,8 @@
 #define STR_FORM_SPINNER            455
 #define STR_FORM_SCROLLBAR          456
 
-#define STR_COUNT                       457
+#define STR_PGNUM                    457
 
-#endif
+#define STR_COUNT                       458
 
+#endif
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index c18dd72..a3fd6d5 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -619,6 +619,10 @@ Resource RID_GLOBSTR
     {
         Text [ en-US ] = "Page" ;
     };
+    String STR_PGNUM
+    {
+        Text [ en-US ] = "Page %1" ;
+    };
     String STR_LOAD_DOC
     {
         Text [ en-US ] = "Load document" ;
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 4a1f18c..e4760fb 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -962,15 +962,14 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
         Color aManual( rColorCfg.GetColorValue(svtools::CALCPAGEBREAKMANUAL).nColor );
         Color aAutomatic( rColorCfg.GetColorValue(svtools::CALCPAGEBREAK).nColor );
 
-        String aPageText = ScGlobal::GetRscString( STR_PAGE );
+        String aPageStr = ScGlobal::GetRscString( STR_PGNUM );
         if ( nPageScript == 0 )
         {
             //	get script type of translated "Page" string only once
-            nPageScript = pDoc->GetStringScriptType( aPageText );
+            nPageScript = pDoc->GetStringScriptType( aPageStr );
             if (nPageScript == 0)
                 nPageScript = ScGlobal::GetDefaultScriptType();
         }
-        aPageText += ' ';
 
         Font aFont;
         ScEditEngineDefaulter* pEditEng = NULL;
@@ -1095,8 +1094,7 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
                                     nPageNo += ((long)nColPos)*nRowBreaks+nRowPos;
                                 else
                                     nPageNo += ((long)nRowPos)*nColBreaks+nColPos;
-                                String aPageStr = aPageText;
-                                aPageStr += String::CreateFromInt32(nPageNo);
+                                aPageStr.SearchAndReplaceAscii("%1", String::CreateFromInt32(nPageNo));
 
                                 if ( pEditEng )
                                 {


More information about the Libreoffice-commits mailing list