summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorDobra Gabor <dobragab@gmail.com>2015-04-02 14:48:41 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2015-04-10 12:30:20 +0000
commit4d000e85633c8e97e73bfc68a128dd7bea31223f (patch)
tree796906d7224eeb7f8f30b3f6b94b9f7b4a2a2a23 /sd
parent2819ee71da631116662401f14f8a0fb78c2a7f3a (diff)
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@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/app/strings.src8
-rw-r--r--sd/source/ui/inc/strings.hrc15
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx17
-rw-r--r--sd/source/ui/view/drviewsa.cxx17
-rw-r--r--sd/source/ui/view/outlnvsh.cxx9
5 files changed, 35 insertions, 31 deletions
diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src
index 991ee3a9ec71..4743c4500c98 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 aa92fb31cfe7..bbc6a4573210 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 24712a5bd941..d6ac365ef3fb 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 87464ebd77b2..420a884012b0 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 24df4ce1107b..4c6c1fb996cd 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);