[Libreoffice-commits] core.git: 4 commits - svtools/qa sw/source vcl/unx

Caolán McNamara caolanm at redhat.com
Mon Mar 2 08:19:30 PST 2015


 svtools/qa/unit/GraphicObjectTest.cxx |    1 +
 sw/source/core/docnode/nodes.cxx      |    4 ++--
 vcl/unx/gtk/window/gtksalframe.cxx    |   10 ++++++----
 3 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit e53da56ab2afbd28235137776a2b11f5b07fe828
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 2 16:18:38 2015 +0000

    quieten this a bit
    
    Change-Id: Iea35e1377613a16a05c0df73cd9a38f4b717f015

diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 2451895..21ee7f8 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -1964,8 +1964,7 @@ void GtkSalFrame::AllocateFrame()
                                                basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX, cairo_stride);
         m_aFrame->setDamageTracker(
             basebmp::IBitmapDeviceDamageTrackerSharedPtr(new DamageTracker(*this)) );
-        fprintf( stderr, "allocated m_aFrame size of %dx%d \n",
-                 (int)maGeometry.nWidth, (int)maGeometry.nHeight );
+        SAL_INFO("vcl.gtk3", "allocated m_aFrame size of " << maGeometry.nWidth << " x " << maGeometry.nHeight);
 
 #if OSL_DEBUG_LEVEL > 0 // set background to orange
         m_aFrame->clear( basebmp::Color( 255, 127, 0 ) );
commit eb95cdd91a82b8f2a10b5cce0f7ab3f3a33a3e91
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 2 16:15:29 2015 +0000

    implement GetWorkArea for gtk3
    
    Change-Id: I1dc064886516777ef4f714c2e4ecc95abd053dbc

diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index dda79d7..2451895 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -2092,8 +2092,11 @@ void GtkSalFrame::GetWorkArea( Rectangle& rRect )
 #if !GTK_CHECK_VERSION(3,0,0)
     rRect = GetGtkSalData()->GetGtkDisplay()->getWMAdaptor()->getWorkArea( 0 );
 #else
-    g_warning ("no get work area");
-    rRect = Rectangle( 0, 0, 1024, 768 );
+    GdkScreen  *pScreen = gtk_window_get_screen(GTK_WINDOW(m_pWindow));
+    gint nMonitor = gdk_screen_get_monitor_at_window(pScreen, widget_get_window(m_pWindow));
+    GdkRectangle aRect;
+    gdk_screen_get_monitor_workarea(pScreen, nMonitor, &aRect);
+    rRect = Rectangle(aRect.x, aRect.y, aRect.width, aRect.height);
 #endif
 }
 
commit c3c41f2190739243a8e9d9c8c44759f30e7a1bbf
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 2 15:41:57 2015 +0000

    coverity#735901 Dereference after null check
    
    Change-Id: Ie7defb4233a8ed51d358f8686ea8bfb6d22bb4c3

diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index a97dfe0..bec2c28 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1614,7 +1614,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
                 pDestNd = rPos.nNode.GetNode().GetTxtNode();
             }
 
-            if( pDestNd && pEnd->nContent.GetIndex() )
+            if (pDestNd && pEnd->nContent.GetIndex())
             {
                 // move the content into the new node
                 SwIndex aIdx( pEndSrcNd, 0 );
@@ -1622,7 +1622,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes )
                                 pEnd->nContent.GetIndex());
             }
 
-            if( bCopyCollFmt )
+            if (pDestNd && bCopyCollFmt)
             {
                 SwDoc* const pInsDoc = pDestNd->GetDoc();
                 ::sw::UndoGuard const ug(pInsDoc->GetIDocumentUndoRedo());
commit 6ee80e749a9ce6f56d53205ac1bd5d19429138a7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 2 15:38:07 2015 +0000

    coverity#1272391 Dereference null return value
    
    Change-Id: Id1c5a498ff5c25eefe2573e695f66d8922213f92

diff --git a/svtools/qa/unit/GraphicObjectTest.cxx b/svtools/qa/unit/GraphicObjectTest.cxx
index 036df77..463a1ce 100644
--- a/svtools/qa/unit/GraphicObjectTest.cxx
+++ b/svtools/qa/unit/GraphicObjectTest.cxx
@@ -262,6 +262,7 @@ void GraphicObjectTest::testTdf88935()
         if( aNodes[nIndex]->IsGrfNode() )
         {
             SwGrfNode* pGrfNode = aNodes[nIndex]->GetGrfNode();
+            CPPUNIT_ASSERT(pGrfNode);
             if( !pGraphObj1 )
             {
                 pGraphObj1 = &pGrfNode->GetGrfObj();


More information about the Libreoffice-commits mailing list