[Libreoffice-commits] core.git: 23 commits - bean/com desktop/source framework/source include/vcl jurt/com qadevOOo/runner qadevOOo/tests ridljar/com scripting/java sd/source swext/mediawiki vcl/inc vcl/source wizards/com xmerge/source
Caolán McNamara
caolanm at redhat.com
Tue Oct 20 13:19:02 PDT 2015
bean/com/sun/star/comp/beans/LocalOfficeWindow.java | 34 ++-----
desktop/source/app/appinit.cxx | 5 -
framework/source/services/desktop.cxx | 2
include/vcl/svapp.hxx | 16 +++
jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java | 9 +
qadevOOo/runner/helper/WindowListener.java | 16 ---
qadevOOo/runner/util/utils.java | 8 -
qadevOOo/tests/java/ifc/document/_XMimeTypeInfo.java | 1
qadevOOo/tests/java/ifc/form/_XConfirmDeleteBroadcaster.java | 2
qadevOOo/tests/java/ifc/form/_XLoadable.java | 6 -
qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java | 22 +---
qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java | 22 +---
qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java | 19 +--
ridljar/com/sun/star/uno/Type.java | 1
scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java | 2
scripting/java/com/sun/star/script/framework/container/ParcelContainer.java | 2
scripting/java/com/sun/star/script/framework/provider/ScriptContext.java | 1
sd/source/ui/annotations/annotationtag.cxx | 8 -
sd/source/ui/annotations/annotationtag.hxx | 2
swext/mediawiki/src/com/sun/star/wiki/Helper.java | 2
swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java | 2
swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java | 4
vcl/inc/svdata.hxx | 1
vcl/source/app/svapp.cxx | 48 +++++++---
wizards/com/sun/star/wizards/common/FileAccess.java | 1
wizards/com/sun/star/wizards/common/PlaceholderTextElement.java | 2
wizards/com/sun/star/wizards/db/TypeInspector.java | 10 --
wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java | 1
xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/sxc/SxcDocumentSerializer.java | 12 --
29 files changed, 108 insertions(+), 153 deletions(-)
New commits:
commit 8e4739b94de0bbc7ceb91705a7ba7946b8b70b94
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 21:04:48 2015 +0100
afl-eventtesting + VclPtr: missing dispose on impress annotation window
regression from
commit c72fac269626cd4c2c3f62a6eed69e47b59256a4
Date: Mon Mar 16 12:17:44 2015 +0200
vclwidget: convert lots more sites to use VclPtr
Change-Id: Iac6a83003d9c395589acdc23fe511d2bb47e91ee
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index bcd3ad8..7fdfec5d 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -566,9 +566,9 @@ void AnnotationTag::OpenPopup( bool bEdit )
if( !mpAnnotationWindow.get() )
{
- vcl::Window* pWindow = dynamic_cast< vcl::Window* >( getView().GetFirstOutputDevice() );
- if( pWindow )
- {
+ vcl::Window* pWindow = dynamic_cast< vcl::Window* >( getView().GetFirstOutputDevice() );
+ if( pWindow )
+ {
RealPoint2D aPosition( mxAnnotation->getPosition() );
Point aPos( pWindow->OutputToScreenPixel( pWindow->LogicToPixel( Point( static_cast<long>(aPosition.X * 100.0), static_cast<long>(aPosition.Y * 100.0) ) ) ) );
@@ -604,7 +604,7 @@ void AnnotationTag::ClosePopup()
{
mpAnnotationWindow->RemoveEventListener( LINK(this, AnnotationTag, WindowEventHandler));
mpAnnotationWindow->Deactivate();
- mpAnnotationWindow.reset();
+ mpAnnotationWindow.disposeAndClear();
}
}
diff --git a/sd/source/ui/annotations/annotationtag.hxx b/sd/source/ui/annotations/annotationtag.hxx
index f627c1f..4a7e0da 100644
--- a/sd/source/ui/annotations/annotationtag.hxx
+++ b/sd/source/ui/annotations/annotationtag.hxx
@@ -82,7 +82,7 @@ private:
VclPtr<AnnotationWindow> mpAnnotationWindow;
Color maColor;
int mnIndex;
- const vcl::Font& mrFont;
+ const vcl::Font& mrFont;
Size maSize;
ImplSVEvent * mnClosePopupEvent;
VclPtr<vcl::Window> mpListenWindow;
commit bcd5004c3bb48cd1cfbd185e6ff30d107b5c81b7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 16:09:11 2015 +0100
coverity#1327109 UrF: Unread field
Change-Id: Iee847f2c82c35e5f92e8be29e1f2062085977dbc
diff --git a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java
index 2ec8e6f..3cded65 100644
--- a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java
+++ b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java
@@ -70,9 +70,7 @@ import util.utils;
public class ConnectionLineAccessibility extends TestCase
{
XWindow xWindow = null;
- Object oDBSource = null;
String aFile = "";
- XConnection connection = null;
XIsolatedConnection isolConnection = null;
XComponent QueryComponent = null;
String user = "";
@@ -98,13 +96,9 @@ public class ConnectionLineAccessibility extends TestCase
{
XInterface oObj = null;
- Object oDBSource = null;
- Object newQuery = null;
- XStorable store = null;
-
Param.getMSF().createInstance("com.sun.star.sdb.DatabaseContext");
- oDBSource = Param.getMSF().createInstance("com.sun.star.sdb.DataSource");
- newQuery = Param.getMSF().createInstance("com.sun.star.sdb.QueryDefinition");
+ Object oDBSource = Param.getMSF().createInstance("com.sun.star.sdb.DataSource");
+ Object newQuery = Param.getMSF().createInstance("com.sun.star.sdb.QueryDefinition");
Param.getMSF().createInstance("com.sun.star.awt.Toolkit");
String mysqlURL = (String) Param.get("mysql.url");
@@ -140,22 +134,18 @@ public class ConnectionLineAccessibility extends TestCase
log.println("writing database file ...");
XDocumentDataSource xDDS = UnoRuntime.queryInterface(XDocumentDataSource.class, oDBSource);
- store = UnoRuntime.queryInterface(XStorable.class,
+ XStorable store = UnoRuntime.queryInterface(XStorable.class,
xDDS.getDatabaseDocument());
aFile = utils.getOfficeTemp(Param.getMSF())+"ConnectionLine.odb";
log.println("... filename will be "+aFile);
- store.storeAsURL(aFile,new PropertyValue[]
- {});
+ store.storeAsURL(aFile,new PropertyValue[]{});
log.println("... done");
isolConnection = UnoRuntime.queryInterface(
XIsolatedConnection.class,
oDBSource);
- XConnection connection = null;
- XStatement statement = null;
-
final String tbl_name1 = "tst_table1";
final String tbl_name2 = "tst_table2";
final String col_name1 = "id1";
@@ -163,8 +153,8 @@ public class ConnectionLineAccessibility extends TestCase
util.utils.waitForEventIdle(Param.getMSF());
- connection = isolConnection.getIsolatedConnection(user, password);
- statement = connection.createStatement();
+ XConnection connection = isolConnection.getIsolatedConnection(user, password);
+ XStatement statement = connection.createStatement();
statement.executeUpdate("drop table if exists " + tbl_name1);
statement.executeUpdate("drop table if exists " + tbl_name2);
statement.executeUpdate("create table " + tbl_name1 + " (" +
diff --git a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java
index 5152492..b7d926e 100644
--- a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java
+++ b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java
@@ -95,13 +95,10 @@ public class JoinViewAccessibility extends TestCase {
{
XInterface oObj = null;
- Object newQuery = null;
- XStorable store = null;
-
Param.getMSF().createInstance("com.sun.star.sdb.DatabaseContext");
Object oDBSource = Param.getMSF()
.createInstance("com.sun.star.sdb.DataSource");
- newQuery = Param.getMSF().createInstance(
+ Object newQuery = Param.getMSF().createInstance(
"com.sun.star.sdb.QueryDefinition");
Param.getMSF().createInstance("com.sun.star.awt.Toolkit");
@@ -138,12 +135,11 @@ public class JoinViewAccessibility extends TestCase {
log.println ("writing database file ...");
XDocumentDataSource xDDS = UnoRuntime.queryInterface(XDocumentDataSource.class, oDBSource);
- store = UnoRuntime.queryInterface(XStorable.class,
+ XStorable store = UnoRuntime.queryInterface(XStorable.class,
xDDS.getDatabaseDocument());
aFile = utils.getOfficeTemp (Param.getMSF ())+"JoinView.odb";
log.println ("... filename will be "+aFile);
- store.storeAsURL (aFile,new PropertyValue[]
- {});
+ store.storeAsURL (aFile,new PropertyValue[]{});
log.println ("... done");
isolConnection = UnoRuntime.queryInterface (
diff --git a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java
index b280bac..384edb8 100644
--- a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java
+++ b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java
@@ -98,13 +98,10 @@ public class TableWindowAccessibility extends TestCase {
PrintWriter log) throws Exception {
XInterface oObj = null;
- Object newQuery = null;
- XStorable store = null;
-
Param.getMSF().createInstance("com.sun.star.sdb.DatabaseContext");
Object oDBSource = Param.getMSF()
.createInstance("com.sun.star.sdb.DataSource");
- newQuery = Param.getMSF().createInstance(
+ Object newQuery = Param.getMSF().createInstance(
"com.sun.star.sdb.QueryDefinition");
Param.getMSF().createInstance("com.sun.star.awt.Toolkit");
@@ -140,7 +137,7 @@ public class TableWindowAccessibility extends TestCase {
log.println("writing database file ...");
XDocumentDataSource xDDS = UnoRuntime.queryInterface(
XDocumentDataSource.class, oDBSource);
- store = UnoRuntime.queryInterface(XStorable.class,
+ XStorable store = UnoRuntime.queryInterface(XStorable.class,
xDDS.getDatabaseDocument());
aFile = utils.getOfficeTemp(Param.getMSF()) + "TableWindow.odb";
log.println("... filename will be " + aFile);
commit 4c7c5fe39aa7dfbc2d87a0d08cdf32dc2e0360e3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 16:06:57 2015 +0100
coverity#1327110 UrF: Unread field
Change-Id: I6147a86cbe216830a693c24654cfaf2e63d4601e
diff --git a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java
index abddd04..5152492 100644
--- a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java
+++ b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java
@@ -69,9 +69,7 @@ import util.utils;
*/
public class JoinViewAccessibility extends TestCase {
XWindow xWindow = null;
- Object oDBSource = null;
String aFile = "";
- XConnection connection = null;
XIsolatedConnection isolConnection = null;
XComponent QueryComponent = null;
String user = "";
@@ -97,12 +95,11 @@ public class JoinViewAccessibility extends TestCase {
{
XInterface oObj = null;
- Object oDBSource = null;
Object newQuery = null;
XStorable store = null;
Param.getMSF().createInstance("com.sun.star.sdb.DatabaseContext");
- oDBSource = Param.getMSF()
+ Object oDBSource = Param.getMSF()
.createInstance("com.sun.star.sdb.DataSource");
newQuery = Param.getMSF().createInstance(
"com.sun.star.sdb.QueryDefinition");
@@ -153,17 +150,14 @@ public class JoinViewAccessibility extends TestCase {
XIsolatedConnection.class,
oDBSource);
- XConnection connection = null;
- XStatement statement = null;
-
final String tbl_name1 = "tst_table1";
final String tbl_name2 = "tst_table2";
final String col_name1 = "id1";
final String col_name2 = "id2";
util.utils.waitForEventIdle(Param.getMSF());
- connection = isolConnection.getIsolatedConnection (user, password);
- statement = connection.createStatement ();
+ XConnection connection = isolConnection.getIsolatedConnection (user, password);
+ XStatement statement = connection.createStatement ();
statement.executeUpdate ("drop table if exists " + tbl_name1);
statement.executeUpdate ("drop table if exists " + tbl_name2);
statement.executeUpdate ("create table " + tbl_name1 + " (" +
commit bd3649ce3a3eff4e4ededc60dcb277ba2ad469b7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 16:05:34 2015 +0100
coverity#1327112 UrF: Unread field
Change-Id: I96ee36baef6301ce98ee200b58cc9634d615cfa1
diff --git a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java
index b7bcd77..b280bac 100644
--- a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java
+++ b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java
@@ -72,9 +72,7 @@ import util.utils;
*/
public class TableWindowAccessibility extends TestCase {
XWindow xWindow = null;
- Object oDBSource = null;
String aFile = "";
- XConnection connection = null;
XIsolatedConnection isolConnection = null;
XComponent QueryComponent = null;
String user = "";
@@ -100,12 +98,11 @@ public class TableWindowAccessibility extends TestCase {
PrintWriter log) throws Exception {
XInterface oObj = null;
- Object oDBSource = null;
Object newQuery = null;
XStorable store = null;
Param.getMSF().createInstance("com.sun.star.sdb.DatabaseContext");
- oDBSource = Param.getMSF()
+ Object oDBSource = Param.getMSF()
.createInstance("com.sun.star.sdb.DataSource");
newQuery = Param.getMSF().createInstance(
"com.sun.star.sdb.QueryDefinition");
@@ -153,17 +150,14 @@ public class TableWindowAccessibility extends TestCase {
isolConnection = UnoRuntime.queryInterface(XIsolatedConnection.class,
oDBSource);
- XConnection connection = null;
- XStatement statement = null;
-
final String tbl_name1 = "tst_table1";
final String tbl_name2 = "tst_table2";
final String col_name1 = "id1";
final String col_name2 = "id2";
util.utils.waitForEventIdle(Param.getMSF());
- connection = isolConnection.getIsolatedConnection(user, password);
- statement = connection.createStatement();
+ XConnection connection = isolConnection.getIsolatedConnection(user, password);
+ XStatement statement = connection.createStatement();
statement.executeUpdate("drop table if exists " + tbl_name1);
statement.executeUpdate("drop table if exists " + tbl_name2);
statement.executeUpdate("create table " + tbl_name1 + " ("
commit 7df47cb431f1b3d41cf3be2065d394128155e823
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 16:04:05 2015 +0100
coverity#1327132 UrF: Unread field
Change-Id: Idda304f3085e09aeb300d336debd6459de1bf414
diff --git a/qadevOOo/runner/helper/WindowListener.java b/qadevOOo/runner/helper/WindowListener.java
index 064743c..6efd454 100644
--- a/qadevOOo/runner/helper/WindowListener.java
+++ b/qadevOOo/runner/helper/WindowListener.java
@@ -23,18 +23,10 @@ package helper;
*/
public class WindowListener implements com.sun.star.awt.XWindowListener {
-
-
- // resize called
- public boolean resizedTrigger;
-
-
-
/**
* Creates a new WindowListener
*/
public WindowListener() {
- resetTrigger();
}
/**
@@ -53,7 +45,6 @@ public class WindowListener implements com.sun.star.awt.XWindowListener {
* The window resize event
*/
public void windowResized(com.sun.star.awt.WindowEvent windowEvent) {
- resizedTrigger = true;
}
/**
@@ -67,11 +58,4 @@ public class WindowListener implements com.sun.star.awt.XWindowListener {
*/
public void disposing(com.sun.star.lang.EventObject eventObject) {
}
-
- /**
- * Reset all triggers to "not fired".
- */
- public void resetTrigger() {
- resizedTrigger = false;
- }
}
commit 19fb7c8b60c93e0fd56887a4f534c43b56abbd0b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 15:48:52 2015 +0100
coverity#1326177 Explicit null dereferenced
Change-Id: I3981037c8383aff65c8b78eb4752c11ddeffc8fd
diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java
index 05b9852..dc1b63c 100644
--- a/qadevOOo/runner/util/utils.java
+++ b/qadevOOo/runner/util/utils.java
@@ -240,15 +240,13 @@ public class utils {
String settingPath = null;
try {
Object settings = msf.createInstance("com.sun.star.comp.framework.PathSettings");
- XPropertySet pthSettings = null;
try {
- pthSettings = (XPropertySet) AnyConverter.toObject(
+ XPropertySet pthSettings = (XPropertySet) AnyConverter.toObject(
new Type(XPropertySet.class), settings);
+ settingPath = (String) pthSettings.getPropertyValue(setting);
} catch (com.sun.star.lang.IllegalArgumentException iae) {
System.out.println("### couldn't get Office Settings");
}
- settingPath = (String) pthSettings.getPropertyValue(setting);
-
} catch (Exception e) {
System.out.println("Couldn't get string value for " + setting);
e.printStackTrace();
@@ -256,8 +254,6 @@ public class utils {
return settingPath;
}
-
-
/**
* This method returns the temp dicrectory of the user.
* Since Java 1.4 it is not possible to read environment variables. To workaround
commit c6351a89533f61bea8866966d2076eff324d102f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 15:44:34 2015 +0100
coverity#1326242 Dereference after null check
Change-Id: I827e6967938114946193f34d7102ff9cd132a1a9
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 8b7d0fe..5f02557 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
@@ -517,19 +517,7 @@ public abstract class SxcDocumentSerializer implements OfficeConstants,
NamedNodeMap cellAtt = node.getAttributes();
- int debug_i=0;
- Node debug_attrib = null;
fmt.clearFormatting();
- if (cellAtt == null || cellAtt.item(0) == null) {
- Debug.log(Debug.INFO, "No Cell Attributes\n");
- // return;
- } else {
- while ((debug_attrib = cellAtt.item(debug_i++)) != null) {
- Debug.log(Debug.INFO, "Cell Attribute " + debug_i +
- ": " + debug_attrib.getNodeName() + " : " +
- debug_attrib.getNodeValue() + "\n");
- }
- }
// Get the type of data in the cell
Node tableValueTypeNode =
commit cf4595de4f6f3322f70b5c5b23875afd9079e8a8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 15:38:30 2015 +0100
coverity#1326356 presumably a deliberate fall through
Change-Id: I6338746911e279f934a0cb7113de81d7a02c6cb1
diff --git a/ridljar/com/sun/star/uno/Type.java b/ridljar/com/sun/star/uno/Type.java
index a4da5b1..c1b0e3e 100644
--- a/ridljar/com/sun/star/uno/Type.java
+++ b/ridljar/com/sun/star/uno/Type.java
@@ -399,6 +399,7 @@ public class Type {
{
return _typeName.equals(type._typeName);
}
+ // fall-through
case TypeClass.EXCEPTION_value:
case TypeClass.INTERFACE_value:
Class<?> c1 = getZClass();
commit 8536c279602a554ae2fb803ce4ce384102dbbd76
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 15:36:26 2015 +0100
coverity#1326431 Dereference null return value
Change-Id: Ib85b3e03d2a9ce6339cd2496e33cc09cff2b9952
diff --git a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
index a968de8..7444e1e 100644
--- a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
+++ b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
@@ -89,28 +89,20 @@ public class LocalOfficeWindow
}
/**
- * Returns an AWT toolkit.
- */
- private XToolkit queryAWTToolkit()
- throws com.sun.star.uno.Exception
- {
- // Create a UNO toolkit.
- XMultiComponentFactory compfactory;
- XComponentContext xContext = mConnection.getComponentContext();
- if ( xContext != null )
- {
- compfactory = mConnection.getComponentContext().getServiceManager();
- XMultiServiceFactory factory;
- factory = UnoRuntime.queryInterface(
- XMultiServiceFactory.class, compfactory);
- Object object = factory.createInstance( "com.sun.star.awt.Toolkit");
- return UnoRuntime.queryInterface(XToolkit.class, object);
- }
- else
- return null;
- }
+ * Returns an AWT toolkit.
+ */
+ private XToolkit queryAWTToolkit() throws com.sun.star.uno.Exception
+ {
+ // Create a UNO toolkit.
+ XComponentContext xContext = mConnection.getComponentContext();
+ XMultiComponentFactory compfactory = mConnection.getComponentContext().getServiceManager();
+ XMultiServiceFactory factory = UnoRuntime.queryInterface(
+ XMultiServiceFactory.class, compfactory);
+ Object object = factory.createInstance( "com.sun.star.awt.Toolkit");
+ return UnoRuntime.queryInterface(XToolkit.class, object);
+ }
- /// called when system parent is available, reparents the bean window
+ /// called when system parent is available, reparents the bean window
private synchronized void aquireSystemWindow()
{
if ( !bPeer )
commit 86d275366a1d8c32273d7cf347623062935ec576
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 15:31:07 2015 +0100
coverity#1326553 Dereference before null check
Change-Id: I1fe2e0477f136f31b854672878d0544d9492d51b
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 ddbd460..5ff3f70 100644
--- a/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java
+++ b/scripting/java/com/sun/star/script/framework/container/ParcelContainer.java
@@ -694,7 +694,7 @@ public class ParcelContainer implements XNameAccess {
LogUtils.DEBUG("** parcelName = " + parsedUri.parcel);
}
- if (parsedUri.function != null && (parsedUri.function.length() > 0)) {
+ if (parsedUri.function.length() > 0) {
// strip out parcel name
parsedUri.function =
commit f8ce21a346ed1ed89c8a13ea2eddafca1e851d5d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 15:29:58 2015 +0100
coverity#1326552 Dereference before null check
Change-Id: I5a3fb6b5e9966a8e0c5dd0175e4f4f3292025a2c
diff --git a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java
index abe00e1..8e9b3a0 100644
--- a/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java
+++ b/scripting/java/com/sun/star/script/framework/browse/ParcelBrowseNode.java
@@ -136,7 +136,7 @@ public class ParcelBrowseNode extends PropertySet implements
}
public boolean hasChildNodes() {
- if (container != null && container.hasByName(getName()) && parcel != null) {
+ if (container != null && parcel != null && container.hasByName(getName())) {
return parcel.hasElements();
}
commit f43dde5d2dd4afecf75ba69f1ad3d3f180c57321
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 15:28:22 2015 +0100
coverity#1326559 Dereference before null check
Change-Id: I1661514bf3002b79544615620843d1e535aabfce
diff --git a/wizards/com/sun/star/wizards/common/PlaceholderTextElement.java b/wizards/com/sun/star/wizards/common/PlaceholderTextElement.java
index d3756bc..60ec7eb 100644
--- a/wizards/com/sun/star/wizards/common/PlaceholderTextElement.java
+++ b/wizards/com/sun/star/wizards/common/PlaceholderTextElement.java
@@ -41,7 +41,7 @@ public class PlaceholderTextElement extends TextElement
public void write(Object textRange)
{
super.write(textRange);
- if (text == null || text.equals(PropertyNames.EMPTY_STRING))
+ if (text.equals(PropertyNames.EMPTY_STRING))
{
XTextRange xTextRange = UnoRuntime.queryInterface(XTextRange.class, textRange);
try
commit 3d9103037d00cbb0df37f78ee56d34e2cd8c7065
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 15:22:55 2015 +0100
coverity#1326575 Useless call
also
coverity#1326574 Useless call
Change-Id: Ida860ca8ed1475c88e90fc8aaf608c440453a9a0
diff --git a/wizards/com/sun/star/wizards/common/FileAccess.java b/wizards/com/sun/star/wizards/common/FileAccess.java
index 14f77ed..d664b28 100644
--- a/wizards/com/sun/star/wizards/common/FileAccess.java
+++ b/wizards/com/sun/star/wizards/common/FileAccess.java
@@ -213,7 +213,6 @@ public class FileAccess
Locale aLocale = (Locale) Helper.getUnoStructValue(defaults, "CharLocale");
if (aLocale == null)
{
- java.util.Locale.getDefault();
aLocale = new com.sun.star.lang.Locale();
aLocale.Country = java.util.Locale.getDefault().getCountry();
aLocale.Language = java.util.Locale.getDefault().getLanguage();
diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java b/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java
index fc84743..9c723c5 100644
--- a/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java
+++ b/wizards/com/sun/star/wizards/reportbuilder/layout/ReportBuilderLayouter.java
@@ -803,7 +803,6 @@ abstract public class ReportBuilderLayouter implements IReportBuilderLayouter
XNumberFormatsSupplier x = xFormattedField.getFormatsSupplier();
XNumberFormats xFormats = x.getNumberFormats();
XNumberFormatTypes x3 = UnoRuntime.queryInterface(XNumberFormatTypes.class, xFormats);
- Locale.getDefault();
com.sun.star.lang.Locale aLocale = new com.sun.star.lang.Locale();
aLocale.Country = Locale.getDefault().getCountry();
aLocale.Language = Locale.getDefault().getLanguage();
commit b1e949ed10053a0bcb4b1cb554814b07009e9512
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 15:06:29 2015 +0100
coverity#1326963 RV: Bad use of return value
Change-Id: I86aaa7904b3d6e551dcaf0e8d207bea2f2f134c3
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java b/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
index 1e89e5c..4c1b340 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiEditorImpl.java
@@ -365,7 +365,9 @@ public final class WikiEditorImpl extends WeakBase
{
// remove the temporary file
File aFile = new File( new URI( sTemp2Url ) );
- aFile.delete();
+ if (!aFile.delete()) {
+ throw new java.lang.Exception("could not remove" + sTemp2Url);
+ }
}
catch ( java.lang.Exception e )
{
commit 1bb2c50ff17989c9acff7ab85f47c1480103bd21
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 15:02:41 2015 +0100
coverity#1327145 UrF: Unread field
Change-Id: Iab1f9fc1c33790cb6766f60db585653aa877386d
diff --git a/qadevOOo/tests/java/ifc/document/_XMimeTypeInfo.java b/qadevOOo/tests/java/ifc/document/_XMimeTypeInfo.java
index 5a25f04..6744186 100644
--- a/qadevOOo/tests/java/ifc/document/_XMimeTypeInfo.java
+++ b/qadevOOo/tests/java/ifc/document/_XMimeTypeInfo.java
@@ -37,7 +37,6 @@ import com.sun.star.lang.XComponent;
public class _XMimeTypeInfo extends MultiMethodTest {
public XMimeTypeInfo oObj = null;
- public XComponent source = null ;
public String[] smi = null;
/**
commit 33cedaa331c8ac1c53f66238970d93961b032b4e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 15:01:33 2015 +0100
coverity#1327147 UrF: Unread field
Change-Id: I611eb419c4e67a6fc63791500fb9d5ccfe7f1488
diff --git a/qadevOOo/tests/java/ifc/form/_XConfirmDeleteBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XConfirmDeleteBroadcaster.java
index ee06ff7..7f5b613 100644
--- a/qadevOOo/tests/java/ifc/form/_XConfirmDeleteBroadcaster.java
+++ b/qadevOOo/tests/java/ifc/form/_XConfirmDeleteBroadcaster.java
@@ -41,13 +41,11 @@ import lib.MultiMethodTest;
*/
public class _XConfirmDeleteBroadcaster extends MultiMethodTest {
public XConfirmDeleteBroadcaster oObj = null;
- protected boolean confirmed = false;
protected XConfirmDeleteListener mxConfirmDeleteListener =
new ConfirmDeleteImpl();
private class ConfirmDeleteImpl implements XConfirmDeleteListener {
public boolean confirmDelete(RowChangeEvent rowChangeEvent) {
- confirmed = true;
return true;
}
public void disposing(EventObject eventObject) {
commit 06913bd76dc150fa3097f808bde832bd4088d753
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 15:00:34 2015 +0100
coverity#1327149 UrF: Unread field
Change-Id: I444e27236b715b1eb612dee3559a28967e069744
diff --git a/qadevOOo/tests/java/ifc/form/_XLoadable.java b/qadevOOo/tests/java/ifc/form/_XLoadable.java
index 7f89388..a4bf0e7 100644
--- a/qadevOOo/tests/java/ifc/form/_XLoadable.java
+++ b/qadevOOo/tests/java/ifc/form/_XLoadable.java
@@ -45,12 +45,9 @@ public class _XLoadable extends MultiMethodTest {
* Listener implementation which sets flags on appropriate method calls
*/
protected static class TestLoadListener implements com.sun.star.form.XLoadListener {
- public boolean disposingCalled = false ;
public boolean loadedCalled = false ;
public boolean reloadedCalled = false ;
- public boolean reloadingCalled = false ;
public boolean unloadedCalled = false ;
- public boolean unloadingCalled = false ;
private final java.io.PrintWriter log;
public TestLoadListener(java.io.PrintWriter log) {
@@ -58,7 +55,6 @@ public class _XLoadable extends MultiMethodTest {
}
public void disposing(com.sun.star.lang.EventObject e) {
- disposingCalled = true ;
log.println(" disposing was called.") ;
}
@@ -73,7 +69,6 @@ public class _XLoadable extends MultiMethodTest {
}
public void reloading(com.sun.star.lang.EventObject e) {
- reloadingCalled = true ;
log.println(" reloading was called.") ;
}
@@ -83,7 +78,6 @@ public class _XLoadable extends MultiMethodTest {
}
public void unloading(com.sun.star.lang.EventObject e) {
- unloadingCalled = true ;
log.println(" unloading was called.") ;
}
}
commit fb8d764d841f7452fd955890cb315abbc82ae2c2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 14:54:36 2015 +0100
coverity#1327460 DLS: Dead local store
Change-Id: I53431357f153d61d3f80e9a3e76358d8e9bb0e0b
diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java
index c949b55..05dd9c7 100644
--- a/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java
+++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java
@@ -449,9 +449,12 @@ public class java_remote_bridge
* @see com.sun.star.uno.IBridge#acquire
*/
public void acquire() {
- int x = _life_count.incrementAndGet();
-
- if(DEBUG) System.err.println("##### " + getClass().getName() + ".acquire:" + x);
+ if(DEBUG) {
+ int x = _life_count.incrementAndGet();
+ System.err.println("##### " + getClass().getName() + ".acquire:" + x);
+ } else {
+ _life_count.incrementAndGet();
+ }
}
/**
commit b23deda0bbd27c424bd1b8bac3e8655cc1de620f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 14:51:19 2015 +0100
coverity#1327463 Dm: Dubious method used
Change-Id: I452603d75aa2e96d4c5e7fc00d730c98a265c186
diff --git a/swext/mediawiki/src/com/sun/star/wiki/Helper.java b/swext/mediawiki/src/com/sun/star/wiki/Helper.java
index 8a15621..0208899 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/Helper.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/Helper.java
@@ -770,7 +770,7 @@ public class Helper
connPost.setDoOutput(true);
connPost.connect();
- OutputStreamWriter post = new OutputStreamWriter(connPost.getOutputStream());
+ OutputStreamWriter post = new OutputStreamWriter(connPost.getOutputStream(), "UTF-8");
post.write("wpName=");
post.write(URLEncoder.encode(sWikiUser, "UTF-8"));
post.write("&wpRemember=1");
commit 8da886989b9f60fbcbd2c7eac5db47128030b1aa
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 14:50:44 2015 +0100
coverity#1327464 Dm: Dubious method used
Change-Id: I7fb3182f181909a289f4253370904215518c1f23
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java b/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java
index 58638b5..a576ef9 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java
@@ -204,7 +204,7 @@ public class WikiArticle
connPost.setDoOutput(true);
connPost.connect();
- OutputStreamWriter post = new OutputStreamWriter(connPost.getOutputStream());
+ OutputStreamWriter post = new OutputStreamWriter(connPost.getOutputStream(), "UTF-8");
post.write("wpTextbox1=");
post.write(URLEncoder.encode(sWikiCode, "UTF-8"));
post.write("&wpSummary=");
commit 03828157f4bf252a37dc8f745f163fc70f4c166c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 14:45:24 2015 +0100
coverity#1327466 UrF: Unread field
this class is unused since
commit 8f60da0a29744d456cb074af05aeb4b40d1774fa
Author: Noel Grandin <noel at peralex.com>
Date: Wed Oct 14 11:49:19 2015 +0200
cid#1326681 DLS: Dead local store
and clean up the return value, no need to return a TypeInfo when all we
need is a boolean
Change-Id: I8da388b861612acd925ef502904181d140e3abb5
diff --git a/wizards/com/sun/star/wizards/db/TypeInspector.java b/wizards/com/sun/star/wizards/db/TypeInspector.java
index 0067b59..bc9f696 100644
--- a/wizards/com/sun/star/wizards/db/TypeInspector.java
+++ b/wizards/com/sun/star/wizards/db/TypeInspector.java
@@ -46,16 +46,6 @@ public class TypeInspector
};
static final int INVALID = 999999;
- public static class TypeInfo
- {
- public boolean bisAutoIncrementable;
-
- public TypeInfo(boolean _bisAutoIncrementable)
- {
- bisAutoIncrementable = _bisAutoIncrementable;
- }
- }
-
public TypeInspector(XResultSet _xResultSet)
{
try
commit b6b8ef2508335604f56325f696f1c1791d892305
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 12:19:48 2015 +0100
afl-eventtesting: shutdown cleaner to allow things to deregister
Change-Id: I2dc7c90f1f5a776bb0e6772d2b381116d28dd46f
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index c41880e..f8b0957 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -98,8 +98,9 @@ void Desktop::RegisterServices(Reference< XComponentContext > const & context)
CommandLineArgs& rCmdLine = GetCommandLineArgs();
// Headless mode for FAT Office, auto cancels any dialogs that popup
- bool bHeadlessMode = rCmdLine.IsHeadless() && !rCmdLine.IsEventTesting();
- if (bHeadlessMode)
+ if (rCmdLine.IsEventTesting())
+ Application::EnableEventTestingMode();
+ else if (rCmdLine.IsHeadless())
Application::EnableHeadlessMode(false);
// read accept string from configuration
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 7d09db7..d6c427e 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -231,7 +231,7 @@ 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 = true;
+ bool bAllowUI = !Application::IsEventTestingModeEnabled();
bool bFramesClosed = impl_closeFrames(bAllowUI);
if ( ! bFramesClosed )
{
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 429cf08..c51f925 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1382,6 +1382,22 @@ public:
///@}
+ /** @name Event Testing Mode
+ */
+
+ /** Enables event testing mode.
+
+ */
+ static void EnableEventTestingMode();
+
+ /** Determines if event testing mode is enabled
+
+ @return True if event testing mode is enabled, false if not.
+ */
+ static bool IsEventTestingModeEnabled();
+
+ ///@}
+
/** @name IME Status Window Control
*/
///@{
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 48749ea..10fda49 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -162,6 +162,7 @@ struct ImplSVAppData
int mnEventTestLimit;
DECL_STATIC_LINK_TYPED(ImplSVAppData, ImplQuitMsg, void*, void);
+ DECL_STATIC_LINK_TYPED(ImplSVAppData, ImplPrepareExitMsg, void*, void);
DECL_STATIC_LINK_TYPED(ImplSVAppData, ImplEndAllDialogsMsg, void*, void);
DECL_STATIC_LINK_TYPED(ImplSVAppData, ImplEndAllPopupsMsg, void*, void);
DECL_STATIC_LINK_TYPED(ImplSVAppData, ImplVclEventTestingHdl, void*, void);
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 7a474de..81ab92a 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -65,7 +65,9 @@
#include "com/sun/star/uno/Reference.h"
#include "com/sun/star/awt/XToolkit.hpp"
+#include <com/sun/star/frame/Desktop.hpp>
#include "com/sun/star/uno/XNamingService.hpp"
+#include <com/sun/star/util/XModifiable.hpp>
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "comphelper/solarmutex.hxx"
#include "osl/process.h"
@@ -359,7 +361,7 @@ void Application::EndAllPopups()
namespace
{
- bool InjectKeyEvent(SvStream& rStream)
+ VclPtr<vcl::Window> GetEventWindow()
{
VclPtr<vcl::Window> xWin(Application::GetFirstTopLevelWindow());
while (xWin)
@@ -368,6 +370,12 @@ namespace
break;
xWin.reset(Application::GetNextTopLevelWindow(xWin));
}
+ return xWin;
+ }
+
+ bool InjectKeyEvent(SvStream& rStream)
+ {
+ VclPtr<vcl::Window> xWin(GetEventWindow());
if (!xWin)
return false;
@@ -398,6 +406,7 @@ namespace
{
Application::EndAllPopups();
Application::EndAllDialogs();
+ Application::PostUserEvent( LINK( NULL, ImplSVAppData, ImplPrepareExitMsg ) );
Application::Quit();
}
}
@@ -437,25 +446,26 @@ IMPL_STATIC_LINK_NOARG_TYPED( ImplSVAppData, ImplVclEventTestingHdl, void*, void
}
}
+IMPL_STATIC_LINK_NOARG_TYPED( ImplSVAppData, ImplPrepareExitMsg, void*, void )
+{
+ //now close top level frames
+ (void)GetpApp()->QueryExit();
+}
+
void Application::Execute()
{
ImplSVData* pSVData = ImplGetSVData();
pSVData->maAppData.mbInAppExecute = true;
pSVData->maAppData.mbAppQuit = false;
- sal_uInt16 n = GetCommandLineParamCount();
- for (sal_uInt16 i = 0; i != n; ++i)
+ if (Application::IsEventTestingModeEnabled())
{
- if (GetCommandLineParam(i) == "--eventtesting")
- {
- pSVData->maAppData.mnEventTestLimit = 50;
- pSVData->maAppData.mpEventTestingIdle = new Idle("eventtesting");
- pSVData->maAppData.mpEventTestingIdle->SetIdleHdl(LINK(&(pSVData->maAppData), ImplSVAppData, VclEventTestingHdl));
- pSVData->maAppData.mpEventTestingIdle->SetPriority(SchedulerPriority::MEDIUM);
- pSVData->maAppData.mpEventTestInput = new SvFileStream("eventtesting", StreamMode::READ);
- pSVData->maAppData.mpEventTestingIdle->Start();
- break;
- }
+ pSVData->maAppData.mnEventTestLimit = 50;
+ pSVData->maAppData.mpEventTestingIdle = new Idle("eventtesting");
+ pSVData->maAppData.mpEventTestingIdle->SetIdleHdl(LINK(&(pSVData->maAppData), ImplSVAppData, VclEventTestingHdl));
+ pSVData->maAppData.mpEventTestingIdle->SetPriority(SchedulerPriority::MEDIUM);
+ pSVData->maAppData.mpEventTestInput = new SvFileStream("eventtesting", StreamMode::READ);
+ pSVData->maAppData.mpEventTestingIdle->Start();
}
while ( !pSVData->maAppData.mbAppQuit )
@@ -1655,6 +1665,18 @@ void Application::EnableConsoleOnly()
bConsoleOnly = true;
}
+static bool bEventTestingMode = false;
+
+bool Application::IsEventTestingModeEnabled()
+{
+ return bEventTestingMode;
+}
+
+void Application::EnableEventTestingMode()
+{
+ bEventTestingMode = true;
+}
+
void Application::ShowNativeErrorBox(const OUString& sTitle ,
const OUString& sMessage)
{
commit e9fc41292be2e2f9a29fbb6092e182f6bee9639d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 20 12:43:14 2015 +0100
Revert "coverity#1327168 see if stock SuppressWarnings is sufficient to"
that didn't work
This reverts commit 04a7df738aae3b255c1faa80fa79262602eaead7.
Change-Id: I5e4dfc28c03668eebb0fe8056beede7ef0b05ee5
diff --git a/scripting/java/com/sun/star/script/framework/provider/ScriptContext.java b/scripting/java/com/sun/star/script/framework/provider/ScriptContext.java
index de285a2..1f73ffb 100644
--- a/scripting/java/com/sun/star/script/framework/provider/ScriptContext.java
+++ b/scripting/java/com/sun/star/script/framework/provider/ScriptContext.java
@@ -52,7 +52,6 @@ public class ScriptContext extends PropertySet implements XScriptContext {
private final XComponentContext m_xComponentContext;
// property, accessed via reflection
- @SuppressWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
public String m_sDocURI = null;
private ScriptContext(XComponentContext xmComponentContext, XDesktop xDesktop,
More information about the Libreoffice-commits
mailing list