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

Caolán McNamara caolanm at redhat.com
Sat Jun 11 20:44:13 UTC 2016


 sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx |    5 +----
 sd/source/ui/view/viewshel.cxx                          |    3 +--
 vcl/source/window/paint.cxx                             |    3 +--
 3 files changed, 3 insertions(+), 8 deletions(-)

New commits:
commit aa3d649e5f4200551ec23edbc3d51734e5d94c47
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jun 11 21:26:29 2016 +0100

    coverity#1362678 Dereference after null check
    
    RelocateToWindow is only called by RelocateToParentWindow
    
    RelocateToParentWindow is only called by RelocateToWindow and
    ViewShellWrapper::relocateToAnchor
    
    ViewShellWrapper::relocateToAnchor never passes nullptr as
    its argument to RelocateToParentWindow
    
    so presumably this can never be null
    
    WriteFrameViewData was never called by that logic and
    ReadFrameViewData was always called
    
    Change-Id: Ida584b330d7c7539515a5e7287206f6469699b98

diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
index 8fd5503..0b7ce99 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
@@ -292,11 +292,8 @@ bool SlideSorterViewShell::RelocateToParentWindow (vcl::Window* pParentWindow)
     if ( ! mpSlideSorter)
         return false;
 
-    if (pParentWindow == nullptr)
-        WriteFrameViewData();
     const bool bSuccess (mpSlideSorter->RelocateToWindow(pParentWindow));
-    if (pParentWindow != nullptr)
-        ReadFrameViewData(mpFrameView);
+    ReadFrameViewData(mpFrameView);
 
     return bSuccess;
 }
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 07c2382..942f9a5 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -1563,8 +1563,7 @@ bool ViewShell::RelocateToParentWindow (vcl::Window* pParentWindow)
 {
     mpParentWindow = pParentWindow;
 
-    if (mpParentWindow)
-        mpParentWindow->SetBackground (Wallpaper());
+    mpParentWindow->SetBackground (Wallpaper());
 
     if (mpContentWindow.get() != nullptr)
         mpContentWindow->SetParent(pParentWindow);
commit 110d3b3d405eded0f0eda8e0987be16f66152f32
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jun 11 21:13:46 2016 +0100

    coverity#1362676 Dereference after null check
    
    ImplGetDefaultWindow has to exist, its created if its not
    
    Change-Id: I51364ef1a525856424c0b7afcd8c906d3eb73fb9

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index df2a543..96477e3 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1460,8 +1460,7 @@ void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& /
     if( ! mpWindowImpl->mbVisible )
     {
         vcl::Window* pTempParent = ImplGetDefaultWindow();
-        if( pTempParent )
-            pTempParent->EnableChildTransparentMode();
+        pTempParent->EnableChildTransparentMode();
         pRealParent = GetParent();
         SetParent( pTempParent );
         // trigger correct visibility flags for children


More information about the Libreoffice-commits mailing list