diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-15 09:11:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-15 09:11:32 +0200 |
commit | 96285ce13fc6ea5889b53530a522ec28089d9f0b (patch) | |
tree | 645d7275f4aac5a405644190dff88d847086bfcb /sd | |
parent | fdc970ef3aeae9e0b86d32c8a131e14995ca188c (diff) |
convert EventType to scoped enum
and drop unused INDEXES_CHANGED enumerator
Change-Id: I25790a012c53509b8af082dac4a250193ca19bde
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/sidebar/AllMasterPagesSelector.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPageContainer.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPageContainer.hxx | 4 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPageDescriptor.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPagesSelector.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx | 7 |
6 files changed, 19 insertions, 23 deletions
diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx index 596d1870f46c..5d630dd4ed8a 100644 --- a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx @@ -128,13 +128,12 @@ void AllMasterPagesSelector::NotifyContainerChangeEvent ( { switch (rEvent.meEventType) { - case MasterPageContainerChangeEvent::CHILD_ADDED: + case MasterPageContainerChangeEvent::EventType::CHILD_ADDED: AddItem(rEvent.maChildToken); MasterPagesSelector::Fill(); break; - case MasterPageContainerChangeEvent::INDEX_CHANGED: - case MasterPageContainerChangeEvent::INDEXES_CHANGED: + case MasterPageContainerChangeEvent::EventType::INDEX_CHANGED: mpSortedMasterPages->clear(); MasterPagesSelector::Fill(); break; diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx index d276a720ee4c..02044642581c 100644 --- a/sd/source/ui/sidebar/MasterPageContainer.cxx +++ b/sd/source/ui/sidebar/MasterPageContainer.cxx @@ -236,7 +236,7 @@ void MasterPageContainer::SetPreviewSize (PreviewSize eSize) { mePreviewSize = eSize; mpImpl->FireContainerChange( - MasterPageContainerChangeEvent::SIZE_CHANGED, + MasterPageContainerChangeEvent::EventType::SIZE_CHANGED, NIL_TOKEN); } @@ -597,7 +597,7 @@ void MasterPageContainer::Implementation::UpdatePreviewSizePixel() maSmallPreviewSizePixel.Height() = nNewSmallHeight; maLargePreviewSizePixel.Height() = nNewLargeHeight; FireContainerChange( - MasterPageContainerChangeEvent::SIZE_CHANGED, + MasterPageContainerChangeEvent::EventType::SIZE_CHANGED, NIL_TOKEN); } } @@ -657,7 +657,7 @@ MasterPageContainer::Token MasterPageContainer::Implementation::PutMasterPage ( maContainer.push_back(rpDescriptor); aEntry = maContainer.end()-1; - FireContainerChange(MasterPageContainerChangeEvent::CHILD_ADDED,aResult); + FireContainerChange(MasterPageContainerChangeEvent::EventType::CHILD_ADDED,aResult); } } else @@ -963,11 +963,11 @@ bool MasterPageContainer::Implementation::UpdateDescriptor ( mpDocument)); if (nPageObjectModified == 1 && bSendEvents) FireContainerChange( - MasterPageContainerChangeEvent::DATA_CHANGED, + MasterPageContainerChangeEvent::EventType::DATA_CHANGED, rpDescriptor->maToken); if (nPageObjectModified == -1 && bSendEvents) FireContainerChange( - MasterPageContainerChangeEvent::CHILD_REMOVED, + MasterPageContainerChangeEvent::EventType::CHILD_REMOVED, rpDescriptor->maToken); if (nPageObjectModified && ! mbFirstPageObjectSeen) UpdatePreviewSizePixel(); @@ -981,7 +981,7 @@ bool MasterPageContainer::Implementation::UpdateDescriptor ( if (bPreviewModified && bSendEvents) FireContainerChange( - MasterPageContainerChangeEvent::PREVIEW_CHANGED, + MasterPageContainerChangeEvent::EventType::PREVIEW_CHANGED, rpDescriptor->maToken); return nPageObjectModified || bPreviewModified; diff --git a/sd/source/ui/sidebar/MasterPageContainer.hxx b/sd/source/ui/sidebar/MasterPageContainer.hxx index b0c8ac7438f8..8fef14a85e3d 100644 --- a/sd/source/ui/sidebar/MasterPageContainer.hxx +++ b/sd/source/ui/sidebar/MasterPageContainer.hxx @@ -170,7 +170,7 @@ private: class MasterPageContainerChangeEvent { public: - enum EventType { + enum class EventType { // A master page was added to the container. CHILD_ADDED, // A master page was removed from the container. @@ -183,8 +183,6 @@ public: DATA_CHANGED, // The TemplateIndex of a master page has changed. INDEX_CHANGED, - // More than one entries changed their TemplateIndex - INDEXES_CHANGED } meEventType; // Token of the container entry whose data changed or which was added or diff --git a/sd/source/ui/sidebar/MasterPageDescriptor.cxx b/sd/source/ui/sidebar/MasterPageDescriptor.cxx index 60e7931d5aec..ce2f2757a2c5 100644 --- a/sd/source/ui/sidebar/MasterPageDescriptor.cxx +++ b/sd/source/ui/sidebar/MasterPageDescriptor.cxx @@ -147,11 +147,11 @@ const Image& MasterPageDescriptor::GetPreview (MasterPageContainer::PreviewSize { pResult.reset(new std::vector<MasterPageContainerChangeEvent::EventType>()); if (bDataChanged) - pResult->push_back(MasterPageContainerChangeEvent::DATA_CHANGED); + pResult->push_back(MasterPageContainerChangeEvent::EventType::DATA_CHANGED); if (bIndexChanged) - pResult->push_back(MasterPageContainerChangeEvent::INDEX_CHANGED); + pResult->push_back(MasterPageContainerChangeEvent::EventType::INDEX_CHANGED); if (bPreviewChanged) - pResult->push_back(MasterPageContainerChangeEvent::PREVIEW_CHANGED); + pResult->push_back(MasterPageContainerChangeEvent::EventType::PREVIEW_CHANGED); } return pResult; diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index 9ef3276d35f4..42bc5461f08d 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -418,12 +418,12 @@ void MasterPagesSelector::NotifyContainerChangeEvent (const MasterPageContainerC switch (rEvent.meEventType) { - case MasterPageContainerChangeEvent::SIZE_CHANGED: + case MasterPageContainerChangeEvent::EventType::SIZE_CHANGED: PreviewValueSet::SetPreviewSize(mpContainer->GetPreviewSizePixel()); UpdateAllPreviews(); break; - case MasterPageContainerChangeEvent::PREVIEW_CHANGED: + case MasterPageContainerChangeEvent::EventType::PREVIEW_CHANGED: { int nIndex (GetIndexForToken(rEvent.maChildToken)); if (nIndex >= 0) @@ -436,14 +436,14 @@ void MasterPagesSelector::NotifyContainerChangeEvent (const MasterPageContainerC } break; - case MasterPageContainerChangeEvent::DATA_CHANGED: + case MasterPageContainerChangeEvent::EventType::DATA_CHANGED: { InvalidateItem(rEvent.maChildToken); Fill(); } break; - case MasterPageContainerChangeEvent::CHILD_REMOVED: + case MasterPageContainerChangeEvent::EventType::CHILD_REMOVED: { int nIndex (GetIndexForToken(rEvent.maChildToken)); SetItem(nIndex, MasterPageContainer::NIL_TOKEN); diff --git a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx index 1622353915b2..a25c35d432d4 100644 --- a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx +++ b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx @@ -303,10 +303,9 @@ IMPL_LINK(RecentlyUsedMasterPages, MasterPageContainerChangeListener, { switch (rEvent.meEventType) { - case MasterPageContainerChangeEvent::CHILD_ADDED: - case MasterPageContainerChangeEvent::CHILD_REMOVED: - case MasterPageContainerChangeEvent::INDEX_CHANGED: - case MasterPageContainerChangeEvent::INDEXES_CHANGED: + case MasterPageContainerChangeEvent::EventType::CHILD_ADDED: + case MasterPageContainerChangeEvent::EventType::CHILD_REMOVED: + case MasterPageContainerChangeEvent::EventType::INDEX_CHANGED: ResolveList(); break; |