From e688987b28d4995820d38cd88c8c66be33044492 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Sun, 20 Mar 2016 01:54:44 +0900 Subject: starmath: Replace lt_SmSymPtr with a lambda MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... as std::binary_function is deprecated in C++11. Change-Id: Idf73bcd832fa80addf46e3545de3b6787d3b3de6 Reviewed-on: https://gerrit.libreoffice.org/23370 Tested-by: Jenkins Reviewed-by: Björn Michaelsen --- starmath/inc/symbol.hxx | 10 ---------- starmath/source/dialog.cxx | 7 ++++++- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'starmath') 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 #include #include -#include -#include #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 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) -- cgit