summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-11-15 22:12:20 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-11-15 22:12:20 +0100
commited89443a2c555a1f3d605c6d605c1f7a730fc632 (patch)
tree09dc72945d310f9cef14ba7fe4568313471a19d7 /test
parent49230835a7da7e7da394e7202c21c4e5c5b084b6 (diff)
undoapi: step 2.1 of the migration of css.chart2.XUndoManager to css.document.XUndoManager:
implement an XUndoManager/Supplier for chart documents
Diffstat (limited to 'test')
-rw-r--r--test/source/java/org/openoffice/test/tools/OfficeDocumentView.java27
1 files changed, 23 insertions, 4 deletions
diff --git a/test/source/java/org/openoffice/test/tools/OfficeDocumentView.java b/test/source/java/org/openoffice/test/tools/OfficeDocumentView.java
index 841607d9a377..9d5db59ac009 100644
--- a/test/source/java/org/openoffice/test/tools/OfficeDocumentView.java
+++ b/test/source/java/org/openoffice/test/tools/OfficeDocumentView.java
@@ -28,6 +28,8 @@ package org.openoffice.test.tools;
/**************************************************************************/
+import com.sun.star.beans.NamedValue;
+import com.sun.star.beans.PropertyState;
import com.sun.star.beans.PropertyValue;
import com.sun.star.frame.XController;
import com.sun.star.frame.XDispatch;
@@ -93,6 +95,7 @@ public class OfficeDocumentView
return xReturn;
}
+
/* ------------------------------------------------------------------ */
/** retrieves a dispatcher for the given URL, obtained at the current view of the document
*/
@@ -109,17 +112,33 @@ public class OfficeDocumentView
@return
<TRUE/> if the URL was successfully dispatched
*/
- public boolean dispatch( String url ) throws com.sun.star.uno.Exception
+ public boolean dispatch( String i_url ) throws com.sun.star.uno.Exception
+ {
+ return dispatch( i_url, new PropertyValue[0] );
+ }
+
+ /* ------------------------------------------------------------------ */
+ public boolean dispatch( final String i_url, final PropertyValue[] i_arguments ) throws com.sun.star.uno.Exception
{
URL[] completeURL = new URL[] { new URL() };
- completeURL[0].Complete = url;
+ completeURL[0].Complete = i_url;
XDispatch dispatcher = getDispatcher( completeURL );
if ( dispatcher == null )
return false;
- PropertyValue[] aDummyArgs = new PropertyValue[] { };
- dispatcher.dispatch( completeURL[0], aDummyArgs );
+ dispatcher.dispatch( completeURL[0], i_arguments );
return true;
}
+
+ /* ------------------------------------------------------------------ */
+ public boolean dispatch( final String i_url, final NamedValue[] i_arguments ) throws com.sun.star.uno.Exception
+ {
+ final PropertyValue[] dispatchArgs = new PropertyValue[ i_arguments.length ];
+ for ( int i=0; i<i_arguments.length; ++i )
+ {
+ dispatchArgs[i] = new PropertyValue( i_arguments[i].Name, -1, i_arguments[i].Value, PropertyState.DIRECT_VALUE );
+ }
+ return dispatch( i_url, dispatchArgs );
+ }
};