include/svx/svdundo.hxx       |    2 +-
 svx/source/svdraw/svdundo.cxx |    7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit f582670131dc211e472960ecff1826f7b133b083
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Thu Jan 14 17:30:17 2021 +0100
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Fri Jan 15 07:26:48 2021 +0100

    Use value comparison here
    
    This was always comparing pointers, ever since commit
    cb07ed8c74d71de9ef512c7a3568c7ee85585cef. They could only
    happen to be not different if they are both nullptr. But
    the uses of the function seem to expect value comparison
    (see SdrObjEditView::ImpChainingEventHdl,
    SdrObjEditView::SdrEndTextEdit).
    
    Change-Id: I2265dc8f0f7e4441940f8e19ec0b016b5f78e812
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109284
    Tested-by: Mike Kaganski <mike.kagan...@collabora.com>
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx
index d1aac69b1d65..e56b6d52f9a7 100644
--- a/include/svx/svdundo.hxx
+++ b/include/svx/svdundo.hxx
@@ -407,7 +407,7 @@ public:
     SdrUndoObjSetText(SdrObject& rNewObj, sal_Int32 nText );
     virtual ~SdrUndoObjSetText() override;
 
-    bool IsDifferent() const { return pOldText!=pNewText; }
+    bool IsDifferent() const;
     void AfterSetText();
 
     virtual void Undo() override;
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 0cbb447f1a91..f27f9e0493a2 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -991,6 +991,13 @@ SdrUndoObjSetText::~SdrUndoObjSetText()
     pNewText.reset();
 }
 
+bool SdrUndoObjSetText::IsDifferent() const
+{
+    if (!pOldText || !pNewText)
+        return !pOldText && !pNewText;
+    return !(*pOldText == *pNewText);
+}
+
 void SdrUndoObjSetText::AfterSetText()
 {
     if (!bNewTextAvailable)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to