[Libreoffice-commits] core.git: scripting/java
Robert Antoni Buj i Gelonch
robert.buj at gmail.com
Thu Oct 2 12:55:20 PDT 2014
scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java | 5 +----
scripting/java/org/openoffice/idesupport/filter/ExceptParcelFilter.java | 6 ++----
scripting/java/org/openoffice/netbeans/modules/office/actions/DeployParcelAction.java | 7 ++-----
scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelFolder.java | 6 +-----
4 files changed, 6 insertions(+), 18 deletions(-)
New commits:
commit 4959ff5fef4381b7d09650fa62e8cda649ba7676
Author: Robert Antoni Buj i Gelonch <robert.buj at gmail.com>
Date: Thu Oct 2 19:51:11 2014 +0200
scripting: The if statement is redundant
Change-Id: Ia6186be4ed48fd75d1063eed233a88e09b675bf1
Reviewed-on: https://gerrit.libreoffice.org/11774
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
diff --git a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java
index e789d86..adcde1f 100644
--- a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java
+++ b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java
@@ -210,10 +210,7 @@ public class SecurityDialog extends WeakBase implements XComponent,
// XServiceInfo
public boolean supportsService(/*IN*/String serviceName) {
- if (serviceName.equals(__serviceName))
- return true;
-
- return false;
+ return serviceName.equals(__serviceName);
}
// XServiceInfo
diff --git a/scripting/java/org/openoffice/idesupport/filter/ExceptParcelFilter.java b/scripting/java/org/openoffice/idesupport/filter/ExceptParcelFilter.java
index 178d449..25ce356 100644
--- a/scripting/java/org/openoffice/idesupport/filter/ExceptParcelFilter.java
+++ b/scripting/java/org/openoffice/idesupport/filter/ExceptParcelFilter.java
@@ -33,11 +33,9 @@ public class ExceptParcelFilter implements FileFilter {
public static ExceptParcelFilter getInstance() {
return filter;
}
- public boolean validate(String name) {
- if (name.startsWith(ExceptParcelFilter.parcelName))
- return true;
- return false;
+ public boolean validate(String name) {
+ return name.startsWith(ExceptParcelFilter.parcelName);
}
@Override
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/actions/DeployParcelAction.java b/scripting/java/org/openoffice/netbeans/modules/office/actions/DeployParcelAction.java
index 6f9f48b..e662fae 100644
--- a/scripting/java/org/openoffice/netbeans/modules/office/actions/DeployParcelAction.java
+++ b/scripting/java/org/openoffice/netbeans/modules/office/actions/DeployParcelAction.java
@@ -215,14 +215,11 @@ public class DeployParcelAction extends CookieAction implements
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setFileFilter(new FileFilter() {
public boolean accept(File file) {
- if (file.isDirectory() ||
+ return file.isDirectory() ||
file.getName().endsWith(".sxw") ||
file.getName().endsWith(".sxc") ||
file.getName().endsWith(".sxd") ||
- file.getName().endsWith(".sxi"))
- return true;
-
- return false;
+ file.getName().endsWith(".sxi");
}
public String getDescription() {
diff --git a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelFolder.java b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelFolder.java
index a9f0456..8d27555 100644
--- a/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelFolder.java
+++ b/scripting/java/org/openoffice/netbeans/modules/office/loader/ParcelFolder.java
@@ -284,11 +284,7 @@ public class ParcelFolder extends DataFolder {
private class ParcelFolderFilter implements DataFilter {
public boolean acceptDataObject(DataObject dobj) {
String name = dobj.getPrimaryFile().getNameExt();
-
- if (name.equals(ParcelZipper.PARCEL_DESCRIPTOR_XML))
- return false;
-
- return true;
+ return !name.equals(ParcelZipper.PARCEL_DESCRIPTOR_XML);
}
}
}
More information about the Libreoffice-commits
mailing list