[Libreoffice-commits] core.git: 2 commits - editeng/source sd/source

Caolán McNamara caolanm at redhat.com
Sun May 20 19:17:10 UTC 2018


 editeng/source/misc/svxacorr.cxx |    2 +-
 sd/source/ui/view/viewshe2.cxx   |   13 ++++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit ca11699dbb5c721d527d68e4b68b4eac0d1a7a74
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat May 19 21:37:37 2018 +0100

    coverity#1435678 Resource leak
    
    Change-Id: I994508d0d88fa6727c49d568956887ca1d22ce7e
    Reviewed-on: https://gerrit.libreoffice.org/54588
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index 6c1ad846131c..2b45314c419a 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -478,8 +478,13 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
         return;
     }
 
-    SdUndoGroup* pUndoGroup(new SdUndoGroup(GetDoc()));
-    pUndoGroup->SetComment(SdResId(STR_UNDO_CHANGE_PAGEFORMAT));
+    SdUndoGroup* pUndoGroup(nullptr);
+    SfxViewShell* pViewShell(GetViewShell());
+    if (pViewShell)
+    {
+        pUndoGroup = new SdUndoGroup(GetDoc());
+        pUndoGroup->SetComment(SdResId(STR_UNDO_CHANGE_PAGEFORMAT));
+    }
     Broadcast (ViewShellHint(ViewShellHint::HINT_PAGE_RESIZE_START));
 
     // use Model-based method at SdDrawDocument
@@ -503,9 +508,7 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
     }
 
     // handed over undo group to undo manager
-    SfxViewShell* pViewShell(GetViewShell());
-
-    if(nullptr != pViewShell)
+    if (pViewShell)
     {
         pViewShell->GetViewFrame()->GetObjectShell()->GetUndoManager()->AddUndoAction(pUndoGroup);
     }
commit d437650712ff05475e1f3e8b2b4dd8fc47b1d8aa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat May 19 21:32:37 2018 +0100

    coverity#1435680 silence Unchecked return value
    
    Change-Id: Ie7e7f234d32a42ec4747f20172e92c6edc637faf
    Reviewed-on: https://gerrit.libreoffice.org/54587
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 70daa82e3a88..556f60b9c426 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2649,7 +2649,7 @@ bool SvxAutocorrWordList::Insert(std::unique_ptr<SvxAutocorrWord> pWord) const
 void SvxAutocorrWordList::LoadEntry(const OUString& sWrong, const OUString& sRight, bool bOnlyTxt)
 {
     std::unique_ptr<SvxAutocorrWord> pNew(new SvxAutocorrWord( sWrong, sRight, bOnlyTxt ));
-    Insert( std::move(pNew) );
+    (void)Insert(std::move(pNew));
 }
 
 bool SvxAutocorrWordList::empty() const


More information about the Libreoffice-commits mailing list