summaryrefslogtreecommitdiff
path: root/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-12 10:35:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-12 15:33:03 +0200
commitca5e875958882ed54b376535cccc144e3fa0345f (patch)
tree0c5eecb3750c4e0134f25744701ce89378472a7a /sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
parent05bf4b0a3af2e55501f8ce73cc97ca5e2caa54c2 (diff)
expand out DELETEZ
Change-Id: I8691d7cedc340997284b1e8e9adae5f867c2d707 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100586 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx')
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx33
1 files changed, 16 insertions, 17 deletions
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