From 117fdb9898dcc379b4f83437e858c57fd1d11911 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 21 Nov 2012 22:21:40 +0100 Subject: convert users of XDocumentInfo to XDocumentProperties Change-Id: I10f395f90d554d0ec26fe9f2654ae839e21c7ee5 --- qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java | 13 ++++++------- qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java | 22 ++++++++-------------- 2 files changed, 14 insertions(+), 21 deletions(-) (limited to 'qadevOOo/tests/java/mod/_sw') diff --git a/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java b/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java index dadcd90ddbd5..1de4f4baee13 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLMetaExporter.java @@ -28,7 +28,8 @@ import util.SOfficeFactory; import util.XMLTools; import com.sun.star.beans.XPropertySet; -import com.sun.star.document.XDocumentInfoSupplier; +import com.sun.star.document.XDocumentPropertiesSupplier; +import com.sun.star.document.XDocumentProperties; import com.sun.star.document.XExporter; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.XTextDocument; @@ -129,12 +130,10 @@ public class XMLMetaExporter extends TestCase { xEx.setSourceDocument(xTextDoc); //set some meta data - XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface - (XDocumentInfoSupplier.class, xTextDoc) ; - XPropertySet docInfo = UnoRuntime.queryInterface - (XPropertySet.class, infoSup.getDocumentInfo()) ; - docInfo.setPropertyValue("Title", TITLE); - + XDocumentPropertiesSupplier xPropSup = UnoRuntime.queryInterface + (XDocumentPropertiesSupplier.class, xTextDoc); + final XDocumentProperties xDocProps = xPropSup.getDocumentProperties(); + xDocProps.setTitle(TITLE); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log) ; throw new StatusException("Can't create component.", e) ; diff --git a/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java b/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java index c234003caf8c..7e071d8e504d 100644 --- a/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java +++ b/qadevOOo/tests/java/mod/_sw/XMLMetaImporter.java @@ -27,7 +27,8 @@ import lib.TestParameters; import util.SOfficeFactory; import com.sun.star.beans.XPropertySet; -import com.sun.star.document.XDocumentInfoSupplier; +import com.sun.star.document.XDocumentPropertiesSupplier; +import com.sun.star.document.XDocumentProperties; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.XTextDocument; import com.sun.star.uno.UnoRuntime; @@ -153,24 +154,17 @@ public class XMLMetaImporter extends TestCase { tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ; - XDocumentInfoSupplier infoSup = UnoRuntime.queryInterface - (XDocumentInfoSupplier.class, xTextDoc) ; - final XPropertySet docInfo = UnoRuntime.queryInterface - (XPropertySet.class, infoSup.getDocumentInfo()) ; + XDocumentPropertiesSupplier xPropSup = UnoRuntime.queryInterface + (XDocumentPropertiesSupplier.class, xTextDoc); + final XDocumentProperties xDocProps = xPropSup.getDocumentProperties(); final PrintWriter logF = log ; tEnv.addObjRelation("XDocumentHandler.ImportChecker", new ifc.xml.sax._XDocumentHandler.ImportChecker() { public boolean checkImport() { - try { - String title = (String) docInfo.getPropertyValue("Title") ; - logF.println("Title returned = '" + title + "'") ; - return impTitle.equals(title) ; - } catch (com.sun.star.uno.Exception e) { - logF.println("Exception occurred while checking filter :") ; - e.printStackTrace(logF) ; - return false ; - } + String title = xDocProps.getTitle(); + logF.println("Title returned = '" + title + "'") ; + return impTitle.equals(title) ; } }) ; -- cgit