summaryrefslogtreecommitdiff
path: root/qadevOOo
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-04-26 22:04:27 +0900
committerTomaž Vajngerl <quikee@gmail.com>2018-05-07 16:30:35 +0200
commit7a8ed362eb163ac15a000ba1cfc74b58315800a1 (patch)
tree79c1543ac1edd99a7cf3fe7f26573828b4b2be1e /qadevOOo
parent3e7bea5ece847dcd7234f7e7fd310b1daab0eec1 (diff)
[API CHANGE] revert and deprecate *BackGraphicURL add *BackGraphic
*BackGraphicURL include the following properties: - BackGraphicURL - FooterBackGraphicURL - HeaderBackGraphicURL - ParaBackGraphicURL This were removed, but for backwards compatibility this commit adds them back again and depreactes them in the UNO API. The behaviour also changes as internal vnd.sun.star.GraphicObject scheme URLs aren't supported so this properties can only be set and only if a external URL is provided. If getting such a property then a RuntimeException will be thrown. [ Miklos Vajna: fixed up sw/qa and writerfilter bits. ] Change-Id: If60011837da96197b576bfe2671ecafccad736c7 Reviewed-on: https://gerrit.libreoffice.org/53511 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'qadevOOo')
-rw-r--r--qadevOOo/runner/util/utils.java6
-rw-r--r--qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java25
-rw-r--r--qadevOOo/tests/java/mod/_sw/CharacterStyle.java4
-rw-r--r--qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java6
-rw-r--r--qadevOOo/tests/java/mod/_sw/PageStyle.java8
-rw-r--r--qadevOOo/tests/java/mod/_sw/ParagraphStyle.java5
-rw-r--r--qadevOOo/tests/java/mod/_sw/SwXTextCursor.java13
7 files changed, 52 insertions, 15 deletions
diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java
index a0f525ab8339..1e6901fca1d2 100644
--- a/qadevOOo/runner/util/utils.java
+++ b/qadevOOo/runner/util/utils.java
@@ -30,6 +30,7 @@ import java.net.Socket;
import java.net.ServerSocket;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.Arrays;
import com.sun.star.awt.XToolkitExperimental;
import com.sun.star.beans.XPropertySet;
@@ -577,16 +578,19 @@ public class utils {
* @param props The instance of XPropertySet
* @param includePropertyAttribute Properties without these attributes are filtered and will not be returned.
* @param excludePropertyAttribute Properties with these attributes are filtered and will not be returned.
+ * @param array of string names of properties that will be skipped
* @return A String array with all property names.
* @see com.sun.star.beans.XPropertySet
* @see com.sun.star.beans.Property
* @see com.sun.star.beans.PropertyAttribute
*/
public static String[] getFilteredPropertyNames(XPropertySet props, short includePropertyAttribute,
- short excludePropertyAttribute) {
+ short excludePropertyAttribute, String[] skipList) {
Property[] the_props = props.getPropertySetInfo().getProperties();
ArrayList<String> l = new ArrayList<String>();
for (int i = 0; i < the_props.length; i++) {
+ if (Arrays.asList(skipList).contains(the_props[i].Name))
+ continue;
boolean exclude = ((the_props[i].Attributes & excludePropertyAttribute) != 0);
boolean include = (includePropertyAttribute == 0) ||
((the_props[i].Attributes & includePropertyAttribute) != 0);
diff --git a/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java
index 697f5d0c7c83..1d169539413d 100644
--- a/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java
+++ b/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java
@@ -19,8 +19,10 @@
package ifc.beans;
import java.util.HashSet;
+import java.util.ArrayList;
import java.util.Set;
import java.util.StringTokenizer;
+import java.util.Arrays;
import lib.MultiMethodTest;
import lib.Status;
@@ -132,17 +134,30 @@ public class _XMultiPropertySet extends MultiMethodTest {
boolean bResult = true;
Property[] properties = propertySetInfo.getProperties();
- String[] allnames = new String[properties.length];
+
+ ArrayList<String> allFilteredNames = new ArrayList<String>();
+ ArrayList<Property> allFilteredProperties = new ArrayList<Property>();
+
+ String[] skipNames = (String[]) tEnv.getObjRelation("SkipProperties");
+
for (int i = 0; i < properties.length; i++) {
- allnames[i] = properties[i].Name;
+ if (skipNames == null || !Arrays.asList(skipNames).contains(properties[i].Name))
+ {
+ allFilteredNames.add(properties[i].Name);
+ allFilteredProperties.add(properties[i]);
+ }
}
- values = oObj.getPropertyValues(allnames);
+ String[] arrayAllFilteredNames = allFilteredNames.toArray(new String[allFilteredNames.size()]);
+
+ values = oObj.getPropertyValues(arrayAllFilteredNames);
bResult &= values!=null;
tRes.tested("getPropertyValues()", bResult) ;
- getPropsToTest(properties);
+ Property[] arrayFilteredProperties = allFilteredProperties.toArray(new Property[allFilteredProperties.size()]);
+
+ getPropsToTest(arrayFilteredProperties);
}
/**
@@ -346,5 +361,3 @@ public class _XMultiPropertySet extends MultiMethodTest {
disposeEnvironment();
}
}
-
-
diff --git a/qadevOOo/tests/java/mod/_sw/CharacterStyle.java b/qadevOOo/tests/java/mod/_sw/CharacterStyle.java
index 085f9c9ba122..1671a39b99ed 100644
--- a/qadevOOo/tests/java/mod/_sw/CharacterStyle.java
+++ b/qadevOOo/tests/java/mod/_sw/CharacterStyle.java
@@ -137,8 +137,10 @@ public class CharacterStyle extends TestCase {
XPropertySet xStyleProp = UnoRuntime.queryInterface(XPropertySet.class, oMyStyle);
+ String[] skipPropetiesNamed = {};
+
short exclude = PropertyAttribute.READONLY;
- tEnv.addObjRelation("PropertyNames",utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude));
+ tEnv.addObjRelation("PropertyNames",utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude, skipPropetiesNamed));
return tEnv;
}
diff --git a/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java b/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java
index 15b0b8faa1c1..0ccff31ed554 100644
--- a/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java
+++ b/qadevOOo/tests/java/mod/_sw/ConditionalParagraphStyle.java
@@ -129,8 +129,12 @@ public class ConditionalParagraphStyle extends TestCase {
XPropertySet xStyleProp = UnoRuntime.queryInterface(XPropertySet.class, oMyStyle);
short exclude = PropertyAttribute.READONLY;
- String[] names = utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude);
+ String[] skipPropetiesNamed = { "ParaBackGraphicURL" };
+
+ String[] names = utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude, skipPropetiesNamed);
+
tEnv.addObjRelation("PropertyNames", names);
+ tEnv.addObjRelation("SkipProperties", skipPropetiesNamed);
return tEnv;
}
diff --git a/qadevOOo/tests/java/mod/_sw/PageStyle.java b/qadevOOo/tests/java/mod/_sw/PageStyle.java
index 6c5816418ee2..fdfac78b1dee 100644
--- a/qadevOOo/tests/java/mod/_sw/PageStyle.java
+++ b/qadevOOo/tests/java/mod/_sw/PageStyle.java
@@ -126,8 +126,14 @@ public class PageStyle extends TestCase {
XPropertySet xStyleProp = UnoRuntime.queryInterface(XPropertySet.class, oMyStyle);
short exclude = PropertyAttribute.READONLY;
- String[] names = utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude);
+
+ String[] skipPropetiesNamed = {
+ "BackGraphicURL", "HeaderBackGraphicURL", "FooterBackGraphicURL"
+ };
+
+ String[] names = utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude, skipPropetiesNamed);
tEnv.addObjRelation("PropertyNames", names);
+ tEnv.addObjRelation("SkipProperties", skipPropetiesNamed);
return tEnv;
}
diff --git a/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java b/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java
index d0aeb41f3eb9..e52daed43c02 100644
--- a/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java
+++ b/qadevOOo/tests/java/mod/_sw/ParagraphStyle.java
@@ -119,7 +119,10 @@ public class ParagraphStyle extends TestCase {
XPropertySet xStyleProp = UnoRuntime.queryInterface(XPropertySet.class, oMyStyle);
short exclude = PropertyAttribute.READONLY;
- String[] names = utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude);
+
+ String[] skipPropetiesNamed = { "ParaBackGraphicURL" };
+
+ String[] names = utils.getFilteredPropertyNames(xStyleProp, (short)0, exclude, skipPropetiesNamed);
tEnv.addObjRelation("PropertyNames", names);
return tEnv;
diff --git a/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java b/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java
index 34764a4673f2..5b641b1e72af 100644
--- a/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java
+++ b/qadevOOo/tests/java/mod/_sw/SwXTextCursor.java
@@ -19,6 +19,7 @@ package mod._sw;
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.Arrays;
import lib.TestCase;
import lib.TestEnvironment;
@@ -171,7 +172,12 @@ public class SwXTextCursor extends TestCase {
XPropertySet xCursorProp = UnoRuntime.queryInterface(
XPropertySet.class, oObj);
- tEnv.addObjRelation("PropertyNames", getPropertyNames(xCursorProp));
+
+ String[] skipNames = { "ParaBackGraphicURL" };
+ String[] propertyNames = getPropertyNames(xCursorProp, skipNames);
+
+ tEnv.addObjRelation("PropertyNames", propertyNames);
+ tEnv.addObjRelation("SkipProperties", propertyNames);
//Adding relation for util.XSortable
final XParagraphCursor paragrCursor = UnoRuntime.queryInterface(
@@ -285,14 +291,13 @@ public class SwXTextCursor extends TestCase {
return tEnv;
} // finish method getTestEnvironment
- public String[] getPropertyNames(XPropertySet props) {
+ public String[] getPropertyNames(XPropertySet props, String[] skipList) {
Property[] the_props = props.getPropertySetInfo().getProperties();
ArrayList<String> names = new ArrayList<String>();
for (int i = 0; i < the_props.length; i++) {
boolean isWritable = ((the_props[i].Attributes & PropertyAttribute.READONLY) == 0);
-
- if (isWritable) {
+ if (isWritable && !Arrays.asList(skipList).contains(the_props[i].Name)) {
names.add(the_props[i].Name);
}
}