diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2010-11-15 22:12:20 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2010-11-15 22:12:20 +0100 |
commit | e09697dcf98c03bedffe5b1834edc40aee248feb (patch) | |
tree | d05470d32ffc08b1aef13480905bc80e0759b3af /test | |
parent | 9a8cb95491e90ee1aef41eec23ef063cdd882c71 (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.java | 27 |
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 04fdcad02..6a03e2df4 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 ); + } }; |