[Libreoffice-commits] core.git: 16 commits - basegfx/source bean/com framework/source include/basegfx officecfg/registry qadevOOo/runner scripting/java sfx2/source svx/source vcl/source wizards/com

Caolán McNamara caolanm at redhat.com
Thu Oct 22 08:45:39 PDT 2015


 basegfx/source/curve/b2dcubicbezier.cxx                                     |    4 -
 basegfx/source/polygon/b2dpolygoncutandtouch.cxx                            |    4 -
 bean/com/sun/star/comp/beans/LocalOfficeWindow.java                         |    2 
 framework/source/services/desktop.cxx                                       |    9 ++
 include/basegfx/numeric/ftools.hxx                                          |    6 +
 officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu        |    4 -
 officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu     |    4 -
 qadevOOo/runner/base/java_fat.java                                          |   12 ++-
 scripting/java/com/sun/star/script/framework/container/ParcelContainer.java |    6 +
 scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java       |    7 --
 sfx2/source/appl/appbas.cxx                                                 |   14 ++--
 svx/source/svdraw/svdotextdecomposition.cxx                                 |   20 ++---
 vcl/source/app/svapp.cxx                                                    |    1 
 wizards/com/sun/star/wizards/common/JavaTools.java                          |   16 ++--
 wizards/com/sun/star/wizards/form/FieldLinker.java                          |    6 +
 wizards/com/sun/star/wizards/form/StyleApplier.java                         |    6 +
 wizards/com/sun/star/wizards/form/UIControlArranger.java                    |    3 
 wizards/com/sun/star/wizards/ui/ButtonList.java                             |   34 +++++-----
 18 files changed, 99 insertions(+), 59 deletions(-)

New commits:
commit d34e464e41e89721934a2a5b1db97af241bb48c3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 16:27:58 2015 +0100

    rename Rectangles and Ovals to Legacy to scare folk off them
    
    towards the ms-compatible basic shapes
    
    Change-Id: I64f223ca3098015364285861dec3e2653bade8d4

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu
index 349df4e..d6ca109 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu
@@ -246,7 +246,7 @@
           <value>false</value>
         </prop>
         <prop oor:name="UIName" oor:type="xs:string">
-          <value xml:lang="en-US">Circles and Ovals</value>
+          <value xml:lang="en-US">Legacy Circles and Ovals</value>
         </prop>
         <prop oor:name="Visible" oor:type="xs:boolean">
           <value>false</value>
@@ -478,7 +478,7 @@
           <value>false</value>
         </prop>
         <prop oor:name="UIName" oor:type="xs:string">
-          <value xml:lang="en-US">Rectangles</value>
+          <value xml:lang="en-US">Legacy Rectangles</value>
         </prop>
         <prop oor:name="Visible" oor:type="xs:boolean">
           <value>false</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
index bbaf583..a45bac8 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
@@ -175,7 +175,7 @@
           <value>false</value>
         </prop>
         <prop oor:name="UIName" oor:type="xs:string">
-          <value xml:lang="en-US">Circles and Ovals</value>
+          <value xml:lang="en-US">Legacy Circles and Ovals</value>
         </prop>
         <prop oor:name="Visible" oor:type="xs:boolean">
           <value>false</value>
@@ -508,7 +508,7 @@
           <value>false</value>
         </prop>
         <prop oor:name="UIName" oor:type="xs:string">
-          <value xml:lang="en-US">Rectangles</value>
+          <value xml:lang="en-US">Legacy Rectangles</value>
         </prop>
         <prop oor:name="Visible" oor:type="xs:boolean">
           <value>false</value>
commit fd5a8dced0b7eb4024fdc402c2f5f69205b5e922
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 13:14:57 2015 +0100

    Visisble->Visible
    
    cosmetic only
    
    Change-Id: I9363e4766d6dfdd9327cfa74e5922f3b51c67fd2

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 950617c..b654147 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1206,8 +1206,8 @@ void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryLi
         // add stopped state if loop is not endless
         if(0L != nRepeat)
         {
-            bool bVisisbleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue());
-            drawinglayer::animation::AnimationEntryFixed aStop(ENDLESS_TIME, bVisisbleWhenStopped ? 0.0 : 1.0);
+            bool bVisibleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue());
+            drawinglayer::animation::AnimationEntryFixed aStop(ENDLESS_TIME, bVisibleWhenStopped ? 0.0 : 1.0);
             rAnimList.append(aStop);
         }
     }
@@ -1215,11 +1215,11 @@ void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryLi
 
 void impCreateScrollTiming(const SfxItemSet& rSet, drawinglayer::animation::AnimationEntryList& rAnimList, bool bForward, double fTimeFullPath, double fFrequency)
 {
-    bool bVisisbleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue());
-    bool bVisisbleWhenStarted(static_cast<const SdrTextAniStartInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTARTINSIDE)).GetValue());
+    bool bVisibleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue());
+    bool bVisibleWhenStarted(static_cast<const SdrTextAniStartInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTARTINSIDE)).GetValue());
     const sal_uInt32 nRepeat(static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue());
 
-    if(bVisisbleWhenStarted)
+    if(bVisibleWhenStarted)
     {
         // move from center to outside
         drawinglayer::animation::AnimationEntryLinear aInOut(fTimeFullPath * 0.5, fFrequency, 0.5, bForward ? 1.0 : 0.0);
@@ -1232,7 +1232,7 @@ void impCreateScrollTiming(const SfxItemSet& rSet, drawinglayer::animation::Anim
     aLoop.append(aThrough);
     rAnimList.append(aLoop);
 
-    if(0L != nRepeat && bVisisbleWhenStopped)
+    if(0L != nRepeat && bVisibleWhenStopped)
     {
         // move from outside to center
         drawinglayer::animation::AnimationEntryLinear aOutIn(fTimeFullPath * 0.5, fFrequency, bForward ? 0.0 : 1.0, 0.5);
@@ -1255,10 +1255,10 @@ void impCreateAlternateTiming(const SfxItemSet& rSet, drawinglayer::animation::A
 
     const double fStartPosition(bForward ? fRelativeTextLength : 1.0 - fRelativeTextLength);
     const double fEndPosition(bForward ? 1.0 - fRelativeTextLength : fRelativeTextLength);
-    bool bVisisbleWhenStarted(static_cast<const SdrTextAniStartInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTARTINSIDE)).GetValue());
+    bool bVisibleWhenStarted(static_cast<const SdrTextAniStartInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTARTINSIDE)).GetValue());
     const sal_uInt32 nRepeat(static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue());
 
-    if(!bVisisbleWhenStarted)
+    if(!bVisibleWhenStarted)
     {
         // move from outside to center
         drawinglayer::animation::AnimationEntryLinear aOutIn(fTimeFullPath * 0.5, fFrequency, bForward ? 0.0 : 1.0, 0.5);
@@ -1296,8 +1296,8 @@ void impCreateAlternateTiming(const SfxItemSet& rSet, drawinglayer::animation::A
 
     if(0L != nRepeat)
     {
-        bool bVisisbleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue());
-        if(bVisisbleWhenStopped)
+        bool bVisibleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue());
+        if(bVisibleWhenStopped)
         {
             // add timing for staying at the end
             drawinglayer::animation::AnimationEntryFixed aEnd(ENDLESS_TIME, 0.5);
commit 8e203f58bc275df13e66e733bf0e43970079abed
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 13:13:31 2015 +0100

    crashtesting+ubsan: kde170880-1.html ANISTOPINSIDE cast to StartInsideItem
    
    presumably this is a simple typo and it should be ANISTARTINSIDE
    
    Change-Id: I05c6cfb857955c7d418e3997845dd0ef6d2bff36

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 9533e9e..950617c 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1216,7 +1216,7 @@ void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryLi
 void impCreateScrollTiming(const SfxItemSet& rSet, drawinglayer::animation::AnimationEntryList& rAnimList, bool bForward, double fTimeFullPath, double fFrequency)
 {
     bool bVisisbleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue());
-    bool bVisisbleWhenStarted(static_cast<const SdrTextAniStartInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE )).GetValue());
+    bool bVisisbleWhenStarted(static_cast<const SdrTextAniStartInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTARTINSIDE)).GetValue());
     const sal_uInt32 nRepeat(static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue());
 
     if(bVisisbleWhenStarted)
@@ -1255,7 +1255,7 @@ void impCreateAlternateTiming(const SfxItemSet& rSet, drawinglayer::animation::A
 
     const double fStartPosition(bForward ? fRelativeTextLength : 1.0 - fRelativeTextLength);
     const double fEndPosition(bForward ? 1.0 - fRelativeTextLength : fRelativeTextLength);
-    bool bVisisbleWhenStarted(static_cast<const SdrTextAniStartInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE )).GetValue());
+    bool bVisisbleWhenStarted(static_cast<const SdrTextAniStartInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTARTINSIDE)).GetValue());
     const sal_uInt32 nRepeat(static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue());
 
     if(!bVisisbleWhenStarted)
commit 73ffc462b9b7b1e48470c17d6fbffda66be76e67
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 12:54:16 2015 +0100

    coverity#1326120 try and silence Constant expression result
    
    Change-Id: Iafd034dd51135ad99f56279ceee1c770f91436b0

diff --git a/basegfx/source/curve/b2dcubicbezier.cxx b/basegfx/source/curve/b2dcubicbezier.cxx
index bbafb7b..ee87cbe 100644
--- a/basegfx/source/curve/b2dcubicbezier.cxx
+++ b/basegfx/source/curve/b2dcubicbezier.cxx
@@ -446,7 +446,7 @@ namespace basegfx
                             : aVecA.getY() / aEdge.getY());
 
                         // relative end point of vector in edge range?
-                        if(fTools::moreOrEqual(fScale, 0.0) && fTools::lessOrEqual(fScale, 1.0))
+                        if (fTools::betweenOrEqualEither(fScale, 0.0, 1.0))
                         {
                             bAIsTrivial = true;
                         }
@@ -468,7 +468,7 @@ namespace basegfx
                             : aVecB.getY() / aEdge.getY());
 
                         // end point of vector in edge range? Caution: controlB is directed AGAINST edge
-                        if(fTools::lessOrEqual(fScale, 0.0) && fTools::moreOrEqual(fScale, -1.0))
+                        if (fTools::betweenOrEqualEither(fScale, -1.0, 0.0))
                         {
                             bBIsTrivial = true;
                         }
diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
index 25b0530..0ccebe9 100644
--- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
+++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
@@ -229,7 +229,7 @@ namespace basegfx
                         const double fOne(1.0);
                         fCut = (aVecB.getY() * (rCurrB.getX() - rCurrA.getX()) + aVecB.getX() * (rCurrA.getY() - rCurrB.getY())) / fCut;
 
-                        if(fTools::moreOrEqual(fCut, fZero) && fTools::lessOrEqual(fCut, fOne))
+                        if (fTools::betweenOrEqualEither(fCut, fZero, fOne))
                         {
                             // it's a candidate, but also need to test parameter value of cut on line 2
                             double fCut2;
@@ -244,7 +244,7 @@ namespace basegfx
                                 fCut2 = (rCurrA.getY() + (fCut * aVecA.getY()) - rCurrB.getY()) / aVecB.getY();
                             }
 
-                            if(fTools::moreOrEqual(fCut2, fZero) && fTools::lessOrEqual(fCut2, fOne))
+                            if (fTools::betweenOrEqualEither(fCut2, fZero, fOne))
                             {
                                 // cut is in range, add point. Two edges can have only one cut, but
                                 // add a cut point to each list. The lists may be the same for
diff --git a/include/basegfx/numeric/ftools.hxx b/include/basegfx/numeric/ftools.hxx
index b4ae0a4..35a1a35 100644
--- a/include/basegfx/numeric/ftools.hxx
+++ b/include/basegfx/numeric/ftools.hxx
@@ -196,6 +196,12 @@ namespace basegfx
         {
             return (rfValA > rfValB || equal(rfValA, rfValB));
         }
+
+        static bool betweenOrEqualEither(const double& rfValA, const double& rfValB, const double& rfValC)
+        {
+            return (rfValA > rfValB && rfValA < rfValC) || equal(rfValA, rfValB) || equal(rfValA, rfValC);
+        }
+
     };
 } // end of namespace basegfx
 
commit d7f3eed145fa8220bb34de1f21403d80b2b3f5ae
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 11:49:09 2015 +0100

    afl-eventtesting: improve event testing exit
    
    don't "Quit" twice and skip tearing down office ipc etc for the pseudo-quit
    AFL_PERSISTENT=1 case
    
    Change-Id: I26f0e798b95bc9376890381d4e5bd87fe8f12622

diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index d6c427e..2f02a4c 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -231,8 +231,13 @@ sal_Bool SAL_CALL Desktop::terminate()
 
     // try to close all open frames.
     // Allow using of any UI ... because Desktop.terminate() was designed as UI functionality in the past.
-    bool bAllowUI = !Application::IsEventTestingModeEnabled();
-    bool bFramesClosed = impl_closeFrames(bAllowUI);
+    bool bIsEventTestingMode = Application::IsEventTestingModeEnabled();
+    bool bFramesClosed = impl_closeFrames(!bIsEventTestingMode);
+    if (bIsEventTestingMode)
+    {
+        Application::Quit();
+        return true;
+    }
     if ( ! bFramesClosed )
     {
         impl_sendCancelTerminationEvent(lCalledTerminationListener);
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 81ab92a..f4928aa 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -407,7 +407,6 @@ namespace
         Application::EndAllPopups();
         Application::EndAllDialogs();
         Application::PostUserEvent( LINK( NULL, ImplSVAppData, ImplPrepareExitMsg ) );
-        Application::Quit();
     }
 }
 
commit 7e0108266d7338d14ff953efcce0c019f693dd55
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 09:52:39 2015 +0100

    coverity#1326738 Dm: Dubious method used
    
    Change-Id: Ia266e5c1b66e35fdb4c6fdd5816f3b35d54ae1bd

diff --git a/qadevOOo/runner/base/java_fat.java b/qadevOOo/runner/base/java_fat.java
index c5c1476..a0426fd 100644
--- a/qadevOOo/runner/base/java_fat.java
+++ b/qadevOOo/runner/base/java_fat.java
@@ -21,7 +21,8 @@ import helper.APIDescGetter;
 import helper.AppProvider;
 
 import java.io.BufferedReader;
-import java.io.FileReader;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import lib.MultiMethodTest;
@@ -392,7 +393,14 @@ public class java_fat implements TestBase {
         BufferedReader exclusion = null;
 
         try {
-            exclusion = new BufferedReader(new FileReader(url));
+            InputStreamReader reader = new InputStreamReader(new FileInputStream(url), "UTF-8");
+            exclusion = new BufferedReader(reader);
+        } catch (java.io.UnsupportedEncodingException uee) {
+            if (debug) {
+                System.out.println("Couldn't decode file " + url);
+            }
+
+            return entryList;
         } catch (java.io.FileNotFoundException fnfe) {
             if (debug) {
                 System.out.println("Couldn't find file " + url);
commit 337661a98938a7477f666dff190322d65951cbd2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 09:43:01 2015 +0100

    coverity#1326446 Dereference null return value
    
    Change-Id: Ief00b565147bd4a08c4fd6de9df71d9126dc1f75

diff --git a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java
index 5ff3f70..d7dd252 100644
--- a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java
+++ b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java
@@ -137,6 +137,12 @@ public class ParcelContainer implements XNameAccess {
 
         for (ParcelContainer c : childContainers) {
 
+            String name = c.getName();
+            if (name == null)
+            {
+                continue;
+            }
+
             String location =
                 ScriptMetaData.getLocationPlaceHolder(c.containerUrl, c.getName());
 
commit 9740a474a43260ababe5db3c49109b0190ba8a7f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 09:37:38 2015 +0100

    coverity#1326429 Dereference null return value
    
    Change-Id: Ib047f6cb255610422afb423006b58e0da7eacead

diff --git a/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java b/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java
index 432d401..4e2059b 100644
--- a/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java
+++ b/scripting/java/com/sun/star/script/framework/io/UCBStreamHandler.java
@@ -207,13 +207,12 @@ public class UCBStreamHandler extends URLStreamHandler {
             InputStream is) throws
         IOException {
 
-        ZipEntry entry;
         ZipInputStream zis = new ZipInputStream(is);
 
         while (zis.available() != 0) {
-            entry = zis.getNextEntry();
+            ZipEntry entry = zis.getNextEntry();
 
-            if (entry.getName().equals(file)) {
+            if (entry != null && entry.getName().equals(file)) {
                 return zis;
             }
         }
@@ -275,4 +274,4 @@ public class UCBStreamHandler extends URLStreamHandler {
 
         return result;
     }
-}
\ No newline at end of file
+}
commit 2092a029bb4eeacc1029a11b77b6120d0ad3a9ff
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 09:22:17 2015 +0100

    coverity#1326403 Dereference null return value
    
    Change-Id: I1f191a2bc0139bada7603681eb0246de7dd15139

diff --git a/wizards/com/sun/star/wizards/form/UIControlArranger.java b/wizards/com/sun/star/wizards/form/UIControlArranger.java
index 9e68a6f..566829d 100644
--- a/wizards/com/sun/star/wizards/form/UIControlArranger.java
+++ b/wizards/com/sun/star/wizards/form/UIControlArranger.java
@@ -169,6 +169,9 @@ public class UIControlArranger
                 if (curControlForm.getArrangemode() == FormWizard.COLUMNAR_LEFT)
                 {
                     Control[] LabelControls = curControlForm.getLabelControls();
+                    if (LabelControls == null) {
+                        continue;
+                    }
                     for (int n = 0; n < LabelControls.length; n++)
                     {
                         LabelControls[n].xPropertySet.setPropertyValue(PropertyNames.PROPERTY_ALIGN, Short.valueOf(iAlignValue));
commit b8562697c971922ee57099817297d6ad3713f9f9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 09:32:12 2015 +0100

    coverity#1326382 Dereference null return value
    
    Change-Id: I1c427c3d6cae2cf1798adcc29cd6f5f51eb2b49e

diff --git a/wizards/com/sun/star/wizards/form/StyleApplier.java b/wizards/com/sun/star/wizards/form/StyleApplier.java
index eda18d3..3f20fd8 100644
--- a/wizards/com/sun/star/wizards/form/StyleApplier.java
+++ b/wizards/com/sun/star/wizards/form/StyleApplier.java
@@ -409,6 +409,9 @@ public class StyleApplier
                                     for (int i = 0; i < 2; i++)
                                     {
                                         XPropertySet xPropertySet = oTimeStampControl.getControlofGroupShapeByIndex(i);
+                                        if (xPropertySet == null) {
+                                            continue;
+                                        }
                                         setDBControlColors(xPropertySet, _iStyleColors);
                                     }
                                 }
commit 3af09eae62595a6c0895e7410f7be51f347a802a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 09:23:24 2015 +0100

    coverity#1326384 Dereference null return value
    
    Change-Id: Ibf3c2ffb78740d55a6e6e4e6c66fb71b5b1c4c85

diff --git a/wizards/com/sun/star/wizards/form/StyleApplier.java b/wizards/com/sun/star/wizards/form/StyleApplier.java
index b61ce95..eda18d3 100644
--- a/wizards/com/sun/star/wizards/form/StyleApplier.java
+++ b/wizards/com/sun/star/wizards/form/StyleApplier.java
@@ -272,6 +272,9 @@ public class StyleApplier
                             for (int i = 0; i < 2; i++)
                             {
                                 XPropertySet xPropertySet = oTimeStampControl.getControlofGroupShapeByIndex(i);
+                                if (xPropertySet == null) {
+                                    continue;
+                                }
                                 if (xPropertySet.getPropertySetInfo().hasPropertyByName(PropertyNames.PROPERTY_BORDER))
                                 {
                                     xPropertySet.setPropertyValue(PropertyNames.PROPERTY_BORDER, IBorderValue);
commit 12e2d518d89b349d989601e1aaa9e37ca5fba093
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 09:18:41 2015 +0100

    coverity#1326397 Dereference null return value
    
    Change-Id: Iafb022cf3bbdbaa8a6b230cb60377d90e64fe142

diff --git a/wizards/com/sun/star/wizards/common/JavaTools.java b/wizards/com/sun/star/wizards/common/JavaTools.java
index aa8436c..cfeb142 100644
--- a/wizards/com/sun/star/wizards/common/JavaTools.java
+++ b/wizards/com/sun/star/wizards/common/JavaTools.java
@@ -122,13 +122,15 @@ public class JavaTools
     public static int FieldInTable(String[][] SearchList, String SearchString)
     {
         int retvalue = -1;
-        int FieldLen = SearchList.length;
-        if (FieldLen > 0) {
-            for (int i = 0; i < FieldLen; i++) {
-                if (SearchList[i][0] != null) {
-                    if (SearchList[i][0].equals(SearchString)) {
-                        retvalue = i;
-                        break;
+        if (SearchList != null) {
+            int FieldLen = SearchList.length;
+            if (FieldLen > 0) {
+                for (int i = 0; i < FieldLen; i++) {
+                    if (SearchList[i][0] != null) {
+                        if (SearchList[i][0].equals(SearchString)) {
+                            retvalue = i;
+                            break;
+                        }
                     }
                 }
             }
commit ae056434494dc35954cf39c37b730cb82b667412
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 09:14:42 2015 +0100

    coverity#1326173 Explicit null dereferenced
    
    Change-Id: Icee3d9af9b9811e99afca49e2fe1b46fb4a85bca

diff --git a/wizards/com/sun/star/wizards/form/FieldLinker.java b/wizards/com/sun/star/wizards/form/FieldLinker.java
index e80bb9d..2a0c3d3 100644
--- a/wizards/com/sun/star/wizards/form/FieldLinker.java
+++ b/wizards/com/sun/star/wizards/form/FieldLinker.java
@@ -282,8 +282,10 @@ public class FieldLinker extends DBLimitedFieldSelection
 
         public void itemStateChanged(ItemEvent EventObject)
         {
-            int ikey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList);
-            enableNextControlRow(ikey);
+            if (EventObject != null) {
+                int ikey = CurUnoDialog.getControlKey(EventObject.Source, CurUnoDialog.ControlList);
+                enableNextControlRow(ikey);
+            }
         }
 
         public void disposing(com.sun.star.lang.EventObject eventObject)
commit f86c07afd733234a2653325df0f165c0dfeaf716
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 09:12:37 2015 +0100

    coverity#1326381 Dereference null return value
    
    Change-Id: I86f5fee9bd77b741536816b6b4d1b6b520acba9e

diff --git a/wizards/com/sun/star/wizards/ui/ButtonList.java b/wizards/com/sun/star/wizards/ui/ButtonList.java
index 9e6f365..b0624c9 100644
--- a/wizards/com/sun/star/wizards/ui/ButtonList.java
+++ b/wizards/com/sun/star/wizards/ui/ButtonList.java
@@ -285,23 +285,25 @@ public class ButtonList implements XItemEventBroadcaster, XActionListener
         }
         for (int i = 0; i < m_aButtons.length; i++)
         {
-            Object[] oResources = renderer.getImageUrls(getObjectFor(i));
-            if (oResources != null)
+            Object oObj = getObjectFor(i);
+            if (oObj == null)
+                continue;
+            Object[] oResources = renderer.getImageUrls(oObj);
+            if (oResources == null)
+                continue;
+            if (oResources.length == 1)
             {
-                if (oResources.length == 1)
-                {
-                    Helper.setUnoPropertyValue(m_aButtons[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, oResources[0]);
-                }
-                else if (oResources.length == 2)
-                {
-                    oUnoDialog.getPeerConfiguration().setImageUrl(m_aButtons[i].getModel(), oResources[0], oResources[1]);
-                }
-                boolean bTabStop = Boolean.TRUE; // focusable ? Boolean.TRUE : Boolean.FALSE;
-                Helper.setUnoPropertyValue(m_aButtons[i].getModel(), "Tabstop", bTabStop);
-                if (refreshOverNull)
-                {
-                    setVisible(m_aButtons[i], true);
-                }
+                Helper.setUnoPropertyValue(m_aButtons[i].getModel(), PropertyNames.PROPERTY_IMAGEURL, oResources[0]);
+            }
+            else if (oResources.length == 2)
+            {
+                oUnoDialog.getPeerConfiguration().setImageUrl(m_aButtons[i].getModel(), oResources[0], oResources[1]);
+            }
+            boolean bTabStop = Boolean.TRUE; // focusable ? Boolean.TRUE : Boolean.FALSE;
+            Helper.setUnoPropertyValue(m_aButtons[i].getModel(), "Tabstop", bTabStop);
+            if (refreshOverNull)
+            {
+                setVisible(m_aButtons[i], true);
             }
         }
     }
commit c4e1857dc034d38900f8a7ef0a10814911e91e59
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 09:04:41 2015 +0100

    coverity#441226 Dereference null return value
    
    Change-Id: Ib80e5f5d9e41c6511779e7a956cdba9b856c25ba

diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx
index 1a4365b..085d788 100644
--- a/sfx2/source/appl/appbas.cxx
+++ b/sfx2/source/appl/appbas.cxx
@@ -152,12 +152,14 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
     {
         case SID_ATTR_UNDO_COUNT:
         {
-            const SfxUInt16Item* pCountItem = rReq.GetArg<SfxUInt16Item>(nSID);
-            std::shared_ptr< comphelper::ConfigurationChanges > batch(
-                comphelper::ConfigurationChanges::create());
-            officecfg::Office::Common::Undo::Steps::set(
-                pCountItem->GetValue(), batch);
-            batch->commit();
+            if (const SfxUInt16Item* pCountItem = rReq.GetArg<SfxUInt16Item>(nSID))
+            {
+                std::shared_ptr< comphelper::ConfigurationChanges > batch(
+                    comphelper::ConfigurationChanges::create());
+                officecfg::Office::Common::Undo::Steps::set(
+                    pCountItem->GetValue(), batch);
+                batch->commit();
+            }
             break;
         }
 
commit 69eaba2e9b2269e18145cc663cf0e503b85a5a6d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 22 08:59:02 2015 +0100

    coverity#1328488 DLS: Dead local store
    
    Change-Id: Ief4b5909d40ee3c3c86f60eeb980591a3e8b230e

diff --git a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
index 7444e1e..1fc5768 100644
--- a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
+++ b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
@@ -95,7 +95,7 @@ public class LocalOfficeWindow
     {
          // Create a UNO toolkit.
          XComponentContext xContext = mConnection.getComponentContext();
-         XMultiComponentFactory compfactory = mConnection.getComponentContext().getServiceManager();
+         XMultiComponentFactory compfactory = xContext.getServiceManager();
          XMultiServiceFactory factory = UnoRuntime.queryInterface(
                  XMultiServiceFactory.class, compfactory);
          Object object  = factory.createInstance( "com.sun.star.awt.Toolkit");


More information about the Libreoffice-commits mailing list