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

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Thu Jan 14 14:23:15 UTC 2021


 sfx2/source/dialog/dinfdlg.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 6aabffcfc1e0323280353d2e5120e36ae55fea5a
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Jan 12 13:16:32 2021 +0100
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu Jan 14 15:22:37 2021 +0100

    Use comphelper::ContainerUniquePtrEquals here
    
    This restores correct comparison of pointed values, that was
    broken since commit df3e716b3c4313d9c495c64aa7d84082fb9596e7.
    Thanks Noel for investigation :-)
    
    This restores operator== dropped for being unused in commit
    1d25e1de0b9498e469cb052b2d86bf7f7ae6adae.
    
    Change-Id: I5614be004c0a98f5dc6f22febc3a51de08e75664
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109116
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 6a7bd27aafaf..2eed31607374 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -28,6 +28,7 @@
 #include <unotools/localedatawrapper.hxx>
 #include <unotools/cmdoptions.hxx>
 #include <comphelper/processfactory.hxx>
+#include <comphelper/stl_types.hxx>
 #include <comphelper/xmlsechelper.hxx>
 #include <unotools/useroptions.hxx>
 #include <svtools/ctrlbox.hxx>
@@ -86,6 +87,11 @@ struct CustomProperty
 
     CustomProperty( const OUString& sName, const css::uno::Any& rValue ) :
         m_sName( sName ), m_aValue( rValue ) {}
+
+    bool operator==(const CustomProperty& rProp) const
+    {
+        return m_sName == rProp.m_sName && m_aValue == rProp.m_aValue;
+    }
 };
 
 SfxPoolItem* SfxDocumentInfoItem::CreateDefault() { return new SfxDocumentInfoItem; }
@@ -311,9 +317,7 @@ bool SfxDocumentInfoItem::operator==( const SfxPoolItem& rItem) const
          m_Keywords             == rInfoItem.m_Keywords          &&
          m_Subject              == rInfoItem.m_Subject           &&
          m_Title                == rInfoItem.m_Title             &&
-         m_aCustomProperties.size() == rInfoItem.m_aCustomProperties.size() &&
-         std::equal(m_aCustomProperties.begin(), m_aCustomProperties.end(),
-            rInfoItem.m_aCustomProperties.begin()) &&
+         comphelper::ContainerUniquePtrEquals(m_aCustomProperties, rInfoItem.m_aCustomProperties) &&
          m_aCmisProperties.getLength() == rInfoItem.m_aCmisProperties.getLength();
 }
 


More information about the Libreoffice-commits mailing list