[Libreoffice-commits] core.git: sc/inc sc/source sd/source
Dobra Gabor
dobragab at gmail.com
Fri Apr 10 05:30:49 PDT 2015
sc/inc/globstr.hrc | 4 +++-
sc/source/ui/src/globstr.src | 4 ++++
sc/source/ui/view/cellsh.cxx | 11 ++++++-----
sd/source/ui/app/strings.src | 8 ++++++++
sd/source/ui/inc/strings.hrc | 15 +++++++++------
sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 17 ++++++++---------
sd/source/ui/view/drviewsa.cxx | 17 ++++++-----------
sd/source/ui/view/outlnvsh.cxx | 9 ++++-----
8 files changed, 48 insertions(+), 37 deletions(-)
New commits:
commit 4d000e85633c8e97e73bfc68a128dd7bea31223f
Author: Dobra Gabor <dobragab at gmail.com>
Date: Thu Apr 2 14:48:41 2015 +0200
tdf#89641 Page numbering in Calc and Draw/Impress
Change-Id: I5ce2f528ae4a243ea8402c787b5c77cf75052d2e
Format: "Slide 2 / 3" changed to "Slide 2 of 3 (1)".
Reviewed-on: https://gerrit.libreoffice.org/14806
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
Tested-by: Katarina Behrens <Katarina.Behrens at cib.de>
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 9ef50d5..07896d4 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -698,7 +698,9 @@
#define STR_UNQUOTED_STRING 533
#define STR_ENTER_VALUE 534
-#define SC_GLOBSTR_STR_COUNT 535 /**< the count of permanently resident strings */
+#define STR_TABLE_COUNT 535
+
+#define SC_GLOBSTR_STR_COUNT 536 /**< the count of permanently resident strings */
#endif
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 40b6b93..318ec1d 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -2089,6 +2089,10 @@ Resource RID_GLOBSTR
{
Text[ en-US ] = "Enter a value!";
};
+ String STR_TABLE_COUNT
+ {
+ Text [ en-US ] = "Sheet %1 of %2";
+ };
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 6078b6c..c0eac46 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -678,11 +678,12 @@ void ScCellShell::GetState(SfxItemSet &rSet)
case SID_STATUS_DOCPOS:
{
- OUString aStr = ScGlobal::GetRscString( STR_TABLE ) +
- " " + OUString::number( nTab + 1 ) +
- " / " + OUString::number( nTabCount );
- rSet.Put( SfxStringItem( nWhich, aStr ) );
- }
+ OUString aStr = ScGlobal::GetRscString( STR_TABLE_COUNT );
+
+ aStr = aStr.replaceFirst("%1", OUString::number( nTab + 1 ) );
+ aStr = aStr.replaceFirst("%2", OUString::number( nTabCount ) );
+
+ rSet.Put( SfxStringItem( nWhich, aStr ) ); }
break;
case SID_ROWCOL_SELCOUNT:
diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src
index 991ee3a..4743c45 100644
--- a/sd/source/ui/app/strings.src
+++ b/sd/source/ui/app/strings.src
@@ -371,6 +371,14 @@ String STR_SD_PAGE
{
Text [ en-US ] = "Slide" ;
};
+String STR_SD_PAGE_COUNT
+{
+ Text [ en-US ] = "Slide %1 of %2" ;
+};
+String STR_SD_PAGE_COUNT_CUSTOM
+{
+ Text [ en-US ] = "Slide %1 of %2 (%3)" ;
+};
String STR_ALL_FILES
{
Text [ en-US ] = "All files" ;
diff --git a/sd/source/ui/inc/strings.hrc b/sd/source/ui/inc/strings.hrc
index aa92fb3..bbc6a45 100644
--- a/sd/source/ui/inc/strings.hrc
+++ b/sd/source/ui/inc/strings.hrc
@@ -161,12 +161,15 @@
#define STR_TWAIN_NO_SOURCE_UNX (RID_APP_START+262)
#define STR_UNDO_DELETEPAGES (RID_APP_START+265)
#define STR_UNDO_INSERTPAGES (RID_APP_START+266)
-//free (RID_APP_START+267)
-#define STR_ASK_DELETE_LAYER (RID_APP_START+268)
-#define STR_UNDO_CHANGE_TITLE_AND_LAYOUT (RID_APP_START+269)
-#define STR_WAV_FILE (RID_APP_START+270)
-#define STR_MIDI_FILE (RID_APP_START+271)
-#define STR_SD_PAGE (RID_APP_START+272)
+
+#define STR_ASK_DELETE_LAYER (RID_APP_START+267)
+#define STR_UNDO_CHANGE_TITLE_AND_LAYOUT (RID_APP_START+268)
+#define STR_WAV_FILE (RID_APP_START+269)
+#define STR_MIDI_FILE (RID_APP_START+270)
+#define STR_SD_PAGE (RID_APP_START+271)
+#define STR_SD_PAGE_COUNT (RID_APP_START+272)
+#define STR_SD_PAGE_COUNT_CUSTOM (RID_APP_START+273)
+
#define STR_ALL_FILES (RID_APP_START+274)
#define STR_UNDO_INSERT_TEXTFRAME (RID_APP_START+275)
#define STR_ACTION_NOTPOSSIBLE (RID_APP_START+278)
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 24712a5..d6ac365 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -834,13 +834,12 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
sal_Int32 nPageCount;
sal_Int32 nActivePageCount;
sal_uInt16 nSelectedPages = mrSlideSorter.GetController().GetPageSelector().GetSelectedPageCount();
- OUStringBuffer aPageStr;
+ OUString aPageStr;
OUString aLayoutStr;
//Set number of slides
if (nSelectedPages > 0)
{
- aPageStr = SD_RESSTR(STR_SLIDE_SINGULAR);
model::PageEnumeration aSelectedPages (
model::PageEnumerationProvider::CreateSelectedPagesEnumeration(
mrSlideSorter.GetModel()));
@@ -852,15 +851,15 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
nPageCount = mrSlideSorter.GetModel().GetPageCount();
nActivePageCount = static_cast<sal_Int32>(mrSlideSorter.GetModel().GetDocument()->GetActiveSdPageCount());
- aPageStr.append(" ").append(static_cast<sal_Int32>(nFirstPage), 10).append(" / ").append(nPageCount, 10);
- if (nPageCount != nActivePageCount)
- {
- aPageStr.append(" (").append(nActivePageCount, 10).append(")");
- }
+ aPageStr = (nPageCount == nActivePageCount) ? SD_RESSTR(STR_SD_PAGE_COUNT) : SD_RESSTR(STR_SD_PAGE_COUNT_CUSTOM);
+
+ aPageStr = aPageStr.replaceFirst("%1", OUString::number(nFirstPage));
+ aPageStr = aPageStr.replaceFirst("%2", OUString::number(nPageCount));
+ if(nPageCount != nActivePageCount)
+ aPageStr = aPageStr.replaceFirst("%3", OUString::number(nActivePageCount));
}
- rSet.Put( SfxStringItem( SID_STATUS_PAGE, aPageStr.makeStringAndClear() ) );
+ rSet.Put( SfxStringItem( SID_STATUS_PAGE, aPageStr ) );
}
-
//Set layout
if (nSelectedPages == 1 && pPage != NULL)
{
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 87464eb..420a884 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -700,17 +700,12 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
sal_Int32 nPageCount = sal_Int32(GetDoc()->GetSdPageCount(mePageKind));
sal_Int32 nActivePageCount = sal_Int32(GetDoc()->GetActiveSdPageCount());
// Always show the slide/page number.
- OUString aOUString = SD_RESSTR(STR_SD_PAGE);
- aOUString += " ";
- aOUString += OUString::number( maTabControl.GetCurPageId() );
- aOUString += " / " ;
- aOUString += OUString::number( nPageCount );
- if (nPageCount != nActivePageCount)
- {
- aOUString += " (";
- aOUString += OUString::number( nActivePageCount );
- aOUString += ")";
- }
+ OUString aOUString = (nPageCount == nActivePageCount) ? SD_RESSTR(STR_SD_PAGE_COUNT) : SD_RESSTR(STR_SD_PAGE_COUNT_CUSTOM);
+
+ aOUString = aOUString.replaceFirst("%1", OUString::number(maTabControl.GetCurPageId()));
+ aOUString = aOUString.replaceFirst("%2", OUString::number(nPageCount));
+ if(nPageCount != nActivePageCount)
+ aOUString = aOUString.replaceFirst("%3", OUString::number(nActivePageCount));
// If in layer mode additionally show the layer that contains all
// selected shapes of the page. If the shapes are distributed on
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 24df4ce..4c6c1fb 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -1347,11 +1347,10 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet)
SdrPage* pPage = GetDoc()->GetSdPage( (sal_uInt16) nPos, PK_STANDARD );
- aPageStr = SD_RESSTR(STR_SD_PAGE);
- aPageStr += " ";
- aPageStr += OUString::number( (sal_Int32)(nPos + 1) ); // sal_uLong -> sal_Int32
- aPageStr += " / ";
- aPageStr += OUString::number( nPageCount );
+ aPageStr = SD_RESSTR(STR_SD_PAGE_COUNT);
+
+ aPageStr = aPageStr.replaceFirst("%1", OUString::number((sal_Int32)(nPos + 1)));
+ aPageStr = aPageStr.replaceFirst("%2", OUString::number(nPageCount));
aLayoutStr = pPage->GetLayoutName();
sal_Int32 nIndex = aLayoutStr.indexOf(SD_LT_SEPARATOR);
More information about the Libreoffice-commits
mailing list