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

Samuel Mehrbrodt s.mehrbrodt at gmail.com
Sat Aug 30 01:24:37 PDT 2014


 sw/inc/globals.hrc                |   48 +++++++++++++++++++-------------------
 sw/source/ui/shells/shells.src    |    8 ++++++
 sw/source/uibase/inc/view.hxx     |    1 
 sw/source/uibase/uiview/view.cxx  |    1 
 sw/source/uibase/uiview/view2.cxx |   21 +++++-----------
 5 files changed, 40 insertions(+), 39 deletions(-)

New commits:
commit 4b4e4ccf8d571fd6f6ee538c4e406b07fc810e2d
Author: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
Date:   Wed Aug 27 23:52:28 2014 +0200

    fdo#80617 Use complete string to allow translation for page number info
    
    Change-Id: I8cc899f70ee4dcd65495b8ccc153a8fc3a2cc413
    Reviewed-on: https://gerrit.libreoffice.org/11157
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
    Reviewed-by: Thomas Arnhold <thomas at arnhold.org>
    Tested-by: Thomas Arnhold <thomas at arnhold.org>

diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc
index 5121a62..99cad7c 100644
--- a/sw/inc/globals.hrc
+++ b/sw/inc/globals.hrc
@@ -31,7 +31,9 @@
 #define STR_DOC_STAT                (RC_GLOBALS_BEGIN + 10)
 
 #define STR_PAGE                    (RC_GLOBALS_BEGIN + 14)
-#define STR_PRINTOPTUI              (RC_GLOBALS_BEGIN + 15)
+#define STR_PAGE_COUNT              (RC_GLOBALS_BEGIN + 15)
+#define STR_PAGE_COUNT_CUSTOM       (RC_GLOBALS_BEGIN + 16)
+#define STR_PRINTOPTUI              (RC_GLOBALS_BEGIN + 17)
 
 #define ST_SCRIPT_WESTERN           (RC_GLOBALS_BEGIN + 105)
 #define ST_SCRIPT_ASIAN             (RC_GLOBALS_BEGIN + 106)
@@ -39,32 +41,32 @@
 
 //EventStrings
 
-#define STR_EVENT_OBJECT_SELECT      ( RC_GLOBALS_BEGIN + 17 )
-#define STR_EVENT_START_INS_GLOSSARY ( RC_GLOBALS_BEGIN + 18 )
-#define STR_EVENT_END_INS_GLOSSARY   ( RC_GLOBALS_BEGIN + 19 )
-#define STR_EVENT_MOUSEOVER_OBJECT   ( RC_GLOBALS_BEGIN + 20 )
-#define STR_EVENT_MOUSECLICK_OBJECT  ( RC_GLOBALS_BEGIN + 21 )
-#define STR_EVENT_MOUSEOUT_OBJECT    ( RC_GLOBALS_BEGIN + 22 )
-#define STR_EVENT_IMAGE_LOAD         ( RC_GLOBALS_BEGIN + 23 )
-#define STR_EVENT_IMAGE_ABORT        ( RC_GLOBALS_BEGIN + 24 )
-#define STR_EVENT_IMAGE_ERROR        ( RC_GLOBALS_BEGIN + 25 )
-#define STR_EVENT_FRM_KEYINPUT_A     ( RC_GLOBALS_BEGIN + 26 )
-#define STR_EVENT_FRM_KEYINPUT_NOA   ( RC_GLOBALS_BEGIN + 27 )
-#define STR_EVENT_FRM_RESIZE         ( RC_GLOBALS_BEGIN + 28 )
-#define STR_EVENT_FRM_MOVE           ( RC_GLOBALS_BEGIN + 29 )
+#define STR_EVENT_OBJECT_SELECT      ( RC_GLOBALS_BEGIN + 18 )
+#define STR_EVENT_START_INS_GLOSSARY ( RC_GLOBALS_BEGIN + 19 )
+#define STR_EVENT_END_INS_GLOSSARY   ( RC_GLOBALS_BEGIN + 20 )
+#define STR_EVENT_MOUSEOVER_OBJECT   ( RC_GLOBALS_BEGIN + 21 )
+#define STR_EVENT_MOUSECLICK_OBJECT  ( RC_GLOBALS_BEGIN + 22 )
+#define STR_EVENT_MOUSEOUT_OBJECT    ( RC_GLOBALS_BEGIN + 23 )
+#define STR_EVENT_IMAGE_LOAD         ( RC_GLOBALS_BEGIN + 24 )
+#define STR_EVENT_IMAGE_ABORT        ( RC_GLOBALS_BEGIN + 25 )
+#define STR_EVENT_IMAGE_ERROR        ( RC_GLOBALS_BEGIN + 26 )
+#define STR_EVENT_FRM_KEYINPUT_A     ( RC_GLOBALS_BEGIN + 27 )
+#define STR_EVENT_FRM_KEYINPUT_NOA   ( RC_GLOBALS_BEGIN + 28 )
+#define STR_EVENT_FRM_RESIZE         ( RC_GLOBALS_BEGIN + 29 )
+#define STR_EVENT_FRM_MOVE           ( RC_GLOBALS_BEGIN + 30 )
 
 // Strings for frame alignment in Popup
-#define STR_TOP_BASE                (RC_GLOBALS_BEGIN + 30)
-#define STR_BOTTOM_BASE             (RC_GLOBALS_BEGIN + 31)
-#define STR_CENTER_BASE             (RC_GLOBALS_BEGIN + 32)
-#define STR_TOP                     (RC_GLOBALS_BEGIN + 33)
-#define STR_BOTTOM                  (RC_GLOBALS_BEGIN + 34)
-#define STR_CENTER_HORI             (RC_GLOBALS_BEGIN + 35)
-#define STR_CENTER_VERT             (RC_GLOBALS_BEGIN + 36)
+#define STR_TOP_BASE                (RC_GLOBALS_BEGIN + 31)
+#define STR_BOTTOM_BASE             (RC_GLOBALS_BEGIN + 32)
+#define STR_CENTER_BASE             (RC_GLOBALS_BEGIN + 33)
+#define STR_TOP                     (RC_GLOBALS_BEGIN + 34)
+#define STR_BOTTOM                  (RC_GLOBALS_BEGIN + 35)
+#define STR_CENTER_HORI             (RC_GLOBALS_BEGIN + 36)
+#define STR_CENTER_VERT             (RC_GLOBALS_BEGIN + 37)
 
-#define STR_LOAD_HTML_DOC           (RC_GLOBALS_BEGIN + 37)
+#define STR_LOAD_HTML_DOC           (RC_GLOBALS_BEGIN + 38)
 
-#define STR_JAVA_EDIT               (RC_GLOBALS_BEGIN + 38)
+#define STR_JAVA_EDIT               (RC_GLOBALS_BEGIN + 39)
 
 #define STR_REMOVE_WARNING          (RC_GLOBALS_BEGIN + 40)
 
diff --git a/sw/source/ui/shells/shells.src b/sw/source/ui/shells/shells.src
index 45c0112..03668eb 100644
--- a/sw/source/ui/shells/shells.src
+++ b/sw/source/ui/shells/shells.src
@@ -107,6 +107,14 @@ String STR_PAGE
 {
         Text [ en-US ] = "Page " ;
 };
+String STR_PAGE_COUNT
+{
+        Text [ en-US ] = "Page %1 of %2" ;
+};
+String STR_PAGE_COUNT_CUSTOM
+{
+        Text [ en-US ] = "Page %1 of %2 (Page %3)" ;
+};
 String RID_TEXT_TOOLBOX
 {
         Text [ en-US ] = "Text Object Bar" ;
diff --git a/sw/source/uibase/inc/view.hxx b/sw/source/uibase/inc/view.hxx
index 6d519a5..fd09bf4 100644
--- a/sw/source/uibase/inc/view.hxx
+++ b/sw/source/uibase/inc/view.hxx
@@ -170,7 +170,6 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
 
     SvxHtmlOptions      m_aHTMLOpt;
     Timer               m_aTimer;         // for delayed ChgLnks during an action
-    OUString            m_aPageStr;       // status view, current page
     OUString            m_sSwViewData,
     //and the new cursor position if the user double click in the PagePreview
                         m_sNewCrsrPos;
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 9d892d6..5ed48eb 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -693,7 +693,6 @@ void SwView::_CheckReadonlySelection()
 
 SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
     : SfxViewShell( _pFrame, SWVIEWFLAGS ),
-    m_aPageStr( SW_RES( STR_PAGE )),
     m_nNewPage(USHRT_MAX),
     m_nOldPageNum(0),
     m_pNumRuleNodeFromDoc(0),
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 785bf63..eb908f1 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -193,30 +193,23 @@ static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, sal_uInt16 nWhi
  *
  * @param nPhyNum  The physical page number
  * @param nVirtNum The logical page number (user-assigned)
- * @param rPgStr   User-defined page name (will be used instead of nVirtNum)
+ * @param rPgStr   User-defined page name (will be shown if different from logical page number)
  *
- * @return OUString Formatted string: Page 1/10 (rPgStr/logical page number)
+ * @return OUString Formatted string: Page 1/10 (Page nVirtNumv/rPgStr)
  **/
 OUString SwView::GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr)
 {
-    OUString aStr(m_aPageStr);
-    aStr += OUString::number(nPhyNum);
-    aStr += "/";
-    aStr += OUString::number(GetWrtShell().GetPageCnt());
-
     // Show user-defined page number in brackets if any.
     OUString extra;
     if (!rPgStr.isEmpty() && OUString::number(nPhyNum) != rPgStr)
         extra = rPgStr;
     else if (nPhyNum != nVirtNum)
         extra = OUString::number(nVirtNum);
-    if (!extra.isEmpty())
-    {
-        aStr += " (";
-        aStr += m_aPageStr;
-        aStr += extra;
-        aStr += ")";
-    }
+
+    OUString aStr(extra.isEmpty() ? SW_RES(STR_PAGE_COUNT) : SW_RES(STR_PAGE_COUNT_CUSTOM));
+    aStr = aStr.replaceFirst("%1", OUString::number(nPhyNum));
+    aStr = aStr.replaceFirst("%2", OUString::number(GetWrtShell().GetPageCnt()));
+    aStr = aStr.replaceFirst("%3", extra);
     return aStr;
 }
 


More information about the Libreoffice-commits mailing list