summaryrefslogtreecommitdiff
path: root/odk/examples/DevelopersGuide/OfficeDev
diff options
context:
space:
mode:
Diffstat (limited to 'odk/examples/DevelopersGuide/OfficeDev')
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Clipboard/Clipboard.java66
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Clipboard/ClipboardListener.java8
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Clipboard/ClipboardOwner.java8
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Clipboard/TextTransferable.java12
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/ContextMenuInterceptor.java68
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Desk.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/FunctionHelper.java6
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IShutdownListener.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/JavaWindowPeerFake.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/NativeView.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OfficeConnect.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusView.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.c4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.h4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.c4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.h4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DisableCommands/DisableCommandsTest.java84
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java88
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/FilterOptions.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx12
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx60
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.hxx44
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx82
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXmlFilter_cpp.uno.xml24
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java92
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/LinguisticExamples.java92
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/OneInstanceFactory.java22
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper.java18
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Hyph.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java114
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java102
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java70
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/XHyphenatedWord_impl.java16
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/XMeaning_impl.java8
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/XPossibleHyphens_impl.java16
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Linguistic/XSpellAlternatives_impl.java18
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/MenuElement.java6
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java6
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/PathSettings/PathSettingsTest.java30
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/PathSubstitution/PathSubstitutionTest.java26
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/TerminationTest/TerminateListener.java10
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/TerminationTest/TerminationTest.java30
51 files changed, 661 insertions, 661 deletions
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Clipboard/Clipboard.java b/odk/examples/DevelopersGuide/OfficeDev/Clipboard/Clipboard.java
index 0d79e1e6bc25..82127e706b57 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Clipboard/Clipboard.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Clipboard/Clipboard.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.lang.XComponent;
@@ -53,9 +53,9 @@ import com.sun.star.uno.AnyConverter;
public class Clipboard
{
- public static void main(String[] args)
+ public static void main(String[] args)
{
- try
+ try
{
// get the remote office context. If necessary a new office
// process is started
@@ -82,13 +82,13 @@ public class Clipboard
xDoc.getText().setString("In the first step, paste the current content of the clipboard in the document!\nThe text \"Hello world!\" shall be insert at the current cursor position below.\n\nIn the second step, please select some words and put it into the clipboard! ...\n\nCurrent clipboard content = ");
// ensure that the document content is optimal visible
- com.sun.star.frame.XModel xModel =
+ com.sun.star.frame.XModel xModel =
(com.sun.star.frame.XModel)UnoRuntime.queryInterface(
com.sun.star.frame.XModel.class, xDoc);
// get the frame for later usage
com.sun.star.frame.XFrame xFrame =
xModel.getCurrentController().getFrame();
-
+
com.sun.star.view.XViewSettingsSupplier xViewSettings =
(com.sun.star.view.XViewSettingsSupplier)UnoRuntime.queryInterface(
com.sun.star.view.XViewSettingsSupplier.class,
@@ -97,7 +97,7 @@ public class Clipboard
"ZoomType", new Short((short)0));
}
// test document will be closed later
-
+
Object oClipboard = xServiceManager.createInstanceWithContext(
"com.sun.star.datatransfer.clipboard.SystemClipboard",
xOfficeContext);
@@ -113,27 +113,27 @@ public class Clipboard
UnoRuntime.queryInterface(XClipboardNotifier.class, oClipboard);
ClipboardListener aClipListener= new ClipboardListener();
-
+
xClipNotifier.addClipboardListener(aClipListener);
// Read ClipBoard
- readClipBoard(xClipboard);
+ readClipBoard(xClipboard);
//---------------------------------------------------
// becoming a clipboard owner
//---------------------------------------------------
-
+
System.out.println("Becoming a clipboard owner...");
System.out.println("");
ClipboardOwner aClipOwner = new ClipboardOwner();
xClipboard.setContents(new TextTransferable("Hello World!"), aClipOwner);
- int iFirst = 0;
-
+ int iFirst = 0;
+
while (aClipOwner.isClipboardOwner())
{
if (iFirst != 2) {
- if (iFirst == 1) {
+ if (iFirst == 1) {
System.out.println("Change clipboard ownership by putting something into the clipboard!\n");
System.out.print("Still clipboard owner...");
} else {
@@ -147,8 +147,8 @@ public class Clipboard
}
// Read ClipBoard again
- readClipBoard(xClipboard);
-
+ readClipBoard(xClipboard);
+
//---------------------------------------------------
// unregistering as clipboard listener
//---------------------------------------------------
@@ -165,10 +165,10 @@ public class Clipboard
{
xComponent.dispose();
}
-
+
System.exit(0);
}
- catch( Exception ex )
+ catch( Exception ex )
{
ex.printStackTrace();
}
@@ -180,42 +180,42 @@ public class Clipboard
//---------------------------------------------------
// get a list of formats currently on the clipboard
//---------------------------------------------------
-
+
XTransferable xTransferable = xClipboard.getContents();
-
+
DataFlavor[] aDflvArr = xTransferable.getTransferDataFlavors();
-
+
// print all available formats
-
+
System.out.println("Reading the clipboard...");
System.out.println("Available clipboard formats:");
-
+
DataFlavor aUniFlv = null;
-
+
for (int i=0;i<aDflvArr.length;i++)
{
- System.out.println( "MimeType: " +
- aDflvArr[i].MimeType +
- " HumanPresentableName: " +
- aDflvArr[i].HumanPresentableName );
+ System.out.println( "MimeType: " +
+ aDflvArr[i].MimeType +
+ " HumanPresentableName: " +
+ aDflvArr[i].HumanPresentableName );
// if there is the format unicode text on the clipboard save the
// corresponding DataFlavor so that we can later output the string
-
+
if ( aDflvArr[i].MimeType.equals("text/plain;charset=utf-16") )
- {
+ {
aUniFlv = aDflvArr[i];
}
}
-
+
System.out.println("");
-
- try
+
+ try
{
if (aUniFlv != null)
{
System.out.print("Unicode text on the clipboard ...\nYour selected text \"");
- Object aData = xTransferable.getTransferData(aUniFlv);
+ Object aData = xTransferable.getTransferData(aUniFlv);
System.out.println(AnyConverter.toString(aData)
+ "\" is now in the clipboard.\n");
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Clipboard/ClipboardListener.java b/odk/examples/DevelopersGuide/OfficeDev/Clipboard/ClipboardListener.java
index 49efd28c0ea8..b858ddcfcda4 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Clipboard/ClipboardListener.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Clipboard/ClipboardListener.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,19 +29,19 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.lang.EventObject;
import com.sun.star.datatransfer.clipboard.ClipboardEvent;
import com.sun.star.datatransfer.clipboard.XClipboardListener;
-//-----------------------------
+//-----------------------------
// A simple clipboard listener
//-----------------------------
public class ClipboardListener implements XClipboardListener
-{
+{
public void disposing(EventObject event)
{
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Clipboard/ClipboardOwner.java b/odk/examples/DevelopersGuide/OfficeDev/Clipboard/ClipboardOwner.java
index eb745bae4119..46137bbb5995 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Clipboard/ClipboardOwner.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Clipboard/ClipboardOwner.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.datatransfer.XTransferable;
@@ -37,11 +37,11 @@ import com.sun.star.datatransfer.clipboard.XClipboard;
import com.sun.star.datatransfer.clipboard.XClipboardOwner;
//--------------------------
-// A simple clipboard owner
+// A simple clipboard owner
//--------------------------
public class ClipboardOwner implements XClipboardOwner
-{
+{
public void lostOwnership( XClipboard xClipboard, XTransferable xTransferable )
{
System.out.println("");
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Clipboard/TextTransferable.java b/odk/examples/DevelopersGuide/OfficeDev/Clipboard/TextTransferable.java
index 291cbbb97e22..768745f67504 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Clipboard/TextTransferable.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Clipboard/TextTransferable.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.datatransfer.DataFlavor;
@@ -43,7 +43,7 @@ import com.sun.star.uno.Type;
//---------------------------------------
public class TextTransferable implements XTransferable
-{
+{
public TextTransferable(String aText)
{
text = aText;
@@ -64,10 +64,10 @@ public class TextTransferable implements XTransferable
DataFlavor[] adf = new DataFlavor[1];
DataFlavor uniflv = new DataFlavor(
- UNICODE_CONTENT_TYPE,
- "Unicode Text",
+ UNICODE_CONTENT_TYPE,
+ "Unicode Text",
new Type(String.class) );
-
+
adf[0] = uniflv;
return adf;
diff --git a/odk/examples/DevelopersGuide/OfficeDev/ContextMenuInterceptor.java b/odk/examples/DevelopersGuide/OfficeDev/ContextMenuInterceptor.java
index 1b10f7d50dcb..a5d81e306492 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/ContextMenuInterceptor.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/ContextMenuInterceptor.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.beans.XPropertySet;
@@ -51,7 +51,7 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor {
try {
OfficeConnect aConnect = OfficeConnect.createConnection();
- com.sun.star.frame.XDesktop xDesktop =
+ com.sun.star.frame.XDesktop xDesktop =
(com.sun.star.frame.XDesktop)aConnect.createRemoteInstance(
com.sun.star.frame.XDesktop.class,"com.sun.star.frame.Desktop");
@@ -71,16 +71,16 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor {
UnoRuntime.queryInterface(com.sun.star.text.XTextDocument.class,
xComponent);
- String infoMsg = new String("All context menus of the created document frame contains now a 'Help' entry with the submenus 'Content', 'Help Agent' and 'Tips'.\n\nPress 'Return' in the shell to remove the context menu interceptor and finish the example!");
+ String infoMsg = new String("All context menus of the created document frame contains now a 'Help' entry with the submenus 'Content', 'Help Agent' and 'Tips'.\n\nPress 'Return' in the shell to remove the context menu interceptor and finish the example!");
xDoc.getText().setString(infoMsg);
// ensure that the document content is optimal visible
- com.sun.star.frame.XModel xModel =
+ com.sun.star.frame.XModel xModel =
(com.sun.star.frame.XModel)UnoRuntime.queryInterface(
com.sun.star.frame.XModel.class, xDoc);
// get the frame for later usage
xFrame = xModel.getCurrentController().getFrame();
-
+
com.sun.star.view.XViewSettingsSupplier xViewSettings =
(com.sun.star.view.XViewSettingsSupplier)UnoRuntime.queryInterface(
com.sun.star.view.XViewSettingsSupplier.class, xModel.getCurrentController());
@@ -88,26 +88,26 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor {
"ZoomType", new Short((short)0));
}
// test document will be closed later
-
+
// reuse the frame
com.sun.star.frame.XController xController = xFrame.getController();
if ( xController != null ) {
- com.sun.star.ui.XContextMenuInterception xContextMenuInterception =
- (com.sun.star.ui.XContextMenuInterception)UnoRuntime.queryInterface(
+ com.sun.star.ui.XContextMenuInterception xContextMenuInterception =
+ (com.sun.star.ui.XContextMenuInterception)UnoRuntime.queryInterface(
com.sun.star.ui.XContextMenuInterception.class, xController );
if( xContextMenuInterception != null ) {
ContextMenuInterceptor aContextMenuInterceptor = new ContextMenuInterceptor();
- com.sun.star.ui.XContextMenuInterceptor xContextMenuInterceptor =
- (com.sun.star.ui.XContextMenuInterceptor)UnoRuntime.queryInterface(
+ com.sun.star.ui.XContextMenuInterceptor xContextMenuInterceptor =
+ (com.sun.star.ui.XContextMenuInterceptor)UnoRuntime.queryInterface(
com.sun.star.ui.XContextMenuInterceptor.class, aContextMenuInterceptor );
xContextMenuInterception.registerContextMenuInterceptor( xContextMenuInterceptor );
-
+
System.out.println( "\n ... all context menus of the created document frame contains now a 'Help' entry with the\n submenus 'Content', 'Help Agent' and 'Tips'.\n\nPress 'Return' to remove the context menu interceptor and finish the example!");
java.io.BufferedReader reader
= new java.io.BufferedReader(new java.io.InputStreamReader(System.in));
reader.read();
-
+
xContextMenuInterception.releaseContextMenuInterceptor(
xContextMenuInterceptor );
System.out.println( " ... context menu interceptor removed!" );
@@ -138,7 +138,7 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor {
}
System.out.println(" ... exit!\n");
- System.exit( 0 );
+ System.exit( 0 );
}
/**
@@ -147,7 +147,7 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor {
*@param args Description of Parameter
*@since
*/
- public ContextMenuInterceptorAction notifyContextMenuExecute(
+ public ContextMenuInterceptorAction notifyContextMenuExecute(
com.sun.star.ui.ContextMenuExecuteEvent aEvent ) throws RuntimeException {
try {
@@ -155,30 +155,30 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor {
// Retrieve context menu container and query for service factory to
// create sub menus, menu entries and separators
com.sun.star.container.XIndexContainer xContextMenu = aEvent.ActionTriggerContainer;
- com.sun.star.lang.XMultiServiceFactory xMenuElementFactory =
+ com.sun.star.lang.XMultiServiceFactory xMenuElementFactory =
(com.sun.star.lang.XMultiServiceFactory)UnoRuntime.queryInterface(
com.sun.star.lang.XMultiServiceFactory.class, xContextMenu );
if ( xMenuElementFactory != null ) {
// create root menu entry and sub menu
com.sun.star.beans.XPropertySet xRootMenuEntry =
(XPropertySet)UnoRuntime.queryInterface(
- com.sun.star.beans.XPropertySet.class,
+ com.sun.star.beans.XPropertySet.class,
xMenuElementFactory.createInstance( "com.sun.star.ui.ActionTrigger" ));
// create a line separator for our new help sub menu
- com.sun.star.beans.XPropertySet xSeparator =
- (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
- com.sun.star.beans.XPropertySet.class,
+ com.sun.star.beans.XPropertySet xSeparator =
+ (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
+ com.sun.star.beans.XPropertySet.class,
xMenuElementFactory.createInstance( "com.sun.star.ui.ActionTriggerSeparator" ));
-
+
Short aSeparatorType = new Short( ActionTriggerSeparatorType.LINE );
xSeparator.setPropertyValue( "SeparatorType", (Object)aSeparatorType );
-
+
// query sub menu for index container to get access
com.sun.star.container.XIndexContainer xSubMenuContainer =
- (com.sun.star.container.XIndexContainer)UnoRuntime.queryInterface(
+ (com.sun.star.container.XIndexContainer)UnoRuntime.queryInterface(
com.sun.star.container.XIndexContainer.class,
- xMenuElementFactory.createInstance(
+ xMenuElementFactory.createInstance(
"com.sun.star.ui.ActionTriggerContainer" ));
// intialize root menu entry
@@ -188,21 +188,21 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor {
xRootMenuEntry.setPropertyValue( "SubContainer", (Object)xSubMenuContainer );
// create menu entries for the new sub menu
-
+
// intialize help/content menu entry
- XPropertySet xMenuEntry = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet xMenuEntry = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xMenuElementFactory.createInstance(
"com.sun.star.ui.ActionTrigger" ));
xMenuEntry.setPropertyValue( "Text", new String( "Content" ));
xMenuEntry.setPropertyValue( "CommandURL", new String( "slot:5401" ));
xMenuEntry.setPropertyValue( "HelpURL", new String( "5401" ));
-
+
// insert menu entry to sub menu
xSubMenuContainer.insertByIndex( 0, (Object)xMenuEntry );
// intialize help/help agent
- xMenuEntry = (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
+ xMenuEntry = (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class,
xMenuElementFactory.createInstance(
"com.sun.star.ui.ActionTrigger" ));
@@ -212,11 +212,11 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor {
// insert menu entry to sub menu
xSubMenuContainer.insertByIndex( 1, (Object)xMenuEntry );
-
+
// intialize help/tips
- xMenuEntry = (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
+ xMenuEntry = (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class,
- xMenuElementFactory.createInstance(
+ xMenuElementFactory.createInstance(
"com.sun.star.ui.ActionTrigger" ));
xMenuEntry.setPropertyValue( "Text", new String( "Tips" ));
xMenuEntry.setPropertyValue( "CommandURL", new String( "slot:5404" ));
@@ -230,7 +230,7 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor {
// add new sub menu into the given context menu
xContextMenu.insertByIndex( 0, (Object)xRootMenuEntry );
-
+
// The controller should execute the modified context menu and stop notifying other
// interceptors.
return com.sun.star.ui.ContextMenuInterceptorAction.EXECUTE_MODIFIED;
@@ -238,7 +238,7 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor {
}
catch ( com.sun.star.beans.UnknownPropertyException ex ) {
// do something useful
- // we used a unknown property
+ // we used a unknown property
}
catch ( com.sun.star.lang.IndexOutOfBoundsException ex ) {
// do something useful
@@ -250,7 +250,7 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor {
catch ( java.lang.Exception ex ) {
// catch java exceptions and something useful
}
-
+
return com.sun.star.ui.ContextMenuInterceptorAction.IGNORED;
}
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java
index 0a53b9a1e0b9..3aa793148b8c 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// __________ Imports __________
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Desk.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Desk.java
index 8f635dfdcf6e..b63c83e551e7 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Desk.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Desk.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// __________ Imports __________
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java
index a45294c5affe..0e9aeeacb5a4 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// __________ Imports __________
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/FunctionHelper.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/FunctionHelper.java
index 75af2ab7f35d..9e04ddccd3c0 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/FunctionHelper.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/FunctionHelper.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// __________ Imports __________
@@ -189,7 +189,7 @@ public class FunctionHelper
* future prove this old one should be tried too.
* - it's possible to pass the native window handle directly to the toolkit.
* A special interface method was enabled to accept that.
- *
+ *
* The right way to create an office window should be then:
* - try to use second creation mode (directly using of the window handle)
* - if it failed ... use the old way by packing the handle inside an object
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java
index 935f788b8c03..45b020225304 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import java.util.Vector;
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IShutdownListener.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IShutdownListener.java
index ba9035383d24..f80358f097b9 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IShutdownListener.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IShutdownListener.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// __________ Implementation __________
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java
index da1b68bc059d..36f01ffd79f7 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// __________ Imports __________
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/JavaWindowPeerFake.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/JavaWindowPeerFake.java
index 24cd05e2f526..1e05e12dfaa8 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/JavaWindowPeerFake.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/JavaWindowPeerFake.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import java.awt.*;
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/NativeView.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/NativeView.java
index ead6d7745287..e727270b9ead 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/NativeView.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/NativeView.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// __________ Imports __________
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OfficeConnect.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OfficeConnect.java
index e1a8b3f9f35b..f4bc5554a87a 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OfficeConnect.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OfficeConnect.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// __________ Imports __________
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java
index 7d84d7c5fcca..c98045d96fe5 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import java.util.Vector;
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java
index de369dcd8c16..25db43df1320 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// __________ Imports __________
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusView.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusView.java
index 64923f539516..18e4c1e31798 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusView.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusView.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// __________ Imports __________
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java
index e35e3c0d7b99..02f68a05e0fd 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// __________ Imports __________
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.c b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.c
index fa52c68b3ee4..83f246eef876 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.c
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.c
@@ -3,7 +3,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -30,7 +30,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
#include <X11/Xlib.h>
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.h b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.h
index 81de2d9f1b31..51642e94495d 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.h
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/unix/nativeview.h
@@ -3,7 +3,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -30,7 +30,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
/* DO NOT EDIT THIS FILE - it is machine generated */
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.c b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.c
index 84173a0e546a..28da7c111ab5 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.c
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.c
@@ -3,7 +3,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -30,7 +30,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
#include <windows.h>
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.h b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.h
index 81de2d9f1b31..51642e94495d 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.h
+++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/nativelib/windows/nativeview.h
@@ -3,7 +3,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -30,7 +30,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
/* DO NOT EDIT THIS FILE - it is machine generated */
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DisableCommands/DisableCommandsTest.java b/odk/examples/DevelopersGuide/OfficeDev/DisableCommands/DisableCommandsTest.java
index a74c0d102544..5398c8173d1f 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/DisableCommands/DisableCommandsTest.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/DisableCommands/DisableCommandsTest.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.uno.UnoRuntime;
@@ -51,7 +51,7 @@ import com.sun.star.text.XTextDocument;
* commands.
*/
public class DisableCommandsTest extends java.lang.Object {
-
+
/*
* A list of command names
*/
@@ -62,37 +62,37 @@ public class DisableCommandsTest extends java.lang.Object {
new String( "SelectAll" ),
new String( "Quit" ),
};
-
+
private static XComponentContext xRemoteContext = null;
private static XMultiComponentFactory xRemoteServiceManager = null;
private static XURLTransformer xTransformer = null;
private static XMultiServiceFactory xConfigProvider = null;
-
+
/*
* @param args the command line arguments
*/
public static void main(String[] args) {
-
+
try {
// get the remote office context. If necessary a new office
// process is started
xRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
System.out.println("Connected to a running office ...");
xRemoteServiceManager = xRemoteContext.getServiceManager();
-
+
Object transformer = xRemoteServiceManager.createInstanceWithContext(
"com.sun.star.util.URLTransformer", xRemoteContext );
xTransformer = (com.sun.star.util.XURLTransformer)
UnoRuntime.queryInterface(com.sun.star.util.XURLTransformer.class,
transformer );
-
+
Object configProvider = xRemoteServiceManager.createInstanceWithContext(
"com.sun.star.configuration.ConfigurationProvider",
xRemoteContext );
xConfigProvider = (com.sun.star.lang.XMultiServiceFactory)
UnoRuntime.queryInterface(
com.sun.star.lang.XMultiServiceFactory.class, configProvider );
-
+
// create a new test document
Object oDesktop = xRemoteServiceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", xRemoteContext);
@@ -117,13 +117,13 @@ public class DisableCommandsTest extends java.lang.Object {
+ "example and close the document.");
// ensure that the document content is optimal visible
- com.sun.star.frame.XModel xModel =
+ com.sun.star.frame.XModel xModel =
(com.sun.star.frame.XModel)UnoRuntime.queryInterface(
com.sun.star.frame.XModel.class, xDoc);
// get the frame for later usage
com.sun.star.frame.XFrame xFrame =
xModel.getCurrentController().getFrame();
-
+
com.sun.star.view.XViewSettingsSupplier xViewSettings =
(com.sun.star.view.XViewSettingsSupplier)UnoRuntime.queryInterface(
com.sun.star.view.XViewSettingsSupplier.class,
@@ -136,13 +136,13 @@ public class DisableCommandsTest extends java.lang.Object {
// First we need a defined starting point. So we have to remove
// all commands from the disabled set!
enableCommands();
-
+
// Check if the commands are usable
testCommands( false );
-
+
// Disable the commands
disableCommands();
-
+
// Now the commands shouldn't be usable anymore
testCommands( true );
@@ -151,7 +151,7 @@ public class DisableCommandsTest extends java.lang.Object {
System.out.println("\nYou can now check the disabled commands.\n"
+"Please press 'return' to enable the commands!");
waitForUserInput();
-
+
// Remove disable commands to make Office usable again
enableCommands();
@@ -161,7 +161,7 @@ public class DisableCommandsTest extends java.lang.Object {
+"Please press 'return' to finish the example and "
+"close the document!");
waitForUserInput();
-
+
// close test document
com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable)
UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class,
@@ -172,7 +172,7 @@ public class DisableCommandsTest extends java.lang.Object {
} else
{
xComponent.dispose();
- }
+ }
}
catch (java.lang.Exception e){
e.printStackTrace();
@@ -192,7 +192,7 @@ public class DisableCommandsTest extends java.lang.Object {
reader.read();
}
-
+
/**
* Test the commands that we enabled/disabled
*/
@@ -209,8 +209,8 @@ public class DisableCommandsTest extends java.lang.Object {
if ( xFrame != null )
{
// We have a frame. Now we need access to the dispatch provider.
- xDispatchProvider =
- (com.sun.star.frame.XDispatchProvider)UnoRuntime.queryInterface(
+ xDispatchProvider =
+ (com.sun.star.frame.XDispatchProvider)UnoRuntime.queryInterface(
com.sun.star.frame.XDispatchProvider.class, xFrame );
if ( xDispatchProvider != null )
{
@@ -222,13 +222,13 @@ public class DisableCommandsTest extends java.lang.Object {
com.sun.star.util.URL[] aURL = new com.sun.star.util.URL[1];
aURL[0] = new com.sun.star.util.URL();
com.sun.star.frame.XDispatch xDispatch = null;
-
+
aURL[0].Complete = ".uno:" + aCommandURLTestSet[n];
xTransformer.parseSmart( aURL, ".uno:" );
-
+
// Try to get a dispatch object for our URL
xDispatch = xDispatchProvider.queryDispatch( aURL[0], "", 0 );
-
+
if ( xDispatch != null )
{
if ( bDisabledCmds )
@@ -273,14 +273,14 @@ public class DisableCommandsTest extends java.lang.Object {
try {
// Create configuration update access to have write access to the
// configuration
- Object xAccess = xConfigProvider.createInstanceWithArguments(
+ Object xAccess = xConfigProvider.createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationUpdateAccess",
lParams );
-
+
com.sun.star.container.XNameAccess xNameAccess =
(com.sun.star.container.XNameAccess)UnoRuntime.queryInterface(
com.sun.star.container.XNameAccess.class, xAccess );
-
+
if ( xNameAccess != null ) {
// We need the XNameContainer interface to remove the nodes by name
com.sun.star.container.XNameContainer xNameContainer =
@@ -300,13 +300,13 @@ public class DisableCommandsTest extends java.lang.Object {
catch ( com.sun.star.container.NoSuchElementException e ) {
}
}
- }
+ }
// Commit our changes
com.sun.star.util.XChangesBatch xFlush =
(com.sun.star.util.XChangesBatch)UnoRuntime.queryInterface(
com.sun.star.util.XChangesBatch.class, xAccess);
-
+
xFlush.commitChanges();
}
catch ( com.sun.star.uno.Exception e ) {
@@ -314,7 +314,7 @@ public class DisableCommandsTest extends java.lang.Object {
System.out.println( e );
}
}
-
+
/**
* Disable all commands defined in the aCommandURLTestSet array
*/
@@ -322,7 +322,7 @@ public class DisableCommandsTest extends java.lang.Object {
// Set the root path for our configuration access
com.sun.star.beans.PropertyValue[] lParams =
new com.sun.star.beans.PropertyValue[1];
-
+
lParams[0] = new com.sun.star.beans.PropertyValue();
lParams[0].Name = new String("nodepath");
lParams[0].Value = "/org.openoffice.Office.Commands/Execute/Disabled";
@@ -330,41 +330,41 @@ public class DisableCommandsTest extends java.lang.Object {
try {
// Create configuration update access to have write access to the
// configuration
- Object xAccess = xConfigProvider.createInstanceWithArguments(
+ Object xAccess = xConfigProvider.createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationUpdateAccess",
lParams );
-
- com.sun.star.lang.XSingleServiceFactory xSetElementFactory =
+
+ com.sun.star.lang.XSingleServiceFactory xSetElementFactory =
(com.sun.star.lang.XSingleServiceFactory)UnoRuntime.queryInterface(
com.sun.star.lang.XSingleServiceFactory.class, xAccess );
com.sun.star.container.XNameContainer xNameContainer =
(com.sun.star.container.XNameContainer)UnoRuntime.queryInterface(
com.sun.star.container.XNameContainer.class, xAccess );
-
+
if ( xSetElementFactory != null && xNameContainer != null ) {
Object[] aArgs = new Object[0];
-
+
for ( int i = 0; i < aCommandURLTestSet.length; i++ ) {
// Create the nodes with the XSingleServiceFactory of the
// configuration
Object xNewElement =
xSetElementFactory.createInstanceWithArguments( aArgs );
-
+
if ( xNewElement != null ) {
// We have a new node. To set the properties of the node
// we need the XPropertySet interface.
- com.sun.star.beans.XPropertySet xPropertySet =
+ com.sun.star.beans.XPropertySet xPropertySet =
(com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class,
xNewElement );
-
+
if ( xPropertySet != null ) {
// Create a unique node name.
String aCmdNodeName = new String( "Command-" );
aCmdNodeName += i;
-
+
// Insert the node into the Disabled set
xPropertySet.setPropertyValue( "Command",
aCommandURLTestSet[i] );
@@ -373,20 +373,20 @@ public class DisableCommandsTest extends java.lang.Object {
}
}
}
-
+
// Commit our changes
com.sun.star.util.XChangesBatch xFlush =
(com.sun.star.util.XChangesBatch)UnoRuntime.queryInterface(
com.sun.star.util.XChangesBatch.class, xAccess);
xFlush.commitChanges();
- }
+ }
}
catch ( com.sun.star.uno.Exception e )
{
System.err.println( "Exception detected!" + e);
e.printStackTrace();
}
- }
+ }
/**
* reset URL so it can be reused
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
index 24eb92a3109c..623a19102774 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
package OfficeDev.samples.Filter;
@@ -88,7 +88,7 @@ public class AsciiReplaceFilter
{
//______________________________
// const
-
+
// the supported service names, the first one being the service name of the component itself
public static final String[] m_serviceNames = { "com.sun.star.comp.ansifilter.AsciiReplaceFilter" , "com.sun.star.document.ImportFilter", "com.sun.star.document.ExportFilter" };
@@ -354,12 +354,12 @@ public class AsciiReplaceFilter
bImport = m_bImport;
xText = m_xDocument;
}
-
+
measure("options analyzed");
-
+
if (aOptions.isValid()==false)
return false;
-
+
// start real filtering
boolean bState = false;
if (bImport)
@@ -424,32 +424,32 @@ public class AsciiReplaceFilter
FilterOptions aOptions )
{
measure("implts_import {");
-
+
com.sun.star.text.XSimpleText xText = (com.sun.star.text.XSimpleText)UnoRuntime.queryInterface(
com.sun.star.text.XSimpleText.class,
xTarget.getText());
-
+
measure("cast XSimpleText");
-
+
boolean bBreaked = false;
-
+
try
{
StringBuffer sBuffer = new StringBuffer(100000);
byte[][] lData = new byte[1][];
int nRead = aOptions.m_xInput.readBytes( lData, 4096 );
-
+
measure("read first bytes");
-
+
while (nRead>0 && !bBreaked)
{
// copy data from stream to temp. buffer
sBuffer.append( new String(lData[0]) );
measure("buffer append ["+nRead+"]");
-
+
nRead = aOptions.m_xInput.readBytes( lData, 2048 );
measure("read next bytes");
-
+
// check for cancelled filter proc on every loop!
synchronized(this)
{
@@ -461,11 +461,11 @@ public class AsciiReplaceFilter
}
measure("break check");
}
-
+
// Make some replacements inside the buffer.
String sText = implts_replace( sBuffer, aOptions );
measure("replace");
-
+
// copy current buffer to the document model.
// Create a new paragraph for every line inside original file.
// May not all data could be readed - but that doesn't matter here.
@@ -474,27 +474,27 @@ public class AsciiReplaceFilter
int nStart = 0;
int nEnd = -1;
int nLength = sText.length();
-
+
com.sun.star.text.XTextRange xCursor = (com.sun.star.text.XTextRange)UnoRuntime.queryInterface(
com.sun.star.text.XTextRange.class,
xText.createTextCursor());
-
+
while (true)
{
nEnd = sText.indexOf('\n',nStart);
-
+
if (nEnd==-1 && nStart<nLength)
nEnd = nLength;
-
+
if (nEnd==-1)
break;
-
+
String sLine = sText.substring(nStart,nEnd);
nStart = nEnd+1;
-
+
xText.insertString(xCursor,sLine,false);
xText.insertControlCharacter(xCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,false);
-
+
// check for cancelled filter proc on every loop!
synchronized(this)
{
@@ -506,9 +506,9 @@ public class AsciiReplaceFilter
}
measure("break check");
}
-
+
measure("set on model");
-
+
// with refreshing the document we are on the safe-side, otherwise the first time the filter is used the document is not fully shown (flaw!).
com.sun.star.util.XRefreshable xRefresh = (com.sun.star.util.XRefreshable)UnoRuntime.queryInterface(
com.sun.star.util.XRefreshable.class,
@@ -526,11 +526,11 @@ public class AsciiReplaceFilter
catch(com.sun.star.io.BufferSizeExceededException exExceed ) { bBreaked = true; }
catch(com.sun.star.io.NotConnectedException exConnect ) { bBreaked = true; }
catch(com.sun.star.io.IOException exIO ) { bBreaked = true; }
-
+
measure("} implts_import");
-
+
return !bBreaked;
}
@@ -556,22 +556,22 @@ public class AsciiReplaceFilter
FilterOptions aOptions)
{
measure("implts_export {");
-
+
com.sun.star.text.XTextRange xText = (com.sun.star.text.XSimpleText)UnoRuntime.queryInterface(
com.sun.star.text.XSimpleText.class,
xSource.getText());
-
+
measure("cast XTextRange");
-
+
boolean bBreaked = false;
-
+
try
{
StringBuffer sBuffer = new StringBuffer(xText.getString());
String sText = implts_replace(sBuffer,aOptions);
-
+
measure("get text from model");
-
+
// Normaly this function isn't realy cancelable
// But we following operation can be very expensive. So
// this place is the last one to stop it.
@@ -583,12 +583,12 @@ public class AsciiReplaceFilter
return false;
}
}
-
+
aOptions.m_xOutput.writeBytes(sText.getBytes());
aOptions.m_xOutput.flush();
-
+
measure("written to file");
-
+
// If we created used stream - we must close it too.
if (aOptions.m_bStreamOwner==true)
{
@@ -599,12 +599,12 @@ public class AsciiReplaceFilter
catch(com.sun.star.io.BufferSizeExceededException exExceed ) { bBreaked = true; }
catch(com.sun.star.io.NotConnectedException exConnect ) { bBreaked = true; }
catch(com.sun.star.io.IOException exIO ) { bBreaked = true; }
-
+
measure("} implts_export");
-
+
return !bBreaked;
}
-
+
/**
* helper function to convert the used StringBuffer into a Strig value.
* And we use this chance to have a look on optional filter options
@@ -626,7 +626,7 @@ public class AsciiReplaceFilter
nEnd = nStart+nLength;
}
}
-
+
// convert buffer into return format [string]
// and convert to lower or upper case if required.
String sResult = rBuffer.toString();
@@ -637,11 +637,11 @@ public class AsciiReplaceFilter
else
sResult = sResult.toUpperCase();
}
-
+
return sResult;
}
-
-
+
+
//______________________________
// interface XServiceInfo
/**
@@ -672,7 +672,7 @@ public class AsciiReplaceFilter
sService.equals( m_serviceNames[2] )
);
}
-
+
/**
* Return the real class name of the component
*
@@ -730,4 +730,4 @@ public class AsciiReplaceFilter
_AsciiReplaceFilter.m_serviceNames,
xRegistryKey );
}
-}
+}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/FilterOptions.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/FilterOptions.java
index 013f93a304f5..3c72f8f6e46e 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/FilterOptions.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/FilterOptions.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
package OfficeDev.samples.Filter;
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
index c6f5f9629453..bf62c3999bf4 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
@@ -3,7 +3,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -30,7 +30,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
#include <stdio.h>
@@ -66,9 +66,9 @@ sal_Bool SAL_CALL component_writeInfo(
try
{
Reference< XRegistryKey > xNewKey(
- reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( FilterDetect_getImplementationName() ) );
+ reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( FilterDetect_getImplementationName() ) );
xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
-
+
const Sequence< OUString > & rSNL = FilterDetect_getSupportedServiceNames();
const OUString * pArray = rSNL.getConstArray();
for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
@@ -89,7 +89,7 @@ void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
void * pRet = 0;
-
+
OUString implName = OUString::createFromAscii( pImplName );
if ( pServiceManager && implName.equals(FilterDetect_getImplementationName()) )
{
@@ -97,7 +97,7 @@ void * SAL_CALL component_getFactory(
reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
OUString::createFromAscii( pImplName ),
FilterDetect_createInstance, FilterDetect_getSupportedServiceNames() ) );
-
+
if (xFactory.is())
{
xFactory->acquire();
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx
index e6bbe85cb2c7..b9fbd7c6af70 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx
@@ -3,7 +3,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -30,7 +30,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
#include "filterdetect.hxx"
@@ -72,7 +72,7 @@ using namespace com::sun::star::container;
using namespace com::sun::star::ucb;
-OUString SAL_CALL FilterDetect::detect(Sequence< PropertyValue >& aArguments )
+OUString SAL_CALL FilterDetect::detect(Sequence< PropertyValue >& aArguments )
throw( RuntimeException )
{
// type name to return
@@ -82,7 +82,7 @@ OUString SAL_CALL FilterDetect::detect(Sequence< PropertyValue >& aArguments )
// stream of the document to be detected
Reference< XInputStream > xInStream;
for ( sal_Int32 i = 0 ; i < aArguments.getLength(); i++)
- {
+ {
OUString aName = aArguments[i].Name;
if (aName.equalsAscii("TypeName" ) )
aArguments[i].Value >>= sOriginalTypeName;
@@ -92,7 +92,7 @@ OUString SAL_CALL FilterDetect::detect(Sequence< PropertyValue >& aArguments )
aArguments[i].Value >>= xInStream;
}
- if (!xInStream.is())
+ if (!xInStream.is())
{
// open the stream if it was not suplied by the framework
Reference< XSimpleFileAccess > xSFI(mxMSF->createInstance(
@@ -100,7 +100,7 @@ OUString SAL_CALL FilterDetect::detect(Sequence< PropertyValue >& aArguments )
if (sURL.getLength() > 0 && xSFI.is())
{
try
- {
+ {
xInStream = xSFI->openFileRead( sURL);
}
catch( Exception& )
@@ -116,17 +116,17 @@ OUString SAL_CALL FilterDetect::detect(Sequence< PropertyValue >& aArguments )
// flatxml starts with an office:document element. this element
// conatains a clas="..." attribut by which we can deduct the
// type of document that is to be loaded
- //
+ //
// WARNING:
// parsing the plain text of the document is an easy way to do this
- // but not the purest solution, since namespaces and other xml details
+ // but not the purest solution, since namespaces and other xml details
// may lead to another syntactic expression of the same document.
// this example works for the way the office serializes it's XML stream
// but might need extension for other data sources...
static OString aDocToken("office:document");
// static OString aClassToken("office:class=\"");
static OString aMimeTypeToken("office:mimetype=\"");
-
+
sal_Int32 nHeadSize = 4096;
Sequence< sal_Int8 > aHeadData(nHeadSize);
@@ -138,9 +138,9 @@ OUString SAL_CALL FilterDetect::detect(Sequence< PropertyValue >& aArguments )
long bytestRead = xInStream->readBytes(aHeadData, nHeadSize);
OString aHead = OString((const sal_Char *)aHeadData.getConstArray(), bytestRead).toAsciiLowerCase();
-
+
// check for document element of flatxml format
- if (aHead.indexOf(aDocToken) >= 0)
+ if (aHead.indexOf(aDocToken) >= 0)
{
// read document class
sal_Int32 n = aHead.indexOf(aMimeTypeToken);
@@ -150,26 +150,26 @@ OUString SAL_CALL FilterDetect::detect(Sequence< PropertyValue >& aArguments )
OString aMimeType = aHead.copy(n, aHead.indexOf('\"', n) - n);
// return type for class found
if (aMimeType.equals("application/x-vnd.oasis.opendocument.text") ||
- aMimeType.equals("application/vnd.oasis.opendocument.text"))
+ aMimeType.equals("application/vnd.oasis.opendocument.text"))
sTypeName = OUString::createFromAscii("devguide_FlatXMLType_Cpp_writer");
else if (aMimeType.equals("application/x-vnd.oasis.opendocument.text-master") ||
- aMimeType.equals("application/vnd.oasis.opendocument.text-master"))
- sTypeName = OUString::createFromAscii("devguide_FlatXMLType_Cpp_master");
+ aMimeType.equals("application/vnd.oasis.opendocument.text-master"))
+ sTypeName = OUString::createFromAscii("devguide_FlatXMLType_Cpp_master");
else if (aMimeType.equals("application/x-vnd.oasis.openoffice.text-global") ||
- aMimeType.equals("application/vnd.oasis.openoffice.text-global"))
- sTypeName = OUString::createFromAscii("devguide_FlatXMLType_Cpp_master");
+ aMimeType.equals("application/vnd.oasis.openoffice.text-global"))
+ sTypeName = OUString::createFromAscii("devguide_FlatXMLType_Cpp_master");
else if (aMimeType.equals("application/x-vnd.oasis.opendocument.spreadsheet") ||
- aMimeType.equals("application/vnd.oasis.opendocument.spreadsheet"))
- sTypeName = OUString::createFromAscii("devguide_FlatXMLType_Cpp_calc");
+ aMimeType.equals("application/vnd.oasis.opendocument.spreadsheet"))
+ sTypeName = OUString::createFromAscii("devguide_FlatXMLType_Cpp_calc");
else if (aMimeType.equals("application/x-vnd.oasis.opendocument.drawing") ||
- aMimeType.equals("application/vnd.oasis.opendocument.drawing"))
- sTypeName = OUString::createFromAscii("devguide_FlatXMLType_Cpp_draw");
+ aMimeType.equals("application/vnd.oasis.opendocument.drawing"))
+ sTypeName = OUString::createFromAscii("devguide_FlatXMLType_Cpp_draw");
else if (aMimeType.equals("application/x-vnd.oasis.opendocument.presentation") ||
- aMimeType.equals("application/vnd.oasis.opendocument.presentation"))
+ aMimeType.equals("application/vnd.oasis.opendocument.presentation"))
sTypeName = OUString::createFromAscii("devguide_FlatXMLType_Cpp_impress");
else if (aMimeType.equals("application/x-vnd.oasis.opendocument.presentation") ||
aMimeType.equals("application/vnd.oasis.opendocument.presentation"))
- sTypeName = OUString::createFromAscii("devguide_FlatXMLType_Cpp_impress");
+ sTypeName = OUString::createFromAscii("devguide_FlatXMLType_Cpp_impress");
}
}
return sTypeName;
@@ -177,7 +177,7 @@ OUString SAL_CALL FilterDetect::detect(Sequence< PropertyValue >& aArguments )
// XInitialization
-void SAL_CALL FilterDetect::initialize( const Sequence< Any >& aArguments )
+void SAL_CALL FilterDetect::initialize( const Sequence< Any >& aArguments )
throw (Exception, RuntimeException)
{
Sequence < PropertyValue > aAnySeq;
@@ -187,10 +187,10 @@ void SAL_CALL FilterDetect::initialize( const Sequence< Any >& aArguments )
const PropertyValue * pValue = aAnySeq.getConstArray();
nLength = aAnySeq.getLength();
for ( sal_Int32 i = 0 ; i < nLength; i++)
- {
+ {
if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "Type" ) ) )
{
- pValue[i].Value >>= msFilterName;
+ pValue[i].Value >>= msFilterName;
}
else if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "UserData" ) ) )
{
@@ -212,13 +212,13 @@ OUString FilterDetect_getImplementationName ()
#define SERVICE_NAME1 "com.sun.star.document.ExtendedTypeDetection"
-sal_Bool SAL_CALL FilterDetect_supportsService( const OUString& ServiceName )
+sal_Bool SAL_CALL FilterDetect_supportsService( const OUString& ServiceName )
throw (RuntimeException)
{
return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME1 ) );
}
-Sequence< OUString > SAL_CALL FilterDetect_getSupportedServiceNames( )
+Sequence< OUString > SAL_CALL FilterDetect_getSupportedServiceNames( )
throw (RuntimeException)
{
Sequence < OUString > aRet(2);
@@ -236,19 +236,19 @@ Reference< XInterface > SAL_CALL FilterDetect_createInstance( const Reference< X
}
// XServiceInfo
-OUString SAL_CALL FilterDetect::getImplementationName( )
+OUString SAL_CALL FilterDetect::getImplementationName( )
throw (RuntimeException)
{
return FilterDetect_getImplementationName();
}
-sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName )
+sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName )
throw (RuntimeException)
{
return FilterDetect_supportsService( rServiceName );
}
-Sequence< OUString > SAL_CALL FilterDetect::getSupportedServiceNames( )
+Sequence< OUString > SAL_CALL FilterDetect::getSupportedServiceNames( )
throw (RuntimeException)
{
return FilterDetect_getSupportedServiceNames();
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.hxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.hxx
index 210d59cf56e5..e3da3d5cec0c 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.hxx
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.hxx
@@ -3,7 +3,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -30,7 +30,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
#ifndef _FILTERDETECT_HXX
@@ -47,7 +47,7 @@
#include <cppuhelper/implbase3.hxx>
-enum FilterType
+enum FilterType
{
FILTER_IMPORT,
FILTER_EXPORT
@@ -66,36 +66,36 @@ protected:
::rtl::OUString msFilterName;
::com::sun::star::uno::Sequence< ::rtl::OUString > msUserData;
::rtl::OUString msTemplateName;
-
- sal_Bool SAL_CALL exportImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+
+ sal_Bool SAL_CALL exportImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
throw (::com::sun::star::uno::RuntimeException);
-
- sal_Bool SAL_CALL importImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+
+ sal_Bool SAL_CALL importImpl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
throw (::com::sun::star::uno::RuntimeException);
-
+
public:
FilterDetect( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF)
: mxMSF( rxMSF ) {}
-
+
virtual ~FilterDetect() {}
-
+
//XExtendedFilterDetection
- virtual ::rtl::OUString SAL_CALL detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& lDescriptor )
+ virtual ::rtl::OUString SAL_CALL detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& lDescriptor )
throw( com::sun::star::uno::RuntimeException );
-
+
// XInitialization
-
- virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
+
// XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( )
+ virtual ::rtl::OUString SAL_CALL getImplementationName( )
throw (::com::sun::star::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
+
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
throw (::com::sun::star::uno::RuntimeException);
-
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
+
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
throw (::com::sun::star::uno::RuntimeException);
};
@@ -103,10 +103,10 @@ public:
::rtl::OUString FilterDetect_getImplementationName()
throw ( ::com::sun::star::uno::RuntimeException );
-sal_Bool SAL_CALL FilterDetect_supportsService( const ::rtl::OUString& ServiceName )
+sal_Bool SAL_CALL FilterDetect_supportsService( const ::rtl::OUString& ServiceName )
throw ( ::com::sun::star::uno::RuntimeException );
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL FilterDetect_getSupportedServiceNames( )
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL FilterDetect_getSupportedServiceNames( )
throw ( ::com::sun::star::uno::RuntimeException );
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
index 6935eb351f55..34ae11cdbfe9 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
@@ -3,7 +3,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -30,7 +30,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
#include <cppuhelper/factory.hxx>
@@ -88,47 +88,47 @@ private:
public:
// ctor...
- XFlatXml( const Reference< XMultiServiceFactory > &r )
+ XFlatXml( const Reference< XMultiServiceFactory > &r )
: m_rServiceFactory(r)
, m_bPrettyPrint(sal_True)
{}
// XImportFilter
virtual sal_Bool SAL_CALL importer(
- const Sequence<PropertyValue>& aSourceData,
- const Reference<XDocumentHandler>& xHandler,
- const Sequence<OUString>& msUserData)
+ const Sequence<PropertyValue>& aSourceData,
+ const Reference<XDocumentHandler>& xHandler,
+ const Sequence<OUString>& msUserData)
throw(RuntimeException);
// XExportFilter
virtual sal_Bool SAL_CALL exporter(
- const Sequence<PropertyValue>& aSourceData,
- const Sequence<OUString>& msUserData)
+ const Sequence<PropertyValue>& aSourceData,
+ const Sequence<OUString>& msUserData)
throw(RuntimeException);
// XDocumentHandler
- virtual void SAL_CALL startDocument()
+ virtual void SAL_CALL startDocument()
throw (SAXException,RuntimeException);
- virtual void SAL_CALL endDocument()
+ virtual void SAL_CALL endDocument()
throw (SAXException, RuntimeException);
- virtual void SAL_CALL startElement(const OUString& str, const Reference<XAttributeList>& attriblist)
+ virtual void SAL_CALL startElement(const OUString& str, const Reference<XAttributeList>& attriblist)
throw (SAXException,RuntimeException);
- virtual void SAL_CALL endElement(const OUString& str)
+ virtual void SAL_CALL endElement(const OUString& str)
throw (SAXException, RuntimeException);
- virtual void SAL_CALL characters(const OUString& str)
+ virtual void SAL_CALL characters(const OUString& str)
throw (SAXException, RuntimeException);
- virtual void SAL_CALL ignorableWhitespace(const OUString& str)
+ virtual void SAL_CALL ignorableWhitespace(const OUString& str)
throw (SAXException, RuntimeException);
- virtual void SAL_CALL processingInstruction(const OUString& str, const OUString& str2)
+ virtual void SAL_CALL processingInstruction(const OUString& str, const OUString& str2)
throw (com::sun::star::xml::sax::SAXException,RuntimeException);
- virtual void SAL_CALL setDocumentLocator(const Reference<XLocator>& doclocator)
- throw (SAXException,RuntimeException);
+ virtual void SAL_CALL setDocumentLocator(const Reference<XLocator>& doclocator)
+ throw (SAXException,RuntimeException);
};
sal_Bool XFlatXml::importer(
- const Sequence<PropertyValue>& aSourceData,
- const Reference<XDocumentHandler>& xHandler,
- const Sequence<OUString>& msUserData)
+ const Sequence<PropertyValue>& aSourceData,
+ const Reference<XDocumentHandler>& xHandler,
+ const Sequence<OUString>& msUserData)
throw (RuntimeException)
{
// get information from media descriptor
@@ -137,12 +137,12 @@ sal_Bool XFlatXml::importer(
// the sax parser that drives the supplied document handler
sal_Int32 nLength = aSourceData.getLength();
OUString aName, aFileName, aURL;
- Reference< XInputStream > xInputStream;
+ Reference< XInputStream > xInputStream;
for ( sal_Int32 i = 0 ; i < nLength; i++)
{
aName = aSourceData[i].Name;
if (aName.equalsAscii("InputStream"))
- aSourceData[i].Value >>= xInputStream;
+ aSourceData[i].Value >>= xInputStream;
else if ( aName.equalsAscii("FileName"))
aSourceData[i].Value >>= aFileName;
else if ( aName.equalsAscii("URL"))
@@ -158,17 +158,17 @@ sal_Bool XFlatXml::importer(
if (xSeek.is())
xSeek->seek(0);
-
+
// create SAX parser that will read the document file
// and provide events to xHandler passed to this call
- Reference < XParser > xSaxParser( m_rServiceFactory->createInstance(
+ Reference < XParser > xSaxParser( m_rServiceFactory->createInstance(
OUString::createFromAscii("com.sun.star.xml.sax.Parser")), UNO_QUERY );
OSL_ASSERT(xSaxParser.is());
if(!xSaxParser.is())return sal_False;
// let the parser try to send the sax event to the document handler
try
- {
+ {
InputSource aInput;
aInput.sSystemId = aURL;
aInput.sPublicId = aURL;
@@ -188,8 +188,8 @@ sal_Bool XFlatXml::importer(
}
sal_Bool XFlatXml::exporter(
- const Sequence<PropertyValue>& aSourceData,
- const Sequence<OUString>& msUserData)
+ const Sequence<PropertyValue>& aSourceData,
+ const Sequence<OUString>& msUserData)
throw (RuntimeException)
{
@@ -199,9 +199,9 @@ sal_Bool XFlatXml::exporter(
// from it's data-source interface
OUString aName, sURL;
Reference<XOutputStream> rOutputStream;
- sal_Int32 nLength = aSourceData.getLength();
+ sal_Int32 nLength = aSourceData.getLength();
for ( sal_Int32 i = 0 ; i < nLength; i++)
- {
+ {
aName = aSourceData[i].Name;
if ( aName.equalsAscii("OutputStream"))
aSourceData[i].Value >>= rOutputStream;
@@ -243,44 +243,44 @@ void XFlatXml::endDocument() throw (SAXException,RuntimeException){
m_rDocumentHandler->endDocument();
}
-void XFlatXml::startElement(const OUString& str, const Reference<XAttributeList>& attriblist)
+void XFlatXml::startElement(const OUString& str, const Reference<XAttributeList>& attriblist)
throw (SAXException, RuntimeException)
{
OSL_ASSERT(m_rDocumentHandler.is());
m_rDocumentHandler->startElement(str, attriblist);
}
-void XFlatXml::endElement(const OUString& str)
- throw (SAXException, RuntimeException)
+void XFlatXml::endElement(const OUString& str)
+ throw (SAXException, RuntimeException)
{
OSL_ASSERT(m_rDocumentHandler.is());
m_rDocumentHandler->endElement(str);
}
-void XFlatXml::characters(const OUString& str)
- throw (SAXException, RuntimeException)
+void XFlatXml::characters(const OUString& str)
+ throw (SAXException, RuntimeException)
{
OSL_ASSERT(m_rDocumentHandler.is());
m_rDocumentHandler->characters(str);
}
-void XFlatXml::ignorableWhitespace(const OUString& str)
+void XFlatXml::ignorableWhitespace(const OUString& str)
throw (SAXException, RuntimeException)
-{
+{
OSL_ASSERT(m_rDocumentHandler.is());
if (!m_bPrettyPrint) return;
m_rDocumentHandler->ignorableWhitespace(str);
}
-
-void XFlatXml::processingInstruction(const OUString& str, const OUString& str2)
- throw (SAXException, RuntimeException)
+
+void XFlatXml::processingInstruction(const OUString& str, const OUString& str2)
+ throw (SAXException, RuntimeException)
{
OSL_ASSERT(m_rDocumentHandler.is());
m_rDocumentHandler->processingInstruction(str, str2);
}
-void XFlatXml::setDocumentLocator(const Reference<XLocator>& doclocator)
- throw (SAXException, RuntimeException)
+void XFlatXml::setDocumentLocator(const Reference<XLocator>& doclocator)
+ throw (SAXException, RuntimeException)
{
OSL_ASSERT(m_rDocumentHandler.is());
m_rDocumentHandler->setDocumentLocator(doclocator);
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXmlFilter_cpp.uno.xml b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXmlFilter_cpp.uno.xml
index 9202844eef76..a7965afc4af0 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXmlFilter_cpp.uno.xml
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXmlFilter_cpp.uno.xml
@@ -5,12 +5,12 @@
<component-description>
<author> Aidan Butler </author>
<name>devguide.officedev.samples.filter.FlatXmlCpp</name>
-
+
<description>
This component is a sample implementation, which describes how a filter may be written that uses the XmlFilterAdaptor component. This filter opens and saves Flat Xml files.
</description>
- <loader-name> com.sun.star.loader.SharedLibrary </loader-name>
- <language> c++ </language>
+ <loader-name> com.sun.star.loader.SharedLibrary </loader-name>
+ <language> c++ </language>
<status value="final"/>
<supported-service>devguide.officedev.samples.filter.FlatXmlCpp</supported-service>
<type>com.sun.star.lang.XSingleServiceFactory</type>
@@ -47,13 +47,13 @@
<type>com.sun.star.ucb.XSimpleFileAccess</type>
<type>com.sun.star.beans.XPropertySet</type>
</component-description>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
- <runtime-module-dependency> cppuhelper$(UDK_MAJOR)$(COM) </runtime-module-dependency>
- <runtime-module-dependency> salhelper$(UDK_MAJOR)$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppu$(UDK_MAJOR) </runtime-module-dependency>
- <runtime-module-dependency> reg$(UDK_MAJOR) </runtime-module-dependency>
- <runtime-module-dependency> store$(UDK_MAJOR) </runtime-module-dependency>
- <runtime-module-dependency> sal$(UDK_MAJOR) </runtime-module-dependency>
+ <project-build-dependency> cppuhelper </project-build-dependency>
+ <project-build-dependency> cppu </project-build-dependency>
+ <project-build-dependency> sal </project-build-dependency>
+ <runtime-module-dependency> cppuhelper$(UDK_MAJOR)$(COM) </runtime-module-dependency>
+ <runtime-module-dependency> salhelper$(UDK_MAJOR)$(COM) </runtime-module-dependency>
+ <runtime-module-dependency> cppu$(UDK_MAJOR) </runtime-module-dependency>
+ <runtime-module-dependency> reg$(UDK_MAJOR) </runtime-module-dependency>
+ <runtime-module-dependency> store$(UDK_MAJOR) </runtime-module-dependency>
+ <runtime-module-dependency> sal$(UDK_MAJOR) </runtime-module-dependency>
</module-description>
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java
index cf95e1637c08..e801227ed4be 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import java.io.*;
@@ -50,8 +50,8 @@ import com.sun.star.io.XActiveDataSource;
-public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
- XServiceInfo, XDocumentHandler, XTypeProvider
+public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
+ XServiceInfo, XDocumentHandler, XTypeProvider
{
/*
@@ -66,15 +66,15 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
static private final String[] __supportedServiceNames = {
"devguide.officedev.samples.filter.FlatXmlJava"
};
-
+
public FlatXml(XMultiServiceFactory f) {
m_xServiceFactory = f;
}
-
+
// --- XTypeProvider ---
public byte[] getImplementationId() {
return Integer.toString(this.hashCode()).getBytes();
- }
+ }
// --- XServiceName ---
public String getServiceName() {
@@ -91,10 +91,10 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
public String getImplementationName() {
return( this.getClass().getName() );
}
- public String[] getSupportedServiceNames() {
+ public String[] getSupportedServiceNames() {
return( __supportedServiceNames );
}
-
+
public com.sun.star.uno.Type[] getTypes() {
Type[] typeReturn = {};
try {
@@ -103,7 +103,7 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
new Type( XExportFilter.class ),
new Type( XImportFilter.class ),
new Type( XServiceName.class ),
- new Type( XServiceInfo.class )
+ new Type( XServiceInfo.class )
};
} catch( java.lang.Exception exception ) {
return null;
@@ -111,19 +111,19 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
return( typeReturn );
}
- public boolean importer(PropertyValue[] aSourceData, XDocumentHandler xDocHandler, String[] msUserData)
- throws com.sun.star.uno.RuntimeException, com.sun.star.lang.IllegalArgumentException
- {
+ public boolean importer(PropertyValue[] aSourceData, XDocumentHandler xDocHandler, String[] msUserData)
+ throws com.sun.star.uno.RuntimeException, com.sun.star.lang.IllegalArgumentException
+ {
String sName = null;
String sFileName = null;
- String sURL = null;
- com.sun.star.io.XInputStream xin = null;
+ String sURL = null;
+ com.sun.star.io.XInputStream xin = null;
try {
-
+
for (int i = 0 ; i < aSourceData.length; i++)
{
- sName = aSourceData[i].Name;
+ sName = aSourceData[i].Name;
if (sName.equals("InputStream"))
xin = (XInputStream)AnyConverter.toObject(XInputStream.class, aSourceData[i].Value);
if (sName.equals("URL"))
@@ -131,48 +131,48 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
if (sName.equals("FileName"))
sFileName=(String)AnyConverter.toObject(String.class, aSourceData[i].Value);
}
-
+
Object tmpObj=m_xServiceFactory.createInstance("com.sun.star.xml.sax.Parser");
if (tmpObj == null) return false;
-
+
XParser xParser = (XParser)UnoRuntime.queryInterface(XParser.class , tmpObj);
if (xParser == null) return false;
-
+
InputSource aInput = new InputSource();
aInput.sSystemId = sURL;
aInput.aInputStream =xin;
xParser.setDocumentHandler ( xDocHandler );
- xParser.parseStream ( aInput );
+ xParser.parseStream ( aInput );
} catch (com.sun.star.uno.Exception e){
- e.printStackTrace();
+ e.printStackTrace();
return false;
}
-
+
// done...
return true;
}
- public boolean exporter(PropertyValue[] aSourceData, String[] msUserData)
+ public boolean exporter(PropertyValue[] aSourceData, String[] msUserData)
throws com.sun.star.uno.RuntimeException, com.sun.star.lang.IllegalArgumentException
{
try {
String sURL = null;
String sName = null;
XOutputStream xos = null;
-
- // get interesting values from sourceData
+
+ // get interesting values from sourceData
for (int i = 0 ; i < aSourceData.length; i++)
{
- sName = aSourceData[i].Name;
+ sName = aSourceData[i].Name;
if (sName.equals("OutputStream"))
xos = (XOutputStream)AnyConverter.toObject(XOutputStream.class, aSourceData[i].Value);
if (sName.equals("URL"))
sURL=(String)AnyConverter.toObject(String.class, aSourceData[i].Value);
}
-
+
// prepare the XML writer
Object tmpObj = null;
- if (m_xHandler == null)
+ if (m_xHandler == null)
{
tmpObj = m_xServiceFactory.createInstance("com.sun.star.xml.sax.Writer");
if (tmpObj != null)
@@ -181,10 +181,10 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
if (m_xHandler == null)
return false;
- // Connect the provided output stream to the writer
+ // Connect the provided output stream to the writer
XActiveDataSource xADSource = (XActiveDataSource)UnoRuntime.queryInterface(
XActiveDataSource.class, m_xHandler);
-
+
if (xADSource != null && xos != null)
xADSource.setOutputStream(xos);
else
@@ -192,23 +192,23 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
} catch (com.sun.star.uno.Exception e){
return false;
}
-
+
// done ...
return true;
}
-
- public void startDocument ()
+
+ public void startDocument ()
throws com.sun.star.xml.sax.SAXException
{
m_xHandler.startDocument();
}
-
+
public void endDocument()
throws com.sun.star.xml.sax.SAXException
{
m_xHandler.endDocument();
}
-
+
public void startElement (String str, com.sun.star.xml.sax.XAttributeList xattribs)
throws com.sun.star.xml.sax.SAXException
{
@@ -226,12 +226,12 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
{
m_xHandler.characters(str);
}
-
+
public void ignorableWhitespace(String str)
throws com.sun.star.xml.sax.SAXException
{
if (!m_bPrettyPrint) return;
- else m_xHandler.ignorableWhitespace(str);
+ else m_xHandler.ignorableWhitespace(str);
}
public void processingInstruction(String aTarget, String aData)
@@ -245,12 +245,12 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
{
m_xHandler.setDocumentLocator(xLocator);
}
-
- // ------------------------------------------------------------
+
+ // ------------------------------------------------------------
// component management
-
+
public static XSingleServiceFactory __getServiceFactory(String implName,
- XMultiServiceFactory multiFactory, XRegistryKey regKey)
+ XMultiServiceFactory multiFactory, XRegistryKey regKey)
{
XSingleServiceFactory xSingleServiceFactory = null;
if (implName.equals(__implName) ) {
@@ -260,14 +260,14 @@ public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
} catch (java.lang.ClassNotFoundException e) {
return null;
}
- }
+ }
return xSingleServiceFactory;
}
-
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey)
+
+ public static boolean __writeRegistryServiceInfo(XRegistryKey regKey)
{
return FactoryHelper.writeRegistryServiceInfo(__implName,
__serviceName, regKey);
}
-
+
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/LinguisticExamples.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/LinguisticExamples.java
index 60829600861f..b4c2cd1edf12 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/LinguisticExamples.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/LinguisticExamples.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// used interfaces
@@ -84,14 +84,14 @@ public class LinguisticExamples
protected XPropertySet mxLinguProps = null;
- public static void main(String args[])
+ public static void main(String args[])
{
// Create an instance of the class and call it's begin method
try {
LinguisticExamples aExample = new LinguisticExamples();
aExample.Connect();
- aExample.Run();
- } catch (Exception e) {
+ aExample.Run();
+ } catch (Exception e) {
System.err.println("failed to run examples");
e.printStackTrace();
}
@@ -119,12 +119,12 @@ public class LinguisticExamples
if (mxRemoteContext != null && mxRemoteServiceManager != null) {
Object aObj = mxRemoteServiceManager.createInstanceWithContext(
"com.sun.star.linguistic2.LinguServiceManager", mxRemoteContext );
- mxLinguSvcMgr = (XLinguServiceManager)
+ mxLinguSvcMgr = (XLinguServiceManager)
UnoRuntime.queryInterface(XLinguServiceManager.class, aObj);
}
return mxLinguSvcMgr != null;
- }
-
+ }
+
/** Get the SpellChecker to be used.
*/
@@ -175,9 +175,9 @@ public class LinguisticExamples
// use american english as language
Locale aLocale = new Locale("en","US","");
-
-
-
+
+
+
// another list of property values to used in function calls below.
// Only properties with values different from the (default) values
// in the LinguProperties property set need to be supllied.
@@ -185,9 +185,9 @@ public class LinguisticExamples
aProps[0] = new PropertyValue();
aProps[0].Name = "IsGermanPreReform";
aProps[0].Value = new Boolean( true );
-
-
- GetSpell();
+
+
+ GetSpell();
if (mxSpell != null)
{
// test with correct word
@@ -198,7 +198,7 @@ public class LinguisticExamples
// test with incorrect word
aWord = "course";
bIsCorrect = mxSpell.isValid( aWord, aLocale , aEmptyProps );
- System.out.println( aWord + ": " + bIsCorrect );
+ System.out.println( aWord + ": " + bIsCorrect );
aWord = "house";
@@ -220,10 +220,10 @@ public class LinguisticExamples
}
- GetHyph();
+ GetHyph();
if (mxHyph != null)
{
- // maximum number of characters to remain before the hyphen
+ // maximum number of characters to remain before the hyphen
// character in the resulting word of the hyphenation
short nMaxLeading = 6;
@@ -235,16 +235,16 @@ public class LinguisticExamples
else
{
System.out.println( "valid hyphenation pos found at "
- + xHyphWord.getHyphenationPos()
+ + xHyphWord.getHyphenationPos()
+ " in " + xHyphWord.getWord() );
System.out.println( "hyphenation char will be after char "
- + xHyphWord.getHyphenPos()
+ + xHyphWord.getHyphenPos()
+ " in " + xHyphWord.getHyphenatedWord() );
}
//! Note: 'aProps' needs to have set 'IsGermanPreReform' to true!
- xHyphWord = mxHyph.queryAlternativeSpelling( "Schiffahrt",
+ xHyphWord = mxHyph.queryAlternativeSpelling( "Schiffahrt",
new Locale("de","DE",""), (short)4, aProps );
if (xHyphWord == null)
System.out.println( "no alternative spelling found at specified position." );
@@ -253,10 +253,10 @@ public class LinguisticExamples
if (xHyphWord.isAlternativeSpelling())
System.out.println( "alternative spelling detectetd!" );
System.out.println( "valid hyphenation pos found at "
- + xHyphWord.getHyphenationPos()
+ + xHyphWord.getHyphenationPos()
+ " in " + xHyphWord.getWord() );
System.out.println( "hyphenation char will be after char "
- + xHyphWord.getHyphenPos()
+ + xHyphWord.getHyphenPos()
+ " in " + xHyphWord.getHyphenatedWord() );
}
@@ -267,12 +267,12 @@ public class LinguisticExamples
if (xPossHyph == null)
System.out.println( "no hyphenation positions found." );
else
- System.out.println( xPossHyph.getPossibleHyphens() );
- }
-
-
- GetThes();
- if (mxThes != null)
+ System.out.println( xPossHyph.getPossibleHyphens() );
+ }
+
+
+ GetThes();
+ if (mxThes != null)
{
XMeaning[] xMeanings = mxThes.queryMeanings("house", aLocale,
aEmptyProps );
@@ -287,11 +287,11 @@ public class LinguisticExamples
for (int k = 0; k < aSynonyms.length; ++k)
System.out.println( " Synonym: " + aSynonyms[k] );
}
- }
- }
-
-
-
+ }
+ }
+
+
+
XLinguServiceEventListener aClient = new Client();
// get access to LinguProperties property set
@@ -299,18 +299,18 @@ public class LinguisticExamples
"com.sun.star.linguistic2.LinguProperties", mxRemoteContext);
XPropertySet aLinguProps = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class,aObj);
-
+
// set a spellchecker and hyphenator property value to a defined state
try {
aLinguProps.setPropertyValue("IsGermanPreReform", new Boolean(true));
} catch (Exception e) {
- }
+ }
// now add the client as listener to the service manager to
// get informed when spellchecking or hyphenation may produce
// different results then before.
mxLinguSvcMgr.addLinguServiceManagerListener(aClient);
-
+
// change that property value in order to trigger a property change
// event that eventually results in the listeners
// 'processLinguServiceEvent' function being called
@@ -318,9 +318,9 @@ public class LinguisticExamples
aLinguProps.setPropertyValue("IsGermanPreReform", new Boolean(false));
} catch (Exception e) {
}
-
+
//! keep the listener and the program alive until the event will
- //! be launched.
+ //! be launched.
//! There is a voluntary delay before launching the event!
// Of course this code would usually not be in a *real* client
// its
@@ -328,38 +328,38 @@ public class LinguisticExamples
try {
this.wait(4000);
} catch(Exception e) {
-
+
}
}
-
+
//! remove listener before programm termination.
//! should not be omitted.
mxLinguSvcMgr.removeLinguServiceManagerListener(aClient);
-
-
+
+
System.exit(0);
}
/** simple sample implementation of a clients XLinguServiceEventListener
* interface implementation
*/
- public class Client
+ public class Client
implements XLinguServiceEventListener
{
public void disposing ( EventObject aEventObj )
{
//! any references to the EventObjects source have to be
//! released here now!
-
+
System.out.println("object listened to will be disposed");
}
public void processLinguServiceEvent( LinguServiceEvent aServiceEvent )
- {
+ {
//! do here whatever you think needs to be done depending
//! on the event recieved (e.g. trigger background spellchecking
//! or hyphenation again.)
-
+
System.out.println("Listener called");
}
};
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/OneInstanceFactory.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/OneInstanceFactory.java
index 9b2a22403caa..03e2a665b610 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/OneInstanceFactory.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/OneInstanceFactory.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.lang.XSingleServiceFactory;
@@ -45,9 +45,9 @@ import java.lang.reflect.Constructor;
//
// purpose of this class is to provide a service factory that instantiates
-// the services only once (as long as this factory itself exists)
+// the services only once (as long as this factory itself exists)
// and returns only reference to that instance.
-//
+//
public class OneInstanceFactory implements
XSingleServiceFactory,
@@ -75,8 +75,8 @@ public class OneInstanceFactory implements
//**********************
// XSingleServiceFactory
//**********************
- public Object createInstance()
- throws com.sun.star.uno.Exception,
+ public Object createInstance()
+ throws com.sun.star.uno.Exception,
com.sun.star.uno.RuntimeException
{
if (xInstantiatedService == null)
@@ -88,7 +88,7 @@ public class OneInstanceFactory implements
}
catch( Exception e ) {
}
-
+
//!! workaround for services not always being created
//!! via 'createInstanceWithArguments'
XInitialization xIni = (XInitialization) UnoRuntime.queryInterface(
@@ -102,15 +102,15 @@ public class OneInstanceFactory implements
XPropertySet.class , xMultiFactory.createInstance(
"com.sun.star.linguistic2.LinguProperties" ) );
aArguments[0] = xPropSet;
- }
+ }
xIni.initialize( aArguments );
}
}
return xInstantiatedService;
}
- public Object createInstanceWithArguments( Object[] aArguments )
- throws com.sun.star.uno.Exception,
+ public Object createInstanceWithArguments( Object[] aArguments )
+ throws com.sun.star.uno.Exception,
com.sun.star.uno.RuntimeException
{
if (xInstantiatedService == null)
@@ -145,7 +145,7 @@ public class OneInstanceFactory implements
{
return aSvcImplName;
}
-
+
public String[] getSupportedServiceNames()
throws com.sun.star.uno.RuntimeException
{
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper.java
index 87b1ea3b5b3b..ec6471480fcd 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.linguistic2.XLinguServiceEventBroadcaster;
@@ -66,23 +66,23 @@ public class PropChgHelper implements
{
return xEvtSource;
}
-
+
public XPropertySet GetPropSet()
{
return xPropSet;
}
-
+
public String[] GetPropNames()
{
return aPropNames;
}
-
+
public void LaunchEvent( LinguServiceEvent aEvt )
{
int nCnt = aLngSvcEvtListeners.size();
for (int i = 0; i < nCnt; ++i)
{
- XLinguServiceEventListener xLstnr =
+ XLinguServiceEventListener xLstnr =
(XLinguServiceEventListener) aLngSvcEvtListeners.get(i);
if (xLstnr != null)
xLstnr.processLinguServiceEvent( aEvt );
@@ -104,7 +104,7 @@ public class PropChgHelper implements
if (aPropNames[i].length() != 0)
{
try {
- xPropSet.addPropertyChangeListener(
+ xPropSet.addPropertyChangeListener(
aPropNames[i], (XPropertyChangeListener) this );
}
catch( Exception e ) {
@@ -124,7 +124,7 @@ public class PropChgHelper implements
if (aPropNames[i].length() != 0)
{
try {
- xPropSet.removePropertyChangeListener(
+ xPropSet.removePropertyChangeListener(
aPropNames[i], (XPropertyChangeListener) this );
}
catch( Exception e ) {
@@ -135,7 +135,7 @@ public class PropChgHelper implements
xPropSet = null;
}
}
-
+
// __________ interface methods __________
//***************
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Hyph.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Hyph.java
index 00d67df8485a..0b6395036d98 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Hyph.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Hyph.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.linguistic2.XLinguServiceEventBroadcaster;
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java
index d399e13477e1..9a4f07a33779 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.linguistic2.XLinguServiceEventBroadcaster;
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java
index adad109f9a87..9e4639c7f5f1 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,10 +29,10 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
-// uno
+// uno
import com.sun.star.lib.uno.helper.ComponentBase;
import com.sun.star.uno.UnoRuntime;
@@ -43,10 +43,10 @@ import com.sun.star.lang.XSingleServiceFactory;
// supported Interfaces
import com.sun.star.linguistic2.XHyphenator;
import com.sun.star.linguistic2.XLinguServiceEventBroadcaster;
-import com.sun.star.lang.XInitialization;
+import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XServiceInfo;
-import com.sun.star.lang.XServiceDisplayName;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.lang.XServiceDisplayName;
// Exceptions
import com.sun.star.uno.Exception;
@@ -101,10 +101,10 @@ public class SampleHyphenator extends ComponentBase implements
{
return aLoc1.Language.equals( aLoc2.Language ) &&
aLoc1.Country .equals( aLoc2.Country ) &&
- aLoc1.Variant .equals( aLoc2.Variant );
+ aLoc1.Variant .equals( aLoc2.Variant );
}
- private boolean GetValueToUse(
+ private boolean GetValueToUse(
String aPropName,
boolean bDefaultVal,
PropertyValue[] aProps )
@@ -139,11 +139,11 @@ public class SampleHyphenator extends ComponentBase implements
catch (Exception e) {
bRes = bDefaultVal;
}
-
+
return bRes;
}
-
- private short GetValueToUse(
+
+ private short GetValueToUse(
String aPropName,
short nDefaultVal,
PropertyValue[] aProps )
@@ -178,20 +178,20 @@ public class SampleHyphenator extends ComponentBase implements
catch (Exception e) {
nRes = nDefaultVal;
}
-
+
return nRes;
}
-
+
// __________ interface methods __________
-
-
+
+
//*****************
//XSupportedLocales
//*****************
public Locale[] getLocales()
throws com.sun.star.uno.RuntimeException
{
- Locale aLocales[] =
+ Locale aLocales[] =
{
new Locale( "de", "DE", "" ),
new Locale( "en", "US", "" )
@@ -199,23 +199,23 @@ public class SampleHyphenator extends ComponentBase implements
return aLocales;
}
-
- public boolean hasLocale( Locale aLocale )
+
+ public boolean hasLocale( Locale aLocale )
throws com.sun.star.uno.RuntimeException
{
boolean bRes = false;
if ( IsEqual( aLocale, new Locale( "de", "DE", "" ) ) ||
IsEqual( aLocale, new Locale( "en", "US", "" ) ))
bRes = true;
- return bRes;
+ return bRes;
}
-
+
//***********
//XHyphenator
//***********
public XHyphenatedWord hyphenate(
String aWord, Locale aLocale,
- short nMaxLeading, PropertyValue[] aProperties )
+ short nMaxLeading, PropertyValue[] aProperties )
throws com.sun.star.uno.RuntimeException,
IllegalArgumentException
{
@@ -239,14 +239,14 @@ public class SampleHyphenator extends ComponentBase implements
short nHyphMinWordLen = GetValueToUse( "HyphMinWordLength", (short)5, aProperties );
XHyphenatedWord xRes = null;
-
+
if (aWord.length() >= nHyphMinWordLen)
{
String aHyphenatedWord = aWord;
short nHyphenationPos = -1;
short nHyphenPos = -1;
- //!! This code needs to be replaced by code calling the actual
+ //!! This code needs to be replaced by code calling the actual
//!! implementation of your hyphenator
if (IsEqual( aLocale, new Locale( "de", "DE", "" ) ) )
{
@@ -254,7 +254,7 @@ public class SampleHyphenator extends ComponentBase implements
{
// Note: there is only one position where the word
// can be hyphenated...
-
+
aHyphenatedWord = "Schifffahrt";
nHyphenationPos = 4;
nHyphenPos = 5;
@@ -267,15 +267,15 @@ public class SampleHyphenator extends ComponentBase implements
else if (IsEqual( aLocale, new Locale( "en", "US", "" ) ) )
{
int nLast = aWord.length() - 1 - nHyphMinTrailing;
-
- if ( aWord.equals( "waterfall" ) )
+
+ if ( aWord.equals( "waterfall" ) )
{
if (4 <= nLast)
nHyphenationPos = nHyphenPos = 4;
else
nHyphenationPos = nHyphenPos = 1;
}
- else if ( aWord.equals( "driving" ) )
+ else if ( aWord.equals( "driving" ) )
{
nHyphenationPos = nHyphenPos = 3;
}
@@ -284,19 +284,19 @@ public class SampleHyphenator extends ComponentBase implements
// check if hyphenation pos is valid,
// a value of -1 indicates that hyphenation is not possible
if ( nHyphenationPos != -1 &&
- !(nHyphenationPos < nHyphMinLeading) &&
+ !(nHyphenationPos < nHyphMinLeading) &&
!(nHyphenationPos >= aWord.length() - nHyphMinTrailing))
{
- xRes = new XHyphenatedWord_impl(aWord, aLocale,
+ xRes = new XHyphenatedWord_impl(aWord, aLocale,
nHyphenationPos, aHyphenatedWord, nHyphenPos);
}
}
return xRes;
}
-
+
public XHyphenatedWord queryAlternativeSpelling(
String aWord, Locale aLocale,
- short nIndex, PropertyValue[] aProperties )
+ short nIndex, PropertyValue[] aProperties )
throws com.sun.star.uno.RuntimeException,
IllegalArgumentException
{
@@ -318,10 +318,10 @@ public class SampleHyphenator extends ComponentBase implements
short nHyphMinLeading = GetValueToUse( "HyphMinLeading", (short)2, aProperties );
short nHyphMinTrailing = GetValueToUse( "HyphMinTrailing", (short)2, aProperties );
short nHyphMinWordLen = GetValueToUse( "HyphMinWordLength", (short)5, aProperties );
-
+
XHyphenatedWord xRes = null;
- //!! This code needs to be replaced by code calling the actual
+ //!! This code needs to be replaced by code calling the actual
//!! implementation of your hyphenator
if ( IsEqual( aLocale, new Locale( "de", "DE", "" ) ) )
{
@@ -330,8 +330,8 @@ public class SampleHyphenator extends ComponentBase implements
// is set.
if (aWord.equals( "Schiffahrt" ) &&
bIsGermanPreReform && nIndex == 4)
- {
- xRes = new XHyphenatedWord_impl(aWord, aLocale,
+ {
+ xRes = new XHyphenatedWord_impl(aWord, aLocale,
(short)4, "Schifffahrt", (short)5 );
}
}
@@ -342,16 +342,16 @@ public class SampleHyphenator extends ComponentBase implements
return xRes;
}
-
+
public XPossibleHyphens createPossibleHyphens(
String aWord, Locale aLocale,
- PropertyValue[] aProperties )
+ PropertyValue[] aProperties )
throws com.sun.star.uno.RuntimeException,
IllegalArgumentException
{
if (IsEqual( aLocale, new Locale() ) || aWord.length() == 0)
return null;
-
+
// linguistic is currently not allowed to throw exceptions
// thus we return null which means 'word cannot be hyphenated'
if (!hasLocale( aLocale ))
@@ -367,15 +367,15 @@ public class SampleHyphenator extends ComponentBase implements
short nHyphMinLeading = GetValueToUse( "HyphMinLeading", (short)2, aProperties );
short nHyphMinTrailing = GetValueToUse( "HyphMinTrailing", (short)2, aProperties );
short nHyphMinWordLen = GetValueToUse( "HyphMinWordLength", (short)5, aProperties );
-
+
XPossibleHyphens xRes = null;
- //!! This code needs to be replaced by code calling the actual
+ //!! This code needs to be replaced by code calling the actual
//!! implementation of your hyphenator
if ( IsEqual( aLocale, new Locale( "de", "DE", "" ) ) )
{
if (bIsGermanPreReform && aWord.equals( "Schiffahrt" ))
- {
+ {
short aPos[] = new short[] { (short) 4 };
xRes = new XPossibleHyphens_impl(aWord, aLocale,
"Schiff=fahrt", aPos);
@@ -389,14 +389,14 @@ public class SampleHyphenator extends ComponentBase implements
}
else if ( IsEqual( aLocale, new Locale( "en", "US", "" ) ) )
{
- if ( aWord.equals( "waterfall" ) )
+ if ( aWord.equals( "waterfall" ) )
{
short aPos[] = new short[]
{ (short) 1, (short) 4 };
xRes = new XPossibleHyphens_impl(aWord, aLocale,
"wa=ter=fall", aPos);
}
- else if ( aWord.equals( "driving" ) )
+ else if ( aWord.equals( "driving" ) )
{
short aPos[] = new short[]
{ (short) 3 };
@@ -407,7 +407,7 @@ public class SampleHyphenator extends ComponentBase implements
return xRes;
}
-
+
//*****************************
//XLinguServiceEventBroadcaster
//*****************************
@@ -415,35 +415,35 @@ public class SampleHyphenator extends ComponentBase implements
XLinguServiceEventListener xLstnr )
throws com.sun.star.uno.RuntimeException
{
- boolean bRes = false;
+ boolean bRes = false;
if (!bDisposing && xLstnr != null)
bRes = aPropChgHelper.addLinguServiceEventListener( xLstnr );
return bRes;
}
-
+
public boolean removeLinguServiceEventListener(
- XLinguServiceEventListener xLstnr )
+ XLinguServiceEventListener xLstnr )
throws com.sun.star.uno.RuntimeException
{
- boolean bRes = false;
+ boolean bRes = false;
if (!bDisposing && xLstnr != null)
bRes = aPropChgHelper.removeLinguServiceEventListener( xLstnr );
return bRes;
- }
+ }
//********************
// XServiceDisplayName
//********************
- public String getServiceDisplayName( Locale aLocale )
+ public String getServiceDisplayName( Locale aLocale )
throws com.sun.star.uno.RuntimeException
{
- return "Java Samples";
+ return "Java Samples";
}
//****************
// XInitialization
//****************
- public void initialize( Object[] aArguments )
+ public void initialize( Object[] aArguments )
throws com.sun.star.uno.Exception,
com.sun.star.uno.RuntimeException
{
@@ -457,7 +457,7 @@ public class SampleHyphenator extends ComponentBase implements
}
}
-
+
//*************
// XServiceInfo
//*************
@@ -479,17 +479,17 @@ public class SampleHyphenator extends ComponentBase implements
{
return _aSvcImplName;
}
-
+
public String[] getSupportedServiceNames()
throws com.sun.star.uno.RuntimeException
{
return getSupportedServiceNames_Static();
}
-
+
// __________ static things __________
public static String _aSvcImplName = "com.sun.star.linguistic2.JavaSamples.SampleHyphenator";
-
+
public static String[] getSupportedServiceNames_Static()
{
String[] aResult = { "com.sun.star.linguistic2.Hyphenator" };
@@ -531,7 +531,7 @@ public class SampleHyphenator extends ComponentBase implements
* @param xRegKey the registryKey
* @see com.sun.star.comp.loader.JavaLoader
*/
- public static boolean __writeRegistryServiceInfo(
+ public static boolean __writeRegistryServiceInfo(
com.sun.star.registry.XRegistryKey xRegKey )
{
boolean bResult = true;
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java
index 9e2cd5a81853..f63bc81af147 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// uno
@@ -43,10 +43,10 @@ import com.sun.star.lang.XSingleServiceFactory;
// supported Interfaces
import com.sun.star.linguistic2.XSpellChecker;
import com.sun.star.linguistic2.XLinguServiceEventBroadcaster;
-import com.sun.star.lang.XInitialization;
+import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XServiceInfo;
-import com.sun.star.lang.XServiceDisplayName;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.lang.XServiceDisplayName;
// Exceptions
import com.sun.star.uno.Exception;
@@ -101,10 +101,10 @@ public class SampleSpellChecker extends ComponentBase implements
{
return aLoc1.Language.equals( aLoc2.Language ) &&
aLoc1.Country .equals( aLoc2.Country ) &&
- aLoc1.Variant .equals( aLoc2.Variant );
+ aLoc1.Variant .equals( aLoc2.Variant );
}
- private boolean GetValueToUse(
+ private boolean GetValueToUse(
String aPropName,
boolean bDefaultVal,
PropertyValue[] aProps )
@@ -139,13 +139,13 @@ public class SampleSpellChecker extends ComponentBase implements
catch (Exception e) {
bRes = bDefaultVal;
}
-
+
return bRes;
}
private boolean IsUpper( String aWord, Locale aLocale )
{
- java.util.Locale aLang = new java.util.Locale(
+ java.util.Locale aLang = new java.util.Locale(
aLocale.Language, aLocale.Country, aLocale.Variant );
return aWord.equals( aWord.toUpperCase( aLang ) );
}
@@ -161,14 +161,14 @@ public class SampleSpellChecker extends ComponentBase implements
return false;
}
- private short GetSpellFailure(
- String aWord,
+ private short GetSpellFailure(
+ String aWord,
Locale aLocale,
- PropertyValue[] aProperties )
+ PropertyValue[] aProperties )
{
short nRes = -1;
- //!! This code needs to be replaced by code calling the actual
+ //!! This code needs to be replaced by code calling the actual
//!! implementation of your spellchecker
boolean bIsGermanPreReform = GetValueToUse( "IsGermanPreReform", false, aProperties );
if (IsEqual( aLocale, new Locale( "de", "DE", "" ) ))
@@ -188,23 +188,23 @@ public class SampleSpellChecker extends ComponentBase implements
{
// default value (no other SpellFailure type is applicable)
nRes = SpellFailure.SPELLING_ERROR;
-
+
if (aWord.equals( "arizona" ))
nRes = SpellFailure.CAPTION_ERROR;
else if (aWord.equals( "house" ))
nRes = SpellFailure.SPELLING_ERROR;
else if (aWord.equals( "course" ))
nRes = SpellFailure.IS_NEGATIVE_WORD;
- }
+ }
}
-
+
return nRes;
}
- private XSpellAlternatives GetProposals(
- String aWord,
- Locale aLocale,
- PropertyValue[] aProperties )
+ private XSpellAlternatives GetProposals(
+ String aWord,
+ Locale aLocale,
+ PropertyValue[] aProperties )
{
short nType = SpellFailure.SPELLING_ERROR;
String[] aProposals = null;
@@ -218,7 +218,7 @@ public class SampleSpellChecker extends ComponentBase implements
boolean bIsSpellUpperCase = GetValueToUse( "IsSpellUpperCase", false, aProperties );
boolean bIsSpellCapitalization = GetValueToUse( "IsSpellCapitalization", true, aProperties );
- //!! This code needs to be replaced by code calling the actual
+ //!! This code needs to be replaced by code calling the actual
//!! implementation of your spellchecker
if (IsEqual( aLocale, new Locale( "de", "DE", "" ) ))
{
@@ -257,17 +257,17 @@ public class SampleSpellChecker extends ComponentBase implements
return new XSpellAlternatives_impl( aWord, aLocale,
nType, aProposals );
}
-
+
// __________ interface methods __________
-
-
+
+
//*****************
//XSupportedLocales
//*****************
public Locale[] getLocales()
throws com.sun.star.uno.RuntimeException
{
- Locale aLocales[] =
+ Locale aLocales[] =
{
new Locale( "de", "DE", "" ),
new Locale( "en", "US", "" )
@@ -275,30 +275,30 @@ public class SampleSpellChecker extends ComponentBase implements
return aLocales;
}
-
- public boolean hasLocale( Locale aLocale )
+
+ public boolean hasLocale( Locale aLocale )
throws com.sun.star.uno.RuntimeException
{
boolean bRes = false;
if ( IsEqual( aLocale, new Locale( "de", "DE", "" ) ) ||
IsEqual( aLocale, new Locale( "en", "US", "" ) ))
bRes = true;
- return bRes;
+ return bRes;
}
-
+
//*************
//XSpellChecker
//*************
public boolean isValid(
String aWord, Locale aLocale,
- PropertyValue[] aProperties )
+ PropertyValue[] aProperties )
throws com.sun.star.uno.RuntimeException,
IllegalArgumentException
{
if (IsEqual( aLocale, new Locale() ) || aWord.length() == 0)
return true;
-
+
// linguistic is currently not allowed to throw exceptions
// thus we return null which means 'word cannot be spelled'
if (!hasLocale( aLocale ))
@@ -312,7 +312,7 @@ public class SampleSpellChecker extends ComponentBase implements
boolean bIsSpellWithDigits = GetValueToUse( "IsSpellWithDigits", false, aProperties );
boolean bIsSpellUpperCase = GetValueToUse( "IsSpellUpperCase", false, aProperties );
boolean bIsSpellCapitalization = GetValueToUse( "IsSpellCapitalization", true, aProperties );
-
+
short nFailure = GetSpellFailure( aWord, aLocale, aProperties );
if (nFailure != -1)
{
@@ -327,22 +327,22 @@ public class SampleSpellChecker extends ComponentBase implements
return nFailure == -1;
}
-
-
+
+
public XSpellAlternatives spell(
String aWord, Locale aLocale,
- PropertyValue[] aProperties )
+ PropertyValue[] aProperties )
throws com.sun.star.uno.RuntimeException,
IllegalArgumentException
{
if (IsEqual( aLocale, new Locale() ) || aWord.length() == 0)
return null;
-
+
// linguistic is currently not allowed to throw exceptions
// thus we return null fwhich means 'word cannot be spelled'
if (!hasLocale( aLocale ))
return null;
-
+
XSpellAlternatives xRes = null;
if (!isValid( aWord, aLocale, aProperties ))
{
@@ -350,8 +350,8 @@ public class SampleSpellChecker extends ComponentBase implements
}
return xRes;
}
-
-
+
+
//*****************************
//XLinguServiceEventBroadcaster
//*****************************
@@ -359,35 +359,35 @@ public class SampleSpellChecker extends ComponentBase implements
XLinguServiceEventListener xLstnr )
throws com.sun.star.uno.RuntimeException
{
- boolean bRes = false;
+ boolean bRes = false;
if (!bDisposing && xLstnr != null)
bRes = aPropChgHelper.addLinguServiceEventListener( xLstnr );
return bRes;
}
-
+
public boolean removeLinguServiceEventListener(
- XLinguServiceEventListener xLstnr )
+ XLinguServiceEventListener xLstnr )
throws com.sun.star.uno.RuntimeException
{
- boolean bRes = false;
+ boolean bRes = false;
if (!bDisposing && xLstnr != null)
bRes = aPropChgHelper.removeLinguServiceEventListener( xLstnr );
return bRes;
- }
+ }
//********************
// XServiceDisplayName
//********************
- public String getServiceDisplayName( Locale aLocale )
+ public String getServiceDisplayName( Locale aLocale )
throws com.sun.star.uno.RuntimeException
{
- return "Java Samples";
+ return "Java Samples";
}
//****************
// XInitialization
//****************
- public void initialize( Object[] aArguments )
+ public void initialize( Object[] aArguments )
throws com.sun.star.uno.Exception,
com.sun.star.uno.RuntimeException
{
@@ -422,17 +422,17 @@ public class SampleSpellChecker extends ComponentBase implements
{
return _aSvcImplName;
}
-
+
public String[] getSupportedServiceNames()
throws com.sun.star.uno.RuntimeException
{
return getSupportedServiceNames_Static();
}
-
+
// __________ static things __________
public static String _aSvcImplName = "com.sun.star.linguistic2.JavaSamples.SampleSpellChecker";
-
+
public static String[] getSupportedServiceNames_Static()
{
String[] aResult = { "com.sun.star.linguistic2.SpellChecker" };
@@ -474,7 +474,7 @@ public class SampleSpellChecker extends ComponentBase implements
* @param xRegKey the registryKey
* @see com.sun.star.comp.loader.JavaLoader
*/
- public static boolean __writeRegistryServiceInfo(
+ public static boolean __writeRegistryServiceInfo(
com.sun.star.registry.XRegistryKey xRegKey )
{
boolean bResult = true;
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java
index 7e5bbb1bf442..e3b361f87a72 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// uno
@@ -42,10 +42,10 @@ import com.sun.star.lang.XSingleServiceFactory;
// supported Interfaces
import com.sun.star.linguistic2.XThesaurus;
-import com.sun.star.lang.XInitialization;
+import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XServiceInfo;
-import com.sun.star.lang.XServiceDisplayName;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.lang.XServiceDisplayName;
// Exceptions
import com.sun.star.uno.Exception;
@@ -74,7 +74,7 @@ public class SampleThesaurus extends ComponentBase implements
PropChgHelper aPropChgHelper;
ArrayList aEvtListeners;
boolean bDisposing;
-
+
public SampleThesaurus()
{
// names of relevant properties to be used
@@ -84,13 +84,13 @@ public class SampleThesaurus extends ComponentBase implements
"IsUseDictionaryList",
"IsGermanPreReform",
};
-
+
// this service has no listeners thus we may use the base class,
- // which is here basically used only to keep track of the
+ // which is here basically used only to keep track of the
// property set (and it's lifetime) since it gets used in the
// 'GetValueToUse' function
aPropChgHelper = new PropChgHelper( (XThesaurus) this, aProps );
-
+
aEvtListeners = new ArrayList();
bDisposing = false;
}
@@ -99,10 +99,10 @@ public class SampleThesaurus extends ComponentBase implements
{
return aLoc1.Language.equals( aLoc2.Language ) &&
aLoc1.Country .equals( aLoc2.Country ) &&
- aLoc1.Variant .equals( aLoc2.Variant );
+ aLoc1.Variant .equals( aLoc2.Variant );
}
- private boolean GetValueToUse(
+ private boolean GetValueToUse(
String aPropName,
boolean bDefaultVal,
PropertyValue[] aProps )
@@ -137,40 +137,40 @@ public class SampleThesaurus extends ComponentBase implements
catch (Exception e) {
bRes = bDefaultVal;
}
-
+
return bRes;
}
-
+
// __________ interface methods __________
-
-
+
+
//*****************
//XSupportedLocales
//*****************
public Locale[] getLocales()
throws com.sun.star.uno.RuntimeException
{
- Locale aLocales[] =
+ Locale aLocales[] =
{
new Locale( "en", "US", "" )
};
return aLocales;
}
-
- public boolean hasLocale( Locale aLocale )
+
+ public boolean hasLocale( Locale aLocale )
throws com.sun.star.uno.RuntimeException
{
boolean bRes = false;
if (IsEqual( aLocale, new Locale( "en", "US", "" ) ))
bRes = true;
- return bRes;
+ return bRes;
}
-
+
//**********
//XThesaurus
//**********
- public XMeaning[] queryMeanings(
+ public XMeaning[] queryMeanings(
String aTerm, Locale aLocale,
PropertyValue[] aProperties )
throws com.sun.star.lang.IllegalArgumentException,
@@ -178,7 +178,7 @@ public class SampleThesaurus extends ComponentBase implements
{
if (IsEqual( aLocale, new Locale() ) || aTerm.length() == 0)
return null;
-
+
// linguistic is currently not allowed to throw exceptions
// thus we return null fwhich means 'word cannot be looked up'
if (!hasLocale( aLocale ))
@@ -192,39 +192,39 @@ public class SampleThesaurus extends ComponentBase implements
XMeaning[] aRes = null;
- //!! This code needs to be replaced by code calling the actual
+ //!! This code needs to be replaced by code calling the actual
//!! implementation of your thesaurus
if (aTerm.equals( "house" ) &&
IsEqual( aLocale, new Locale( "en", "US", "" ) ) )
{
aRes = new XMeaning[]
{
- new XMeaning_impl( "a building where one lives",
+ new XMeaning_impl( "a building where one lives",
new String[]{ "home", "place", "dwelling" } ),
- new XMeaning_impl( "a group of people sharing common ancestry",
+ new XMeaning_impl( "a group of people sharing common ancestry",
new String[]{ "family", "clan", "kindred" } ),
- new XMeaning_impl( "to provide with lodging",
+ new XMeaning_impl( "to provide with lodging",
new String[]{ "room", "board", "put up" } )
};
}
return aRes;
}
-
-
+
+
//********************
// XServiceDisplayName
//********************
- public String getServiceDisplayName( Locale aLocale )
+ public String getServiceDisplayName( Locale aLocale )
throws com.sun.star.uno.RuntimeException
{
- return "Java Samples";
+ return "Java Samples";
}
//****************
// XInitialization
//****************
- public void initialize( Object[] aArguments )
+ public void initialize( Object[] aArguments )
throws com.sun.star.uno.Exception,
com.sun.star.uno.RuntimeException
{
@@ -259,17 +259,17 @@ public class SampleThesaurus extends ComponentBase implements
{
return _aSvcImplName;
}
-
+
public String[] getSupportedServiceNames()
throws com.sun.star.uno.RuntimeException
{
return getSupportedServiceNames_Static();
}
-
+
// __________ static things __________
public static String _aSvcImplName = "com.sun.star.linguistic2.JavaSamples.SampleThesaurus";
-
+
public static String[] getSupportedServiceNames_Static()
{
String[] aResult = { "com.sun.star.linguistic2.Thesaurus" };
@@ -311,7 +311,7 @@ public class SampleThesaurus extends ComponentBase implements
* @param xRegKey the registryKey
* @see com.sun.star.comp.loader.JavaLoader
*/
- public static boolean __writeRegistryServiceInfo(
+ public static boolean __writeRegistryServiceInfo(
com.sun.star.registry.XRegistryKey xRegKey )
{
boolean bResult = true;
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XHyphenatedWord_impl.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XHyphenatedWord_impl.java
index 47405dd38a89..08fd7ab6dde6 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XHyphenatedWord_impl.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XHyphenatedWord_impl.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.lang.Locale;
@@ -45,10 +45,10 @@ public class XHyphenatedWord_impl implements
boolean bIsAltSpelling;
public XHyphenatedWord_impl(
- String aWord,
- Locale aLang,
+ String aWord,
+ Locale aLang,
short nHyphenationPos,
- String aHyphenatedWord,
+ String aHyphenatedWord,
short nHyphenPos )
{
this.aWord = aWord;
@@ -58,7 +58,7 @@ public class XHyphenatedWord_impl implements
this.nHyphenPos = nHyphenPos;
this.bIsAltSpelling = (aWord != aHyphenatedWord);
- //!! none of these cases should ever occur!
+ //!! none of these cases should ever occur!
//!! values provided only for safety
if (this.aWord == null)
this.aWord = new String();
@@ -67,7 +67,7 @@ public class XHyphenatedWord_impl implements
if (this.aHyphenatedWord == null)
this.aHyphenatedWord = new String();
}
-
+
// XHyphenatedWord
public String getWord() throws com.sun.star.uno.RuntimeException
@@ -86,7 +86,7 @@ public class XHyphenatedWord_impl implements
{
return aHyphenatedWord;
}
- public short getHyphenPos() throws com.sun.star.uno.RuntimeException
+ public short getHyphenPos() throws com.sun.star.uno.RuntimeException
{
return nHyphenPos;
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XMeaning_impl.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XMeaning_impl.java
index b1fc2e1ea710..29adf8f9f1a4 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XMeaning_impl.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XMeaning_impl.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.lang.Locale;
@@ -44,8 +44,8 @@ public class XMeaning_impl implements
{
this.aMeaning = aMeaning;
this.aSynonyms = aSynonyms;
-
- //!! none of these cases should ever occur!
+
+ //!! none of these cases should ever occur!
//!! values provided only for safety
if (this.aMeaning == null)
this.aMeaning = new String();
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XPossibleHyphens_impl.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XPossibleHyphens_impl.java
index dce63f8d8ec9..3756dddd4e51 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XPossibleHyphens_impl.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XPossibleHyphens_impl.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.lang.Locale;
@@ -43,7 +43,7 @@ public class XPossibleHyphens_impl implements
Locale aLang;
public XPossibleHyphens_impl(
- String aWord,
+ String aWord,
Locale aLang,
String aHyphWord,
short[] aOrigHyphenPos)
@@ -52,8 +52,8 @@ public class XPossibleHyphens_impl implements
this.aLang = aLang;
this.aHyphWord = aHyphWord;
this.aOrigHyphenPos = aOrigHyphenPos;
-
- //!! none of these cases should ever occur!
+
+ //!! none of these cases should ever occur!
//!! values provided only for safety
if (this.aWord == null)
this.aWord = new String();
@@ -67,7 +67,7 @@ public class XPossibleHyphens_impl implements
if (this.aOrigHyphenPos == null)
this.aOrigHyphenPos = new short[]{};
}
-
+
// XPossibleHyphens
public String getWord() throws com.sun.star.uno.RuntimeException
{
@@ -78,9 +78,9 @@ public class XPossibleHyphens_impl implements
{
return aLang;
}
- public String getPossibleHyphens() throws com.sun.star.uno.RuntimeException
+ public String getPossibleHyphens() throws com.sun.star.uno.RuntimeException
{
- return aHyphWord;
+ return aHyphWord;
}
public short[] getHyphenationPositions() throws com.sun.star.uno.RuntimeException
{
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XSpellAlternatives_impl.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XSpellAlternatives_impl.java
index 0c3cdd0bf89e..15e6c17ccb80 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XSpellAlternatives_impl.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/XSpellAlternatives_impl.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.lang.Locale;
@@ -43,24 +43,24 @@ public class XSpellAlternatives_impl implements
String[] aAlt; // list of alternatives, may be empty.
short nType; // type of failure
- public XSpellAlternatives_impl(
- String aWord,
- Locale aLanguage,
- short nFailureType,
+ public XSpellAlternatives_impl(
+ String aWord,
+ Locale aLanguage,
+ short nFailureType,
String[] aAlt )
{
this.aWord = aWord;
this.aLanguage = aLanguage;
this.aAlt = aAlt;
this.nType = nFailureType;
-
- //!! none of these cases should ever occur!
+
+ //!! none of these cases should ever occur!
//!! values provided only for safety
if (this.aWord == null)
this.aWord = new String();
if (this.aLanguage == null)
this.aLanguage = new Locale();
-
+
// having no alternatives is OK though.
// still for safety an empty existing array has to be provided.
if (this.aAlt == null)
diff --git a/odk/examples/DevelopersGuide/OfficeDev/MenuElement.java b/odk/examples/DevelopersGuide/OfficeDev/MenuElement.java
index 71ec62d69098..bf6c6ce419b2 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/MenuElement.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/MenuElement.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.lang.XServiceInfo;
@@ -45,7 +45,7 @@ public class MenuElement
return xServiceInfo.supportsService( "com.sun.star.ui.ActionTrigger" );
}
-
+
static public boolean IsMenuSeparator( com.sun.star.beans.XPropertySet xMenuElement ) {
com.sun.star.lang.XServiceInfo xServiceInfo =
(com.sun.star.lang.XServiceInfo)UnoRuntime.queryInterface(
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java b/odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java
index de05e4caa2f1..9ea9174e02a8 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// __________ Imports __________
diff --git a/odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java b/odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java
index 7f0bd79b99e4..6d4745b97412 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/OfficeConnect.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
// __________ Imports __________
@@ -175,7 +175,7 @@ public class OfficeConnect
*/
// singleton connection instance
private static OfficeConnect maConnection;
-
+
// reference to remote office context
private com.sun.star.uno.XComponentContext mxOfficeContext;
// reference to remote service manager
diff --git a/odk/examples/DevelopersGuide/OfficeDev/PathSettings/PathSettingsTest.java b/odk/examples/DevelopersGuide/OfficeDev/PathSettings/PathSettingsTest.java
index 9aaeadc74f79..44d0a2c9c094 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/PathSettings/PathSettingsTest.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/PathSettings/PathSettingsTest.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.uno.UnoRuntime;
@@ -46,7 +46,7 @@ import com.sun.star.beans.UnknownPropertyException;
* path pathsettings servce.
*/
public class PathSettingsTest extends java.lang.Object {
-
+
/*
* List of pre-defined path variables supported by
* the path settings service.
@@ -77,28 +77,28 @@ public class PathSettingsTest extends java.lang.Object {
"UserDictionary",
"Work"
};
-
+
/*
* @param args the command line arguments
*/
public static void main(String[] args) {
-
+
XComponentContext xRemoteContext = null;
XMultiComponentFactory xRemoteServiceManager = null;
XPropertySet xPathSettingsService = null;
-
+
try {
// get the remote office context. If necessary a new office
// process is started
xRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
System.out.println("Connected to a running office ...");
xRemoteServiceManager = xRemoteContext.getServiceManager();
-
+
Object pathSubst = xRemoteServiceManager.createInstanceWithContext(
"com.sun.star.comp.framework.PathSettings", xRemoteContext );
xPathSettingsService = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, pathSubst);
-
+
/* Work with path settings */
workWithPathSettings( xPathSettingsService );
}
@@ -120,12 +120,12 @@ public class PathSettingsTest extends java.lang.Object {
for ( int i=0; i<predefinedPathProperties.length; i++ ) {
try {
/* Retrieve values for path properties from path settings
- * service*/
- Object aValue = xPathSettingsService.getPropertyValue(
+ * service*/
+ Object aValue = xPathSettingsService.getPropertyValue(
predefinedPathProperties[i] );
-
+
// getPropertyValue returns an Object, you have to cast
- // it to type that you need
+ // it to type that you need
String aPath = (String)aValue;
System.out.println( "Property="+ predefinedPathProperties[i]
+ " Path=" + aPath );
@@ -137,11 +137,11 @@ public class PathSettingsTest extends java.lang.Object {
System.err.println( "WrappedTargetException has been thrown accessing "+predefinedPathProperties[i]);
}
}
-
+
// Try to modfiy the work path property. After running this example
- // you should see the new value of "My Documents" in the path options
+ // you should see the new value of "My Documents" in the path options
// tab page, accessible via "Tools - Options - [Star|Open]Office -
- // Paths".
+ // Paths".
// If you want to revert the changes, you can also do it with the
// path tab page.
try {
diff --git a/odk/examples/DevelopersGuide/OfficeDev/PathSubstitution/PathSubstitutionTest.java b/odk/examples/DevelopersGuide/OfficeDev/PathSubstitution/PathSubstitutionTest.java
index 26faedd97da9..5aad6fa07b8a 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/PathSubstitution/PathSubstitutionTest.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/PathSubstitution/PathSubstitutionTest.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.uno.UnoRuntime;
@@ -44,7 +44,7 @@ import com.sun.star.util.XStringSubstitution;
* @author Carsten Driesner
*/
public class PathSubstitutionTest extends java.lang.Object {
-
+
/*
* List of pre-defined path variables supported by
* the path substitution service.
@@ -53,28 +53,28 @@ public class PathSubstitutionTest extends java.lang.Object {
"$(home)","$(inst)","$(prog)","$(temp)","$(user)",
"$(work)","$(path)","$(lang)","$(langid)","$(vlang)"
};
-
+
/*
* @param args the command line arguments
*/
public static void main(String[] args) {
-
+
XComponentContext xRemoteContext = null;
XMultiComponentFactory xRemoteServiceManager = null;
XStringSubstitution xPathSubstService = null;
-
+
try {
// get the remote office context. If necessary a new office
// process is started
xRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
System.out.println("Connected to a running office ...");
xRemoteServiceManager = xRemoteContext.getServiceManager();
-
+
Object pathSubst = xRemoteServiceManager.createInstanceWithContext(
"com.sun.star.comp.framework.PathSubstitution", xRemoteContext );
xPathSubstService = (XStringSubstitution)UnoRuntime.queryInterface(
XStringSubstitution.class, pathSubst);
-
+
/* Work with path variables */
workWithPathVariables( xPathSubstService );
}
@@ -91,22 +91,22 @@ public class PathSubstitutionTest extends java.lang.Object {
if ( xPathSubstService != null ) {
for ( int i=0; i<predefinedPathVariables.length; i++ ) {
try {
- /* Retrieve values for pre-defined path variables */
- String aValue = xPathSubstService.getSubstituteVariableValue(
+ /* Retrieve values for pre-defined path variables */
+ String aValue = xPathSubstService.getSubstituteVariableValue(
predefinedPathVariables[i] );
- System.out.println( "Variable: "+ predefinedPathVariables[i] +
+ System.out.println( "Variable: "+ predefinedPathVariables[i] +
" value=" + aValue );
}
catch ( com.sun.star.container.NoSuchElementException e) {
System.err.println( "NoSuchElementException has been thrown accessing "+predefinedPathVariables[i]);
}
}
-
+
// Check the resubstitution function
try {
String aPath = xPathSubstService.getSubstituteVariableValue(
predefinedPathVariables[0] ); // Use $(home) as starting point
- aPath += "/test"; // extend the path
+ aPath += "/test"; // extend the path
System.out.println( "Path="+aPath );
String aResubstPath = xPathSubstService.reSubstituteVariables( aPath );
System.out.println( "Resubstituted path="+aResubstPath );
diff --git a/odk/examples/DevelopersGuide/OfficeDev/TerminationTest/TerminateListener.java b/odk/examples/DevelopersGuide/OfficeDev/TerminationTest/TerminateListener.java
index 65343e967c69..b04e95c582b1 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/TerminationTest/TerminateListener.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/TerminationTest/TerminateListener.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.frame.TerminationVetoException;
@@ -45,9 +45,9 @@ public class TerminateListener implements XTerminateListener {
System.out.println("about to terminate...");
}
- public void queryTermination(com.sun.star.lang.EventObject eventObject)
+ public void queryTermination(com.sun.star.lang.EventObject eventObject)
throws TerminationVetoException {
-
+
// test if we can terminate now
if (TerminationTest.isAtWork() == true) {
System.out.println("Terminate while we are at work? You can't mean it serious ;-)!");
@@ -56,5 +56,5 @@ public class TerminateListener implements XTerminateListener {
}
public void disposing(com.sun.star.lang.EventObject eventObject) {
- }
+ }
}
diff --git a/odk/examples/DevelopersGuide/OfficeDev/TerminationTest/TerminationTest.java b/odk/examples/DevelopersGuide/OfficeDev/TerminationTest/TerminationTest.java
index 8c0a0c556cbe..0df7b6b2c515 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/TerminationTest/TerminationTest.java
+++ b/odk/examples/DevelopersGuide/OfficeDev/TerminationTest/TerminationTest.java
@@ -2,7 +2,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -29,7 +29,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
import com.sun.star.uno.UnoRuntime;
@@ -42,7 +42,7 @@ import com.sun.star.frame.XDesktop;
* @author dschulten
*/
public class TerminationTest extends java.lang.Object {
-
+
private static boolean atWork = false;
/**
* @param args the command line arguments
@@ -52,8 +52,8 @@ public class TerminationTest extends java.lang.Object {
XComponentContext xRemoteContext = null;
XMultiComponentFactory xRemoteServiceManager = null;
XDesktop xDesktop = null;
-
- try {
+
+ try {
// get the remote office context. If necessary a new office
// process is started
xRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
@@ -63,26 +63,26 @@ public class TerminationTest extends java.lang.Object {
Object desktop = xRemoteServiceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", xRemoteContext);
xDesktop = (XDesktop)UnoRuntime.queryInterface(XDesktop.class, desktop);
-
+
TerminateListener terminateListener = new TerminateListener();
xDesktop.addTerminateListener(terminateListener);
-
+
atWork = true;
// try to terminate while we are at work
boolean terminated = xDesktop.terminate();
System.out.println("The Office " +
- (terminated == true ?
- "has been terminated" :
+ (terminated == true ?
+ "has been terminated" :
"is still running, we are at work"));
-
+
// no longer at work
atWork = false;
- // once more: try to terminate
+ // once more: try to terminate
terminated = xDesktop.terminate();
- System.out.println("The Office " +
+ System.out.println("The Office " +
(terminated == true ?
"has been terminated" :
- "is still running. Someone else prevents termination, " +
+ "is still running. Someone else prevents termination, " +
"e.g. the quickstarter"));
}
catch (java.lang.Exception e){
@@ -91,8 +91,8 @@ public class TerminationTest extends java.lang.Object {
finally {
System.exit(0);
}
-
-
+
+
}
public static boolean isAtWork() {
return atWork;