summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <timar@fsf.hu>2010-10-21 11:19:47 +0200
committerAndras Timar <timar@fsf.hu>2010-10-21 11:19:47 +0200
commit9fe87047580c7a2893ac290fb90edb67b76b3a90 (patch)
tree343adecaef218e1c6cae0dad8dff61ce35f9451e
parent026c85ff21efaf569b9a40dff83ef5027d0292b9 (diff)
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.
-rw-r--r--sc/inc/globstr.hrc5
-rw-r--r--sc/source/ui/src/globstr.src4
-rw-r--r--sc/source/ui/view/gridwin4.cxx8
3 files changed, 10 insertions, 7 deletions
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 1f16de350..70f1c9a0b 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 c18dd7240..a3fd6d5b7 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 4a1f18cba..e4760fb3f 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 )
{