summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorRob Snelders <programming@ertai.nl>2013-03-23 19:36:41 +0100
committerThorsten Behrens <tbehrens@suse.com>2013-03-23 22:58:52 +0100
commit99120b7ddc8ede9108d4a45a5605ac191fe22bc9 (patch)
tree8500cc2657aada3d22e8c5b7ff690861d77ba491 /sd
parent78eda507c8452e8f6d743427d56526a91b779790 (diff)
Display the number of active slides in the statusbar
Conflicts: sd/source/ui/view/drviews4.cxx Change-Id: I788070fdf093ec8b9f875ea5e81999990cd04501
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/drawdoc.hxx2
-rw-r--r--sd/source/core/PageListWatcher.cxx18
-rw-r--r--sd/source/core/PageListWatcher.hxx2
-rw-r--r--sd/source/core/drawdoc2.cxx6
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx11
-rw-r--r--sd/source/ui/view/drviews4.cxx2
-rw-r--r--sd/source/ui/view/drviewsa.cxx10
7 files changed, 48 insertions, 3 deletions
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 3d8997885403..d9b96793e28a 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -343,6 +343,8 @@ public:
SD_DLLPUBLIC SdPage*GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind);
SD_DLLPUBLIC sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const;
+ SD_DLLPUBLIC sal_uInt16 GetActiveSdPageCount() const;
+
sal_uInt16 GetMasterPageUserCount(SdrPage* pMaster) const;
const sd::PresentationSettings& getPresentationSettings() const { return maPresentationSettings; }
diff --git a/sd/source/core/PageListWatcher.cxx b/sd/source/core/PageListWatcher.cxx
index 6efa75be5576..cd4f9ffe62bb 100644
--- a/sd/source/core/PageListWatcher.cxx
+++ b/sd/source/core/PageListWatcher.cxx
@@ -32,6 +32,7 @@ void ImpPageListWatcher::ImpRecreateSortedPageListOnDemand()
maPageVectorStandard.clear();
maPageVectorNotes.clear();
mpHandoutPage = 0L;
+ mnVisiblePageCount = -1;
// build up vectors again
const sal_uInt32 nPageCount(ImpGetPageCount());
@@ -46,6 +47,7 @@ void ImpPageListWatcher::ImpRecreateSortedPageListOnDemand()
case PK_STANDARD:
{
maPageVectorStandard.push_back(pCandidate);
+ if (!pCandidate->IsExcluded()) mnVisiblePageCount++;
break;
}
case PK_NOTES:
@@ -167,6 +169,22 @@ sal_uInt32 ImpPageListWatcher::GetSdPageCount(PageKind ePgKind)
return nRetval;
}
+
+sal_uInt32 ImpPageListWatcher::GetVisibleSdPageCount()
+{
+ sal_uInt32 nVisiblePageCount = 0;
+
+ // build up vectors again
+ const sal_uInt32 nPageCount(ImpGetPageCount());
+
+ for(sal_uInt32 a(0L); a < nPageCount; a++)
+ {
+ SdPage* pCandidate = ImpGetPage(a);
+ if ((pCandidate->GetPageKind() == PK_STANDARD)&&(!pCandidate->IsExcluded())) nVisiblePageCount++;
+ }
+ return nVisiblePageCount;
+}
+
//////////////////////////////////////////////////////////////////////////////
sal_uInt32 ImpDrawPageListWatcher::ImpGetPageCount() const
diff --git a/sd/source/core/PageListWatcher.hxx b/sd/source/core/PageListWatcher.hxx
index 177acd28f828..fd8164531fbf 100644
--- a/sd/source/core/PageListWatcher.hxx
+++ b/sd/source/core/PageListWatcher.hxx
@@ -43,6 +43,7 @@ protected:
SdPage* mpHandoutPage;
sal_Bool mbPageListValid;
+ sal_uInt32 mnVisiblePageCount;
void ImpRecreateSortedPageListOnDemand();
virtual sal_uInt32 ImpGetPageCount() const = 0;
@@ -60,6 +61,7 @@ public:
void Invalidate() { mbPageListValid = sal_False; }
SdPage* GetSdPage(PageKind ePgKind, sal_uInt32 nPgNum = 0L);
sal_uInt32 GetSdPageCount(PageKind ePgKind);
+ sal_uInt32 GetVisibleSdPageCount();
};
//////////////////////////////////////////////////////////////////////////////
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index fd36dd446385..0e8f5d67e229 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -66,6 +66,7 @@
#include "PageListWatcher.hxx"
#include <vcl/virdev.hxx>
+#include "customshowlist.hxx"
using namespace ::sd;
@@ -202,6 +203,11 @@ sal_uInt16 SdDrawDocument::GetMasterSdPageCount(PageKind ePgKind) const
return (sal_uInt16)mpMasterPageListWatcher->GetSdPageCount(ePgKind);
}
+sal_uInt16 SdDrawDocument::GetActiveSdPageCount() const
+{
+ return (sal_uInt16)mpDrawPageListWatcher->GetVisibleSdPageCount();
+}
+
// Adapt the page numbers that are registered in the page objects of the notes
// pages
void SdDrawDocument::UpdatePageObjectsInNotes(sal_uInt16 nStartPos)
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 6db42a09c38f..bdf802bcacb6 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -815,6 +815,8 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
SdPage* pPage = NULL;
SdPage* pFirstPage = NULL;
sal_uInt16 nFirstPage;
+ sal_Int32 nPageCount;
+ sal_Int32 nActivePageCount;
sal_uInt16 nSelectedPages = mrSlideSorter.GetController().GetPageSelector().GetSelectedPageCount();
OUStringBuffer aPageStr;
String aLayoutStr;
@@ -831,7 +833,14 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
{
pPage = pDescriptor->GetPage();
nFirstPage = (pPage->GetPageNum()/2) + 1;
- aPageStr.append(" ").append(static_cast<sal_Int32>(nFirstPage), 10).append(" / ").append(mrSlideSorter.GetModel().GetPageCount(), 10);
+ 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(")");
+ }
}
rSet.Put( SfxStringItem( SID_STATUS_PAGE, aPageStr.makeStringAndClear() ) );
}
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index e360345f9016..1a5dd612660f 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -822,7 +822,7 @@ void DrawViewShell::ShowMousePosInfo(const Rectangle& rRect,
SID_ATTR_SIZE, SID_ATTR_SIZE,
0L);
-// GetStatusBarState(aSet); not fast by pressed modify key!!
+ GetStatusBarState(aSet);
aSet.Put( SfxStringItem( SID_CONTEXT, mpDrawView->GetStatusText() ) );
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 1a0443e7e468..b75289e456d3 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -699,12 +699,20 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
// Display of current page and layer.
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_STATUS_PAGE ) )
{
+ 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::valueOf( sal_Int32(maTabControl.GetCurPageId()) );
aOUString += " / " ;
- aOUString += OUString::valueOf( sal_Int32(GetDoc()->GetSdPageCount(mePageKind)) );
+ aOUString += OUString::valueOf( nPageCount );
+ if (nPageCount != nActivePageCount)
+ {
+ aOUString += " (";
+ aOUString += OUString::valueOf( nActivePageCount );
+ aOUString += ")";
+ }
// If in layer mode additionally show the layer that contains all
// selected shapes of the page. If the shapes are distributed on