summaryrefslogtreecommitdiff
path: root/sd/source/ui/view
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-06-20 22:40:45 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-23 13:13:14 +0200
commit6441c2f2e20bc424c6a4cd1c2d704710e4d80346 (patch)
tree83859a71b3f28a6305030e369c88a7f22b0918da /sd/source/ui/view
parent849d5d9903e54c92682227dfad545664e4bbda53 (diff)
tdf#96099 Remove trivial std::vector typedefs in sd, sfx2, shell
Change-Id: Ib3708c9650f273de4a2f549d2ce9f2465bd37d6c Reviewed-on: https://gerrit.libreoffice.org/56206 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r--sd/source/ui/view/ToolBarManager.cxx48
1 files changed, 20 insertions, 28 deletions
diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx
index 91db27743b2a..6b0c77231b15 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -68,8 +68,6 @@ private:
Reference<frame::XLayoutManager> mxLayouter;
};
-typedef ::std::vector<OUString> NameList;
-
/** Store a list of tool bars for each of the tool bar groups. From
this the list of requested tool bars is built.
*/
@@ -82,19 +80,19 @@ public:
void AddToolBar (sd::ToolBarManager::ToolBarGroup eGroup, const OUString& rsName);
bool RemoveToolBar (sd::ToolBarManager::ToolBarGroup eGroup, const OUString& rsName);
- void GetToolBarsToActivate (NameList& rToolBars) const;
- void GetToolBarsToDeactivate (NameList& rToolBars) const;
+ void GetToolBarsToActivate (std::vector<OUString>& rToolBars) const;
+ void GetToolBarsToDeactivate (std::vector<OUString>& rToolBars) const;
void MarkToolBarAsActive (const OUString& rsName);
void MarkToolBarAsNotActive (const OUString& rsName);
void MarkAllToolBarsAsNotActive();
private:
- typedef ::std::map<sd::ToolBarManager::ToolBarGroup,NameList> Groups;
+ typedef ::std::map<sd::ToolBarManager::ToolBarGroup, std::vector<OUString> > Groups;
Groups maGroups;
- NameList maActiveToolBars;
+ std::vector<OUString> maActiveToolBars;
- void MakeRequestedToolBarList (NameList& rToolBars) const;
+ void MakeRequestedToolBarList (std::vector<OUString>& rToolBars) const;
};
/** Manage tool bars that are implemented as sub shells of a view shell.
@@ -682,12 +680,11 @@ void ToolBarManager::Implementation::PreUpdate()
// Get the list of tool bars that are not used anymore and are to be
// deactivated.
- NameList aToolBars;
+ std::vector<OUString> aToolBars;
maToolBarList.GetToolBarsToDeactivate(aToolBars);
// Turn off the tool bars.
- NameList::const_iterator iToolBar;
- for (iToolBar=aToolBars.begin(); iToolBar!=aToolBars.end(); ++iToolBar)
+ for (auto iToolBar=aToolBars.cbegin(); iToolBar!=aToolBars.cend(); ++iToolBar)
{
OUString sFullName (GetToolBarResourceName(*iToolBar));
SAL_INFO("sd.view", OSL_THIS_FUNC << ": turning off tool bar " << sFullName);
@@ -710,14 +707,13 @@ void ToolBarManager::Implementation::PostUpdate()
mbPostUpdatePending = false;
// Create the list of requested tool bars.
- NameList aToolBars;
+ std::vector<OUString> aToolBars;
maToolBarList.GetToolBarsToActivate(aToolBars);
SAL_INFO("sd.view", OSL_THIS_FUNC << ": ToolBarManager::PostUpdate [");
// Turn on the tool bars that are visible in the new context.
- NameList::const_iterator iToolBar;
- for (iToolBar=aToolBars.begin(); iToolBar!=aToolBars.end(); ++iToolBar)
+ for (auto iToolBar=aToolBars.cbegin(); iToolBar!=aToolBars.cend(); ++iToolBar)
{
OUString sFullName (GetToolBarResourceName(*iToolBar));
SAL_INFO("sd.view", OSL_THIS_FUNC << ": turning on tool bar " << sFullName);
@@ -1220,13 +1216,12 @@ void ToolBarList::AddToolBar (
{
Groups::iterator iGroup (maGroups.find(eGroup));
if (iGroup == maGroups.end())
- iGroup = maGroups.emplace(eGroup,NameList()).first;
+ iGroup = maGroups.emplace(eGroup,std::vector<OUString>()).first;
if (iGroup != maGroups.end())
{
- NameList::const_iterator iBar (
- ::std::find(iGroup->second.begin(),iGroup->second.end(),rsName));
- if (iBar == iGroup->second.end())
+ auto iBar (std::find(iGroup->second.cbegin(),iGroup->second.cend(),rsName));
+ if (iBar == iGroup->second.cend())
{
iGroup->second.push_back(rsName);
}
@@ -1240,8 +1235,7 @@ bool ToolBarList::RemoveToolBar (
Groups::iterator iGroup (maGroups.find(eGroup));
if (iGroup != maGroups.end())
{
- NameList::iterator iBar (
- ::std::find(iGroup->second.begin(),iGroup->second.end(),rsName));
+ auto iBar (std::find(iGroup->second.begin(),iGroup->second.end(),rsName));
if (iBar != iGroup->second.end())
{
iGroup->second.erase(iBar);
@@ -1251,7 +1245,7 @@ bool ToolBarList::RemoveToolBar (
return false;
}
-void ToolBarList::MakeRequestedToolBarList (NameList& rRequestedToolBars) const
+void ToolBarList::MakeRequestedToolBarList (std::vector<OUString>& rRequestedToolBars) const
{
for (auto eGroup : o3tl::enumrange<sd::ToolBarManager::ToolBarGroup>())
{
@@ -1264,13 +1258,12 @@ void ToolBarList::MakeRequestedToolBarList (NameList& rRequestedToolBars) const
}
}
-void ToolBarList::GetToolBarsToActivate (NameList& rToolBars) const
+void ToolBarList::GetToolBarsToActivate (std::vector<OUString>& rToolBars) const
{
- NameList aRequestedToolBars;
+ std::vector<OUString> aRequestedToolBars;
MakeRequestedToolBarList(aRequestedToolBars);
- NameList::const_iterator iToolBar;
- for (iToolBar=aRequestedToolBars.begin(); iToolBar!=aRequestedToolBars.end(); ++iToolBar)
+ for (auto iToolBar=aRequestedToolBars.cbegin(); iToolBar!=aRequestedToolBars.cend(); ++iToolBar)
{
if (::std::find(maActiveToolBars.begin(),maActiveToolBars.end(),*iToolBar)
== maActiveToolBars.end())
@@ -1280,13 +1273,12 @@ void ToolBarList::GetToolBarsToActivate (NameList& rToolBars) const
}
}
-void ToolBarList::GetToolBarsToDeactivate (NameList& rToolBars) const
+void ToolBarList::GetToolBarsToDeactivate (std::vector<OUString>& rToolBars) const
{
- NameList aRequestedToolBars;
+ std::vector<OUString> aRequestedToolBars;
MakeRequestedToolBarList(aRequestedToolBars);
- NameList::const_iterator iToolBar;
- for (iToolBar=maActiveToolBars.begin(); iToolBar!=maActiveToolBars.end(); ++iToolBar)
+ for (auto iToolBar=maActiveToolBars.cbegin(); iToolBar!=maActiveToolBars.cend(); ++iToolBar)
{
if (::std::find(aRequestedToolBars.begin(),aRequestedToolBars.end(),*iToolBar)
== aRequestedToolBars.end())