[Libreoffice-commits] core.git: fpicker/source
Mario J. Rugiero
mrugiero at gmail.com
Sun Nov 8 22:10:16 PST 2015
fpicker/source/win32/filepicker/customcontrolcontainer.cxx | 73 +------------
1 file changed, 6 insertions(+), 67 deletions(-)
New commits:
commit f045b7cb457e8ca1c0a2b3d3ec08f5fe647542bd
Author: Mario J. Rugiero <mrugiero at gmail.com>
Date: Sun Nov 8 23:07:03 2015 -0300
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 at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/fpicker/source/win32/filepicker/customcontrolcontainer.cxx b/fpicker/source/win32/filepicker/customcontrolcontainer.cxx
index 4955c03..c4b5fe3 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();
}
More information about the Libreoffice-commits
mailing list