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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 12 13:33:39 UTC 2020


 sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx |   33 +++++------
 1 file changed, 16 insertions(+), 17 deletions(-)

New commits:
commit ca5e875958882ed54b376535cccc144e3fa0345f
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Aug 12 10:35:01 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Aug 12 15:33:03 2020 +0200

    expand out DELETEZ
    
    Change-Id: I8691d7cedc340997284b1e8e9adae5f867c2d707
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100586
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index ddbc8ecb5ab1..d7a9ebb5845a 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -125,23 +125,20 @@ ScNotesChildren::ScNotesChildren(ScPreviewShell* pViewShell, ScAccessibleDocumen
 {
 }
 
-namespace {
-
-struct DeleteAccNote
-{
-    void operator()(ScAccNote& rNote)
-    {
-        if (rNote.mpTextHelper)
-            DELETEZ( rNote.mpTextHelper);
-    }
-};
-
-}
-
 ScNotesChildren::~ScNotesChildren()
 {
-    std::for_each(maNotes.begin(), maNotes.end(), DeleteAccNote());
-    std::for_each(maMarks.begin(), maMarks.end(), DeleteAccNote());
+    for (auto & i : maNotes)
+        if (i.mpTextHelper)
+        {
+            delete i.mpTextHelper;
+            i.mpTextHelper = nullptr;
+        }
+    for (auto & i : maMarks)
+        if (i.mpTextHelper)
+        {
+            delete i.mpTextHelper;
+            i.mpTextHelper = nullptr;
+        }
 }
 
 ::accessibility::AccessibleTextHelper* ScNotesChildren::CreateTextHelper(const OUString& rString, const tools::Rectangle& rVisRect, const ScAddress& aCellPos, bool bMarkNote, sal_Int32 nChildOffset) const
@@ -386,7 +383,8 @@ sal_Int32 ScNotesChildren::CheckChanges(const ScPreviewLocationData& rData,
                             aNote.mnParaCount = aNote.mpTextHelper->GetChildCount();
                         // collect removed children
                         CollectChildren(*aItr, rOldParas);
-                        DELETEZ(aItr->mpTextHelper);
+                        delete aItr->mpTextHelper;
+                        aItr->mpTextHelper = nullptr;;
                         // collect new children
                         CollectChildren(aNote, rNewParas);
                     }
@@ -408,7 +406,8 @@ sal_Int32 ScNotesChildren::CheckChanges(const ScPreviewLocationData& rData,
                 {
                     // collect removed children
                     CollectChildren(*aItr, rOldParas);
-                    DELETEZ(aItr->mpTextHelper);
+                    delete aItr->mpTextHelper;
+                    aItr->mpTextHelper = nullptr;
 
                     // no note to add
                     // not necessary, because this branch should not be reached if it is the end


More information about the Libreoffice-commits mailing list