summaryrefslogtreecommitdiffstats
path: root/sc/source/ui
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-06-28 21:48:22 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-07-03 12:21:03 +0200
commitc4ddf6cd6d97e7ce7c2e63e4d393bbeffcb34e4d (patch)
tree128225fc91bd7da687f965337a49b9b64fbe8a79 /sc/source/ui
parentTranslate German comments and debug strings (leftovers in dirs sal to sc) (diff)
downloadcore-c4ddf6cd6d97e7ce7c2e63e4d393bbeffcb34e4d.tar.gz
core-c4ddf6cd6d97e7ce7c2e63e4d393bbeffcb34e4d.zip
C++11 remove std::unary_function bases from functors
std::unary_function is deprecated since C++11 and removed in C++17 90% done with regexp magic. removed obsolete <functional> includes. The std::unary_function base class was used in 3 places: * chart2/source/tools/DataSeriesHelper.cxx: lcl_MatchesRole is used in a std::not1 function helper who uses the members return_type and argument_type. - replace deprecated std::not1 with a lambda * chart2/source/tools/ModifyListenerHelper.cxx: lcl_weakReferenceToSame used the argument_type member in the operator() parameter. - inline the parameter type. * xmloff/source/chart/SchXMLExport.cxx: lcl_SequenceToMapElement used result_type and argument_type in operator(). - inline the types Also fix compile error with gcc about finding std::for_each. Change-Id: I073673beb01410c3108e7d0346d9e7d6b9ad2e2f Reviewed-on: https://gerrit.libreoffice.org/39358 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/Accessibility/AccessibleFilterMenu.cxx2
-rw-r--r--sc/source/ui/dbgui/dbnamdlg.cxx2
-rw-r--r--sc/source/ui/docshell/autostyl.cxx6
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx16
-rw-r--r--sc/source/ui/undo/undoblk.cxx2
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx15
-rw-r--r--sc/source/ui/view/drawvie4.cxx4
-rw-r--r--sc/source/ui/view/gridwin.cxx4
-rw-r--r--sc/source/ui/xmlsource/xmlsourcedlg.cxx2
9 files changed, 26 insertions, 27 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
index 76c96eb554e4..2aa8ba93c3e3 100644
--- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
+++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
@@ -50,7 +50,7 @@ using ::std::for_each;
namespace {
-class AddRemoveEventListener : public ::std::unary_function<void, Reference<XAccessible> >
+class AddRemoveEventListener
{
public:
explicit AddRemoveEventListener(const Reference<XAccessibleEventListener>& rListener, bool bAdd) :
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 1955934d4430..0b2155e1ac3a 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -496,7 +496,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, Button*, void)
namespace {
-class FindByName : public ::std::unary_function<std::unique_ptr<ScDBData>, bool>
+class FindByName
{
const OUString& mrName;
public:
diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx
index 30a1fb16c93d..d3fb83763b1a 100644
--- a/sc/source/ui/docshell/autostyl.cxx
+++ b/sc/source/ui/docshell/autostyl.cxx
@@ -31,7 +31,7 @@ static inline sal_uLong TimeNow() // seconds
namespace {
-class FindByRange : public ::std::unary_function<ScAutoStyleData, bool>
+class FindByRange
{
ScRange maRange;
public:
@@ -39,7 +39,7 @@ public:
bool operator() (const ScAutoStyleData& rData) const { return rData.aRange == maRange; }
};
-class FindByTimeout : public ::std::unary_function<ScAutoStyleData, bool>
+class FindByTimeout
{
sal_uLong mnTimeout;
public:
@@ -47,7 +47,7 @@ public:
bool operator() (const ScAutoStyleData& rData) const { return rData.nTimeout >= mnTimeout; }
};
-struct FindNonZeroTimeout : public ::std::unary_function<ScAutoStyleData, bool>
+struct FindNonZeroTimeout
{
bool operator() (const ScAutoStyleData& rData) const
{
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index a395daf2dd24..e90e0e5af690 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -65,10 +65,10 @@ using ::com::sun::star::uno::Any;
using ::std::vector;
using ::std::find;
using ::std::find_if;
+using ::std::for_each;
using ::std::distance;
using ::std::pair;
using ::std::list;
-using ::std::unary_function;
using namespace formula;
#define SRCDOC_LIFE_SPAN 30000 // 5 minutes (in 100th of a sec)
@@ -76,7 +76,7 @@ using namespace formula;
namespace {
-class TabNameSearchPredicate : public unary_function<ScExternalRefCache::TableName, bool>
+class TabNameSearchPredicate
{
public:
explicit TabNameSearchPredicate(const OUString& rSearchName) :
@@ -94,7 +94,7 @@ private:
OUString maSearchName;
};
-class FindSrcFileByName : public unary_function<ScExternalRefManager::SrcFileData, bool>
+class FindSrcFileByName
{
public:
explicit FindSrcFileByName(const OUString& rMatchName) :
@@ -111,7 +111,7 @@ private:
const OUString& mrMatchName;
};
-class NotifyLinkListener : public unary_function<ScExternalRefManager::LinkListener*, void>
+class NotifyLinkListener
{
public:
NotifyLinkListener(sal_uInt16 nFileId, ScExternalRefManager::LinkUpdateType eType) :
@@ -129,7 +129,7 @@ private:
ScExternalRefManager::LinkUpdateType meType;
};
-struct UpdateFormulaCell : public unary_function<ScFormulaCell*, void>
+struct UpdateFormulaCell
{
void operator() (ScFormulaCell* pCell) const
{
@@ -152,7 +152,7 @@ struct UpdateFormulaCell : public unary_function<ScFormulaCell*, void>
}
};
-class RemoveFormulaCell : public unary_function<pair<const sal_uInt16, ScExternalRefManager::RefCellSet>, void>
+class RemoveFormulaCell
{
public:
explicit RemoveFormulaCell(ScFormulaCell* p) : mpCell(p) {}
@@ -164,7 +164,7 @@ private:
ScFormulaCell* mpCell;
};
-class ConvertFormulaToStatic : public unary_function<ScFormulaCell*, void>
+class ConvertFormulaToStatic
{
public:
explicit ConvertFormulaToStatic(ScDocument* pDoc) : mpDoc(pDoc) {}
@@ -215,7 +215,7 @@ bool hasRefsToSrcDoc(ScRangeData& rData, sal_uInt16 nFileId)
return false;
}
-class EraseRangeByIterator : public unary_function<ScRangeName::iterator, void>
+class EraseRangeByIterator
{
ScRangeName& mrRanges;
public:
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 53d6212aeb88..c62b497c9748 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1261,7 +1261,7 @@ void ScUndoDragDrop::DoUndo( ScRange aRange )
namespace {
-class DataChangeNotifier : public std::unary_function<SvtListener*, void>
+class DataChangeNotifier
{
ScHint maHint;
public:
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 5593feed2a74..f50a852202ac 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -76,7 +76,6 @@ using ::std::unique_ptr;
using ::std::vector;
using ::std::list;
using ::std::distance;
-using ::std::unary_function;
using ::std::shared_ptr;
namespace
@@ -104,7 +103,7 @@ const SfxItemPropertyMapEntry* lcl_GetDataSequencePropertyMap()
return aDataSequencePropertyMap_Impl;
}
-struct lcl_appendTableNumber : public ::std::unary_function< SCTAB, void >
+struct lcl_appendTableNumber
{
explicit lcl_appendTableNumber( OUStringBuffer & rBuffer ) :
m_rBuffer( rBuffer )
@@ -828,7 +827,7 @@ void Chart2Positioner::createPositionMap()
/**
* Function object to create a range string from a token list.
*/
-class Tokens2RangeString : public unary_function<ScTokenRef, void>
+class Tokens2RangeString
{
public:
Tokens2RangeString(ScDocument* pDoc, FormulaGrammar::Grammar eGram, sal_Unicode cRangeSep) :
@@ -882,7 +881,7 @@ private:
*
* and each address doesn't include any '$' symbols.
*/
-class Tokens2RangeStringXML : public unary_function<ScTokenRef, void>
+class Tokens2RangeStringXML
{
public:
explicit Tokens2RangeStringXML(ScDocument* pDoc) :
@@ -1357,7 +1356,7 @@ bool lcl_addUpperLeftCornerIfMissing(vector<ScTokenRef>& rRefTokens,
#define SHRINK_RANGE_THRESHOLD 10000
-class ShrinkRefTokenToDataRange : public std::unary_function<ScTokenRef, void>
+class ShrinkRefTokenToDataRange
{
ScDocument* mpDoc;
public:
@@ -1605,7 +1604,7 @@ namespace
/**
* Function object to create a list of table numbers from a token list.
*/
-class InsertTabNumber : public unary_function<ScTokenRef, void>
+class InsertTabNumber
{
public:
InsertTabNumber() :
@@ -3037,7 +3036,7 @@ namespace {
* This function object is used to accumulatively count the numbers of
* columns and rows in all reference tokens.
*/
-class AccumulateRangeSize : public unary_function<ScTokenRef, void>
+class AccumulateRangeSize
{
public:
AccumulateRangeSize() :
@@ -3067,7 +3066,7 @@ private:
* This function object is used to generate label strings from a list of
* reference tokens.
*/
-class GenerateLabelStrings : public unary_function<ScTokenRef, void>
+class GenerateLabelStrings
{
public:
GenerateLabelStrings(sal_Int32 nSize, chart2::data::LabelOrigin eOrigin, bool bColumn) :
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 5a5ac3de2b23..6c567dcc080a 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -282,7 +282,7 @@ void getChartSourceRanges(ScDocument* pDoc, const SdrMarkList& rObjs, std::vecto
}
}
-class InsertTabIndex : public std::unary_function<ScRange, void>
+class InsertTabIndex
{
std::vector<SCTAB>& mrTabs;
public:
@@ -293,7 +293,7 @@ public:
}
};
-class CopyRangeData : public std::unary_function<ScRange, void>
+class CopyRangeData
{
ScDocument* mpSrc;
ScDocument* mpDest;
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index a7a9e9b72ac7..59cd5d61cefe 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -582,7 +582,7 @@ public:
}
};
-class AddItemToEntry : public std::unary_function<OUString, void>
+class AddItemToEntry
{
ScQueryEntry::QueryItemsType& mrItems;
svl::SharedStringPool& mrPool;
@@ -602,7 +602,7 @@ public:
}
};
-class AddSelectedItemString : public std::unary_function<ScQueryEntry::Item, void>
+class AddSelectedItemString
{
std::unordered_set<OUString, OUStringHash>& mrSet;
public:
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 09bd3dbabc09..b9bc6b9d147b 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -238,7 +238,7 @@ void ScXMLSourceDlg::HandleGetFocus(Control* pCtrl)
namespace {
-class UnhighlightEntry : public std::unary_function<SvTreeListEntry*, void>
+class UnhighlightEntry
{
SvTreeListBox& mrTree;
public: