[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Sep 13 18:20:52 UTC 2018


 sw/source/core/undo/SwRewriter.cxx |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 658d3c9fabe7e66a1b8740cacf0f9b763d7ea130
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Sep 13 13:26:54 2018 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Sep 13 20:20:28 2018 +0200

    Make use of special operator == explicit
    
    Change-Id: I6449da3ef928a5a92a4197f5c2228e55253e43c3
    Reviewed-on: https://gerrit.libreoffice.org/60431
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/source/core/undo/SwRewriter.cxx b/sw/source/core/undo/SwRewriter.cxx
index 28eaa6d144f5..cd63f3e551a8 100644
--- a/sw/source/core/undo/SwRewriter.cxx
+++ b/sw/source/core/undo/SwRewriter.cxx
@@ -22,11 +22,6 @@
 
 using namespace std;
 
-bool operator == (const SwRewriteRule & a, const SwRewriteRule & b)
-{
-    return a.first == b.first;
-}
-
 SwRewriter::SwRewriter()
 {
 }
@@ -37,7 +32,9 @@ void SwRewriter::AddRule(SwUndoArg eWhat, const OUString & rWith)
 
     vector<SwRewriteRule>::iterator aIt;
 
-    aIt = find(mRules.begin(), mRules.end(), aRule);
+    aIt = find_if(
+        mRules.begin(), mRules.end(),
+        [&aRule](SwRewriteRule const & a) { return a.first == aRule.first; });
 
     if (aIt != mRules.end())
         *aIt = aRule;


More information about the Libreoffice-commits mailing list