summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2016-03-20 01:54:44 +0900
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2016-03-19 19:27:35 +0000
commite688987b28d4995820d38cd88c8c66be33044492 (patch)
tree95fd52d7f0ee15238070c8acb649531659a05399 /starmath
parentc9c78dc1a57fecb291e8b98b3e67eb92e5ca12e2 (diff)
starmath: Replace lt_SmSymPtr with a lambda
... as std::binary_function is deprecated in C++11. Change-Id: Idf73bcd832fa80addf46e3545de3b6787d3b3de6 Reviewed-on: https://gerrit.libreoffice.org/23370 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/symbol.hxx10
-rw-r--r--starmath/source/dialog.cxx7
2 files changed, 6 insertions, 11 deletions
diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx
index f73d15617ab7..3b23e92ea581 100644
--- a/starmath/inc/symbol.hxx
+++ b/starmath/inc/symbol.hxx
@@ -26,8 +26,6 @@
#include <map>
#include <vector>
#include <set>
-#include <functional>
-#include <algorithm>
#include "unomodel.hxx"
#include "utility.hxx"
@@ -94,14 +92,6 @@ typedef std::map< OUString, SmSym > SymbolMap_t;
// vector of pointers to the actual symbols in the above container
typedef std::vector< const SmSym * > SymbolPtrVec_t;
-struct lt_SmSymPtr : public std::binary_function< const SmSym *, const SmSym *, bool >
-{
- bool operator() ( const SmSym *pSym1, const SmSym *pSym2 ) const
- {
- return pSym1->GetCharacter() < pSym2->GetCharacter();
- }
-};
-
class SmSymbolManager : public SfxListener
{
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 7b56427cad8a..87fba573d94f 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -51,6 +51,7 @@
#include "document.hxx"
#include "unomodel.hxx"
+#include <algorithm>
namespace
{
@@ -1611,7 +1612,11 @@ bool SmSymbolDialog::SelectSymbolSet(const OUString &rSymbolSetName)
aSymbolSet = rSymbolMgr.GetSymbolSet( aSymbolSetName );
// sort symbols by Unicode position (useful for displaying Greek characters alphabetically)
- std::sort( aSymbolSet.begin(), aSymbolSet.end(), lt_SmSymPtr() );
+ std::sort( aSymbolSet.begin(), aSymbolSet.end(),
+ [](const SmSym *pSym1, const SmSym *pSym2)
+ {
+ return pSym1->GetCharacter() < pSym2->GetCharacter();
+ } );
m_pSymbolSetDisplay->SetSymbolSet( aSymbolSet );
if (aSymbolSet.size() > 0)