[Libreoffice-commits] core.git: starmath/inc starmath/source

Takeshi Abe tabe at fixedpoint.jp
Sat Mar 19 19:28:02 UTC 2016


 starmath/inc/symbol.hxx    |   10 ----------
 starmath/source/dialog.cxx |    7 ++++++-
 2 files changed, 6 insertions(+), 11 deletions(-)

New commits:
commit e688987b28d4995820d38cd88c8c66be33044492
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Sun Mar 20 01:54:44 2016 +0900

    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 at libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx
index f73d156..3b23e92 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 7b56427..87fba57 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)


More information about the Libreoffice-commits mailing list