[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - 2 commits - libreofficekit/source

Caolán McNamara caolanm at redhat.com
Mon Jan 11 02:13:09 PST 2016


 libreofficekit/source/gtk/lokdocview.cxx |   14 ++++++--------
 libreofficekit/source/gtk/tilebuffer.hxx |    4 ++++
 2 files changed, 10 insertions(+), 8 deletions(-)

New commits:
commit d753e9e41283ca1e0d77001ec1174426451dd7fe
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 21 09:11:16 2015 +0000

    coverity#1315075 Uninitialized scalar field
    
    Change-Id: I003839589354f02f8064b6a6af6174d2793b9b3a
    (cherry picked from commit 92305c3c41d120b868e0821221a583697868ad6d)
    Reviewed-on: https://gerrit.libreoffice.org/21271
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/libreofficekit/source/gtk/tilebuffer.hxx b/libreofficekit/source/gtk/tilebuffer.hxx
index 96100d7..cdd3e70 100644
--- a/libreofficekit/source/gtk/tilebuffer.hxx
+++ b/libreofficekit/source/gtk/tilebuffer.hxx
@@ -267,6 +267,10 @@ struct LOEvent
         , m_nSetGraphicSelectionType(0)
         , m_nSetGraphicSelectionX(0)
         , m_nSetGraphicSelectionY(0)
+        , m_nTilePixelWidth(0)
+        , m_nTilePixelHeight(0)
+        , m_nTileTwipWidth(0)
+        , m_nTileTwipHeight(0)
     {
     }
 
commit af32996eb55008b9787516a280a237b61a05ca05
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Dec 19 15:11:03 2015 +0000

    coverity#1343633 Resource leak
    
    Change-Id: I2384091557c2a3b061e2c60118309f35b65b45d6
    (cherry picked from commit 746da6b7fb3829e1ca23a4b8dfec6c502bac681c)
    Reviewed-on: https://gerrit.libreoffice.org/21270
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 918f292..426773c 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -335,6 +335,9 @@ static void
 doSearch(LOKDocView* pDocView, const char* pText, bool bBackwards, bool highlightAll)
 {
     LOKDocViewPrivate& priv = getPrivate(pDocView);
+    if (!priv->m_pDocument)
+        return;
+
     boost::property_tree::ptree aTree;
     GtkWidget* drawingWidget = GTK_WIDGET(pDocView);
     GdkWindow* drawingWindow = gtk_widget_get_window(drawingWidget);
@@ -342,9 +345,6 @@ doSearch(LOKDocView* pDocView, const char* pText, bool bBackwards, bool highligh
     cairo_rectangle_int_t cairoVisRect;
     int x, y;
 
-    if (!priv->m_pDocument)
-        return;
-
     cairo_region_get_rectangle(cairoVisRegion, 0, &cairoVisRect);
     x = pixelToTwip (cairoVisRect.x, priv->m_fZoom);
     y = pixelToTwip (cairoVisRect.y, priv->m_fZoom);
@@ -2543,13 +2543,13 @@ SAL_DLLPUBLIC_EXPORT void
 lok_doc_view_set_part (LOKDocView* pDocView, int nPart)
 {
     LOKDocViewPrivate& priv = getPrivate(pDocView);
+    if (!priv->m_pDocument)
+        return;
+
     GTask* task = g_task_new(pDocView, nullptr, nullptr, nullptr);
     LOEvent* pLOEvent = new LOEvent(LOK_SET_PART);
     GError* error = nullptr;
 
-    if (!priv->m_pDocument)
-        return;
-
     pLOEvent->m_nPart = nPart;
     g_task_set_task_data(task, pLOEvent, LOEvent::destroy);
 
@@ -2566,7 +2566,6 @@ SAL_DLLPUBLIC_EXPORT gchar*
 lok_doc_view_get_part_name (LOKDocView* pDocView, int nPart)
 {
     LOKDocViewPrivate& priv = getPrivate(pDocView);
-
     if (!priv->m_pDocument)
         return nullptr;
 
@@ -2682,7 +2681,6 @@ lok_doc_view_post_command (LOKDocView* pDocView,
                            gboolean bNotifyWhenFinished)
 {
     LOKDocViewPrivate& priv = getPrivate(pDocView);
-
     if (!priv->m_pDocument)
         return;
 


More information about the Libreoffice-commits mailing list