summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorMario J. Rugiero <mrugiero@gmail.com>2015-11-08 23:07:03 -0300
committerNoel Grandin <noelgrandin@gmail.com>2015-11-09 06:09:56 +0000
commitf045b7cb457e8ca1c0a2b3d3ec08f5fe647542bd (patch)
treeb9dc068940e50811b22201611d641f53fe92d21c /fpicker
parent357a6f6ba23245c6fe84d888edc7ad0d01a831b8 (diff)
Replace a few for_each and one-liner locals by range-based loops in fpicker.
Change-Id: I07cb510b8c8ab195d5d3addb715cfb0af488ab9b Reviewed-on: https://gerrit.libreoffice.org/19849 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/win32/filepicker/customcontrolcontainer.cxx73
1 files changed, 6 insertions, 67 deletions
diff --git a/fpicker/source/win32/filepicker/customcontrolcontainer.cxx b/fpicker/source/win32/filepicker/customcontrolcontainer.cxx
index 4955c03a8b58..c4b5fe340ff9 100644
--- a/fpicker/source/win32/filepicker/customcontrolcontainer.cxx
+++ b/fpicker/source/win32/filepicker/customcontrolcontainer.cxx
@@ -20,44 +20,6 @@
#include "customcontrolcontainer.hxx"
#include <algorithm>
-#include <functional>
-
-
-
-
-
-namespace /* private */
-{
- void DeleteCustomControl(CCustomControl* aCustomControl)
- {
- delete aCustomControl;
- };
-
- void AlignCustomControl(CCustomControl* aCustomControl)
- {
- aCustomControl->Align();
- };
-
- class CSetFontHelper
- {
- public:
- CSetFontHelper(HFONT hFont) :
- m_hFont(hFont)
- {
- }
-
- void SAL_CALL operator()(CCustomControl* aCustomControl)
- {
- aCustomControl->SetFont(m_hFont);
- }
-
- private:
- HFONT m_hFont;
- };
-}
-
-
-
CCustomControlContainer::~CCustomControlContainer()
@@ -66,44 +28,26 @@ CCustomControlContainer::~CCustomControlContainer()
}
-
-
-
void SAL_CALL CCustomControlContainer::Align()
{
- std::for_each(
- m_ControlContainer.begin(),
- m_ControlContainer.end(),
- AlignCustomControl);
+ for (auto aCCustomControl : m_ControlContainer)
+ aCCustomControl->Align();
}
-
-
-
void SAL_CALL CCustomControlContainer::SetFont(HFONT hFont)
{
- CSetFontHelper aSetFontHelper(hFont);
-
- std::for_each(
- m_ControlContainer.begin(),
- m_ControlContainer.end(),
- aSetFontHelper);
+ for (auto aCCustomControl : m_ControlContainer)
+ aCCustomControl->SetFont(hFont);
}
-
-
-
void SAL_CALL CCustomControlContainer::AddControl(CCustomControl* aCustomControl)
{
m_ControlContainer.push_back(aCustomControl);
}
-
-
-
void SAL_CALL CCustomControlContainer::RemoveControl(CCustomControl* aCustomControl)
{
ControlContainer_t::iterator iter_end = m_ControlContainer.end();
@@ -119,15 +63,10 @@ void SAL_CALL CCustomControlContainer::RemoveControl(CCustomControl* aCustomCont
}
-
-
-
void SAL_CALL CCustomControlContainer::RemoveAllControls()
{
- std::for_each(
- m_ControlContainer.begin(),
- m_ControlContainer.end(),
- DeleteCustomControl);
+ for (auto aCCustomControl : m_ControlContainer)
+ delete aCCustomControl;
m_ControlContainer.clear();
}