[Libreoffice-commits] core.git: sd/source
Rob Snelders
programming at ertai.nl
Sat Mar 23 07:36:40 PDT 2013
sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 35 +++++++----------
1 file changed, 16 insertions(+), 19 deletions(-)
New commits:
commit 015131c87e14f84040cfa579bc81419714cbe964
Author: Rob Snelders <programming at ertai.nl>
Date: Sat Mar 23 13:36:00 2013 +0100
Give the number of slides also when more slides are selected
Change-Id: I2a169831f2caada6d052edb697036a53ca67ddd0
Reviewed-on: https://gerrit.libreoffice.org/2927
Reviewed-by: Thorsten Behrens <tbehrens at suse.com>
Tested-by: Thorsten Behrens <tbehrens at suse.com>
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index a3f2ba7..6db42a0 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -814,16 +814,15 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
// page view and layout
SdPage* pPage = NULL;
SdPage* pFirstPage = NULL;
- sal_uInt16 nFirstPage;
- sal_uInt16 nSelectedPages = (sal_uInt16)mrSlideSorter.GetController().GetPageSelector().GetSelectedPageCount();
- rtl::OUString aPageStr;
+ sal_uInt16 nFirstPage;
+ sal_uInt16 nSelectedPages = mrSlideSorter.GetController().GetPageSelector().GetSelectedPageCount();
+ OUStringBuffer aPageStr;
String aLayoutStr;
+ //Set number of slides
if (nSelectedPages > 0)
- aPageStr = SD_RESSTR(STR_SD_PAGE);
-
- if (nSelectedPages == 1)
{
+ aPageStr = SD_RESSTR(STR_SLIDE_SINGULAR);
model::PageEnumeration aSelectedPages (
model::PageEnumerationProvider::CreateSelectedPagesEnumeration(
mrSlideSorter.GetModel()));
@@ -831,22 +830,20 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
if (pDescriptor)
{
pPage = pDescriptor->GetPage();
- nFirstPage = pPage->GetPageNum()/2;
- pFirstPage = pPage;
-
- aPageStr += " ";
- aPageStr += rtl::OUString::valueOf( static_cast<sal_Int32>(nFirstPage + 1) );
- aPageStr += " / " ;
- aPageStr += rtl::OUString::valueOf(mrSlideSorter.GetModel().GetPageCount());
-
- aLayoutStr = pFirstPage->GetLayoutName();
- aLayoutStr.Erase( aLayoutStr.SearchAscii( SD_LT_SEPARATOR ) );
+ nFirstPage = (pPage->GetPageNum()/2) + 1;
+ aPageStr.append(" ").append(static_cast<sal_Int32>(nFirstPage), 10).append(" / ").append(mrSlideSorter.GetModel().GetPageCount(), 10);
}
+ rSet.Put( SfxStringItem( SID_STATUS_PAGE, aPageStr.makeStringAndClear() ) );
}
- rSet.Put( SfxStringItem( SID_STATUS_PAGE, aPageStr ) );
- rSet.Put( SfxStringItem( SID_STATUS_LAYOUT, aLayoutStr ) );
-
+ //Set layout
+ if (nSelectedPages == 1 && pPage != NULL)
+ {
+ pFirstPage = pPage;
+ aLayoutStr = pFirstPage->GetLayoutName();
+ aLayoutStr.Erase( aLayoutStr.SearchAscii( SD_LT_SEPARATOR ) );
+ rSet.Put( SfxStringItem( SID_STATUS_LAYOUT, aLayoutStr ) );
+ }
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ATTR_ZOOMSLIDER ) )
{
rSet.Put( SfxVoidItem( SID_ATTR_ZOOMSLIDER ) );
More information about the Libreoffice-commits
mailing list