[Libreoffice-commits] core.git: 5 commits - qadevOOo/tests vcl/inc vcl/unx wizards/com xmerge/source

Caolán McNamara caolanm at redhat.com
Tue Feb 16 12:29:12 UTC 2016


 qadevOOo/tests/java/ifc/awt/_XWindow.java                                                    |    3 
 vcl/inc/unx/gtk/gtkgdi.hxx                                                                   |    2 
 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx                                                    |   35 ++++------
 wizards/com/sun/star/wizards/form/FieldLinker.java                                           |    8 +-
 wizards/com/sun/star/wizards/table/ScenarioSelector.java                                     |    4 -
 wizards/com/sun/star/wizards/ui/FilterComponent.java                                         |    4 +
 xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java |    7 +-
 7 files changed, 32 insertions(+), 31 deletions(-)

New commits:
commit e6d255420a7fb00ed1050e0e96768eea57a92bc4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 16 12:27:29 2016 +0000

    Related: tdf#97739 fix gtk3 spinbuttons for recent control region changes
    
    Change-Id: Ia745cbe808395c4c9ec6a3c72612814a4834bbcb

diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index 2bb6029..d4ae5f0 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -163,7 +163,7 @@ private:
                              ControlPart nPart,
                              Rectangle aAreaRect,
                              ControlState nState );
-           Rectangle PaintSpinButton(GtkStyleContext *context,
+           void PaintSpinButton(GtkStyleContext *context,
                          cairo_t *cr,
                          const Rectangle& rControlRectangle,
                          ControlType nType,
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 8cdb67b..df3f5c6 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -607,14 +607,13 @@ void GtkSalGraphics::PaintOneSpinButton( GtkStyleContext *context,
     g_object_unref(pixbuf);
 }
 
-Rectangle GtkSalGraphics::PaintSpinButton(GtkStyleContext *context,
+void GtkSalGraphics::PaintSpinButton(GtkStyleContext *context,
                                      cairo_t *cr,
                                      const Rectangle& rControlRectangle,
                                      ControlType nType,
-                                     ControlPart /*nPart*/,
+                                     ControlPart nPart,
                                      const ImplControlValue& rValue )
 {
-    Rectangle            areaRect;
     const SpinbuttonValue *pSpinVal = (rValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue *>(&rValue) : nullptr;
     ControlPart upBtnPart = PART_BUTTON_UP;
     ControlState upBtnState = ControlState::NONE;
@@ -630,26 +629,20 @@ Rectangle GtkSalGraphics::PaintSpinButton(GtkStyleContext *context,
         downBtnState = pSpinVal->mnLowerState;
     }
 
-    areaRect = rControlRectangle;
-
-    gtk_render_background(context, cr,
-                          0, 0,
-                          areaRect.GetWidth(), areaRect.GetHeight() );
-    gtk_render_frame(context, cr,
-                     0, 0,
-                     areaRect.GetWidth(), areaRect.GetHeight() );
-
-    // CTRL_SPINBUTTONS pass their area in pSpinVal, not in rControlRectangle
-    if (pSpinVal)
+    if (nPart == PART_ENTIRE_CONTROL)
     {
-        areaRect = pSpinVal->maUpperRect;
-        areaRect.Union( pSpinVal->maLowerRect );
+        gtk_render_background(context, cr,
+                              0, 0,
+                              rControlRectangle.GetWidth(), rControlRectangle.GetHeight() );
+        gtk_render_frame(context, cr,
+                         0, 0,
+                         rControlRectangle.GetWidth(), rControlRectangle.GetHeight() );
     }
 
-    PaintOneSpinButton(mpSpinUpStyle, cr, nType, upBtnPart, areaRect, upBtnState );
-    PaintOneSpinButton(mpSpinDownStyle, cr, nType, downBtnPart, areaRect, downBtnState );
-
-    return areaRect;
+    cairo_translate(cr, -rControlRectangle.Left(), -rControlRectangle.Top());
+    PaintOneSpinButton(mpSpinUpStyle, cr, nType, upBtnPart, rControlRectangle, upBtnState );
+    PaintOneSpinButton(mpSpinDownStyle, cr, nType, downBtnPart, rControlRectangle, downBtnState );
+    cairo_translate(cr, rControlRectangle.Left(), rControlRectangle.Top());
 }
 
 #define ARROW_SIZE 11 * 0.85
@@ -1478,7 +1471,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
         PaintScrollbar(context, cr, rControlRegion, nType, nPart, rValue);
         break;
     case RENDER_SPINBUTTON:
-        aDamageRect.Union(PaintSpinButton(context, cr, rControlRegion, nType, nPart, rValue));
+        PaintSpinButton(context, cr, rControlRegion, nType, nPart, rValue);
         break;
     case RENDER_COMBOBOX:
         PaintCombobox(flags, cr, rControlRegion, nType, nPart, rValue);
commit 7cdb46536db710d1173f410d02f3c49674939db8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 16 11:43:57 2016 +0000

    coverity#1326425 Dereference null return value
    
    Change-Id: I034a110457d1fa20c392e6660874077def125edd

diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java
index 501059f..9cf2942 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java
@@ -469,15 +469,20 @@ public abstract class SxcDocumentSerializer implements OfficeConstants,
             Debug.log(Debug.TRACE, "traverseColumn() default-cell-style : " + cellStyleName);
         }
 
+        CellStyle cellStyle = null;
+
         if(cellStyleName.equalsIgnoreCase("Default") || cellStyleName.length()==0) {
 
             Debug.log(Debug.TRACE, "No default cell Style Attribute was found");
 
         } else {
 
-            CellStyle cellStyle = (CellStyle)styleCat.lookup(cellStyleName,
+            cellStyle = (CellStyle)styleCat.lookup(cellStyleName,
                                 SxcConstants.TABLE_CELL_STYLE_FAMILY, null,
                                 CellStyle.class);
+        }
+
+        if (cellStyle != null) {
             Format defaultFmt = new Format(cellStyle.getFormat());
             col.setFormat(defaultFmt);
         }
commit f359cbc665f34540213b7b28e8a72c755e22dbd1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 16 11:40:46 2016 +0000

    coverity#1326398 Dereference null return value
    
    Change-Id: I3a33d9a4b90d23c9262fcabcb252b60def4ce585

diff --git a/wizards/com/sun/star/wizards/table/ScenarioSelector.java b/wizards/com/sun/star/wizards/table/ScenarioSelector.java
index f0a41de..61b4b74 100644
--- a/wizards/com/sun/star/wizards/table/ScenarioSelector.java
+++ b/wizards/com/sun/star/wizards/table/ScenarioSelector.java
@@ -235,7 +235,9 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
             {
                 FieldDescription curfielddescription = CurTableWizardUnoDialog.fielditems.get(fieldnames[i]);
                 PropertyValue[] aProperties = curfielddescription.getPropertyValues();
-                this.curtabledescriptor.addColumn(aProperties);
+                if (aProperties != null {
+                    this.curtabledescriptor.addColumn(aProperties);
+                }
             }
             catch (RuntimeException e)
             {
commit 5b5b06628be63ff80cdbfc2cb41e68ba04bf5454
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 16 11:33:54 2016 +0000

    coverity#coverity#1326173 Explicit null dereferenced
    
    Change-Id: Ifecc942dce4cafb1dcd7028fe742f450892564e4

diff --git a/wizards/com/sun/star/wizards/form/FieldLinker.java b/wizards/com/sun/star/wizards/form/FieldLinker.java
index 3384f02..c5222f2 100644
--- a/wizards/com/sun/star/wizards/form/FieldLinker.java
+++ b/wizards/com/sun/star/wizards/form/FieldLinker.java
@@ -284,13 +284,13 @@ public class FieldLinker extends DBLimitedFieldSelection
 
     private class ItemListenerImpl implements com.sun.star.awt.XItemListener
     {
-
         public void itemStateChanged(ItemEvent EventObject)
         {
-            if (EventObject != null) {
-                int ikey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList);
-                enableNextControlRow(ikey);
+            if (EventObject == null) {
+                return;
             }
+            int ikey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList);
+            enableNextControlRow(ikey);
         }
 
         public void disposing(com.sun.star.lang.EventObject eventObject)
diff --git a/wizards/com/sun/star/wizards/ui/FilterComponent.java b/wizards/com/sun/star/wizards/ui/FilterComponent.java
index 27e7eff..ad1eb18 100644
--- a/wizards/com/sun/star/wizards/ui/FilterComponent.java
+++ b/wizards/com/sun/star/wizards/ui/FilterComponent.java
@@ -106,6 +106,10 @@ public class FilterComponent
 
         public void itemStateChanged(com.sun.star.awt.ItemEvent EventObject)
         {
+            if (EventObject == null) {
+                return;
+            }
+
             int iKey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList);
             String sControlName = PropertyNames.EMPTY_STRING;
             switch (iKey)
commit 83f3e8ec978d999e54b58b5596498860bda82c29
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 16 11:29:34 2016 +0000

    coverity#1327140 UrF: Unread field
    
    Change-Id: Ide851a6d015a61603b6bff90e52a20d43bf98198

diff --git a/qadevOOo/tests/java/ifc/awt/_XWindow.java b/qadevOOo/tests/java/ifc/awt/_XWindow.java
index b418a2b..472a91d 100644
--- a/qadevOOo/tests/java/ifc/awt/_XWindow.java
+++ b/qadevOOo/tests/java/ifc/awt/_XWindow.java
@@ -559,16 +559,13 @@ public class _XWindow extends MultiMethodTest {
     * removePaintListener()
     */
     public static class TestPaintListener implements XPaintListener {
-        public boolean paint = false;
 
         public void windowPaint(PaintEvent e) {
-            paint = true;
         }
 
         public void disposing(EventObject e) {}
 
         public void init() {
-            paint = false;
         }
 
     }


More information about the Libreoffice-commits mailing list