diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2015-12-20 21:55:42 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2015-12-20 21:55:42 +0100 |
commit | f909e39f98ee5e5e8e879865f7747e7776cc96ed (patch) | |
tree | 4e3c8db47dd1ae1487b9c9b398f2625c5bdc4103 /editeng/source | |
parent | 7393d64a69094d3025639daafac5c796e79f144c (diff) |
cppcheck: false positive memleak
Help cppcheck by tweaking a bit the code.
No functional diff
Change-Id: If495b0ff845b16522d19da0b723db08b4481e995
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index d8e9a2d33507..f14d57c2ecf1 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -186,14 +186,12 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou if (comphelper::LibreOfficeKit::isActive() && !pRegion) pRegion = &aRegion; - tools::PolyPolygon* pPolyPoly = nullptr; - if ( pRegion ) - pPolyPoly = new tools::PolyPolygon; - OutputDevice* pTarget = pTargetDevice ? pTargetDevice : pOutWin; bool bClipRegion = pTarget->IsClipRegion(); vcl::Region aOldRegion = pTarget->GetClipRegion(); + tools::PolyPolygon* pPolyPoly = nullptr; + if ( !pRegion ) { if ( !pEditEngine->pImpEditEngine->GetUpdateMode() ) @@ -214,6 +212,10 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou if ( pOutWin->GetCursor() ) pOutWin->GetCursor()->Hide(); } + else + { + pPolyPoly = new tools::PolyPolygon; + } DBG_ASSERT( !pEditEngine->IsIdleFormatterActive(), "DrawSelection: Not formatted!" ); aTmpSel.Adjust( pEditEngine->GetEditDoc() ); |