summaryrefslogtreecommitdiff
path: root/odk
diff options
context:
space:
mode:
Diffstat (limited to 'odk')
-rwxr-xr-xodk/configure.pl126
-rw-r--r--odk/examples/DevelopersGuide/Accessibility/ConnectionTask.java12
-rw-r--r--odk/examples/DevelopersGuide/Accessibility/EventHandler.java44
-rw-r--r--odk/examples/DevelopersGuide/Accessibility/EventListenerProxy.java20
-rw-r--r--odk/examples/DevelopersGuide/Accessibility/GraphicalDisplay.java8
-rw-r--r--odk/examples/DevelopersGuide/Accessibility/IAccessibleObjectDisplay.java4
-rw-r--r--odk/examples/DevelopersGuide/Accessibility/MessageArea.java6
-rw-r--r--odk/examples/DevelopersGuide/Accessibility/NameProvider.java6
-rw-r--r--odk/examples/DevelopersGuide/Accessibility/RegistrationThread.java16
-rw-r--r--odk/examples/DevelopersGuide/Accessibility/SSR.java14
-rw-r--r--odk/examples/DevelopersGuide/Accessibility/TextualDisplay.java20
-rw-r--r--odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java68
-rw-r--r--odk/examples/DevelopersGuide/Charts/CalcHelper.java16
-rw-r--r--odk/examples/DevelopersGuide/Charts/ChartHelper.java20
-rw-r--r--odk/examples/DevelopersGuide/Charts/ChartInCalc.java12
-rw-r--r--odk/examples/DevelopersGuide/Charts/ChartInDraw.java12
-rw-r--r--odk/examples/DevelopersGuide/Charts/ChartInWriter.java6
-rw-r--r--odk/examples/DevelopersGuide/Charts/Helper.java12
-rw-r--r--odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java10
-rw-r--r--odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java8
-rw-r--r--odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java64
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Addons.xcu46
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx4
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.hxx6
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx22
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java64
-rw-r--r--odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.cxx6
-rw-r--r--odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx8
-rw-r--r--odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx10
-rw-r--r--odk/examples/DevelopersGuide/Components/CppComponent/some.idl6
-rw-r--r--odk/examples/DevelopersGuide/Components/JavaComponent/SomethingA.idl16
-rw-r--r--odk/examples/DevelopersGuide/Components/JavaComponent/SomethingB.idl16
-rw-r--r--odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentA.java10
-rw-r--r--odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.java10
-rw-r--r--odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java44
-rw-r--r--odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java10
-rw-r--r--odk/examples/DevelopersGuide/Components/JavaComponent/XSomethingA.idl22
-rw-r--r--odk/examples/DevelopersGuide/Components/JavaComponent/XSomethingB.idl22
-rw-r--r--odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.idl18
-rw-r--r--odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java28
-rw-r--r--odk/examples/DevelopersGuide/Components/SimpleLicense/description.xml2
-rw-r--r--odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java48
-rw-r--r--odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Thumbs.java14
-rw-r--r--odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/ImageShrink.idl4
-rw-r--r--odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/XImageShrink.idl6
-rw-r--r--odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/XImageShrinkFilter.idl4
-rw-r--r--odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java50
-rw-r--r--odk/examples/DevelopersGuide/Components/dialogcomponent/TestDialogHandler.idl8
-rw-r--r--odk/examples/DevelopersGuide/Components/dialogcomponent/XTestDialogHandler.idl22
-rw-r--r--odk/examples/DevelopersGuide/Config/ConfigExamples.java238
-rw-r--r--odk/examples/DevelopersGuide/Database/CodeSamples.java28
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.hxx80
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/OTypeInfo.hxx48
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx96
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.hxx44
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.cxx52
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.hxx8
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx20
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.hxx10
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.cxx62
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.hxx28
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx142
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.hxx26
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.cxx4
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.hxx10
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx38
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.cxx40
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.hxx24
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.cxx216
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.hxx128
-rw-r--r--odk/examples/DevelopersGuide/Database/OpenQuery.java28
-rw-r--r--odk/examples/DevelopersGuide/Database/RowSet.java10
-rw-r--r--odk/examples/DevelopersGuide/Database/RowSetEventListener.java4
-rw-r--r--odk/examples/DevelopersGuide/Database/Sales.java34
-rw-r--r--odk/examples/DevelopersGuide/Database/SalesMan.java44
-rw-r--r--odk/examples/DevelopersGuide/Database/sdbcx.java36
-rw-r--r--odk/examples/DevelopersGuide/Drawing/ChangeOrderDemo.java10
-rw-r--r--odk/examples/DevelopersGuide/Drawing/ControlAndSelectDemo.java6
-rw-r--r--odk/examples/DevelopersGuide/Drawing/CustomShowDemo.java14
-rw-r--r--odk/examples/DevelopersGuide/Drawing/DrawViewDemo.java22
-rw-r--r--odk/examples/DevelopersGuide/Drawing/DrawingDemo.java30
-rw-r--r--odk/examples/DevelopersGuide/Drawing/FillAndLineStyleDemo.java14
-rw-r--r--odk/examples/DevelopersGuide/Drawing/GluePointDemo.java18
-rw-r--r--odk/examples/DevelopersGuide/Drawing/GraphicExportDemo.java36
-rw-r--r--odk/examples/DevelopersGuide/Drawing/Helper.java8
-rw-r--r--odk/examples/DevelopersGuide/Drawing/LayerDemo.java10
-rw-r--r--odk/examples/DevelopersGuide/Drawing/ObjectTransformationDemo.java10
-rw-r--r--odk/examples/DevelopersGuide/Drawing/Organigram.java42
-rw-r--r--odk/examples/DevelopersGuide/Drawing/PageHelper.java12
-rw-r--r--odk/examples/DevelopersGuide/Drawing/PresentationDemo.java18
-rw-r--r--odk/examples/DevelopersGuide/Drawing/ShapeHelper.java6
-rw-r--r--odk/examples/DevelopersGuide/Drawing/StyleDemo.java8
-rw-r--r--odk/examples/DevelopersGuide/Drawing/TextDemo.java10
-rw-r--r--odk/examples/DevelopersGuide/FirstSteps/FirstConnection.java6
-rw-r--r--odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java80
-rw-r--r--odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.java4
-rw-r--r--odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java12
-rw-r--r--odk/examples/DevelopersGuide/FirstSteps/build_FirstUnoContact.xml14
-rw-r--r--odk/examples/DevelopersGuide/Forms/ButtonOperator.java10
-rw-r--r--odk/examples/DevelopersGuide/Forms/ComponentTreeTraversal.java14
-rw-r--r--odk/examples/DevelopersGuide/Forms/ControlLock.java24
-rw-r--r--odk/examples/DevelopersGuide/Forms/ControlValidation.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/ControlValidator.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/DataAwareness.java48
-rw-r--r--odk/examples/DevelopersGuide/Forms/DateValidator.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java6
-rw-r--r--odk/examples/DevelopersGuide/Forms/DocumentHelper.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/DocumentType.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java6
-rw-r--r--odk/examples/DevelopersGuide/Forms/FLTools.java34
-rw-r--r--odk/examples/DevelopersGuide/Forms/FormLayer.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/GridFieldValidator.java12
-rw-r--r--odk/examples/DevelopersGuide/Forms/HsqlDatabase.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/InteractionRequest.java8
-rw-r--r--odk/examples/DevelopersGuide/Forms/KeyGenerator.java24
-rw-r--r--odk/examples/DevelopersGuide/Forms/ListSelectionValidator.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/NumericValidator.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/RowSet.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/SalesFilter.java38
-rw-r--r--odk/examples/DevelopersGuide/Forms/SingleControlValidation.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/SpreadsheetView.java4
-rw-r--r--odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/TextValidator.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/TimeValidator.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/UNO.java6
-rw-r--r--odk/examples/DevelopersGuide/Forms/URLHelper.java12
-rw-r--r--odk/examples/DevelopersGuide/Forms/ValueBinding.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/WaitForInput.java6
-rw-r--r--odk/examples/DevelopersGuide/GUI/DialogDocument.java22
-rw-r--r--odk/examples/DevelopersGuide/GUI/ImageControlSample.java18
-rw-r--r--odk/examples/DevelopersGuide/GUI/MessageBox.java56
-rw-r--r--odk/examples/DevelopersGuide/GUI/RoadmapItemStateChangeListener.java6
-rw-r--r--odk/examples/DevelopersGuide/GUI/SystemDialog.java34
-rw-r--r--odk/examples/DevelopersGuide/GUI/UnoDialogSample.java414
-rw-r--r--odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java62
-rw-r--r--odk/examples/DevelopersGuide/GUI/UnoMenu.java18
-rw-r--r--odk/examples/DevelopersGuide/GUI/UnoMenu2.java14
-rw-r--r--odk/examples/DevelopersGuide/OfficeBean/OOoBeanViewer.java56
-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
-rw-r--r--odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.cxx16
-rw-r--r--odk/examples/DevelopersGuide/ProfUNO/CppBinding/string_samples.cxx10
-rw-r--r--odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/ConnectionAwareClient.java30
-rw-r--r--odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/UrlResolver.java10
-rw-r--r--odk/examples/DevelopersGuide/ProfUNO/Lifetime/MyUnoObject.java14
-rw-r--r--odk/examples/DevelopersGuide/ProfUNO/Lifetime/object_lifetime.cxx4
-rw-r--r--odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_cpp/SimpleBootstrap_cpp.cxx10
-rw-r--r--odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_java/SimpleBootstrap_java.java12
-rw-r--r--odk/examples/DevelopersGuide/ScriptingFramework/SayHello/SayHello/SayHello.java2
-rwxr-xr-xodk/examples/DevelopersGuide/ScriptingFramework/SayHello/build.xml6
-rw-r--r--odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/ScriptSelector/ScriptSelector.java16
-rwxr-xr-xodk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/build.xml6
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java10
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java12
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/GeneralTableSample.java4
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.java8
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java2
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/ViewSample.java8
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/XExampleAddIn.idl10
-rw-r--r--odk/examples/DevelopersGuide/Text/TextDocuments.java588
-rw-r--r--odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java4
-rw-r--r--odk/examples/DevelopersGuide/UCB/DataStreamComposer.java6
-rw-r--r--odk/examples/DevelopersGuide/UCB/DataStreamRetriever.java4
-rw-r--r--odk/examples/DevelopersGuide/UCB/Helper.java14
-rw-r--r--odk/examples/DevelopersGuide/UCB/MyActiveDataSink.java22
-rw-r--r--odk/examples/DevelopersGuide/UCB/MyInputStream.java8
-rw-r--r--odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java4
-rw-r--r--odk/examples/DevelopersGuide/UCB/ResourceRemover.java4
-rw-r--r--odk/examples/OLE/activex/SOActiveX.cpp146
-rw-r--r--odk/examples/OLE/activex/SOActiveX.h52
-rw-r--r--odk/examples/OLE/activex/SOComWindowPeer.cpp6
-rw-r--r--odk/examples/OLE/activex/SOComWindowPeer.h50
-rw-r--r--odk/examples/OLE/activex/StdAfx2.cpp4
-rw-r--r--odk/examples/OLE/activex/StdAfx2.h4
-rw-r--r--odk/examples/OLE/activex/resource.h6
-rw-r--r--odk/examples/OLE/activex/so_activex.cpp6
-rw-r--r--odk/examples/OLE/activex/so_activex.idl24
-rw-r--r--odk/examples/cpp/DocumentLoader/DocumentLoader.cxx28
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/CalcListener.cxx2
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/ListenerHelper.cxx32
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/ListenerHelper.h2
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/MyJob.cxx2
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/MyListener.cxx2
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx64
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.h8
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/WriterListener.cxx2
-rw-r--r--odk/examples/cpp/complextoolbarcontrols/exports.cxx2
-rw-r--r--odk/examples/cpp/counter/XCountable.idl6
-rw-r--r--odk/examples/cpp/counter/counter.cxx46
-rw-r--r--odk/examples/cpp/counter/countermain.cxx16
-rw-r--r--odk/examples/cpp/remoteclient/remoteclient.cxx22
-rw-r--r--odk/examples/java/ConverterServlet/ConverterServlet.java102
-rw-r--r--odk/examples/java/DocumentHandling/DocumentConverter.java58
-rw-r--r--odk/examples/java/DocumentHandling/DocumentLoader.java16
-rw-r--r--odk/examples/java/DocumentHandling/DocumentPrinter.java22
-rw-r--r--odk/examples/java/DocumentHandling/DocumentSaver.java16
-rw-r--r--odk/examples/java/Drawing/SDraw.java110
-rw-r--r--odk/examples/java/EmbedDocument/Container1/EmbedContApp.java84
-rw-r--r--odk/examples/java/EmbedDocument/Container1/EmbedContFrame.java16
-rwxr-xr-xodk/examples/java/EmbedDocument/EmbeddedObject/EditorFrame.java20
-rwxr-xr-xodk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java38
-rwxr-xr-xodk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java2
-rwxr-xr-xodk/examples/java/Inspector/Addons.xcu2
-rw-r--r--odk/examples/java/Inspector/HideableMutableTreeNode.java50
-rw-r--r--odk/examples/java/Inspector/HideableTreeModel.java72
-rw-r--r--odk/examples/java/Inspector/Inspector.java132
-rw-r--r--odk/examples/java/Inspector/InspectorAddon.java54
-rw-r--r--odk/examples/java/Inspector/InspectorPane.java172
-rw-r--r--odk/examples/java/Inspector/InstanceInspector.idl14
-rw-r--r--odk/examples/java/Inspector/Introspector.java186
-rw-r--r--odk/examples/java/Inspector/MethodParametersDialog.java86
-rwxr-xr-xodk/examples/java/Inspector/ObjectInspector.xcu4
-rw-r--r--odk/examples/java/Inspector/ProtocolHandlerAddon.java64
-rw-r--r--odk/examples/java/Inspector/SourceCodeGenerator.java620
-rw-r--r--odk/examples/java/Inspector/SwingDialogProvider.java158
-rw-r--r--odk/examples/java/Inspector/SwingTreeControlProvider.java150
-rw-r--r--odk/examples/java/Inspector/SwingTreePathProvider.java22
-rw-r--r--odk/examples/java/Inspector/SwingUnoFacetteNode.java20
-rw-r--r--odk/examples/java/Inspector/SwingUnoMethodNode.java42
-rw-r--r--odk/examples/java/Inspector/SwingUnoNode.java52
-rw-r--r--odk/examples/java/Inspector/SwingUnoPropertyNode.java40
-rw-r--r--odk/examples/java/Inspector/TDocSupplier.java54
-rw-r--r--odk/examples/java/Inspector/TestInspector.java16
-rw-r--r--odk/examples/java/Inspector/UnoFacetteNode.java22
-rw-r--r--odk/examples/java/Inspector/UnoMethodNode.java66
-rw-r--r--odk/examples/java/Inspector/UnoNode.java132
-rw-r--r--odk/examples/java/Inspector/UnoPropertyNode.java74
-rw-r--r--odk/examples/java/Inspector/UnoTreeRenderer.java18
-rw-r--r--odk/examples/java/Inspector/XDialogProvider.java32
-rw-r--r--odk/examples/java/Inspector/XInstanceInspector.idl18
-rw-r--r--odk/examples/java/Inspector/XLanguageSourceCodeGenerator.java54
-rw-r--r--odk/examples/java/Inspector/XMethodParametersDialog.java6
-rw-r--r--odk/examples/java/Inspector/XTreeControlProvider.java50
-rw-r--r--odk/examples/java/Inspector/XTreePathProvider.java14
-rw-r--r--odk/examples/java/Inspector/XUnoFacetteNode.java22
-rw-r--r--odk/examples/java/Inspector/XUnoMethodNode.java32
-rw-r--r--odk/examples/java/Inspector/XUnoNode.java40
-rw-r--r--odk/examples/java/Inspector/XUnoPropertyNode.java12
-rw-r--r--odk/examples/java/MinimalComponent/BuildMinimalComponent.xml2
-rw-r--r--odk/examples/java/MinimalComponent/MinimalComponent.idl16
-rw-r--r--odk/examples/java/MinimalComponent/MinimalComponent.java28
-rw-r--r--odk/examples/java/MinimalComponent/TestMinimalComponent.java14
-rw-r--r--odk/examples/java/NotesAccess/NotesAccess.java92
-rw-r--r--odk/examples/java/PropertySet/PropTest.java22
-rw-r--r--odk/examples/java/Spreadsheet/CalcAddins.java78
-rw-r--r--odk/examples/java/Spreadsheet/ChartTypeChange.java98
-rw-r--r--odk/examples/java/Spreadsheet/EuroAdaption.java128
-rw-r--r--odk/examples/java/Spreadsheet/SCalc.java122
-rw-r--r--odk/examples/java/Spreadsheet/XCalcAddins.idl6
-rw-r--r--odk/examples/java/Storage/StorageFunctionality.java30
-rw-r--r--odk/examples/java/Storage/Test01.java12
-rw-r--r--odk/examples/java/Storage/Test02.java12
-rw-r--r--odk/examples/java/Storage/Test03.java14
-rw-r--r--odk/examples/java/Storage/Test04.java18
-rw-r--r--odk/examples/java/Storage/Test05.java14
-rw-r--r--odk/examples/java/Storage/Test06.java4
-rw-r--r--odk/examples/java/Storage/Test07.java6
-rw-r--r--odk/examples/java/Storage/Test08.java18
-rw-r--r--odk/examples/java/Storage/Test09.java8
-rw-r--r--odk/examples/java/Storage/TestHelper.java36
-rw-r--r--odk/examples/java/Text/BookmarkInsertion.java106
-rw-r--r--odk/examples/java/Text/GraphicsInserter.java50
-rw-r--r--odk/examples/java/Text/HardFormatting.java102
-rw-r--r--odk/examples/java/Text/SWriter.java200
-rw-r--r--odk/examples/java/Text/StyleCreation.java76
-rw-r--r--odk/examples/java/Text/StyleInitialization.java116
-rw-r--r--odk/examples/java/Text/TextDocumentStructure.java54
-rw-r--r--odk/examples/java/Text/TextReplace.java82
-rw-r--r--odk/examples/java/Text/WriterSelector.java40
-rw-r--r--odk/examples/java/ToDo/ToDo.idl4
-rw-r--r--odk/examples/java/ToDo/ToDo.java262
-rw-r--r--odk/examples/java/ToDo/XToDo.idl10
-rw-r--r--odk/inc/pch/precompiled_odk.cxx2
-rw-r--r--odk/inc/pch/precompiled_odk.hxx2
-rw-r--r--odk/source/com/sun/star/lib/loader/InstallationFinder.java154
-rw-r--r--odk/source/com/sun/star/lib/loader/Loader.java42
-rw-r--r--odk/source/com/sun/star/lib/loader/WinRegKey.java54
-rw-r--r--odk/source/com/sun/star/lib/loader/WinRegKeyException.java6
-rw-r--r--odk/source/unoapploader/unx/unoapploader.c28
-rw-r--r--odk/source/unoapploader/win/unoapploader.c28
-rw-r--r--odk/source/unowinreg/win/unowinreg.cxx48
-rw-r--r--odk/util/check.pl12
-rw-r--r--odk/util/checkdiff.pl2
334 files changed, 5973 insertions, 5973 deletions
diff --git a/odk/configure.pl b/odk/configure.pl
index c03fe0081c17..d102e6f031a2 100755
--- a/odk/configure.pl
+++ b/odk/configure.pl
@@ -37,7 +37,7 @@ chomp($main::OO_SDK_URE_HOME);
$main::OO_SDK_MAKE_HOME = "";
$main::makeName = "make";
-if ( $main::operatingSystem =~ m/solaris/ ||
+if ( $main::operatingSystem =~ m/solaris/ ||
$main::operatingSystem =~ m/freebsd/ )
{
$main::makeName = "gmake";
@@ -84,9 +84,9 @@ if ( $main::OFFICE_OR_URE eq "Office" )
if ( $main::operatingSystem =~ m/darwin/ )
{
# used for a SDK as part of the office installation
-# $main::OFFICE_HOME = `cd $main::sdkpath/../../.. && pwd`;
-# chomp($main::OFFICE_HOME);
-# print " Used Office = $main::OFFICE_HOME\n";
+# $main::OFFICE_HOME = `cd $main::sdkpath/../../.. && pwd`;
+# chomp($main::OFFICE_HOME);
+# print " Used Office = $main::OFFICE_HOME\n";
print " Used SDK = $main::OO_SDK_HOME\n\n";
$main::OFFICE_HOME_SUGGESTION = searchMacOffice();
@@ -96,16 +96,16 @@ if ( $main::OFFICE_OR_URE eq "Office" )
print " Enter the Office installation directory [$main::OFFICE_HOME_SUGGESTION]: ";
$main::OFFICE_HOME = readStdIn();
chop($main::OFFICE_HOME);
- if ( $main::OFFICE_HOME eq "" )
+ if ( $main::OFFICE_HOME eq "" )
{
$main::OFFICE_HOME = $main::OFFICE_HOME_SUGGESTION;
}
-
+
if ( ! -d "$main::OFFICE_HOME" )
- {
+ {
$main::OFFICE_HOME = "";
print " Error: An office installation is required, please specify the path to a valid installation.\n";
- }
+ }
# check more details
if ( -d "$main::OFFICE_HOME/Contents/basis-link" ) {
@@ -125,7 +125,7 @@ if ( $main::OFFICE_OR_URE eq "Office" )
print " Error: no base layer found in office installation, please specify the path to a valid installation.\n";
}
}
- } else
+ } else
{
$main::OFFICE_HOME_SUGGESTION = searchoffice();
@@ -137,17 +137,17 @@ if ( $main::OFFICE_OR_URE eq "Office" )
if ( ! $main::OFFICE_HOME_SUGGESTION eq "" )
{
my $tmpOffice = readlink "$main::OFFICE_HOME_SUGGESTION/soffice";
-
+
if ( $tmpOffice eq "" )
{
$tmpOffice = "$main::OFFICE_HOME_SUGGESTION/soffice";
}
-
+
my $offset = rindex($tmpOffice, "/program/soffice");
if ( $offset != -1 )
{
$main::OFFICE_HOME_SUGGESTION = substr($tmpOffice, 0, $offset);
- } else
+ } else
{
$offset = rindex($tmpOffice, "/soffice");
if ( $offset != -1 )
@@ -159,35 +159,35 @@ if ( $main::OFFICE_OR_URE eq "Office" )
}
}
}
-
+
while ( (! -d "$main::OFFICE_HOME" ) ||
((-d "$main::OFFICE_HOME") && (! -d "$main::OFFICE_HOME/program")) )
{
print " Enter the Office installation directory [$main::OFFICE_HOME_SUGGESTION]: ";
$main::OFFICE_HOME = readStdIn();
chop($main::OFFICE_HOME);
- if ( $main::OFFICE_HOME eq "" )
+ if ( $main::OFFICE_HOME eq "" )
{
$main::OFFICE_HOME = $main::OFFICE_HOME_SUGGESTION;
}
-
+
if ( ! -d "$main::OFFICE_HOME" )
- {
+ {
$main::OFFICE_HOME = "";
print " Error: An office installation is required, please specify the path to a valid installation.\n";
} else
{
# special work for a network installation, no prgram directory but a link to the soffice binary
if ( (! -d "$main::OFFICE_HOME/program") && (-e "$main::OFFICE_HOME/soffice") )
- {
+ {
my $soserver = `ls -l $OFFICE_HOME_SUGGESTION/soffice | sed -n 's/.* -> //p'`;
$soserver= substr($soserver, 0, rindex($soserver, "program") - 1);
-
+
if ( ! -d $soserver )
{
$main::OFFICE_HOME = "";
print " Error: An office installation is required, please specify the path to a valid installation.\n";
- } else
+ } else
{
$main::OFFICE_HOME = $soserver;
}
@@ -224,16 +224,16 @@ while ( (!$main::correctVersion) &&
print " Enter GNU make ($main::makeVersion or higher) tools directory [$main::OO_SDK_MAKE_HOME_SUGGESTION]: ";
$main::OO_SDK_MAKE_HOME = readStdIn();
chop($main::OO_SDK_MAKE_HOME);
- if ( $main::OO_SDK_MAKE_HOME eq "" )
+ if ( $main::OO_SDK_MAKE_HOME eq "" )
{
$main::OO_SDK_MAKE_HOME = $main::OO_SDK_MAKE_HOME_SUGGESTION;
}
- if ( (! -d "$main::OO_SDK_MAKE_HOME") ||
+ if ( (! -d "$main::OO_SDK_MAKE_HOME") ||
((-d "$main::OO_SDK_MAKE_HOME") && (! -e "$main::OO_SDK_MAKE_HOME/$main::makeName")) )
- {
+ {
$main::OO_SDK_MAKE_HOME = "";
print " Error: GNU make is required, please specify a GNU make tools directory.\n";
- } else
+ } else
{
#check version
my $testVersion = `$OO_SDK_MAKE_HOME/$main::makeName --version`;
@@ -241,7 +241,7 @@ while ( (!$main::correctVersion) &&
{
print " Set the environment variable OO_SDK_MAKE_HOME to your GNU build tools directory.\n";
print " GNU make version $main::makeVersion can be obtained at ftp://ftp.gnu.org/gnu/make/\n";
- } else
+ } else
{
if ($testVersion =~ m#((\d+\.)+\d+)# )
{
@@ -266,16 +266,16 @@ while ( (!$main::correctVersion) &&
print " Enter zip ($main::zipVersion or higher) tool directory [$main::OO_SDK_ZIP_HOME_SUGGESTION]: ";
$main::OO_SDK_ZIP_HOME = readStdIn();
chop($main::OO_SDK_ZIP_HOME);
- if ( $main::OO_SDK_ZIP_HOME eq "" )
+ if ( $main::OO_SDK_ZIP_HOME eq "" )
{
$main::OO_SDK_ZIP_HOME = $main::OO_SDK_ZIP_HOME_SUGGESTION;
}
- if ( (! -d "$main::OO_SDK_ZIP_HOME") ||
+ if ( (! -d "$main::OO_SDK_ZIP_HOME") ||
((-d "$main::OO_SDK_ZIP_HOME") && (! -e "$main::OO_SDK_ZIP_HOME/zip")) )
- {
+ {
$main::OO_SDK_ZIP_HOME = "";
print " Error: zip tool is required, please specify a zip tool directory.\n";
- } else
+ } else
{
#check version
my $testVersion = `$OO_SDK_ZIP_HOME/zip -h 2>&1 | egrep Zip | head -n 1`;
@@ -284,7 +284,7 @@ while ( (!$main::correctVersion) &&
{
print " Set the environment variable OO_SDK_ZIP_HOME to your zip tool directory.\n";
print " zip version $main::zipVersion can be obtained at ftp://www.info-zip.org/\n";
- } else
+ } else
{
if ($testVersion =~ m#((\d+\.)+\d+)# )
{
@@ -312,26 +312,26 @@ while ( (!$main::correctVersion) &&
print " - MacOS, GNU C++ compiler, gcc version 4.0.1 or higher\n";
print " Enter the directory of the C++ compiler, the directory\n";
print " where the compiler is located (optional) [$main::OO_SDK_CPP_HOME_SUGGESTION]: ";
-
+
$main::OO_SDK_CPP_HOME = readStdIn();
chop($main::OO_SDK_CPP_HOME);
- if ( $main::OO_SDK_CPP_HOME eq "" )
+ if ( $main::OO_SDK_CPP_HOME eq "" )
{
$main::OO_SDK_CPP_HOME = $main::OO_SDK_CPP_HOME_SUGGESTION;
}
- if ( ! $main::OO_SDK_CPP_HOME eq "" )
+ if ( ! $main::OO_SDK_CPP_HOME eq "" )
{
- if ( (! -d "$main::OO_SDK_CPP_HOME") ||
+ if ( (! -d "$main::OO_SDK_CPP_HOME") ||
((-d "$main::OO_SDK_CPP_HOME") && (! -e "$main::OO_SDK_CPP_HOME/$main::cppName")) )
- {
+ {
print " Error: Could not find directory '$main::OO_SDK_CPP_HOME'.\n";
if ( skipChoice("C++ compiler") == 1 )
{
$main::correctVersion = 1;
}
$main::OO_SDK_CPP_HOME = "";
- } else
+ } else
{
#check version
if ( $main::cppName eq "gcc" )
@@ -343,7 +343,7 @@ while ( (!$main::correctVersion) &&
print " GNU compiler.\nSet the environment variable OO_SDK_CPP_HOME to your GNU build tools ";
print " directory.\nA GNU compiler version $main::cppVersion can be obtained at ";
print " ftp://ftp.gnu.org/gnu/gcc/\n";
- } else
+ } else
{
$main::correctVersion = testVersion($main::cppVersion, $testVersion, "$main::OO_SDK_CPP_HOME/$main::cppName", 1);
if ( !$main::correctVersion )
@@ -367,7 +367,7 @@ while ( (!$main::correctVersion) &&
{
print " The '$main::cppName' command found at $main::OO_SDK_CPP_HOME/$main::cppName is not a ";
print " Solaris C++ compiler.\nSet the environment variable OO_SDK_CPP_HOME to your Solaris C++ compiler directory.\n";
- } else
+ } else
{
if ($testVersion =~ m#((\d+\.)+\d+)# )
{
@@ -387,7 +387,7 @@ while ( (!$main::correctVersion) &&
$main::correctVersion = testVersion("5.5", $testVersion, "$main::OO_SDK_CPP_HOME/$main::cppName", 2);
if ( $main::correctVersion ) {
$main::OO_SDK_CC_55_OR_HIGHER = $testVersion;
- }
+ }
}
}
}
@@ -417,27 +417,27 @@ while ( (!$main::correctVersion) &&
print " Enter Java SDK (1.5, recommendation is 1.6 or higher) installation directory (optional) [$main::OO_SDK_JAVA_HOME_SUGGESTION]: ";
$main::OO_SDK_JAVA_HOME = readStdIn();
chop($main::OO_SDK_JAVA_HOME);
- if ( $main::OO_SDK_JAVA_HOME eq "" )
+ if ( $main::OO_SDK_JAVA_HOME eq "" )
{
$main::OO_SDK_JAVA_HOME = $main::OO_SDK_JAVA_HOME_SUGGESTION;
}
- if ( ! $main::OO_SDK_JAVA_HOME eq "" )
+ if ( ! $main::OO_SDK_JAVA_HOME eq "" )
{
- if ( (! -d "$main::OO_SDK_JAVA_HOME") ||
+ if ( (! -d "$main::OO_SDK_JAVA_HOME") ||
((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac")) )
- {
+ {
print " Error: Could not find directory '$main::OO_SDK_JAVA_HOME' or '$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac'.\n";
if ( skipChoice("JAVA SDK") == 1 )
{
$main::correctVersion = 1;
}
$main::OO_SDK_JAVA_HOME = "";
- } else
+ } else
{
#check version
my $testVersion = `$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/java -version 2>&1 | egrep "java version" | head -n 1 | sed -e 's#.*version "##' | sed -e 's#".*##'`;
$testVersion =~ s#([^\n]+)\n#$1#go;
-
+
$main::correctVersion = testVersion($main::javaVersion, $testVersion, "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/java", 1);
if ( !$main::correctVersion )
{
@@ -462,18 +462,18 @@ while ( (!$main::skipOutputDir) &&
{
print " Default output directory is in your HOME directory.\n";
print " Enter an existent directory if you prefer a different output directory (optional) [$main::OO_SDK_OUTPUT_DIR_SUGGESTION]: ";
-
+
$main::OO_SDK_OUTPUT_DIR = readStdIn();
chop($main::OO_SDK_OUTPUT_DIR);
- if ( $main::OO_SDK_OUTPUT_DIR eq "" )
+ if ( $main::OO_SDK_OUTPUT_DIR eq "" )
{
$main::OO_SDK_OUTPUT_DIR = $main::OO_SDK_OUTPUT_DIR_SUGGESTION;
}
- if ( ! $main::OO_SDK_OUTPUT_DIR eq "" )
+ if ( ! $main::OO_SDK_OUTPUT_DIR eq "" )
{
if ( ! -d "$main::OO_SDK_OUTPUT_DIR" )
- {
+ {
print " Error: Could not find directory '$main::OO_SDK_OUTPUT_DIR'.\n";
if ( skipChoice("optional output directory") == 1 )
{
@@ -491,8 +491,8 @@ while ( (!$main::skipOutputDir) &&
# prepare auto deployment
if ( $main::OFFICE_OR_URE eq "Office" )
{
- while ( $main::SDK_AUTO_DEPLOYMENT eq "" ||
- ((! $main::SDK_AUTO_DEPLOYMENT eq "YES") &&
+ while ( $main::SDK_AUTO_DEPLOYMENT eq "" ||
+ ((! $main::SDK_AUTO_DEPLOYMENT eq "YES") &&
(! $main::SDK_AUTO_DEPLOYMENT eq "NO")) )
{
print " Automatic deployment of UNO components (YES/NO) [$main::SDK_AUTO_DEPLOYMENT_SUGGESTION]: ";
@@ -552,7 +552,7 @@ sub resolveLink
my $link= shift;
my $resolvedpath = "$base/$link";
- my $linktarget = readlink "$resolvedpath";
+ my $linktarget = readlink "$resolvedpath";
my $resolvedlink = "";
while ( $linktarget ne "") {
@@ -636,10 +636,10 @@ sub searchMacOffice
}
if (-d "/Applications/Oracle Open Office.app" ) {
return "/Applications/Oracle Open Office.app";
- }
+ }
if (-d "/Applications/StarOffice.app" ) {
return "/Applications/StarOffice.app";
- }
+ }
if (-d "/Applications/StarSuite.app" ) {
return "/Applications/StarSuite.app";
}
@@ -653,9 +653,9 @@ sub searchoffice
my $tmpOffice = substr($main::sdkpath, 0, $offset);
my $officepath = "$tmpOffice/libreoffice";
-# if ( $main::OO_MINORVERSION > 0) {
-# $officepath = "$officepath$main::OO_MINORVERSION";
-# }
+# if ( $main::OO_MINORVERSION > 0) {
+# $officepath = "$officepath$main::OO_MINORVERSION";
+# }
# search corresponding office for this SDK
if (-d $officepath && -e "$officepath/program/soffice") {
@@ -663,9 +663,9 @@ sub searchoffice
}
# fallback
my $tmpversion = $main::OO_MAJORVERSION;
-# if ( $main::OO_MINORVERSION > 0) {
-# $tmpversion = "$tmpversion.$main::OO_MINORVERSION";
-# }
+# if ( $main::OO_MINORVERSION > 0) {
+# $tmpversion = "$tmpversion.$main::OO_MINORVERSION";
+# }
$officepath = "$tmpOffice/oracle_open_office$tmpversion";
if (-d $officepath && -e "$officepath/program/soffice") {
@@ -764,7 +764,7 @@ sub readStdIn
return $tmpstdin;
}
-sub prepareScriptFile()
+sub prepareScriptFile()
{
my $inputFile = shift;
my $outputFile = shift;
@@ -794,10 +794,10 @@ sub prepareScriptFile()
$_ =~ s#\@OO_SDK_JAVA_HOME\@#$main::OO_SDK_JAVA_HOME#go;
$_ =~ s#\@SDK_AUTO_DEPLOYMENT\@#$main::SDK_AUTO_DEPLOYMENT#go;
$_ =~ s#\@OO_SDK_OUTPUT_DIR\@#$main::OO_SDK_OUTPUT_DIR#go;
-
- print FILEOUT $_;
+
+ print FILEOUT $_;
}
-
+
close FILEIN;
close FILEOUT;
}
diff --git a/odk/examples/DevelopersGuide/Accessibility/ConnectionTask.java b/odk/examples/DevelopersGuide/Accessibility/ConnectionTask.java
index 7bf9bdb88cd5..56016c07aca6 100644
--- a/odk/examples/DevelopersGuide/Accessibility/ConnectionTask.java
+++ b/odk/examples/DevelopersGuide/Accessibility/ConnectionTask.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.event.ActionListener;
@@ -48,7 +48,7 @@ import com.sun.star.awt.XExtendedToolkit;
/** This timer task tries to connect to a running Office application in regular
intervals until a connection can be successfully established.
*/
-class ConnectionTask
+class ConnectionTask
extends TimerTask
{
public ConnectionTask (EventListenerProxy xListener)
@@ -67,7 +67,7 @@ class ConnectionTask
/** This method is run every time the task is executed. It tries to
- connect to and register the listener at an Office application. If it
+ connect to and register the listener at an Office application. If it
can establish a connection it terminates the timer task. Otherwise it
waits until the next activation.
*/
@@ -168,7 +168,7 @@ class ConnectionTask
try
{
com.sun.star.uno.XComponentContext xCmpContext = null;
-
+
// get the remote office component context
xCmpContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
if( xCmpContext != null )
@@ -193,7 +193,7 @@ class ConnectionTask
return null;
}
- /** Time in milliseconds between two attempts to connect to an Office
+ /** Time in milliseconds between two attempts to connect to an Office
application.
*/
private int mnPeriod = 1000;
diff --git a/odk/examples/DevelopersGuide/Accessibility/EventHandler.java b/odk/examples/DevelopersGuide/Accessibility/EventHandler.java
index 61395bba7d70..611d0d198e1b 100644
--- a/odk/examples/DevelopersGuide/Accessibility/EventHandler.java
+++ b/odk/examples/DevelopersGuide/Accessibility/EventHandler.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;
@@ -93,7 +93,7 @@ public class EventHandler
XAccessibleContext xContext = xAccessible.getAccessibleContext();
if (xContext != null)
{
- MessageArea.println ("new top level window has accessible name "
+ MessageArea.println ("new top level window has accessible name "
+ xContext.getAccessibleName());
// Register at all accessible objects of the new window.
@@ -141,14 +141,14 @@ public class EventHandler
{
if (xContext != null)
{
- MessageArea.println ("focusGained: " + xContext.getAccessibleName()
+ MessageArea.println ("focusGained: " + xContext.getAccessibleName()
+ " with role "
+ NameProvider.getRoleName (xContext.getAccessibleRole()));
// Tell the object displays to update their views.
for (int i=0; i<maObjectDisplays.size(); i++)
{
- IAccessibleObjectDisplay aDisplay =
+ IAccessibleObjectDisplay aDisplay =
(IAccessibleObjectDisplay)maObjectDisplays.get(i);
if (aDisplay != null)
aDisplay.setAccessibleObject (xContext);
@@ -163,7 +163,7 @@ public class EventHandler
-
+
/** Print a message that the given object just lost the focus. Call
all accessible object diplays and tell them to update.
*/
@@ -171,15 +171,15 @@ public class EventHandler
{
if (xContext != null)
{
- MessageArea.println ("focusLost: "
- + xContext.getAccessibleName()
+ MessageArea.println ("focusLost: "
+ + xContext.getAccessibleName()
+ " with role "
+ NameProvider.getRoleName (xContext.getAccessibleRole()));
// Tell the object displays to update their views.
for (int i=0; i<maObjectDisplays.size(); i++)
{
- IAccessibleObjectDisplay aDisplay =
+ IAccessibleObjectDisplay aDisplay =
(IAccessibleObjectDisplay)maObjectDisplays.get(i);
if (aDisplay != null)
aDisplay.setAccessibleObject (null);
@@ -196,7 +196,7 @@ public class EventHandler
/** Handle a change of the caret position. Ignore this on all objects
but the one currently focused.
*/
- private void handleCaretEvent (XAccessibleContext xContext,
+ private void handleCaretEvent (XAccessibleContext xContext,
long nOldPosition, long nNewPosition)
{
if (xContext == mxFocusedObject)
@@ -231,7 +231,7 @@ public class EventHandler
}
// Print a message about the changed state.
- MessageArea.print ("setting state " + NameProvider.getStateName(nState)
+ MessageArea.print ("setting state " + NameProvider.getStateName(nState)
+ " to " + aNewValue);
if (xContext != null)
{
@@ -241,7 +241,7 @@ public class EventHandler
else
MessageArea.println (" at null");
- // Further handling of some states
+ // Further handling of some states
switch (nState)
{
case AccessibleStateType.FOCUSED:
@@ -259,7 +259,7 @@ public class EventHandler
single child.
*/
private void handleChildEvent (
- XAccessibleContext aOldChild,
+ XAccessibleContext aOldChild,
XAccessibleContext aNewChild)
{
if (aOldChild != null)
@@ -285,7 +285,7 @@ public class EventHandler
if (mxFocusedObject != null)
for (int i=0; i<maObjectDisplays.size(); i++)
{
- IAccessibleObjectDisplay aDisplay =
+ IAccessibleObjectDisplay aDisplay =
(IAccessibleObjectDisplay)maObjectDisplays.get(i);
if (aDisplay != null)
aDisplay.updateAccessibleObject (mxFocusedObject);
@@ -300,19 +300,19 @@ public class EventHandler
*/
private void handleGenericEvent (
int nEventId,
- Object aSource,
- Object aOldValue,
+ Object aSource,
+ Object aOldValue,
Object aNewValue)
{
// Print event to message area.
- MessageArea.print ("received event "
+ MessageArea.print ("received event "
+ NameProvider.getEventName (nEventId) + " from ");
XAccessibleContext xContext = objectToContext (aSource);
if (xContext != null)
MessageArea.print (xContext.getAccessibleName());
else
MessageArea.print ("null");
- MessageArea.println (" / "
+ MessageArea.println (" / "
+ NameProvider.getRoleName(xContext.getAccessibleRole()));
}
@@ -339,14 +339,14 @@ public class EventHandler
{
short nOldState = -1;
short nNewState = -1;
- try
+ try
{
if (AnyConverter.isShort (aEvent.NewValue))
nNewState = AnyConverter.toShort (aEvent.NewValue);
if (AnyConverter.isShort (aEvent.OldValue))
nOldState = AnyConverter.toShort (aEvent.OldValue);
}
- catch (com.sun.star.lang.IllegalArgumentException e)
+ catch (com.sun.star.lang.IllegalArgumentException e)
{}
handleStateChange (
objectToContext (aEvent.Source),
@@ -359,7 +359,7 @@ public class EventHandler
case AccessibleEventId.BOUNDRECT_CHANGED:
handleVisibleDataEvent (objectToContext (aEvent.Source));
break;
-
+
case AccessibleEventId.CARET_CHANGED:
try
{
@@ -368,7 +368,7 @@ public class EventHandler
AnyConverter.toLong(aEvent.OldValue),
AnyConverter.toLong(aEvent.NewValue));
}
- catch (com.sun.star.lang.IllegalArgumentException e)
+ catch (com.sun.star.lang.IllegalArgumentException e)
{}
break;
diff --git a/odk/examples/DevelopersGuide/Accessibility/EventListenerProxy.java b/odk/examples/DevelopersGuide/Accessibility/EventListenerProxy.java
index 273f6146a6cc..526ebdc7d1ff 100644
--- a/odk/examples/DevelopersGuide/Accessibility/EventListenerProxy.java
+++ b/odk/examples/DevelopersGuide/Accessibility/EventListenerProxy.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.accessibility.XAccessible;
@@ -42,16 +42,16 @@ import com.sun.star.uno.UnoRuntime;
import java.util.LinkedList;
/** This class acts as a proxy for the simple screen reader. It waits for
- two types of events:
+ two types of events:
1. Accessibility events signal modifications concerning accessibility
objects.
2. Top window events inform the listener about new or removed windows.
This class exists because events had to be handled in a seperate thread
to avoid dead locks: The thread that receives an event must no call back
- to the Office directly.
+ to the Office directly.
- Soon this should not be necessary anymore. There is now a flag which
+ Soon this should not be necessary anymore. There is now a flag which
switches between synchronous and asynchronous callbacks.
All reveived events are eventually forwarded to the actual listener. In
@@ -109,7 +109,7 @@ class EventListenerProxy
else
aEvent = null;
}
-
+
if (aEvent != null)
{
try
@@ -118,7 +118,7 @@ class EventListenerProxy
}
catch (Throwable aException)
{
- MessageArea.println(
+ MessageArea.println(
"Exception during event delivery: " + aException);
aException.printStackTrace();
}
@@ -136,7 +136,7 @@ class EventListenerProxy
}
catch (Exception aException)
{
- // Ignore this exception since there is not much
+ // Ignore this exception since there is not much
// that we can do about it.
}
}
@@ -145,9 +145,9 @@ class EventListenerProxy
public void disposing( final EventObject aEvent)
{
- addEvent (new Runnable()
+ addEvent (new Runnable()
{
- public void run()
+ public void run()
{
maListener.disposing (aEvent);
}
diff --git a/odk/examples/DevelopersGuide/Accessibility/GraphicalDisplay.java b/odk/examples/DevelopersGuide/Accessibility/GraphicalDisplay.java
index 37579e1c3242..b3645353c2d9 100644
--- a/odk/examples/DevelopersGuide/Accessibility/GraphicalDisplay.java
+++ b/odk/examples/DevelopersGuide/Accessibility/GraphicalDisplay.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 javax.swing.*;
@@ -112,10 +112,10 @@ public class GraphicalDisplay
XAccessible xParent = xContext.getAccessibleParent();
if (xParent != null)
drawAccessibleObject (g, xParent.getAccessibleContext(), Color.GRAY);
-
+
// When the context supports the XAccessibleComponent interface
// then draw its outline.
- XAccessibleComponent xComponent =
+ XAccessibleComponent xComponent =
(XAccessibleComponent)UnoRuntime.queryInterface(
XAccessibleComponent.class, xContext);
if (xComponent != null)
diff --git a/odk/examples/DevelopersGuide/Accessibility/IAccessibleObjectDisplay.java b/odk/examples/DevelopersGuide/Accessibility/IAccessibleObjectDisplay.java
index 5e8eb3a2655c..ae6fd896361c 100644
--- a/odk/examples/DevelopersGuide/Accessibility/IAccessibleObjectDisplay.java
+++ b/odk/examples/DevelopersGuide/Accessibility/IAccessibleObjectDisplay.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.accessibility.XAccessibleContext;
diff --git a/odk/examples/DevelopersGuide/Accessibility/MessageArea.java b/odk/examples/DevelopersGuide/Accessibility/MessageArea.java
index 9f3280a591a1..d71fc0966cca 100644
--- a/odk/examples/DevelopersGuide/Accessibility/MessageArea.java
+++ b/odk/examples/DevelopersGuide/Accessibility/MessageArea.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.Font;
@@ -43,7 +43,7 @@ import javax.swing.JScrollBar;
/** A message area displays text in a scrollable text widget. It is a
- singleton. Other objects can access it directly to display messages.
+ singleton. Other objects can access it directly to display messages.
*/
public class MessageArea
extends JScrollPane
diff --git a/odk/examples/DevelopersGuide/Accessibility/NameProvider.java b/odk/examples/DevelopersGuide/Accessibility/NameProvider.java
index 9eeba18f83fd..5d4c134002d6 100644
--- a/odk/examples/DevelopersGuide/Accessibility/NameProvider.java
+++ b/odk/examples/DevelopersGuide/Accessibility/NameProvider.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.HashMap;
@@ -129,7 +129,7 @@ public class NameProvider
maStateMap.put (new Integer (AccessibleStateType.OPAQUE), "OPAQUE");
maStateMap.put (new Integer (AccessibleStateType.PRESSED), "PRESSED");
maStateMap.put (new Integer (AccessibleStateType.RESIZABLE), "RESIZABLE");
- maStateMap.put (new Integer (AccessibleStateType.SELECTABLE), "SELECTABLE");
+ maStateMap.put (new Integer (AccessibleStateType.SELECTABLE), "SELECTABLE");
maStateMap.put (new Integer (AccessibleStateType.SELECTED), "SELECTED");
maStateMap.put (new Integer (AccessibleStateType.SENSITIVE), "SENSITIVE");
maStateMap.put (new Integer (AccessibleStateType.SHOWING), "SHOWING");
diff --git a/odk/examples/DevelopersGuide/Accessibility/RegistrationThread.java b/odk/examples/DevelopersGuide/Accessibility/RegistrationThread.java
index 092941b323a7..9d574c9d7f46 100644
--- a/odk/examples/DevelopersGuide/Accessibility/RegistrationThread.java
+++ b/odk/examples/DevelopersGuide/Accessibility/RegistrationThread.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.event.ActionListener;
@@ -44,7 +44,7 @@ import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.accessibility.*;
import com.sun.star.awt.XExtendedToolkit;
-/** This class is used as a thread and registers or unregsiters a listener
+/** This class is used as a thread and registers or unregsiters a listener
given the constructor at all nodes of a tree of accessibility objects.
*/
public class RegistrationThread
@@ -61,8 +61,8 @@ public class RegistrationThread
This flag decides whether to add or remove the listener.
*/
public RegistrationThread (
- EventListenerProxy aListener,
- XAccessibleContext xRoot,
+ EventListenerProxy aListener,
+ XAccessibleContext xRoot,
boolean bRegister,
boolean bShowMessages)
{
@@ -90,7 +90,7 @@ public class RegistrationThread
{
if ( ! mbRegister)
MessageArea.print ("un");
- MessageArea.println ("registered at " + nNodeCount
+ MessageArea.println ("registered at " + nNodeCount
+ " objects in accessibility tree of " + mxRoot.getAccessibleName());
}
}
@@ -111,7 +111,7 @@ public class RegistrationThread
// Register the root node.
XAccessibleEventBroadcaster xBroadcaster =
(XAccessibleEventBroadcaster) UnoRuntime.queryInterface (
- XAccessibleEventBroadcaster.class,
+ XAccessibleEventBroadcaster.class,
xRoot);
if (xBroadcaster != null)
{
@@ -121,7 +121,7 @@ public class RegistrationThread
xBroadcaster.removeEventListener (maListener);
nNodeCount += 1;
}
-
+
// Call this method recursively to register all sub-trees.
try
{
diff --git a/odk/examples/DevelopersGuide/Accessibility/SSR.java b/odk/examples/DevelopersGuide/Accessibility/SSR.java
index e1830cfa2630..f3b0720869a9 100644
--- a/odk/examples/DevelopersGuide/Accessibility/SSR.java
+++ b/odk/examples/DevelopersGuide/Accessibility/SSR.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.event.ActionListener;
@@ -72,9 +72,9 @@ public class SSR
/** Setup the GUI. It is divided into three areas. The lower half is
ocupied by a message area that logs all the events received from
- accessibility objects. The upper half is shared by two different
+ accessibility objects. The upper half is shared by two different
displays of the currently focused object. On left there is a textual
- representation. On the right there is a graphical view of the
+ representation. On the right there is a graphical view of the
objects's outline.
*/
private void Layout ()
@@ -89,7 +89,7 @@ public class SSR
mFrame.setContentPane(aPanel);
mFrame.setSize (600,400);
-
+
addComponent (new JLabel ("Focused Object:"),
0,0, 1,1, 0,0, GridBagConstraints.WEST, GridBagConstraints.NONE);
@@ -116,7 +116,7 @@ public class SSR
mFrame.show();
}
-
+
@@ -136,7 +136,7 @@ public class SSR
aConstraints.weighty = weighty;
aConstraints.anchor = anchor;
aConstraints.fill = fill;
-
+
mFrame.getContentPane().add (aComponent, aConstraints);
return aComponent;
diff --git a/odk/examples/DevelopersGuide/Accessibility/TextualDisplay.java b/odk/examples/DevelopersGuide/Accessibility/TextualDisplay.java
index 0d8ce96d978d..3776d635eeaf 100644
--- a/odk/examples/DevelopersGuide/Accessibility/TextualDisplay.java
+++ b/odk/examples/DevelopersGuide/Accessibility/TextualDisplay.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.Color;
@@ -112,7 +112,7 @@ class TextualDisplay
private void showContextInfo (XAccessibleContext xContext, String sIndentation)
{
// Show the description.
- msTextContent += sIndentation + "Description: "
+ msTextContent += sIndentation + "Description: "
+ xContext.getAccessibleDescription() + "\n";
showStates (xContext, sIndentation);
@@ -120,7 +120,7 @@ class TextualDisplay
-
+
/** Show a list of all of the the given object's states. Use the
NameConverter class to transform the numerical state ids into human
readable names.
@@ -147,7 +147,7 @@ class TextualDisplay
-
+
/** When the given object supports the XAccessibleComponent interface then
show its size and location on the screen.
*/
@@ -155,17 +155,17 @@ class TextualDisplay
{
// Try to cast the given accessible context to the
// XAccessibleComponent interface.
- XAccessibleComponent xComponent =
+ XAccessibleComponent xComponent =
(XAccessibleComponent)UnoRuntime.queryInterface(
XAccessibleComponent.class, xContext);
if (xComponent != null)
{
Point aLocation = xComponent.getLocationOnScreen();
- msTextContent += sIndentation + "Position : "
+ msTextContent += sIndentation + "Position : "
+ aLocation.X + ", " + aLocation.Y + "\n";
-
+
Size aSize = xComponent.getSize();
- msTextContent += sIndentation + "Size : "
+ msTextContent += sIndentation + "Size : "
+ aSize.Width + ", " + aSize.Height + "\n";
}
}
@@ -208,7 +208,7 @@ class TextualDisplay
XAccessibleContext xParentContext = (XAccessibleContext)aPathToRoot.get(i);
String sParentName = xParentContext.getAccessibleName();
if (sParentName.length() == 0)
- sParentName = "<unnamed> / Role "
+ sParentName = "<unnamed> / Role "
+ NameProvider.getRoleName(xParentContext.getAccessibleRole());
msTextContent += sIndentation + sParentName + "\n";
sIndentation += msIndentation;
diff --git a/odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java b/odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java
index 27a97ec40345..6145a3c49949 100644
--- a/odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.java
+++ b/odk/examples/DevelopersGuide/BasicAndDialogs/CreatingDialogs/SampleDialog.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 com.sun.star.comp.sdk.examples;
@@ -73,20 +73,20 @@ import com.sun.star.uno.XComponentContext;
*/
public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor {
-
+
static final String __serviceName = "com.sun.star.examples.SampleDialog";
private static final String _buttonName = "Button1";
private static final String _cancelButtonName = "CancelButton";
private static final String _labelName = "Label1";
private static final String _labelPrefix = "Number of button clicks: ";
-
+
private XComponentContext _xComponentContext;
-
+
public SampleDialog( XComponentContext xComponentContext ) {
_xComponentContext = xComponentContext;
}
-
+
// static component operations
public static XSingleServiceFactory __getServiceFactory( String implName,
XMultiServiceFactory multiFactory,
@@ -95,7 +95,7 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
if ( implName.equals( SampleDialog.class.getName() ) ) {
xSingleServiceFactory = FactoryHelper.getServiceFactory(
SampleDialog.class, SampleDialog.__serviceName, multiFactory, regKey );
- }
+ }
return xSingleServiceFactory;
}
@@ -103,7 +103,7 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
return FactoryHelper.writeRegistryServiceInfo(
SampleDialog.class.getName(), SampleDialog.__serviceName, regKey );
}
-
+
// XServiceInfo
public String getImplementationName( ) {
return getClass().getName();
@@ -111,11 +111,11 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
// XServiceInfo
public boolean supportsService( /*IN*/String serviceName ) {
- if ( serviceName.equals( __serviceName))
+ if ( serviceName.equals( __serviceName))
return true;
return false;
}
-
+
// XServiceInfo
public String[] getSupportedServiceNames( ) {
String[] retValue= new String[0];
@@ -132,7 +132,7 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
catch ( Exception e ) {
throw new com.sun.star.lang.WrappedTargetRuntimeException( e.getMessage(), this, e );
}
- }
+ }
}
/** method for creating a dialog at runtime
@@ -141,12 +141,12 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
// get the service manager from the component context
XMultiComponentFactory xMultiComponentFactory = _xComponentContext.getServiceManager();
-
+
// create the dialog model and set the properties
Object dialogModel = xMultiComponentFactory.createInstanceWithContext(
"com.sun.star.awt.UnoControlDialogModel", _xComponentContext );
XPropertySet xPSetDialog = ( XPropertySet )UnoRuntime.queryInterface(
- XPropertySet.class, dialogModel );
+ XPropertySet.class, dialogModel );
xPSetDialog.setPropertyValue( "PositionX", new Integer( 100 ) );
xPSetDialog.setPropertyValue( "PositionY", new Integer( 100 ) );
xPSetDialog.setPropertyValue( "Width", new Integer( 150 ) );
@@ -156,7 +156,7 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
// get the service manager from the dialog model
XMultiServiceFactory xMultiServiceFactory = ( XMultiServiceFactory )UnoRuntime.queryInterface(
XMultiServiceFactory.class, dialogModel );
-
+
// create the button model and set the properties
Object buttonModel = xMultiServiceFactory.createInstance(
"com.sun.star.awt.UnoControlButtonModel" );
@@ -167,9 +167,9 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
xPSetButton.setPropertyValue( "Width", new Integer( 50 ) );
xPSetButton.setPropertyValue( "Height", new Integer( 14 ) );
xPSetButton.setPropertyValue( "Name", _buttonName );
- xPSetButton.setPropertyValue( "TabIndex", new Short( (short)0 ) );
+ xPSetButton.setPropertyValue( "TabIndex", new Short( (short)0 ) );
xPSetButton.setPropertyValue( "Label", new String( "Click Me" ) );
-
+
// create the label model and set the properties
Object labelModel = xMultiServiceFactory.createInstance(
"com.sun.star.awt.UnoControlFixedTextModel" );
@@ -180,7 +180,7 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
xPSetLabel.setPropertyValue( "Width", new Integer( 100 ) );
xPSetLabel.setPropertyValue( "Height", new Integer( 14 ) );
xPSetLabel.setPropertyValue( "Name", _labelName );
- xPSetLabel.setPropertyValue( "TabIndex", new Short( (short)1 ) );
+ xPSetLabel.setPropertyValue( "TabIndex", new Short( (short)1 ) );
xPSetLabel.setPropertyValue( "Label", _labelPrefix );
// create a Cancel button model and set the properties
@@ -193,49 +193,49 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
xPSetCancelButton.setPropertyValue( "Width", new Integer( 50 ) );
xPSetCancelButton.setPropertyValue( "Height", new Integer( 14 ) );
xPSetCancelButton.setPropertyValue( "Name", _cancelButtonName );
- xPSetCancelButton.setPropertyValue( "TabIndex", new Short( (short)2 ) );
+ xPSetCancelButton.setPropertyValue( "TabIndex", new Short( (short)2 ) );
xPSetCancelButton.setPropertyValue( "PushButtonType", new Short( (short)2 ) );
xPSetCancelButton.setPropertyValue( "Label", new String( "Cancel" ) );
-
+
// insert the control models into the dialog model
XNameContainer xNameCont = ( XNameContainer )UnoRuntime.queryInterface(
XNameContainer.class, dialogModel );
xNameCont.insertByName( _buttonName, buttonModel );
xNameCont.insertByName( _labelName, labelModel );
xNameCont.insertByName( _cancelButtonName, cancelButtonModel );
-
+
// create the dialog control and set the model
Object dialog = xMultiComponentFactory.createInstanceWithContext(
"com.sun.star.awt.UnoControlDialog", _xComponentContext );
XControl xControl = ( XControl )UnoRuntime.queryInterface(
XControl.class, dialog );
XControlModel xControlModel = ( XControlModel )UnoRuntime.queryInterface(
- XControlModel.class, dialogModel );
+ XControlModel.class, dialogModel );
xControl.setModel( xControlModel );
-
+
// add an action listener to the button control
XControlContainer xControlCont = ( XControlContainer )UnoRuntime.queryInterface(
- XControlContainer.class, dialog );
+ XControlContainer.class, dialog );
Object objectButton = xControlCont.getControl( "Button1" );
XButton xButton = ( XButton )UnoRuntime.queryInterface(
XButton.class, objectButton );
xButton.addActionListener( new ActionListenerImpl( xControlCont ) );
-
+
// create a peer
Object toolkit = xMultiComponentFactory.createInstanceWithContext(
- "com.sun.star.awt.ExtToolkit", _xComponentContext );
+ "com.sun.star.awt.ExtToolkit", _xComponentContext );
XToolkit xToolkit = ( XToolkit )UnoRuntime.queryInterface(
XToolkit.class, toolkit );
XWindow xWindow = ( XWindow )UnoRuntime.queryInterface(
XWindow.class, xControl );
- xWindow.setVisible( false );
+ xWindow.setVisible( false );
xControl.createPeer( xToolkit, null );
-
+
// execute the dialog
XDialog xDialog = ( XDialog )UnoRuntime.queryInterface(
XDialog.class, dialog );
xDialog.execute();
-
+
// dispose the dialog
XComponent xComponent = ( XComponent )UnoRuntime.queryInterface(
XComponent.class, dialog );
@@ -253,23 +253,23 @@ public class SampleDialog extends WeakBase implements XServiceInfo, XJobExecutor
public ActionListenerImpl( XControlContainer xControlCont ) {
_xControlCont = xControlCont;
}
-
+
// XEventListener
public void disposing( EventObject eventObject ) {
_xControlCont = null;
}
-
+
// XActionListener
public void actionPerformed( ActionEvent actionEvent ) {
// increase click counter
_nCounts++;
-
+
// set label text
Object label = _xControlCont.getControl( "Label1" );
XFixedText xLabel = ( XFixedText )UnoRuntime.queryInterface(
- XFixedText.class, label );
+ XFixedText.class, label );
xLabel.setText( _labelPrefix + _nCounts );
- }
- }
+ }
+ }
}
diff --git a/odk/examples/DevelopersGuide/Charts/CalcHelper.java b/odk/examples/DevelopersGuide/Charts/CalcHelper.java
index c7a82f327118..c9bac59345ab 100644
--- a/odk/examples/DevelopersGuide/Charts/CalcHelper.java
+++ b/odk/examples/DevelopersGuide/Charts/CalcHelper.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 __________
@@ -108,7 +108,7 @@ public class CalcHelper
}
catch( Exception ex )
{}
-
+
return aSheet;
}
@@ -207,7 +207,7 @@ public class CalcHelper
}
catch( NoSuchElementException ex )
{
- System.out.println( "Couldn't find chart with name " + sChartName + ": " + ex );
+ System.out.println( "Couldn't find chart with name " + sChartName + ": " + ex );
}
catch( Exception ex )
{}
@@ -278,7 +278,7 @@ public class CalcHelper
{
System.out.println( "Sheet not found" + ex );
}
-
+
return aRange;
}
@@ -303,13 +303,13 @@ public class CalcHelper
double fFactor = 2.0 * java.lang.Math.PI / (double)(nRowCount - 1);
String aFormula;
- // set variable factor for cos formula
+ // set variable factor for cos formula
int nFactorCol = nColumnCount + 2;
(aSheet.getCellByPosition( nFactorCol - 1, 0 )).setValue( 0.2 );
XText xCellText = (XText) UnoRuntime.queryInterface( XText.class, aSheet.getCellByPosition( nFactorCol - 1, 1 ) );
xCellText.setString( "Change the factor above and\nwatch the changes in the chart" );
-
+
for( nCol = 0; nCol < nColumnCount; nCol++ )
{
for( nRow = 0; nRow < nRowCount; nRow++ )
@@ -338,7 +338,7 @@ public class CalcHelper
{
System.out.println( "Sheet not found" + ex );
}
-
+
return aRange;
}
diff --git a/odk/examples/DevelopersGuide/Charts/ChartHelper.java b/odk/examples/DevelopersGuide/Charts/ChartHelper.java
index 0cffc0e3e954..5d44dc034ebb 100644
--- a/odk/examples/DevelopersGuide/Charts/ChartHelper.java
+++ b/odk/examples/DevelopersGuide/Charts/ChartHelper.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 __________
@@ -104,7 +104,7 @@ public class ChartHelper
{
XPropertySet xPropSet = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xTextContent);
-
+
Any aAny = new Any(String.class, msChartClassID);
xPropSet.setPropertyValue("CLSID", aAny );
@@ -116,12 +116,12 @@ public class ChartHelper
//insert embedded object in text -> object will be created
xText.insertTextContent( xCursor, xTextContent, true );
-
+
// set size and position
XShape xShape = (XShape)UnoRuntime.queryInterface(
XShape.class, xTextContent);
xShape.setSize( aExtent );
-
+
aAny = new Any(Short.class,
new Short(com.sun.star.text.VertOrientation.NONE));
xPropSet.setPropertyValue("VertOrient", aAny );
@@ -132,12 +132,12 @@ public class ChartHelper
xPropSet.setPropertyValue("VertOrientPosition", aAny );
aAny = new Any(Integer.class, new Integer(aUpperLeft.X));
xPropSet.setPropertyValue("HoriOrientPosition", aAny );
-
+
// retrieve the chart document as model of the OLE shape
aResult = (XChartDocument) UnoRuntime.queryInterface(
XChartDocument.class,
xPropSet.getPropertyValue( "Model" ));
-
+
// create a diagram via the factory and set this as
// new diagram
aResult.setDiagram(
@@ -150,12 +150,12 @@ public class ChartHelper
} catch( Exception ex)
{
System.out.println( "caught exception: " + ex );
- }
+ }
}
return aResult;
}
-
+
public XChartDocument insertOLEChartInDraw(
String sChartName,
Point aUpperLeft,
@@ -213,7 +213,7 @@ public class ChartHelper
XShape aShape = (XShape) UnoRuntime.queryInterface(
XShape.class,
aFact.createInstance( "com.sun.star.drawing.OLE2Shape" ));
-
+
// insert the shape into the page
aPage.add( aShape );
aShape.setPosition( aUpperLeft );
diff --git a/odk/examples/DevelopersGuide/Charts/ChartInCalc.java b/odk/examples/DevelopersGuide/Charts/ChartInCalc.java
index 06f571bec304..44ae46033389 100644
--- a/odk/examples/DevelopersGuide/Charts/ChartInCalc.java
+++ b/odk/examples/DevelopersGuide/Charts/ChartInCalc.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 __________
@@ -166,7 +166,7 @@ public class ChartInCalc
public void unlockControllers()
throws RuntimeException
{
- ((XModel) UnoRuntime.queryInterface( XModel.class, maChartDocument )).unlockControllers();
+ ((XModel) UnoRuntime.queryInterface( XModel.class, maChartDocument )).unlockControllers();
}
// ____________________
@@ -259,7 +259,7 @@ public class ChartInCalc
nMaxIndex = i;
}
}
-
+
// first parameter is the index of the point, the second one is the series
XPropertySet aPointProp = maDiagram.getDataPointProperties( 0, 1 );
@@ -276,7 +276,7 @@ public class ChartInCalc
catch( IndexOutOfBoundsException ex )
{
System.out.println( "Oops, there not enough data points or series for setting properties: " + ex );
- }
+ }
}
// ____________________
@@ -319,7 +319,7 @@ public class ChartInCalc
XPropertySet aDocProp = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, maChartDocument );
aDocProp.setPropertyValue( "HasMainTitle", new Boolean( true ));
-
+
XShape aTitle = maChartDocument.getTitle();
XPropertySet aTitleProp = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, aTitle );
diff --git a/odk/examples/DevelopersGuide/Charts/ChartInDraw.java b/odk/examples/DevelopersGuide/Charts/ChartInDraw.java
index 9b206f5f7635..ed21c900aaa5 100644
--- a/odk/examples/DevelopersGuide/Charts/ChartInDraw.java
+++ b/odk/examples/DevelopersGuide/Charts/ChartInDraw.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 __________
@@ -144,7 +144,7 @@ public class ChartInDraw
public void unlockControllers()
throws RuntimeException
{
- ((XModel) UnoRuntime.queryInterface( XModel.class, maChartDocument )).unlockControllers();
+ ((XModel) UnoRuntime.queryInterface( XModel.class, maChartDocument )).unlockControllers();
}
// ____________________
@@ -226,7 +226,7 @@ public class ChartInDraw
aDiaProp.setPropertyValue( "Deep", aTrue );
// from Chart3DBarProperties:
aDiaProp.setPropertyValue( "SolidType", new Integer( ChartSolidType.CYLINDER ));
-
+
// change floor color to Magenta6
XPropertySet aFloor = ((X3DDisplay) UnoRuntime.queryInterface(
X3DDisplay.class, maDiagram )).getFloor();
@@ -289,13 +289,13 @@ public class ChartInDraw
// set direction
com.sun.star.drawing.Direction3D aDirection = new com.sun.star.drawing.Direction3D();
-
+
aDirection.DirectionX = -0.75;
aDirection.DirectionY = 0.5;
aDirection.DirectionZ = 0.5;
aDiaProp.setPropertyValue( "D3DSceneLightDirection1", aDirection );
- aDiaProp.setPropertyValue( "D3DSceneLightOn1", new Boolean( true ));
+ aDiaProp.setPropertyValue( "D3DSceneLightOn1", new Boolean( true ));
}
// ______________________________
diff --git a/odk/examples/DevelopersGuide/Charts/ChartInWriter.java b/odk/examples/DevelopersGuide/Charts/ChartInWriter.java
index 9f64e1f49c22..22108393f66c 100644
--- a/odk/examples/DevelopersGuide/Charts/ChartInWriter.java
+++ b/odk/examples/DevelopersGuide/Charts/ChartInWriter.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 __________
@@ -151,7 +151,7 @@ public class ChartInWriter
public void unlockControllers()
throws RuntimeException
{
- ((XModel) UnoRuntime.queryInterface( XModel.class, maChartDocument )).unlockControllers();
+ ((XModel) UnoRuntime.queryInterface( XModel.class, maChartDocument )).unlockControllers();
}
// ____________________
diff --git a/odk/examples/DevelopersGuide/Charts/Helper.java b/odk/examples/DevelopersGuide/Charts/Helper.java
index 13efc37d177a..cae86ca2d5d1 100644
--- a/odk/examples/DevelopersGuide/Charts/Helper.java
+++ b/odk/examples/DevelopersGuide/Charts/Helper.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 __________
@@ -72,14 +72,14 @@ import com.sun.star.lang.IndexOutOfBoundsException;
// __________ Implementation __________
-/** Helper for creating a calc document adding cell values and charts
+/** Helper for creating a calc document adding cell values and charts
@author Bj&ouml;rn Milcke
*/
public class Helper
{
public Helper( String[] args )
{
- // connect to a running office and get the ServiceManager
+ // connect to a running office and get the ServiceManager
try {
// get the remote office component context
maContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
@@ -152,10 +152,10 @@ public class Helper
return aResult;
}
-
+
public XComponentContext getComponentContext(){
return maContext;
-
+
}
// __________ private members and methods __________
diff --git a/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java b/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java
index 10a137a316d5..9bb24a81b62b 100644
--- a/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.java
+++ b/odk/examples/DevelopersGuide/Charts/JavaSampleChartAddIn.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.
- *
+ *
*************************************************************************/
// base classes
@@ -212,7 +212,7 @@ public class JavaSampleChartAddIn extends WeakBase implements
JOptionPane.showMessageDialog( null, "One of the lines is still null", "Assertion", JOptionPane.WARNING_MESSAGE );
return;
}
-
+
// position lines
// --------------
@@ -262,7 +262,7 @@ public class JavaSampleChartAddIn extends WeakBase implements
XPropertySet aShapeProp = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, maTopLine );
aShapeProp.setPropertyValue( "PolyPolygon", aMaxPtSeq );
-
+
aShapeProp = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, maBottomLine );
aShapeProp.setPropertyValue( "PolyPolygon", aMinPtSeq );
@@ -309,7 +309,7 @@ public class JavaSampleChartAddIn extends WeakBase implements
{
return( JavaSampleChartAddIn.class.getName() );
}
-
+
public String[] getSupportedServiceNames()
{
return getSupportedServiceNames_Static();
diff --git a/odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java b/odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java
index 9c37b4d19954..41ee1afb1e96 100644
--- a/odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.java
+++ b/odk/examples/DevelopersGuide/Charts/ListenAtCalcRangeInDraw.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 __________
@@ -121,7 +121,7 @@ public class ListenAtCalcRangeInDraw implements XChartDataChangeEventListener
// ____________________
public void run()
- {
+ {
try
{
((XPropertySet) UnoRuntime.queryInterface(
@@ -186,7 +186,7 @@ public class ListenAtCalcRangeInDraw implements XChartDataChangeEventListener
XPropertySet aDocProp = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, maChartDocument );
aDocProp.setPropertyValue( "HasMainTitle", new Boolean( true ));
-
+
((XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, maChartDocument.getSubTitle())).setPropertyValue(
"String", aTitle );
diff --git a/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java b/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java
index 3a90b2d63313..d895be7df98f 100644
--- a/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java
+++ b/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java
@@ -72,32 +72,32 @@ import com.sun.star.awt.XWindow;
public class SelectionChangeListener implements XSelectionChangeListener {
public static void main( String args[] ) {
SelectionChangeListener aMySelf = new SelectionChangeListener( args );
-
+
aMySelf.run();
}
-
+
public SelectionChangeListener( String args[] ) {
Helper aHelper = new Helper( args );
-
+
maContext = aHelper.getComponentContext();
-
+
CalcHelper aCalcHelper = new CalcHelper( aHelper.createSpreadsheetDocument() );
-
+
// insert a cell range with 4 columns and 12 rows filled with random numbers
XCellRange aRange = aCalcHelper.insertRandomRange( 4, 12 );
CellRangeAddress aRangeAddress = ((XCellRangeAddressable) UnoRuntime.queryInterface(
XCellRangeAddressable.class, aRange)).getRangeAddress();
-
+
// change view to sheet containing the chart
aCalcHelper.raiseChartSheet();
-
+
// the unit for measures is 1/100th of a millimeter
// position at (1cm, 1cm)
Point aPos = new Point( 1000, 1000 );
-
+
// size of the chart is 15cm x 9.271cm
Size aExtent = new Size( 15000, 9271 );
-
+
// insert a new chart into the "Chart" sheet of the
// spreadsheet document
maChartDocument = aCalcHelper.insertChart(
@@ -107,12 +107,12 @@ public class SelectionChangeListener implements XSelectionChangeListener {
aExtent,
"com.sun.star.chart.XYDiagram" );
}
-
+
// ____________________
-
+
public void run() {
boolean bTrying = true;
-
+
while( bTrying ) {
// start listening for selection changes
XSelectionSupplier aSelSupp = (XSelectionSupplier) UnoRuntime.queryInterface(
@@ -124,67 +124,67 @@ public class SelectionChangeListener implements XSelectionChangeListener {
System.out.println( "Successfully attached as selection change listener" );
bTrying = false;
}
-
+
// start listening for death of Controller
XComponent aComp = (XComponent) UnoRuntime.queryInterface( XComponent.class, aSelSupp );
if( aComp != null ) {
aComp.addEventListener( this );
System.out.println( "Successfully attached as dispose listener" );
}
-
+
try {
Thread.currentThread().sleep( 500 );
} catch( InterruptedException ex ) {
}
}
}
-
+
// ____________________
-
+
// XEventListener (base of XSelectionChangeListener)
public void disposing( EventObject aSourceObj ) {
System.out.println( "disposing called. detaching as listener" );
-
+
// stop listening for selection changes
XSelectionSupplier aCtrl = (XSelectionSupplier) UnoRuntime.queryInterface(
XSelectionSupplier.class, aSourceObj );
if( aCtrl != null )
aCtrl.removeSelectionChangeListener( this );
-
+
// remove as dispose listener
XComponent aComp = (XComponent) UnoRuntime.queryInterface( XComponent.class, aSourceObj );
if( aComp != null )
aComp.removeEventListener( this );
-
+
// bail out
System.exit( 0 );
}
-
+
// ____________________
-
+
// XSelectionChangeListener
public void selectionChanged( EventObject aEvent ) {
XController aCtrl = (XController) UnoRuntime.queryInterface( XController.class, aEvent.Source );
if( aCtrl != null ) {
XMultiComponentFactory mMCF = maContext.getServiceManager();
-
+
MyMessageBox aMsgBox = new MyMessageBox(mMCF);
-
+
aMsgBox.start();
-
+
System.out.println("Listener finished");
}
}
-
+
// __________ private __________
-
+
private class MyMessageBox extends Thread{
private XMultiComponentFactory mMCF;
-
+
public MyMessageBox(XMultiComponentFactory xMCF){
mMCF = xMCF;
}
-
+
public void run() {
XDesktop aDesktop = null;
XInterface aToolKit = null;
@@ -196,16 +196,16 @@ public class SelectionChangeListener implements XSelectionChangeListener {
try {
Object oDesktop = mMCF.createInstanceWithContext("com.sun.star.frame.Desktop", maContext);
Object oToolKit = mMCF.createInstanceWithContext("com.sun.star.awt.Toolkit", maContext);
-
+
aDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, oDesktop);
aToolKit = (XInterface) UnoRuntime.queryInterface(XInterface.class, oToolKit);
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
XWindow xWin = aDesktop.getCurrentFrame().getContainerWindow();
XWindowPeer aWinPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xWin);
-
+
Rectangle aRect = new Rectangle();
int button = com.sun.star.awt.MessageBoxButtons.BUTTONS_OK;
XMessageBoxFactory aMBF = (XMessageBoxFactory) UnoRuntime.queryInterface(XMessageBoxFactory.class, aToolKit);
@@ -213,7 +213,7 @@ public class SelectionChangeListener implements XSelectionChangeListener {
xMB.execute();
}
}
-
+
private XChartDocument maChartDocument;
private XComponentContext maContext;
}
diff --git a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Addons.xcu b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Addons.xcu
index d3d8d7411ed2..b97762510429 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Addons.xcu
+++ b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Addons.xcu
@@ -1,22 +1,22 @@
<?xml version='1.0' encoding='UTF-8'?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Addons" oor:package="org.openoffice.Office">
<node oor:name="AddonUI">
-
+
<node oor:name="AddonMenu">
-
+
<node oor:name="myAsyncJobAlias" oor:op="replace">
-
+
<prop oor:name="URL" oor:type="xs:string">
-
+
<value>vnd.sun.star.job:alias=AsyncJob</value>
-
+
</prop>
-
+
<prop oor:name="ImageIdentifier" oor:type="xs:string">
<value>private:image/3216</value>
-
+
</prop>
-
+
<prop oor:name="Title" oor:type="xs:string">
<!-- The x-no-translate entry is a marker to prevent l10n tooling from translation. It it is not necessary. -->
<value xml:lang="x-no-translate"></value>
@@ -27,20 +27,20 @@
<value>_self</value>
</prop>
</node>
-
+
<node oor:name="myAsyncJobEvent" oor:op="replace">
-
+
<prop oor:name="URL" oor:type="xs:string">
-
+
<value>vnd.sun.star.job:event=onMyOwnJobEvent</value>
-
+
</prop>
-
+
<prop oor:name="ImageIdentifier" oor:type="xs:string">
<value>private:image/3216</value>
-
+
</prop>
-
+
<prop oor:name="Title" oor:type="xs:string">
<!-- The x-no-translate entry is a marker to prevent l10n tooling from translation. It it is not necessary. -->
<value xml:lang="x-no-translate"></value>
@@ -51,20 +51,20 @@
<value>_self</value>
</prop>
</node>
-
+
<node oor:name="myAsyncJobService" oor:op="replace">
-
+
<prop oor:name="URL" oor:type="xs:string">
-
+
<value>vnd.sun.star.job:service=com.sun.star.comp.framework.java.services.AsyncJob</value>
-
+
</prop>
-
+
<prop oor:name="ImageIdentifier" oor:type="xs:string">
<value>private:image/3216</value>
-
+
</prop>
-
+
<prop oor:name="Title" oor:type="xs:string">
<!-- The x-no-translate entry is a marker to prevent l10n tooling from translation. It it is not necessary. -->
<value xml:lang="x-no-translate"></value>
@@ -74,7 +74,7 @@
<prop oor:name="Target" oor:type="xs:string">
<value>_self</value>
</prop>
- </node>
+ </node>
</node>
</node>
</oor:component-data>
diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx
index dbf2d548d7f3..de478e6711f6 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx
+++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.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 <addon.hxx>
diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.hxx b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.hxx
index f2e4a0f4a08e..63f90f2312d2 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.hxx
+++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.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 _Addon_HXX
@@ -80,7 +80,7 @@ public:
// XDispatchProvider
virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >
- SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL,
+ SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL,
const ::rtl::OUString& sTargetFrameName, sal_Int32 nSearchFlags )
throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence < ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > >
diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
index 19553b282926..3f8596026f7d 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
+++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.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>
@@ -45,13 +45,13 @@
// include our specific addon header to get access to functions and definitions
#include <addon.hxx>
-
+
using namespace ::rtl;
using namespace ::osl;
using namespace ::cppu;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::registry;
+using namespace ::com::sun::star::registry;
//##################################################################################################
//#### EXPORTED ####################################################################################
@@ -84,13 +84,13 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *
Reference< XRegistryKey > xNewKey(
reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLEMENTATION_NAME "/UNO/SERVICES") ) ) );
-
+
const Sequence< OUString > & rSNL =
Addon_getSupportedServiceNames();
const OUString * pArray = rSNL.getConstArray();
for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
xNewKey->createKey( pArray[nPos] );
-
+
return sal_True;
}
catch (InvalidRegistryException &)
@@ -107,12 +107,12 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *
* @param pImplName name of implementation
* @param pServiceManager a service manager, need for component creation
* @param pRegistryKey the registry key for this component, need for persistent data
- * @return a component factory
+ * @return a component factory
*/
extern "C" void * SAL_CALL component_getFactory(const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey)
{
void * pRet = 0;
-
+
if (rtl_str_compare( pImplName, IMPLEMENTATION_NAME ) == 0)
{
Reference< XSingleServiceFactory > xFactory( createSingleFactory(
@@ -120,15 +120,15 @@ extern "C" void * SAL_CALL component_getFactory(const sal_Char * pImplName, void
OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) ),
Addon_createInstance,
Addon_getSupportedServiceNames() ) );
-
+
if (xFactory.is())
{
xFactory->acquire();
pRet = xFactory.get();
}
}
-
+
return pRet;
-}
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
index ad3b0efe8747..2844d25e3def 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
+++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.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.XComponentContext;
@@ -42,12 +42,12 @@ import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XTypeProvider;
import com.sun.star.lang.XServiceInfo;
import com.sun.star.uno.Type;
-import com.sun.star.frame.XStatusListener;
-import com.sun.star.frame.XDispatchProvider;
-import com.sun.star.frame.XDispatch;
-import com.sun.star.frame.XModel;
-import com.sun.star.frame.XFrame;
-import com.sun.star.frame.DispatchDescriptor;
+import com.sun.star.frame.XStatusListener;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XModel;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.DispatchDescriptor;
import com.sun.star.awt.XToolkit;
import com.sun.star.awt.XWindowPeer;
import com.sun.star.awt.XMessageBox;
@@ -62,14 +62,14 @@ public class ProtocolHandlerAddon {
*/
public static class ProtocolHandlerAddonImpl extends WeakBase implements
XDispatchProvider,
- XDispatch,
+ XDispatch,
XInitialization,
XServiceInfo {
/** The service name, that must be used to get an instance of this service.
*/
static private final String[] m_serviceNames = { "com.sun.star.frame.ProtocolHandler" };
-
+
/** The component context, that gives access to the service manager and all registered services.
*/
private XComponentContext m_xCmpCtx;
@@ -83,7 +83,7 @@ public class ProtocolHandlerAddon {
private XFrame m_xFrame;
private XStatusListener m_xStatusListener;
-
+
/** The constructor of the inner class has a XMultiServiceFactory parameter.
* @param xmultiservicefactoryInitialization A special service factory
* could be introduced while initializing.
@@ -91,7 +91,7 @@ public class ProtocolHandlerAddon {
public ProtocolHandlerAddonImpl( XComponentContext xComponentContext ) {
m_xCmpCtx = xComponentContext;
}
-
+
/** This method is a member of the interface for initializing an object
* directly after its creation.
* @param object This array of arbitrary objects will be passed to the
@@ -114,7 +114,7 @@ public class ProtocolHandlerAddon {
m_xCmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.awt.Toolkit",
m_xCmpCtx));
}
-
+
/** This method returns an array of all supported service names.
* @return Array of supported service names.
*/
@@ -125,7 +125,7 @@ public class ProtocolHandlerAddon {
public static String[] getServiceNames() {
return m_serviceNames;
}
-
+
/** This method returns true, if the given service will be
* supported by the component.
* @param stringService Service name.
@@ -133,22 +133,22 @@ public class ProtocolHandlerAddon {
*/
public boolean supportsService( String sService ) {
int len = m_serviceNames.length;
-
+
for( int i=0; i < len; i++) {
if ( sService.equals( m_serviceNames[i] ) )
return true;
}
-
+
return false;
}
-
+
/** Return the class name of the component.
* @return Class name of the component.
*/
public String getImplementationName() {
return ProtocolHandlerAddonImpl.class.getName();
}
-
+
// XDispatchProvider
public XDispatch queryDispatch( /*IN*/com.sun.star.util.URL aURL,
/*IN*/String sTargetFrameName,
@@ -164,23 +164,23 @@ public class ProtocolHandlerAddon {
}
return xRet;
}
-
+
public XDispatch[] queryDispatches( /*IN*/DispatchDescriptor[] seqDescripts ) {
int nCount = seqDescripts.length;
XDispatch[] lDispatcher = new XDispatch[nCount];
-
+
for( int i=0; i<nCount; ++i )
lDispatcher[i] = queryDispatch( seqDescripts[i].FeatureURL,
seqDescripts[i].FrameName,
seqDescripts[i].SearchFlags );
-
- return lDispatcher;
+
+ return lDispatcher;
}
// XDispatch
public void dispatch( /*IN*/com.sun.star.util.URL aURL,
/*IN*/com.sun.star.beans.PropertyValue[] aArguments ) {
-
+
if ( aURL.Protocol.compareTo("org.openoffice.Office.addon.example:") == 0 )
{
if ( aURL.Path.compareTo( "Function1" ) == 0 )
@@ -197,11 +197,11 @@ public class ProtocolHandlerAddon {
}
}
}
-
+
public void addStatusListener( /*IN*/XStatusListener xControl,
/*IN*/com.sun.star.util.URL aURL ) {
}
-
+
public void removeStatusListener( /*IN*/XStatusListener xControl,
/*IN*/com.sun.star.util.URL aURL ) {
}
@@ -221,7 +221,7 @@ public class ProtocolHandlerAddon {
aDescriptor.WindowAttributes = WindowAttribute.BORDER |
WindowAttribute.MOVEABLE |
WindowAttribute.CLOSEABLE;
-
+
XWindowPeer xPeer = m_xToolkit.createWindow( aDescriptor );
if ( null != xPeer ) {
XMessageBox xMsgBox = (XMessageBox)UnoRuntime.queryInterface(
@@ -235,12 +235,12 @@ public class ProtocolHandlerAddon {
}
}
} catch ( com.sun.star.uno.Exception e) {
- // do your error handling
+ // do your error handling
}
}
}
-
-
+
+
/** Gives a factory for creating the service.
* This method is called by the <code>JavaLoader</code>
* <p>
@@ -256,14 +256,14 @@ public class ProtocolHandlerAddon {
*/
public static XSingleComponentFactory __getComponentFactory( String sImplementationName ) {
XSingleComponentFactory xFactory = null;
-
+
if ( sImplementationName.equals( ProtocolHandlerAddonImpl.class.getName() ) )
xFactory = Factory.createComponentFactory(ProtocolHandlerAddonImpl.class,
ProtocolHandlerAddonImpl.getServiceNames());
-
+
return xFactory;
}
-
+
/** Writes the service information into the given registry key.
* This method is called by the <code>JavaLoader</code>.
* @return returns true if the operation succeeded
diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.cxx
index c377cdb1ebb7..31436a26e7ed 100644
--- a/odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.cxx
+++ b/odk/examples/DevelopersGuide/Components/CppComponent/TestCppComponent.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>
@@ -52,7 +52,7 @@ SAL_IMPLEMENT_MAIN()
try
{
// get the remote office component context
- Reference< XComponentContext > xContext( ::cppu::bootstrap() );
+ Reference< XComponentContext > xContext( ::cppu::bootstrap() );
fprintf(stdout, "\nconnected to a running office...\n");
// create a new instance of MyService1
diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx
index 23c2cd4a38c9..a6933ce63304 100644
--- a/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx
+++ b/odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.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 <osl/interlck.h>
@@ -63,7 +63,7 @@ OUString SAL_CALL getImplementationName_MyService1Impl()
"my_module.my_sc_implementation.MyService1") );
}
-
+
class MyService1Impl
: public ::my_module::XSomething
, public lang::XServiceInfo
@@ -81,7 +81,7 @@ public:
{}
virtual ~MyService1Impl() {}
-
+
// XInterface
virtual Any SAL_CALL queryInterface( Type const & type )
throw (RuntimeException);
diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx
index 81401ede482b..5ed74abbc710 100644
--- a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx
+++ b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.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/implbase3.hxx> // "3" implementing three interfaces
@@ -56,7 +56,7 @@ extern OUString SAL_CALL getImplementationName_MyService1Impl();
extern Reference< XInterface > SAL_CALL create_MyService1Impl(
Reference< XComponentContext > const & xContext )
SAL_THROW( () );
-
+
static Sequence< OUString > getSupportedServiceNames_MyService2Impl()
{
Sequence<OUString> names(1);
@@ -69,7 +69,7 @@ static OUString getImplementationName_MyService2Impl()
return OUString( RTL_CONSTASCII_USTRINGPARAM(
"my_module.my_sc_implementation.MyService2") );
}
-
+
class MyService2Impl : public ::cppu::WeakImplHelper3<
::my_module::XSomething, lang::XServiceInfo, lang::XInitialization >
{
@@ -86,7 +86,7 @@ public:
// focus on three given interfaces,
// no need to implement XInterface, XTypeProvider, XWeak
-
+
// XInitialization will be called upon
// createInstanceWithArguments[AndContext]()
virtual void SAL_CALL initialize( Sequence< Any > const & args )
diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/some.idl b/odk/examples/DevelopersGuide/Components/CppComponent/some.idl
index 342f03560a93..d08cc64318c6 100644
--- a/odk/examples/DevelopersGuide/Components/CppComponent/some.idl
+++ b/odk/examples/DevelopersGuide/Components/CppComponent/some.idl
@@ -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.
- *
+ *
*************************************************************************/
#include <com/sun/star/uno/XInterface.idl>
@@ -46,7 +46,7 @@ module my_module
service MyService1 : XSomething;
- service MyService2 : XSomething
+ service MyService2 : XSomething
{
create([in]string sArgument)
raises (::com::sun::star::lang::IllegalArgumentException);
diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/SomethingA.idl b/odk/examples/DevelopersGuide/Components/JavaComponent/SomethingA.idl
index a98a3047dba6..769a03e58852 100644
--- a/odk/examples/DevelopersGuide/Components/JavaComponent/SomethingA.idl
+++ b/odk/examples/DevelopersGuide/Components/JavaComponent/SomethingA.idl
@@ -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,18 +29,18 @@
* 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 INCLUDED_COM_SUN_STAR_TEST_SOMETHINGA_IDL
#define INCLUDED_COM_SUN_STAR_TEST_SOMETHINGA_IDL
-
+
#include <XSomethingA.idl>
module com { module sun { module star { module test {
service SomethingA: XSomethingA;
-}; }; }; };
-
-#endif
-
-
+}; }; }; };
+
+#endif
+
+
diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/SomethingB.idl b/odk/examples/DevelopersGuide/Components/JavaComponent/SomethingB.idl
index 0281ba751794..0a6bd9444fa9 100644
--- a/odk/examples/DevelopersGuide/Components/JavaComponent/SomethingB.idl
+++ b/odk/examples/DevelopersGuide/Components/JavaComponent/SomethingB.idl
@@ -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,18 +29,18 @@
* 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 INCLUDED_COM_SUN_STAR_TEST_SOMETHINGB_IDL
#define INCLUDED_COM_SUN_STAR_TEST_SOMETHINGB_IDL
-#include <XSomethingB.idl>
+#include <XSomethingB.idl>
module com { module sun { module star { module test {
service SomethingB : XSomethingB;
-}; }; }; };
-
-#endif
-
-
+}; }; }; };
+
+#endif
+
+
diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentA.java b/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentA.java
index 540328e2bff2..ed81b0f707cc 100644
--- a/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentA.java
+++ b/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentA.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.XMultiServiceFactory;
import com.sun.star.lib.uno.helper.WeakBase;
@@ -42,7 +42,7 @@ public class TestComponentA extends WeakBase implements XServiceInfo, XSomething
static final String __serviceName= "com.sun.star.test.SomethingA";
static byte[] _implementationId;
-
+
public TestComponentA() {
}
@@ -57,7 +57,7 @@ public class TestComponentA extends WeakBase implements XServiceInfo, XSomething
}
// XServiceInfo
public boolean supportsService( /*IN*/String serviceName ) {
- if ( serviceName.equals( __serviceName))
+ if ( serviceName.equals( __serviceName))
return true;
return false;
}
@@ -67,5 +67,5 @@ public class TestComponentA extends WeakBase implements XServiceInfo, XSomething
retValue[0]= __serviceName;
return retValue;
}
-
+
}
diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.java b/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.java
index 006cdceedb2c..848c9b45795d 100644
--- a/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.java
+++ b/odk/examples/DevelopersGuide/Components/JavaComponent/TestComponentB.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.XComponentContext;
import com.sun.star.lang.XTypeProvider;
@@ -51,7 +51,7 @@ public class TestComponentB implements XTypeProvider, XServiceInfo, XSomethingB
this.context= context;
this.args= args;
}
-
+
// XSomethingB
public String methodTwo(String val) {
if (args.length > 0 && args[0] instanceof String )
@@ -87,7 +87,7 @@ public class TestComponentB implements XTypeProvider, XServiceInfo, XSomethingB
// XServiceInfo
public boolean supportsService( /*IN*/String serviceName ) {
- if ( serviceName.equals( __serviceName))
+ if ( serviceName.equals( __serviceName))
return true;
return false;
}
@@ -96,5 +96,5 @@ public class TestComponentB implements XTypeProvider, XServiceInfo, XSomethingB
String[] retValue= new String[0];
retValue[0]= __serviceName;
return retValue;
- }
+ }
}
diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java b/odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java
index ab07ccc4564e..50fff36ba0b1 100644
--- a/odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java
+++ b/odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.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.XComponentContext;
import com.sun.star.comp.helper.Bootstrap;
@@ -43,13 +43,13 @@ import com.sun.star.container.XSet;
// sample starbasic code, you can execute it after you have connected to the office.
// Sub Main
-// o = createUnoService( "com.sun.star.test.SomethingB" )
-// msgbox o.methodOne( "from the office !" )
+// o = createUnoService( "com.sun.star.test.SomethingB" )
+// msgbox o.methodOne( "from the office !" )
// End Sub
public class TestJavaComponent
{
-
+
public static void insertIntoServiceManager(
XMultiComponentFactory serviceManager, Object singleFactory )
throws com.sun.star.uno.Exception
@@ -64,14 +64,14 @@ public class TestJavaComponent
{
XSet set = (XSet ) UnoRuntime.queryInterface( XSet.class, serviceManager );
set.remove( singleFactory );
-
+
}
-
+
public static void main(String[] args) throws java.lang.Exception
{
try {
boolean bLocal = false;
-
+
XMultiComponentFactory xUsedServiceManager = null;
XComponentContext xUsedComponentContext = null;
@@ -79,22 +79,22 @@ public class TestJavaComponent
{
XComponentContext xLocalComponentContext =
Bootstrap.createInitialComponentContext( null );
-
+
// initial serviceManager
XMultiComponentFactory xLocalServiceManager =
xLocalComponentContext.getServiceManager();
-
+
bLocal = true;
xUsedServiceManager = xLocalServiceManager;
xUsedComponentContext = xLocalComponentContext;
-
+
System.out.println( "Using local servicemanager" );
- } else {
+ } else {
// get the remote office component context
xUsedComponentContext =
com.sun.star.comp.helper.Bootstrap.bootstrap();
System.out.println("Connected to a running office ...");
-
+
xUsedServiceManager = xUsedComponentContext.getServiceManager();
System.out.println( "Using remote servicemanager" );
}
@@ -102,7 +102,7 @@ public class TestJavaComponent
if ( xUsedServiceManager == null )
{
System.out.println( "ERROR: no service manager" );
- System.exit(0);
+ System.exit(0);
}
Object factory = new Object();
@@ -111,23 +111,23 @@ public class TestJavaComponent
// retrieve the factory for the component implementation
factory = TestServiceProvider.__getServiceFactory(
"TestComponentB", null, null);
-
+
// insert the factory into the local servicemanager
// From now on, the service can be instantiated !
insertIntoServiceManager( xUsedServiceManager, factory );
- }
-
+ }
+
XSomethingB xSomethingB = SomethingB.create(xUsedComponentContext);
-
+
// and call the test method.
String s= xSomethingB.methodTwo("Hello World!");
System.out.println(s);
-
+
if ( bLocal )
{
- // remove it again from the servicemanager,
+ // remove it again from the servicemanager,
removeFromServiceManager( xUsedServiceManager, factory );
- }
+ }
}
catch ( Exception e )
@@ -138,6 +138,6 @@ public class TestJavaComponent
}
// quit, even when a remote bridge is running
- System.exit(0);
+ System.exit(0);
}
}
diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java b/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java
index dee8899510e4..1653a76594bf 100644
--- a/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.java
+++ b/odk/examples/DevelopersGuide/Components/JavaComponent/TestServiceProvider.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.XMultiServiceFactory;
import com.sun.star.lang.XSingleServiceFactory;
@@ -49,14 +49,14 @@ public class TestServiceProvider
if (implName.equals( TestComponentA.class.getName()) )
xSingleServiceFactory = FactoryHelper.getServiceFactory(
TestComponentA.class, TestComponentA.__serviceName,
- multiFactory, regKey);
+ multiFactory, regKey);
else if (implName.equals(TestComponentB.class.getName()))
xSingleServiceFactory= FactoryHelper.getServiceFactory(
TestComponentB.class, TestComponentB.__serviceName,
multiFactory, regKey);
return xSingleServiceFactory;
}
-
+
public static boolean __writeRegistryServiceInfo(XRegistryKey regKey){
boolean bregA= FactoryHelper.writeRegistryServiceInfo(
TestComponentA.class.getName(),
@@ -65,7 +65,7 @@ public class TestServiceProvider
TestComponentB.class.getName(),
TestComponentB.__serviceName, regKey);
return bregA && bregB;
- }
+ }
}
diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/XSomethingA.idl b/odk/examples/DevelopersGuide/Components/JavaComponent/XSomethingA.idl
index f353cd3c7d98..15096be85138 100644
--- a/odk/examples/DevelopersGuide/Components/JavaComponent/XSomethingA.idl
+++ b/odk/examples/DevelopersGuide/Components/JavaComponent/XSomethingA.idl
@@ -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,20 +29,20 @@
* 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 INCLUDED_COM_SUN_STAR_TEST_XSOMETHINGA_IDL
#define INCLUDED_COM_SUN_STAR_TEST_XSOMETHINGA_IDL
-
-#include <com/sun/star/uno/XInterface.idl>
+
+#include <com/sun/star/uno/XInterface.idl>
module com { module sun { module star { module test {
- interface XSomethingA {
+ interface XSomethingA {
string methodOne([in]string value);
- };
-}; }; }; };
-
-#endif
-
-
+ };
+}; }; }; };
+
+#endif
+
+
diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/XSomethingB.idl b/odk/examples/DevelopersGuide/Components/JavaComponent/XSomethingB.idl
index a06532c3ad48..c328bafd2e1e 100644
--- a/odk/examples/DevelopersGuide/Components/JavaComponent/XSomethingB.idl
+++ b/odk/examples/DevelopersGuide/Components/JavaComponent/XSomethingB.idl
@@ -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,20 +29,20 @@
* 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 INCLUDED_COM_SUN_STAR_TEST_XSOMETHINGB_IDL
#define INCLUDED_COM_SUN_STAR_TEST_XSOMETHINGB_IDL
-
-#include <com/sun/star/uno/XInterface.idl>
+
+#include <com/sun/star/uno/XInterface.idl>
module com { module sun { module star { module test {
- interface XSomethingB {
+ interface XSomethingB {
string methodTwo([in]string value);
- };
-}; }; }; };
-
-#endif
-
-
+ };
+}; }; }; };
+
+#endif
+
+
diff --git a/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.idl b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.idl
index f93cb2279358..6f42dd8e0b02 100644
--- a/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.idl
+++ b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.idl
@@ -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,22 +29,22 @@
* 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 _org_openoffice_LicenseTest_idl_
-#define _org_openoffice_LicenseTest_idl_
-
-#include <com/sun/star/lang/XServiceInfo.idl>
-
+#ifndef _org_openoffice_LicenseTest_idl_
+#define _org_openoffice_LicenseTest_idl_
+
+#include <com/sun/star/lang/XServiceInfo.idl>
+
// org
module org {
// openoffice
module openoffice {
// example service, XServiceInfo is implemented here for demonstration
- // issues. XServiceInfo must be implemented by all components.
+ // issues. XServiceInfo must be implemented by all components.
service LicenseTest: ::com::sun::star::lang::XServiceInfo;
};
};
-#endif
+#endif
diff --git a/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java
index 211638c46c58..37ad00c593a6 100644
--- a/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.java
+++ b/odk/examples/DevelopersGuide/Components/SimpleLicense/LicenseTest.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.lib.uno.helper.Factory;
@@ -59,7 +59,7 @@ public class LicenseTest {
*/
static private final String __serviceName =
"org.openoffice.LicenseTest";
-
+
/** The initial component contextr, that gives access to
* the service manager, supported singletons, ...
* It's often later used
@@ -70,7 +70,7 @@ public class LicenseTest {
* It's often later used
*/
private XMultiComponentFactory m_xMCF;
-
+
/** The constructor of the inner class has a XMultiServiceFactory parameter.
* @param xmultiservicefactoryInitialization A special service factory
* could be introduced while initializing.
@@ -78,13 +78,13 @@ public class LicenseTest {
public _LicenseTest(XComponentContext xCompContext) {
try {
m_cmpCtx = xCompContext;
- m_xMCF = m_cmpCtx.getServiceManager();
+ m_xMCF = m_cmpCtx.getServiceManager();
}
catch( Exception e ) {
e.printStackTrace();
}
}
-
+
/** This method returns an array of all supported service names.
* @return Array of supported service names.
*/
@@ -100,7 +100,7 @@ public class LicenseTest {
String[] sSupportedServiceNames = { __serviceName };
return sSupportedServiceNames;
}
-
+
/** This method returns true, if the given service will be
* supported by the component.
* @param sServiceName Service name.
@@ -109,16 +109,16 @@ public class LicenseTest {
public boolean supportsService( String sServiceName ) {
return sServiceName.equals( __serviceName );
}
-
+
/** Return the class name of the component.
* @return Class name of the component.
*/
public String getImplementationName() {
return _LicenseTest.class.getName();
- }
+ }
}
-
-
+
+
/**
* Gives a factory for creating the service.
* This method is called by the <code>JavaLoader</code>
@@ -132,11 +132,11 @@ public class LicenseTest {
public static XSingleComponentFactory __getComponentFactory(String sImplName)
{
XSingleComponentFactory xFactory = null;
-
+
if ( sImplName.equals( _LicenseTest.class.getName() ) )
xFactory = Factory.createComponentFactory(_LicenseTest.class,
_LicenseTest.getServiceNames());
-
+
return xFactory;
}
@@ -167,5 +167,5 @@ public class LicenseTest {
* your component using these objects.
*/
}
-
+
}
diff --git a/odk/examples/DevelopersGuide/Components/SimpleLicense/description.xml b/odk/examples/DevelopersGuide/Components/SimpleLicense/description.xml
index aa465ab8d288..aef2e4d71970 100644
--- a/odk/examples/DevelopersGuide/Components/SimpleLicense/description.xml
+++ b/odk/examples/DevelopersGuide/Components/SimpleLicense/description.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<description xmlns="http://openoffice.org/extensions/description/2006"
xmlns:xlink="http://www.w3.org/1999/xlink">
-
+
<registration>
<simple-license accept-by="admin" default-license-id="de">
<license-text xlink:href="registration/license_de.txt" lang="de" license-id="de" />
diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java
index 7fe4307d8a80..8a5f13a38a15 100644
--- a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.java
+++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/ImageShrink.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 org.openoffice.comp.test;
@@ -53,13 +53,13 @@ import com.sun.star.registry.XRegistryKey;
import com.sun.star.comp.loader.FactoryHelper;
import com.sun.star.lib.uno.helper.WeakBase;
-public class ImageShrink extends WeakBase
+public class ImageShrink extends WeakBase
implements com.sun.star.lang.XServiceInfo,
org.openoffice.test.XImageShrinkFilter {
com.sun.star.uno.XComponentContext xComponentContext = null;
-
+
// maintain a static implementation id for all instances of ImageShrink
// initialized by the first call to getImplementationId()
static byte[] _implementationId;
@@ -67,8 +67,8 @@ public class ImageShrink extends WeakBase
// hold the service name in a private static member variable of the class
protected static final String __serviceName = "org.openoffice.test.ImageShrink";
-
-
+
+
String destDir = "";
String sourceDir = "";
boolean cancel = false;
@@ -83,7 +83,7 @@ public class ImageShrink extends WeakBase
public static XSingleServiceFactory __getServiceFactory(String implName,
XMultiServiceFactory multiFactory,
com.sun.star.registry.XRegistryKey regKey) {
-
+
com.sun.star.lang.XSingleServiceFactory xSingleServiceFactory = null;
if (implName.equals( ImageShrink.class.getName()) )
xSingleServiceFactory = FactoryHelper.getServiceFactory( ImageShrink.class,
@@ -92,25 +92,25 @@ public class ImageShrink extends WeakBase
regKey);
return xSingleServiceFactory;
- }
+ }
public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
//System.out.println(ImageShrink.class.getName());
return FactoryHelper.writeRegistryServiceInfo( ImageShrink.class.getName(),
__serviceName,
regKey);
- }
-
+ }
+
// XFilter implementation (a sub-interface of XImageShrinkFilter)
public void cancel() {
cancel = true;
}
-
+
public boolean filter(com.sun.star.beans.PropertyValue[] propertyValue) {
- // while cancel = false,
- // scale images found in sourceDir according to dimension and
- // write them to destDir, using the image file format given in
-
-
+ // while cancel = false,
+ // scale images found in sourceDir according to dimension and
+ // write them to destDir, using the image file format given in
+
+
// []propertyValue
return true;
}
@@ -119,23 +119,23 @@ public class ImageShrink extends WeakBase
public String getDestinationDirectory() {
return destDir;
}
-
+
public com.sun.star.awt.Size getDimension() {
return dimension;
}
-
+
public String getSourceDirectory() {
return sourceDir;
}
-
+
public void setDestinationDirectory(String str) {
destDir = str;
}
-
+
public void setDimension(com.sun.star.awt.Size size) {
dimension = size;
}
-
+
public void setSourceDirectory(String str) {
sourceDir = str;
}
@@ -146,13 +146,13 @@ public class ImageShrink extends WeakBase
}
public boolean supportsService(String serviceName) {
- if ( serviceName.equals( __serviceName))
+ if ( serviceName.equals( __serviceName))
return true;
return false;
}
public String[] getSupportedServiceNames( ) {
return new String[] { __serviceName };
- }
-
+ }
+
}
diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Thumbs.java b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Thumbs.java
index 3ef79b89e9c0..7dbc23fc9f68 100644
--- a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Thumbs.java
+++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/comp/test/Thumbs.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 org.openoffice.comp.test;
@@ -41,7 +41,7 @@ import com.sun.star.uno.UnoRuntime;
* Note: the image shrink functionality is not implemented
*/
public class Thumbs {
-
+
/**
* @param args the command line arguments
*/
@@ -57,13 +57,13 @@ public class Thumbs {
// new ImageShrink object
org.openoffice.test.XImageShrinkFilter xImageShrinkFilter =
org.openoffice.test.ImageShrink.create(xRemoteContext);
-
+
System.out.println("ImageShrink component succesfully instantiated");
- java.io.File f = new java.io.File(".");
- System.out.println("set SourceDrectory ...");
+ java.io.File f = new java.io.File(".");
+ System.out.println("set SourceDrectory ...");
xImageShrinkFilter.setSourceDirectory(f.getCanonicalPath());
-
+
System.out.println("source Directory = "
+ xImageShrinkFilter.getSourceDirectory());
}
diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/ImageShrink.idl b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/ImageShrink.idl
index b891982f5133..56f89f0ea42c 100644
--- a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/ImageShrink.idl
+++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/ImageShrink.idl
@@ -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.
- *
+ *
*************************************************************************/
#ifndef _org_openoffice_test_ImageShrink_idl_
diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/XImageShrink.idl b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/XImageShrink.idl
index 361e9914e10e..8b00132112a5 100644
--- a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/XImageShrink.idl
+++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/XImageShrink.idl
@@ -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.
- *
+ *
*************************************************************************/
#ifndef _org_openoffice_test_XImageShrink_idl_
@@ -41,7 +41,7 @@
module org { module openoffice { module test {
interface XImageShrink {
-
+
[attribute] string SourceDirectory;
[attribute] string DestinationDirectory;
[attribute] com::sun::star::awt::Size Dimension;
diff --git a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/XImageShrinkFilter.idl b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/XImageShrinkFilter.idl
index 18a59aa667c4..23bbacb23f49 100644
--- a/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/XImageShrinkFilter.idl
+++ b/odk/examples/DevelopersGuide/Components/Thumbs/org/openoffice/test/XImageShrinkFilter.idl
@@ -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.
- *
+ *
*************************************************************************/
#ifndef _org_openoffice_test_XImageShrinkFilter_idl_
diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
index f7ad9ad4b7c8..ba5c168672b6 100644
--- a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
+++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.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,11 +29,11 @@
* 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.Type;
-import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import com.sun.star.registry.XRegistryKey;
import com.sun.star.lang.XTypeProvider;
@@ -61,7 +61,7 @@ import com.sun.star.awt.WindowAttribute;
import com.sun.star.awt.WindowClass;
import com.sun.star.awt.WindowDescriptor;
import com.sun.star.awt.Rectangle;
-
+
import com.sun.star.test.XTestDialogHandler;
// DialogComponent implements all necessary interfaces self, this is only
@@ -69,15 +69,15 @@ import com.sun.star.test.XTestDialogHandler;
// ComponentBase, see implementation of TestComponentA.
public class DialogComponent {
- // public static class _DialogComponent extends WeakBase
+ // public static class _DialogComponent extends WeakBase
public static class _DialogComponent
implements XTypeProvider, XServiceInfo, XTestDialogHandler, XDialogEventHandler {
static final String __serviceName= "com.sun.star.test.TestDialogHandler";
-
+
static byte[] _implementationId;
private XComponentContext m_xCmpCtx;
-
+
private XFrame m_xFrame;
private XToolkit m_xToolkit;
@@ -89,17 +89,17 @@ public class DialogComponent {
m_xToolkit = (XToolkit) UnoRuntime.queryInterface(
XToolkit.class,
m_xCmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.awt.Toolkit",
- m_xCmpCtx));
+ m_xCmpCtx));
}
catch (Exception e) {
e.printStackTrace();
}
}
-
+
// XTestDialogHandler
public String createDialog( String DialogURL, XModel xModel, XFrame xFrame ) {
m_xFrame = xFrame;
-
+
try {
XMultiComponentFactory xMCF = m_xCmpCtx.getServiceManager();
Object obj;
@@ -108,7 +108,7 @@ public class DialogComponent {
if( xModel != null ) {
Object[] args = new Object[1];
args[0] = xModel;
-
+
obj = xMCF.createInstanceWithArgumentsAndContext(
"com.sun.star.awt.DialogProvider2", args, m_xCmpCtx );
}
@@ -119,7 +119,7 @@ public class DialogComponent {
XDialogProvider2 xDialogProvider = (XDialogProvider2)
UnoRuntime.queryInterface( XDialogProvider2.class, obj );
-
+
XDialog xDialog = xDialogProvider.createDialogWithHandler( DialogURL, this );
if( xDialog != null )
xDialog.execute();
@@ -129,13 +129,13 @@ public class DialogComponent {
}
return "Created dialog \"" + DialogURL + "\"";
}
-
+
public void copyText( XDialog xDialog, Object aEventObject ) {
XControlContainer xControlContainer = (XControlContainer)UnoRuntime.queryInterface(
XControlContainer.class, xDialog );
String aTextPropertyStr = "Text";
String aText = "";
- XControl xTextField1Control = xControlContainer.getControl( "TextField1" );
+ XControl xTextField1Control = xControlContainer.getControl( "TextField1" );
XControlModel xControlModel1 = xTextField1Control.getModel();
XPropertySet xPropertySet1 = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xControlModel1 );
@@ -146,8 +146,8 @@ public class DialogComponent {
catch (Exception e) {
e.printStackTrace();
}
-
- XControl xTextField2Control = xControlContainer.getControl( "TextField2" );
+
+ XControl xTextField2Control = xControlContainer.getControl( "TextField2" );
XControlModel xControlModel2 = xTextField2Control.getModel();
XPropertySet xPropertySet2 = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xControlModel2 );
@@ -165,7 +165,7 @@ public class DialogComponent {
public void handleEvent() {
showMessageBox( "DialogComponent", "handleEvent() called" );
}
-
+
public void handleEventWithArguments( XDialog xDialog, Object aEventObject ) {
showMessageBox( "DialogComponent", "handleEventWithArguments() called\n\n" +
"Event Object = " + aEventObject );
@@ -236,7 +236,7 @@ public class DialogComponent {
String[] sSupportedServiceNames = { __serviceName };
return sSupportedServiceNames;
}
-
+
//XServiceInfo
public String[] getSupportedServiceNames() {
return getServiceNames();
@@ -246,12 +246,12 @@ public class DialogComponent {
public boolean supportsService( String sServiceName ) {
return sServiceName.equals( __serviceName );
}
-
+
//XServiceInfo
public String getImplementationName() {
// return DialogComponent.class.getName();
return _DialogComponent.class.getName();
- }
+ }
public void showMessageBox(String sTitle, String sMessage) {
try {
@@ -268,7 +268,7 @@ public class DialogComponent {
aDescriptor.WindowAttributes = WindowAttribute.BORDER |
WindowAttribute.MOVEABLE |
WindowAttribute.CLOSEABLE;
-
+
XWindowPeer xPeer = m_xToolkit.createWindow( aDescriptor );
if ( null != xPeer ) {
XMessageBox xMsgBox = (XMessageBox)UnoRuntime.queryInterface(
@@ -282,9 +282,9 @@ public class DialogComponent {
}
}
} catch ( com.sun.star.uno.Exception e) {
- // do your error handling
+ // do your error handling
}
- }
+ }
}
/**
@@ -300,11 +300,11 @@ public class DialogComponent {
public static XSingleComponentFactory __getComponentFactory(String sImplName)
{
XSingleComponentFactory xFactory = null;
-
+
if ( sImplName.equals( _DialogComponent.class.getName() ) )
xFactory = Factory.createComponentFactory(_DialogComponent.class,
_DialogComponent.getServiceNames());
-
+
return xFactory;
}
diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/TestDialogHandler.idl b/odk/examples/DevelopersGuide/Components/dialogcomponent/TestDialogHandler.idl
index 7196b173b4fa..b465d8c6da11 100644
--- a/odk/examples/DevelopersGuide/Components/dialogcomponent/TestDialogHandler.idl
+++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/TestDialogHandler.idl
@@ -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.
- *
+ *
*************************************************************************/
#ifndef INCLUDED_COM_SUN_STAR_TEST_TESTDIALOGHANDLER_IDL
#define INCLUDED_COM_SUN_STAR_TEST_TESTDIALOGHANDLER_IDL
@@ -43,5 +43,5 @@ module com { module sun { module star { module test {
#endif
-
-
+
+
diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/XTestDialogHandler.idl b/odk/examples/DevelopersGuide/Components/dialogcomponent/XTestDialogHandler.idl
index aa968917d5c9..5952d314ec8d 100644
--- a/odk/examples/DevelopersGuide/Components/dialogcomponent/XTestDialogHandler.idl
+++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/XTestDialogHandler.idl
@@ -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,25 +29,25 @@
* 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 INCLUDED_COM_SUN_STAR_TEST_XTESTDIALOGHANDLER_IDL
#define INCLUDED_COM_SUN_STAR_TEST_XTESTDIALOGHANDLER_IDL
-
-#include <com/sun/star/uno/XInterface.idl>
-#include <com/sun/star/awt/XDialog.idl>
+
+#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/awt/XDialog.idl>
#include <com/sun/star/frame/XModel.idl>
#include <com/sun/star/frame/XFrame.idl>
module com { module sun { module star { module test {
- interface XTestDialogHandler {
+ interface XTestDialogHandler {
string createDialog( [in] string DialogURL, [in] ::com::sun::star::frame::XModel xModel,
[in] ::com::sun::star::frame::XFrame xFrame );
void copyText( [in] ::com::sun::star::awt::XDialog xDialog, [in] any aEventObject );
- void handleEvent();
- void handleEventWithArguments( [in] ::com::sun::star::awt::XDialog xDialog, [in] any aEventObject );
- };
-}; }; }; };
-
+ void handleEvent();
+ void handleEventWithArguments( [in] ::com::sun::star::awt::XDialog xDialog, [in] any aEventObject );
+ };
+}; }; }; };
+
#endif
diff --git a/odk/examples/DevelopersGuide/Config/ConfigExamples.java b/odk/examples/DevelopersGuide/Config/ConfigExamples.java
index a88127ef1053..d978cf19a60f 100644
--- a/odk/examples/DevelopersGuide/Config/ConfigExamples.java
+++ b/odk/examples/DevelopersGuide/Config/ConfigExamples.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 everything we use
@@ -84,8 +84,8 @@ import com.sun.star.util.ChangesEvent;
o Resetting data to their defaults
Each example is in a separate method call.
-*/
-public class ConfigExamples
+*/
+public class ConfigExamples
{
// The ComponentContext interface of the remote component context
private XComponentContext mxContext = null;
@@ -96,27 +96,27 @@ public class ConfigExamples
// The MultiServiceFactory interface of the ConfigurationProvider
private XMultiServiceFactory mxProvider = null;
- public static void main( String args[] )
+ public static void main( String args[] )
{
try {
// get the remote office component context
com.sun.star.uno.XComponentContext xContext =
com.sun.star.comp.helper.Bootstrap.bootstrap();
-
+
if( xContext != null )
System.out.println("Connected to a running office ...");
else
System.out.println( "ERROR: Cannot connect - no remote component context available." );
-
+
// Create an instance of the class and call it's run method
ConfigExamples aExample = new ConfigExamples(xContext);
aExample.run( );
-
- // if you own the service manager dispose it here
- // to ensure that the default provider is properly disposed and flushed
+
+ // if you own the service manager dispose it here
+ // to ensure that the default provider is properly disposed and flushed
System.exit(0);
- }
- catch( Exception e )
+ }
+ catch( Exception e )
{
e.printStackTrace();
System.exit(-1);
@@ -133,10 +133,10 @@ public class ConfigExamples
/** Run the examples with a default ConfigurationProvider
*/
- public void run()
+ public void run()
throws com.sun.star.uno.Exception
{
- mxProvider = createProvider();
+ mxProvider = createProvider();
runExamples( );
@@ -146,7 +146,7 @@ public class ConfigExamples
/** Run the examples with an AdministrationProvider
*/
- public void runForAdmin(Object [] aAdminArgs)
+ public void runForAdmin(Object [] aAdminArgs)
throws com.sun.star.uno.Exception
{
mxProvider = createAdminProvider(aAdminArgs);
@@ -160,7 +160,7 @@ public class ConfigExamples
/** Run the examples with a given ConfigurationProvider
*/
- public void runExamples( )
+ public void runExamples( )
{
if (checkProvider(mxProvider))
{
@@ -181,7 +181,7 @@ public class ConfigExamples
else
System.out.println("ERROR: Cannot run examples without ConfigurationProvider.");
- }
+ }
/** Do some simple checks, if tehre is a valid ConfigurationProvider
*/
@@ -198,10 +198,10 @@ public class ConfigExamples
try
{
// check the provider implementation
- XServiceInfo xProviderServices =
+ XServiceInfo xProviderServices =
(XServiceInfo) UnoRuntime.queryInterface( XServiceInfo.class, xProvider );
- if (xProviderServices == null ||
+ if (xProviderServices == null ||
!xProviderServices.supportsService("com.sun.star.configuration.ConfigurationProvider"))
{
System.out.println("WARNING: The provider is not a com.sun.star.configuration.ConfigurationProvider");
@@ -221,15 +221,15 @@ public class ConfigExamples
return false;
}
}
-
- /** Get the provider we have
+
+ /** Get the provider we have
*/
public XMultiServiceFactory getProvider( )
{
return mxProvider;
}
- /** Create a default configuration provider
+ /** Create a default configuration provider
*/
public XMultiServiceFactory createProvider( )
throws com.sun.star.uno.Exception
@@ -238,14 +238,14 @@ public class ConfigExamples
// create the provider and return it as a XMultiServiceFactory
XMultiServiceFactory xProvider = (XMultiServiceFactory)
- UnoRuntime.queryInterface(XMultiServiceFactory.class,
+ UnoRuntime.queryInterface(XMultiServiceFactory.class,
mxServiceManager.createInstanceWithContext(sProviderService,
- mxContext));
+ mxContext));
return xProvider;
}
- /** Create an administration provider
+ /** Create an administration provider
@param aAdminArguments
An array of extra arguments to be used to create the provider
@@ -259,7 +259,7 @@ public class ConfigExamples
XMultiServiceFactory xAdminProvider = (XMultiServiceFactory)
UnoRuntime.queryInterface(XMultiServiceFactory.class,
mxServiceManager.createInstanceWithArgumentsAndContext(
- sAdminService, aAdminArguments, mxContext));
+ sAdminService, aAdminArguments, mxContext));
return xAdminProvider;
}
@@ -274,7 +274,7 @@ public class ConfigExamples
// The service name: Need only read access:
final String sReadOnlyView = "com.sun.star.configuration.ConfigurationAccess";
- // creation arguments: nodepath
+ // creation arguments: nodepath
com.sun.star.beans.PropertyValue aPathArgument = new com.sun.star.beans.PropertyValue();
aPathArgument.Name = "nodepath";
aPathArgument.Value = sPath;
@@ -298,7 +298,7 @@ public class ConfigExamples
// The service name: Need update access:
final String cUpdatableView = "com.sun.star.configuration.ConfigurationUpdateAccess";
- // creation arguments: nodepath
+ // creation arguments: nodepath
com.sun.star.beans.PropertyValue aPathArgument = new com.sun.star.beans.PropertyValue();
aPathArgument.Name = "nodepath";
aPathArgument.Value = sPath;
@@ -322,12 +322,12 @@ public class ConfigExamples
// The service name: Need update access:
final String cUpdatableView = "com.sun.star.configuration.ConfigurationUpdateAccess";
- // creation arguments: nodepath
+ // creation arguments: nodepath
com.sun.star.beans.PropertyValue aPathArgument = new com.sun.star.beans.PropertyValue();
aPathArgument.Name = "nodepath";
aPathArgument.Value = sPath;
- // creation arguments: commit mode - write-through or write-back
+ // creation arguments: commit mode - write-through or write-back
com.sun.star.beans.PropertyValue aModeArgument = new com.sun.star.beans.PropertyValue();
aModeArgument.Name = "lazywrite";
aModeArgument.Value = new Boolean(bAsync);
@@ -382,7 +382,7 @@ public class ConfigExamples
{
System.out.println("\n--- starting example: update group data synchronously --------------");
editGridOptions( );
- }
+ }
catch ( Exception e )
{
e.printStackTrace();
@@ -401,7 +401,7 @@ public class ConfigExamples
Object aNewData = readGridConfiguration( );
System.out.println("Before reset: user grid options: " + aOldData);
System.out.println("After reset: default grid options: " + aNewData);
- }
+ }
catch ( Exception e )
{
e.printStackTrace();
@@ -447,7 +447,7 @@ public class ConfigExamples
protected GridOptions readGridConfiguration()
throws com.sun.star.uno.Exception
{
- // The path to the root element
+ // The path to the root element
final String cGridOptionsPath = "/org.openoffice.Office.Calc/Grid";
// create the view
@@ -455,9 +455,9 @@ public class ConfigExamples
// the result structure
GridOptions options = new GridOptions();
-
+
// accessing a single nested value
- XHierarchicalPropertySet xProperties =
+ XHierarchicalPropertySet xProperties =
(XHierarchicalPropertySet)UnoRuntime.queryInterface(XHierarchicalPropertySet.class, xViewRoot);
Object aVisible = xProperties.getHierarchicalPropertyValue("Option/VisibleGrid");
@@ -468,8 +468,8 @@ public class ConfigExamples
XMultiPropertySet xSubdivProperties =
(XMultiPropertySet)UnoRuntime.queryInterface(XMultiPropertySet.class, xSubdivision);
-
- // variables for multi-element access
+
+ // variables for multi-element access
String[] aElementNames = new String[2];
aElementNames[0] = "XAxis";
@@ -483,10 +483,10 @@ public class ConfigExamples
// accessing deeply nested subproperties
Object xResolution = xProperties.getHierarchicalPropertyValue("Resolution");
- XMultiHierarchicalPropertySet xResolutionProperties =
+ XMultiHierarchicalPropertySet xResolutionProperties =
(XMultiHierarchicalPropertySet)
UnoRuntime.queryInterface(XMultiHierarchicalPropertySet.class, xResolution);
-
+
aElementNames[0] = "XAxis/Metric";
aElementNames[1] = "YAxis/Metric";
@@ -496,7 +496,7 @@ public class ConfigExamples
options.resolution_y = ((Integer) aElementValues[1]).intValue();
// all options have been retrieved - clean up and return
- // we are done with the view - dispose it
+ // we are done with the view - dispose it
((XComponent)UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
@@ -518,7 +518,7 @@ public class ConfigExamples
throws com.sun.star.uno.Exception
{
// First process this as an element (preorder traversal)
- XHierarchicalName xElementPath =
+ XHierarchicalName xElementPath =
(XHierarchicalName) UnoRuntime.queryInterface(XHierarchicalName.class, xElement);
String sPath = xElementPath.getHierarchicalName();
@@ -528,7 +528,7 @@ public class ConfigExamples
// now process this as a container
XNameAccess xChildAccess =
(XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xElement);
-
+
// get a list of child elements
String[] aElementNames = xChildAccess.getElementNames();
@@ -540,7 +540,7 @@ public class ConfigExamples
// is it a structural element (object) ...
if ( aAnyConv.isObject(aChild) && !aAnyConv.isArray(aChild) )
{
- // then get an interface
+ // then get an interface
XInterface xChildElement = (XInterface)UnoRuntime.queryInterface(XInterface.class, aChild);
// and continue processing child elements recursively
@@ -549,10 +549,10 @@ public class ConfigExamples
// ... or is it a simple value
else
{
- // Build the path to it from the path of
+ // Build the path to it from the path of
// the element and the name of the child
String sChildPath;
- sChildPath =
+ sChildPath =
xElementPath.composeHierarchicalName(aElementNames[i]);
// and process the value
@@ -561,7 +561,7 @@ public class ConfigExamples
}
}
- /** Method to browse the part rooted at sRootPath
+ /** Method to browse the part rooted at sRootPath
of the configuration that the Provider provides.
All nodes will be processed by the IConfigurationProcessor passed.
@@ -571,12 +571,12 @@ public class ConfigExamples
{
// create the root element
XInterface xViewRoot = (XInterface)createConfigurationView( sRootPath );
-
+
// now do the processing
browseElementRecursively( xViewRoot, aProcessor );
- // we are done with the view - dispose it
- // This assumes that the processor
+ // we are done with the view - dispose it
+ // This assumes that the processor
// does not keep a reference to the elements in processStructuralElement
((XComponent) UnoRuntime.queryInterface(XComponent.class,xViewRoot)).dispose();
@@ -594,14 +594,14 @@ public class ConfigExamples
final String sFilterKey = "/org.openoffice.TypeDetection.Filter/Filters";
// browse the configuration, dumping filter information
- browseConfiguration( sFilterKey,
+ browseConfiguration( sFilterKey,
new IConfigurationProcessor () {
/// prints Path and Value of properties
public void processValueElement( String sPath_, Object aValue_ ) {
if (new AnyConverter().isArray(aValue_))
{
final Object [] aArray = (Object [])aValue_;
-
+
System.out.print("\tValue: " + sPath_ + " = { ");
for (int i=0; i<aArray.length; ++i)
{
@@ -613,14 +613,14 @@ public class ConfigExamples
else
System.out.println("\tValue: " + sPath_ + " = " + aValue_);
}
-
+
/// prints the Filter entries
public void processStructuralElement( String sPath_, XInterface xElement_) {
// get template information, to detect instances of the 'Filter' template
- XTemplateInstance xInstance =
+ XTemplateInstance xInstance =
( XTemplateInstance )UnoRuntime.queryInterface( XTemplateInstance .class,xElement_);
- // only select the Filter entries
+ // only select the Filter entries
if (xInstance != null && xInstance.getTemplateName().endsWith("Filter")) {
XNamed xNamed = (XNamed)UnoRuntime.queryInterface(XNamed.class,xElement_);
System.out.println("Filter " + xNamed.getName() + " (" + sPath_ + ")");
@@ -631,12 +631,12 @@ public class ConfigExamples
// GROUP UPDATE example
- /** This method simulates editing configuration data using a GridEditor dialog class
+ /** This method simulates editing configuration data using a GridEditor dialog class
*/
public void editGridOptions( )
throws com.sun.star.uno.Exception
{
- // The path to the root element
+ // The path to the root element
final String cGridOptionsPath = "/org.openoffice.Office.Calc/Grid";
// create the SYNCHRONOUS view for better error handling
@@ -646,7 +646,7 @@ public class ConfigExamples
GridOptionsEditor dialog = new GridOptionsEditor();
// set up the initial values and register listeners
- // get a data access interface, to supply the view with a model
+ // get a data access interface, to supply the view with a model
XMultiHierarchicalPropertySet xProperties =
(XMultiHierarchicalPropertySet)
UnoRuntime.queryInterface(XMultiHierarchicalPropertySet.class, xViewRoot);
@@ -654,10 +654,10 @@ public class ConfigExamples
dialog.setModel( xProperties );
// get a listener object (probably an adapter) that notifies
- // the dialog of external changes to its model
+ // the dialog of external changes to its model
XChangesListener xListener = dialog.createChangesListener( );
-
- XChangesNotifier xNotifier =
+
+ XChangesNotifier xNotifier =
(XChangesNotifier)UnoRuntime.queryInterface(XChangesNotifier.class, xViewRoot);
xNotifier.addChangesListener( xListener );
@@ -668,9 +668,9 @@ public class ConfigExamples
if (dialog.execute() == GridOptionsEditor.SAVE_SETTINGS)
{
// changes have been applied to the view here
- XChangesBatch xUpdateControl =
+ XChangesBatch xUpdateControl =
(XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class,xViewRoot);
-
+
try
{
xUpdateControl.commitChanges();
@@ -680,12 +680,12 @@ public class ConfigExamples
dialog.informUserOfError( e );
}
}
-
+
// all changes have been handled - clean up and return
// listener is done now
xNotifier.removeChangesListener( xListener );
- // we are done with the view - dispose it
+ // we are done with the view - dispose it
((XComponent)UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
}
@@ -747,7 +747,7 @@ public class ConfigExamples
});
}
/// this method is called when data has changed to display the updated data
- private void updateDisplay() {
+ private void updateDisplay() {
if (mxModel != null)
System.out.println("Grid options editor: data=" + readModel());
else
@@ -755,7 +755,7 @@ public class ConfigExamples
}
// this method is used to read all relevant data from the model
- private GridOptions readModel()
+ private GridOptions readModel()
{
try
{
@@ -789,7 +789,7 @@ public class ConfigExamples
{
try
{
- XHierarchicalPropertySet xHPS =
+ XHierarchicalPropertySet xHPS =
(XHierarchicalPropertySet)UnoRuntime.queryInterface(XHierarchicalPropertySet.class, mxModel);
final String sSetting = "Option/VisibleGrid";
@@ -799,7 +799,7 @@ public class ConfigExamples
Boolean bOldValue = (Boolean)xHPS.getHierarchicalPropertyValue(sSetting);
Boolean bNewValue = new Boolean( ! bOldValue.booleanValue() );
-
+
xHPS.setHierarchicalPropertyValue(sSetting,bNewValue);
}
catch (Exception e)
@@ -809,10 +809,10 @@ public class ConfigExamples
}
}
- /** This method creates an extra updatable view to change some data
- and trigger the listener of the GridEditor
+ /** This method creates an extra updatable view to change some data
+ and trigger the listener of the GridEditor
*/
- void changeSomeData(String xKey)
+ void changeSomeData(String xKey)
{
try
{
@@ -846,12 +846,12 @@ public class ConfigExamples
}
// commit the changes
- XChangesBatch xUpdateControl =
+ XChangesBatch xUpdateControl =
(XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class,xOtherViewRoot);
-
+
xUpdateControl.commitChanges();
- // we are done with the view - dispose it
+ // we are done with the view - dispose it
((XComponent)UnoRuntime.queryInterface(XComponent.class, xOtherViewRoot)).dispose();
}
catch (Exception e)
@@ -866,20 +866,20 @@ public class ConfigExamples
protected void resetGridConfiguration()
throws com.sun.star.uno.Exception
{
- // The path to the root element
+ // The path to the root element
final String cGridOptionsPath = "/org.openoffice.Office.Calc/Grid";
// create the view
Object xViewRoot = createUpdatableView(cGridOptionsPath);
// resetting a single nested value
- XHierarchicalNameAccess xHierarchicalAccess =
+ XHierarchicalNameAccess xHierarchicalAccess =
(XHierarchicalNameAccess)UnoRuntime.queryInterface(XHierarchicalNameAccess.class, xViewRoot);
// get using absolute name
Object xOptions = xHierarchicalAccess.getByHierarchicalName(cGridOptionsPath + "/Option");
- XPropertyState xOptionState =
+ XPropertyState xOptionState =
(XPropertyState)UnoRuntime.queryInterface(XPropertyState.class, xOptions);
xOptionState.setPropertyToDefault("VisibleGrid");
@@ -888,9 +888,9 @@ public class ConfigExamples
Object xResolutionX = xHierarchicalAccess.getByHierarchicalName("Resolution/XAxis");
Object xResolutionY = xHierarchicalAccess.getByHierarchicalName("Resolution/YAxis");
- XPropertyState xResolutionStateX =
+ XPropertyState xResolutionStateX =
(XPropertyState)UnoRuntime.queryInterface(XPropertyState.class, xResolutionX);
- XPropertyState xResolutionStateY =
+ XPropertyState xResolutionStateY =
(XPropertyState)UnoRuntime.queryInterface(XPropertyState.class, xResolutionY);
xResolutionStateX.setPropertyToDefault("Metric");
@@ -901,16 +901,16 @@ public class ConfigExamples
XMultiPropertyStates xSubdivisionStates =
(XMultiPropertyStates)UnoRuntime.queryInterface(XMultiPropertyStates.class, xSubdivision);
-
+
xSubdivisionStates.setAllPropertiesToDefault();
// commit the changes
- XChangesBatch xUpdateControl =
+ XChangesBatch xUpdateControl =
(XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class,xViewRoot);
-
+
xUpdateControl.commitChanges();
- // we are done with the view - dispose it
+ // we are done with the view - dispose it
((XComponent)UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
}
@@ -920,7 +920,7 @@ public class ConfigExamples
/** This method stores a sample data source given some connection data.
- ATTENTION: This example requires an older version of the
+ ATTENTION: This example requires an older version of the
org.openoffice.Office.DataAccess schema.
It does not work with the current schema.
Because of this, the method currenty does nothing.
@@ -929,12 +929,12 @@ public class ConfigExamples
void storeSampleDataSource()
throws com.sun.star.uno.Exception
{
- if (SET_EXAMPLE_BROKEN_IN_THIS_RELEASE)
+ if (SET_EXAMPLE_BROKEN_IN_THIS_RELEASE)
{
System.out.println("- DISABLED: (the existing example does not work with this version) -");
return; // this function does not work
}
-
+
String sSampleDataSourceName = "SampleTextDatabase";
String sSampleDataSourceURL = "sdbc:flat:$(userurl)/database/SampleTextDatabase";
@@ -964,10 +964,10 @@ public class ConfigExamples
)
throws com.sun.star.uno.Exception
{
- // create the view and get the data source element
+ // create the view and get the data source element
Object xDataSource = createDataSourceDescription(getProvider(),sDataSourceName);
- // set the values
+ // set the values
XPropertySet xDataSourceProperties =
(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xDataSource);
@@ -978,7 +978,7 @@ public class ConfigExamples
if ( aTableFilter != null )
xDataSourceProperties.setPropertyValue("TableFilter", aTableFilter );
-
+
// store the driver-specific settings
if (aDriverSettings != null)
{
@@ -991,9 +991,9 @@ public class ConfigExamples
Object xViewRoot = getViewRoot(xDataSource);
// commit the changes
- XChangesBatch xUpdateControl =
+ XChangesBatch xUpdateControl =
(XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class,xViewRoot);
-
+
xUpdateControl.commitChanges();
// now clean up
@@ -1012,20 +1012,20 @@ public class ConfigExamples
// The service name: Need an update access:
final String cUpdatableView = "com.sun.star.configuration.ConfigurationUpdateAccess";
- // The path to the DataSources set node
+ // The path to the DataSources set node
final String cDataSourcesPath = "/org.openoffice.Office.DataAccess/DataSources";
- // creation arguments: nodepath
+ // creation arguments: nodepath
com.sun.star.beans.PropertyValue aPathArgument = new com.sun.star.beans.PropertyValue();
aPathArgument.Name = "nodepath";
aPathArgument.Value = cDataSourcesPath ;
- // creation arguments: commit mode
+ // creation arguments: commit mode
com.sun.star.beans.PropertyValue aModeArgument = new com.sun.star.beans.PropertyValue();
aModeArgument.Name = "lazywrite";
aModeArgument.Value = new Boolean( true );
- // creation arguments: depth
+ // creation arguments: depth
com.sun.star.beans.PropertyValue aDepthArgument = new com.sun.star.beans.PropertyValue();
aDepthArgument.Name = "depth";
aDepthArgument.Value = new Integer( 1 );
@@ -1036,7 +1036,7 @@ public class ConfigExamples
aArguments[2] = aDepthArgument;
// create the view: asynchronously updatable, with depth 1
- Object xViewRoot =
+ Object xViewRoot =
xProvider.createInstanceWithArguments(cUpdatableView, aArguments);
XNameAccess xSetOfDataSources =
@@ -1046,12 +1046,12 @@ public class ConfigExamples
if ( xSetOfDataSources .hasByName( sDataSourceName ))
{
// the element is there, but it is loaded only with depth zero !
- try
+ try
{
// the view should point to the element directly, so we need to extend the path
XHierarchicalName xComposePath = (XHierarchicalName)
UnoRuntime.queryInterface(XHierarchicalName.class, xSetOfDataSources );
-
+
String sElementPath = xComposePath.composeHierarchicalName( sDataSourceName );
// use the name of the element now
@@ -1063,19 +1063,19 @@ public class ConfigExamples
aDeepArguments[1] = aModeArgument;
// create the view: asynchronously updatable, with unlimited depth
- xDataSourceDescriptor =
+ xDataSourceDescriptor =
xProvider.createInstanceWithArguments(cUpdatableView, aDeepArguments);
- if ( xDataSourceDescriptor != null) // all went fine
+ if ( xDataSourceDescriptor != null) // all went fine
{
// dispose the other view
((XComponent)UnoRuntime.queryInterface(XComponent.class, xViewRoot)).dispose();
xViewRoot = null;
}
}
- catch (Exception e)
+ catch (Exception e)
{
- // something went wrong, we retry with a new element
+ // something went wrong, we retry with a new element
System.err.println("WARNING: An exception occurred while creating a view for an existing data source: " + e);
xDataSourceDescriptor = null;
}
@@ -1084,8 +1084,8 @@ public class ConfigExamples
// do we have a result element yet ?
if ( xDataSourceDescriptor == null)
{
- // get the container
- XNameContainer xSetUpdate =
+ // get the container
+ XNameContainer xSetUpdate =
(XNameContainer)UnoRuntime.queryInterface(XNameContainer.class, xViewRoot);
// create a new detached set element (instance of DataSourceDescription)
@@ -1095,7 +1095,7 @@ public class ConfigExamples
// the new element is the result !
xDataSourceDescriptor = xElementFactory.createInstance();
- // insert it - this also names the element
+ // insert it - this also names the element
xSetUpdate.insertByName( sDataSourceName , xDataSourceDescriptor );
}
@@ -1106,21 +1106,21 @@ public class ConfigExamples
void storeSettings(Object xSettingsSet, com.sun.star.beans.NamedValue [] aSettings )
throws com.sun.star.uno.Exception
{
- if (aSettings == null)
+ if (aSettings == null)
return;
// get the settings set as a container
- XNameContainer xSettingsContainer =
+ XNameContainer xSettingsContainer =
(XNameContainer) UnoRuntime.queryInterface( XNameContainer.class, xSettingsSet);
// and get a factory interface for creating the entries
- XSingleServiceFactory xSettingsFactory =
+ XSingleServiceFactory xSettingsFactory =
(XSingleServiceFactory) UnoRuntime.queryInterface(XSingleServiceFactory.class, xSettingsSet);
// now insert the individual settings
for (int i = 0; i < aSettings.length; ++i) {
// create a DataSourceSetting object
- XPropertySet xSetting = (XPropertySet)
+ XPropertySet xSetting = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, xSettingsFactory.createInstance() );
// can set the value before inserting
@@ -1139,9 +1139,9 @@ public class ConfigExamples
/// This method get the view root node given an interface to any node in the view
public static Object getViewRoot(Object xElement)
{
- Object xResult = xElement;
-
- // set the result to its parent until that would be null
+ Object xResult = xElement;
+
+ // set the result to its parent until that would be null
Object xParent;
do
{
@@ -1164,13 +1164,13 @@ public class ConfigExamples
// workaround methods for unimplemented functionality
/// WORKAROUND: does the same as xNamedItem.setName(sNewName) should do
- void renameSetItem(XNamed xNamedItem, String sNewName)
+ void renameSetItem(XNamed xNamedItem, String sNewName)
throws com.sun.star.uno.Exception
{
- XChild xChildItem = (XChild)
+ XChild xChildItem = (XChild)
UnoRuntime.queryInterface(XChild.class, xNamedItem);
- XNameContainer xParentSet = (XNameContainer)
+ XNameContainer xParentSet = (XNameContainer)
UnoRuntime.queryInterface( XNameContainer.class, xChildItem.getParent() );
String sOldName = xNamedItem.getName();
@@ -1178,16 +1178,16 @@ public class ConfigExamples
// now rename the item
xParentSet.removeByName(sOldName);
xParentSet.insertByName(sNewName,xNamedItem);
- }
+ }
/// WORKAROUND: does the same as xChildItem.setParent( xNewParent ) should do
- void moveSetItem(XChild xChildItem, XNameContainer xNewParent)
+ void moveSetItem(XChild xChildItem, XNameContainer xNewParent)
throws com.sun.star.uno.Exception
{
- XNamed xNamedItem = (XNamed)
+ XNamed xNamedItem = (XNamed)
UnoRuntime.queryInterface(XNamed.class, xChildItem);
- XNameContainer xOldParent = (XNameContainer)
+ XNameContainer xOldParent = (XNameContainer)
UnoRuntime.queryInterface( XNameContainer.class, xChildItem.getParent() );
String sItemName = xNamedItem.getName();
diff --git a/odk/examples/DevelopersGuide/Database/CodeSamples.java b/odk/examples/DevelopersGuide/Database/CodeSamples.java
index 79b3405a4602..0980055a0c0b 100644
--- a/odk/examples/DevelopersGuide/Database/CodeSamples.java
+++ b/odk/examples/DevelopersGuide/Database/CodeSamples.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,12 +50,12 @@ import com.sun.star.sdbc.*;
import com.sun.star.sdb.*;
import com.sun.star.sdbcx.*;
import com.sun.star.frame.*;
-
+
public class CodeSamples
{
public static XComponentContext xContext;
public static XMultiComponentFactory xMCF;
-
+
public static void main(String argv[]) throws java.lang.Exception
{
try {
@@ -108,7 +108,7 @@ public class CodeSamples
}
displayTableStructure( con );
}
- // printDataSources();
+ // printDataSources();
}
catch(Exception e)
{
@@ -136,7 +136,7 @@ public class CodeSamples
else
System.out.println("Connection could not be created!");
}
-
+
// uses the driver manager to create a new connection and dispose it.
public static XConnection openConnectionWithDriverManager() throws com.sun.star.uno.Exception
{
@@ -302,11 +302,11 @@ public class CodeSamples
xContext));
// we use the first datasource
XQueryDefinitionsSupplier xQuerySup = (XQueryDefinitionsSupplier)
- UnoRuntime.queryInterface(XQueryDefinitionsSupplier.class,
- xNameAccess.getByName( "Bibliography" ));
+ UnoRuntime.queryInterface(XQueryDefinitionsSupplier.class,
+ xNameAccess.getByName( "Bibliography" ));
XNameAccess xQDefs = xQuerySup.getQueryDefinitions();
// create new query definition
- XSingleServiceFactory xSingleFac = (XSingleServiceFactory)
+ XSingleServiceFactory xSingleFac = (XSingleServiceFactory)
UnoRuntime.queryInterface(XSingleServiceFactory.class, xQDefs);
XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(
@@ -324,7 +324,7 @@ public class CodeSamples
{}
xCont.insertByName("Query1",xProp);
XDocumentDataSource xDs = (XDocumentDataSource)UnoRuntime.queryInterface(XDocumentDataSource.class, xQuerySup);
-
+
XStorable xStore = (XStorable)UnoRuntime.queryInterface(XStorable.class,xDs.getDatabaseDocument());
xStore.store();
}
@@ -338,13 +338,13 @@ public class CodeSamples
xContext));
// we use the first datasource
XDataSource xDS = (XDataSource)UnoRuntime.queryInterface(
- XDataSource.class, xNameAccess.getByName( "Bibliography" ));
+ XDataSource.class, xNameAccess.getByName( "Bibliography" ));
XConnection con = xDS.getConnection("","");
XQueriesSupplier xQuerySup = (XQueriesSupplier)
- UnoRuntime.queryInterface(XQueriesSupplier.class, con);
-
+ UnoRuntime.queryInterface(XQueriesSupplier.class, con);
+
XNameAccess xQDefs = xQuerySup.getQueries();
-
+
XColumnsSupplier xColsSup = (XColumnsSupplier) UnoRuntime.queryInterface(
XColumnsSupplier.class,xQDefs.getByName("Query1"));
XNameAccess xCols = xColsSup.getColumns();
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.hxx
index 2de4fbecab35..4d728611b18f 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.hxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.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 _CONNECTIVITY_OSUBCOMPONENT_HXX_
@@ -79,7 +79,7 @@ namespace connectivity
protected:
// the parent must support the tunnel implementation
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent;
- SELF* m_pDerivedImplementation;
+ SELF* m_pDerivedImplementation;
public:
OSubComponent(
@@ -112,14 +112,14 @@ namespace connectivity
class OPropertyArrayUsageHelper
{
protected:
- static sal_Int32 s_nRefCount;
- static ::cppu::IPropertyArrayHelper* s_pProps;
- static ::osl::Mutex s_aMutex;
+ static sal_Int32 s_nRefCount;
+ static ::cppu::IPropertyArrayHelper* s_pProps;
+ static ::osl::Mutex s_aMutex;
public:
OPropertyArrayUsageHelper();
virtual ~OPropertyArrayUsageHelper()
- { // ARGHHHHHHH ..... would like to implement this in proparrhlp_impl.hxx (as we do with all other methods)
+ { // ARGHHHHHHH ..... would like to implement this in proparrhlp_impl.hxx (as we do with all other methods)
// but SUNPRO 5 compiler (linker) doesn't like this
::osl::MutexGuard aGuard(s_aMutex);
OSL_ENSURE(s_nRefCount > 0, "OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
@@ -133,7 +133,7 @@ namespace connectivity
/** call this in the getInfoHelper method of your derived class. The method returns the array helper of the
class, which is created if neccessary.
*/
- ::cppu::IPropertyArrayHelper* getArrayHelper();
+ ::cppu::IPropertyArrayHelper* getArrayHelper();
protected:
/** used to implement the creation of the array helper which is shared amongst all instances of the class.
@@ -143,19 +143,19 @@ namespace connectivity
<BR>
as long as IPropertyArrayHelper has no virtual destructor, the implementation of ~OPropertyArrayUsageHelper
assumes that you created an ::cppu::OPropertyArrayHelper when deleting s_pProps.
- @return an pointer to the newly created array helper. Must not be NULL.
+ @return an pointer to the newly created array helper. Must not be NULL.
*/
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const = 0;
};
- template<class TYPE>
- sal_Int32 OPropertyArrayUsageHelper< TYPE >::s_nRefCount = 0;
+ template<class TYPE>
+ sal_Int32 OPropertyArrayUsageHelper< TYPE >::s_nRefCount = 0;
- template<class TYPE>
- ::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper< TYPE >::s_pProps = NULL;
+ template<class TYPE>
+ ::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper< TYPE >::s_pProps = NULL;
- template<class TYPE>
- ::osl::Mutex OPropertyArrayUsageHelper< TYPE >::s_aMutex;
+ template<class TYPE>
+ ::osl::Mutex OPropertyArrayUsageHelper< TYPE >::s_aMutex;
//------------------------------------------------------------------
template <class TYPE>
@@ -219,32 +219,32 @@ namespace connectivity
}
-#define DECLARE_SERVICE_INFO() \
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); \
- 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( ) throw(::com::sun::star::uno::RuntimeException) \
-
-#define IMPLEMENT_SERVICE_INFO(classname, implasciiname, serviceasciiname) \
- ::rtl::OUString SAL_CALL classname::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) \
- { \
- return ::rtl::OUString::createFromAscii(implasciiname); \
- } \
- ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL classname::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) \
- { \
- ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1); \
- aSupported[0] = ::rtl::OUString::createFromAscii(serviceasciiname); \
- return aSupported; \
- } \
- sal_Bool SAL_CALL classname::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) \
- { \
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames()); \
- const ::rtl::OUString* pSupported = aSupported.getConstArray(); \
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength(); \
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) \
- ; \
+#define DECLARE_SERVICE_INFO() \
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); \
+ 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( ) throw(::com::sun::star::uno::RuntimeException) \
+
+#define IMPLEMENT_SERVICE_INFO(classname, implasciiname, serviceasciiname) \
+ ::rtl::OUString SAL_CALL classname::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) \
+ { \
+ return ::rtl::OUString::createFromAscii(implasciiname); \
+ } \
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL classname::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) \
+ { \
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1); \
+ aSupported[0] = ::rtl::OUString::createFromAscii(serviceasciiname); \
+ return aSupported; \
+ } \
+ sal_Bool SAL_CALL classname::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) \
+ { \
+ Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames()); \
+ const ::rtl::OUString* pSupported = aSupported.getConstArray(); \
+ const ::rtl::OUString* pEnd = pSupported + aSupported.getLength(); \
+ for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) \
+ ; \
\
- return pSupported != pEnd; \
- } \
+ return pSupported != pEnd; \
+ } \
}
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/OTypeInfo.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/OTypeInfo.hxx
index 912f07bb64d7..4a28333adc35 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/OTypeInfo.hxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/OTypeInfo.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 _CONNECTIVITY_OTYPEINFO_HXX_
@@ -43,28 +43,28 @@ namespace connectivity
{
struct OTypeInfo
{
- ::rtl::OUString aTypeName; // Name des Types in der Datenbank
- ::rtl::OUString aLiteralPrefix; // Prefix zum Quoten
- ::rtl::OUString aLiteralSuffix; // Suffix zum Quoten
- ::rtl::OUString aCreateParams; // Parameter zum Erstellen
- ::rtl::OUString aLocalTypeName;
-
- sal_Int32 nPrecision; // Laenge des Types
-
- sal_Int16 nMaximumScale; // Nachkommastellen
- sal_Int16 nMinimumScale; // Min Nachkommastellen
-
- sal_Int16 nType; // Datenbanktyp
- sal_Int16 nSearchType; // kann nach dem Typen gesucht werden
- sal_Int16 nNumPrecRadix; // indicating the radix, which is usually 2 or 10
-
- sal_Bool bCurrency : 1, // Waehrung
- bAutoIncrement : 1, // Ist es ein automatisch incrementierendes Feld
- bNullable : 1, // Kann das Feld NULL annehmen
- bCaseSensitive : 1, // Ist der Type Casesensitive
- bUnsigned : 1, // Ist der Type Unsigned
- bEmpty_1 : 1, // for later use
- bEmpty_2 : 1;
+ ::rtl::OUString aTypeName; // Name des Types in der Datenbank
+ ::rtl::OUString aLiteralPrefix; // Prefix zum Quoten
+ ::rtl::OUString aLiteralSuffix; // Suffix zum Quoten
+ ::rtl::OUString aCreateParams; // Parameter zum Erstellen
+ ::rtl::OUString aLocalTypeName;
+
+ sal_Int32 nPrecision; // Laenge des Types
+
+ sal_Int16 nMaximumScale; // Nachkommastellen
+ sal_Int16 nMinimumScale; // Min Nachkommastellen
+
+ sal_Int16 nType; // Datenbanktyp
+ sal_Int16 nSearchType; // kann nach dem Typen gesucht werden
+ sal_Int16 nNumPrecRadix; // indicating the radix, which is usually 2 or 10
+
+ sal_Bool bCurrency : 1, // Waehrung
+ bAutoIncrement : 1, // Ist es ein automatisch incrementierendes Feld
+ bNullable : 1, // Kann das Feld NULL annehmen
+ bCaseSensitive : 1, // Ist der Type Casesensitive
+ bUnsigned : 1, // Ist der Type Unsigned
+ bEmpty_1 : 1, // for later use
+ bEmpty_2 : 1;
OTypeInfo()
:bCurrency(sal_False)
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx
index 1e52822705b8..62c70353b9f2 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.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 "SConnection.hxx"
@@ -52,7 +52,7 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::sdbc;
// --------------------------------------------------------------------------------
-OConnection::OConnection(SkeletonDriver* _pDriver)
+OConnection::OConnection(SkeletonDriver* _pDriver)
: OSubComponent<OConnection, OConnection_BASE>((::cppu::OWeakObject*)_pDriver, this),
OMetaConnection_BASE(m_aMutex),
m_pDriver(_pDriver),
@@ -81,7 +81,7 @@ void SAL_CALL OConnection::release() throw()
void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyValue >& info) throw(SQLException)
{
osl_incrementInterlockedCount( &m_refCount );
-
+
// some example code how to get the information out of the sequence
sal_Int32 nLen = url.indexOf(':');
@@ -89,17 +89,17 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
::rtl::OUString aDSN(RTL_CONSTASCII_USTRINGPARAM("DSN=")), aUID, aPWD, aSysDrvSettings;
aDSN += url.copy(nLen+1);
- const char* pUser = "user";
- const char* pTimeout = "Timeout";
- const char* pSilent = "Silent";
- const char* pPwd = "password";
+ const char* pUser = "user";
+ const char* pTimeout = "Timeout";
+ const char* pSilent = "Silent";
+ const char* pPwd = "password";
const char* pUseCatalog = "UseCatalog";
- const char* pSysDrv = "SystemDriverSettings";
+ const char* pSysDrv = "SystemDriverSettings";
sal_Int32 nTimeout = 20;
sal_Bool bSilent = sal_True;
- const PropertyValue *pBegin = info.getConstArray();
- const PropertyValue *pEnd = pBegin + info.getLength();
+ const PropertyValue *pBegin = info.getConstArray();
+ const PropertyValue *pEnd = pBegin + info.getLength();
for(;pBegin != pEnd;++pBegin)
{
if(!pBegin->Name.compareToAscii(pTimeout))
@@ -140,7 +140,7 @@ Reference< XStatement > SAL_CALL OConnection::createStatement( ) throw(SQLExcep
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
+
// create a statement
// the statement can only be executed once
Reference< XStatement > xReturn = new OStatement(this);
@@ -152,7 +152,7 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const ::
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
+
// the pre
if(m_aTypeInfo.empty())
buildTypeInfo();
@@ -168,8 +168,8 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl::
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- // not implemented yet :-) a task to do
+
+ // not implemented yet :-) a task to do
return NULL;
}
// --------------------------------------------------------------------------------
@@ -177,7 +177,7 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl::
{
::osl::MutexGuard aGuard( m_aMutex );
// when you need to transform SQL92 to you driver specific you can do it here
-
+
return _sSql;
}
// --------------------------------------------------------------------------------
@@ -210,7 +210,7 @@ void SAL_CALL OConnection::rollback( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
+
// same as commit but for the other case
}
@@ -218,7 +218,7 @@ void SAL_CALL OConnection::rollback( ) throw(SQLException, RuntimeException)
sal_Bool SAL_CALL OConnection::isClosed( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
-
+
// just simple -> we are close when we are disposed taht means someone called dispose(); (XComponent)
return OConnection_BASE::rBHelper.bDisposed;
}
@@ -227,7 +227,7 @@ Reference< XDatabaseMetaData > SAL_CALL OConnection::getMetaData( ) throw(SQLEx
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
+
// here we have to create the class with biggest interface
// The answer is 42 :-)
Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
@@ -244,15 +244,15 @@ void SAL_CALL OConnection::setReadOnly( sal_Bool readOnly ) throw(SQLException,
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
+
// set you connection to readonly
}
// --------------------------------------------------------------------------------
sal_Bool SAL_CALL OConnection::isReadOnly( ) throw(SQLException, RuntimeException)
-{
+{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
+
// return if your connection to readonly
return sal_False;
}
@@ -269,7 +269,7 @@ void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQ
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
+
// return your current catalog
return ::rtl::OUString();
@@ -288,7 +288,7 @@ sal_Int32 SAL_CALL OConnection::getTransactionIsolation( ) throw(SQLException,
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
+
// please have a look at @see com.sun.star.sdbc.TransactionIsolation
return TransactionIsolation::NONE;
@@ -298,7 +298,7 @@ Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OConnection::getT
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
+
// if your driver has special database types you can return it here
return NULL;
@@ -316,7 +316,7 @@ void SAL_CALL OConnection::close( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
+
}
dispose();
}
@@ -340,30 +340,30 @@ void OConnection::buildTypeInfo() throw( SQLException)
Reference< XResultSet> xRs = getMetaData ()->getTypeInfo ();
Reference< XRow> xRow(xRs,UNO_QUERY);
// Information for a single SQL type
-
+
// Loop on the result set until we reach end of file
- while (xRs->next ())
+ while (xRs->next ())
{
OTypeInfo aInfo;
- aInfo.aTypeName = xRow->getString (1);
- aInfo.nType = xRow->getShort (2);
- aInfo.nPrecision = xRow->getInt (3);
- aInfo.aLiteralPrefix = xRow->getString (4);
- aInfo.aLiteralSuffix = xRow->getString (5);
- aInfo.aCreateParams = xRow->getString (6);
- aInfo.bNullable = xRow->getBoolean (7) == ColumnValue::NULLABLE;
- aInfo.bCaseSensitive = xRow->getBoolean (8);
- aInfo.nSearchType = xRow->getShort (9);
- aInfo.bUnsigned = xRow->getBoolean (10);
- aInfo.bCurrency = xRow->getBoolean (11);
- aInfo.bAutoIncrement = xRow->getBoolean (12);
- aInfo.aLocalTypeName = xRow->getString (13);
- aInfo.nMinimumScale = xRow->getShort (14);
- aInfo.nMaximumScale = xRow->getShort (15);
- aInfo.nNumPrecRadix = (sal_Int16)xRow->getInt(18);
-
-
+ aInfo.aTypeName = xRow->getString (1);
+ aInfo.nType = xRow->getShort (2);
+ aInfo.nPrecision = xRow->getInt (3);
+ aInfo.aLiteralPrefix = xRow->getString (4);
+ aInfo.aLiteralSuffix = xRow->getString (5);
+ aInfo.aCreateParams = xRow->getString (6);
+ aInfo.bNullable = xRow->getBoolean (7) == ColumnValue::NULLABLE;
+ aInfo.bCaseSensitive = xRow->getBoolean (8);
+ aInfo.nSearchType = xRow->getShort (9);
+ aInfo.bUnsigned = xRow->getBoolean (10);
+ aInfo.bCurrency = xRow->getBoolean (11);
+ aInfo.bAutoIncrement = xRow->getBoolean (12);
+ aInfo.aLocalTypeName = xRow->getString (13);
+ aInfo.nMinimumScale = xRow->getShort (14);
+ aInfo.nMaximumScale = xRow->getShort (15);
+ aInfo.nNumPrecRadix = (sal_Int16)xRow->getInt(18);
+
+
// Now that we have the type info, save it
// in the Hashtable if we don't already have an
@@ -382,7 +382,7 @@ void OConnection::disposing()
{
// we noticed that we should be destroied in near future so we have to dispose our statements
::osl::MutexGuard aGuard(m_aMutex);
-
+
for (OWeakRefArray::iterator i = m_aStatements.begin(); m_aStatements.end() != i; ++i)
{
Reference< XComponent > xComp(i->get(), UNO_QUERY);
@@ -391,7 +391,7 @@ void OConnection::disposing()
}
m_aStatements.clear();
- m_bClosed = sal_True;
+ m_bClosed = sal_True;
m_xMetaData = ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDatabaseMetaData>();
dispose_ChildImpl();
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.hxx
index 8072094d7346..8961cf49bfa4 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.hxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.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 CONNECTIVITY_SCONNECTION_HXX
@@ -64,8 +64,8 @@ namespace connectivity
class SkeletonDriver;
class ODatabaseMetaData;
- typedef OMetaConnection_BASE OConnection_BASE; // implements basics and text encoding
- typedef ::std::vector< ::connectivity::OTypeInfo> TTypeInfoVector;
+ typedef OMetaConnection_BASE OConnection_BASE; // implements basics and text encoding
+ typedef ::std::vector< ::connectivity::OTypeInfo> TTypeInfoVector;
typedef std::vector< ::com::sun::star::uno::WeakReferenceHelper > OWeakRefArray;
class OConnection : public OBase_Mutex,
@@ -75,38 +75,38 @@ namespace connectivity
friend class connectivity::skeleton::OSubComponent<OConnection, OConnection_BASE>;
protected:
-
- rtl_TextEncoding m_nTextEncoding; // the encoding which is used for all text conversions
+
+ rtl_TextEncoding m_nTextEncoding; // the encoding which is used for all text conversions
//====================================================================
// Data attributes
//====================================================================
- TTypeInfoVector m_aTypeInfo; // vector containing an entry
+ TTypeInfoVector m_aTypeInfo; // vector containing an entry
// for each row returned by
// DatabaseMetaData.getTypeInfo.
::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
- OWeakRefArray m_aStatements; // vector containing a list
+ OWeakRefArray m_aStatements; // vector containing a list
// of all the Statement objects
// for this Connection
::com::sun::star::sdbc::SQLWarning m_aLastWarning; // Last SQLWarning generated by
// an operation
- ::rtl::OUString m_aURL; // URL of connection
- ::rtl::OUString m_sUser; // the user name
- SkeletonDriver* m_pDriver; // Pointer to the owning
+ ::rtl::OUString m_aURL; // URL of connection
+ ::rtl::OUString m_sUser; // the user name
+ SkeletonDriver* m_pDriver; // Pointer to the owning
// driver object
-
- sal_Bool m_bClosed;
- sal_Bool m_bUseCatalog; // should we use the catalog on filebased databases
- sal_Bool m_bUseOldDateFormat;
+
+ sal_Bool m_bClosed;
+ sal_Bool m_bUseCatalog; // should we use the catalog on filebased databases
+ sal_Bool m_bUseOldDateFormat;
void buildTypeInfo() throw( ::com::sun::star::sdbc::SQLException);
-
+
public:
virtual void construct( const ::rtl::OUString& url,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info) throw(::com::sun::star::sdbc::SQLException);
- OConnection(SkeletonDriver* _pDriver);
+ OConnection(SkeletonDriver* _pDriver);
virtual ~OConnection();
void closeAllStatements () throw( ::com::sun::star::sdbc::SQLException);
@@ -143,12 +143,12 @@ namespace connectivity
virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
//
-
+
// should we use the catalog on filebased databases
- inline sal_Bool isCatalogUsed() const { return m_bUseCatalog; }
- inline ::rtl::OUString getUserName() const { return m_sUser; }
- inline SkeletonDriver* getDriver() const { return m_pDriver;}
- inline rtl_TextEncoding getTextEncoding() const { return m_nTextEncoding; }
+ inline sal_Bool isCatalogUsed() const { return m_bUseCatalog; }
+ inline ::rtl::OUString getUserName() const { return m_sUser; }
+ inline SkeletonDriver* getDriver() const { return m_pDriver;}
+ inline rtl_TextEncoding getTextEncoding() const { return m_nTextEncoding; }
};
}
}
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.cxx
index 0a8bf55cbed1..b17b8053e9b0 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.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 "SDatabaseMetaData.hxx"
@@ -45,7 +45,7 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::sdbc;
-ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon)
+ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon)
: m_pConnection(_pCon)
, m_bUseCatalog(sal_True)
{
@@ -53,7 +53,7 @@ ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon)
if(!m_pConnection->isCatalogUsed())
{
osl_incrementInterlockedCount( &m_refCount );
- m_bUseCatalog = !(usesLocalFiles() || usesLocalFilePerTable());
+ m_bUseCatalog = !(usesLocalFiles() || usesLocalFilePerTable());
osl_decrementInterlockedCount( &m_refCount );
}
}
@@ -789,88 +789,88 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas( ) throw(SQLExce
return NULL;
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
+Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges(
+ const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
{
return NULL;
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
- const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern,
+Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
+ const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern,
const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
{
return NULL;
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
- const Any& catalog, const ::rtl::OUString& schemaPattern,
+Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
+ const Any& catalog, const ::rtl::OUString& schemaPattern,
const ::rtl::OUString& tableNamePattern, const Sequence< ::rtl::OUString >& types ) throw(SQLException, RuntimeException)
{
return NULL;
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns(
- const Any& catalog, const ::rtl::OUString& schemaPattern,
+Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns(
+ const Any& catalog, const ::rtl::OUString& schemaPattern,
const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
{
return NULL;
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures(
- const Any& catalog, const ::rtl::OUString& schemaPattern,
+Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures(
+ const Any& catalog, const ::rtl::OUString& schemaPattern,
const ::rtl::OUString& procedureNamePattern ) throw(SQLException, RuntimeException)
{
return NULL;
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns(
+Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns(
const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
{
return NULL;
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys(
+Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys(
const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
{
return NULL;
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys(
+Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys(
const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
{
return NULL;
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys(
+Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys(
const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException)
{
return NULL;
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
+Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo(
+ const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table,
sal_Bool unique, sal_Bool approximate ) throw(SQLException, RuntimeException)
{
return NULL;
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getBestRowIdentifier(
- const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope,
+Reference< XResultSet > SAL_CALL ODatabaseMetaData::getBestRowIdentifier(
+ const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope,
sal_Bool nullable ) throw(SQLException, RuntimeException)
{
return NULL;
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
+Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(SQLException, RuntimeException)
{
return NULL;
}
// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference(
- const Any& primaryCatalog, const ::rtl::OUString& primarySchema,
- const ::rtl::OUString& primaryTable, const Any& foreignCatalog,
+Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference(
+ const Any& primaryCatalog, const ::rtl::OUString& primarySchema,
+ const ::rtl::OUString& primaryTable, const Any& foreignCatalog,
const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(SQLException, RuntimeException)
{
return NULL;
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.hxx
index bdd3ac439796..4e62def377fd 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.hxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.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 CONNECTIVITY_SDATABASEMETADATA_HXX
@@ -52,8 +52,8 @@ namespace connectivity
class ODatabaseMetaData : public ODatabaseMetaData_BASE
{
- OConnection* m_pConnection;
- sal_Bool m_bUseCatalog;
+ OConnection* m_pConnection;
+ sal_Bool m_bUseCatalog;
public:
inline OConnection* getOwnConnection() const { return m_pConnection; }
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx
index 6e3521d8b878..d0f435effe60 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.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 "SDriver.hxx"
@@ -54,7 +54,7 @@ namespace connectivity
}
}
// --------------------------------------------------------------------------------
-SkeletonDriver::SkeletonDriver()
+SkeletonDriver::SkeletonDriver()
: ODriver_BASE(m_aMutex)
{
}
@@ -62,7 +62,7 @@ SkeletonDriver::SkeletonDriver()
void SkeletonDriver::disposing()
{
::osl::MutexGuard aGuard(m_aMutex);
-
+
// when driver will be destroied so all our connections have to be destroied as well
for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i)
{
@@ -86,7 +86,7 @@ rtl::OUString SkeletonDriver::getImplementationName_Static( ) throw(RuntimeExce
//------------------------------------------------------------------------------
Sequence< ::rtl::OUString > SkeletonDriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
{
- // which service is supported
+ // which service is supported
// for more information @see com.sun.star.sdbc.Driver
Sequence< ::rtl::OUString > aSNS( 1 );
aSNS[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdbc.Driver");
@@ -122,14 +122,14 @@ Reference< XConnection > SAL_CALL SkeletonDriver::connect( const ::rtl::OUString
{
// create a new connection with the given properties and append it to our vector
OConnection* pCon = new OConnection(this);
- Reference< XConnection > xCon = pCon; // important here because otherwise the connection could be deleted inside (refcount goes -> 0)
- pCon->construct(url,info); // late constructor call which can throw exception and allows a correct dtor call when so
+ Reference< XConnection > xCon = pCon; // important here because otherwise the connection could be deleted inside (refcount goes -> 0)
+ pCon->construct(url,info); // late constructor call which can throw exception and allows a correct dtor call when so
m_xConnections.push_back(WeakReferenceHelper(*pCon));
-
+
return xCon;
}
// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL SkeletonDriver::acceptsURL( const ::rtl::OUString& url )
+sal_Bool SAL_CALL SkeletonDriver::acceptsURL( const ::rtl::OUString& url )
throw(SQLException, RuntimeException)
{
// here we have to look if we support this url format
@@ -202,7 +202,7 @@ void checkDisposed(sal_Bool _bThrow) throw ( DisposedException )
{
if (_bThrow)
throw DisposedException();
-
+
}
//.........................................................................
}
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.hxx
index 36d50a486b6d..2c1cb2cc50ee 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.hxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.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 CONNECTIVITY_SDRIVER_HXX
@@ -47,14 +47,14 @@ namespace connectivity
{
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SkeletonDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception );
- typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::sdbc::XDriver,
+ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::sdbc::XDriver,
::com::sun::star::lang::XServiceInfo > ODriver_BASE;
class SkeletonDriver : public ODriver_BASE
{
protected:
- ::osl::Mutex m_aMutex; // mutex is need to control member access
- OWeakRefArray m_xConnections; // vector containing a list
+ ::osl::Mutex m_aMutex; // mutex is need to control member access
+ OWeakRefArray m_xConnections; // vector containing a list
// of all the Connection objects
// for this Driver
public:
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.cxx
index 17217402462f..f896abb13e98 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.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>
@@ -95,7 +95,7 @@ Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) thr
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
if(!m_xMetaData.is())
m_xMetaData = new OResultSetMetaData(getOwnConnection());
return m_xMetaData;
@@ -106,7 +106,7 @@ void SAL_CALL OPreparedStatement::close( ) throw(SQLException, RuntimeException
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
// Reset last warning message
@@ -127,7 +127,7 @@ sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeExc
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
// same as in statement with the difference that this statement also can contain parameter
return sal_False;
@@ -138,7 +138,7 @@ sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, Run
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
// same as in statement with the difference that this statement also can contain parameter
return 0;
}
@@ -155,7 +155,7 @@ Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQ
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
return (Reference< XConnection >)m_pConnection;
}
// -------------------------------------------------------------------------
@@ -164,10 +164,10 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLE
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
Reference< XResultSet > rs = NULL;
-
+
return rs;
}
// -------------------------------------------------------------------------
@@ -176,14 +176,14 @@ void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -192,7 +192,7 @@ void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const Date&
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -201,7 +201,7 @@ void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const Time&
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -209,7 +209,7 @@ void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -217,7 +217,7 @@ void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -226,7 +226,7 @@ void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x )
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -234,7 +234,7 @@ void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -242,7 +242,7 @@ void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 a
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -250,7 +250,7 @@ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 s
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -258,7 +258,7 @@ void SAL_CALL OPreparedStatement::setClob( sal_Int32 parameterIndex, const Refer
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -266,7 +266,7 @@ void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Refer
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -274,7 +274,7 @@ void SAL_CALL OPreparedStatement::setArray( sal_Int32 parameterIndex, const Refe
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -282,14 +282,14 @@ void SAL_CALL OPreparedStatement::setRef( sal_Int32 parameterIndex, const Refere
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 sqlType, sal_Int32 scale ) throw(SQLException, RuntimeException)
{
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- ::osl::MutexGuard aGuard( m_aMutex );
+ ::osl::MutexGuard aGuard( m_aMutex );
}
// -------------------------------------------------------------------------
@@ -298,7 +298,7 @@ void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_I
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -306,7 +306,7 @@ void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -314,7 +314,7 @@ void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -322,7 +322,7 @@ void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequ
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -331,7 +331,7 @@ void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex,
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -339,7 +339,7 @@ void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, con
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -381,7 +381,7 @@ void OPreparedStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,cons
// -----------------------------------------------------------------------------
void OPreparedStatement::checkParameterIndex(sal_Int32 _parameterIndex)
{
- if( !_parameterIndex || _parameterIndex > m_nNumParams)
+ if( !_parameterIndex || _parameterIndex > m_nNumParams)
throw SQLException();
}
// -----------------------------------------------------------------------------
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.hxx
index b01823f76a64..709d676db9bb 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.hxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.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 CONNECTIVITY_SPREPAREDSTATEMENT_HXX
@@ -48,42 +48,42 @@ namespace connectivity
{
class OBoundParam;
- typedef ::cppu::ImplHelper5< ::com::sun::star::sdbc::XPreparedStatement,
+ typedef ::cppu::ImplHelper5< ::com::sun::star::sdbc::XPreparedStatement,
::com::sun::star::sdbc::XParameters,
::com::sun::star::sdbc::XPreparedBatchExecution,
::com::sun::star::sdbc::XResultSetMetaDataSupplier,
::com::sun::star::lang::XServiceInfo> OPreparedStatement_BASE;
- class OPreparedStatement : public OStatement_BASE2,
+ class OPreparedStatement : public OStatement_BASE2,
public OPreparedStatement_BASE
{
protected:
struct Parameter
{
- ::com::sun::star::uno::Any aValue;
- sal_Int32 nDataType;
+ ::com::sun::star::uno::Any aValue;
+ sal_Int32 nDataType;
- Parameter(const ::com::sun::star::uno::Any& rValue,
- sal_Int32 rDataType) : aValue(rValue),nDataType(rDataType)
+ Parameter(const ::com::sun::star::uno::Any& rValue,
+ sal_Int32 rDataType) : aValue(rValue),nDataType(rDataType)
{
}
};
- ::std::vector< Parameter> m_aParameters;
+ ::std::vector< Parameter> m_aParameters;
//====================================================================
// Data attributes
//====================================================================
- TTypeInfoVector m_aTypeInfo; // Hashtable containing an entry
+ TTypeInfoVector m_aTypeInfo; // Hashtable containing an entry
// for each row returned by
// DatabaseMetaData.getTypeInfo.
- sal_Int32 m_nNumParams; // Number of parameter markers
+ sal_Int32 m_nNumParams; // Number of parameter markers
// for the prepared statement
- ::rtl::OUString m_sSqlStatement;
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData;
- sal_Bool m_bPrepared;
+ ::rtl::OUString m_sSqlStatement;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData;
+ sal_Bool m_bPrepared;
void checkParameterIndex(sal_Int32 _parameterIndex);
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx
index 985ddb032fc5..72c23a44667b 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.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 "SResultSet.hxx"
@@ -54,8 +54,8 @@ using namespace com::sun::star::io;
using namespace com::sun::star::util;
//------------------------------------------------------------------------------
-// IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
-::rtl::OUString SAL_CALL OResultSet::getImplementationName( ) throw ( RuntimeException) \
+// IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
+::rtl::OUString SAL_CALL OResultSet::getImplementationName( ) throw ( RuntimeException) \
{
return ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.skeleton.ResultSet");
}
@@ -80,7 +80,7 @@ sal_Bool SAL_CALL OResultSet::supportsService( const ::rtl::OUString& _rServiceN
}
// -------------------------------------------------------------------------
-OResultSet::OResultSet(OStatement_Base* pStmt)
+OResultSet::OResultSet(OStatement_Base* pStmt)
: OResultSet_BASE(m_aMutex)
,OPropertySetHelper(OResultSet_BASE::rBHelper)
,m_aStatement((OWeakObject*)pStmt)
@@ -101,8 +101,8 @@ void OResultSet::disposing(void)
::osl::MutexGuard aGuard(m_aMutex);
- m_aStatement = NULL;
- m_xMetaData = NULL;
+ m_aStatement = NULL;
+ m_xMetaData = NULL;
}
// -------------------------------------------------------------------------
Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeException)
@@ -126,10 +126,10 @@ Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeExcep
sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
{
-
+
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- // find the first column with the name columnName
+ // find the first column with the name columnName
::osl::MutexGuard aGuard( m_aMutex );
@@ -137,7 +137,7 @@ sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) t
sal_Int32 nLen = xMeta->getColumnCount();
sal_Int32 i = 1;
for(;i<=nLen;++i)
- if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
+ if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
break;
return i;
@@ -147,7 +147,7 @@ Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 column
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return NULL;
}
@@ -156,7 +156,7 @@ Reference< XInputStream > SAL_CALL OResultSet::getCharacterStream( sal_Int32 col
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return NULL;
}
@@ -166,7 +166,7 @@ sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLExcep
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return sal_False;
}
// -------------------------------------------------------------------------
@@ -175,7 +175,7 @@ sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLExceptio
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
sal_Int8 nRet = 0;
return nRet;
@@ -184,10 +184,10 @@ sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLExceptio
Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
-
+
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
::osl::MutexGuard aGuard( m_aMutex );
-
+
return Sequence< sal_Int8 >();
}
// -------------------------------------------------------------------------
@@ -196,7 +196,7 @@ Date SAL_CALL OResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, R
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
Date nRet;
return nRet;
@@ -207,7 +207,7 @@ double SAL_CALL OResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLExceptio
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
double nRet = 0;
return nRet;
@@ -218,7 +218,7 @@ float SAL_CALL OResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException,
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
float nVal(0);
return nVal;
@@ -229,7 +229,7 @@ sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 columnIndex ) throw(SQLExceptio
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
sal_Int32 nRet=0;
return nRet;
}
@@ -239,7 +239,7 @@ sal_Int32 SAL_CALL OResultSet::getRow( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
sal_Int32 nValue = 0;
return nValue;
}
@@ -249,7 +249,7 @@ sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 columnIndex ) throw(SQLExcepti
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return sal_Int64();
}
// -------------------------------------------------------------------------
@@ -258,7 +258,7 @@ Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLEx
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
if(!m_xMetaData.is())
m_xMetaData = new OResultSetMetaData(m_pStatement->getOwnConnection());
@@ -269,7 +269,7 @@ Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 columnIndex ) throw
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return NULL;
}
@@ -279,7 +279,7 @@ Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 columnIndex ) throw(S
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return NULL;
}
// -------------------------------------------------------------------------
@@ -287,7 +287,7 @@ Reference< XBlob > SAL_CALL OResultSet::getBlob( sal_Int32 columnIndex ) throw(S
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return NULL;
}
// -------------------------------------------------------------------------
@@ -296,7 +296,7 @@ Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 columnIndex ) throw(SQL
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return NULL;
}
// -------------------------------------------------------------------------
@@ -305,7 +305,7 @@ Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const Reference< ::co
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return Any();
}
// -------------------------------------------------------------------------
@@ -314,7 +314,7 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
sal_Int16 nRet=0;
return nRet;
@@ -326,8 +326,8 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
-
+
+
::rtl::OUString nRet;
return nRet;
}
@@ -348,7 +348,7 @@ Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, R
DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException)
{
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
::osl::MutexGuard aGuard( m_aMutex );
@@ -361,7 +361,7 @@ sal_Bool SAL_CALL OResultSet::isBeforeFirst( ) throw(SQLException, RuntimeExcep
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
// here you have to implement your movements
// return true means there is no data
@@ -372,7 +372,7 @@ sal_Bool SAL_CALL OResultSet::isAfterLast( ) throw(SQLException, RuntimeExcepti
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return sal_True;
}
// -------------------------------------------------------------------------
@@ -380,7 +380,7 @@ sal_Bool SAL_CALL OResultSet::isFirst( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return sal_False;
}
@@ -389,7 +389,7 @@ sal_Bool SAL_CALL OResultSet::isLast( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return sal_False;
}
@@ -398,7 +398,7 @@ void SAL_CALL OResultSet::beforeFirst( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
// move before the first row so that isBeforeFirst returns false
// the smae for other movement methods
}
@@ -415,7 +415,7 @@ void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
dispose();
}
@@ -425,7 +425,7 @@ sal_Bool SAL_CALL OResultSet::first( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return sal_False;
}
// -------------------------------------------------------------------------
@@ -442,7 +442,7 @@ sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row ) throw(SQLException, Runt
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return sal_False;
}
// -------------------------------------------------------------------------
@@ -466,7 +466,7 @@ Reference< XInterface > SAL_CALL OResultSet::getStatement( ) throw(SQLException
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return m_aStatement.get();
}
@@ -476,16 +476,16 @@ sal_Bool SAL_CALL OResultSet::rowDeleted( ) throw(SQLException, RuntimeExceptio
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return sal_False;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL OResultSet::rowInserted( ) throw(SQLException, RuntimeException)
-{
+{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return sal_False;
}
@@ -494,7 +494,7 @@ sal_Bool SAL_CALL OResultSet::rowUpdated( ) throw(SQLException, RuntimeExceptio
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return sal_False;
}
@@ -504,7 +504,7 @@ sal_Bool SAL_CALL OResultSet::next( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return sal_False;
}
@@ -514,7 +514,7 @@ sal_Bool SAL_CALL OResultSet::wasNull( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return m_bWasNull;
}
@@ -524,7 +524,7 @@ void SAL_CALL OResultSet::cancel( ) throw(RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::clearWarnings( ) throw(SQLException, RuntimeException)
@@ -548,7 +548,7 @@ void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
// only when you allow updates
}
@@ -571,7 +571,7 @@ void SAL_CALL OResultSet::moveToInsertRow( ) throw(SQLException, RuntimeExcepti
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
// only when you allow insert's
}
@@ -595,7 +595,7 @@ void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) thr
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException)
@@ -610,7 +610,7 @@ void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) thro
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException)
@@ -624,14 +624,14 @@ void SAL_CALL OResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -----------------------------------------------------------------------
void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -639,28 +639,28 @@ void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw(
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const Date& x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -668,7 +668,7 @@ void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const Time& x ) thr
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -676,7 +676,7 @@ void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const DateTime
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -684,28 +684,28 @@ void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const Refer
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
@@ -713,7 +713,7 @@ void SAL_CALL OResultSet::updateNumericObject( sal_Int32 columnIndex, const Any&
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
}
// -------------------------------------------------------------------------
// XRowLocate
@@ -747,7 +747,7 @@ sal_Int32 SAL_CALL OResultSet::compareBookmarks( const Any& first, const Any&
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return CompareBookmark::NOT_EQUAL;
}
@@ -767,7 +767,7 @@ Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >&
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+
return Sequence< sal_Int32 >();
}
// -------------------------------------------------------------------------
@@ -776,12 +776,12 @@ IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
Sequence< Property > aProps(6);
Property* pProperties = aProps.getArray();
sal_Int32 nPos = 0;
- DECL_PROP1IMPL(CURSORNAME, ::rtl::OUString) PropertyAttribute::READONLY);
- DECL_PROP0(FETCHDIRECTION, sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
+ DECL_PROP1IMPL(CURSORNAME, ::rtl::OUString) PropertyAttribute::READONLY);
+ DECL_PROP0(FETCHDIRECTION, sal_Int32);
+ DECL_PROP0(FETCHSIZE, sal_Int32);
DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
- DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY);
+ DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY);
return new OPropertyArrayHelper(aProps);
}
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.hxx
index 9a102418bd99..b626a56a60df 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.hxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.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 CONNECTIVITY_SRESULTSET_HXX
@@ -57,7 +57,7 @@ namespace connectivity
{
/*
- ** OResultSet
+ ** OResultSet
*/
typedef ::cppu::WeakComponentImplHelper12< ::com::sun::star::sdbc::XResultSet,
::com::sun::star::sdbc::XRow,
@@ -72,17 +72,17 @@ namespace connectivity
::com::sun::star::sdbc::XColumnLocate,
::com::sun::star::lang::XServiceInfo> OResultSet_BASE;
- class OResultSet : public OBase_Mutex,
- public OResultSet_BASE,
- public ::cppu::OPropertySetHelper,
- public OPropertyArrayUsageHelper<OResultSet>
+ class OResultSet : public OBase_Mutex,
+ public OResultSet_BASE,
+ public ::cppu::OPropertySetHelper,
+ public OPropertyArrayUsageHelper<OResultSet>
{
protected:
- OStatement_Base* m_pStatement;
- ::com::sun::star::uno::WeakReferenceHelper m_aStatement;
+ OStatement_Base* m_pStatement;
+ ::com::sun::star::uno::WeakReferenceHelper m_aStatement;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
- rtl_TextEncoding m_nTextEncoding;
- sal_Bool m_bWasNull;
+ rtl_TextEncoding m_nTextEncoding;
+ sal_Bool m_bWasNull;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
@@ -109,9 +109,9 @@ namespace connectivity
virtual ~OResultSet();
public:
DECLARE_SERVICE_INFO();
-
+
OResultSet( OStatement_Base* pStmt);
-
+
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
{
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.cxx
index 86ec005351ae..0f7af1fc60c3 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.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 "SResultSetMetaData.hxx"
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.hxx
index 1560801b4391..92418de6f96d 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.hxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.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 CONNECTIVITY_SRESULSETMETADATA_HXX
@@ -49,15 +49,15 @@ namespace connectivity
//**************************************************************
typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> OResultSetMetaData_BASE;
- class OResultSetMetaData : public OResultSetMetaData_BASE
+ class OResultSetMetaData : public OResultSetMetaData_BASE
{
- OConnection* m_pConnection;
+ OConnection* m_pConnection;
protected:
virtual ~OResultSetMetaData();
public:
// ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
- OResultSetMetaData(OConnection* _pConnection) : m_pConnection(_pConnection){}
+ OResultSetMetaData(OConnection* _pConnection) : m_pConnection(_pConnection){}
/// Avoid ambigous cast error from the compiler.
inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw()
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx
index fdfedd684766..2de009ddb86d 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.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 "SDriver.hxx"
@@ -48,7 +48,7 @@ using ::com::sun::star::lang::XMultiServiceFactory;
typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
(
const Reference< XMultiServiceFactory > & rServiceManager,
- const OUString & rComponentName,
+ const OUString & rComponentName,
::cppu::ComponentInstantiation pCreateFunction,
const Sequence< OUString > & rServiceNames,
rtl_ModuleCount* _pTemp
@@ -62,8 +62,8 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
//---------------------------------------------------------------------------------------
void REGISTER_PROVIDER(
- const OUString& aServiceImplName,
- const Sequence< OUString>& Services,
+ const OUString& aServiceImplName,
+ const Sequence< OUString>& Services,
const Reference< ::com::sun::star::registry::XRegistryKey > & xKey)
{
OUString aMainKeyName;
@@ -97,31 +97,31 @@ struct ProviderRequest
inline
sal_Bool CREATE_PROVIDER(
- const OUString& Implname,
- const Sequence< OUString > & Services,
+ const OUString& Implname,
+ const Sequence< OUString > & Services,
::cppu::ComponentInstantiation Factory,
createFactoryFunc creator
)
{
if (!xRet.is() && (Implname == sImplementationName))
- try
- {
- xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
+ try
+ {
+ xRet = creator( xServiceManager, sImplementationName,Factory, Services,0);
}
catch(...)
{
}
return xRet.is();
}
-
+
void* getProvider() const { return xRet.get(); }
};
//---------------------------------------------------------------------------------------
extern "C" void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **ppEnvTypeName,
- uno_Environment **ppEnv
+ const sal_Char **ppEnvTypeName,
+ uno_Environment **ppEnv
)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
@@ -133,14 +133,14 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(
void* pRegistryKey
)
{
- if (pRegistryKey)
- try
+ if (pRegistryKey)
+ try
{
Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey));
REGISTER_PROVIDER(
- SkeletonDriver::getImplementationName_Static(),
- SkeletonDriver::getSupportedServiceNames_Static(), xKey);
+ SkeletonDriver::getImplementationName_Static(),
+ SkeletonDriver::getSupportedServiceNames_Static(), xKey);
return sal_True;
}
@@ -164,9 +164,9 @@ extern "C" void* SAL_CALL component_getFactory(
ProviderRequest aReq(pServiceManager,pImplementationName);
aReq.CREATE_PROVIDER(
- SkeletonDriver::getImplementationName_Static(),
+ SkeletonDriver::getImplementationName_Static(),
SkeletonDriver::getSupportedServiceNames_Static(),
- SkeletonDriver_CreateInstance, ::cppu::createSingleFactory)
+ SkeletonDriver_CreateInstance, ::cppu::createSingleFactory)
;
if(aReq.xRet.is())
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.cxx
index ea1bf91b644e..5e1bee3d5d32 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.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>
@@ -57,7 +57,7 @@ using namespace com::sun::star::container;
using namespace com::sun::star::io;
using namespace com::sun::star::util;
//------------------------------------------------------------------------------
-OStatement_Base::OStatement_Base(OConnection* _pConnection )
+OStatement_Base::OStatement_Base(OConnection* _pConnection )
: OStatement_BASE(m_aMutex),
OPropertySetHelper(OStatement_BASE::rBHelper),
rBHelper(OStatement_BASE::rBHelper),
@@ -130,7 +130,7 @@ void SAL_CALL OStatement_Base::close( ) throw(SQLException, RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
}
dispose();
}
@@ -145,7 +145,7 @@ sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(S
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
// returns true when a resultset is available
return sal_False;
}
@@ -155,7 +155,7 @@ Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const ::rtl::OUS
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
Reference< XResultSet > xRS = NULL;
// create a resultset as result of executing the sql statement
@@ -169,7 +169,7 @@ Reference< XConnection > SAL_CALL OStatement_Base::getConnection( ) throw(SQLEx
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
// just return our connection here
return (Reference< XConnection >)m_pConnection;
}
@@ -193,7 +193,7 @@ void SAL_CALL OStatement::addBatch( const ::rtl::OUString& sql ) throw(SQLExcept
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
m_aBatchList.push_back(sql);
}
@@ -202,7 +202,7 @@ Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( ) throw(SQLException,
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
return Sequence< sal_Int32 >();
}
// -------------------------------------------------------------------------
@@ -212,8 +212,8 @@ sal_Int32 SAL_CALL OStatement_Base::executeUpdate( const ::rtl::OUString& sql )
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
- // the return values gives information about how many rows are affected by executing the sql statement
+
+ // the return values gives information about how many rows are affected by executing the sql statement
return 0;
}
@@ -223,8 +223,8 @@ Reference< XResultSet > SAL_CALL OStatement_Base::getResultSet( ) throw(SQLExce
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-// return our save resultset here
+
+// return our save resultset here
return m_xResultSet;
}
// -------------------------------------------------------------------------
@@ -234,7 +234,7 @@ sal_Bool SAL_CALL OStatement_Base::getMoreResults( ) throw(SQLException, Runtim
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
- // if your driver supports more than only one resultset
+ // if your driver supports more than only one resultset
// and has one more at this moment return true
return sal_False;
}
@@ -245,7 +245,7 @@ Any SAL_CALL OStatement_Base::getWarnings( ) throw(SQLException, RuntimeExcepti
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
return makeAny(m_aLastWarning);
}
@@ -256,7 +256,7 @@ void SAL_CALL OStatement_Base::clearWarnings( ) throw(SQLException, RuntimeExce
{
::osl::MutexGuard aGuard( m_aMutex );
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+
m_aLastWarning = SQLWarning();
}
@@ -268,12 +268,12 @@ void SAL_CALL OStatement_Base::clearWarnings( ) throw(SQLException, RuntimeExce
Sequence< Property > aProps(10);
Property* pProperties = aProps.getArray();
sal_Int32 nPos = 0;
- DECL_PROP0(CURSORNAME, ::rtl::OUString);
+ DECL_PROP0(CURSORNAME, ::rtl::OUString);
DECL_BOOL_PROP0(ESCAPEPROCESSING);
DECL_PROP0(FETCHDIRECTION,sal_Int32);
- DECL_PROP0(FETCHSIZE, sal_Int32);
+ DECL_PROP0(FETCHSIZE, sal_Int32);
DECL_PROP0(MAXFIELDSIZE,sal_Int32);
- DECL_PROP0(MAXROWS, sal_Int32);
+ DECL_PROP0(MAXROWS, sal_Int32);
DECL_PROP0(QUERYTIMEOUT,sal_Int32);
DECL_PROP0(RESULTSETCONCURRENCY,sal_Int32);
DECL_PROP0(RESULTSETTYPE,sal_Int32);
@@ -296,7 +296,7 @@ sal_Bool OStatement_Base::convertFastPropertyValue(
throw (::com::sun::star::lang::IllegalArgumentException)
{
sal_Bool bConverted = sal_False;
- // here we have to try to convert
+ // here we have to try to convert
return bConverted;
}
// -------------------------------------------------------------------------
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.hxx
index 7dc260c32b6b..d8d32a4aa5b5 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.hxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.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 CONNECTIVITY_SSTATEMENT_HXX
@@ -54,7 +54,7 @@ namespace connectivity
namespace skeleton
{
- typedef ::cppu::WeakComponentImplHelper5< ::com::sun::star::sdbc::XStatement,
+ typedef ::cppu::WeakComponentImplHelper5< ::com::sun::star::sdbc::XStatement,
::com::sun::star::sdbc::XWarningsSupplier,
::com::sun::star::util::XCancellable,
::com::sun::star::sdbc::XCloseable,
@@ -64,10 +64,10 @@ namespace connectivity
//************ Class: OStatement_Base
// is a base class for the normal statement and for the prepared statement
//**************************************************************
- class OStatement_Base : public OBase_Mutex,
- public OStatement_BASE,
- public ::cppu::OPropertySetHelper,
- public OPropertyArrayUsageHelper<OStatement_Base>
+ class OStatement_Base : public OBase_Mutex,
+ public OStatement_BASE,
+ public ::cppu::OPropertySetHelper,
+ public OPropertyArrayUsageHelper<OStatement_Base>
{
::com::sun::star::sdbc::SQLWarning m_aLastWarning;
@@ -75,9 +75,9 @@ namespace connectivity
::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet> m_xResultSet; // The last ResultSet created
// for this Statement
- ::std::list< ::rtl::OUString> m_aBatchList;
+ ::std::list< ::rtl::OUString> m_aBatchList;
- OConnection* m_pConnection; // The owning Connection object
+ OConnection* m_pConnection; // The owning Connection object
protected:
void disposeResultSet();
@@ -94,7 +94,7 @@ namespace connectivity
throw (::com::sun::star::lang::IllegalArgumentException);
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception);
+ const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception);
virtual void SAL_CALL getFastPropertyValue(
::com::sun::star::uno::Any& rValue,
sal_Int32 nHandle) const;
@@ -138,7 +138,7 @@ namespace connectivity
OConnection* getOwnConnection() const { return m_pConnection;}
};
- class OStatement_BASE2 :public OStatement_Base
+ class OStatement_BASE2 :public OStatement_Base
,public OSubComponent<OStatement_BASE2, OStatement_BASE>
{
@@ -152,7 +152,7 @@ namespace connectivity
virtual void SAL_CALL release() throw();
};
- class OStatement : public OStatement_BASE2,
+ class OStatement : public OStatement_BASE2,
public ::com::sun::star::sdbc::XBatchExecution,
public ::com::sun::star::lang::XServiceInfo
{
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.cxx
index 832f59757f34..9cd66a47a34b 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.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 <osl/diagnose.h>
@@ -39,64 +39,64 @@ namespace connectivity
{
namespace skeleton
{
- const sal_Char* getPROPERTY_QUERYTIMEOUT() { return "QueryTimeOut"; }
- const sal_Char* getPROPERTY_MAXFIELDSIZE() { return "MaxFieldSize"; }
- const sal_Char* getPROPERTY_MAXROWS() { return "MaxRows"; }
- const sal_Char* getPROPERTY_CURSORNAME() { return "CursorName"; }
- const sal_Char* getPROPERTY_RESULTSETCONCURRENCY() { return "ResultSetConcurrency"; }
- const sal_Char* getPROPERTY_RESULTSETTYPE() { return "ResultSetType"; }
- const sal_Char* getPROPERTY_FETCHDIRECTION() { return "FetchDirection"; }
- const sal_Char* getPROPERTY_FETCHSIZE() { return "FetchSize"; }
- const sal_Char* getPROPERTY_ESCAPEPROCESSING() { return "EscapeProcessing"; }
- const sal_Char* getPROPERTY_USEBOOKMARKS() { return "UseBookmarks"; }
-
- const sal_Char* getPROPERTY_NAME() { return "Name"; }
- const sal_Char* getPROPERTY_TYPE() { return "Type"; }
- const sal_Char* getPROPERTY_TYPENAME() { return "TypeName"; }
- const sal_Char* getPROPERTY_PRECISION() { return "Precision"; }
- const sal_Char* getPROPERTY_SCALE() { return "Scale"; }
- const sal_Char* getPROPERTY_ISNULLABLE() { return "IsNullable"; }
- const sal_Char* getPROPERTY_ISAUTOINCREMENT() { return "IsAutoIncrement"; }
- const sal_Char* getPROPERTY_ISROWVERSION() { return "IsRowVersion"; }
- const sal_Char* getPROPERTY_DESCRIPTION() { return "Description"; }
- const sal_Char* getPROPERTY_DEFAULTVALUE() { return "DefaultValue"; }
-
- const sal_Char* getPROPERTY_REFERENCEDTABLE() { return "ReferencedTable"; }
- const sal_Char* getPROPERTY_UPDATERULE() { return "UpdateRule"; }
- const sal_Char* getPROPERTY_DELETERULE() { return "DeleteRule"; }
- const sal_Char* getPROPERTY_CATALOG() { return "Catalog"; }
- const sal_Char* getPROPERTY_ISUNIQUE() { return "IsUnique"; }
- const sal_Char* getPROPERTY_ISPRIMARYKEYINDEX() { return "IsPrimaryKeyIndex"; }
- const sal_Char* getPROPERTY_ISCLUSTERED() { return "IsClustered"; }
- const sal_Char* getPROPERTY_ISASCENDING() { return "IsAscending"; }
- const sal_Char* getPROPERTY_SCHEMANAME() { return "SchemaName"; }
- const sal_Char* getPROPERTY_CATALOGNAME() { return "CatalogName"; }
- const sal_Char* getPROPERTY_COMMAND() { return "Command"; }
- const sal_Char* getPROPERTY_CHECKOPTION() { return "CheckOption"; }
- const sal_Char* getPROPERTY_PASSWORD() { return "Password"; }
- const sal_Char* getPROPERTY_RELATEDCOLUMN() { return "RelatedColumn"; }
-
- const sal_Char* getSTAT_INVALID_INDEX() { return "Invalid descriptor index"; }
+ const sal_Char* getPROPERTY_QUERYTIMEOUT() { return "QueryTimeOut"; }
+ const sal_Char* getPROPERTY_MAXFIELDSIZE() { return "MaxFieldSize"; }
+ const sal_Char* getPROPERTY_MAXROWS() { return "MaxRows"; }
+ const sal_Char* getPROPERTY_CURSORNAME() { return "CursorName"; }
+ const sal_Char* getPROPERTY_RESULTSETCONCURRENCY() { return "ResultSetConcurrency"; }
+ const sal_Char* getPROPERTY_RESULTSETTYPE() { return "ResultSetType"; }
+ const sal_Char* getPROPERTY_FETCHDIRECTION() { return "FetchDirection"; }
+ const sal_Char* getPROPERTY_FETCHSIZE() { return "FetchSize"; }
+ const sal_Char* getPROPERTY_ESCAPEPROCESSING() { return "EscapeProcessing"; }
+ const sal_Char* getPROPERTY_USEBOOKMARKS() { return "UseBookmarks"; }
+
+ const sal_Char* getPROPERTY_NAME() { return "Name"; }
+ const sal_Char* getPROPERTY_TYPE() { return "Type"; }
+ const sal_Char* getPROPERTY_TYPENAME() { return "TypeName"; }
+ const sal_Char* getPROPERTY_PRECISION() { return "Precision"; }
+ const sal_Char* getPROPERTY_SCALE() { return "Scale"; }
+ const sal_Char* getPROPERTY_ISNULLABLE() { return "IsNullable"; }
+ const sal_Char* getPROPERTY_ISAUTOINCREMENT() { return "IsAutoIncrement"; }
+ const sal_Char* getPROPERTY_ISROWVERSION() { return "IsRowVersion"; }
+ const sal_Char* getPROPERTY_DESCRIPTION() { return "Description"; }
+ const sal_Char* getPROPERTY_DEFAULTVALUE() { return "DefaultValue"; }
+
+ const sal_Char* getPROPERTY_REFERENCEDTABLE() { return "ReferencedTable"; }
+ const sal_Char* getPROPERTY_UPDATERULE() { return "UpdateRule"; }
+ const sal_Char* getPROPERTY_DELETERULE() { return "DeleteRule"; }
+ const sal_Char* getPROPERTY_CATALOG() { return "Catalog"; }
+ const sal_Char* getPROPERTY_ISUNIQUE() { return "IsUnique"; }
+ const sal_Char* getPROPERTY_ISPRIMARYKEYINDEX() { return "IsPrimaryKeyIndex"; }
+ const sal_Char* getPROPERTY_ISCLUSTERED() { return "IsClustered"; }
+ const sal_Char* getPROPERTY_ISASCENDING() { return "IsAscending"; }
+ const sal_Char* getPROPERTY_SCHEMANAME() { return "SchemaName"; }
+ const sal_Char* getPROPERTY_CATALOGNAME() { return "CatalogName"; }
+ const sal_Char* getPROPERTY_COMMAND() { return "Command"; }
+ const sal_Char* getPROPERTY_CHECKOPTION() { return "CheckOption"; }
+ const sal_Char* getPROPERTY_PASSWORD() { return "Password"; }
+ const sal_Char* getPROPERTY_RELATEDCOLUMN() { return "RelatedColumn"; }
+
+ const sal_Char* getSTAT_INVALID_INDEX() { return "Invalid descriptor index"; }
+
+ const sal_Char* getPROPERTY_FUNCTION() { return "Function"; }
+ const sal_Char* getPROPERTY_TABLENAME() { return "TableName"; }
+ const sal_Char* getPROPERTY_REALNAME() { return "RealName"; }
+ const sal_Char* getPROPERTY_DBASEPRECISIONCHANGED() { return "DbasePrecisionChanged"; }
+ const sal_Char* getPROPERTY_ISCURRENCY() { return "IsCurrency"; }
+ const sal_Char* getPROPERTY_ISBOOKMARKABLE() { return "IsBookmarkable"; }
- const sal_Char* getPROPERTY_FUNCTION() { return "Function"; }
- const sal_Char* getPROPERTY_TABLENAME() { return "TableName"; }
- const sal_Char* getPROPERTY_REALNAME() { return "RealName"; }
- const sal_Char* getPROPERTY_DBASEPRECISIONCHANGED() { return "DbasePrecisionChanged"; }
- const sal_Char* getPROPERTY_ISCURRENCY() { return "IsCurrency"; }
- const sal_Char* getPROPERTY_ISBOOKMARKABLE() { return "IsBookmarkable"; }
+ const sal_Char* getPROPERTY_FORMATKEY() { return "FormatKey"; }
+ const sal_Char* getPROPERTY_LOCALE() { return "Locale"; }
- const sal_Char* getPROPERTY_FORMATKEY() { return "FormatKey"; }
- const sal_Char* getPROPERTY_LOCALE() { return "Locale"; }
-
- const sal_Char* getPROPERTY_AUTOINCREMENTCREATION() { return "AutoIncrementCreation"; }
- const sal_Char* getPROPERTY_PRIVILEGES() { return "Privileges"; }
+ const sal_Char* getPROPERTY_AUTOINCREMENTCREATION() { return "AutoIncrementCreation"; }
+ const sal_Char* getPROPERTY_PRIVILEGES() { return "Privileges"; }
//============================================================
//= error messages
//============================================================
- const sal_Char* getERRORMSG_SEQUENCE() { return "Function sequence error"; }
- const sal_Char* getSQLSTATE_SEQUENCE() { return "HY010"; }
- const sal_Char* getSQLSTATE_GENERAL() { return "HY0000"; }
- const sal_Char* getSTR_DELIMITER() { return "/"; }
+ const sal_Char* getERRORMSG_SEQUENCE() { return "Function sequence error"; }
+ const sal_Char* getSQLSTATE_SEQUENCE() { return "HY010"; }
+ const sal_Char* getSQLSTATE_GENERAL() { return "HY0000"; }
+ const sal_Char* getSTR_DELIMITER() { return "/"; }
OPropertyMap::~OPropertyMap()
{
@@ -122,59 +122,59 @@ namespace skeleton
rtl_uString* pStr = NULL;
switch(_nIndex)
{
- case PROPERTY_ID_QUERYTIMEOUT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_QUERYTIMEOUT() ); break; }
- case PROPERTY_ID_MAXFIELDSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXFIELDSIZE() ); break; }
- case PROPERTY_ID_MAXROWS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXROWS() ); break; }
- case PROPERTY_ID_CURSORNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CURSORNAME() ); break; }
- case PROPERTY_ID_RESULTSETCONCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETCONCURRENCY() ); break; }
- case PROPERTY_ID_RESULTSETTYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETTYPE() ); break; }
- case PROPERTY_ID_FETCHDIRECTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHDIRECTION() ); break; }
- case PROPERTY_ID_FETCHSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHSIZE() ); break; }
- case PROPERTY_ID_ESCAPEPROCESSING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ESCAPEPROCESSING() ); break; }
- case PROPERTY_ID_USEBOOKMARKS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_USEBOOKMARKS() ); break; }
- // Column
- case PROPERTY_ID_NAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_NAME() ); break; }
- case PROPERTY_ID_TYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPE() ); break; }
- case PROPERTY_ID_TYPENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPENAME() ); break; }
- case PROPERTY_ID_PRECISION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRECISION() ); break; }
- case PROPERTY_ID_SCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCALE() ); break; }
- case PROPERTY_ID_ISNULLABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISNULLABLE() ); break; }
- case PROPERTY_ID_ISAUTOINCREMENT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISAUTOINCREMENT() ); break; }
- case PROPERTY_ID_ISROWVERSION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISROWVERSION() ); break; }
- case PROPERTY_ID_DESCRIPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DESCRIPTION() ); break; }
- case PROPERTY_ID_DEFAULTVALUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DEFAULTVALUE() ); break; }
-
- case PROPERTY_ID_REFERENCEDTABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REFERENCEDTABLE() ); break; }
- case PROPERTY_ID_UPDATERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_UPDATERULE() ); break; }
- case PROPERTY_ID_DELETERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DELETERULE() ); break; }
- case PROPERTY_ID_CATALOG: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOG() ); break; }
- case PROPERTY_ID_ISUNIQUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISUNIQUE() ); break; }
- case PROPERTY_ID_ISPRIMARYKEYINDEX: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISPRIMARYKEYINDEX() ); break; }
- case PROPERTY_ID_ISCLUSTERED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCLUSTERED() ); break; }
- case PROPERTY_ID_ISASCENDING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISASCENDING() ); break; }
- case PROPERTY_ID_SCHEMANAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCHEMANAME() ); break; }
- case PROPERTY_ID_CATALOGNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOGNAME() ); break; }
-
- case PROPERTY_ID_COMMAND: { rtl_uString_newFromAscii(&pStr,getPROPERTY_COMMAND() ); break; }
- case PROPERTY_ID_CHECKOPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CHECKOPTION() ); break; }
- case PROPERTY_ID_PASSWORD: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PASSWORD() ); break; }
- case PROPERTY_ID_RELATEDCOLUMN: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RELATEDCOLUMN() ); break; }
-
- case PROPERTY_ID_FUNCTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FUNCTION() ); break; }
- case PROPERTY_ID_TABLENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TABLENAME() ); break; }
- case PROPERTY_ID_REALNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REALNAME() ); break; }
- case PROPERTY_ID_DBASEPRECISIONCHANGED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DBASEPRECISIONCHANGED() ); break; }
- case PROPERTY_ID_ISCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCURRENCY() ); break; }
- case PROPERTY_ID_ISBOOKMARKABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISBOOKMARKABLE() ); break; }
- case PROPERTY_ID_INVALID_INDEX: { rtl_uString_newFromAscii(&pStr,getSTAT_INVALID_INDEX() ); break; }
- case PROPERTY_ID_ERRORMSG_SEQUENCE: { rtl_uString_newFromAscii(&pStr,getERRORMSG_SEQUENCE() ); break; }
- case PROPERTY_ID_HY010: { rtl_uString_newFromAscii(&pStr,getSQLSTATE_SEQUENCE() ); break; }
- case PROPERTY_ID_HY0000: { rtl_uString_newFromAscii(&pStr,getSQLSTATE_GENERAL() ); break; }
- case PROPERTY_ID_DELIMITER: { rtl_uString_newFromAscii(&pStr,getSTR_DELIMITER() ); break; }
- case PROPERTY_ID_FORMATKEY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FORMATKEY() ); break; }
- case PROPERTY_ID_LOCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_LOCALE() ); break; }
- case PROPERTY_ID_AUTOINCREMENTCREATION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_AUTOINCREMENTCREATION() ); break; }
- case PROPERTY_ID_PRIVILEGES: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRIVILEGES() ); break; }
+ case PROPERTY_ID_QUERYTIMEOUT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_QUERYTIMEOUT() ); break; }
+ case PROPERTY_ID_MAXFIELDSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXFIELDSIZE() ); break; }
+ case PROPERTY_ID_MAXROWS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXROWS() ); break; }
+ case PROPERTY_ID_CURSORNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CURSORNAME() ); break; }
+ case PROPERTY_ID_RESULTSETCONCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETCONCURRENCY() ); break; }
+ case PROPERTY_ID_RESULTSETTYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETTYPE() ); break; }
+ case PROPERTY_ID_FETCHDIRECTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHDIRECTION() ); break; }
+ case PROPERTY_ID_FETCHSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHSIZE() ); break; }
+ case PROPERTY_ID_ESCAPEPROCESSING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ESCAPEPROCESSING() ); break; }
+ case PROPERTY_ID_USEBOOKMARKS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_USEBOOKMARKS() ); break; }
+ // Column
+ case PROPERTY_ID_NAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_NAME() ); break; }
+ case PROPERTY_ID_TYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPE() ); break; }
+ case PROPERTY_ID_TYPENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPENAME() ); break; }
+ case PROPERTY_ID_PRECISION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRECISION() ); break; }
+ case PROPERTY_ID_SCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCALE() ); break; }
+ case PROPERTY_ID_ISNULLABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISNULLABLE() ); break; }
+ case PROPERTY_ID_ISAUTOINCREMENT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISAUTOINCREMENT() ); break; }
+ case PROPERTY_ID_ISROWVERSION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISROWVERSION() ); break; }
+ case PROPERTY_ID_DESCRIPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DESCRIPTION() ); break; }
+ case PROPERTY_ID_DEFAULTVALUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DEFAULTVALUE() ); break; }
+
+ case PROPERTY_ID_REFERENCEDTABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REFERENCEDTABLE() ); break; }
+ case PROPERTY_ID_UPDATERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_UPDATERULE() ); break; }
+ case PROPERTY_ID_DELETERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DELETERULE() ); break; }
+ case PROPERTY_ID_CATALOG: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOG() ); break; }
+ case PROPERTY_ID_ISUNIQUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISUNIQUE() ); break; }
+ case PROPERTY_ID_ISPRIMARYKEYINDEX: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISPRIMARYKEYINDEX() ); break; }
+ case PROPERTY_ID_ISCLUSTERED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCLUSTERED() ); break; }
+ case PROPERTY_ID_ISASCENDING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISASCENDING() ); break; }
+ case PROPERTY_ID_SCHEMANAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCHEMANAME() ); break; }
+ case PROPERTY_ID_CATALOGNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOGNAME() ); break; }
+
+ case PROPERTY_ID_COMMAND: { rtl_uString_newFromAscii(&pStr,getPROPERTY_COMMAND() ); break; }
+ case PROPERTY_ID_CHECKOPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CHECKOPTION() ); break; }
+ case PROPERTY_ID_PASSWORD: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PASSWORD() ); break; }
+ case PROPERTY_ID_RELATEDCOLUMN: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RELATEDCOLUMN() ); break; }
+
+ case PROPERTY_ID_FUNCTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FUNCTION() ); break; }
+ case PROPERTY_ID_TABLENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TABLENAME() ); break; }
+ case PROPERTY_ID_REALNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REALNAME() ); break; }
+ case PROPERTY_ID_DBASEPRECISIONCHANGED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DBASEPRECISIONCHANGED() ); break; }
+ case PROPERTY_ID_ISCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCURRENCY() ); break; }
+ case PROPERTY_ID_ISBOOKMARKABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISBOOKMARKABLE() ); break; }
+ case PROPERTY_ID_INVALID_INDEX: { rtl_uString_newFromAscii(&pStr,getSTAT_INVALID_INDEX() ); break; }
+ case PROPERTY_ID_ERRORMSG_SEQUENCE: { rtl_uString_newFromAscii(&pStr,getERRORMSG_SEQUENCE() ); break; }
+ case PROPERTY_ID_HY010: { rtl_uString_newFromAscii(&pStr,getSQLSTATE_SEQUENCE() ); break; }
+ case PROPERTY_ID_HY0000: { rtl_uString_newFromAscii(&pStr,getSQLSTATE_GENERAL() ); break; }
+ case PROPERTY_ID_DELIMITER: { rtl_uString_newFromAscii(&pStr,getSTR_DELIMITER() ); break; }
+ case PROPERTY_ID_FORMATKEY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FORMATKEY() ); break; }
+ case PROPERTY_ID_LOCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_LOCALE() ); break; }
+ case PROPERTY_ID_AUTOINCREMENTCREATION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_AUTOINCREMENTCREATION() ); break; }
+ case PROPERTY_ID_PRIVILEGES: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRIVILEGES() ); break; }
}
m_aPropertyMap[_nIndex] = pStr;
return pStr;
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.hxx
index c10aa5dc7db6..ca0d5bf27633 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.hxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.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 _CONNECTIVITY_PROPERTYIDS_HXX_
@@ -49,7 +49,7 @@ namespace skeleton
{
class OPropertyMap
{
- ::std::map<sal_Int32 , rtl_uString*> m_aPropertyMap;
+ ::std::map<sal_Int32 , rtl_uString*> m_aPropertyMap;
::rtl::OUString fillValue(sal_Int32 _nIndex);
public:
@@ -67,15 +67,15 @@ namespace skeleton
};
-
+
typedef const sal_Char* (*PVFN)();
struct UStringDescription
{
- const sal_Char* pZeroTerminatedName;
+ const sal_Char* pZeroTerminatedName;
sal_Int32 nLength;
- UStringDescription(PVFN _fCharFkt);
+ UStringDescription(PVFN _fCharFkt);
operator ::rtl::OUString() const { return ::rtl::OUString(pZeroTerminatedName,nLength,RTL_TEXTENCODING_ASCII_US); }
~UStringDescription();
private:
@@ -89,73 +89,73 @@ namespace skeleton
#define DECL_PROP1IMPL(varname, type) \
pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::cppu::UnoType< type >::get(),
//------------------------------------------------------------------------------
-#define DECL_PROP0(varname, type) \
+#define DECL_PROP0(varname, type) \
DECL_PROP1IMPL(varname, type) 0)
//------------------------------------------------------------------------------
#define DECL_BOOL_PROP1IMPL(varname) \
pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getBooleanCppuType(),
//------------------------------------------------------------------------------
-#define DECL_BOOL_PROP0(varname) \
+#define DECL_BOOL_PROP0(varname) \
DECL_BOOL_PROP1IMPL(varname) 0)
-#define PROPERTY_ID_QUERYTIMEOUT 1
-#define PROPERTY_ID_MAXFIELDSIZE 2
-#define PROPERTY_ID_MAXROWS 3
-#define PROPERTY_ID_CURSORNAME 4
-#define PROPERTY_ID_RESULTSETCONCURRENCY 5
-#define PROPERTY_ID_RESULTSETTYPE 6
-#define PROPERTY_ID_FETCHDIRECTION 7
-#define PROPERTY_ID_FETCHSIZE 8
-#define PROPERTY_ID_ESCAPEPROCESSING 9
-#define PROPERTY_ID_USEBOOKMARKS 10
+#define PROPERTY_ID_QUERYTIMEOUT 1
+#define PROPERTY_ID_MAXFIELDSIZE 2
+#define PROPERTY_ID_MAXROWS 3
+#define PROPERTY_ID_CURSORNAME 4
+#define PROPERTY_ID_RESULTSETCONCURRENCY 5
+#define PROPERTY_ID_RESULTSETTYPE 6
+#define PROPERTY_ID_FETCHDIRECTION 7
+#define PROPERTY_ID_FETCHSIZE 8
+#define PROPERTY_ID_ESCAPEPROCESSING 9
+#define PROPERTY_ID_USEBOOKMARKS 10
// Column
-#define PROPERTY_ID_NAME 11
-#define PROPERTY_ID_TYPE 12
-#define PROPERTY_ID_TYPENAME 13
-#define PROPERTY_ID_PRECISION 14
-#define PROPERTY_ID_SCALE 15
-#define PROPERTY_ID_ISNULLABLE 16
-#define PROPERTY_ID_ISAUTOINCREMENT 17
-#define PROPERTY_ID_ISROWVERSION 18
-#define PROPERTY_ID_DESCRIPTION 19
-#define PROPERTY_ID_DEFAULTVALUE 20
-
-#define PROPERTY_ID_REFERENCEDTABLE 21
-#define PROPERTY_ID_UPDATERULE 22
-#define PROPERTY_ID_DELETERULE 23
-#define PROPERTY_ID_CATALOG 24
-#define PROPERTY_ID_ISUNIQUE 25
-#define PROPERTY_ID_ISPRIMARYKEYINDEX 26
-#define PROPERTY_ID_ISCLUSTERED 27
-#define PROPERTY_ID_ISASCENDING 28
-#define PROPERTY_ID_SCHEMANAME 29
-#define PROPERTY_ID_CATALOGNAME 30
-
-#define PROPERTY_ID_COMMAND 31
-#define PROPERTY_ID_CHECKOPTION 32
-#define PROPERTY_ID_PASSWORD 33
-#define PROPERTY_ID_RELATEDCOLUMN 34
-
-#define PROPERTY_ID_FUNCTION 35
-#define PROPERTY_ID_TABLENAME 36
-#define PROPERTY_ID_REALNAME 37
-#define PROPERTY_ID_DBASEPRECISIONCHANGED 38
-#define PROPERTY_ID_ISCURRENCY 39
-#define PROPERTY_ID_ISBOOKMARKABLE 40
-
-#define PROPERTY_ID_INVALID_INDEX 41
-#define PROPERTY_ID_ERRORMSG_SEQUENCE 42
-#define PROPERTY_ID_HY010 43
-#define PROPERTY_ID_HY0000 44
-#define PROPERTY_ID_DELIMITER 45
-#define PROPERTY_ID_FORMATKEY 46
-#define PROPERTY_ID_LOCALE 47
-#define PROPERTY_ID_IM001 48
-
-#define PROPERTY_ID_AUTOINCREMENTCREATION 49
-
-#define PROPERTY_ID_PRIVILEGES 50
+#define PROPERTY_ID_NAME 11
+#define PROPERTY_ID_TYPE 12
+#define PROPERTY_ID_TYPENAME 13
+#define PROPERTY_ID_PRECISION 14
+#define PROPERTY_ID_SCALE 15
+#define PROPERTY_ID_ISNULLABLE 16
+#define PROPERTY_ID_ISAUTOINCREMENT 17
+#define PROPERTY_ID_ISROWVERSION 18
+#define PROPERTY_ID_DESCRIPTION 19
+#define PROPERTY_ID_DEFAULTVALUE 20
+
+#define PROPERTY_ID_REFERENCEDTABLE 21
+#define PROPERTY_ID_UPDATERULE 22
+#define PROPERTY_ID_DELETERULE 23
+#define PROPERTY_ID_CATALOG 24
+#define PROPERTY_ID_ISUNIQUE 25
+#define PROPERTY_ID_ISPRIMARYKEYINDEX 26
+#define PROPERTY_ID_ISCLUSTERED 27
+#define PROPERTY_ID_ISASCENDING 28
+#define PROPERTY_ID_SCHEMANAME 29
+#define PROPERTY_ID_CATALOGNAME 30
+
+#define PROPERTY_ID_COMMAND 31
+#define PROPERTY_ID_CHECKOPTION 32
+#define PROPERTY_ID_PASSWORD 33
+#define PROPERTY_ID_RELATEDCOLUMN 34
+
+#define PROPERTY_ID_FUNCTION 35
+#define PROPERTY_ID_TABLENAME 36
+#define PROPERTY_ID_REALNAME 37
+#define PROPERTY_ID_DBASEPRECISIONCHANGED 38
+#define PROPERTY_ID_ISCURRENCY 39
+#define PROPERTY_ID_ISBOOKMARKABLE 40
+
+#define PROPERTY_ID_INVALID_INDEX 41
+#define PROPERTY_ID_ERRORMSG_SEQUENCE 42
+#define PROPERTY_ID_HY010 43
+#define PROPERTY_ID_HY0000 44
+#define PROPERTY_ID_DELIMITER 45
+#define PROPERTY_ID_FORMATKEY 46
+#define PROPERTY_ID_LOCALE 47
+#define PROPERTY_ID_IM001 48
+
+#define PROPERTY_ID_AUTOINCREMENTCREATION 49
+
+#define PROPERTY_ID_PRIVILEGES 50
#endif // _CONNECTIVITY_PROPERTYIDS_HXX_
diff --git a/odk/examples/DevelopersGuide/Database/OpenQuery.java b/odk/examples/DevelopersGuide/Database/OpenQuery.java
index c62d560039f0..3f63651cc7c2 100644
--- a/odk/examples/DevelopersGuide/Database/OpenQuery.java
+++ b/odk/examples/DevelopersGuide/Database/OpenQuery.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.bridge.XUnoUrlResolver;
@@ -54,11 +54,11 @@ public class OpenQuery {
private XComponentContext xContext = null;
private XMultiComponentFactory xMCF = null;
-
+
/** Creates a new instance of OpenQuery */
public OpenQuery() {
}
-
+
/**
* @param args the command line arguments
*/
@@ -87,12 +87,12 @@ public class OpenQuery {
e.printStackTrace();
System.exit(1);
}
-
+
// first we create our RowSet object and get its XRowSet interface
Object rowSet = xMCF.createInstanceWithContext(
"com.sun.star.sdb.RowSet", xContext);
- com.sun.star.sdbc.XRowSet xRowSet = (com.sun.star.sdbc.XRowSet)
+ com.sun.star.sdbc.XRowSet xRowSet = (com.sun.star.sdbc.XRowSet)
UnoRuntime.queryInterface(com.sun.star.sdbc.XRowSet.class, rowSet);
// set the properties needed to connect to a database
@@ -137,26 +137,26 @@ public class OpenQuery {
com.sun.star.sdbc.XResultSetUpdate xResultSetUpdate = (com.sun.star.sdbc.XResultSetUpdate)
UnoRuntime.queryInterface(
com.sun.star.sdbc.XResultSetUpdate.class, xRowSet);
-
+
// XRowUpdate for row updates
com.sun.star.sdbc.XRowUpdate xRowUpdate = (com.sun.star.sdbc.XRowUpdate)
UnoRuntime.queryInterface(
com.sun.star.sdbc.XRowUpdate.class, xRowSet);
-
+
// move to insertRow buffer
xResultSetUpdate.moveToInsertRow();
-
+
// edit insertRow buffer
xRowUpdate.updateString(xLoc.findColumn("IDENTIFIER"), "GOF95");
- xRowUpdate.updateString(xLoc.findColumn("AUTHOR"), "Gamma, Helm, Johnson, Vlissides");
-
+ xRowUpdate.updateString(xLoc.findColumn("AUTHOR"), "Gamma, Helm, Johnson, Vlissides");
+
// write buffer to database
xResultSetUpdate.insertRow();
-
+
// throw away the row set
com.sun.star.lang.XComponent xComp = (com.sun.star.lang.XComponent)UnoRuntime.queryInterface(
com.sun.star.lang.XComponent.class, xRowSet);
xComp.dispose();
- }
-
+ }
+
}
diff --git a/odk/examples/DevelopersGuide/Database/RowSet.java b/odk/examples/DevelopersGuide/Database/RowSet.java
index bffcca51b663..9907b1659c18 100644
--- a/odk/examples/DevelopersGuide/Database/RowSet.java
+++ b/odk/examples/DevelopersGuide/Database/RowSet.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.*;
@@ -48,7 +48,7 @@ import com.sun.star.sdbc.*;
import com.sun.star.sdbcx.Privilege;
import com.sun.star.sdb.CommandType;
import com.sun.star.sdb.XRowSetApproveBroadcaster;
-
+
public class RowSet
{
private static XComponentContext xContext = null;
@@ -209,8 +209,8 @@ public class RowSet
// do some movements to check if we got all notifications
XResultSet xRes = (XResultSet)UnoRuntime.queryInterface(XResultSet.class,xRowRes);
System.out.println("beforeFirst");
- xRes.beforeFirst();
- // this should lead to no notifications because
+ xRes.beforeFirst();
+ // this should lead to no notifications because
// we should stand before the first row at the beginning
System.out.println("We stand before the first row: " + xRes.isBeforeFirst());
diff --git a/odk/examples/DevelopersGuide/Database/RowSetEventListener.java b/odk/examples/DevelopersGuide/Database/RowSetEventListener.java
index ba0f03f2cc02..aed05e5391c7 100644
--- a/odk/examples/DevelopersGuide/Database/RowSetEventListener.java
+++ b/odk/examples/DevelopersGuide/Database/RowSetEventListener.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.sdb.XRowSetApproveListener;
diff --git a/odk/examples/DevelopersGuide/Database/Sales.java b/odk/examples/DevelopersGuide/Database/Sales.java
index efa3422e21f2..92716578dfa2 100644
--- a/odk/examples/DevelopersGuide/Database/Sales.java
+++ b/odk/examples/DevelopersGuide/Database/Sales.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,23 +29,23 @@
* 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.*;
-// import com.sun.star.comp.helper.RegistryServiceFactory;
-// import com.sun.star.comp.servicemanager.ServiceManager;
-// import com.sun.star.lang.XMultiServiceFactory;
-// import com.sun.star.lang.XServiceInfo;
+// import com.sun.star.comp.helper.RegistryServiceFactory;
+// import com.sun.star.comp.servicemanager.ServiceManager;
+// import com.sun.star.lang.XMultiServiceFactory;
+// import com.sun.star.lang.XServiceInfo;
import com.sun.star.lang.XComponent;
-// import com.sun.star.bridge.XUnoUrlResolver;
+// import com.sun.star.bridge.XUnoUrlResolver;
import com.sun.star.uno.*;
import com.sun.star.util.Date;
import com.sun.star.beans.XPropertySet;
import com.sun.star.container.XNameAccess;
import com.sun.star.sdbc.*;
-
+
public class Sales
{
private XConnection con;
@@ -82,7 +82,7 @@ public class Sales
public void insertDataIntoSales() throws com.sun.star.uno.Exception
{
XStatement stmt = con.createStatement();
- stmt.executeUpdate("INSERT INTO SALES " +
+ stmt.executeUpdate("INSERT INTO SALES " +
"VALUES (1, '100', '1','Linux','2001-02-12',15)");
stmt.executeUpdate("INSERT INTO SALES " +
"VALUES (2, '101', '2','Beef','2001-10-18',15.78)");
@@ -94,8 +94,8 @@ public class Sales
public void updateSales() throws com.sun.star.uno.Exception
{
XStatement stmt = con.createStatement();
- String updateString = "UPDATE SALES " +
- "SET PRICE = 30 " +
+ String updateString = "UPDATE SALES " +
+ "SET PRICE = 30 " +
"WHERE SALENR = 1";
stmt.executeUpdate(updateString);
}
@@ -104,7 +104,7 @@ public class Sales
public void retrieveSalesData() throws com.sun.star.uno.Exception
{
XStatement stmt = con.createStatement();
- String query = "SELECT NAME, PRICE FROM SALES " +
+ String query = "SELECT NAME, PRICE FROM SALES " +
"WHERE SALENR = 1";
XResultSet rs = stmt.executeQuery(query);
XRow row = (XRow)UnoRuntime.queryInterface(XRow.class, rs);
@@ -155,10 +155,10 @@ public class Sales
{
// example for a programmatic way to do updates. This doesn't work with adabas.
XStatement stmt = con.createStatement();
-// stmt.executeUpdate("INSERT INTO SALES " +
+// stmt.executeUpdate("INSERT INTO SALES " +
// "VALUES (4, 102, 5, 'FTOP Darjeeling tea', '2002-01-02',150)");
//
-// stmt = con.createStatement();
+// stmt = con.createStatement();
XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,stmt);
xProp.setPropertyValue("ResultSetType", new java.lang.Integer(ResultSetType.SCROLL_INSENSITIVE));
xProp.setPropertyValue("ResultSetConcurrency", new java.lang.Integer(ResultSetConcurrency.UPDATABLE));
@@ -167,7 +167,7 @@ public class Sales
// insert a new row
XRowUpdate updateRow = (XRowUpdate)UnoRuntime.queryInterface(XRowUpdate.class,rs);
- XResultSetUpdate updateRs = ( XResultSetUpdate )UnoRuntime. queryInterface(XResultSetUpdate.class,rs);
+ XResultSetUpdate updateRs = ( XResultSetUpdate )UnoRuntime. queryInterface(XResultSetUpdate.class,rs);
updateRs.moveToInsertRow();
updateRow.updateInt(1, 4);
updateRow.updateInt(2, 102);
@@ -189,7 +189,7 @@ public class Sales
XResultSet rs = stmt.executeQuery("SELECT * FROM SALES");
XRow row = (XRow)UnoRuntime.queryInterface(XRow.class,rs);
- XResultSetUpdate updateRs = ( XResultSetUpdate )UnoRuntime. queryInterface(XResultSetUpdate.class,rs);
+ XResultSetUpdate updateRs = ( XResultSetUpdate )UnoRuntime. queryInterface(XResultSetUpdate.class,rs);
// move to the inserted row
rs.absolute(4);
updateRs.deleteRow();
@@ -213,7 +213,7 @@ public class Sales
// modifiy the 4 row
XRowUpdate updateRow = (XRowUpdate)UnoRuntime.queryInterface(XRowUpdate.class,rs);
- XResultSetUpdate updateRs = ( XResultSetUpdate )UnoRuntime. queryInterface(XResultSetUpdate.class,rs);
+ XResultSetUpdate updateRs = ( XResultSetUpdate )UnoRuntime. queryInterface(XResultSetUpdate.class,rs);
updateRow.updateFloat(2, 150);
updateRs.updateRow();
// repositioning
diff --git a/odk/examples/DevelopersGuide/Database/SalesMan.java b/odk/examples/DevelopersGuide/Database/SalesMan.java
index e19bca758bdd..2e0e870923ee 100644
--- a/odk/examples/DevelopersGuide/Database/SalesMan.java
+++ b/odk/examples/DevelopersGuide/Database/SalesMan.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,23 +29,23 @@
* 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.*;
-// import com.sun.star.comp.helper.RegistryServiceFactory;
-// import com.sun.star.comp.servicemanager.ServiceManager;
-// import com.sun.star.lang.XMultiServiceFactory;
-// import com.sun.star.lang.XServiceInfo;
+// import com.sun.star.comp.helper.RegistryServiceFactory;
+// import com.sun.star.comp.servicemanager.ServiceManager;
+// import com.sun.star.lang.XMultiServiceFactory;
+// import com.sun.star.lang.XServiceInfo;
import com.sun.star.lang.XComponent;
-// import com.sun.star.bridge.XUnoUrlResolver;
+// import com.sun.star.bridge.XUnoUrlResolver;
import com.sun.star.uno.*;
import com.sun.star.util.Date;
import com.sun.star.beans.XPropertySet;
import com.sun.star.container.XNameAccess;
import com.sun.star.sdbc.*;
-
+
public class SalesMan
{
private XConnection con;
@@ -83,20 +83,20 @@ public class SalesMan
public void insertDataIntoSalesMan() throws com.sun.star.uno.Exception
{
XStatement stmt = con.createStatement();
- stmt.executeUpdate("INSERT INTO SALESMAN " +
- "VALUES (1, 'Joseph', 'Smith','Bond Street','CA',95460,"
+ stmt.executeUpdate("INSERT INTO SALESMAN " +
+ "VALUES (1, 'Joseph', 'Smith','Bond Street','CA',95460,"
+ "'1946-07-02')");
stmt.executeUpdate("INSERT INTO SALESMAN " +
- "VALUES (2, 'Frank', 'Jones','Lake Silver','CA',95460,"
+ "VALUES (2, 'Frank', 'Jones','Lake Silver','CA',95460,"
+ "'1963-12-24')");
stmt.executeUpdate("INSERT INTO SALESMAN " +
- "VALUES (3, 'Jane', 'Esperansa','23 Hollywood drive','CA',95460,"
+ "VALUES (3, 'Jane', 'Esperansa','23 Hollywood drive','CA',95460,"
+ "'1972-04-01')");
stmt.executeUpdate("INSERT INTO SALESMAN " +
- "VALUES (4, 'George', 'Flint','12 Washington street','CA',95460,"
+ "VALUES (4, 'George', 'Flint','12 Washington street','CA',95460,"
+ "'1953-02-13')");
stmt.executeUpdate("INSERT INTO SALESMAN " +
- "VALUES (5, 'Bob', 'Meyers','2 Moon way','CA',95460,"
+ "VALUES (5, 'Bob', 'Meyers','2 Moon way','CA',95460,"
+ "'1949-09-07')");
}
@@ -110,19 +110,19 @@ public class SalesMan
setPara.setInt(2, 1);
updateStreet.executeUpdate();
- setPara.setString(1, "Marryland");
+ setPara.setString(1, "Marryland");
setPara.setInt(2, 4);
- updateStreet.executeUpdate();
+ updateStreet.executeUpdate();
// changes STREET column of salesman George to Marryland
setPara.setString(1, "Michigan road");
- updateStreet.executeUpdate();
- // changes again STREET column of salesman George to
- // Michigan road
+ updateStreet.executeUpdate();
+ // changes again STREET column of salesman George to
+ // Michigan road
// parameter 2 stayed 4, and the first parameter was reset
// to "Michigan road")
- setPara.setString(1, "Bond Street");
- setPara.setInt(2, 3);
+ setPara.setString(1, "Bond Street");
+ setPara.setInt(2, 3);
int n = updateStreet.executeUpdate();
System.out.println("executeUpdate returns: " + n);
// n = 1 because one row had a change in it
@@ -132,7 +132,7 @@ public class SalesMan
public void retrieveSalesManData() throws com.sun.star.uno.Exception
{
XStatement stmt = con.createStatement();
- XResultSet rs = stmt.executeQuery("SELECT FIRSTNAME, LASTNAME, BIRTHDATE FROM SALESMAN");
+ XResultSet rs = stmt.executeQuery("SELECT FIRSTNAME, LASTNAME, BIRTHDATE FROM SALESMAN");
XRow row = (XRow)UnoRuntime.queryInterface(XRow.class,rs);
while ( rs != null && rs.next() ) {
String fn = row.getString( 1 );
diff --git a/odk/examples/DevelopersGuide/Database/sdbcx.java b/odk/examples/DevelopersGuide/Database/sdbcx.java
index 62a4f7007fe6..e446ed5dc994 100644
--- a/odk/examples/DevelopersGuide/Database/sdbcx.java
+++ b/odk/examples/DevelopersGuide/Database/sdbcx.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.*;
@@ -43,13 +43,13 @@ import com.sun.star.container.XIndexAccess;
import com.sun.star.sdbc.*;
import com.sun.star.sdbcx.*;
import com.sun.star.lang.XMultiServiceFactory;
-
+
public class sdbcx
{
private XMultiServiceFactory xORB;
private static XConnection con;
private XTablesSupplier xTabSup;
-
+
public static XMultiServiceFactory rSmgr;
public static void main(String argv[]) throws java.lang.Exception
{
@@ -108,7 +108,7 @@ public class sdbcx
{
xORB = rSmgr;
}
-
+
public void createConnection() throws com.sun.star.uno.Exception
{
// create the Driver with the implementation name
@@ -126,8 +126,8 @@ public class sdbcx
new com.sun.star.beans.PropertyValue("user",0,"test1",com.sun.star.beans.PropertyState.DIRECT_VALUE),
new com.sun.star.beans.PropertyValue("password",0,"test1",com.sun.star.beans.PropertyState.DIRECT_VALUE)
};
- //
-
+ //
+
// now create a connection to adabas
con = xDriver.connect(adabasURL,adabasProps);
if(con != null)
@@ -176,7 +176,7 @@ public class sdbcx
}
//###########################################################
- // 15. example
+ // 15. example
// print all columns of a XColumnsSupplier
//###########################################################
public static void printColumns(XColumnsSupplier xColumnsSup) throws com.sun.star.uno.Exception,SQLException
@@ -190,7 +190,7 @@ public class sdbcx
System.out.println(" " + aColumnNames[i]);
}
//###########################################################
- // 16. example
+ // 16. example
// print all keys inclusive the columns of a key
//###########################################################
public static void printKeys(XColumnsSupplier xColumnsSup) throws com.sun.star.uno.Exception,SQLException
@@ -207,12 +207,12 @@ public class sdbcx
XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,key);
System.out.println(" " + xProp.getPropertyValue("Name"));
XColumnsSupplier xKeyColumnsSup = ( XColumnsSupplier ) UnoRuntime.queryInterface(XColumnsSupplier.class,xProp);
- printColumns(xKeyColumnsSup);
+ printColumns(xKeyColumnsSup);
}
}
}
//###########################################################
- // 17. example
+ // 17. example
// print all keys inclusive the columns of a key
//###########################################################
public static void printIndexes(XColumnsSupplier xColumnsSup) throws com.sun.star.uno.Exception,SQLException
@@ -229,13 +229,13 @@ public class sdbcx
System.out.println(" " + aIndexNames[i]);
Object index = xIndexs.getByName(aIndexNames[i]);
XColumnsSupplier xIndexColumnsSup = (XColumnsSupplier)UnoRuntime.queryInterface(XColumnsSupplier.class,index);
- printColumns(xIndexColumnsSup);
+ printColumns(xIndexColumnsSup);
}
}
}
//###########################################################
- // 18. example
+ // 18. example
// column properties
//###########################################################
public static void printColumnProperties(Object column) throws com.sun.star.uno.Exception,SQLException
@@ -260,7 +260,7 @@ public class sdbcx
}
//###########################################################
- // 19. example
+ // 19. example
// index properties
//###########################################################
public static void printIndexProperties(Object index) throws com.sun.star.uno.Exception,SQLException
@@ -275,7 +275,7 @@ public class sdbcx
}
//###########################################################
- // 20. example
+ // 20. example
// key properties
//###########################################################
public static void printKeyProperties(Object key) throws com.sun.star.uno.Exception,SQLException
@@ -290,7 +290,7 @@ public class sdbcx
}
//###########################################################
- // 21. example
+ // 21. example
// print all groups and the users with their privileges who belong to this group
//###########################################################
public static void printGroups(XTablesSupplier xTabSup) throws com.sun.star.uno.Exception,SQLException
@@ -324,7 +324,7 @@ public class sdbcx
}
//###########################################################
- // 22. example
+ // 22. example
// create the table salesmen
//###########################################################
public static void createTableSalesMen(XNameAccess xTables) throws com.sun.star.uno.Exception,SQLException
@@ -399,7 +399,7 @@ public class sdbcx
}
//###########################################################
- // 23. example
+ // 23. example
// create a user
//###########################################################
public static void createUser(XNameAccess xUsers) throws com.sun.star.uno.Exception,SQLException
diff --git a/odk/examples/DevelopersGuide/Drawing/ChangeOrderDemo.java b/odk/examples/DevelopersGuide/Drawing/ChangeOrderDemo.java
index 7adbd41ba6a0..12ae3f20ff88 100644
--- a/odk/examples/DevelopersGuide/Drawing/ChangeOrderDemo.java
+++ b/odk/examples/DevelopersGuide/Drawing/ChangeOrderDemo.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 __________
@@ -89,12 +89,12 @@ public class ChangeOrderDemo
XShape xShape2 = ShapeHelper.createShape( xDrawDoc,
new Point( 2000, 2000 ), new Size( 5000, 5000 ),
"com.sun.star.drawing.EllipseShape" );
-
+
xShapes.add( xShape1 );
ShapeHelper.addPortion( xShape1, " this shape was inserted first", false );
ShapeHelper.addPortion( xShape1, "by changing the ZOrder it lie now on top", true );
xShapes.add( xShape2 );
-
+
XPropertySet xPropSet1 = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, xShape1 );
XPropertySet xPropSet2 = (XPropertySet)
@@ -102,7 +102,7 @@ public class ChangeOrderDemo
int nOrderOfShape1 = ((Integer)xPropSet1.getPropertyValue( "ZOrder" )).intValue();
int nOrderOfShape2 = ((Integer)xPropSet2.getPropertyValue( "ZOrder" )).intValue();
-
+
xPropSet1.setPropertyValue( "ZOrder", new Integer( nOrderOfShape2 ) );
xPropSet2.setPropertyValue( "ZOrder", new Integer( nOrderOfShape1 ) );
}
diff --git a/odk/examples/DevelopersGuide/Drawing/ControlAndSelectDemo.java b/odk/examples/DevelopersGuide/Drawing/ControlAndSelectDemo.java
index 1628f0c59ff8..3a6bfee22e7a 100644
--- a/odk/examples/DevelopersGuide/Drawing/ControlAndSelectDemo.java
+++ b/odk/examples/DevelopersGuide/Drawing/ControlAndSelectDemo.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 __________
@@ -91,7 +91,7 @@ public class ControlAndSelectDemo
XMultiServiceFactory xFactory =
(XMultiServiceFactory )UnoRuntime.queryInterface(
XMultiServiceFactory.class, xComponent );
-
+
XDrawPagesSupplier xDrawPagesSupplier =
(XDrawPagesSupplier)UnoRuntime.queryInterface(
XDrawPagesSupplier.class, xComponent );
diff --git a/odk/examples/DevelopersGuide/Drawing/CustomShowDemo.java b/odk/examples/DevelopersGuide/Drawing/CustomShowDemo.java
index de42d7ce426e..46020dfac470 100644
--- a/odk/examples/DevelopersGuide/Drawing/CustomShowDemo.java
+++ b/odk/examples/DevelopersGuide/Drawing/CustomShowDemo.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 __________
@@ -97,7 +97,7 @@ public class CustomShowDemo
(XDrawPagesSupplier)UnoRuntime.queryInterface(
XDrawPagesSupplier.class, xDrawDoc );
XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
-
+
// take care that this document has ten pages
while ( xDrawPages.getCount() < 10 )
xDrawPages.insertNewByIndex( 0 );
@@ -107,13 +107,13 @@ public class CustomShowDemo
"page five", "page six", "page seven", "page eight", "page nine" };
int i;
for ( i = 0; i < 10; i++ )
- {
+ {
XDrawPage xDrawPage = (XDrawPage)UnoRuntime.queryInterface(
XDrawPage.class, xDrawPages.getByIndex( i ));
XNamed xPageName = (XNamed)UnoRuntime.queryInterface(
- XNamed.class, xDrawPage );
+ XNamed.class, xDrawPage );
xPageName.setName( aNameArray[ i ] );
-
+
// now we will create and insert the text object
XShape xTextObj = ShapeHelper.createShape( xDrawDoc, new Point( 10000, 9000 ),
new Size( 10000, 5000 ),
@@ -135,7 +135,7 @@ public class CustomShowDemo
XSingleServiceFactory xFactory = (XSingleServiceFactory)
UnoRuntime.queryInterface( XSingleServiceFactory.class, xNameContainer );
- Object xObj;
+ Object xObj;
XIndexContainer xContainer;
/* instanciate an IndexContainer that will take
diff --git a/odk/examples/DevelopersGuide/Drawing/DrawViewDemo.java b/odk/examples/DevelopersGuide/Drawing/DrawViewDemo.java
index 43fbe81f1713..1b806d78d0c6 100644
--- a/odk/examples/DevelopersGuide/Drawing/DrawViewDemo.java
+++ b/odk/examples/DevelopersGuide/Drawing/DrawViewDemo.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 __________
@@ -73,7 +73,7 @@ public class DrawViewDemo
// get the remote office context of a running office (a new office
// instance is started if necessary)
com.sun.star.uno.XComponentContext xOfficeContext = Helper.connect();
-
+
// suppress Presentation Autopilot when opening the document
// properties are the same as described for
// com.sun.star.document.MediaDescriptor
@@ -81,19 +81,19 @@ public class DrawViewDemo
pPropValues[ 0 ] = new PropertyValue();
pPropValues[ 0 ].Name = "Silent";
pPropValues[ 0 ].Value = new Boolean( true );
-
+
java.io.File sourceFile = new java.io.File(args[0]);
StringBuffer sUrl = new StringBuffer("file:///");
sUrl.append(sourceFile.getCanonicalPath().replace('\\', '/'));
-
+
xComponent = Helper.createDocument( xOfficeContext,
sUrl.toString(), "_blank", 0,
pPropValues );
XModel xModel =
(XModel)UnoRuntime.queryInterface(
XModel.class, xComponent );
-
-
+
+
// print all available properties of first view
System.out.println("*** print all available properties of first view");
XViewDataSupplier xViewDataSupplier =
@@ -104,15 +104,15 @@ public class DrawViewDemo
{
PropertyValue[] aPropSeq = (PropertyValue[])
xIndexAccess.getByIndex( 0 );
-
+
for( int i = 0; i < aPropSeq.length; i++ )
{
System.out.println( aPropSeq[ i ].Name + " = " +
aPropSeq[ i ].Value );
}
}
-
-
+
+
// print all properties that are supported by the controller
// and change into masterpage mode
System.out.println("*** print all properties that are supported by the controller");
@@ -128,7 +128,7 @@ public class DrawViewDemo
}
System.out.println("*** change into masterpage mode");
xPropSet.setPropertyValue( "IsMasterPageMode", new Boolean( true ) );
-
+
}
catch( Exception ex )
{
diff --git a/odk/examples/DevelopersGuide/Drawing/DrawingDemo.java b/odk/examples/DevelopersGuide/Drawing/DrawingDemo.java
index 78b4b981da7c..6d34da14e986 100644
--- a/odk/examples/DevelopersGuide/Drawing/DrawingDemo.java
+++ b/odk/examples/DevelopersGuide/Drawing/DrawingDemo.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 __________
@@ -112,10 +112,10 @@ public class DrawingDemo
System.exit( 0 );
}
-
+
Demo_PageCreation( xDrawDoc, 10 );
Demo_PageNaming( xDrawDoc, "this page is called: LastPage" );
- Demo_ShapeCreation( xDrawDoc );
+ Demo_ShapeCreation( xDrawDoc );
Demo_PolyPolygonBezier( xDrawDoc );
Demo_Group1( xDrawDoc );
Demo_Group2( xDrawDoc );
@@ -141,8 +141,8 @@ public class DrawingDemo
nMasterPages < ( ( nDrawPages + 1 ) / 2 ); nMasterPages++ )
PageHelper.insertNewMasterPageByIndex( xDrawDoc, nMasterPages );
- // Now connect master page 1 to draw page 1 and 2,
- // master page 2 to draw page 3 and 4 and so on.
+ // Now connect master page 1 to draw page 1 and 2,
+ // master page 2 to draw page 3 and 4 and so on.
for ( i = 0; i < nDrawPages; i++ )
{
XDrawPage xDrawPage = PageHelper.getDrawPageByIndex( xDrawDoc, i );
@@ -247,13 +247,13 @@ public class DrawingDemo
int nRndObjWidth = aRndGen.nextInt( nHalfWidth );
int nRndObjHeight = aRndGen.nextInt( nHalfHeight );
- int nRndObjPosX = aRndGen.nextInt( nHalfWidth - nRndObjWidth );
+ int nRndObjPosX = aRndGen.nextInt( nHalfWidth - nRndObjWidth );
int nRndObjPosY = aRndGen.nextInt( nHalfHeight - nRndObjHeight )
+ nHalfHeight;
XShapes xShapes = (XShapes)
UnoRuntime.queryInterface( XShapes.class, pPages[ i ] );
- ShapeHelper.createAndInsertShape( xDrawDoc, xShapes,
+ ShapeHelper.createAndInsertShape( xDrawDoc, xShapes,
new Point( nRndObjPosX, nRndObjPosY ),
new Size( nRndObjWidth, nRndObjHeight ),
"com.sun.star.drawing.RectangleShape" );
@@ -275,7 +275,7 @@ public class DrawingDemo
new Point( 0, 0 ),
new Size( 0, 0 ),
"com.sun.star.drawing.ClosedBezierShape" );
-
+
// the fact that the shape must have been added to the page before
// it is possible to apply changes to the PropertySet, it is a good
// proceeding to add the shape as soon as possible
@@ -301,7 +301,7 @@ public class DrawingDemo
PolyPolygonBezierCoords aCoords = new PolyPolygonBezierCoords();
// allocating the outer sequence
int nPolygonCount = 50;
- aCoords.Coordinates = new Point[ nPolygonCount ][ ];
+ aCoords.Coordinates = new Point[ nPolygonCount ][ ];
aCoords.Flags = new PolygonFlags[ nPolygonCount ][ ];
int i, n, nY;
// fill the inner point sequence now
@@ -310,8 +310,8 @@ public class DrawingDemo
// create a polygon using two normal and two control points
// allocating the inner sequence
int nPointCount = 8;
- Point[] pPolyPoints = new Point[ nPointCount ];
- PolygonFlags[] pPolyFlags = new PolygonFlags[ nPointCount ];
+ Point[] pPolyPoints = new Point[ nPointCount ];
+ PolygonFlags[] pPolyFlags = new PolygonFlags[ nPointCount ];
for ( n = 0; n < nPointCount; n++ )
pPolyPoints[ n ] = new Point();
@@ -343,7 +343,7 @@ public class DrawingDemo
pPolyFlags[ 7 ] = PolygonFlags.NORMAL;
aCoords.Coordinates[ i ]= pPolyPoints;
- aCoords.Flags[ i ] = pPolyFlags;
+ aCoords.Flags[ i ] = pPolyFlags;
}
xShapeProperties.setPropertyValue( "PolyPolygonBezier", aCoords );
@@ -356,7 +356,7 @@ public class DrawingDemo
}
}
- // This method will create a group containing two ellipses
+ // This method will create a group containing two ellipses
// the shapes will be added into the top right corner of the first
// draw page
public static void Demo_Group1( XComponent xDrawDoc )
@@ -380,7 +380,7 @@ public class DrawingDemo
Size aPageSize = PageHelper.getPageSize( xDrawPage );
- int nWidth = 4000;
+ int nWidth = 4000;
int nHeight = 2000;
int nPosX = ( aPageSize.Width * 3 ) / 4 - nWidth / 2;
int nPosY1 = 2000;
diff --git a/odk/examples/DevelopersGuide/Drawing/FillAndLineStyleDemo.java b/odk/examples/DevelopersGuide/Drawing/FillAndLineStyleDemo.java
index 132338870fee..9380ffd2a004 100644
--- a/odk/examples/DevelopersGuide/Drawing/FillAndLineStyleDemo.java
+++ b/odk/examples/DevelopersGuide/Drawing/FillAndLineStyleDemo.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 __________
@@ -80,20 +80,20 @@ public class FillAndLineStyleDemo
"private:factory/sdraw", "_blank", 0, pPropValues );
XDrawPage xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
-
+
XShape xRectangle = ShapeHelper.createShape( xDrawDoc,
new Point( 0, 0 ),
new Size( 15000, 12000 ),
"com.sun.star.drawing.RectangleShape" );
-
+
XShapes xShapes = (XShapes)
UnoRuntime.queryInterface( XShapes.class, xPage );
xShapes.add( xRectangle );
XPropertySet xPropSet = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, xRectangle );
-
- /* apply a gradient fill style that goes from top left to bottom
+
+ /* apply a gradient fill style that goes from top left to bottom
right and is changing its color from green to yellow */
xPropSet.setPropertyValue( "FillStyle",
com.sun.star.drawing.FillStyle.GRADIENT );
@@ -121,7 +121,7 @@ public class FillAndLineStyleDemo
aLineDash.Distance = 150;
xPropSet.setPropertyValue( "LineDash", aLineDash );
xPropSet.setPropertyValue( "LineColor", new Integer( 0x0000ff ) );
- xPropSet.setPropertyValue( "LineWidth", new Integer( 200 ) );
+ xPropSet.setPropertyValue( "LineWidth", new Integer( 200 ) );
}
catch( Exception ex )
diff --git a/odk/examples/DevelopersGuide/Drawing/GluePointDemo.java b/odk/examples/DevelopersGuide/Drawing/GluePointDemo.java
index 2835770e2ae5..43765dec8ea1 100644
--- a/odk/examples/DevelopersGuide/Drawing/GluePointDemo.java
+++ b/odk/examples/DevelopersGuide/Drawing/GluePointDemo.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 __________
@@ -107,15 +107,15 @@ public class GluePointDemo
xShapes.add( xShape1 );
xShapes.add( xShape2 );
xShapes.add( xConnector );
-
+
XPropertySet xConnectorPropSet = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, xConnector );
-// Index value of 0 : the shape is connected at the top
-// Index value of 1 : the shape is connected at the left
-// Index value of 2 : the shape is connected at the bottom
-// Index value of 3 : the shape is connected at the right
-
+// Index value of 0 : the shape is connected at the top
+// Index value of 1 : the shape is connected at the left
+// Index value of 2 : the shape is connected at the bottom
+// Index value of 3 : the shape is connected at the right
+
int nStartIndex = 3;
int nEndIndex = 1;
@@ -130,7 +130,7 @@ public class GluePointDemo
new Integer( nEndIndex ) );
XGluePointsSupplier xGluePointsSupplier;
- XIndexContainer xIndexContainer;
+ XIndexContainer xIndexContainer;
XIdentifierContainer xIdentifierContainer;
GluePoint2 aGluePoint = new GluePoint2();
diff --git a/odk/examples/DevelopersGuide/Drawing/GraphicExportDemo.java b/odk/examples/DevelopersGuide/Drawing/GraphicExportDemo.java
index 65c9ecf99b4f..63901b901f1c 100644
--- a/odk/examples/DevelopersGuide/Drawing/GraphicExportDemo.java
+++ b/odk/examples/DevelopersGuide/Drawing/GraphicExportDemo.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 __________
@@ -66,7 +66,7 @@ public class GraphicExportDemo
// get the remote office context of a running office (a new office
// instance is started if necessary)
com.sun.star.uno.XComponentContext xOfficeContext = Helper.connect();
-
+
// suppress Presentation Autopilot when opening the document
// properties are the same as described for
// com.sun.star.document.MediaDescriptor
@@ -74,38 +74,38 @@ public class GraphicExportDemo
pPropValues[ 0 ] = new PropertyValue();
pPropValues[ 0 ].Name = "Silent";
pPropValues[ 0 ].Value = new Boolean( true );
-
+
java.io.File sourceFile = new java.io.File(args[0]);
StringBuffer sUrl = new StringBuffer("file:///");
sUrl.append(sourceFile.getCanonicalPath().replace('\\', '/'));
-
+
xComponent = Helper.createDocument( xOfficeContext,
sUrl.toString(), "_blank", 0,
pPropValues );
-
+
Object GraphicExportFilter =
xOfficeContext.getServiceManager().createInstanceWithContext(
"com.sun.star.drawing.GraphicExportFilter", xOfficeContext);
XExporter xExporter = (XExporter)
UnoRuntime.queryInterface( XExporter.class, GraphicExportFilter );
-
+
PropertyValue aProps[] = new PropertyValue[2];
aProps[0] = new PropertyValue();
aProps[0].Name = "MediaType";
aProps[0].Value = "image/gif";
-
+
/* some graphics e.g. the Windows Metafile does not have a Media Type,
for this case
- aProps[0].Name = "FilterName"; // it is possible to set a FilterName
+ aProps[0].Name = "FilterName"; // it is possible to set a FilterName
aProps[0].Value = "WMF";
*/
java.io.File destFile = new java.io.File(args[1]);
java.net.URL destUrl = destFile.toURL();
-
+
aProps[1] = new PropertyValue();
aProps[1].Name = "URL";
aProps[1].Value = destUrl.toString();//args[ 1 ];
-
+
int nPageIndex = Integer.parseInt( args[ 2 ] );
if ( nPageIndex < PageHelper.getDrawPageCount( xComponent ) &&
nPageIndex > 1 )
@@ -115,19 +115,19 @@ public class GraphicExportDemo
XComponent xComp = (XComponent)
UnoRuntime.queryInterface( XComponent.class, xPage );
xExporter.setSourceDocument( xComp );
- XFilter xFilter = (XFilter)
+ XFilter xFilter = (XFilter)
UnoRuntime.queryInterface( XFilter.class, xExporter );
xFilter.filter( aProps );
System.out.println( "*** graphics on page \"" + nPageIndex
+ "\" from file \"" + args[0]
- + "\" exported under the name \""
+ + "\" exported under the name \""
+ args[1] + "\" in the local directory" );
} else
{
System.out.println( "page index not in range" );
}
-
-
+
+
// close the document
com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable)
UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class,
@@ -138,15 +138,15 @@ public class GraphicExportDemo
else
xComponent.dispose();
- System.out.println("*** document closed!");
+ System.out.println("*** document closed!");
}
catch( Exception ex )
{
System.out.println( ex );
}
-
+
System.exit( 0 );
}
}
-
+
diff --git a/odk/examples/DevelopersGuide/Drawing/Helper.java b/odk/examples/DevelopersGuide/Drawing/Helper.java
index efd952ac0ce9..e9d316ee7ec2 100644
--- a/odk/examples/DevelopersGuide/Drawing/Helper.java
+++ b/odk/examples/DevelopersGuide/Drawing/Helper.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 __________
@@ -53,7 +53,7 @@ public class Helper
// if connection fails an exception is thrown
System.out.println("Connected to a running office ...");
-
+
return xOfficeContext;
}
@@ -75,7 +75,7 @@ public class Helper
xComponent = (com.sun.star.lang.XComponent)UnoRuntime.queryInterface(
com.sun.star.lang.XComponent.class, aLoader.loadComponentFromURL(
sURL, sTargetFrame, nSearchFlags, aArgs ) );
-
+
if ( xComponent == null )
throw new Exception( "could not create document: " + sURL );
return xComponent;
diff --git a/odk/examples/DevelopersGuide/Drawing/LayerDemo.java b/odk/examples/DevelopersGuide/Drawing/LayerDemo.java
index 005468ed037f..47fc964432d8 100644
--- a/odk/examples/DevelopersGuide/Drawing/LayerDemo.java
+++ b/odk/examples/DevelopersGuide/Drawing/LayerDemo.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 __________
@@ -117,13 +117,13 @@ public class LayerDemo
XNameAccess xNameAccess = xLayerSupplier.getLayerManager();
XLayerManager xLayerManager = (XLayerManager)
(XLayerManager)UnoRuntime.queryInterface(
- XLayerManager.class, xNameAccess );
+ XLayerManager.class, xNameAccess );
// create a layer and set its properties
XPropertySet xLayerPropSet;
XLayer xNotVisibleAndEditable = xLayerManager.insertNewByIndex(
xLayerManager.getCount() );
-
+
xLayerPropSet = (XPropertySet)
(XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xNotVisibleAndEditable );
@@ -134,7 +134,7 @@ public class LayerDemo
// create a second layer
XLayer xNotEditable = xLayerManager.insertNewByIndex(
xLayerManager.getCount() );
-
+
xLayerPropSet = (XPropertySet)
(XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xNotEditable );
diff --git a/odk/examples/DevelopersGuide/Drawing/ObjectTransformationDemo.java b/odk/examples/DevelopersGuide/Drawing/ObjectTransformationDemo.java
index 787c0434be7f..56b5e80625cf 100644
--- a/odk/examples/DevelopersGuide/Drawing/ObjectTransformationDemo.java
+++ b/odk/examples/DevelopersGuide/Drawing/ObjectTransformationDemo.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 __________
@@ -90,13 +90,13 @@ public class ObjectTransformationDemo
new Point( 0, 0 ), new Size( 10000, 2500 ),
"com.sun.star.drawing.RectangleShape" );
xShapes.add( xShape );
-
+
XPropertySet xPropSet = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, xShape );
-
+
HomogenMatrix3 aHomogenMatrix3 = (HomogenMatrix3)
xPropSet.getPropertyValue( "Transformation" );
-
+
java.awt.geom.AffineTransform aOriginalMatrix =
new java.awt.geom.AffineTransform(
aHomogenMatrix3.Line1.Column1, aHomogenMatrix3.Line2.Column1,
diff --git a/odk/examples/DevelopersGuide/Drawing/Organigram.java b/odk/examples/DevelopersGuide/Drawing/Organigram.java
index c564fd273178..caa390dce6fc 100644
--- a/odk/examples/DevelopersGuide/Drawing/Organigram.java
+++ b/odk/examples/DevelopersGuide/Drawing/Organigram.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.PropertyValue;
@@ -58,14 +58,14 @@ import com.sun.star.uno.XComponentContext;
* @author dschulten
*/
public class Organigram {
-
+
private XComponentContext xRemoteContext = null;
private XMultiComponentFactory xRemoteServiceManager = null;
-
+
/** Creates a new instance of OpenQuery */
public Organigram() {
}
-
+
/**
* @param args the command line arguments
*/
@@ -84,7 +84,7 @@ public class Organigram {
public void drawOrganigram() throws java.lang.Exception {
// get the remote office component context
xRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
- System.out.println("Connected to a running office ...");
+ System.out.println("Connected to a running office ...");
// get the remote service manager
xRemoteServiceManager = xRemoteContext.getServiceManager();
@@ -96,7 +96,7 @@ public class Organigram {
PropertyValue[] loadProps = new PropertyValue[0];
XComponent xDrawComponent = xComponentLoader.loadComponentFromURL(
"private:factory/sdraw", "_blank", 0, loadProps);
-
+
// get draw page by index
com.sun.star.drawing.XDrawPagesSupplier xDrawPagesSupplier =
(com.sun.star.drawing.XDrawPagesSupplier)UnoRuntime.queryInterface(
@@ -107,15 +107,15 @@ public class Organigram {
com.sun.star.drawing.XDrawPage xDrawPage = (com.sun.star.drawing.XDrawPage)
UnoRuntime.queryInterface(com.sun.star.drawing.XDrawPage.class,
drawPage);
-
+
com.sun.star.lang.XMultiServiceFactory xDocumentFactory =
(com.sun.star.lang.XMultiServiceFactory)UnoRuntime.queryInterface(
com.sun.star.lang.XMultiServiceFactory.class, xDrawComponent);
-
+
com.sun.star.beans.XPropertySet xPageProps =
(com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xDrawPage);
-
+
int pageWidth = AnyConverter.toInt(xPageProps.getPropertyValue("Width"));
int pageHeight = AnyConverter.toInt(xPageProps.getPropertyValue("Height"));
int pageBorderTop = AnyConverter.toInt(xPageProps.getPropertyValue("BorderTop"));
@@ -131,7 +131,7 @@ public class Organigram {
orgUnits[1][2] = "IT Services";
orgUnits[1][3] = "Sales";
int[] levelCount = {1, 4};
-
+
int horSpace = 300;
int verSpace = 3000;
@@ -139,12 +139,12 @@ public class Organigram {
int shapeHeight = pageHeight / 20;
int shapeX = pageWidth / 2 - shapeWidth / 2;
int shapeY = pageBorderTop;
-
+
int levelY;
int levelX;
-
+
com.sun.star.drawing.XShape xStartShape = null;
-
+
for (int level = 0; level <= 1; level++) {
levelY = pageBorderTop + 2000 + level * (shapeHeight + verSpace);
for (int i = levelCount[level] - 1; i > -1; i--) {
@@ -156,19 +156,19 @@ public class Organigram {
UnoRuntime.queryInterface(
com.sun.star.drawing.XShape.class, shape);
xShape.setPosition(new com.sun.star.awt.Point(shapeX, levelY));
- xShape.setSize(new com.sun.star.awt.Size(shapeWidth, shapeHeight));
+ xShape.setSize(new com.sun.star.awt.Size(shapeWidth, shapeHeight));
xDrawPage.add(xShape);
-
+
com.sun.star.text.XText xText = (com.sun.star.text.XText)
UnoRuntime.queryInterface(
com.sun.star.text.XText.class, xShape);
-
- xText.setString(orgUnits[level][i]);
+
+ xText.setString(orgUnits[level][i]);
// memorize the root shape
if (level == 0 && i == 0)
- xStartShape = xShape;
-
+ xStartShape = xShape;
+
if (level == 1) {
Object connector = xDocumentFactory.createInstance("com.sun.star.drawing.ConnectorShape");
com.sun.star.beans.XPropertySet xConnectorProps =
@@ -184,7 +184,7 @@ public class Organigram {
new Integer(2)); // 2 = bottom glue point
xConnectorProps.setPropertyValue("EndGluePointIndex",
new Integer(0)); // 0 = top glue point
- }
+ }
}
}
}
diff --git a/odk/examples/DevelopersGuide/Drawing/PageHelper.java b/odk/examples/DevelopersGuide/Drawing/PageHelper.java
index c612afa4e61b..103916686b5c 100644
--- a/odk/examples/DevelopersGuide/Drawing/PageHelper.java
+++ b/odk/examples/DevelopersGuide/Drawing/PageHelper.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 __________
@@ -190,14 +190,14 @@ public class PageHelper
// __________ presentation pages __________
- /** test if a Presentation Document is supported.
+ /** test if a Presentation Document is supported.
This is important, because only presentation documents
have notes and handout pages
*/
static public boolean isImpressDocument( XComponent xComponent )
{
XServiceInfo xInfo = (XServiceInfo)UnoRuntime.queryInterface(
- XServiceInfo.class, xComponent );
+ XServiceInfo.class, xComponent );
return xInfo.supportsService( "com.sun.star.presentation.PresentationDocument" );
}
@@ -205,7 +205,7 @@ public class PageHelper
*/
static public XDrawPage getNotesPage( XDrawPage xDrawPage )
{
- XPresentationPage aPresentationPage =
+ XPresentationPage aPresentationPage =
(XPresentationPage)UnoRuntime.queryInterface(
XPresentationPage.class, xDrawPage );
return aPresentationPage.getNotesPage();
@@ -215,7 +215,7 @@ public class PageHelper
*/
static public XDrawPage getHandoutMasterPage( XComponent xComponent )
{
- XHandoutMasterSupplier aHandoutMasterSupplier =
+ XHandoutMasterSupplier aHandoutMasterSupplier =
(XHandoutMasterSupplier)UnoRuntime.queryInterface(
XHandoutMasterSupplier.class, xComponent );
return aHandoutMasterSupplier.getHandoutMasterPage();
diff --git a/odk/examples/DevelopersGuide/Drawing/PresentationDemo.java b/odk/examples/DevelopersGuide/Drawing/PresentationDemo.java
index 88c100e877f3..6a4113362b26 100644
--- a/odk/examples/DevelopersGuide/Drawing/PresentationDemo.java
+++ b/odk/examples/DevelopersGuide/Drawing/PresentationDemo.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 __________
@@ -61,7 +61,7 @@ import com.sun.star.presentation.XPresentationSupplier;
@author Sven Jacobi
*/
-// This demo will demonstrate how to create a presentation using the Office API
+// This demo will demonstrate how to create a presentation using the Office API
// The first parameter describes the connection that is to use. If there is no parameter
// "uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager" is used.
@@ -90,8 +90,8 @@ public class PresentationDemo
"private:factory/simpress", "_blank", 0, pPropValues );
- XDrawPage xPage;
- XShapes xShapes;
+ XDrawPage xPage;
+ XShapes xShapes;
XPropertySet xShapePropSet;
// create pages, so that three are available
@@ -108,7 +108,7 @@ public class PresentationDemo
com.sun.star.presentation.FadeEffect.FADE_FROM_RIGHT,
com.sun.star.presentation.AnimationSpeed.FAST,
1, 0 ); // automatic object and slide transition
-
+
// create a rectangle that is placed on the top left of the page
xShapePropSet = ShapeHelper.createAndInsertShape( xDrawDoc,
xShapes,new Point( 1000, 1000 ), new Size( 5000, 5000 ),
@@ -117,7 +117,7 @@ public class PresentationDemo
com.sun.star.presentation.AnimationEffect.WAVYLINE_FROM_BOTTOM );
/* the following three properties provokes that the shape is dimmed
- to red
+ to red
after the animation has been finished */
xShapePropSet.setPropertyValue( "DimHide", new Boolean( false ) );
xShapePropSet.setPropertyValue( "DimPrevious", new Boolean( true ) );
@@ -177,7 +177,7 @@ public class PresentationDemo
UnoRuntime.queryInterface( XPropertySet.class, xShape );
xShapePropSet.setPropertyValue("Effect",
com.sun.star.presentation.AnimationEffect.FADE_FROM_BOTTOM );
-
+
xShapePropSet.setPropertyValue(
"OnClick", com.sun.star.presentation.ClickAction.BOOKMARK );
// set the name of page two, and use it with the bookmark action
@@ -219,7 +219,7 @@ public class PresentationDemo
// what type of page xPage is, for this purpose it can been tested
// if the com.sun.star.presentation.DrawPage service is supported
XServiceInfo xInfo = (XServiceInfo)UnoRuntime.queryInterface(
- XServiceInfo.class, xPage );
+ XServiceInfo.class, xPage );
if ( xInfo.supportsService( "com.sun.star.presentation.DrawPage" ) == true )
{
try
diff --git a/odk/examples/DevelopersGuide/Drawing/ShapeHelper.java b/odk/examples/DevelopersGuide/Drawing/ShapeHelper.java
index 7959b642fe0f..72647f4fb680 100644
--- a/odk/examples/DevelopersGuide/Drawing/ShapeHelper.java
+++ b/odk/examples/DevelopersGuide/Drawing/ShapeHelper.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 __________
@@ -59,7 +59,7 @@ import com.sun.star.text.XTextRange;
public class ShapeHelper
{
// __________ static helper methods __________
- //
+ //
public static XPropertySet createAndInsertShape( XComponent xDrawDoc,
XShapes xShapes, Point aPos, Size aSize, String sShapeType )
throws java.lang.Exception
diff --git a/odk/examples/DevelopersGuide/Drawing/StyleDemo.java b/odk/examples/DevelopersGuide/Drawing/StyleDemo.java
index 452526c1fcec..c5a3ad39ff1e 100644
--- a/odk/examples/DevelopersGuide/Drawing/StyleDemo.java
+++ b/odk/examples/DevelopersGuide/Drawing/StyleDemo.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 __________
@@ -97,7 +97,7 @@ public class StyleDemo
(com.sun.star.style.XStyleFamiliesSupplier)
UnoRuntime.queryInterface(
com.sun.star.style.XStyleFamiliesSupplier.class, xModel );
-
+
com.sun.star.container.XNameAccess xFamilies = xSFS.getStyleFamilies();
// the element should now contain at least two Styles. The first is
@@ -107,7 +107,7 @@ public class StyleDemo
{
// this is the family
System.out.println( "\n" + Families[ i ] );
-
+
// and now all available styles
Object aFamilyObj = xFamilies.getByName( Families[ i ] );
com.sun.star.container.XNameAccess xStyles =
diff --git a/odk/examples/DevelopersGuide/Drawing/TextDemo.java b/odk/examples/DevelopersGuide/Drawing/TextDemo.java
index 579f2167da09..cbc87a34d446 100644
--- a/odk/examples/DevelopersGuide/Drawing/TextDemo.java
+++ b/odk/examples/DevelopersGuide/Drawing/TextDemo.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 __________
@@ -82,12 +82,12 @@ public class TextDemo
xDrawDoc = Helper.createDocument( xOfficeContext,
"private:factory/sdraw", "_blank", 0, pPropValues );
- XDrawPage xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
+ XDrawPage xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
XShapes xShapes = (XShapes)
UnoRuntime.queryInterface( XShapes.class, xPage );
- XShape xRectangle;
+ XShape xRectangle;
XPropertySet xTextPropSet, xShapePropSet;
LineSpacing aLineSpacing = new LineSpacing();
aLineSpacing.Mode = LineSpacingMode.PROP;
@@ -126,7 +126,7 @@ public class TextDemo
xRectangle = ShapeHelper.createShape( xDrawDoc,
new Point( 0, 10000 ),
new Size( 21000, 12500 ),
- "com.sun.star.drawing.RectangleShape" );
+ "com.sun.star.drawing.RectangleShape" );
xShapes.add( xRectangle );
xShapePropSet = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, xRectangle );
diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstConnection.java b/odk/examples/DevelopersGuide/FirstSteps/FirstConnection.java
index d38357fe4574..c965c6641512 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/FirstConnection.java
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstConnection.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.
- *
+ *
*************************************************************************/
public class FirstConnection extends java.lang.Object {
@@ -41,7 +41,7 @@ public class FirstConnection extends java.lang.Object {
com.sun.star.comp.helper.Bootstrap.bootstrap();
System.out.println("Connected to a running office ...");
-
+
com.sun.star.lang.XMultiComponentFactory xMCF =
xContext.getServiceManager();
diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java
index 6382c600a143..f4ef0922b8df 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.java
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstLoadComponent.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.PropertyValue;
import com.sun.star.beans.XPropertySet;
@@ -51,13 +51,13 @@ import com.sun.star.sheet.XSpreadsheetView;
import com.sun.star.sheet.XSpreadsheets;
import com.sun.star.table.XCell;
import com.sun.star.uno.UnoRuntime;
-
+
public class FirstLoadComponent {
-
+
/** Creates a new instance of FirstLoadComponent */
public FirstLoadComponent() {
}
-
+
/**
* @param args the command line arguments
*/
@@ -68,41 +68,41 @@ public class FirstLoadComponent {
if (xRemoteContext == null) {
System.err.println("ERROR: Could not bootstrap default Office.");
}
-
+
XMultiComponentFactory xRemoteServiceManager = xRemoteContext.getServiceManager();
-
+
Object desktop = xRemoteServiceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", xRemoteContext);
XComponentLoader xComponentLoader = (XComponentLoader)
UnoRuntime.queryInterface(XComponentLoader.class, desktop);
-
+
PropertyValue[] loadProps = new PropertyValue[0];
XComponent xSpreadsheetComponent = xComponentLoader.loadComponentFromURL("private:factory/scalc", "_blank", 0, loadProps);
-
+
XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument)
UnoRuntime.queryInterface(XSpreadsheetDocument.class,
xSpreadsheetComponent);
-
+
XSpreadsheets xSpreadsheets = xSpreadsheetDocument.getSheets();
xSpreadsheets.insertNewByName("MySheet", (short)0);
com.sun.star.uno.Type elemType = xSpreadsheets.getElementType();
-
+
System.out.println(elemType.getTypeName());
Object sheet = xSpreadsheets.getByName("MySheet");
XSpreadsheet xSpreadsheet = (XSpreadsheet)UnoRuntime.queryInterface(
XSpreadsheet.class, sheet);
-
+
XCell xCell = xSpreadsheet.getCellByPosition(0, 0);
xCell.setValue(21);
xCell = xSpreadsheet.getCellByPosition(0, 1);
xCell.setValue(21);
xCell = xSpreadsheet.getCellByPosition(0, 2);
xCell.setFormula("=sum(A1:A2)");
-
+
XPropertySet xCellProps = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xCell);
xCellProps.setPropertyValue("CellStyle", "Result");
-
+
XModel xSpreadsheetModel = (XModel)UnoRuntime.queryInterface(
XModel.class, xSpreadsheetComponent);
XController xSpreadsheetController = xSpreadsheetModel.getCurrentController();
@@ -110,32 +110,32 @@ public class FirstLoadComponent {
UnoRuntime.queryInterface(XSpreadsheetView.class,
xSpreadsheetController);
xSpreadsheetView.setActiveSheet(xSpreadsheet);
-
+
// *********************************************************
// example for use of enum types
xCellProps.setPropertyValue("VertJustify",
com.sun.star.table.CellVertJustify.TOP);
-
-
+
+
// *********************************************************
// example for a sequence of PropertyValue structs
// create an array with one PropertyValue struct, it contains
// references only
loadProps = new PropertyValue[1];
-
+
// instantiate PropertyValue struct and set its member fields
PropertyValue asTemplate = new PropertyValue();
asTemplate.Name = "AsTemplate";
asTemplate.Value = new Boolean(true);
-
+
// assign PropertyValue struct to array of references for PropertyValue
// structs
loadProps[0] = asTemplate;
-
+
// load calc file as template
//xSpreadsheetComponent = xComponentLoader.loadComponentFromURL(
// "file:///c:/temp/DataAnalysys.ods", "_blank", 0, loadProps);
-
+
// *********************************************************
// example for use of XEnumerationAccess
XCellRangesQuery xCellQuery = (XCellRangesQuery)
@@ -144,7 +144,7 @@ public class FirstLoadComponent {
(short)com.sun.star.sheet.CellFlags.FORMULA);
XEnumerationAccess xFormulas = xFormulaCells.getCells();
XEnumeration xFormulaEnum = xFormulas.createEnumeration();
-
+
while (xFormulaEnum.hasMoreElements()) {
Object formulaCell = xFormulaEnum.nextElement();
xCell = (XCell)UnoRuntime.queryInterface(XCell.class, formulaCell);
@@ -155,7 +155,7 @@ public class FirstLoadComponent {
+ ", row " + xCellAddress.getCellAddress().Row
+ " contains " + xCell.getFormula());
}
-
+
}
catch (java.lang.Exception e){
e.printStackTrace();
@@ -164,7 +164,7 @@ public class FirstLoadComponent {
System.exit( 0 );
}
}
-
+
}
@@ -196,17 +196,17 @@ public class FirstLoadComponent {
// * @author dschulten
// */
// public class FirstLoadComponent {
-
+
// /** Creates a new instance of FirstLoadComponent */
// public FirstLoadComponent() {
// }
-
+
// /**
// * @param args the command line arguments
// */
// private XComponentContext xRemoteContext = null;
// private XMultiComponentFactory xRemoteServiceManager = null;
-
+
// public static void main(String[] args) {
// FirstLoadComponent firstLoadComponent1 = new FirstLoadComponent();
// try {
@@ -220,13 +220,13 @@ public class FirstLoadComponent {
// System.exit(0);
// }
// }
-
+
// private void useConnection() throws java.lang.Exception {
// try {
// // get the remote office component context
// xRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
// System.out.println("Connected to a running office ...");
-
+
// xRemoteServiceManager = xRemoteContext.getServiceManager();
// }
// catch( Exception e) {
@@ -242,7 +242,7 @@ public class FirstLoadComponent {
// PropertyValue[] loadProps = new PropertyValue[0];
// XComponent xSpreadsheetComponent = xComponentLoader.loadComponentFromURL("private:factory/scalc", "_blank", 0, loadProps);
-
+
// XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument)
// UnoRuntime.queryInterface(XSpreadsheetDocument.class,
// xSpreadsheetComponent);
@@ -250,7 +250,7 @@ public class FirstLoadComponent {
// XSpreadsheets xSpreadsheets = xSpreadsheetDocument.getSheets();
// xSpreadsheets.insertNewByName("MySheet", (short)0);
// com.sun.star.uno.Type elemType = xSpreadsheets.getElementType();
-
+
// System.out.println(elemType.getTypeName());
// Object sheet = xSpreadsheets.getByName("MySheet");
// XSpreadsheet xSpreadsheet = (XSpreadsheet)UnoRuntime.queryInterface(
@@ -266,21 +266,21 @@ public class FirstLoadComponent {
// XPropertySet xCellProps = (XPropertySet)UnoRuntime.queryInterface(
// XPropertySet.class, xCell);
// xCellProps.setPropertyValue("CellStyle", "Result");
-
+
// XModel xSpreadsheetModel = (XModel)UnoRuntime.queryInterface(
// XModel.class, xSpreadsheetComponent);
// XController xSpreadsheetController = xSpreadsheetModel.getCurrentController();
// XSpreadsheetView xSpreadsheetView = (XSpreadsheetView)
// UnoRuntime.queryInterface(XSpreadsheetView.class,
// xSpreadsheetController);
-// xSpreadsheetView.setActiveSheet(xSpreadsheet);
-
+// xSpreadsheetView.setActiveSheet(xSpreadsheet);
+
// // *********************************************************
// // example for use of enum types
// xCellProps.setPropertyValue("VertJustify",
// com.sun.star.table.CellVertJustify.TOP);
-
+
// // *********************************************************
// // example for a sequence of PropertyValue structs
// // create an array with one PropertyValue struct, it contains
@@ -299,7 +299,7 @@ public class FirstLoadComponent {
// // load calc file as template
// //xSpreadsheetComponent = xComponentLoader.loadComponentFromURL(
// // "file:///c:/temp/DataAnalysys.ods", "_blank", 0, loadProps);
-
+
// // *********************************************************
// // example for use of XEnumerationAccess
// XCellRangesQuery xCellQuery = (XCellRangesQuery)
@@ -308,7 +308,7 @@ public class FirstLoadComponent {
// (short)com.sun.star.sheet.CellFlags.FORMULA);
// XEnumerationAccess xFormulas = xFormulaCells.getCells();
// XEnumeration xFormulaEnum = xFormulas.createEnumeration();
-
+
// while (xFormulaEnum.hasMoreElements()) {
// Object formulaCell = xFormulaEnum.nextElement();
// xCell = (XCell)UnoRuntime.queryInterface(XCell.class, formulaCell);
@@ -319,11 +319,11 @@ public class FirstLoadComponent {
// + ", row " + xCellAddress.getCellAddress().Row
// + " contains " + xCell.getFormula());
// }
-
+
// }
// catch( com.sun.star.lang.DisposedException e ) { //works from Patch 1
// xRemoteContext = null;
// throw e;
-// }
-// }
+// }
+// }
// }
diff --git a/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.java b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.java
index 24a5efa32154..4c8dd0966a16 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.java
+++ b/odk/examples/DevelopersGuide/FirstSteps/FirstUnoContact.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.
- *
+ *
*************************************************************************/
public class FirstUnoContact {
diff --git a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java
index 7c40da707d2d..047747e5bba5 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java
+++ b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.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;
@@ -418,7 +418,7 @@ public class HelloTextTableShape {
int col = theLine.Color;
System.out.println(col);
}
-
+
protected void manipulateShape(XShape xShape) throws com.sun.star.uno.Exception {
XPropertySet xShapeProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShape);
xShapeProps.setPropertyValue("FillColor", new Integer(0x99CCFF));
@@ -428,7 +428,7 @@ public class HelloTextTableShape {
xShapeProps.setPropertyValue("TextLeftDistance", new Integer(0));
xShapeProps.setPropertyValue("TextRightDistance", new Integer(0));
xShapeProps.setPropertyValue("TextUpperDistance", new Integer(0));
- xShapeProps.setPropertyValue("TextLowerDistance", new Integer(0));
+ xShapeProps.setPropertyValue("TextLowerDistance", new Integer(0));
}
@@ -449,13 +449,13 @@ public class HelloTextTableShape {
// First step: get the remote office component context
xRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
System.out.println("Connected to a running office ...");
-
+
xRemoteServiceManager = xRemoteContext.getServiceManager();
}
catch( Exception e) {
e.printStackTrace();
System.exit(1);
- }
+ }
}
return xRemoteServiceManager;
}
diff --git a/odk/examples/DevelopersGuide/FirstSteps/build_FirstUnoContact.xml b/odk/examples/DevelopersGuide/FirstSteps/build_FirstUnoContact.xml
index 15184aba7e4d..e2b534f8b498 100644
--- a/odk/examples/DevelopersGuide/FirstSteps/build_FirstUnoContact.xml
+++ b/odk/examples/DevelopersGuide/FirstSteps/build_FirstUnoContact.xml
@@ -4,23 +4,23 @@
<property environment="env"/>
<property name="OFFICE_HOME" value="${env.OFFICE_HOME}"/>
<property name="OO_SDK_HOME" value="${env.OO_SDK_HOME}"/>
-
+
<target name="init">
<property name="OUTDIR" value="${OO_SDK_HOME}/WINExample.out/class/FirstUnoContact"/>
</target>
- <path id="office.class.path">
+ <path id="office.class.path">
<filelist dir="${OFFICE_HOME}/program/classes"
files="jurt.jar,unoil.jar,ridl.jar,juh.jar"/>
- </path>
-
+ </path>
+
<fileset id="bootstrap.glue.code" dir="${OO_SDK_HOME}/classes">
<patternset>
<include name="com/sun/star/lib/loader/*.class"/>
<include name="win/unowinreg.dll"/>
</patternset>
- </fileset>
-
+ </fileset>
+
<target name="compile" depends="init">
<mkdir dir="${OUTDIR}"/>
<javac debug="true" deprecation="true" destdir="${OUTDIR}" srcdir=".">
@@ -29,7 +29,7 @@
</target>
<target name="jar" depends="init,compile">
- <jar basedir="${OUTDIR}" compress="true"
+ <jar basedir="${OUTDIR}" compress="true"
jarfile="${OUTDIR}/FirstUnoContact.jar">
<exclude name="**/*.java"/>
<exclude name="*.jar"/>
diff --git a/odk/examples/DevelopersGuide/Forms/ButtonOperator.java b/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
index 3b792e28ea22..b07b6e804137 100644
--- a/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
+++ b/odk/examples/DevelopersGuide/Forms/ButtonOperator.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.
- *
+ *
*************************************************************************/
// java base stuff
import com.sun.star.awt.ActionEvent;
@@ -50,12 +50,12 @@ import java.util.Vector;
*/
public class ButtonOperator implements XActionListener, XFeatureInvalidation
{
- private XComponentContext m_componentContext;
- private DocumentHelper m_aDocument;
+ private XComponentContext m_componentContext;
+ private DocumentHelper m_aDocument;
private XPropertySet m_form;
private XFormOperations m_formOperations;
- private Vector m_aButtons;
+ private Vector m_aButtons;
/* ------------------------------------------------------------------ */
/** ctor
diff --git a/odk/examples/DevelopersGuide/Forms/ComponentTreeTraversal.java b/odk/examples/DevelopersGuide/Forms/ComponentTreeTraversal.java
index 60f46b54eca1..6501120d82f2 100644
--- a/odk/examples/DevelopersGuide/Forms/ComponentTreeTraversal.java
+++ b/odk/examples/DevelopersGuide/Forms/ComponentTreeTraversal.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.*;
@@ -60,9 +60,9 @@ class ComponentTreeTraversal implements IFormComponentAction
{
// step down the tree, if possible
XServiceInfo xSI = UNO.queryServiceInfo( xContainer );
- if ( null != xSI
- && ( xSI.supportsService( "com.sun.star.form.FormComponents" )
- || xSI.supportsService( "com.sun.star.form.component.GridControl" )
+ if ( null != xSI
+ && ( xSI.supportsService( "com.sun.star.form.FormComponents" )
+ || xSI.supportsService( "com.sun.star.form.component.GridControl" )
)
)
{
@@ -77,8 +77,8 @@ class ComponentTreeTraversal implements IFormComponentAction
public void handle( Object aFormComponent ) throws com.sun.star.uno.Exception
{
XIndexContainer xCont = UNO.queryIndexContainer( aFormComponent );
- if ( ( null != xCont )
- && shouldStepInto( xCont )
+ if ( ( null != xCont )
+ && shouldStepInto( xCont )
)
{
for ( int i=0; i<xCont.getCount(); ++i )
diff --git a/odk/examples/DevelopersGuide/Forms/ControlLock.java b/odk/examples/DevelopersGuide/Forms/ControlLock.java
index 5dada0d8fca7..85cf988d9ae8 100644
--- a/odk/examples/DevelopersGuide/Forms/ControlLock.java
+++ b/odk/examples/DevelopersGuide/Forms/ControlLock.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.*;
@@ -48,9 +48,9 @@ import com.sun.star.sdbc.*;
class LockControlModels extends ComponentTreeTraversal
{
- private String m_sDataField;
- private Boolean m_aLockIt;
- private int m_nLevel; // nesting level relative to the form we started with
+ private String m_sDataField;
+ private Boolean m_aLockIt;
+ private int m_nLevel; // nesting level relative to the form we started with
/* ------------------------------------------------------------------ */
public LockControlModels( String sDataField, boolean bLockIt )
@@ -64,7 +64,7 @@ class LockControlModels extends ComponentTreeTraversal
protected boolean shouldStepInto( XIndexContainer xContainer ) throws com.sun.star.uno.Exception
{
if ( !super.shouldStepInto( xContainer ) )
- return false; // don't try to be more clever than our base class
+ return false; // don't try to be more clever than our base class
XForm xForm = (XForm)UnoRuntime.queryInterface( XForm.class, xContainer );
if ( ( null != xForm ) && ( m_nLevel > 1 ) )
@@ -88,10 +88,10 @@ class LockControlModels extends ComponentTreeTraversal
xPSI = xCompProps.getPropertySetInfo();
if ( ( null != xPSI ) && xPSI.hasPropertyByName( "DataField" ) )
- { // indeed it has ....
+ { // indeed it has ....
String sDataField = (String)xCompProps.getPropertyValue( "DataField" );
if ( sDataField.equals( m_sDataField ) )
- { // we found a control model which is bound to what we're looking for
+ { // we found a control model which is bound to what we're looking for
xCompProps.setPropertyValue( "ReadOnly", m_aLockIt );
}
}
@@ -112,10 +112,10 @@ class LockControlModels extends ComponentTreeTraversal
*/
class ControlLock implements XRowSetListener
{
- private XPropertySet m_xForm;
- private String m_sDataField;
- private boolean m_bLockingEnabled;
- private boolean m_bPreviousRoundLock;
+ private XPropertySet m_xForm;
+ private String m_sDataField;
+ private boolean m_bLockingEnabled;
+ private boolean m_bPreviousRoundLock;
/* ------------------------------------------------------------------ */
ControlLock( XPropertySet xForm, String sBoundDataField )
diff --git a/odk/examples/DevelopersGuide/Forms/ControlValidation.java b/odk/examples/DevelopersGuide/Forms/ControlValidation.java
index 38e019ea72b0..f5aa1b087b7e 100644
--- a/odk/examples/DevelopersGuide/Forms/ControlValidation.java
+++ b/odk/examples/DevelopersGuide/Forms/ControlValidation.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/ControlValidator.java b/odk/examples/DevelopersGuide/Forms/ControlValidator.java
index 0ce594633590..e4be47b3e8c3 100644
--- a/odk/examples/DevelopersGuide/Forms/ControlValidator.java
+++ b/odk/examples/DevelopersGuide/Forms/ControlValidator.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/DataAwareness.java b/odk/examples/DevelopersGuide/Forms/DataAwareness.java
index 1bbe299872d0..bedf0b499cb9 100644
--- a/odk/examples/DevelopersGuide/Forms/DataAwareness.java
+++ b/odk/examples/DevelopersGuide/Forms/DataAwareness.java
@@ -149,19 +149,19 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
private static final String s_tableNameCustomers = "CUSTOMERS";
private static final String s_tableNameSales = "SALES";
- private XPropertySet m_xMasterForm;
- private ButtonOperator m_aOperator;
- private SalesFilter m_aSalesFilter;
+ private XPropertySet m_xMasterForm;
+ private ButtonOperator m_aOperator;
+ private SalesFilter m_aSalesFilter;
- private KeyGenerator m_aSalesmanKeyGenerator;
- private KeyGenerator m_aSalesKeyGenerator;
- private ControlLock m_aSalesmenLocker;
- private ControlLock m_aSalesLocker;
- private GridFieldValidator m_aSalesNameValidator;
+ private KeyGenerator m_aSalesmanKeyGenerator;
+ private KeyGenerator m_aSalesKeyGenerator;
+ private ControlLock m_aSalesmenLocker;
+ private ControlLock m_aSalesLocker;
+ private GridFieldValidator m_aSalesNameValidator;
- private boolean m_bDefaultSalesDate;
- private boolean m_bProtectKeyFields;
- private boolean m_bAllowEmptySales;
+ private boolean m_bDefaultSalesDate;
+ private boolean m_bProtectKeyFields;
+ private boolean m_bAllowEmptySales;
/* ------------------------------------------------------------------ */
public DataAwareness()
@@ -225,10 +225,10 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
{
Boolean aIsNew = (Boolean)xFormProps.getPropertyValue( "IsNew" );
if ( aIsNew.booleanValue() )
- { // yepp
+ { // yepp
if ( !m_bDefaultSalesDate )
- { // we're interested to do all this only if the user told us to default the sales date
+ { // we're interested to do all this only if the user told us to default the sales date
// to "today"
// As date fields do this defaulting automatically, the semantics is inverted here:
// If we're told to default, we must do nothing, if we should not default, we must
@@ -276,7 +276,7 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
{
// did it come from a radio button or checkbox?
if ( aEvent.PropertyName.equals( "State" ) )
- { // yep
+ { // yep
Short aNewState = (Short)aEvent.NewValue;
XPropertySet xModel = UNO.queryPropertySet( aEvent.Source );
@@ -292,7 +292,7 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
{
// it's one of the options for key generation
if ( sRefValue.equals( "none" ) )
- { // no automatic generation at all
+ { // no automatic generation at all
m_aSalesmanKeyGenerator.stopGenerator( );
m_aSalesKeyGenerator.stopGenerator( );
}
@@ -300,11 +300,11 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
{
boolean bGenerateOnReset = true;
if ( sRefValue.equals( "update" ) )
- { // generate on update
+ { // generate on update
bGenerateOnReset = ( 0 == nNewValue );
}
else if ( sRefValue.equals( "reset" ) )
- { // generat on reset
+ { // generat on reset
bGenerateOnReset = ( 0 != nNewValue );
}
m_aSalesmanKeyGenerator.activateKeyGenerator( bGenerateOnReset );
@@ -413,7 +413,7 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
String[] aCurrentFilter = (String[])xDSP.getPropertyValue( "TableFilter" );
// check if the table name is already part of it
- String sAllTables = "*"; // all tables
+ String sAllTables = "*"; // all tables
for ( int i=0; i<aCurrentFilter.length; ++i )
{
@@ -692,7 +692,7 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
// --------------------------------------------------------------
/* create some shapes */
- XPropertySet xSNRField = m_formLayer.insertControlLine( "NumericField", "SNR", "", 3 );
+ XPropertySet xSNRField = m_formLayer.insertControlLine( "NumericField", "SNR", "", 3 );
m_formLayer.insertControlLine( "TextField", "FIRSTNAME", "", 11);
m_formLayer.insertControlLine( "TextField", "LASTNAME", "", 19 );
m_formLayer.insertControlLine( "TextField", "STREET", "", 27 );
@@ -748,17 +748,17 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
xSalesFormProps.setPropertyValue( "Command", sCommand );
// the master-details connection
- String[] aMasterFields = new String[] { "SNR" }; // the field in the master form
- String[] aDetailFields = new String[] { "salesmen" }; // the name in the detail form
+ String[] aMasterFields = new String[] { "SNR" }; // the field in the master form
+ String[] aDetailFields = new String[] { "salesmen" }; // the name in the detail form
xSalesFormProps.setPropertyValue( "MasterFields", aMasterFields );
xSalesFormProps.setPropertyValue( "DetailFields", aDetailFields );
// the create thr grid model
XPropertySet xSalesGridModel = m_formLayer.createControlAndShape( "GridControl", 2, 80, 162, 40, xSalesForm );
xSalesGridModel.setPropertyValue( "Name", "SalesTable" );
- XPropertySet xKeyColumn = createGridColumn( xSalesGridModel, "NumericField", "SALENR", 12 );
- XPropertySet xCustomerColumn = createGridColumn( xSalesGridModel, "ListBox", "COS_NR", 40 );
- XPropertySet xSalesNameColumn = createGridColumn( xSalesGridModel, "TextField", "NAME", 25 );
+ XPropertySet xKeyColumn = createGridColumn( xSalesGridModel, "NumericField", "SALENR", 12 );
+ XPropertySet xCustomerColumn = createGridColumn( xSalesGridModel, "ListBox", "COS_NR", 40 );
+ XPropertySet xSalesNameColumn = createGridColumn( xSalesGridModel, "TextField", "NAME", 25 );
createGridColumn( xSalesGridModel, "DateField", "SALEDATE", 24 );
createGridColumn( xSalesGridModel, "CurrencyField", "PRICE", 16 );
diff --git a/odk/examples/DevelopersGuide/Forms/DateValidator.java b/odk/examples/DevelopersGuide/Forms/DateValidator.java
index daa60523bffa..69ba9fd43b9b 100644
--- a/odk/examples/DevelopersGuide/Forms/DateValidator.java
+++ b/odk/examples/DevelopersGuide/Forms/DateValidator.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java b/odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java
index fe055575bba5..9b572bf0735c 100644
--- a/odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java
+++ b/odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -69,7 +69,7 @@ public abstract class DocumentBasedExample implements com.sun.star.lang.XEventLi
// get the remote office component context
m_xCtx = com.sun.star.comp.helper.Bootstrap.bootstrap();
- System.out.println("Connected to a running office ...");
+ System.out.println("Connected to a running office ...");
}
catch (java.lang.Exception e)
{
@@ -190,7 +190,7 @@ public abstract class DocumentBasedExample implements com.sun.star.lang.XEventLi
/* ------------------------------------------------------------------ */
/** waits for the user to press a key (on the console where she started
the java program) or the document to be closed by the user.
-
+
@return <TRUE/> if the user pressed a key on the console,
<FALSE/> if she closed the document
*/
diff --git a/odk/examples/DevelopersGuide/Forms/DocumentHelper.java b/odk/examples/DevelopersGuide/Forms/DocumentHelper.java
index 85aab025d7bd..6ec184e9c08b 100644
--- a/odk/examples/DevelopersGuide/Forms/DocumentHelper.java
+++ b/odk/examples/DevelopersGuide/Forms/DocumentHelper.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/DocumentType.java b/odk/examples/DevelopersGuide/Forms/DocumentType.java
index 5ac8e3e1c5c3..6eea1e02256a 100644
--- a/odk/examples/DevelopersGuide/Forms/DocumentType.java
+++ b/odk/examples/DevelopersGuide/Forms/DocumentType.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java b/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java
index d95fbe452ce5..d5e9d145b33c 100644
--- a/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java
+++ b/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -49,9 +49,9 @@ import com.sun.star.view.XFormLayerAccess;
*/
class DocumentViewHelper
{
- private XMultiServiceFactory m_orb;
+ private XMultiServiceFactory m_orb;
private XController m_controller;
- private DocumentHelper m_document;
+ private DocumentHelper m_document;
/* ------------------------------------------------------------------ */
final protected XController getController()
diff --git a/odk/examples/DevelopersGuide/Forms/FLTools.java b/odk/examples/DevelopersGuide/Forms/FLTools.java
index 3f87e77e1bd6..c50eb99149ba 100644
--- a/odk/examples/DevelopersGuide/Forms/FLTools.java
+++ b/odk/examples/DevelopersGuide/Forms/FLTools.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.*;
@@ -96,7 +96,7 @@ public class FLTools
XPropertySet xProps = UNO.queryPropertySet( aFormComponent );
XPropertySetInfo xPSI = ( null != xProps ) ? xProps.getPropertySetInfo() : null;
if ( null == xPSI )
- { // no property set or no property set info
+ { // no property set or no property set info
// can't do anything except falling back to the name
return getName( aFormComponent );
}
@@ -113,7 +113,7 @@ public class FLTools
sLabel = (String)xProps.getPropertyValue( "Label" );
if ( 0 == sLabel.length() )
- { // no Label property or no label set
+ { // no Label property or no label set
// -> fallback to the component name
sLabel = getName( aFormComponent );
}
@@ -145,7 +145,7 @@ public class FLTools
XInterface xCurrent = (XInterface)UnoRuntime.queryInterface(
XInterface.class, xIndexCont.getByIndex( 0 ) );
if ( xCurrent.equals( xElement ) )
- { // found
+ { // found
nIndex = i;
break;
}
@@ -225,24 +225,24 @@ public class FLTools
switch ( nClassId.intValue() )
{
case FormComponentType.COMMANDBUTTON: sType = "Command button"; break;
- case FormComponentType.RADIOBUTTON : sType = "Radio button"; break;
- case FormComponentType.IMAGEBUTTON : sType = "Image button"; break;
- case FormComponentType.CHECKBOX : sType = "Check Box"; break;
- case FormComponentType.LISTBOX : sType = "List Box"; break;
- case FormComponentType.COMBOBOX : sType = "Combo Box"; break;
- case FormComponentType.GROUPBOX : sType = "Group Box"; break;
- case FormComponentType.FIXEDTEXT : sType = "Fixed Text"; break;
- case FormComponentType.GRIDCONTROL : sType = "Grid Control"; break;
- case FormComponentType.FILECONTROL : sType = "File Control"; break;
+ case FormComponentType.RADIOBUTTON : sType = "Radio button"; break;
+ case FormComponentType.IMAGEBUTTON : sType = "Image button"; break;
+ case FormComponentType.CHECKBOX : sType = "Check Box"; break;
+ case FormComponentType.LISTBOX : sType = "List Box"; break;
+ case FormComponentType.COMBOBOX : sType = "Combo Box"; break;
+ case FormComponentType.GROUPBOX : sType = "Group Box"; break;
+ case FormComponentType.FIXEDTEXT : sType = "Fixed Text"; break;
+ case FormComponentType.GRIDCONTROL : sType = "Grid Control"; break;
+ case FormComponentType.FILECONTROL : sType = "File Control"; break;
case FormComponentType.HIDDENCONTROL: sType = "Hidden Control"; break;
case FormComponentType.IMAGECONTROL : sType = "Image Control"; break;
- case FormComponentType.DATEFIELD : sType = "Date Field"; break;
- case FormComponentType.TIMEFIELD : sType = "Time Field"; break;
+ case FormComponentType.DATEFIELD : sType = "Date Field"; break;
+ case FormComponentType.TIMEFIELD : sType = "Time Field"; break;
case FormComponentType.NUMERICFIELD : sType = "Numeric Field"; break;
case FormComponentType.CURRENCYFIELD: sType = "Currency Field"; break;
case FormComponentType.PATTERNFIELD : sType = "Pattern Field"; break;
- case FormComponentType.TEXTFIELD :
+ case FormComponentType.TEXTFIELD :
// there are two known services with this class id: the usual text field,
// and the formatted field
sType = "Text Field";
diff --git a/odk/examples/DevelopersGuide/Forms/FormLayer.java b/odk/examples/DevelopersGuide/Forms/FormLayer.java
index 468937aacb83..e143e9e12546 100644
--- a/odk/examples/DevelopersGuide/Forms/FormLayer.java
+++ b/odk/examples/DevelopersGuide/Forms/FormLayer.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java b/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java
index 03e8a931d528..c50ae50f9582 100644
--- a/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java
+++ b/odk/examples/DevelopersGuide/Forms/GridFieldValidator.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.
- *
+ *
*************************************************************************/
/**************************************************************************/
@@ -52,11 +52,11 @@ import com.sun.star.task.*;
*/
class GridFieldValidator implements XUpdateListener
{
- private DocumentHelper m_aDocument;
- private XComponentContext m_xCtx;
- private XPropertySet m_xWatchedColumn;
+ private DocumentHelper m_aDocument;
+ private XComponentContext m_xCtx;
+ private XPropertySet m_xWatchedColumn;
- private boolean m_bWatching;
+ private boolean m_bWatching;
/* ------------------------------------------------------------------ */
public GridFieldValidator( XComponentContext xCtx, XPropertySet xWatchedGridColumn )
diff --git a/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java b/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java
index 2d1ba453d914..9c5fbb7259d6 100644
--- a/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java
+++ b/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/InteractionRequest.java b/odk/examples/DevelopersGuide/Forms/InteractionRequest.java
index 31b31c9ebd92..8547fdfcf5ab 100644
--- a/odk/examples/DevelopersGuide/Forms/InteractionRequest.java
+++ b/odk/examples/DevelopersGuide/Forms/InteractionRequest.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.*;
@@ -41,8 +41,8 @@ import java.util.Vector;
*/
class InteractionRequest implements XInteractionRequest
{
- private Object m_aRequest;
- private Vector m_aContinuations;
+ private Object m_aRequest;
+ private Vector m_aContinuations;
/* ------------------------------------------------------------------ */
public InteractionRequest( Object aRequest )
diff --git a/odk/examples/DevelopersGuide/Forms/KeyGenerator.java b/odk/examples/DevelopersGuide/Forms/KeyGenerator.java
index 21012abb046e..324090ef9109 100644
--- a/odk/examples/DevelopersGuide/Forms/KeyGenerator.java
+++ b/odk/examples/DevelopersGuide/Forms/KeyGenerator.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.*;
@@ -182,8 +182,8 @@ class UniqueColumnValue
class KeyGeneratorForReset extends UniqueColumnValue implements XResetListener
{
/* ------------------------------------------------------------------ */
- private DocumentViewHelper m_aView;
- private String m_sFieldName;
+ private DocumentViewHelper m_aView;
+ private String m_sFieldName;
/* ------------------------------------------------------------------ */
/** ctor
@@ -255,7 +255,7 @@ class KeyGeneratorForReset extends UniqueColumnValue implements XResetListener
{
Boolean aIsNew = (Boolean)xFormProps.getPropertyValue( "IsNew" );
if ( aIsNew.booleanValue() )
- { // yepp
+ { // yepp
// we're going to modify the record, though after that, to the user, it should look
// like it has not been modified
@@ -295,7 +295,7 @@ class KeyGeneratorForReset extends UniqueColumnValue implements XResetListener
class KeyGeneratorForUpdate extends UniqueColumnValue implements XRowSetApproveListener
{
/* ------------------------------------------------------------------ */
- private String m_sFieldName;
+ private String m_sFieldName;
/* ------------------------------------------------------------------ */
public KeyGeneratorForUpdate( String sFieldName )
@@ -354,13 +354,13 @@ class KeyGeneratorForUpdate extends UniqueColumnValue implements XRowSetApproveL
public class KeyGenerator
{
/* ------------------------------------------------------------------ */
- private KeyGeneratorForReset m_aResetKeyGenerator;
- private KeyGeneratorForUpdate m_aUpdateKeyGenerator;
- private boolean m_bResetListening;
- private boolean m_bUpdateListening;
+ private KeyGeneratorForReset m_aResetKeyGenerator;
+ private KeyGeneratorForUpdate m_aUpdateKeyGenerator;
+ private boolean m_bResetListening;
+ private boolean m_bUpdateListening;
- private DocumentHelper m_aDocument;
- private XPropertySet m_xForm;
+ private DocumentHelper m_aDocument;
+ private XPropertySet m_xForm;
/* ------------------------------------------------------------------ */
/** ctor
diff --git a/odk/examples/DevelopersGuide/Forms/ListSelectionValidator.java b/odk/examples/DevelopersGuide/Forms/ListSelectionValidator.java
index 6f605eaa3592..845d68025fc2 100644
--- a/odk/examples/DevelopersGuide/Forms/ListSelectionValidator.java
+++ b/odk/examples/DevelopersGuide/Forms/ListSelectionValidator.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/NumericValidator.java b/odk/examples/DevelopersGuide/Forms/NumericValidator.java
index 220996666e95..350d776d0e0a 100644
--- a/odk/examples/DevelopersGuide/Forms/NumericValidator.java
+++ b/odk/examples/DevelopersGuide/Forms/NumericValidator.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/RowSet.java b/odk/examples/DevelopersGuide/Forms/RowSet.java
index f21b26b4d7f8..f123ae6a8cfe 100644
--- a/odk/examples/DevelopersGuide/Forms/RowSet.java
+++ b/odk/examples/DevelopersGuide/Forms/RowSet.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/SalesFilter.java b/odk/examples/DevelopersGuide/Forms/SalesFilter.java
index fa6e9d19abc7..c461d5cac007 100644
--- a/odk/examples/DevelopersGuide/Forms/SalesFilter.java
+++ b/odk/examples/DevelopersGuide/Forms/SalesFilter.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.*;
@@ -51,18 +51,18 @@ import java.util.GregorianCalendar;
*/
class SalesFilter implements XActionListener, XPropertyChangeListener, XResetListener
{
- private DocumentHelper m_aDocument;
- private XPropertySet m_xSalesForm;
+ private DocumentHelper m_aDocument;
+ private XPropertySet m_xSalesForm;
- private XPropertySet m_xFilterList;
- private XPropertySet m_xManualFilter;
- private XPropertySet m_xApplyFilter;
+ private XPropertySet m_xFilterList;
+ private XPropertySet m_xManualFilter;
+ private XPropertySet m_xApplyFilter;
- private boolean m_bSettingsDirty;
- private boolean m_bSettingDate;
- private boolean m_bAdjustingFilterList;
- private short m_nPreviousFilterIndex;
- private java.util.Vector m_aFilterDates;
+ private boolean m_bSettingsDirty;
+ private boolean m_bSettingDate;
+ private boolean m_bAdjustingFilterList;
+ private short m_nPreviousFilterIndex;
+ private java.util.Vector m_aFilterDates;
/* ------------------------------------------------------------------ */
public SalesFilter( DocumentHelper aDocument, XPropertySet xSalesForm,
@@ -298,7 +298,7 @@ class SalesFilter implements XActionListener, XPropertyChangeListener, XResetLis
try
{
if ( isManualFilter( m_nPreviousFilterIndex ) )
- { // previously, the "custom" filter date was selected
+ { // previously, the "custom" filter date was selected
// -> remember the date entered
Object aDate = translateDate( m_xManualFilter.getPropertyValue( "Date" ) );
m_aFilterDates.set( m_nPreviousFilterIndex, aDate );
@@ -351,9 +351,9 @@ class SalesFilter implements XActionListener, XPropertyChangeListener, XResetLis
// both are null
return true;
- return ( aLHS.get( Calendar.YEAR ) == aRHS.get( Calendar.YEAR ) )
- && ( aLHS.get( Calendar.MONTH ) == aRHS.get( Calendar.MONTH ) )
- && ( aLHS.get( Calendar.DAY_OF_MONTH ) == aRHS.get( Calendar.DAY_OF_MONTH ) );
+ return ( aLHS.get( Calendar.YEAR ) == aRHS.get( Calendar.YEAR ) )
+ && ( aLHS.get( Calendar.MONTH ) == aRHS.get( Calendar.MONTH ) )
+ && ( aLHS.get( Calendar.DAY_OF_MONTH ) == aRHS.get( Calendar.DAY_OF_MONTH ) );
}
/* ------------------------------------------------------------------ */
@@ -377,7 +377,7 @@ class SalesFilter implements XActionListener, XPropertyChangeListener, XResetLis
// check if this date is already present in the list of user defined dates
for ( int i=0; i<m_aFilterDates.size(); ++i )
{
- if ( !isManualFilter( (short)i ) ) // do not compare with the manual filter
+ if ( !isManualFilter( (short)i ) ) // do not compare with the manual filter
{
GregorianCalendar aCheckCal = getCalendarObject( (java.util.Date)m_aFilterDates.elementAt( i ) );
if ( equalDate( aDateCal, aCheckCal ) )
@@ -386,7 +386,7 @@ class SalesFilter implements XActionListener, XPropertyChangeListener, XResetLis
}
System.out.println( );
- if ( aFilterItems.size() > 10 ) // (6 standard items + 5 user defined items)
+ if ( aFilterItems.size() > 10 ) // (6 standard items + 5 user defined items)
{
// the first (and thus oldes) user defined item
aFilterItems.removeElementAt( 6 );
@@ -442,7 +442,7 @@ class SalesFilter implements XActionListener, XPropertyChangeListener, XResetLis
XLoadable.class, m_xSalesForm );
xLoad.reload();
- m_aDocument.getCurrentView().grabControlFocus( m_xFilterList );
+ m_aDocument.getCurrentView().grabControlFocus( m_xFilterList );
}
catch ( java.lang.Exception e )
{
diff --git a/odk/examples/DevelopersGuide/Forms/SingleControlValidation.java b/odk/examples/DevelopersGuide/Forms/SingleControlValidation.java
index f12d813f9a9c..56bcd46372f1 100644
--- a/odk/examples/DevelopersGuide/Forms/SingleControlValidation.java
+++ b/odk/examples/DevelopersGuide/Forms/SingleControlValidation.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java b/odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java
index b0abe5139c30..38f1c490abec 100644
--- a/odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java
+++ b/odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java b/odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java
index 716cc72dc2f4..23215c80bf03 100644
--- a/odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java
+++ b/odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/SpreadsheetView.java b/odk/examples/DevelopersGuide/Forms/SpreadsheetView.java
index 77b37e3b2258..c92af746781f 100644
--- a/odk/examples/DevelopersGuide/Forms/SpreadsheetView.java
+++ b/odk/examples/DevelopersGuide/Forms/SpreadsheetView.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,7 +42,7 @@ import com.sun.star.container.*;
*/
public class SpreadsheetView extends DocumentViewHelper
{
-
+
/** Creates a new instance of SpreadsheetView */
public SpreadsheetView( XMultiServiceFactory orb, DocumentHelper document, XController controller )
{
diff --git a/odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java b/odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java
index 40bd460ad2b8..e95e02a7e452 100644
--- a/odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java
+++ b/odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/TextValidator.java b/odk/examples/DevelopersGuide/Forms/TextValidator.java
index 6ca0528137cc..f304a1f6a596 100644
--- a/odk/examples/DevelopersGuide/Forms/TextValidator.java
+++ b/odk/examples/DevelopersGuide/Forms/TextValidator.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/TimeValidator.java b/odk/examples/DevelopersGuide/Forms/TimeValidator.java
index d98b66b19416..45135392a2ec 100644
--- a/odk/examples/DevelopersGuide/Forms/TimeValidator.java
+++ b/odk/examples/DevelopersGuide/Forms/TimeValidator.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/UNO.java b/odk/examples/DevelopersGuide/Forms/UNO.java
index 39540613d478..55152172b37f 100644
--- a/odk/examples/DevelopersGuide/Forms/UNO.java
+++ b/odk/examples/DevelopersGuide/Forms/UNO.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.*;
@@ -78,7 +78,7 @@ public class UNO
return (XTablesSupplier)UnoRuntime.queryInterface( XTablesSupplier.class, aObject );
}
-/* replace Foo with the identifier of your choice.
+/* replace Foo with the identifier of your choice.
Why does Java not have templates?
diff --git a/odk/examples/DevelopersGuide/Forms/URLHelper.java b/odk/examples/DevelopersGuide/Forms/URLHelper.java
index 97c9a6bb8403..7099dd96a96d 100644
--- a/odk/examples/DevelopersGuide/Forms/URLHelper.java
+++ b/odk/examples/DevelopersGuide/Forms/URLHelper.java
@@ -1,23 +1,23 @@
/*
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
- *
+ *
* OpenOffice.org - a multi-platform office productivity suite
- *
+ *
* This file is part of OpenOffice.org.
- *
+ *
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
- *
+ *
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
- *
+ *
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
diff --git a/odk/examples/DevelopersGuide/Forms/ValueBinding.java b/odk/examples/DevelopersGuide/Forms/ValueBinding.java
index 0446ba313f37..f577e64ce221 100644
--- a/odk/examples/DevelopersGuide/Forms/ValueBinding.java
+++ b/odk/examples/DevelopersGuide/Forms/ValueBinding.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/DevelopersGuide/Forms/WaitForInput.java b/odk/examples/DevelopersGuide/Forms/WaitForInput.java
index 4017906f1bcb..e74dc39b942a 100644
--- a/odk/examples/DevelopersGuide/Forms/WaitForInput.java
+++ b/odk/examples/DevelopersGuide/Forms/WaitForInput.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -26,8 +26,8 @@
************************************************************************/
class WaitForInput extends java.lang.Thread
{
- private Object m_aToNotify;
- private boolean m_bDone;
+ private Object m_aToNotify;
+ private boolean m_bDone;
public WaitForInput( Object aToNotify )
{
diff --git a/odk/examples/DevelopersGuide/GUI/DialogDocument.java b/odk/examples/DevelopersGuide/GUI/DialogDocument.java
index 5edefb8b118e..0d6f29d2a1ed 100644
--- a/odk/examples/DevelopersGuide/GUI/DialogDocument.java
+++ b/odk/examples/DevelopersGuide/GUI/DialogDocument.java
@@ -51,11 +51,11 @@ import com.sun.star.uno.XComponentContext;
public class DialogDocument extends UnoDialogSample {
-
+
public DialogDocument(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
super(_xContext, _xMCF);
}
-
+
public static void main(String args[]){
DialogDocument oDialogDocument = null;
try {
@@ -75,8 +75,8 @@ public class DialogDocument extends UnoDialogSample {
// add the model to the NameContainer of the dialog model
oDialogDocument.m_xDlgModelNameContainer.insertByName("Headerlabel", oFTHeaderModel);
oDialogDocument.showDocumentinDialogWindow(oDialogDocument.m_xWindowPeer, new Rectangle(40, 50, 420, 550), "private:factory/swriter");
-
- oDialogDocument.insertButton(oDialogDocument, 126, 370, 50, "~Close dialog", (short) PushButtonType.OK_value);
+
+ oDialogDocument.insertButton(oDialogDocument, 126, 370, 50, "~Close dialog", (short) PushButtonType.OK_value);
oDialogDocument.executeDialog();
}catch( Exception ex ) {
ex.printStackTrace(System.out);
@@ -88,16 +88,16 @@ public class DialogDocument extends UnoDialogSample {
}
}
}
-
+
System.exit( 0 );
}
-
+
public void showDocumentinDialogWindow(XWindowPeer _xParentWindowPeer, Rectangle _aRectangle, String _sUrl){
try {
// The Toolkit is the creator of all windows...
Object oToolkit = m_xMCF.createInstanceWithContext("com.sun.star.awt.Toolkit", m_xContext);
XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class, oToolkit);
-
+
// set up a window description and create the window. A parent window is always necessary for this...
com.sun.star.awt.WindowDescriptor aWindowDescriptor = new com.sun.star.awt.WindowDescriptor();
// a simple window is enough for this purpose...
@@ -107,20 +107,20 @@ public class DialogDocument extends UnoDialogSample {
aWindowDescriptor.Parent = _xParentWindowPeer;
aWindowDescriptor.ParentIndex = 1;
aWindowDescriptor.Bounds = _aRectangle;
-
+
// set the window attributes...
// The attribute CLIPCHILDREN causes the parent to not repaint the areas of the children...
aWindowDescriptor.WindowAttributes = VclWindowPeerAttribute.CLIPCHILDREN + WindowAttribute.BORDER + WindowAttribute.SHOW;
XWindowPeer xWindowPeer = xToolkit.createWindow(aWindowDescriptor);
XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xWindowPeer);
XView xView = (XView) UnoRuntime.queryInterface(XView.class, xWindow);
-
+
// create a frame and initialize it with the created window...
Object oFrame = m_xMCF.createInstanceWithContext("com.sun.star.frame.Frame", m_xContext);
// The frame should be of global scope because it's within the responsibility to dispose it after usage
m_xFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class, oFrame);
m_xFrame.initialize(xWindow);
-
+
// load the document and open it in preview mode
XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, m_xFrame);
PropertyValue[] aPropertyValues = new PropertyValue[2];
@@ -141,5 +141,5 @@ public class DialogDocument extends UnoDialogSample {
throw new java.lang.RuntimeException("cannot happen...");
}
}
-
+
}
diff --git a/odk/examples/DevelopersGuide/GUI/ImageControlSample.java b/odk/examples/DevelopersGuide/GUI/ImageControlSample.java
index 024894ae840b..0a875152cffe 100644
--- a/odk/examples/DevelopersGuide/GUI/ImageControlSample.java
+++ b/odk/examples/DevelopersGuide/GUI/ImageControlSample.java
@@ -53,7 +53,7 @@ public class ImageControlSample extends UnoDialogSample{
super(_xContext, _xMCF);
super.createDialog(_xMCF);
}
-
+
// to start this script pass a parameter denoting the system path to a graphic to be displayed
public static void main(String args[]) {
ImageControlSample oImageControlSample = null;
@@ -78,7 +78,7 @@ public class ImageControlSample extends UnoDialogSample{
// add the model to the NameContainer of the dialog model
oImageControlSample.m_xDlgModelNameContainer.insertByName("Headerlabel", oFTHeaderModel);
XPropertySet xICModelPropertySet = oImageControlSample.insertImageControl(xMCF, 68, 30, 32, 90);
- oImageControlSample.insertButton(oImageControlSample, 90, 75, 50, "~Close dialog", (short) PushButtonType.OK_value);
+ oImageControlSample.insertButton(oImageControlSample, 90, 75, 50, "~Close dialog", (short) PushButtonType.OK_value);
oImageControlSample.createWindowPeer();
// note: due to issue i76718 ("Setting graphic at a controlmodel required dialog peer") the graphic of the image control
// may not be set before the peer of the dialog has been created.
@@ -99,15 +99,15 @@ public class ImageControlSample extends UnoDialogSample{
}
System.exit( 0 );
}
-
-
+
+
public XPropertySet insertImageControl(XMultiComponentFactory _xMCF, int _nPosX, int _nPosY, int _nHeight, int _nWidth){
XPropertySet xICModelPropertySet = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "ImageControl");
// convert the system path to the image to a FileUrl
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oICModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlImageControlModel");
XMultiPropertySet xICModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oICModel);
@@ -117,7 +117,7 @@ public class ImageControlSample extends UnoDialogSample{
xICModelMPSet.setPropertyValues(
new String[] {"Border", "Height", "Name", "PositionX", "PositionY", "ScaleImage", "Width"},
new Object[] { new Short((short) 1), new Integer(_nHeight), sName, new Integer(_nPosX), new Integer(_nPosY), Boolean.FALSE, new Integer(_nWidth)});
-
+
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oICModel);
}catch (com.sun.star.uno.Exception ex){
@@ -134,8 +134,8 @@ public class ImageControlSample extends UnoDialogSample{
}
return xICModelPropertySet;
}
-
-
+
+
// creates a UNO graphic object that can be used to be assigned
// to the property "Graphic" of a controlmodel
public XGraphic getGraphic(XMultiComponentFactory _xMCF, String _sImageSystemPath){
@@ -145,7 +145,7 @@ public class ImageControlSample extends UnoDialogSample{
Object oFCProvider = _xMCF.createInstanceWithContext("com.sun.star.ucb.FileContentProvider", this.m_xContext);
XFileIdentifierConverter xFileIdentifierConverter = (XFileIdentifierConverter) UnoRuntime.queryInterface(XFileIdentifierConverter.class, oFCProvider);
String sImageUrl = xFileIdentifierConverter.getFileURLFromSystemPath(_sImageSystemPath, oFile.getAbsolutePath());
-
+
// create a GraphicProvider at the global service manager...
Object oGraphicProvider = m_xMCF.createInstanceWithContext("com.sun.star.graphic.GraphicProvider", m_xContext);
XGraphicProvider xGraphicProvider = (XGraphicProvider) UnoRuntime.queryInterface(XGraphicProvider.class, oGraphicProvider);
diff --git a/odk/examples/DevelopersGuide/GUI/MessageBox.java b/odk/examples/DevelopersGuide/GUI/MessageBox.java
index 745b25951cd5..1fec55b801ca 100644
--- a/odk/examples/DevelopersGuide/GUI/MessageBox.java
+++ b/odk/examples/DevelopersGuide/GUI/MessageBox.java
@@ -53,29 +53,29 @@ import com.sun.star.uno.XComponentContext;
public class MessageBox {
-
+
protected XComponentContext m_xContext = null;
protected com.sun.star.lang.XMultiComponentFactory m_xMCF;
-
+
/** Creates a new instance of MessageBox */
public MessageBox(XComponentContext _xContext, XMultiComponentFactory _xMCF){
m_xContext = _xContext;
m_xMCF = _xMCF;
}
-
+
public static void main(String args[]) {
XComponent xComp = null;
try {
XComponentContext xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
if(xContext != null )
System.out.println("Connected to a running office ...");
- XMultiComponentFactory xMCF = xContext.getServiceManager();
-
+ XMultiComponentFactory xMCF = xContext.getServiceManager();
+
MessageBox oMessageBox = new MessageBox(xContext, xMCF);
-
+
//load default text document to get an active frame
xComp = oMessageBox.createDefaultTextDocument();
-
+
XWindowPeer xWindowPeer = oMessageBox.getWindowPeerOfFrame(xComp);
if (xWindowPeer != null) {
XVclWindowPeer xVclWindowPeer = (XVclWindowPeer) UnoRuntime.queryInterface(XVclWindowPeer.class, xWindowPeer);
@@ -84,7 +84,7 @@ public class MessageBox {
} else{
System.out.println("Could not retrieve current frame");
}
-
+
} catch( Exception e ) {
System.err.println( e + e.getMessage());
e.printStackTrace();
@@ -99,33 +99,33 @@ public class MessageBox {
}
} catch (com.sun.star.util.CloseVetoException e) {
System.err.println( e + e.getMessage());
- e.printStackTrace();
+ e.printStackTrace();
}
}
}
-
+
System.exit( 0 );
}
-
- // helper method to get the window peer of a document or if no
+
+ // helper method to get the window peer of a document or if no
// document is specified it tries to get the avtive frame
// which is potentially dangerous
public XWindowPeer getWindowPeerOfFrame(XComponent xComp) {
try {
XFrame xFrame = null;
-
+
if (xComp != null) {
XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, xComp);
xFrame = xModel.getCurrentController().getFrame();
-
+
} else {
// Note: This method is potentially dangerous and should only be used for debugging
// purposes as it relies on the platform dependent window handler..
Object oDesktop = m_xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", m_xContext);
XFramesSupplier xFramesSupplier = (XFramesSupplier) UnoRuntime.queryInterface(XFramesSupplier.class, oDesktop);
- xFrame = xFramesSupplier.getActiveFrame();
+ xFrame = xFramesSupplier.getActiveFrame();
}
-
+
if (xFrame != null){
XWindow xWindow = xFrame.getContainerWindow();
if (xWindow != null){
@@ -140,9 +140,9 @@ public class MessageBox {
}
XComponent createDefaultTextDocument() {
-
+
XComponent xComp = null;
- try {
+ try {
Object oDesktop = m_xMCF.createInstanceWithContext(
"com.sun.star.frame.Desktop", m_xContext);
@@ -150,7 +150,7 @@ public class MessageBox {
// text document
com.sun.star.frame.XComponentLoader xCLoader =(com.sun.star.frame.XComponentLoader)
UnoRuntime.queryInterface(com.sun.star.frame.XComponentLoader.class,oDesktop);
-
+
com.sun.star.beans.PropertyValue[] args = new com.sun.star.beans.PropertyValue [1];
args[0] = new com.sun.star.beans.PropertyValue();
args[0].Name = "Hidden";
@@ -158,13 +158,13 @@ public class MessageBox {
String strDoc = "private:factory/swriter";
xComp = xCLoader.loadComponentFromURL(strDoc, "_blank", 0, args);
-
+
} catch(com.sun.star.uno.Exception ex) {
ex.printStackTrace();
}
return xComp;
}
-
+
/** shows an error messagebox
* @param _xParentWindowPeer the windowpeer of the parent window
* @param _sTitle the title of the messagebox
@@ -191,14 +191,14 @@ public class MessageBox {
}
}
}
-
-
+
+
/** @param _xVclWindowPeer the windowpeer of a dialog control or the dialog itself
* @return true if HighContrastMode is activated or false if HighContrastMode is deactivated
*/
public boolean isHighContrastModeActivated(XVclWindowPeer _xVclWindowPeer) {
boolean bIsActivated = false;
-
+
try {
if (_xVclWindowPeer != null){
int nUIColor = AnyConverter.toInt(_xVclWindowPeer.getProperty("DisplayBackgroundColor"));
@@ -216,7 +216,7 @@ public class MessageBox {
}
return bIsActivated;
}
-
+
public static int getRedColorShare(int _nColor) {
int nRed = (int) _nColor/65536;
int nRedModulo = _nColor % 65536;
@@ -225,14 +225,14 @@ public class MessageBox {
int nBlue = nGreenModulo;
return nRed;
}
-
+
public static int getGreenColorShare(int _nColor) {
int nRed = (int) _nColor/65536;
int nRedModulo = _nColor % 65536;
int nGreen = (int) (nRedModulo / 256);
return nGreen;
}
-
+
public static int getBlueColorShare(int _nColor) {
int nRed = (int) _nColor/65536;
int nRedModulo = _nColor % 65536;
@@ -241,5 +241,5 @@ public class MessageBox {
int nBlue = nGreenModulo;
return nBlue;
}
-
+
}
diff --git a/odk/examples/DevelopersGuide/GUI/RoadmapItemStateChangeListener.java b/odk/examples/DevelopersGuide/GUI/RoadmapItemStateChangeListener.java
index a52928cb4be0..834517e4b6cd 100644
--- a/odk/examples/DevelopersGuide/GUI/RoadmapItemStateChangeListener.java
+++ b/odk/examples/DevelopersGuide/GUI/RoadmapItemStateChangeListener.java
@@ -41,11 +41,11 @@ import com.sun.star.uno.UnoRuntime;
public class RoadmapItemStateChangeListener implements XItemListener {
protected com.sun.star.lang.XMultiServiceFactory m_xMSFDialogModel;
-
+
public RoadmapItemStateChangeListener(com.sun.star.lang.XMultiServiceFactory xMSFDialogModel) {
m_xMSFDialogModel = xMSFDialogModel;
}
-
+
public void itemStateChanged(com.sun.star.awt.ItemEvent itemEvent) {
try {
// get the new ID of the roadmap that is supposed to refer to the new step of the dialogmodel
@@ -61,7 +61,7 @@ public class RoadmapItemStateChangeListener implements XItemListener {
exception.printStackTrace(System.out);
}
}
-
+
public void disposing(EventObject eventObject) {
}
}
diff --git a/odk/examples/DevelopersGuide/GUI/SystemDialog.java b/odk/examples/DevelopersGuide/GUI/SystemDialog.java
index 00aa44162442..c20718dfc300 100644
--- a/odk/examples/DevelopersGuide/GUI/SystemDialog.java
+++ b/odk/examples/DevelopersGuide/GUI/SystemDialog.java
@@ -46,16 +46,16 @@ import com.sun.star.uno.XComponentContext;
public class SystemDialog {
-
+
protected XComponentContext m_xContext = null;
protected com.sun.star.lang.XMultiComponentFactory m_xMCF;
-
+
/** Creates a new instance of MessageBox */
public SystemDialog(XComponentContext _xContext, XMultiComponentFactory _xMCF){
m_xContext = _xContext;
m_xMCF = _xMCF;
}
-
+
public static void main(String args[]){
try {
XComponentContext xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
@@ -72,8 +72,8 @@ public class SystemDialog {
System.exit( 0 );
}
-
-
+
+
public String raiseSaveAsDialog() {
String sStorePath = "";
XComponent xComponent = null;
@@ -81,37 +81,37 @@ public class SystemDialog {
// the filepicker is instantiated with the global Multicomponentfactory...
Object oFilePicker = m_xMCF.createInstanceWithContext("com.sun.star.ui.dialogs.FilePicker", m_xContext);
XFilePicker xFilePicker = (XFilePicker) UnoRuntime.queryInterface(XFilePicker.class, oFilePicker);
-
+
// the defaultname is the initially proposed filename..
xFilePicker.setDefaultName("MyExampleDocument");
-
+
// set the initial displaydirectory. In this example the user template directory is used
Object oPathSettings = m_xMCF.createInstanceWithContext("com.sun.star.util.PathSettings",m_xContext);
XPropertySet xPropertySet = (XPropertySet) com.sun.star.uno.UnoRuntime.queryInterface(XPropertySet.class, oPathSettings);
String sTemplateUrl = (String) xPropertySet.getPropertyValue("Template_writable");
xFilePicker.setDisplayDirectory(sTemplateUrl);
-
+
// set the filters of the dialog. The filternames may be retrieved from
// http://wiki.services.openoffice.org/wiki/Framework/Article/Filter
XFilterManager xFilterManager = (XFilterManager) UnoRuntime.queryInterface(XFilterManager.class, xFilePicker);
xFilterManager.appendFilter("OpenDocument Text Template", "writer8_template");
xFilterManager.appendFilter("OpenDocument Text", "writer8");
-
+
// choose the template that defines the capabilities of the filepicker dialog
XInitialization xInitialize = (XInitialization) UnoRuntime.queryInterface(XInitialization.class, xFilePicker);
Short[] listAny = new Short[] { new Short(com.sun.star.ui.dialogs.TemplateDescription.FILESAVE_AUTOEXTENSION)};
xInitialize.initialize(listAny);
-
+
// add a control to the dialog to add the extension automatically to the filename...
XFilePickerControlAccess xFilePickerControlAccess = (XFilePickerControlAccess) UnoRuntime.queryInterface(XFilePickerControlAccess.class, xFilePicker);
xFilePickerControlAccess.setValue(com.sun.star.ui.dialogs.ExtendedFilePickerElementIds.CHECKBOX_AUTOEXTENSION, (short) 0, new Boolean(true));
-
+
xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xFilePicker);
-
+
// execute the dialog...
XExecutableDialog xExecutable = (XExecutableDialog) UnoRuntime.queryInterface(XExecutableDialog.class, xFilePicker);
short nResult = xExecutable.execute();
-
+
// query the resulting path of the dialog...
if (nResult == com.sun.star.ui.dialogs.ExecutableDialogResults.OK){
String[] sPathList = xFilePicker.getFiles();
@@ -129,7 +129,7 @@ public class SystemDialog {
}
return sStorePath;
}
-
+
public String getWorkPath(){
String sWorkUrl = "";
try{
@@ -142,7 +142,7 @@ public class SystemDialog {
}
return sWorkUrl;
}
-
+
/** raises a folderpicker in which the user can browse and select a path
* @param _sDisplayDirectory the path to the directory that is initially displayed
* @param _sTitle the title of the folderpicker
@@ -165,12 +165,12 @@ public class SystemDialog {
xFolderPicker.setTitle(_sTitle);
// show the dialog...
short nResult = xExecutable.execute();
-
+
// User has clicked "Select" button...
if (nResult == com.sun.star.ui.dialogs.ExecutableDialogResults.OK){
sReturnFolder = xFolderPicker.getDirectory();
}
-
+
}catch( Exception exception ) {
exception.printStackTrace(System.out);
} finally{
diff --git a/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java b/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java
index 4013dbb79e66..043fff2a3d4e 100644
--- a/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java
+++ b/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java
@@ -115,8 +115,8 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
protected XTopWindow m_xTopWindow = null;
protected XFrame m_xFrame = null;
protected XComponent m_xComponent = null;
-
-
+
+
/**
* Creates a new instance of UnoDialogSample
*/
@@ -125,11 +125,11 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
m_xMCF = _xMCF;
createDialog(m_xMCF);
}
-
-
+
+
public static void main(String args[]) {
UnoDialogSample oUnoDialogSample = null;
-
+
try {
XComponentContext xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
if(xContext != null )
@@ -180,11 +180,11 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
}
}
-
+
System.exit( 0 );
}
-
-
+
+
/**
* @param _sKeyName
* @return
@@ -206,8 +206,8 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
return null;
}
}
-
-
+
+
/**
* @param _sRegistryPath the path a registryNode
* @param _sImageName the name of the image
@@ -239,26 +239,26 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return sImageUrl;
}
-
+
protected void createDialog(XMultiComponentFactory _xMCF) {
try {
Object oDialogModel = _xMCF.createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", m_xContext);
-
+
// The XMultiServiceFactory of the dialogmodel is needed to instantiate the controls...
m_xMSFDialogModel = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oDialogModel);
-
+
// The named container is used to insert the created controls into...
m_xDlgModelNameContainer = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, oDialogModel);
-
+
// create the dialog...
Object oUnoDialog = _xMCF.createInstanceWithContext("com.sun.star.awt.UnoControlDialog", m_xContext);
m_xDialogControl = (XControl) UnoRuntime.queryInterface(XControl.class, oUnoDialog);
-
+
// The scope of the control container is public...
m_xDlgContainer = (XControlContainer) UnoRuntime.queryInterface(XControlContainer.class, oUnoDialog);
-
+
m_xTopWindow = (XTopWindow) UnoRuntime.queryInterface(XTopWindow.class, m_xDlgContainer);
-
+
// link the dialog and its model...
XControlModel xControlModel = (XControlModel) UnoRuntime.queryInterface(XControlModel.class, oDialogModel);
m_xDialogControl.setModel(xControlModel);
@@ -266,9 +266,9 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
exception.printStackTrace(System.out);
}
}
-
-
-
+
+
+
public short executeDialogWithembeddedExampleSnippets() throws com.sun.star.script.BasicErrorException {
if (m_xWindowPeer == null){
createWindowPeer();
@@ -279,8 +279,8 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
xDialog = (XDialog) UnoRuntime.queryInterface(XDialog.class, m_xDialogControl);
return xDialog.execute();
}
-
-
+
+
public short executeDialog() throws com.sun.star.script.BasicErrorException {
if (m_xWindowPeer == null) {
createWindowPeer();
@@ -289,15 +289,15 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
m_xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, m_xDialogControl);
return xDialog.execute();
}
-
-
-
-
+
+
+
+
public XItemListener getRoadmapItemStateChangeListener(){
return new RoadmapItemStateChangeListener(m_xMSFDialogModel);
}
-
-
+
+
public void initialize(String[] PropertyNames, Object[] PropertyValues) throws com.sun.star.script.BasicErrorException{
try{
XMultiPropertySet xMultiPropertySet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, m_xDlgModelNameContainer);
@@ -305,9 +305,9 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
} catch (com.sun.star.uno.Exception ex) {
ex.printStackTrace(System.out);
}}
-
-
-
+
+
+
/**
* create a peer for this
* dialog, using the given
@@ -333,8 +333,8 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return null;
}
-
-
+
+
public void calculateDialogPosition(XWindow _xWindow) {
Rectangle aFramePosSize = m_xModel.getCurrentController().getFrame().getComponentWindow().getPosSize();
Rectangle CurPosSize = _xWindow.getPosSize();
@@ -346,9 +346,9 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
int iYPos = ((WindowHeight / 2) - (DialogHeight / 2));
_xWindow.setPosSize(iXPos, iYPos, DialogWidth, DialogHeight, PosSize.POS);
}
-
-
-
+
+
+
/**
* Creates a peer for this
* dialog, using the active OO frame
@@ -359,12 +359,12 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
public XWindowPeer createWindowPeer() throws com.sun.star.script.BasicErrorException{
return createWindowPeer(null);
}
-
+
public void endExecute() {
xDialog.endExecute();
}
-
-
+
+
public Object insertControlModel(String ServiceName, String sName, String[] sProperties, Object[] sValues) throws com.sun.star.script.BasicErrorException{
try {
Object oControlModel = m_xMSFDialogModel.createInstance(ServiceName);
@@ -377,30 +377,30 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
return null;
}
}
-
-
+
+
public XFixedText insertFixedText(XMouseListener _xMouseListener, int _nPosX, int _nPosY, int _nWidth, int _nStep, String _sLabel){
XFixedText xFixedText = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "Label");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oFTModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlFixedTextModel");
XMultiPropertySet xFTModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oFTModel);
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
-
+
xFTModelMPSet.setPropertyValues(
new String[] {"Height", "Name", "PositionX", "PositionY", "Step", "Width"},
new Object[] { new Integer(8), sName, new Integer(_nPosX), new Integer(_nPosY), new Integer(_nStep), new Integer(_nWidth)});
// add the model to the NameContainer of the dialog model
m_xDlgModelNameContainer.insertByName(sName, oFTModel);
-
+
// The following property may also be set with XMultiPropertySet but we
// use the XPropertySet interface merely for reasons of demonstration
XPropertySet xFTPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oFTModel);
xFTPSet.setPropertyValue("Label", _sLabel);
-
+
// reference the control by the Name
XControl xFTControl = m_xDlgContainer.getControl(sName);
xFixedText = (XFixedText) UnoRuntime.queryInterface(XFixedText.class, xFTControl);
@@ -420,33 +420,33 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xFixedText;
}
-
-
+
+
public XTextComponent insertCurrencyField(XTextListener _xTextListener, int _nPositionX, int _nPositionY, int _nWidth){
XTextComponent xTextComponent = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "CurrencyField");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oCFModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlCurrencyFieldModel");
XMultiPropertySet xCFModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oCFModel);
-
+
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
xCFModelMPSet.setPropertyValues(
new String[] {"Height", "Name", "PositionX", "PositionY", "Width"},
new Object[] { new Integer(12), sName, new Integer(_nPositionX), new Integer(_nPositionY), new Integer(_nWidth)});
-
+
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oCFModel);
XPropertySet xCFModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oCFModel);
-
+
// The following properties may also be set with XMultiPropertySet but we
// use the XPropertySet interface merely for reasons of demonstration
xCFModelPSet.setPropertyValue("PrependCurrencySymbol", Boolean.TRUE);
xCFModelPSet.setPropertyValue("CurrencySymbol", "$");
xCFModelPSet.setPropertyValue("Value", new Double(2.93));
-
+
// add a textlistener that is notified on each change of the controlvalue...
Object oCFControl = m_xDlgContainer.getControl(sName);
xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, oCFControl);
@@ -465,28 +465,28 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xTextComponent;
}
-
-
-
+
+
+
public XPropertySet insertProgressBar(int _nPosX, int _nPosY, int _nWidth, int _nProgressMax){
XPropertySet xPBModelPSet = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "ProgressBar");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oPBModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlProgressBarModel");
-
+
XMultiPropertySet xPBModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oPBModel);
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
xPBModelMPSet.setPropertyValues(
new String[] {"Height", "Name", "PositionX", "PositionY", "Width"},
new Object[] { new Integer(8), sName, new Integer(_nPosX), new Integer(_nPosY), new Integer(_nWidth)});
-
+
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oPBModel);
xPBModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oPBModel);
-
+
// The following properties may also be set with XMultiPropertySet but we
// use the XPropertySet interface merely for reasons of demonstration
xPBModelPSet.setPropertyValue("ProgressValueMin", new Integer(0));
@@ -505,26 +505,26 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xPBModelPSet;
}
-
-
-
+
+
+
public void insertHorizontalFixedLine(int _nPosX, int _nPosY, int _nWidth, String _sLabel){
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "FixedLine");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oFLModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlFixedLineModel");
XMultiPropertySet xFLModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oFLModel);
-
+
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
xFLModelMPSet.setPropertyValues(
new String[] {"Height", "Name", "Orientation", "PositionX", "PositionY", "Width"},
new Object[] { new Integer(8), sName, new Integer(0), new Integer(_nPosX), new Integer(_nPosY), new Integer(_nWidth)});
-
+
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oFLModel);
-
+
// The following property may also be set with XMultiPropertySet but we
// use the XPropertySet interface merely for reasons of demonstration
XPropertySet xFLPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oFLModel);
@@ -542,26 +542,26 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
ex.printStackTrace(System.out);
}
}
-
-
-
+
+
+
public void insertGroupBox(int _nPosX, int _nPosY, int _nHeight, int _nWidth){
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "FrameControl");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oGBModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlGroupBoxModel");
XMultiPropertySet xGBModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oGBModel);
-
+
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
xGBModelMPSet.setPropertyValues(
new String[] {"Height", "Name", "PositionX", "PositionY", "Width"},
new Object[] { new Integer(_nHeight), sName, new Integer(_nPosX), new Integer(_nPosY), new Integer(_nWidth)});
-
+
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oGBModel);
-
+
// The following property may also be set with XMultiPropertySet but we
// use the XPropertySet interface merely for reasons of demonstration
XPropertySet xGBPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oGBModel);
@@ -579,33 +579,33 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
ex.printStackTrace(System.out);
}
}
-
-
-
+
+
+
public XTextComponent insertEditField(XTextListener _xTextListener, XFocusListener _xFocusListener, int _nPosX, int _nPosY, int _nWidth){
XTextComponent xTextComponent = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "TextField");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oTFModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlEditModel");
XMultiPropertySet xTFModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oTFModel);
-
+
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
xTFModelMPSet.setPropertyValues(
new String[] {"Height", "Name", "PositionX", "PositionY", "Text", "Width"},
new Object[] { new Integer(12), sName, new Integer(_nPosX), new Integer(_nPosY), "MyText", new Integer(_nWidth)});
-
+
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oTFModel);
XPropertySet xTFModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oTFModel);
-
+
// The following property may also be set with XMultiPropertySet but we
// use the XPropertySet interface merely for reasons of demonstration
xTFModelPSet.setPropertyValue("EchoChar", new Short((short) '*'));
XControl xTFControl = m_xDlgContainer.getControl(sName);
-
+
// add a textlistener that is notified on each change of the controlvalue...
xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, xTFControl);
XWindow xTFWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xTFControl);
@@ -626,26 +626,26 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xTextComponent;
}
-
+
public XPropertySet insertTimeField(int _nPosX, int _nPosY, int _nWidth, int _nTime, int _nTimeMin, int _nTimeMax){
XPropertySet xTFModelPSet = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "TimeField");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oTFModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlTimeFieldModel");
XMultiPropertySet xTFModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oTFModel);
-
+
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
xTFModelMPSet.setPropertyValues(
new String[] {"Height", "Name", "PositionX", "PositionY", "Spin", "Width"},
new Object[] { new Integer(12), sName, new Integer(_nPosX), new Integer(_nPosY), Boolean.TRUE, new Integer(_nWidth)});
-
+
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oTFModel);
xTFModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oTFModel);
-
+
// The following properties may also be set with XMultiPropertySet but we
// use the XPropertySet interface merely for reasons of demonstration
xTFModelPSet.setPropertyValue("TimeFormat", new Short((short) 5));
@@ -666,28 +666,28 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xTFModelPSet;
}
-
-
-
+
+
+
public XPropertySet insertDateField(XSpinListener _xSpinListener, int _nPosX, int _nPosY, int _nWidth){
XPropertySet xDFModelPSet = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "DateField");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oDFModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlDateFieldModel");
XMultiPropertySet xDFModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oDFModel);
-
+
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
xDFModelMPSet.setPropertyValues(
new String[] {"Dropdown", "Height", "Name", "PositionX", "PositionY", "Width"},
new Object[] {Boolean.TRUE, new Integer(12), sName, new Integer(_nPosX), new Integer(_nPosY), new Integer(_nWidth)});
-
+
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oDFModel);
xDFModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oDFModel);
-
+
// The following properties may also be set with XMultiPropertySet but we
// use the XPropertySet interface merely for reasons of demonstration
xDFModelPSet.setPropertyValue("DateFormat", new Short((short) 7));
@@ -695,7 +695,7 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
xDFModelPSet.setPropertyValue("DateMax", new Integer(20070501));
xDFModelPSet.setPropertyValue("Date", new Integer(20000415));
Object oDFControl = m_xDlgContainer.getControl(sName);
-
+
// add a SpinListener that is notified on each change of the controlvalue...
XSpinField xSpinField = (XSpinField) UnoRuntime.queryInterface(XSpinField.class, oDFControl);
xSpinField.addSpinListener(_xSpinListener);
@@ -713,27 +713,27 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xDFModelPSet;
}
-
-
+
+
public XPropertySet insertPatternField(int _nPosX, int _nPosY, int _nWidth){
XPropertySet xPFModelPSet = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "PatternField");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oPFModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlPatternFieldModel");
XMultiPropertySet xPFModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oPFModel);
-
+
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
xPFModelMPSet.setPropertyValues(
new String[] {"Height", "Name", "PositionX", "PositionY", "Width"},
new Object[] { new Integer(12), sName, new Integer(_nPosX), new Integer(_nPosY), new Integer(_nWidth)});
-
+
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oPFModel);
xPFModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oPFModel);
-
+
// The following properties may also be set with XMultiPropertySet but we
// use the XPropertySet interface merely for reasons of demonstration
xPFModelPSet.setPropertyValue("LiteralMask", "__.05.2007");
@@ -755,8 +755,8 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xPFModelPSet;
}
-
-
+
+
public XPropertySet insertNumericField( int _nPosX, int _nPosY, int _nWidth,
double _fValueMin, double _fValueMax, double _fValue,
double _fValueStep, short _nDecimalAccuracy){
@@ -764,7 +764,7 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "NumericField");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oNFModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlNumericFieldModel");
XMultiPropertySet xNFModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oNFModel);
@@ -772,7 +772,7 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
xNFModelMPSet.setPropertyValues(
new String[] {"Height", "Name", "PositionX", "PositionY", "Spin", "StrictFormat", "Width"},
new Object[] { new Integer(12), sName, new Integer(_nPosX), new Integer(_nPosY), Boolean.TRUE, Boolean.TRUE, new Integer(_nWidth)});
-
+
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oNFModel);
xNFModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oNFModel);
@@ -798,17 +798,17 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xNFModelPSet;
}
-
-
-
+
+
+
public XPropertySet insertVerticalScrollBar(XAdjustmentListener _xAdjustmentListener, int _nPosX, int _nPosY, int _nHeight){
XPropertySet xSBModelPSet = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "ScrollBar");
-
+
Integer NOrientation = new Integer(com.sun.star.awt.ScrollBarOrientation.VERTICAL);
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oSBModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlScrollBarModel");
XMultiPropertySet xSBModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oSBModel);
@@ -816,10 +816,10 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
xSBModelMPSet.setPropertyValues(
new String[] {"Height", "Name", "Orientation", "PositionX", "PositionY", "Width"},
new Object[] { new Integer(_nHeight), sName, NOrientation, new Integer(_nPosX), new Integer(_nPosY), new Integer(8)});
-
+
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oSBModel);
-
+
xSBModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oSBModel);
// The following properties may also be set with XMultiPropertySet but we
// use the XPropertySet interface merely for reasons of demonstration
@@ -828,7 +828,7 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
xSBModelPSet.setPropertyValue("ScrollValue", new Integer(5));
xSBModelPSet.setPropertyValue("LineIncrement", new Integer(2));
xSBModelPSet.setPropertyValue("BlockIncrement", new Integer(10));
-
+
// Add an Adjustment that will listen to changes of the scrollbar...
XControl xSBControl = m_xDlgContainer.getControl(sName);
XScrollBar xScrollBar = (XScrollBar) UnoRuntime.queryInterface(XScrollBar.class, xSBControl);
@@ -847,8 +847,8 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xSBModelPSet;
}
-
-
+
+
/** makes a String unique by appending a numerical suffix
* @param _xElementContainer the com.sun.star.container.XNameAccess container
* that the new Element is going to be inserted to
@@ -868,29 +868,29 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return _sElementName;
}
-
-
+
+
public XCheckBox insertCheckBox(XItemListener _xItemListener, int _nPosX, int _nPosY, int _nWidth){
XCheckBox xCheckBox = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "CheckBox");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oCBModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlCheckBoxModel");
-
+
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
XMultiPropertySet xCBMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oCBModel);
xCBMPSet.setPropertyValues(
new String[] {"Height", "Label", "Name", "PositionX", "PositionY", "Width" } ,
new Object[] {new Integer(8), "~Include page number", sName, new Integer(_nPosX), new Integer(_nPosY), new Integer(_nWidth)});
-
+
// The following property may also be set with XMultiPropertySet but we
// use the XPropertySet interface merely for reasons of demonstration
XPropertySet xCBModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xCBMPSet);
xCBModelPSet.setPropertyValue("TriState", Boolean.TRUE);
xCBModelPSet.setPropertyValue("State", new Short((short) 1));
-
+
// add the model to the NameContainer of the dialog model
m_xDlgModelNameContainer.insertByName(sName, oCBModel);
XControl xCBControl = m_xDlgContainer.getControl(sName);
@@ -911,15 +911,15 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xCheckBox;
}
-
-
-
-
+
+
+
+
public void insertRadioButtonGroup(short _nTabIndex, int _nPosX, int _nPosY, int _nWidth){
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "OptionButton");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oRBModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlRadioButtonModel");
XMultiPropertySet xRBMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oRBModel);
@@ -929,10 +929,10 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
new Object[] {new Integer(8), "~First Option", sName, new Integer(_nPosX), new Integer(_nPosY), new Short((short) 1), new Short(_nTabIndex++),new Integer(_nWidth)});
// add the model to the NameContainer of the dialog model
m_xDlgModelNameContainer.insertByName(sName, oRBModel);
-
+
// create a unique name by means of an own implementation...
sName = createUniqueName(m_xDlgModelNameContainer, "OptionButton");
-
+
oRBModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlRadioButtonModel");
xRBMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oRBModel);
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
@@ -954,14 +954,14 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
ex.printStackTrace(System.out);
}
}
-
-
+
+
public XListBox insertListBox(int _nPosX, int _nPosY, int _nWidth, int _nStep, String[] _sStringItemList){
XListBox xListBox = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "ListBox");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oListBoxModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlListBoxModel");
XMultiPropertySet xLBModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oListBoxModel);
@@ -994,16 +994,16 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xListBox;
}
-
-
+
+
public XComboBox insertComboBox(int _nPosX, int _nPosY, int _nWidth){
XComboBox xComboBox = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "ComboBox");
-
+
String[] sStringItemList = new String[]{"First Entry", "Second Entry", "Third Entry", "Fourth Entry"};
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oComboBoxModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlComboBoxModel");
XMultiPropertySet xCbBModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oComboBoxModel);
@@ -1011,17 +1011,17 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
xCbBModelMPSet.setPropertyValues(
new String[] {"Dropdown", "Height", "Name", "PositionX", "PositionY", "StringItemList", "Width" } ,
new Object[] {Boolean.TRUE, new Integer(12), sName, new Integer(_nPosX), new Integer(_nPosY), sStringItemList, new Integer(_nWidth)});
-
+
// The following property may also be set with XMultiPropertySet but we
// use the XPropertySet interface merely for reasons of demonstration
XPropertySet xCbBModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xCbBModelMPSet);
xCbBModelPSet.setPropertyValue("MaxTextLen", new Short((short) 10));
xCbBModelPSet.setPropertyValue("ReadOnly", Boolean.FALSE);
-
+
// add the model to the NameContainer of the dialog model
m_xDlgModelNameContainer.insertByName(sName, xCbBModelMPSet);
XControl xControl = m_xDlgContainer.getControl(sName);
-
+
// retrieve a ListBox that is more convenient to work with than the Model of the ListBox...
xComboBox = (XComboBox) UnoRuntime.queryInterface(XComboBox.class, xControl);
} catch (com.sun.star.uno.Exception ex) {
@@ -1038,15 +1038,15 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xComboBox;
}
-
-
-
+
+
+
public XPropertySet insertFormattedField(XSpinListener _xSpinListener, int _nPosX, int _nPosY, int _nWidth){
XPropertySet xFFModelPSet = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "FormattedField");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oFFModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlFormattedFieldModel");
XMultiPropertySet xFFModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oFFModel);
@@ -1054,7 +1054,7 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
xFFModelMPSet.setPropertyValues(
new String[] {"EffectiveValue", "Height", "Name", "PositionX", "PositionY", "StrictFormat", "Spin", "Width"},
new Object[] { new Double(12348), new Integer(12), sName, new Integer(_nPosX), new Integer(_nPosY), Boolean.TRUE, Boolean.TRUE, new Integer(_nWidth)});
-
+
xFFModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oFFModel);
// to define a numberformat you always need a locale...
com.sun.star.lang.Locale aLocale = new com.sun.star.lang.Locale();
@@ -1062,7 +1062,7 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
aLocale.Language = "en";
// this Format is only compliant to the english locale!
String sFormatString = "NNNNMMMM DD, YYYY";
-
+
// a NumberFormatsSupplier has to be created first "in the open countryside"...
Object oNumberFormatsSupplier = m_xMCF.createInstanceWithContext("com.sun.star.util.NumberFormatsSupplier", m_xContext);
XNumberFormatsSupplier xNumberFormatsSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(XNumberFormatsSupplier.class, oNumberFormatsSupplier);
@@ -1073,21 +1073,21 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
// if not then add it to the NumberFormatsSupplier
nFormatKey = xNumberFormats.addNew(sFormatString, aLocale);
}
-
+
// The following property may also be set with XMultiPropertySet but we
// use the XPropertySet interface merely for reasons of demonstration
xFFModelPSet.setPropertyValue("FormatsSupplier", xNumberFormatsSupplier);
xFFModelPSet.setPropertyValue("FormatKey", new Integer(nFormatKey));
-
+
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oFFModel);
-
+
// finally we add a Spin-Listener to the control
XControl xFFControl = m_xDlgContainer.getControl(sName);
// add a SpinListener that is notified on each change of the controlvalue...
XSpinField xSpinField = (XSpinField) UnoRuntime.queryInterface(XSpinField.class, xFFControl);
xSpinField.addSpinListener(_xSpinListener);
-
+
} catch (com.sun.star.uno.Exception ex) {
/* perform individual exception handling here.
* Possible exception types are:
@@ -1102,41 +1102,41 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xFFModelPSet;
}
-
+
public void convertUnits(){
// iXPixelFactor = (int) (100000/xDevice.getInfo().PixelPerMeterX);
}
-
-
+
+
public XTextComponent insertFileControl(XTextListener _xTextListener, int _nPosX, int _nPosY, int _nWidth){
XTextComponent xTextComponent = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "FileControl");
-
+
// retrieve the configured Work path...
Object oPathSettings = m_xMCF.createInstanceWithContext("com.sun.star.util.PathSettings",m_xContext);
XPropertySet xPropertySet = (XPropertySet) com.sun.star.uno.UnoRuntime.queryInterface(XPropertySet.class, oPathSettings);
String sWorkUrl = (String) xPropertySet.getPropertyValue("Work");
-
+
// convert the Url to a system path that is "human readable"...
Object oFCProvider = m_xMCF.createInstanceWithContext("com.sun.star.ucb.FileContentProvider", m_xContext);
XFileIdentifierConverter xFileIdentifierConverter = (XFileIdentifierConverter) UnoRuntime.queryInterface(XFileIdentifierConverter.class, oFCProvider);
String sSystemWorkPath = xFileIdentifierConverter.getSystemPathFromFileURL(sWorkUrl);
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oFCModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlFileControlModel");
-
+
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
XMultiPropertySet xFCModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oFCModel);
xFCModelMPSet.setPropertyValues(
new String[] {"Height", "Name", "PositionX", "PositionY", "Text", "Width"},
new Object[] { new Integer(14), sName, new Integer(_nPosX), new Integer(_nPosY), sSystemWorkPath, new Integer(_nWidth)});
-
+
// The controlmodel is not really available until inserted to the Dialog container
m_xDlgModelNameContainer.insertByName(sName, oFCModel);
XPropertySet xFCModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oFCModel);
-
+
// add a textlistener that is notified on each change of the controlvalue...
XControl xFCControl = m_xDlgContainer.getControl(sName);
xTextComponent = (XTextComponent) UnoRuntime.queryInterface(XTextComponent.class, xFCControl);
@@ -1156,14 +1156,14 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xTextComponent;
}
-
-
+
+
public XButton insertButton(XActionListener _xActionListener, int _nPosX, int _nPosY, int _nWidth, String _sLabel, short _nPushButtonType){
XButton xButton = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "CommandButton");
-
+
// create a controlmodel at the multiservicefactory of the dialog model...
Object oButtonModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlButtonModel");
XMultiPropertySet xButtonMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oButtonModel);
@@ -1171,7 +1171,7 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
xButtonMPSet.setPropertyValues(
new String[] {"Height", "Label", "Name", "PositionX", "PositionY", "PushButtonType", "Width" } ,
new Object[] {new Integer(14), _sLabel, sName, new Integer(_nPosX), new Integer(_nPosY), new Short(_nPushButtonType), new Integer(_nWidth)});
-
+
// add the model to the NameContainer of the dialog model
m_xDlgModelNameContainer.insertByName(sName, oButtonModel);
XControl xButtonControl = m_xDlgContainer.getControl(sName);
@@ -1192,7 +1192,7 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xButton;
}
-
+
/** gets the WindowPeer of a frame
* @param _XTextDocument the instance of a textdocument
* @return the windowpeer of the frame
@@ -1204,7 +1204,7 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
XWindowPeer xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xWindow);
return xWindowPeer;
}
-
+
public XFrame getCurrentFrame(){
XFrame xRetFrame = null;
try {
@@ -1216,8 +1216,8 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
return xRetFrame;
}
-
-
+
+
public void textChanged(TextEvent textEvent) {
try {
// get the control that has fired the event,
@@ -1242,9 +1242,9 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
ex.printStackTrace(System.out);
}
}
-
-
-
+
+
+
public void up(SpinEvent spinEvent) {
try {
// get the control that has fired the event,
@@ -1269,21 +1269,21 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
ex.printStackTrace(System.out);
}
}
-
-
+
+
public void down(SpinEvent spinEvent) {
}
-
+
public void last(SpinEvent spinEvent) {
}
-
+
public void first(SpinEvent spinEvent) {
- }
-
+ }
+
public void disposing(EventObject rEventObject) {
}
-
-
+
+
public void actionPerformed(ActionEvent rEvent) {
try{
// get the control that has fired the event,
@@ -1306,8 +1306,8 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
ex.printStackTrace(System.out);
}
}
-
-
+
+
public void focusLost(FocusEvent _focusEvent) {
short nFocusFlags = _focusEvent.FocusFlags;
int nFocusChangeReason = nFocusFlags & FocusChangeReason.TAB;
@@ -1318,20 +1318,20 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, _focusEvent.NextFocus);
}
}
-
-
+
+
public void focusGained(FocusEvent focusEvent) {
- }
-
+ }
+
public void mouseReleased(MouseEvent mouseEvent) {
}
-
+
public void mousePressed(MouseEvent mouseEvent) {
- }
-
+ }
+
public void mouseExited(MouseEvent mouseEvent) {
}
-
+
public void mouseEntered(MouseEvent _mouseEvent) {
try {
// retrieve the control that the event has been invoked at...
@@ -1348,12 +1348,12 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
// finally set the created pointer at the windowpeer of the control
xControl.getPeer().setPointer(xPointer);
} catch (com.sun.star.uno.Exception ex) {
- throw new java.lang.RuntimeException("cannot happen...");
+ throw new java.lang.RuntimeException("cannot happen...");
}
}
-
-
-
+
+
+
public void itemStateChanged(ItemEvent itemEvent) {
try{
// retrieve the control that the event has been invoked at...
@@ -1386,9 +1386,9 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
*/
ex.printStackTrace(System.out);
}
- }
-
-
+ }
+
+
public void adjustmentValueChanged(AdjustmentEvent _adjustmentEvent) {
switch (_adjustmentEvent.Type.getValue()){
case AdjustmentType.ADJUST_ABS_value:
@@ -1403,41 +1403,41 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
}
System.out.println( "The value of the scrollbar is: " + _adjustmentEvent.Value);
}
-
-
-
+
+
+
// Globally available object variables of the roadmapmodel
XPropertySet m_xRMPSet;
XSingleServiceFactory m_xSSFRoadmap;
XIndexContainer m_xRMIndexCont;
-
+
public void addRoadmap(XItemListener _xItemListener) {
XPropertySet xDialogModelPropertySet = null;
try {
// create a unique name by means of an own implementation...
String sRoadmapName = createUniqueName(m_xDlgModelNameContainer, "Roadmap");
-
+
xDialogModelPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, m_xMSFDialogModel);
// Similar to the office assistants the roadmap is adjusted to the height of the dialog
// where a certain space is left at the bottom for the buttons...
int nDialogHeight = ((Integer) xDialogModelPropertySet.getPropertyValue("Height")).intValue();
-
+
// instantiate the roadmapmodel...
Object oRoadmapModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlRoadmapModel");
-
+
// define the properties of the roadmapmodel
XMultiPropertySet xRMMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oRoadmapModel);
xRMMPSet.setPropertyValues( new String[] {"Complete", "Height", "Name", "PositionX", "PositionY", "Text", "Width" },
new Object[] {Boolean.FALSE, new Integer(nDialogHeight - 26), sRoadmapName, new Integer(0), new Integer(0), "Steps", new Integer(85)});
m_xRMPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oRoadmapModel);
-
+
// add the roadmapmodel to the dialog container..
m_xDlgModelNameContainer.insertByName(sRoadmapName, oRoadmapModel);
-
+
// the roadmapmodel is a SingleServiceFactory to instantiate the roadmapitems...
m_xSSFRoadmap = (XSingleServiceFactory) UnoRuntime.queryInterface(XSingleServiceFactory.class, oRoadmapModel);
m_xRMIndexCont = (XIndexContainer) UnoRuntime.queryInterface(XIndexContainer.class, oRoadmapModel);
-
+
// add the itemlistener to the control...
XControl xRMControl = this.m_xDlgContainer.getControl(sRoadmapName);
XItemEventBroadcaster xRMBroadcaster = (XItemEventBroadcaster) UnoRuntime.queryInterface(XItemEventBroadcaster.class, xRMControl);
@@ -1446,7 +1446,7 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
jexception.printStackTrace(System.out);
}
}
-
+
/**
*To fully understand the example one has to be aware that the passed ???Index??? parameter
* refers to the position of the roadmap item in the roadmapmodel container
@@ -1468,15 +1468,15 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis
exception.printStackTrace(System.out);
}
}
-
-
+
+
public void keyReleased(KeyEvent keyEvent) {
int i = keyEvent.KeyChar;
int n = keyEvent.KeyCode;
int m = keyEvent.KeyFunc;
}
-
+
public void keyPressed(KeyEvent keyEvent) {
}
-
+
}
diff --git a/odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java b/odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java
index 3b85eb57d306..5e5959b340fe 100644
--- a/odk/examples/DevelopersGuide/GUI/UnoDialogSample2.java
+++ b/odk/examples/DevelopersGuide/GUI/UnoDialogSample2.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.awt.PushButtonType;
import com.sun.star.awt.XControl;
@@ -56,36 +56,36 @@ import com.sun.star.uno.XComponentContext;
public class UnoDialogSample2 extends UnoDialogSample {
XIntrospectionAccess m_xIntrospectionAccess = null;
Object m_oUnoObject = null;
- // define some constants used to set positions and sizes
+ // define some constants used to set positions and sizes
// of controls. For further information see
// http://ui.openoffice.org/knowledge/DialogSpecificationandGuidelines.odt
- final static int nFixedTextHeight = 8;
- final static int nControlMargin = 6;
+ final static int nFixedTextHeight = 8;
+ final static int nControlMargin = 6;
final static int nDialogWidth = 250;
final static int nDialogHeight = 140;
// the default roadmap width == 80 MAPs
final static int nRoadmapWidth = 80;
final static int nButtonHeight = 14;
final static int nButtonWidth = 50;
-
-
+
+
public UnoDialogSample2(XComponentContext _xContext, XMultiComponentFactory _xMCF, Object _oUnoObject) {
super(_xContext, _xMCF);
try {
m_oUnoObject = _oUnoObject;
Object o = m_xMCF.createInstanceWithContext("com.sun.star.beans.Introspection", m_xContext);
- XIntrospection m_xIntrospection = ( XIntrospection ) UnoRuntime.queryInterface(XIntrospection.class, o );
- // the variable m_xIntrospectionAccess offers functionality to access all methods and properties
+ XIntrospection m_xIntrospection = ( XIntrospection ) UnoRuntime.queryInterface(XIntrospection.class, o );
+ // the variable m_xIntrospectionAccess offers functionality to access all methods and properties
// of a variable
m_xIntrospectionAccess = m_xIntrospection.inspect(_oUnoObject);
} catch (com.sun.star.uno.Exception ex) {
ex.printStackTrace();
}
}
-
+
public static void main(String args[]) {
UnoDialogSample2 oUnoDialogSample2 = null;
- try {
+ try {
XComponentContext xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
if(xContext != null )
System.out.println("Connected to a running office ...");
@@ -94,8 +94,8 @@ public class UnoDialogSample2 extends UnoDialogSample {
// create an arbitrary Uno-Object - in this case an empty writer document..
Object oDesktop =xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", xContext);
XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, oDesktop);
- Object oUnoObject = xComponentLoader.loadComponentFromURL("private:factory/swriter", "_default", 0, aPropertyValues);
-
+ Object oUnoObject = xComponentLoader.loadComponentFromURL("private:factory/swriter", "_default", 0, aPropertyValues);
+
// define some coordinates where to position the controls
final int nButtonPosX = (int)((nDialogWidth/2) - (nButtonWidth/2));
final int nButtonPosY = nDialogHeight - nButtonHeight - nControlMargin;
@@ -118,9 +118,9 @@ public class UnoDialogSample2 extends UnoDialogSample {
oUnoDialogSample2.insertListBox(nControlPosX, nControlMargin, nListBoxHeight, nControlWidth, 4, sMethodNames);
oUnoDialogSample2.insertListBox(nControlPosX, nControlMargin, nListBoxHeight, nControlWidth, 5, sPropertyNames);
oUnoDialogSample2.insertButton(oUnoDialogSample2, nButtonPosX, nButtonPosY, nButtonWidth, "~Close", (short) PushButtonType.OK_value);
- oUnoDialogSample2.insertHorizontalFixedLine(0, nButtonPosY - nControlMargin - 4, nDialogWidth, "");
- // create the windowpeer;
- // it must be kept in mind that it must be created after the insertion of the controls
+ oUnoDialogSample2.insertHorizontalFixedLine(0, nButtonPosY - nControlMargin - 4, nDialogWidth, "");
+ // create the windowpeer;
+ // it must be kept in mind that it must be created after the insertion of the controls
// (see http://qa.openoffice.org/issues/show_bug.cgi?id=75129)
oUnoDialogSample2.createWindowPeer();
// add the roadmap control. Note that the roadmap may not be created before the windowpeer of the dialog exists
@@ -137,7 +137,7 @@ public class UnoDialogSample2 extends UnoDialogSample {
oUnoDialogSample2.xDialog.execute();
}catch( Exception ex ) {
ex.printStackTrace(System.out);
- }
+ }
finally{
//make sure always to dispose the component and free the memory!
if (oUnoDialogSample2 != null){
@@ -146,10 +146,10 @@ public class UnoDialogSample2 extends UnoDialogSample {
}
}
}
-
+
System.exit( 0 );
}
-
+
public String[] getMethodNames() {
String[] sMethodNames = new String[]{};
@@ -165,15 +165,15 @@ public class UnoDialogSample2 extends UnoDialogSample {
}
return sMethodNames;
}
-
+
// returns the names of all supported servicenames of a UNO object
public String[] getSupportedServiceNames() {
String[] sSupportedServiceNames = new String[]{};
- // If the Uno-Object supports "com.sun.star.lang.XServiceInfo"
+ // If the Uno-Object supports "com.sun.star.lang.XServiceInfo"
// this will give access to all supported servicenames
XServiceInfo xServiceInfo = ( XServiceInfo ) UnoRuntime.queryInterface( XServiceInfo.class, m_oUnoObject);
if ( xServiceInfo != null ) {
- sSupportedServiceNames = xServiceInfo.getSupportedServiceNames();
+ sSupportedServiceNames = xServiceInfo.getSupportedServiceNames();
}
return sSupportedServiceNames;
}
@@ -210,35 +210,35 @@ public class UnoDialogSample2 extends UnoDialogSample {
}
return sTypeNames;
}
-
-
-
+
+
+
public XListBox insertListBox(int _nPosX, int _nPosY, int _nHeight, int _nWidth, int _nStep, String[] _sStringItemList) {
XListBox xListBox = null;
try{
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "ListBox");
- // create a controlmodel at the multiservicefactory of the dialog model...
+ // create a controlmodel at the multiservicefactory of the dialog model...
Object oListBoxModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlListBoxModel");
XMultiPropertySet xLBModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oListBoxModel);
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
- xLBModelMPSet.setPropertyValues(
+ xLBModelMPSet.setPropertyValues(
new String[] {"Dropdown", "Height", "Name", "PositionX", "PositionY", "ReadOnly", "Step", "StringItemList", "Width" } ,
- new Object[] {Boolean.FALSE, new Integer(_nHeight), sName, new Integer(_nPosX), new Integer(_nPosY), Boolean.TRUE, new Integer(_nStep), _sStringItemList, new Integer(_nWidth)});
+ new Object[] {Boolean.FALSE, new Integer(_nHeight), sName, new Integer(_nPosX), new Integer(_nPosY), Boolean.TRUE, new Integer(_nStep), _sStringItemList, new Integer(_nWidth)});
m_xDlgModelNameContainer.insertByName(sName, xLBModelMPSet);
}catch (com.sun.star.uno.Exception ex) {
throw new java.lang.RuntimeException("cannot happen...");
}
return xListBox;
}
-
+
public void insertMultiLineFixedText(int _nPosX, int _nPosY, int _nWidth, int _nLineCount, int _nStep, String _sLabel) {
- try {
+ try {
// create a unique name by means of an own implementation...
String sName = createUniqueName(m_xDlgModelNameContainer, "Label");
int nHeight = _nLineCount * nFixedTextHeight;
- // create a controlmodel at the multiservicefactory of the dialog model...
+ // create a controlmodel at the multiservicefactory of the dialog model...
Object oFTModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlFixedTextModel");
XMultiPropertySet xFTModelMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oFTModel);
// Set the properties at the model - keep in mind to pass the property names in alphabetical order!
diff --git a/odk/examples/DevelopersGuide/GUI/UnoMenu.java b/odk/examples/DevelopersGuide/GUI/UnoMenu.java
index 2fba20245d57..0bd29dfd702f 100644
--- a/odk/examples/DevelopersGuide/GUI/UnoMenu.java
+++ b/odk/examples/DevelopersGuide/GUI/UnoMenu.java
@@ -20,15 +20,15 @@ import com.sun.star.uno.XComponentContext;
public class UnoMenu extends UnoDialogSample implements XMenuListener {
private XTopWindow mxTopWindow = null;
-
+
public UnoMenu(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
super(_xContext, _xMCF);
}
-
+
public static void main(String args[]){
UnoMenu oUnoMenu = null;
XComponent xComponent = null;
- try {
+ try {
XComponentContext xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
if(xContext != null )
System.out.println("Connected to a running office ...");
@@ -38,7 +38,7 @@ public UnoMenu(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
oUnoMenu.addMenuBar(oUnoMenu.mxTopWindow, oUnoMenu);
}catch( Exception ex ) {
ex.printStackTrace(System.out);
- }
+ }
}
@@ -63,7 +63,7 @@ public UnoMenu(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
xPopupMenu.checkItem((short) 2, true);
xPopupMenu.addMenuListener(this);
}catch( Exception e ) {
- throw new java.lang.RuntimeException("cannot happen...");
+ throw new java.lang.RuntimeException("cannot happen...");
}
return xPopupMenu;
}
@@ -81,7 +81,7 @@ public UnoMenu(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
xMenuBar.addMenuListener(_xMenuListener);
_xTopWindow.setMenuBar(xMenuBar);
}catch( Exception e ) {
- throw new java.lang.RuntimeException("cannot happen...");
+ throw new java.lang.RuntimeException("cannot happen...");
}}
protected void closeDialog(){
@@ -91,7 +91,7 @@ public UnoMenu(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
}
// to ensure that the Java application terminates
- System.exit( 0 );
+ System.exit( 0 );
}
public XTopWindow showTopWindow( Rectangle _aRectangle){
@@ -104,7 +104,7 @@ public UnoMenu(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
// set up a window description and create the window. A parent window is always necessary for this...
com.sun.star.awt.WindowDescriptor aWindowDescriptor = new com.sun.star.awt.WindowDescriptor();
// a TopWindow is contains a title bar and is able to inlude menus...
- aWindowDescriptor.Type = WindowClass.TOP;
+ aWindowDescriptor.Type = WindowClass.TOP;
// specify the position and height of the window on the parent window
aWindowDescriptor.Bounds = _aRectangle;
// set the window attributes...
@@ -118,7 +118,7 @@ public UnoMenu(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
Object oFrame = m_xMCF.createInstanceWithContext("com.sun.star.frame.Frame", m_xContext);
m_xFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class, oFrame);
- Object oDesktop = m_xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", m_xContext);
+ Object oDesktop = m_xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", m_xContext);
XFramesSupplier xFramesSupplier = (XFramesSupplier) UnoRuntime.queryInterface(XFramesSupplier.class, oDesktop);
m_xFrame.setCreator(xFramesSupplier);
// get the XTopWindow interface..
diff --git a/odk/examples/DevelopersGuide/GUI/UnoMenu2.java b/odk/examples/DevelopersGuide/GUI/UnoMenu2.java
index d9f9ed92c741..cc25d0d98d1e 100644
--- a/odk/examples/DevelopersGuide/GUI/UnoMenu2.java
+++ b/odk/examples/DevelopersGuide/GUI/UnoMenu2.java
@@ -12,14 +12,14 @@ import com.sun.star.uno.XComponentContext;
public class UnoMenu2 extends UnoMenu implements XMouseListener{
-
+
public UnoMenu2(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
super(_xContext, _xMCF);
}
-
+
public static void main(String args[]){
UnoMenu2 oUnoMenu2 = null;
- try {
+ try {
XComponentContext xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
if(xContext != null )
System.out.println("Connected to a running office ...");
@@ -34,12 +34,12 @@ public UnoMenu2(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
new String[] {"Height", "Label", "Name", "PositionX", "PositionY", "Width"},
new Object[] { new Integer(8), "This code-sample demonstrates the creation of a popup-menu", "HeaderLabel", new Integer(6), new Integer(6), new Integer(200)});
// add the model to the NameContainer of the dialog model
- oUnoMenu2.m_xDlgModelNameContainer.insertByName("Headerlabel", oFTHeaderModel);
+ oUnoMenu2.m_xDlgModelNameContainer.insertByName("Headerlabel", oFTHeaderModel);
oUnoMenu2.addLabelForPopupMenu();
oUnoMenu2.executeDialog();
}catch( Exception ex ) {
ex.printStackTrace(System.out);
- }
+ }
finally{
//make sure always to dispose the component and free the memory!
if (oUnoMenu2 != null) {
@@ -47,7 +47,7 @@ public UnoMenu2(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
oUnoMenu2.m_xComponent.dispose();
}
}
- System.exit( 0 );
+ System.exit( 0 );
}}
@@ -80,7 +80,7 @@ public UnoMenu2(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
if (mouseEvent.PopupTrigger){
Rectangle aRectangle = new Rectangle(mouseEvent.X, mouseEvent.Y, 0, 0);
XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, mouseEvent.Source);
- getPopupMenu().execute( xControl.getPeer(), aRectangle, com.sun.star.awt.PopupMenuDirection.DEFAULT);
+ getPopupMenu().execute( xControl.getPeer(), aRectangle, com.sun.star.awt.PopupMenuDirection.DEFAULT);
}
}
diff --git a/odk/examples/DevelopersGuide/OfficeBean/OOoBeanViewer.java b/odk/examples/DevelopersGuide/OfficeBean/OOoBeanViewer.java
index 0bbe5475f23f..886016f7b308 100644
--- a/odk/examples/DevelopersGuide/OfficeBean/OOoBeanViewer.java
+++ b/odk/examples/DevelopersGuide/OfficeBean/OOoBeanViewer.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 com.sun.star.comp.beans;
@@ -40,18 +40,18 @@ import java.io.*;
/** A simple Applet that contains the SimpleBean.
*
- * This applet is a sample implementation of the
- * OpenOffice.org bean.
+ * This applet is a sample implementation of the
+ * OpenOffice.org bean.
* When initally loaded the applet has two buttons
- * one for opening an existant file and one to open
+ * one for opening an existant file and one to open
* a blank document of a given type supported by
* OpenOffice.org eg. Writer, Calc, Impress, .....
*
*/
-
+
public class OOoBeanViewer extends java.applet.Applet
{
-
+
/**
* Private variables declaration - GUI components
*/
@@ -84,8 +84,8 @@ public class OOoBeanViewer extends java.applet.Applet
public void init()
{
//The aBean needs to be initialized to add it to the applet
- aBean = new OOoBean();
-
+ aBean = new OOoBean();
+
//Initialize GUI components
rightPanel = new java.awt.Panel();
bottomPanel = new java.awt.Panel();
@@ -99,7 +99,7 @@ public class OOoBeanViewer extends java.applet.Applet
menuBarButton = new javax.swing.JCheckBox("MenuBar");
menuBarButton.setSelected( aBean.isMenuBarVisible() );
-
+
mainBarButton = new javax.swing.JCheckBox("MainBar");
mainBarButton.setSelected( aBean.isStandardBarVisible() );
@@ -110,16 +110,16 @@ public class OOoBeanViewer extends java.applet.Applet
statusBarButton.setSelected( aBean.isStatusBarVisible() );
documentURLTextField = new javax.swing.JTextField();
-
+
//Set up the Popup Menu to create a blank document
documentTypePopUp.setToolTipText("Create an empty document");
-
+
item = documentTypePopUp.add("Text Document");
item.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
- createBlankDoc("private:factory/swriter",
+ createBlankDoc("private:factory/swriter",
"New text document");
}
});
@@ -129,7 +129,7 @@ public class OOoBeanViewer extends java.applet.Applet
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
- createBlankDoc("private:factory/simpress",
+ createBlankDoc("private:factory/simpress",
"New presentation document");
}
});
@@ -139,7 +139,7 @@ public class OOoBeanViewer extends java.applet.Applet
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
- createBlankDoc("private:factory/sdraw",
+ createBlankDoc("private:factory/sdraw",
"New drawing document");
}
});
@@ -149,7 +149,7 @@ public class OOoBeanViewer extends java.applet.Applet
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
- createBlankDoc("private:factory/smath",
+ createBlankDoc("private:factory/smath",
"New formula document");
}
});
@@ -159,7 +159,7 @@ public class OOoBeanViewer extends java.applet.Applet
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
- createBlankDoc("private:factory/scalc",
+ createBlankDoc("private:factory/scalc",
"New spreadsheet document");
}
});
@@ -169,7 +169,7 @@ public class OOoBeanViewer extends java.applet.Applet
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
- try
+ try
{
aBean.releaseSystemWindow();
aBean.aquireSystemWindow();
@@ -186,13 +186,13 @@ public class OOoBeanViewer extends java.applet.Applet
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
- try
+ try
{
buffer = aBean.storeToByteArray( null, null );
}
catch ( Throwable aExc )
- {
- System.err.println( "storeToBuffer failed: " + aExc );
+ {
+ System.err.println( "storeToBuffer failed: " + aExc );
aExc.printStackTrace( System.err );
}
}
@@ -203,13 +203,13 @@ public class OOoBeanViewer extends java.applet.Applet
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
- try
+ try
{
aBean.loadFromByteArray( buffer, null );
}
catch ( Throwable aExc )
- {
- System.err.println( "loadFromBuffer failed: " + aExc );
+ {
+ System.err.println( "loadFromBuffer failed: " + aExc );
aExc.printStackTrace( System.err );
}
}
@@ -313,7 +313,7 @@ public class OOoBeanViewer extends java.applet.Applet
//Get the office process to load the URL
aBean.loadFromURL( url, null );
- aBean.aquireSystemWindow();
+ aBean.aquireSystemWindow();
}
catch ( com.sun.star.comp.beans.SystemWindowException aExc )
{
@@ -338,7 +338,7 @@ public class OOoBeanViewer extends java.applet.Applet
private void close()
{
setVisible(false);
- aBean.stopOOoConnection();
+ aBean.stopOOoConnection();
stop();
System.exit(0);
}
@@ -353,7 +353,7 @@ public class OOoBeanViewer extends java.applet.Applet
xDesktop = aBean.getOOoDesktop();
}
catch ( com.sun.star.comp.beans.NoConnectionException aExc ) {} // ignore
- aBean.stopOOoConnection();
+ aBean.stopOOoConnection();
stop();
if ( xDesktop != null )
xDesktop.terminate();
@@ -367,7 +367,7 @@ public class OOoBeanViewer extends java.applet.Applet
{
/**
* windowClosed
- *
+ *
* @param e A WindowEvent for a closed Window event
*/
public void windowClosed( java.awt.event.WindowEvent e)
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;
diff --git a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.cxx b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.cxx
index 9b476874ce26..5361027274ab 100644
--- a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.cxx
+++ b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/office_connect.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>
@@ -55,15 +55,15 @@ SAL_IMPLEMENT_MAIN()
defaultBootstrap_InitialComponentContext();
// retrieve the servicemanager from the context
- Reference< XMultiComponentFactory > rServiceManager =
+ Reference< XMultiComponentFactory > rServiceManager =
rComponentContext->getServiceManager();
// instantiate a sample service with the servicemanager.
Reference< XInterface > rInstance =
- rServiceManager->createInstanceWithContext(
+ rServiceManager->createInstanceWithContext(
OUString::createFromAscii("com.sun.star.bridge.UnoUrlResolver" ),
rComponentContext );
-
+
// Query for the XUnoUrlResolver interface
Reference< XUnoUrlResolver > rResolver( rInstance, UNO_QUERY );
@@ -75,9 +75,9 @@ SAL_IMPLEMENT_MAIN()
try
{
// resolve the uno-url
- rInstance = rResolver->resolve( OUString::createFromAscii(
+ rInstance = rResolver->resolve( OUString::createFromAscii(
"uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager" ) );
-
+
if( ! rInstance.is() )
{
printf( "StarOffice.ServiceManager is not exported from remote counterpart\n" );
@@ -94,7 +94,7 @@ SAL_IMPLEMENT_MAIN()
}
printf( "Connected sucessfully to the office\n" );
- }
+ }
catch( Exception &e )
{
OString o = OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US );
diff --git a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/string_samples.cxx b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/string_samples.cxx
index c3c37e4beee2..47689edb2971 100644
--- a/odk/examples/DevelopersGuide/ProfUNO/CppBinding/string_samples.cxx
+++ b/odk/examples/DevelopersGuide/ProfUNO/CppBinding/string_samples.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>
@@ -58,7 +58,7 @@ SAL_IMPLEMENT_MAIN()
// append an ascii string
buf.appendAscii( "pi ( here " );
- // numbers can be simply appended
+ // numbers can be simply appended
buf.append( pi );
// lets the compiler count the stringlength, so this is more efficient than
@@ -77,11 +77,11 @@ SAL_IMPLEMENT_MAIN()
// I could of course also used the OStringBuffer directly
OString oString = rtl::OUStringToOString( string , RTL_TEXTENCODING_ASCII_US );
- // just to print something
+ // just to print something
printf( "%s\n" ,oString.getStr() );
return 0;
}
-
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/ConnectionAwareClient.java b/odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/ConnectionAwareClient.java
index 5e7d8715c45d..932428173202 100644
--- a/odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/ConnectionAwareClient.java
+++ b/odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/ConnectionAwareClient.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.*;
@@ -63,12 +63,12 @@ public class ConnectionAwareClient extends java.awt.Frame
private XComponentContext _ctx;
private com.sun.star.frame.XComponentLoader _officeComponentLoader;
-
+
public ConnectionAwareClient( XComponentContext ctx , String url )
{
_url = url;
_ctx = ctx;
-
+
Panel p1 = new Panel();
_btnWriter = new Button("New writer");
_btnCalc = new Button("New calc");
@@ -79,7 +79,7 @@ public class ConnectionAwareClient extends java.awt.Frame
p1.add( _btnWriter );
p1.add( _btnCalc );
p1.add( _txtLabel );
-
+
addWindowListener(
new WindowAdapter()
{
@@ -100,7 +100,7 @@ public class ConnectionAwareClient extends java.awt.Frame
_txtLabel.setText( "disconnected" );
}
- public void actionPerformed( ActionEvent event )
+ public void actionPerformed( ActionEvent event )
{
try
{
@@ -143,7 +143,7 @@ public class ConnectionAwareClient extends java.awt.Frame
int semicolon = url.indexOf( ';' );
if( semicolon == -1 )
return null;
-
+
aRet[0] = url.substring( 4 , semicolon );
int nextSemicolon = url.indexOf( ';' , semicolon+1);
@@ -167,7 +167,7 @@ public class ConnectionAwareClient extends java.awt.Frame
// instantiate connector service
Object x = _ctx.getServiceManager().createInstanceWithContext(
"com.sun.star.connection.Connector", _ctx );
-
+
XConnector xConnector = (XConnector )
UnoRuntime.queryInterface(XConnector.class, x);
@@ -179,7 +179,7 @@ public class ConnectionAwareClient extends java.awt.Frame
// connect using the connection string part of the uno-url only.
XConnection connection = xConnector.connect( a[0] );
-
+
x = _ctx.getServiceManager().createInstanceWithContext(
"com.sun.star.bridge.BridgeFactory", _ctx );
@@ -195,7 +195,7 @@ public class ConnectionAwareClient extends java.awt.Frame
XComponent.class, bridge );
xComponent.addEventListener( this );
- // get the remote instance
+ // get the remote instance
x = bridge.getInstance( a[2] );
// Did the remote server export this object ?
@@ -204,7 +204,7 @@ public class ConnectionAwareClient extends java.awt.Frame
throw new com.sun.star.uno.Exception(
"Server didn't provide an instance for" + a[2], null );
}
-
+
// Query the initial object for its main factory interface
XMultiComponentFactory xOfficeMultiComponentFactory = ( XMultiComponentFactory )
UnoRuntime.queryInterface( XMultiComponentFactory.class, x );
@@ -213,17 +213,17 @@ public class ConnectionAwareClient extends java.awt.Frame
// Query for the XPropertySet interface.
XPropertySet xProperySet = ( XPropertySet )
UnoRuntime.queryInterface( XPropertySet.class, xOfficeMultiComponentFactory );
-
+
// Get the default context from the office server.
Object oDefaultContext =
xProperySet.getPropertyValue( "DefaultContext" );
-
+
// Query for the interface XComponentContext.
XComponentContext xOfficeComponentContext =
( XComponentContext ) UnoRuntime.queryInterface(
XComponentContext.class, oDefaultContext );
-
+
// now create the desktop service
// NOTE: use the office component context here !
Object oDesktop = xOfficeMultiComponentFactory.createInstanceWithContext(
@@ -241,7 +241,7 @@ public class ConnectionAwareClient extends java.awt.Frame
}
return officeComponentLoader;
}
-
+
public static void main( String [] args ) throws java.lang.Exception
{
if( args.length != 1 )
diff --git a/odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/UrlResolver.java b/odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/UrlResolver.java
index 854fbea0580b..33b4b9959e0c 100644
--- a/odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/UrlResolver.java
+++ b/odk/examples/DevelopersGuide/ProfUNO/InterprocessConn/UrlResolver.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.bridge.XUnoUrlResolver;
@@ -53,14 +53,14 @@ class UrlResolver
" (use \" on unix shells to avoid ;-problems" );
System.exit( 1 );
}
-
+
// create default local component context
XComponentContext xLocalContext =
com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(null);
-
+
// initial serviceManager
XMultiComponentFactory xLocalServiceManager = xLocalContext.getServiceManager();
-
+
// create a urlresolver
Object urlResolver = xLocalServiceManager.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", xLocalContext );
diff --git a/odk/examples/DevelopersGuide/ProfUNO/Lifetime/MyUnoObject.java b/odk/examples/DevelopersGuide/ProfUNO/Lifetime/MyUnoObject.java
index 1e2051a5a1b6..33da8cd6d5d1 100644
--- a/odk/examples/DevelopersGuide/ProfUNO/Lifetime/MyUnoObject.java
+++ b/odk/examples/DevelopersGuide/ProfUNO/Lifetime/MyUnoObject.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,28 +29,28 @@
* 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.
- *
+ *
*************************************************************************/
class MyUnoObject implements com.sun.star.uno.XInterface
{
public MyUnoObject() {}
-
- protected void finalize() throws Throwable {
+
+ protected void finalize() throws Throwable {
super.finalize();
System.out.println( "finalizer called" );
}
-
+
public static void main( String args[] ) throws java.lang.InterruptedException
{
com.sun.star.uno.XInterface a = new MyUnoObject();
a = null;
- // ask the garbage collector politely
+ // ask the garbage collector politely
System.gc();
synchronized( Thread.currentThread() )
{
- // wait a second
+ // wait a second
Thread.currentThread().wait( 1000 );
}
System.out.println( "leaving" );
diff --git a/odk/examples/DevelopersGuide/ProfUNO/Lifetime/object_lifetime.cxx b/odk/examples/DevelopersGuide/ProfUNO/Lifetime/object_lifetime.cxx
index c24e4e394dd7..63056a9219b7 100644
--- a/odk/examples/DevelopersGuide/ProfUNO/Lifetime/object_lifetime.cxx
+++ b/odk/examples/DevelopersGuide/ProfUNO/Lifetime/object_lifetime.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>
diff --git a/odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_cpp/SimpleBootstrap_cpp.cxx b/odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_cpp/SimpleBootstrap_cpp.cxx
index 32388bb3cded..3735b809e576 100644
--- a/odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_cpp/SimpleBootstrap_cpp.cxx
+++ b/odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_cpp/SimpleBootstrap_cpp.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>
@@ -52,7 +52,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
try
{
// get the remote office component context
- Reference< XComponentContext > xContext( ::cppu::bootstrap() );
+ Reference< XComponentContext > xContext( ::cppu::bootstrap() );
if ( !xContext.is() )
{
fprintf(stderr, "no component context!\n");
@@ -68,10 +68,10 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
return 1;
}
- // get an instance of the remote office desktop UNO service
+ // get an instance of the remote office desktop UNO service
// and query the XComponentLoader interface
Reference < XComponentLoader > xComponentLoader(
- xServiceManager->createInstanceWithContext(
+ xServiceManager->createInstanceWithContext(
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ),
xContext ), UNO_QUERY_THROW );
diff --git a/odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_java/SimpleBootstrap_java.java b/odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_java/SimpleBootstrap_java.java
index a4bce5125f4e..f348e073c5a1 100644
--- a/odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_java/SimpleBootstrap_java.java
+++ b/odk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_java/SimpleBootstrap_java.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.PropertyValue;
@@ -41,18 +41,18 @@ import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.beans.XPropertySet;
public class SimpleBootstrap_java {
-
+
public static void main(String[] args) {
-
+
try {
// get the remote office component context
XComponentContext xContext =
com.sun.star.comp.helper.Bootstrap.bootstrap();
-
+
// get the remote office service manager
XMultiComponentFactory xServiceManager =
xContext.getServiceManager();
-
+
// get an instance of the remote office desktop UNO service
Object desktop = xServiceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", xContext );
diff --git a/odk/examples/DevelopersGuide/ScriptingFramework/SayHello/SayHello/SayHello.java b/odk/examples/DevelopersGuide/ScriptingFramework/SayHello/SayHello/SayHello.java
index b120c4cfa9f9..4913ad09335a 100644
--- a/odk/examples/DevelopersGuide/ScriptingFramework/SayHello/SayHello/SayHello.java
+++ b/odk/examples/DevelopersGuide/ScriptingFramework/SayHello/SayHello/SayHello.java
@@ -16,7 +16,7 @@ public class SayHello
{
SayHello.start(ctxt);
}
-
+
public static void start(XScriptContext ctxt)
throws Exception
{
diff --git a/odk/examples/DevelopersGuide/ScriptingFramework/SayHello/build.xml b/odk/examples/DevelopersGuide/ScriptingFramework/SayHello/build.xml
index dd0b0cfcfd10..ffd3e44504ea 100755
--- a/odk/examples/DevelopersGuide/ScriptingFramework/SayHello/build.xml
+++ b/odk/examples/DevelopersGuide/ScriptingFramework/SayHello/build.xml
@@ -23,12 +23,12 @@
<!-- ==================== classpath setting ============================ -->
<target name="init" depends="checksdk,initsdk,initnosdk">
<path id="scriptclasspath">
- <pathelement location="${opp}/classes/unoil.jar"/>
+ <pathelement location="${opp}/classes/unoil.jar"/>
<pathelement location="${opp}/classes/ridl.jar"/>
<pathelement location="${opp}/classes/jurt.jar"/>
<pathelement location="${opp}/classes/juh.jar"/>
<pathelement location="${opp}/classes/ScriptFramework.jar"/>
- </path>
+ </path>
</target>
<!-- ====================== Clean Generated Files ===================== -->
@@ -77,5 +77,5 @@
<!-- ========================= All In One Build ======================= -->
<target name="all" depends="clean,build,deploy"/>
-
+
</project>
diff --git a/odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/ScriptSelector/ScriptSelector.java b/odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/ScriptSelector/ScriptSelector.java
index f461b9ddfb5d..cc448ff27715 100644
--- a/odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/ScriptSelector/ScriptSelector.java
+++ b/odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/ScriptSelector/ScriptSelector.java
@@ -63,7 +63,7 @@ public class ScriptSelector {
XScriptProviderFactory fac = (XScriptProviderFactory)
UnoRuntime.queryInterface(XScriptProviderFactory.class, obj);
-
+
final XScriptProvider msp =
fac.createScriptProvider(new Any(new Type(), null));
@@ -117,7 +117,7 @@ public class ScriptSelector {
Object[][] out = new Object[1][0];
out[0] = new Object[0];
-
+
short[][] num = new short[1][0];
num[0] = new short[0];
@@ -185,7 +185,7 @@ public class ScriptSelector {
JButton button)
{
boolean enable = false;
-
+
try
{
if (props != null)
@@ -207,19 +207,19 @@ public class ScriptSelector {
{
// leave enable set to false
}
-
+
button.setEnabled(enable);
}
private XBrowseNode getRootNode(XScriptContext ctxt) {
XBrowseNode result = null;
-
+
XComponentContext xcc = ctxt.getComponentContext();
XBrowseNodeFactory xBrowseFac = (XBrowseNodeFactory)
UnoRuntime.queryInterface(
XBrowseNodeFactory.class, xcc.getValueByName(BROWSE_FACTORY));
-
+
result = (XBrowseNode)UnoRuntime.queryInterface(
XBrowseNode.class, xBrowseFac.createView(
BrowseNodeFactoryViewTypes.MACROSELECTOR ) );
@@ -244,7 +244,7 @@ class ScriptSelectorPanel extends JPanel {
public XBrowseNode getSelection() {
DefaultMutableTreeNode node = (DefaultMutableTreeNode)
tree.getLastSelectedPathComponent();
-
+
if (node == null) {
return null;
}
@@ -384,7 +384,7 @@ class ScriptTreeRenderer extends DefaultTreeCellRenderer {
XBrowseNode xbn = (XBrowseNode)node.getUserObject();
if (xbn.getType() == BrowseNodeTypes.SCRIPT) {
setIcon(scriptIcon);
- }
+ }
else if(xbn.getType() == BrowseNodeTypes.CONTAINER) {
setIcon(containerIcon);
}
diff --git a/odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/build.xml b/odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/build.xml
index 572e7c4c459a..6179e527b273 100755
--- a/odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/build.xml
+++ b/odk/examples/DevelopersGuide/ScriptingFramework/ScriptSelector/build.xml
@@ -23,12 +23,12 @@
<!-- ==================== classpath setting ============================ -->
<target name="init" depends="checksdk,initsdk,initnosdk">
<path id="scriptclasspath">
- <pathelement location="${opp}/classes/unoil.jar"/>
+ <pathelement location="${opp}/classes/unoil.jar"/>
<pathelement location="${opp}/classes/ridl.jar"/>
<pathelement location="${opp}/classes/jurt.jar"/>
<pathelement location="${opp}/classes/juh.jar"/>
<pathelement location="${opp}/classes/ScriptFramework.jar"/>
- </path>
+ </path>
</target>
<!-- ====================== Clean Generated Files ===================== -->
@@ -77,5 +77,5 @@
<!-- ========================= All In One Build ======================= -->
<target name="all" depends="clean,build,deploy"/>
-
+
</project>
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
index 44f17a50c83d..94c0c48adc6e 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
+++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.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.
- *
+ *
*************************************************************************/
class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
@@ -250,11 +250,11 @@ public class ExampleAddIn
// ignored in this example
aFuncLocale = aLocale;
}
-
+
public com.sun.star.lang.Locale getLocale()
{
return aFuncLocale;
- }
+ }
// XServiceName
@@ -300,7 +300,7 @@ public class ExampleAddIn
multiFactory, regKey);
return xSingleServiceFactory;
}
-
+
public static boolean __writeRegistryServiceInfo(
com.sun.star.registry.XRegistryKey regKey)
{
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java
index 80f5ff15a4d2..3bd4703aa71d 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.java
+++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleDataPilotSource.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.
- *
+ *
*************************************************************************/
// Example DataPilot source component
@@ -309,7 +309,7 @@ class ExampleLevel implements
aResults[nResultPos].Name = ExampleSettings.getMemberName(nMember);
aResults[nResultPos].Caption = aResults[nResultPos].Name;
aResults[nResultPos].Flags =
- com.sun.star.sheet.MemberResultFlags.HASMEMBER;
+ com.sun.star.sheet.MemberResultFlags.HASMEMBER;
++nResultPos;
for (int nInner=1; nInner<nFill; nInner++)
@@ -323,7 +323,7 @@ class ExampleLevel implements
}
return aResults;
}
-
+
// XPropertySet
public com.sun.star.beans.XPropertySetInfo getPropertySetInfo()
@@ -803,7 +803,7 @@ public class ExampleDataPilotSource
}
// XDataPilotResults
-
+
public com.sun.star.sheet.DataResult[][] getResults()
{
int[] nDigits = new int[ExampleSettings.nDimensionCount];
@@ -969,7 +969,7 @@ public class ExampleDataPilotSource
return xSingleServiceFactory;
}
-
+
public static boolean __writeRegistryServiceInfo(
com.sun.star.registry.XRegistryKey regKey)
{
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/GeneralTableSample.java b/odk/examples/DevelopersGuide/Spreadsheet/GeneralTableSample.java
index 30bd5c143aa1..3307e18a9247 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/GeneralTableSample.java
+++ b/odk/examples/DevelopersGuide/Spreadsheet/GeneralTableSample.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;
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.java b/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.java
index 35beab5053e2..734a6af8ad77 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.java
+++ b/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.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.comp.servicemanager.ServiceManager;
@@ -371,14 +371,14 @@ public class SpreadsheetDocHelper
// First step: get the remote office component context
mxRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
System.out.println("Connected to a running office ...");
-
+
mxRemoteServiceManager = mxRemoteContext.getServiceManager();
}
catch( Exception e) {
System.err.println("ERROR: can't get a component context from a running office ...");
e.printStackTrace();
System.exit(1);
- }
+ }
}
}
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java b/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java
index fcae70c91ec4..7fc2ab28ff29 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java
+++ b/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java
@@ -724,7 +724,7 @@ public class SpreadsheetSample extends SpreadsheetDocHelper
// get the global collection of table auto formats, use global service
// manager
com.sun.star.lang.XMultiComponentFactory xServiceManager = getServiceManager();
-
+
Object aAutoFormatsObj = xServiceManager.createInstanceWithContext(
"com.sun.star.sheet.TableAutoFormats", getContext());
com.sun.star.container.XNameContainer xAutoFormatsNA =
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ViewSample.java b/odk/examples/DevelopersGuide/Spreadsheet/ViewSample.java
index dd89ce017ead..36a3029b2310 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/ViewSample.java
+++ b/odk/examples/DevelopersGuide/Spreadsheet/ViewSample.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;
@@ -75,7 +75,7 @@ public class ViewSample extends SpreadsheetDocHelper
com.sun.star.frame.XModel xModel = (com.sun.star.frame.XModel)
UnoRuntime.queryInterface( com.sun.star.frame.XModel.class, xDoc);
com.sun.star.frame.XController xController = xModel.getCurrentController();
-
+
// --- Spreadsheet view ---
// freeze the first column and first two rows
com.sun.star.sheet.XViewFreezable xFreeze = (com.sun.star.sheet.XViewFreezable)
@@ -96,7 +96,7 @@ public class ViewSample extends SpreadsheetDocHelper
UnoRuntime.queryInterface( com.sun.star.beans.XPropertySet.class, xRange );
xRangeProp.setPropertyValue( "IsCellBackgroundTransparent", new Boolean( false ) );
xRangeProp.setPropertyValue( "CellBackColor", new Integer( 0xFFFFCC ) );
-
+
// --- View settings ---
// change the view to display green grid lines
com.sun.star.beans.XPropertySet xProp = (com.sun.star.beans.XPropertySet)
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/XExampleAddIn.idl b/odk/examples/DevelopersGuide/Spreadsheet/XExampleAddIn.idl
index 7834fc8b3c6d..6f6a48f33ae4 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/XExampleAddIn.idl
+++ b/odk/examples/DevelopersGuide/Spreadsheet/XExampleAddIn.idl
@@ -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,11 +29,11 @@
* 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 _ORG_OPENOFFICE_SHEET_ADDIN_XEXAMPLEADDIN_IDL_
-#define _ORG_OPENOFFICE_SHEET_ADDIN_XEXAMPLEADDIN_IDL_
+#define _ORG_OPENOFFICE_SHEET_ADDIN_XEXAMPLEADDIN_IDL_
#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/sheet/XVolatileResult.idl>
@@ -47,10 +47,10 @@ module org {
{
/// Sample function that just increments a value.
long getIncremented( [in] long nValue );
-
+
/// Sample function that returns a volatile result.
com::sun::star::sheet::XVolatileResult getCounter( [in] string aName );
- };
+ };
};
};
};
diff --git a/odk/examples/DevelopersGuide/Text/TextDocuments.java b/odk/examples/DevelopersGuide/Text/TextDocuments.java
index 4696b41ffe59..fad1be9c0e4a 100644
--- a/odk/examples/DevelopersGuide/Text/TextDocuments.java
+++ b/odk/examples/DevelopersGuide/Text/TextDocuments.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.awt.Point;
@@ -144,9 +144,9 @@ public class TextDocuments {
private static String sOutputDir;
private String aPrinterName = "\\\\so-print\\xml3sof";
-
+
private XComponentContext mxRemoteContext = null;
- private XMultiComponentFactory mxRemoteServiceManager = null;
+ private XMultiComponentFactory mxRemoteServiceManager = null;
private XTextDocument mxDoc = null;
private XMultiServiceFactory mxDocFactory = null;
private XMultiServiceFactory mxFactory = null;
@@ -155,11 +155,11 @@ public class TextDocuments {
private XTextCursor mxDocCursor = null;
private XTextContent mxFishSection = null;
private Random maRandom = null;
-
+
/** Creates a new instance of TextDocuments */
public TextDocuments() {
}
-
+
/**
* @param args the command line arguments
*/
@@ -168,7 +168,7 @@ public class TextDocuments {
try {
// output directory for store test;
sOutputDir = args[0];
-
+
textDocuments1.runDemo();
}
catch (java.lang.Exception e){
@@ -179,15 +179,15 @@ public class TextDocuments {
System.exit(0);
}
}
-
+
protected void runDemo() throws java.lang.Exception {
storePrintExample(); // depends on printer name
- templateExample();
+ templateExample();
viewCursorExample(); // makes changes to the current document,
// use with care
editingExample();
}
-
+
/** Sample for use of templates
* This sample uses the file TextTemplateWithUserFields.odt from the Samples
* folder. The file contains a number of User text fields (Variables - User)
@@ -201,40 +201,40 @@ public class TextDocuments {
recipient.put("ZIP", "34567");
recipient.put("City", "Fort Lauderdale");
recipient.put("State", "Florida");
-
+
// load template with User fields and bookmark
java.io.File sourceFile = new java.io.File("TextTemplateWithUserFields.odt");
StringBuffer sTemplateFileUrl = new StringBuffer("file:///");
sTemplateFileUrl.append(sourceFile.getCanonicalPath().replace('\\', '/'));
- XComponent xTemplateComponent =
+ XComponent xTemplateComponent =
newDocComponentFromTemplate( sTemplateFileUrl.toString() );
-
+
// get XTextFieldsSupplier, XBookmarksSupplier interfaces
XTextFieldsSupplier xTextFieldsSupplier = (XTextFieldsSupplier)
UnoRuntime.queryInterface(XTextFieldsSupplier.class,
xTemplateComponent);
XBookmarksSupplier xBookmarksSupplier = (XBookmarksSupplier)
UnoRuntime.queryInterface(XBookmarksSupplier.class, xTemplateComponent);
-
+
// access the TextFields and the TextFieldMasters collections
XNameAccess xNamedFieldMasters = xTextFieldsSupplier.getTextFieldMasters();
XEnumerationAccess xEnumeratedFields = xTextFieldsSupplier.getTextFields();
-
+
// iterate over hashtable and insert values into field masters
java.util.Enumeration keys = recipient.keys();
while(keys.hasMoreElements()) {
// get column name
String key = (String)keys.nextElement();
-
+
// access corresponding field master
Object fieldMaster = xNamedFieldMasters.getByName(
"com.sun.star.text.fieldmaster.User." + key);
-
+
// query the XPropertySet interface, we need to set the Content property
XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, fieldMaster);
-
+
// insert the column value into field master
xPropertySet.setPropertyValue("Content", recipient.get(key));
}
@@ -245,10 +245,10 @@ public class TextDocuments {
// accessing the Bookmarks collection of the document
XNameAccess xNamedBookmarks = xBookmarksSupplier.getBookmarks();
-
+
// find the bookmark named "Subscription"
Object bookmark = xNamedBookmarks.getByName("Subscription");
- // we need its XTextRange which is available from getAnchor(),
+ // we need its XTextRange which is available from getAnchor(),
// so query for XTextContent
XTextContent xBookmarkContent = (XTextContent)UnoRuntime.queryInterface(
XTextContent.class, bookmark);
@@ -256,14 +256,14 @@ public class TextDocuments {
XTextRange xBookmarkRange = xBookmarkContent.getAnchor();
// set string at the bookmark position
xBookmarkRange.setString("subscription for the Manatee Journal");
-
+
}
-
+
/** Sample for document changes, starting at the current view cursor position
* The sample changes the paragraph style and the character style at the
* current view cursor selection Open the sample file ViewCursorExampleFile,
* select some text and run the example.
- * The current paragraph will be set to Quotations paragraph style.
+ * The current paragraph will be set to Quotations paragraph style.
* The selected text will be set to Quotation character style.
*/
private void viewCursorExample() throws java.lang.Exception {
@@ -281,11 +281,11 @@ public class TextDocuments {
xCurrentComponent);
XController xController = xModel.getCurrentController();
// the controller gives us the TextViewCursor
- XTextViewCursorSupplier xViewCursorSupplier =
+ XTextViewCursorSupplier xViewCursorSupplier =
(XTextViewCursorSupplier)UnoRuntime.queryInterface(
XTextViewCursorSupplier.class, xController);
XTextViewCursor xViewCursor = xViewCursorSupplier.getViewCursor();
-
+
// query its XPropertySet interface, we want to set character and paragraph
// properties
XPropertySet xCursorPropertySet = (XPropertySet)UnoRuntime.queryInterface(
@@ -297,7 +297,7 @@ public class TextDocuments {
XPageCursor xPageCursor = (XPageCursor)UnoRuntime.queryInterface(
XPageCursor.class, xViewCursor);
System.out.println("The current page number is " + xPageCursor.getPage());
- // the model cursor is much more powerful, so
+ // the model cursor is much more powerful, so
// we create a model cursor at the current view cursor position with the
// following steps:
// get the Text service from the TextViewCursor, it is an XTextRange:
@@ -315,8 +315,8 @@ public class TextDocuments {
xParagraphCursor.gotoEndOfParagraph(false);
xParagraphCursor.setString(" ***** Fin de semana! ******");
}
-
-
+
+
/** Sample for the various editing facilities described in the
* developer's manual
*/
@@ -326,49 +326,49 @@ public class TextDocuments {
// query its XTextDocument interface to get the text
mxDoc = (XTextDocument)UnoRuntime.queryInterface(
XTextDocument.class, xEmptyWriterComponent);
-
+
// get a reference to the body text of the document
mxDocText = mxDoc.getText();
-
+
// Get a reference to the document's property set. This contains document
// information like the current word count
mxDocProps = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, mxDoc );
-
+
// Simple text insertion example
BodyTextExample ();
// Example using text ranges to insert strings at the beginning or end
// of a text range
- TextRangeExample ();
+ TextRangeExample ();
// Create a document cursor and remember it, it will be used in most
// of the following examples
- mxDocCursor = mxDocText.createTextCursor();
+ mxDocCursor = mxDocText.createTextCursor();
// Demonstrate some of the different cursor types (word, sentence)
TextCursorExample ();
-
+
// Access the text document's multi service factory, which we will need
// for most of the following examples
mxDocFactory = (XMultiServiceFactory) UnoRuntime.queryInterface(
XMultiServiceFactory.class, mxDoc );
-
+
// Examples of text fields, dependant text fields and field masters
TextFieldExample ();
-
+
// Example of using an XEnumerationAccess to iterate over paragraphs and
// set properties of each paragraph as we do so
- ParagraphExample ();
-
+ ParagraphExample ();
+
// Example of creating and manipulating a text frame
TextFrameExample ();
-
+
// Example of creating and manipulating a text table, text table rows
// and text table cells get a new random generator
maRandom = new Random();
TextTableExample ();
-
+
// Example of creating, inserting and manipulating text sections, as
// well as an example of how to refresh the document
- TextSectionExample ();
+ TextSectionExample ();
// Example of creating a text section over a block of text and formatting
// the text section into columns, as well as how to insert an empty
@@ -383,7 +383,7 @@ public class TextDocuments {
// document and how to create, insert and apply styles
StylesExample ();
IndexExample ();
-
+
// Example of how to create and manipulate reference marks and GetReference
// text fields
ReferenceExample ();
@@ -396,15 +396,15 @@ public class TextDocuments {
// and how to access the draw page of the document using the
// XDrawPageSupplier interface
DrawPageExample ();
-
+
mxFactory = (XMultiServiceFactory)UnoRuntime.queryInterface(
XMultiServiceFactory.class, mxRemoteServiceManager);
// This example demonstrates the use of the AutoTextContainer,
// AutoTextGroup and AutoTextEntry services and shows how to create,
// insert and modify auto text blocks
- AutoTextExample ();
+ AutoTextExample ();
}
-
+
protected void storePrintExample() throws java.lang.Exception {
// get the remote service manager
mxRemoteServiceManager = this.getRemoteServiceManager();
@@ -418,7 +418,7 @@ public class TextDocuments {
java.io.File sourceFile = new java.io.File("PrintDemo.odt");
StringBuffer sLoadFileUrl = new StringBuffer("file:///");
sLoadFileUrl.append(sourceFile.getCanonicalPath().replace('\\', '/'));
-
+
XComponent xDoc = xComponentLoader.loadComponentFromURL(
sLoadFileUrl.toString(), "_blank", 0, loadProps);
@@ -432,10 +432,10 @@ public class TextDocuments {
printDocComponent(xDoc);
}
}
-
+
private XMultiComponentFactory getRemoteServiceManager()
throws java.lang.Exception
- {
+ {
if (mxRemoteContext == null && mxRemoteServiceManager == null) {
// get the remote office context. If necessary a new office
// process is started
@@ -444,8 +444,8 @@ public class TextDocuments {
mxRemoteServiceManager = mxRemoteContext.getServiceManager();
}
return mxRemoteServiceManager;
- }
-
+ }
+
protected XComponent newDocComponent(String docType)
throws java.lang.Exception
{
@@ -457,9 +457,9 @@ public class TextDocuments {
UnoRuntime.queryInterface(XComponentLoader.class, desktop);
PropertyValue[] loadProps = new PropertyValue[0];
return xComponentLoader.loadComponentFromURL(loadUrl, "_blank",
- 0, loadProps);
+ 0, loadProps);
}
-
+
/** Load a document as template
*/
protected XComponent newDocComponentFromTemplate(String loadUrl)
@@ -472,17 +472,17 @@ public class TextDocuments {
"com.sun.star.frame.Desktop", mxRemoteContext);
XComponentLoader xComponentLoader = (XComponentLoader)
UnoRuntime.queryInterface(XComponentLoader.class, desktop);
-
+
// define load properties according to com.sun.star.document.MediaDescriptor
// the boolean property AsTemplate tells the office to create a new document
// from the given file
PropertyValue[] loadProps = new PropertyValue[1];
loadProps[0] = new PropertyValue();
loadProps[0].Name = "AsTemplate";
- loadProps[0].Value = new Boolean(true);
+ loadProps[0].Value = new Boolean(true);
// load
return xComponentLoader.loadComponentFromURL(loadUrl, "_blank",
- 0, loadProps);
+ 0, loadProps);
}
/** Load a document with arguments (text purposes)
@@ -490,18 +490,18 @@ public class TextDocuments {
protected void storeDocComponent(XComponent xDoc, String storeUrl)
throws java.lang.Exception
{
-
+
XStorable xStorable = (XStorable)UnoRuntime.queryInterface(
XStorable.class, xDoc);
PropertyValue[] storeProps = new PropertyValue[1];
storeProps[0] = new PropertyValue();
storeProps[0].Name = "FilterName";
- storeProps[0].Value = "MS Word 97";
+ storeProps[0].Value = "MS Word 97";
System.out.println("... store \"PrintDemo.odt\" to \"" + storeUrl + "\".");
- xStorable.storeAsURL(storeUrl, storeProps);
+ xStorable.storeAsURL(storeUrl, storeProps);
}
-
+
protected void printDocComponent(XComponent xDoc) throws java.lang.Exception {
XPrintable xPrintable = (XPrintable)UnoRuntime.queryInterface(
XPrintable.class, xDoc);
@@ -510,16 +510,16 @@ public class TextDocuments {
printerDesc[0].Name = "Name";
printerDesc[0].Value = aPrinterName;
- xPrintable.setPrinter(printerDesc);
-
+ xPrintable.setPrinter(printerDesc);
+
PropertyValue[] printOpts = new PropertyValue[1];
printOpts[0] = new PropertyValue();
printOpts[0].Name = "Pages";
- printOpts[0].Value = "1";
-
- xPrintable.print(printOpts);
+ printOpts[0].Value = "1";
+
+ xPrintable.print(printOpts);
}
-
+
// Setting the whole text of a document as one string
protected void BodyTextExample ()
{
@@ -527,7 +527,7 @@ public class TextDocuments {
try
{
// demonstrate simple text insertion
- mxDocText.setString ( "This is the new body text of the document."
+ mxDocText.setString ( "This is the new body text of the document."
+ "\n\nThis is on the second line.\n\n" );
}
catch ( Exception e )
@@ -535,7 +535,7 @@ public class TextDocuments {
e.printStackTrace();
}
}
-
+
// Adding a string at the end or the beginning of text
protected void TextRangeExample ()
{
@@ -555,7 +555,7 @@ public class TextDocuments {
e.printStackTrace();
}
}
-
+
/** moving a text cursor, selecting text and overwriting it
*/
protected void TextCursorExample ()
@@ -591,14 +591,14 @@ public class TextDocuments {
// replace the '.' at the end of the sentence with a new string
xSentenceCursor.gotoEndOfSentence( false );
xWordCursor.gotoPreviousWord( true );
- mxDocText.insertString (xWordCursor,
+ mxDocText.insertString (xWordCursor,
", which has been changed with text cursors!",
true);
}
catch ( Exception e )
{
e.printStackTrace();
- }
+ }
}
/** This method inserts both a date field and a user field containing the
@@ -608,7 +608,7 @@ public class TextDocuments {
{
try
{
- // Use the text document's factory to create a DateTime text field,
+ // Use the text document's factory to create a DateTime text field,
// and access it's XTextField interface
XTextField xDateField = (XTextField) UnoRuntime.queryInterface (
XTextField.class, mxDocFactory.createInstance (
@@ -617,9 +617,9 @@ public class TextDocuments {
// Insert it at the end of the document
mxDocText.insertTextContent ( mxDocText.getEnd(), xDateField, false );
- // Use the text document's factory to create a user text field,
+ // Use the text document's factory to create a user text field,
// and access it's XDependentTextField interface
- XDependentTextField xUserField =
+ XDependentTextField xUserField =
(XDependentTextField) UnoRuntime.queryInterface (
XDependentTextField.class, mxDocFactory.createInstance (
"com.sun.star.text.TextField.User" ) );
@@ -633,16 +633,16 @@ public class TextDocuments {
// Set the name and value of the FieldMaster
xMasterPropSet.setPropertyValue ( "Name", "UserEmperor" );
xMasterPropSet.setPropertyValue ( "Value", new Integer ( 42 ) );
-
+
// Attach the field master to the user field
xUserField.attachTextFieldMaster ( xMasterPropSet );
-
+
// Move the cursor to the end of the document
mxDocCursor.gotoEnd( false );
// insert a paragraph break using the XSimpleText interface
- mxDocText.insertControlCharacter (
+ mxDocText.insertControlCharacter (
mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
-
+
// Insert the user field at the end of the document
mxDocText.insertTextContent ( mxDocText.getEnd(), xUserField, false );
}
@@ -650,8 +650,8 @@ public class TextDocuments {
{
e.printStackTrace();
}
- }
-
+ }
+
/** This method demonstrates how to iterate over paragraphs
*/
protected void ParagraphExample ()
@@ -660,7 +660,7 @@ public class TextDocuments {
{
// The service 'com.sun.star.text.Text' supports the XEnumerationAccess
// interface to provide an enumeration of the paragraphs contained by
- // the text the service refers to.
+ // the text the service refers to.
// Here, we access this interface
XEnumerationAccess xParaAccess = (XEnumerationAccess)
@@ -697,80 +697,80 @@ public class TextDocuments {
e.printStackTrace();
}
}
-
+
/** This method returns a random double which isn't too high or too low
*/
protected double getRandomDouble ()
{
return ( ( maRandom.nextInt() % 1000 ) * maRandom.nextDouble () );
}
-
+
/** This method sets the text colour of the cell refered to by sCellName to
white and inserts the string sText in it
*/
protected static void insertIntoCell(String sCellName, String sText,
- XTextTable xTable)
+ XTextTable xTable)
{
- // Access the XText interface of the cell referred to by sCellName
+ // Access the XText interface of the cell referred to by sCellName
XText xCellText = (XText) UnoRuntime.queryInterface(
XText.class, xTable.getCellByName ( sCellName ) );
-
+
// create a text cursor from the cells XText interface
XTextCursor xCellCursor = xCellText.createTextCursor();
// Get the property set of the cell's TextCursor
XPropertySet xCellCursorProps = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xCellCursor );
-
- try
+
+ try
{
// Set the colour of the text to white
xCellCursorProps.setPropertyValue( "CharColor", new Integer(16777215));
- }
- catch ( Exception e)
+ }
+ catch ( Exception e)
{
e.printStackTrace();
}
// Set the text in the cell to sText
xCellText.setString( sText );
}
-
+
/** This method shows how to create and insert a text table, as well as insert
text and formulae into the cells of the table
*/
protected void TextTableExample ()
{
- try
+ try
{
// Create a new table from the document's factory
- XTextTable xTable = (XTextTable) UnoRuntime.queryInterface(
+ XTextTable xTable = (XTextTable) UnoRuntime.queryInterface(
XTextTable.class, mxDocFactory .createInstance(
"com.sun.star.text.TextTable" ) );
-
+
// Specify that we want the table to have 4 rows and 4 columns
xTable.initialize( 4, 4 );
-
+
// Insert the table into the document
mxDocText.insertTextContent( mxDocCursor, xTable, false);
// Get an XIndexAccess of the table rows
XIndexAccess xRows = xTable.getRows();
-
+
// Access the property set of the first row (properties listed in
// service description: com.sun.star.text.TextTableRow)
- XPropertySet xRow = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xRow = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xRows.getByIndex ( 0 ) );
// If BackTransparant is false, then the background color is visible
xRow.setPropertyValue( "BackTransparent", new Boolean(false));
// Specify the color of the background to be dark blue
xRow.setPropertyValue( "BackColor", new Integer(6710932));
-
+
// Access the property set of the whole table
- XPropertySet xTableProps = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet xTableProps = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xTable );
// We want visible background colors
xTableProps.setPropertyValue( "BackTransparent", new Boolean(false));
// Set the background colour to light blue
xTableProps.setPropertyValue( "BackColor", new Integer(13421823));
-
+
// set the text (and text colour) of all the cells in the first row
// of the table
insertIntoCell( "A1", "First Column", xTable );
@@ -783,22 +783,22 @@ public class TextDocuments {
xTable.getCellByName( "A2" ).setValue( getRandomDouble() );
xTable.getCellByName( "B2" ).setValue( getRandomDouble() );
xTable.getCellByName( "C2" ).setValue( getRandomDouble() );
-
+
xTable.getCellByName( "A3" ).setValue( getRandomDouble() );
xTable.getCellByName( "B3" ).setValue( getRandomDouble() );
xTable.getCellByName( "C3" ).setValue( getRandomDouble() );
-
+
xTable.getCellByName( "A4" ).setValue( getRandomDouble() );
xTable.getCellByName( "B4" ).setValue( getRandomDouble() );
xTable.getCellByName( "C4" ).setValue( getRandomDouble() );
-
+
// Set the last cell in each row to be a formula that calculates
// the sum of the first three cells
xTable.getCellByName( "D2" ).setFormula( "sum <A2:C2>" );
xTable.getCellByName( "D3" ).setFormula( "sum <A3:C3>" );
xTable.getCellByName( "D4" ).setFormula( "sum <A4:C4>" );
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
e.printStackTrace();
}
@@ -807,20 +807,20 @@ public class TextDocuments {
*/
protected void TextFrameExample ()
{
- try
+ try
{
// Use the document's factory to create a new text frame and
// immediately access it's XTextFrame interface
XTextFrame xFrame = (XTextFrame) UnoRuntime.queryInterface (
XTextFrame.class, mxDocFactory.createInstance (
"com.sun.star.text.TextFrame" ) );
-
+
// Access the XShape interface of the TextFrame
XShape xShape = (XShape)UnoRuntime.queryInterface(XShape.class, xFrame);
// Access the XPropertySet interface of the TextFrame
XPropertySet xFrameProps = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xFrame );
-
+
// Set the size of the new Text Frame using the XShape's 'setSize'
// method
Size aSize = new Size();
@@ -834,31 +834,31 @@ public class TextDocuments {
// Go to the end of the text document
mxDocCursor.gotoEnd( false );
// Insert a new paragraph
- mxDocText.insertControlCharacter (
+ mxDocText.insertControlCharacter (
mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
// Then insert the new frame
mxDocText.insertTextContent(mxDocCursor, xFrame, false);
-
+
// Access the XText interface of the text contained within the frame
XText xFrameText = xFrame.getText();
// Create a TextCursor over the frame's contents
XTextCursor xFrameCursor = xFrameText.createTextCursor();
// Insert some text into the frame
- xFrameText.insertString(
+ xFrameText.insertString(
xFrameCursor, "The first line in the newly created text frame.",
false );
- xFrameText.insertString(
+ xFrameText.insertString(
xFrameCursor, "\nThe second line in the new text frame.", false );
// Insert a paragraph break into the document (not the frame)
- mxDocText.insertControlCharacter (
+ mxDocText.insertControlCharacter (
mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
e.printStackTrace();
}
}
-
+
/** This example demonstrates the use of the AutoTextContainer, AutoTextGroup
and AutoTextEntry services and shows how to create, insert and modify
auto text blocks
@@ -870,9 +870,9 @@ public class TextDocuments {
// Go to the end of the document
mxDocCursor.gotoEnd( false );
// Insert two paragraphs
- mxDocText.insertControlCharacter ( mxDocCursor,
+ mxDocText.insertControlCharacter ( mxDocCursor,
ControlCharacter.PARAGRAPH_BREAK, false );
- mxDocText.insertControlCharacter ( mxDocCursor,
+ mxDocText.insertControlCharacter ( mxDocCursor,
ControlCharacter.PARAGRAPH_BREAK, false );
// Position the cursor in the second paragraph
XParagraphCursor xParaCursor = (XParagraphCursor)
@@ -881,29 +881,29 @@ public class TextDocuments {
// Get an XNameAccess interface to all auto text groups from the
// document factory
- XNameAccess xContainer = (XNameAccess) UnoRuntime.queryInterface(
+ XNameAccess xContainer = (XNameAccess) UnoRuntime.queryInterface(
XNameAccess.class, mxFactory.createInstance (
"com.sun.star.text.AutoTextContainer" ) );
- // Create a new table at the document factory
- XTextTable xTable = (XTextTable) UnoRuntime.queryInterface(
- XTextTable.class, mxDocFactory .createInstance(
+ // Create a new table at the document factory
+ XTextTable xTable = (XTextTable) UnoRuntime.queryInterface(
+ XTextTable.class, mxDocFactory .createInstance(
"com.sun.star.text.TextTable" ) );
-
+
// Store the names of all auto text groups in an array of strings
String[] aGroupNames = xContainer.getElementNames();
// Make sure we have at least one group name
- if ( aGroupNames.length > 0 )
+ if ( aGroupNames.length > 0 )
{
- // initialise the table to have a row for every autotext group
+ // initialise the table to have a row for every autotext group
// in a single column + one additional row for a header
xTable.initialize( aGroupNames.length+1,1);
// Access the XPropertySet of the table
XPropertySet xTableProps = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xTable );
-
+
// We want a visible background
xTableProps.setPropertyValue( "BackTransparent",
new Boolean(false));
@@ -916,20 +916,20 @@ public class TextDocuments {
// Get an XIndexAccess to all table rows
XIndexAccess xRows = xTable.getRows();
-
+
// Get the first row in the table
XPropertySet xRow = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xRows.getByIndex ( 0 ) );
// We want the background of the first row to be visible too
xRow.setPropertyValue( "BackTransparent", new Boolean(false));
-
+
// And let's make it dark blue
xRow.setPropertyValue( "BackColor", new Integer(6710932));
-
+
// Put a description of the table contents into the first cell
insertIntoCell( "A1", "AutoText Groups", xTable);
-
+
// Create a table cursor pointing at the second cell in the first
// column
XTextTableCursor xTableCursor = xTable.createCursorByCellName("A2");
@@ -939,15 +939,15 @@ public class TextDocuments {
{
// Get the name of the current cell
String sCellName = xTableCursor.getRangeName ();
-
+
// Get the XText interface of the current cell
- XText xCellText = (XText) UnoRuntime.queryInterface (
+ XText xCellText = (XText) UnoRuntime.queryInterface (
XText.class, xTable.getCellByName ( sCellName ) );
-
- // Set the cell contents of the current cell to be
+
+ // Set the cell contents of the current cell to be
//the name of the of an autotext group
xCellText.setString ( aGroupNames[i] );
-
+
// Access the autotext group with this name
XAutoTextGroup xGroup = (XAutoTextGroup)
UnoRuntime.queryInterface (XAutoTextGroup.class,
@@ -955,23 +955,23 @@ public class TextDocuments {
// Get the titles of each autotext block in this group
String [] aBlockNames = xGroup.getTitles();
-
+
// Make sure that the autotext group contains at least one block
if ( aBlockNames.length > 0 )
{
// Split the current cell vertically into two seperate cells
xTableCursor.splitRange ( (short) 1, false );
-
- // Put the cursor in the newly created right hand cell
+
+ // Put the cursor in the newly created right hand cell
// and select it
xTableCursor.goRight ( (short) 1, false );
-
- // Split this cell horizontally to make a seperate cell
+
+ // Split this cell horizontally to make a seperate cell
// for each Autotext block
if ( ( aBlockNames.length -1 ) > 0 )
- xTableCursor.splitRange (
+ xTableCursor.splitRange (
(short) (aBlockNames.length - 1), true );
-
+
// loop over the block names
for ( int j = 0 ; j < aBlockNames.length ; j ++ )
{
@@ -979,44 +979,44 @@ public class TextDocuments {
xCellText = (XText) UnoRuntime.queryInterface (
XText.class, xTable.getCellByName (
xTableCursor.getRangeName() ) );
-
+
// Set the text contents of the current cell to the
// title of an Autotext block
xCellText.setString ( aBlockNames[j] );
-
+
// Move the cursor down one cell
xTableCursor.goDown( (short)1, false);
}
}
// Go back to the cell we originally split
xTableCursor.gotoCellByName ( sCellName, false );
-
+
// Go down one cell
xTableCursor.goDown( (short)1, false);
}
-
+
XAutoTextGroup xGroup;
String [] aBlockNames;
-
+
// Add a depth so that we only generate 200 numbers before giving up
// on finding a random autotext group that contains autotext blocks
int nDepth = 0;
do
{
- // Generate a random, positive number which is lower than
+ // Generate a random, positive number which is lower than
// the number of autotext groups
int nRandom = Math.abs ( maRandom.nextInt() %
aGroupNames.length );
-
+
// Get the autotext group at this name
- xGroup = ( XAutoTextGroup ) UnoRuntime.queryInterface (
+ xGroup = ( XAutoTextGroup ) UnoRuntime.queryInterface (
XAutoTextGroup.class, xContainer.getByName (
aGroupNames[ nRandom ] ) );
// Fill our string array with the names of all the blocks in
// this group
aBlockNames = xGroup.getElementNames();
-
+
// increment our depth counter
++nDepth;
}
@@ -1026,26 +1026,26 @@ public class TextDocuments {
{
// Pick a random block in this group and get it's
// XAutoTextEntry interface
- int nRandom = Math.abs ( maRandom.nextInt()
+ int nRandom = Math.abs ( maRandom.nextInt()
% aBlockNames.length );
XAutoTextEntry xEntry = ( XAutoTextEntry )
- UnoRuntime.queryInterface (
+ UnoRuntime.queryInterface (
XAutoTextEntry.class, xGroup.getByName (
aBlockNames[ nRandom ] ) );
// insert the modified autotext block at the end of the document
xEntry.applyTo ( mxDocCursor );
-
+
// Get the titles of all text blocks in this AutoText group
String [] aBlockTitles = xGroup.getTitles();
-
+
// Get the XNamed interface of the autotext group
XNamed xGroupNamed = ( XNamed ) UnoRuntime.queryInterface (
XNamed.class, xGroup );
-
- // Output the short cut and title of the random block
+
+ // Output the short cut and title of the random block
//and the name of the group it's from
System.out.println ( "Inserted the Autotext '" +
- aBlockTitles[nRandom]
+ aBlockTitles[nRandom]
+ "', shortcut '" + aBlockNames[nRandom]
+ "' from group '"
+ xGroupNamed.getName());
@@ -1055,9 +1055,9 @@ public class TextDocuments {
// Go to the end of the document
mxDocCursor.gotoEnd( false );
// Insert new paragraph
- mxDocText.insertControlCharacter (
+ mxDocText.insertControlCharacter (
mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
-
+
// Position cursor in new paragraph
xParaCursor.gotoPreviousParagraph ( false );
@@ -1068,12 +1068,12 @@ public class TextDocuments {
// Go to the end of the document
mxDocCursor.gotoEnd( false );
}
- catch (Exception e)
+ catch (Exception e)
{
e.printStackTrace();
}
}
-
+
/** This method demonstrates how to insert indexes and index marks
*/
protected void IndexExample ()
@@ -1085,25 +1085,25 @@ public class TextDocuments {
// Insert a new paragraph and position the cursor in it
mxDocText.insertControlCharacter ( mxDocCursor,
ControlCharacter.PARAGRAPH_BREAK, false );
- XParagraphCursor xParaCursor = (XParagraphCursor)
+ XParagraphCursor xParaCursor = (XParagraphCursor)
UnoRuntime.queryInterface( XParagraphCursor.class, mxDocCursor );
xParaCursor.gotoPreviousParagraph ( false );
-
+
// Create a new ContentIndexMark and get it's XPropertySet interface
XPropertySet xEntry = (XPropertySet)UnoRuntime.queryInterface(
- XPropertySet.class,
+ XPropertySet.class,
mxDocFactory.createInstance("com.sun.star.text.ContentIndexMark"));
// Set the text to be displayed in the index
xEntry.setPropertyValue(
"AlternativeText", "Big dogs! Falling on my head!");
-
+
// The Level property _must_ be set
xEntry.setPropertyValue ( "Level", new Short ( (short) 1 ) );
-
+
// Create a ContentIndex and access it's XPropertySet interface
XPropertySet xIndex = (XPropertySet) UnoRuntime.queryInterface(
- XPropertySet.class,
+ XPropertySet.class,
mxDocFactory.createInstance ( "com.sun.star.text.ContentIndex" ) );
// Again, the Level property _must_ be set
@@ -1111,28 +1111,28 @@ public class TextDocuments {
// Access the XTextContent interfaces of both the Index and the
// IndexMark
- XTextContent xIndexContent = (XTextContent) UnoRuntime.queryInterface(
+ XTextContent xIndexContent = (XTextContent) UnoRuntime.queryInterface(
XTextContent.class, xIndex );
- XTextContent xEntryContent = (XTextContent) UnoRuntime.queryInterface(
+ XTextContent xEntryContent = (XTextContent) UnoRuntime.queryInterface(
XTextContent.class, xEntry );
-
+
// Insert both in the document
mxDocText.insertTextContent ( mxDocCursor, xEntryContent, false );
mxDocText.insertTextContent ( mxDocCursor, xIndexContent, false );
-
+
// Get the XDocumentIndex interface of the Index
- XDocumentIndex xDocIndex = (XDocumentIndex) UnoRuntime.queryInterface(
+ XDocumentIndex xDocIndex = (XDocumentIndex) UnoRuntime.queryInterface(
XDocumentIndex.class, xIndex );
-
+
// And call it's update method
xDocIndex.update();
}
- catch (Exception e)
+ catch (Exception e)
{
e.printStackTrace();
}
}
-
+
/** This method demonstrates how to create and insert reference marks, and
* GetReference Text Fields
*/
@@ -1142,25 +1142,25 @@ public class TextDocuments {
{
// Go to the end of the document
mxDocCursor.gotoEnd( false );
-
+
// Insert a paragraph break
- mxDocText.insertControlCharacter (
+ mxDocText.insertControlCharacter (
mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
-
+
// Get the Paragraph cursor
- XParagraphCursor xParaCursor = (XParagraphCursor)
+ XParagraphCursor xParaCursor = (XParagraphCursor)
UnoRuntime.queryInterface( XParagraphCursor.class, mxDocCursor );
-
+
// Move the cursor into the new paragraph
xParaCursor.gotoPreviousParagraph ( false );
-
+
// Create a new ReferenceMark and get it's XNamed interface
XNamed xRefMark = (XNamed) UnoRuntime.queryInterface(XNamed.class,
mxDocFactory.createInstance ("com.sun.star.text.ReferenceMark"));
// Set the name to TableHeader
xRefMark.setName ( "TableHeader" );
-
+
// Get the TextTablesSupplier interface of the document
XTextTablesSupplier xTableSupplier = ( XTextTablesSupplier )
UnoRuntime.queryInterface(XTextTablesSupplier.class, mxDoc);
@@ -1176,10 +1176,10 @@ public class TextDocuments {
// Get the first cell from the table
XText xTableText = (XText) UnoRuntime.queryInterface(
XText.class, xTable.getCellByName ( "A1" ) );
-
+
// Get a text cursor for the first cell
XTextCursor xTableCursor = xTableText.createTextCursor();
-
+
// Get the XTextContent interface of the reference mark so we can
// insert it
XTextContent xContent = ( XTextContent ) UnoRuntime.queryInterface (
@@ -1187,7 +1187,7 @@ public class TextDocuments {
// Insert the reference mark into the first cell of the table
xTableText.insertTextContent ( xTableCursor, xContent, false );
-
+
// Create a 'GetReference' text field to refer to the reference mark
// we just inserted, and get it's XPropertySet interface
XPropertySet xFieldProps = (XPropertySet) UnoRuntime.queryInterface(
@@ -1204,16 +1204,16 @@ public class TextDocuments {
// Put the names of each reference mark into an array of strings
String[] aNames = xMarks.getElementNames();
-
- // Make sure that at least 1 reference mark actually exists
+
+ // Make sure that at least 1 reference mark actually exists
// (well, we just inserted one!)
if ( aNames.length > 0 )
{
// Output the name of the first reference mark ('TableHeader')
System.out.println (
- "GetReference text field inserted for ReferenceMark : "
+ "GetReference text field inserted for ReferenceMark : "
+ aNames[0] );
-
+
// Set the SourceName of the GetReference text field to
// 'TableHeader'
xFieldProps.setPropertyValue ( "SourceName", aNames[0] );
@@ -1224,17 +1224,17 @@ public class TextDocuments {
new Short(ReferenceFieldSource.REFERENCE_MARK));
// We want the reference displayed as 'above' or 'below'
- xFieldProps.setPropertyValue ( "ReferenceFieldPart",
+ xFieldProps.setPropertyValue ( "ReferenceFieldPart",
new Short(ReferenceFieldPart.UP_DOWN));
-
+
// Get the XTextContent interface of the GetReference text field
XTextContent xRefContent = (XTextContent) UnoRuntime.queryInterface(
XTextContent.class, xFieldProps );
// Go to the end of the document
mxDocCursor.gotoEnd( false );
-
+
// Make some text to precede the reference
mxDocText.insertString(mxDocText.getEnd(), "The table ", false);
@@ -1242,7 +1242,7 @@ public class TextDocuments {
mxDocText.insertTextContent(mxDocText.getEnd(), xRefContent, false);
// And some text after the reference..
- mxDocText.insertString(mxDocText.getEnd(),
+ mxDocText.insertString(mxDocText.getEnd(),
" contains the sum of some random numbers.", false );
// Refresh the document
@@ -1251,12 +1251,12 @@ public class TextDocuments {
xRefresh.refresh();
}
}
- catch (Exception e)
+ catch (Exception e)
{
e.printStackTrace();
}
}
-
+
/** This method demonstrates how to create and insert footnotes, and how to
access the XFootnotesSupplier interface of the document
*/
@@ -1272,14 +1272,14 @@ public class TextDocuments {
// Set the label to 'Numbers'
xFootnote.setLabel ( "Numbers" );
-
+
// Get the footnotes XTextContent interface so we can...
- XTextContent xContent = ( XTextContent ) UnoRuntime.queryInterface (
+ XTextContent xContent = ( XTextContent ) UnoRuntime.queryInterface (
XTextContent.class, xFootnote );
-
+
// ...insert it into the document
mxDocText.insertTextContent ( mxDocCursor, xContent, false );
-
+
// Get the XFootnotesSupplier interface of the document
XFootnotesSupplier xFootnoteSupplier = (XFootnotesSupplier)
UnoRuntime.queryInterface(XFootnotesSupplier.class, mxDoc );
@@ -1289,27 +1289,27 @@ public class TextDocuments {
XIndexAccess.class, xFootnoteSupplier.getFootnotes() );
// Get the XFootnote interface to the first footnote inserted ('Numbers')
- XFootnote xNumbers = ( XFootnote ) UnoRuntime.queryInterface (
+ XFootnote xNumbers = ( XFootnote ) UnoRuntime.queryInterface (
XFootnote.class, xFootnotes.getByIndex( 0 ) );
// Get the XSimpleText interface to the Footnote
XSimpleText xSimple = (XSimpleText ) UnoRuntime.queryInterface (
XSimpleText.class, xNumbers );
-
+
// Create a text cursor for the foot note text
XTextRange xRange = (XTextRange ) UnoRuntime.queryInterface (
XTextRange.class, xSimple.createTextCursor() );
-
+
// And insert the actual text of the footnote.
- xSimple.insertString (
+ xSimple.insertString (
xRange, " The numbers were generated by using java.util.Random", false );
}
- catch (Exception e)
+ catch (Exception e)
{
e.printStackTrace();
}
}
-
+
/** This method demonstrates how to create and manipulate shapes, and how to
access the draw page of the document to insert shapes
*/
@@ -1326,22 +1326,22 @@ public class TextDocuments {
ControlCharacter.PARAGRAPH_BREAK, false);
// Get the XParagraphCursor interface of our document cursor
- XParagraphCursor xParaCursor = (XParagraphCursor)
+ XParagraphCursor xParaCursor = (XParagraphCursor)
UnoRuntime.queryInterface( XParagraphCursor.class, mxDocCursor );
// Position the cursor in the 2nd paragraph
xParaCursor.gotoPreviousParagraph ( false );
-
+
// Create a RectangleShape using the document factory
- XShape xRect = (XShape) UnoRuntime.queryInterface(
+ XShape xRect = (XShape) UnoRuntime.queryInterface(
XShape.class, mxDocFactory.createInstance (
"com.sun.star.drawing.RectangleShape" ) );
-
+
// Create an EllipseShape using the document factory
- XShape xEllipse = (XShape) UnoRuntime.queryInterface(
- XShape.class, mxDocFactory.createInstance (
+ XShape xEllipse = (XShape) UnoRuntime.queryInterface(
+ XShape.class, mxDocFactory.createInstance (
"com.sun.star.drawing.EllipseShape" ) );
-
+
// Set the size of both the ellipse and the rectangle
Size aSize = new Size();
aSize.Height = 4000;
@@ -1350,19 +1350,19 @@ public class TextDocuments {
aSize.Height = 3000;
aSize.Width = 6000;
xEllipse.setSize ( aSize );
-
+
// Set the position of the Rectangle to the right of the ellipse
Point aPoint = new Point();
aPoint.X = 6100;
aPoint.Y = 0;
xRect.setPosition ( aPoint );
-
+
// Get the XPropertySet interfaces of both shapes
- XPropertySet xRectProps = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet xRectProps = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xRect );
XPropertySet xEllipseProps = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xEllipse );
-
+
// And set the AnchorTypes of both shapes to 'AT_PARAGRAPH'
xRectProps.setPropertyValue ( "AnchorType",
TextContentAnchorType.AT_PARAGRAPH );
@@ -1374,20 +1374,20 @@ public class TextDocuments {
UnoRuntime.queryInterface (XDrawPageSupplier.class, mxDoc );
// Get the XShapes interface of the draw page
- XShapes xShapes = ( XShapes ) UnoRuntime.queryInterface (
+ XShapes xShapes = ( XShapes ) UnoRuntime.queryInterface (
XShapes.class, xDrawPageSupplier.getDrawPage () );
-
+
// Add both shapes
xShapes.add ( xEllipse );
xShapes.add ( xRect );
/*
This doesn't work, I am assured that FME and AMA are fixing it.
-
- XShapes xGrouper = (XShapes) UnoRuntime.queryInterface(
- XShapes.class, mxDocFactory.createInstance (
+
+ XShapes xGrouper = (XShapes) UnoRuntime.queryInterface(
+ XShapes.class, mxDocFactory.createInstance (
"com.sun.star.drawing.GroupShape" ) );
-
+
XShape xGrouperShape = (XShape) UnoRuntime.queryInterface(
XShape.class, xGrouper );
xShapes.add ( xGrouperShape );
@@ -1399,14 +1399,14 @@ public class TextDocuments {
UnoRuntime.queryInterface(XShapeGrouper.class, xShapes);
xShapeGrouper.group ( xGrouper );
*/
-
+
}
- catch (Exception e)
+ catch (Exception e)
{
e.printStackTrace();
}
- }
-
+ }
+
/** This method demonstrates how to create, insert and apply styles
*/
protected void StylesExample ()
@@ -1415,36 +1415,36 @@ public class TextDocuments {
{
// Go to the end of the document
mxDocCursor.gotoEnd( false );
-
+
// Insert two paragraph breaks
- mxDocText.insertControlCharacter (
+ mxDocText.insertControlCharacter (
mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
- mxDocText.insertControlCharacter (
+ mxDocText.insertControlCharacter (
mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
-
+
// Create a new style from the document's factory
- XStyle xStyle = (XStyle) UnoRuntime.queryInterface(
- XStyle.class, mxDocFactory.createInstance(
+ XStyle xStyle = (XStyle) UnoRuntime.queryInterface(
+ XStyle.class, mxDocFactory.createInstance(
"com.sun.star.style.ParagraphStyle" ) );
-
+
// Access the XPropertySet interface of the new style
XPropertySet xStyleProps = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xStyle );
-
+
// Give the new style a light blue background
xStyleProps.setPropertyValue ( "ParaBackColor", new Integer (13421823));
-
+
// Get the StyleFamiliesSupplier interface of the document
XStyleFamiliesSupplier xSupplier = (XStyleFamiliesSupplier)
UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, mxDoc);
// Use the StyleFamiliesSupplier interface to get the XNameAccess
// interface of the actual style families
- XNameAccess xFamilies = ( XNameAccess ) UnoRuntime.queryInterface (
+ XNameAccess xFamilies = ( XNameAccess ) UnoRuntime.queryInterface (
XNameAccess.class, xSupplier.getStyleFamilies() );
// Access the 'ParagraphStyles' Family
- XNameContainer xFamily = (XNameContainer ) UnoRuntime.queryInterface (
+ XNameContainer xFamily = (XNameContainer ) UnoRuntime.queryInterface (
XNameContainer.class,
xFamilies.getByName ( "ParagraphStyles" ) );
@@ -1452,7 +1452,7 @@ public class TextDocuments {
xFamily.insertByName ( "All-Singing All-Dancing Style", xStyle );
// Get the XParagraphCursor interface of the document cursor
- XParagraphCursor xParaCursor = (XParagraphCursor)
+ XParagraphCursor xParaCursor = (XParagraphCursor)
UnoRuntime.queryInterface( XParagraphCursor.class, mxDocCursor );
// Select the first paragraph inserted
@@ -1469,20 +1469,20 @@ public class TextDocuments {
// Go back to the end
mxDocCursor.gotoEnd ( false );
-
+
// Select the last paragraph in the document
xParaCursor.gotoNextParagraph ( true );
-
+
// And reset it's style to 'Standard' (the programmatic name for
// the default style)
xCursorProps.setPropertyValue ( "ParaStyleName", "Standard" );
}
- catch (Exception e)
+ catch (Exception e)
{
e.printStackTrace();
}
}
-
+
/** This method demonstrates how to set numbering types and numbering levels
using the com.sun.star.text.NumberingRules service
*/
@@ -1493,7 +1493,7 @@ public class TextDocuments {
// Go to the end of the document
mxDocCursor.gotoEnd( false );
// Get the RelativeTextContentInsert interface of the document
- XRelativeTextContentInsert xRelative =
+ XRelativeTextContentInsert xRelative =
(XRelativeTextContentInsert ) UnoRuntime.queryInterface (
XRelativeTextContentInsert.class, mxDocText );
@@ -1516,10 +1516,10 @@ public class TextDocuments {
XTextContent xNewPara = (XTextContent) UnoRuntime.queryInterface(
XTextContent.class, mxDocFactory.createInstance(
"com.sun.star.text.Paragraph" ) );
-
+
// Get the XPropertySet interface of the new paragraph and put
// it in our array
- xParas[i] = (XPropertySet) UnoRuntime.queryInterface(
+ xParas[i] = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xNewPara );
// Insert the new paragraph into the document after the fish
@@ -1538,44 +1538,44 @@ public class TextDocuments {
{
if ( aProps[j].Name.equals ( "NumberingType" ) )
{
- // Once we find it, set it's value to a new type,
+ // Once we find it, set it's value to a new type,
// dependent on which numbering level we're currently on
switch ( i )
{
- case 0 : aProps[j].Value =
+ case 0 : aProps[j].Value =
new Short(NumberingType.ROMAN_UPPER);
break;
- case 1 : aProps[j].Value =
+ case 1 : aProps[j].Value =
new Short(NumberingType.CHARS_UPPER_LETTER);
break;
- case 2 : aProps[j].Value =
+ case 2 : aProps[j].Value =
new Short(NumberingType.ARABIC);
break;
}
// Put the updated PropertyValue sequence back into the
// NumberingRules service
- xReplace.replaceByIndex ( i, aProps );
+ xReplace.replaceByIndex ( i, aProps );
break;
}
}
}
// Get the XParagraphCursor interface of our text cursro
- XParagraphCursor xParaCursor = (XParagraphCursor)
+ XParagraphCursor xParaCursor = (XParagraphCursor)
UnoRuntime.queryInterface( XParagraphCursor.class, mxDocCursor );
// Go to the end of the document, then select the preceding paragraphs
mxDocCursor.gotoEnd ( false );
xParaCursor.gotoPreviousParagraph ( false );
xParaCursor.gotoPreviousParagraph ( true );
xParaCursor.gotoPreviousParagraph ( true );
-
+
// Get the XPropertySet of the cursor's currently selected text
XPropertySet xCursorProps = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, mxDocCursor );
-
+
// Set the updated Numbering rules to the cursor's property set
xCursorProps.setPropertyValue ( "NumberingRules", xNum );
mxDocCursor.gotoEnd( false );
-
+
// Set the first paragraph that was inserted to a numbering level of
// 2 (thus it will have Arabic style numbering)
xParas[0].setPropertyValue ( "NumberingLevel", new Short((short) 2));
@@ -1588,13 +1588,13 @@ public class TextDocuments {
// 0 (thus it will have 'Chars Upper Letter' style numbering)
xParas[2].setPropertyValue ( "NumberingLevel", new Short((short) 0));
}
- catch (Exception e)
+ catch (Exception e)
{
e.printStackTrace();
}
}
-
- /** This method demonstrates how to create linked and unlinked sections
+
+ /** This method demonstrates how to create linked and unlinked sections
*/
protected void TextSectionExample ()
{
@@ -1603,11 +1603,11 @@ public class TextDocuments {
// Go to the end of the document
mxDocCursor.gotoEnd( false );
// Insert two paragraph breaks
- mxDocText.insertControlCharacter (
+ mxDocText.insertControlCharacter (
mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
- mxDocText.insertControlCharacter (
+ mxDocText.insertControlCharacter (
mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, true );
-
+
// Create a new TextSection from the document factory and access
// it's XNamed interface
XNamed xChildNamed = (XNamed) UnoRuntime.queryInterface(
@@ -1615,7 +1615,7 @@ public class TextDocuments {
"com.sun.star.text.TextSection" ) );
// Set the new sections name to 'Child_Section'
xChildNamed.setName ( "Child_Section" );
-
+
// Access the Child_Section's XTextContent interface and insert it
// into the document
XTextContent xChildSection = (XTextContent) UnoRuntime.queryInterface(
@@ -1628,10 +1628,10 @@ public class TextDocuments {
// Go back one paragraph (into Child_Section)
xParaCursor.gotoPreviousParagraph ( false );
-
+
// Insert a string into the Child_Section
mxDocText.insertString ( mxDocCursor, "This is a test", false );
-
+
// Go to the end of the document
mxDocCursor.gotoEnd( false );
@@ -1640,63 +1640,63 @@ public class TextDocuments {
xParaCursor.gotoPreviousParagraph ( false );
// Go to the end of the document, selecting the two paragraphs
mxDocCursor.gotoEnd ( true );
-
+
// Create another text section and access it's XNamed interface
XNamed xParentNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class,
mxDocFactory.createInstance("com.sun.star.text.TextSection"));
// Set this text section's name to Parent_Section
xParentNamed.setName ( "Parent_Section" );
-
+
// Access the Parent_Section's XTextContent interface ...
XTextContent xParentSection = (XTextContent) UnoRuntime.queryInterface(
XTextContent.class, xParentNamed );
// ...and insert it into the document
mxDocText.insertTextContent ( mxDocCursor, xParentSection, false );
-
+
// Go to the end of the document
mxDocCursor.gotoEnd ( false );
// Insert a new paragraph
- mxDocText.insertControlCharacter (
+ mxDocText.insertControlCharacter (
mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
// And select the new pargraph
xParaCursor.gotoPreviousParagraph ( true );
-
+
// Create a new Text Section and access it's XNamed interface
XNamed xLinkNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class,
mxDocFactory.createInstance("com.sun.star.text.TextSection"));
// Set the new text section's name to Linked_Section
xLinkNamed.setName ( "Linked_Section" );
-
+
// Access the Linked_Section's XTextContent interface
XTextContent xLinkedSection = (XTextContent) UnoRuntime.queryInterface(
XTextContent.class, xLinkNamed );
// And insert the Linked_Section into the document
mxDocText.insertTextContent ( mxDocCursor, xLinkedSection, false );
-
+
// Access the Linked_Section's XPropertySet interface
- XPropertySet xLinkProps = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet xLinkProps = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xLinkNamed );
// Set the linked section to be linked to the Child_Section
xLinkProps.setPropertyValue ( "LinkRegion", "Child_Section" );
-
+
// Access the XPropertySet interface of the Child_Section
XPropertySet xChildProps = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xChildNamed );
// Set the Child_Section's background colour to blue
xChildProps.setPropertyValue( "BackColor", new Integer(13421823));
-
+
// Refresh the document, so the linked section matches the Child_Section
- XRefreshable xRefresh = (XRefreshable) UnoRuntime.queryInterface(
+ XRefreshable xRefresh = (XRefreshable) UnoRuntime.queryInterface(
XRefreshable.class, mxDoc );
xRefresh.refresh();
}
- catch (Exception e)
+ catch (Exception e)
{
e.printStackTrace();
}
}
-
+
/** This method demonstrates the XTextColumns interface and how to insert a
blank paragraph using the XRelativeTextContentInsert interface
*/
@@ -1707,36 +1707,36 @@ public class TextDocuments {
// Go to the end of the doucment
mxDocCursor.gotoEnd( false );
// insert a new paragraph
- mxDocText.insertControlCharacter (
+ mxDocText.insertControlCharacter (
mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
-
+
// insert the string 'I am a fish.' 100 times
for ( int i = 0 ; i < 100 ; ++i )
{
mxDocText.insertString ( mxDocCursor, "I am a fish.", false );
}
// insert a paragraph break after the text
- mxDocText.insertControlCharacter (
+ mxDocText.insertControlCharacter (
mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
-
+
// Get the XParagraphCursor interface of our text cursor
- XParagraphCursor xParaCursor = (XParagraphCursor)
+ XParagraphCursor xParaCursor = (XParagraphCursor)
UnoRuntime.queryInterface( XParagraphCursor.class, mxDocCursor );
// Jump back before all the text we just inserted
xParaCursor.gotoPreviousParagraph ( false );
xParaCursor.gotoPreviousParagraph ( false );
-
+
// Insert a string at the beginning of the block of text
mxDocText.insertString ( mxDocCursor, "Fish section begins:", false );
-
+
// Then select all of the text
xParaCursor.gotoNextParagraph ( true );
xParaCursor.gotoNextParagraph ( true );
-
+
// Create a new text section and get it's XNamed interface
XNamed xSectionNamed = (XNamed) UnoRuntime.queryInterface(XNamed.class,
mxDocFactory.createInstance("com.sun.star.text.TextSection"));
-
+
// Set the name of our new section (appropiately) to 'Fish'
xSectionNamed.setName ( "Fish" );
@@ -1747,7 +1747,7 @@ public class TextDocuments {
// We want three columns
xColumns.setColumnCount ( (short) 3 );
-
+
// Get the TextColumns, and make the middle one narrow with a larger
// margin on the left than the right
TextColumn[] aSequence = xColumns.getColumns ();
@@ -1756,26 +1756,26 @@ public class TextDocuments {
aSequence[1].RightMargin = 200;
// Set the updated TextColumns back to the XTextColumns
xColumns.setColumns ( aSequence );
-
+
// Get the property set interface of our 'Fish' section
XPropertySet xSectionProps = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xSectionNamed );
-
+
// Set the columns to the Text Section
xSectionProps.setPropertyValue ( "TextColumns", xColumns );
-
+
// Get the XTextContent interface of our 'Fish' section
mxFishSection = (XTextContent) UnoRuntime.queryInterface(
XTextContent.class, xSectionNamed );
-
+
// Insert the 'Fish' section over the currently selected text
mxDocText.insertTextContent ( mxDocCursor, mxFishSection, true );
-
+
// Get the wonderful XRelativeTextContentInsert interface
XRelativeTextContentInsert xRelative = (XRelativeTextContentInsert )
UnoRuntime.queryInterface (
XRelativeTextContentInsert.class, mxDocText );
-
+
// Create a new empty paragraph and get it's XTextContent interface
XTextContent xNewPara = (XTextContent) UnoRuntime.queryInterface(
XTextContent.class,
@@ -1784,9 +1784,9 @@ public class TextDocuments {
// Insert the empty paragraph after the fish Text Section
xRelative.insertTextContentAfter ( xNewPara, mxFishSection );
}
- catch (Exception e)
+ catch (Exception e)
{
e.printStackTrace();
}
- }
+ }
}
diff --git a/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java b/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java
index 24d627111f38..daa3d821eebf 100644
--- a/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java
+++ b/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.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.ucb.OpenCommandArgument2;
diff --git a/odk/examples/DevelopersGuide/UCB/DataStreamComposer.java b/odk/examples/DevelopersGuide/UCB/DataStreamComposer.java
index 2d67cde0e4ae..899861a0451f 100644
--- a/odk/examples/DevelopersGuide/UCB/DataStreamComposer.java
+++ b/odk/examples/DevelopersGuide/UCB/DataStreamComposer.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.ucb.InsertCommandArgument;
@@ -180,7 +180,7 @@ public class DataStreamComposer {
} else if ( args[i].startsWith( "-srcURL=" )) {
m_srcURL = args[i].substring( 9 );
} else if ( args[i].startsWith( "-workdir=" )) {
- workdir = args[i].substring( 9 );
+ workdir = args[i].substring( 9 );
} else if ( args[i].startsWith( "-help" ) ||
args[i].startsWith( "-?" )) {
printCmdLineUsage();
diff --git a/odk/examples/DevelopersGuide/UCB/DataStreamRetriever.java b/odk/examples/DevelopersGuide/UCB/DataStreamRetriever.java
index 84529ab39533..5bf66124fdd3 100644
--- a/odk/examples/DevelopersGuide/UCB/DataStreamRetriever.java
+++ b/odk/examples/DevelopersGuide/UCB/DataStreamRetriever.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.ucb.OpenCommandArgument2;
diff --git a/odk/examples/DevelopersGuide/UCB/Helper.java b/odk/examples/DevelopersGuide/UCB/Helper.java
index ea5f5536365b..dbba9156f4eb 100644
--- a/odk/examples/DevelopersGuide/UCB/Helper.java
+++ b/odk/examples/DevelopersGuide/UCB/Helper.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;
@@ -70,7 +70,7 @@ public class Helper {
*
* @exception java.lang.Exception
*/
- public Helper(String url) throws java.lang.Exception {
+ public Helper(String url) throws java.lang.Exception {
m_contenturl = url;
if (null == m_xContext ) {
@@ -78,7 +78,7 @@ public class Helper {
m_xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
System.out.println("Connected to a running office ...");
}
-
+
XMultiComponentFactory xMCF = m_xContext.getServiceManager();
m_ucb = (XInterface)UnoRuntime.queryInterface(XInterface.class,
@@ -121,7 +121,7 @@ public class Helper {
}
return content;
}
-
+
/**
* Get ucb instance.
*
@@ -191,9 +191,9 @@ public class Helper {
{
e.printStackTrace();
}
- return new String();
+ return new String();
}
-
+
public static String prependCurrentDirAsAbsoluteFileURL( String relativeURL )
{
// get url of current dir.
diff --git a/odk/examples/DevelopersGuide/UCB/MyActiveDataSink.java b/odk/examples/DevelopersGuide/UCB/MyActiveDataSink.java
index 4d111dc740a8..3eb0dc8fd7d0 100644
--- a/odk/examples/DevelopersGuide/UCB/MyActiveDataSink.java
+++ b/odk/examples/DevelopersGuide/UCB/MyActiveDataSink.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,18 +29,18 @@
* 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.io.XActiveDataSink;
import com.sun.star.io.XInputStream;
/**
- * XActiveDataSink interface implementation. Makes it possible to read
- * the corresponding object from an input stream.
+ * XActiveDataSink interface implementation. Makes it possible to read
+ * the corresponding object from an input stream.
*/
public class MyActiveDataSink implements XActiveDataSink {
-
+
/**
* Member properties
*/
@@ -48,26 +48,26 @@ public class MyActiveDataSink implements XActiveDataSink {
/**
* Constructor
- */
+ */
public MyActiveDataSink() {
super();
}
-
+
/**
* Plugs the input stream.
*
*@param XInputStream
*/
public void setInputStream( XInputStream aStream ) {
- m_aStream = aStream;
+ m_aStream = aStream;
}
-
+
/**
* Get the plugged stream.
*
*@return XInputStream The plugged stream
- */
+ */
public XInputStream getInputStream() {
- return m_aStream;
+ return m_aStream;
}
}
diff --git a/odk/examples/DevelopersGuide/UCB/MyInputStream.java b/odk/examples/DevelopersGuide/UCB/MyInputStream.java
index d3c701c71776..187ff97e861b 100644
--- a/odk/examples/DevelopersGuide/UCB/MyInputStream.java
+++ b/odk/examples/DevelopersGuide/UCB/MyInputStream.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
@@ -164,7 +164,7 @@ public class MyInputStream implements XSeekable, XInputStream {
*@return int
*/
public synchronized int readSomeBytes(byte[][] p0, int p1)
- throws NotConnectedException,
+ throws NotConnectedException,
BufferSizeExceededException,
com.sun.star.io.IOException,
com.sun.star.uno.RuntimeException {
@@ -178,7 +178,7 @@ public class MyInputStream implements XSeekable, XInputStream {
*@param int
*/
public synchronized void skipBytes(int p0)
- throws NotConnectedException, BufferSizeExceededException,
+ throws NotConnectedException, BufferSizeExceededException,
com.sun.star.io.IOException, com.sun.star.uno.RuntimeException {
read += p0;
if( read > bigbuffer.length )
diff --git a/odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java b/odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java
index 2d000c1a3b90..ea7bb3c588de 100644
--- a/odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java
+++ b/odk/examples/DevelopersGuide/UCB/PropertiesRetriever.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/UCB/ResourceRemover.java b/odk/examples/DevelopersGuide/UCB/ResourceRemover.java
index f08740889cdb..09a6bcb7c21c 100644
--- a/odk/examples/DevelopersGuide/UCB/ResourceRemover.java
+++ b/odk/examples/DevelopersGuide/UCB/ResourceRemover.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.
- *
+ *
*************************************************************************/
/**
diff --git a/odk/examples/OLE/activex/SOActiveX.cpp b/odk/examples/OLE/activex/SOActiveX.cpp
index 46f03bb68eab..ef9a2ef72c86 100644
--- a/odk/examples/OLE/activex/SOActiveX.cpp
+++ b/odk/examples/OLE/activex/SOActiveX.cpp
@@ -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.
- *
+ *
*************************************************************************/
// SOActiveX.cpp : Implementation of CSOActiveX
@@ -45,28 +45,28 @@
#define BARS_NUMBER 3
#define BARS_TO_SHOW 2
-OLECHAR* pSlotUrl[BARS_NUMBER] =
+OLECHAR* pSlotUrl[BARS_NUMBER] =
{L"slot:5910" // SID_TOGGLEFUNCTIONBAR
,L"slot:5920" // SID_TOGGLESTATUSBAR
,L"slot:6661" // SID_TOGGLE_MENUBAR
-// ,L"slot:10603" // SID_HYPERLINK_INSERT
+// ,L"slot:10603" // SID_HYPERLINK_INSERT
};
-OLECHAR* pSlotName[BARS_NUMBER] =
- {L"FunctionBarVisible" // SID_TOGGLEFUNCTIONBAR
- ,L"StatusBarVisible" // SID_TOGGLESTATUSBAR
- ,L"MenuBarVisible" // SID_TOGGLE_MENUBAR
-// ,L"InsertHyperlink" // SID_HYPERLINK_INSERT
+OLECHAR* pSlotName[BARS_NUMBER] =
+ {L"FunctionBarVisible" // SID_TOGGLEFUNCTIONBAR
+ ,L"StatusBarVisible" // SID_TOGGLESTATUSBAR
+ ,L"MenuBarVisible" // SID_TOGGLE_MENUBAR
+// ,L"InsertHyperlink" // SID_HYPERLINK_INSERT
};
/////////////////////////////////////////////////////////////////////////////
-HRESULT ExecuteFunc( IDispatch* idispUnoObject,
- OLECHAR* sFuncName,
- CComVariant* params,
- unsigned int count,
+HRESULT ExecuteFunc( IDispatch* idispUnoObject,
+ OLECHAR* sFuncName,
+ CComVariant* params,
+ unsigned int count,
CComVariant* pResult )
{
if( !idispUnoObject )
@@ -80,14 +80,14 @@ HRESULT ExecuteFunc( IDispatch* idispUnoObject,
// DEBUG
EXCEPINFO myInfo;
- return idispUnoObject->Invoke( id, IID_NULL,LOCALE_USER_DEFAULT, DISPATCH_METHOD,
+ return idispUnoObject->Invoke( id, IID_NULL,LOCALE_USER_DEFAULT, DISPATCH_METHOD,
&dispparams, pResult, &myInfo, 0);
}
-HRESULT GetIDispByFunc( IDispatch* idispUnoObject,
- OLECHAR* sFuncName,
- CComVariant* params,
- unsigned int count,
+HRESULT GetIDispByFunc( IDispatch* idispUnoObject,
+ OLECHAR* sFuncName,
+ CComVariant* params,
+ unsigned int count,
CComPtr<IDispatch>& pdispResult )
{
if( !idispUnoObject )
@@ -105,9 +105,9 @@ HRESULT GetIDispByFunc( IDispatch* idispUnoObject,
return S_OK;
}
-HRESULT PutPropertiesToIDisp( IDispatch* pdispObject,
- OLECHAR** sMemberNames,
- CComVariant* pVariant,
+HRESULT PutPropertiesToIDisp( IDispatch* pdispObject,
+ OLECHAR** sMemberNames,
+ CComVariant* pVariant,
unsigned int count )
{
for( unsigned int ind = 0; ind < count; ind++ )
@@ -134,19 +134,19 @@ CSOActiveX::CSOActiveX()
, mOffWin( NULL )
, mbViewOnly( FALSE )
{
- CLSID clsFactory = {0x82154420,0x0FBF,0x11d4,{0x83, 0x13,0x00,0x50,0x04,0x52,0x6A,0xB4}};
+ CLSID clsFactory = {0x82154420,0x0FBF,0x11d4,{0x83, 0x13,0x00,0x50,0x04,0x52,0x6A,0xB4}};
HRESULT hr = CoCreateInstance( clsFactory, NULL, CLSCTX_ALL, __uuidof(IDispatch), (void**)&mpDispFactory);
- mPWinClass.style = CS_HREDRAW|CS_VREDRAW;
- mPWinClass.lpfnWndProc = ::DefWindowProc;
- mPWinClass.cbClsExtra = 0;
- mPWinClass.cbWndExtra = 0;
- mPWinClass.hInstance = (HINSTANCE) GetModuleHandle(NULL); //myInstance;
- mPWinClass.hIcon = NULL;
- mPWinClass.hCursor = NULL;
- mPWinClass.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
- mPWinClass.lpszMenuName = NULL;
- mPWinClass.lpszClassName = STAROFFICE_WINDOWCLASS;
+ mPWinClass.style = CS_HREDRAW|CS_VREDRAW;
+ mPWinClass.lpfnWndProc = ::DefWindowProc;
+ mPWinClass.cbClsExtra = 0;
+ mPWinClass.cbWndExtra = 0;
+ mPWinClass.hInstance = (HINSTANCE) GetModuleHandle(NULL); //myInstance;
+ mPWinClass.hIcon = NULL;
+ mPWinClass.hCursor = NULL;
+ mPWinClass.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
+ mPWinClass.lpszMenuName = NULL;
+ mPWinClass.lpszClassName = STAROFFICE_WINDOWCLASS;
RegisterClass(&mPWinClass);
}
@@ -192,7 +192,7 @@ STDMETHODIMP CSOActiveX::Load ( LPSTREAM pStm )
// may be later?
// for now just ignore
-
+
return S_OK;
}
@@ -201,19 +201,19 @@ STDMETHODIMP CSOActiveX::Load( LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog )
IPropertyBag2* pPropBag2;
HRESULT hr = pPropBag->QueryInterface( IID_IPropertyBag2, (void**)&pPropBag2 );
ATLASSERT( hr >= 0 );
-
+
if( !SUCCEEDED( hr ) )
return hr;
-
+
unsigned long aNum;
hr = pPropBag2->CountProperties( &aNum );
ATLASSERT( hr >= 0 );
if( !SUCCEEDED( hr ) )
return hr;
-
+
PROPBAG2* aPropNames = new PROPBAG2[aNum];
unsigned long aReaded;
-
+
hr = pPropBag2->GetPropertyInfo( 0,
aNum,
aPropNames,
@@ -230,7 +230,7 @@ STDMETHODIMP CSOActiveX::Load( LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog )
hr = pPropBag2->Read( aNum,
aPropNames,
NULL,
- aVal,
+ aVal,
hvs );
ATLASSERT( hr >= 0 );
if( !SUCCEEDED( hr ) )
@@ -249,7 +249,7 @@ STDMETHODIMP CSOActiveX::Load( LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog )
{
mCurFileUrl = wcsdup( aVal[ind].bstrVal );
}
- else if( aVal[ind].vt == VT_BSTR
+ else if( aVal[ind].vt == VT_BSTR
&& !strcmp( OLE2T( aPropNames[ind].pstrName ), "readonly" ) )
{
if( !strcmp( OLE2T( aVal[ind].bstrVal ), "true" ) )
@@ -270,10 +270,10 @@ STDMETHODIMP CSOActiveX::Load( LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog )
if( !mpDispFactory )
return hr;
-
+
mbLoad = TRUE;
- Invalidate();
+ Invalidate();
UpdateWindow();
return hr;
@@ -297,10 +297,10 @@ HRESULT CSOActiveX::GetUrlStruct( OLECHAR* sUrl, CComPtr<IDispatch>& pdispUrl )
if( !SUCCEEDED( hr ) ) return hr;
CComPtr<IDispatch> pdispTransformer;
- hr = GetIDispByFunc( mpDispFactory,
- L"createInstance",
- &CComVariant( L"com.sun.star.util.URLTransformer" ),
- 1,
+ hr = GetIDispByFunc( mpDispFactory,
+ L"createInstance",
+ &CComVariant( L"com.sun.star.util.URLTransformer" ),
+ 1,
pdispTransformer );
if( !SUCCEEDED( hr ) ) return hr;
@@ -330,9 +330,9 @@ HRESULT CSOActiveX::CreateFrameOldWay( HWND hwnd, int width, int height )
HRESULT hr = GetUnoStruct( L"com.sun.star.awt.Rectangle", pdispRectangle );
if( !SUCCEEDED( hr ) ) return hr;
- OLECHAR* sRectMemberNames[4] = { L"X",
- L"Y",
- L"Width",
+ OLECHAR* sRectMemberNames[4] = { L"X",
+ L"Y",
+ L"Width",
L"Height" };
CComVariant pRectVariant[4];
pRectVariant[0] = pRectVariant[1] = pRectVariant[2] = pRectVariant[3] = CComVariant( 0 );
@@ -346,10 +346,10 @@ HRESULT CSOActiveX::CreateFrameOldWay( HWND hwnd, int width, int height )
if( !SUCCEEDED( hr ) ) return hr;
// fill in descriptor with info
- OLECHAR* sDescriptorMemberNames[6] = { L"Type",
- L"WindowServiceName",
- L"ParentIndex",
- L"Parent",
+ OLECHAR* sDescriptorMemberNames[6] = { L"Type",
+ L"WindowServiceName",
+ L"ParentIndex",
+ L"Parent",
L"Bounds",
L"WindowAttributes" };
CComVariant pDescriptorVar[6];
@@ -403,7 +403,7 @@ HRESULT CSOActiveX::CreateFrameOldWay( HWND hwnd, int width, int height )
// initialize window
hr = ExecuteFunc( mpDispWin, L"setBackground", &CComVariant( (long)0xFFFFFFFF ), 1, &dummyResult );
if( !SUCCEEDED( hr ) ) return hr;
-
+
hr = ExecuteFunc( mpDispWin, L"setVisible", &CComVariant( TRUE ), 1, &dummyResult );
if( !SUCCEEDED( hr ) ) return hr;
@@ -431,10 +431,10 @@ HRESULT CSOActiveX::CallDispatch1PBool( OLECHAR* sUrl, OLECHAR* sArgName, BOOL s
aArgs[2] = CComVariant( pdispURL );
aArgs[1] = CComVariant( L"" );
aArgs[0] = CComVariant( (int)0 );
- hr = GetIDispByFunc( mpDispFrame,
- L"queryDispatch",
- aArgs,
- 3,
+ hr = GetIDispByFunc( mpDispFrame,
+ L"queryDispatch",
+ aArgs,
+ 3,
pdispXDispatch );
if( !SUCCEEDED( hr ) ) return hr;
@@ -444,7 +444,7 @@ HRESULT CSOActiveX::CallDispatch1PBool( OLECHAR* sUrl, OLECHAR* sArgName, BOOL s
hr = GetUnoStruct( L"com.sun.star.beans.PropertyValue", pdispPropVal );
if( !SUCCEEDED( hr ) ) return hr;
- OLECHAR* sPropMemberNames[2] = { L"Name", L"Value" };
+ OLECHAR* sPropMemberNames[2] = { L"Name", L"Value" };
CComVariant pPropVar[2];
pPropVar[0] = CComVariant( sArgName );
pPropVar[1] = CComVariant(); pPropVar[1].vt = VT_BOOL; pPropVar[1].boolVal = sArgVal ? VARIANT_TRUE : VARIANT_FALSE ;
@@ -452,7 +452,7 @@ HRESULT CSOActiveX::CallDispatch1PBool( OLECHAR* sUrl, OLECHAR* sArgName, BOOL s
if( !SUCCEEDED( hr ) ) return hr;
SafeArrayPutElement( pPropVals, &ix, pdispPropVal );
-
+
CComVariant aDispArgs[2];
aDispArgs[1] = CComVariant( pdispURL );
// aDispArgs[0] = CComVariant( pPropVals ); such constructor is not defined ??!
@@ -498,7 +498,7 @@ HRESULT CSOActiveX::LoadURLToFrame( )
return S_OK;
}
-
+
HRESULT CSOActiveX::OnDrawAdvanced( ATL_DRAWINFO& di )
{
if( m_spInPlaceSite && mCurFileUrl )
@@ -517,7 +517,7 @@ HRESULT CSOActiveX::OnDrawAdvanced( ATL_DRAWINFO& di )
}
mParentWin = hwnd;
- mOffWin = CreateWindow(
+ mOffWin = CreateWindow(
STAROFFICE_WINDOWCLASS,
"OfficeContainer",
WS_CHILD | WS_CLIPCHILDREN | WS_BORDER,
@@ -536,16 +536,16 @@ HRESULT CSOActiveX::OnDrawAdvanced( ATL_DRAWINFO& di )
{
RECT aRect;
::GetWindowRect( mOffWin, &aRect );
-
+
if( aRect.left != di.prcBounds->left || aRect.top != di.prcBounds->top
|| aRect.right != di.prcBounds->right || aRect.bottom != di.prcBounds->bottom )
{
// on this state the office window should exist already
::SetWindowPos( mOffWin,
HWND_TOP,
- di.prcBounds->left,
- di.prcBounds->top,
- di.prcBounds->right - di.prcBounds->left,
+ di.prcBounds->left,
+ di.prcBounds->top,
+ di.prcBounds->right - di.prcBounds->left,
di.prcBounds->bottom - di.prcBounds->top,
SWP_NOZORDER );
@@ -559,7 +559,7 @@ HRESULT CSOActiveX::OnDrawAdvanced( ATL_DRAWINFO& di )
hr = ExecuteFunc( mpDispWin, L"setPosSize", aPosArgs, 5, &dummyResult );
if( !SUCCEEDED( hr ) ) return hr;
}
- }
+ }
if( ! mpDispFrame )
{
@@ -616,12 +616,12 @@ STDMETHODIMP CSOActiveX::SetClientSite( IOleClientSite* aClientSite )
return hr;
}
-STDMETHODIMP CSOActiveX::Invoke(DISPID dispidMember,
- REFIID riid,
- LCID lcid,
- WORD wFlags,
+STDMETHODIMP CSOActiveX::Invoke(DISPID dispidMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
DISPPARAMS* pDispParams,
- VARIANT* pvarResult,
+ VARIANT* pvarResult,
EXCEPINFO* pExcepInfo,
UINT* puArgErr)
{
@@ -633,8 +633,8 @@ STDMETHODIMP CSOActiveX::Invoke(DISPID dispidMember,
if ( dispidMember == DISPID_ONQUIT )
Cleanup();
-
- IDispatchImpl<ISOActiveX, &IID_ISOActiveX,
+
+ IDispatchImpl<ISOActiveX, &IID_ISOActiveX,
&LIBID_SO_ACTIVEXLib>::Invoke(
dispidMember, riid, lcid, wFlags, pDispParams,
pvarResult, pExcepInfo, puArgErr);
diff --git a/odk/examples/OLE/activex/SOActiveX.h b/odk/examples/OLE/activex/SOActiveX.h
index 2f71bcd3108f..f115d49ebcc1 100644
--- a/odk/examples/OLE/activex/SOActiveX.h
+++ b/odk/examples/OLE/activex/SOActiveX.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.
- *
+ *
*************************************************************************/
// SOActiveX.h : Declaration of the CSOActiveX
@@ -48,7 +48,7 @@
/////////////////////////////////////////////////////////////////////////////
// CSOActiveX
-class ATL_NO_VTABLE CSOActiveX :
+class ATL_NO_VTABLE CSOActiveX :
public CComObjectRootEx<CComSingleThreadModel>,
public IDispatchImpl<ISOActiveX, &IID_ISOActiveX, &LIBID_SO_ACTIVEXLib>,
public CComControl<CSOActiveX>,
@@ -58,29 +58,29 @@ class ATL_NO_VTABLE CSOActiveX :
public IOleInPlaceActiveObjectImpl<CSOActiveX>,
public IViewObjectExImpl<CSOActiveX>,
public IOleInPlaceObjectWindowlessImpl<CSOActiveX>,
-// public IConnectionPointContainerImpl<CSOActiveX>,
+// public IConnectionPointContainerImpl<CSOActiveX>,
public CComCoClass<CSOActiveX, &CLSID_SOActiveX>,
-// public CProxy_ItryPluginEvents< CSOActiveX >,
+// public CProxy_ItryPluginEvents< CSOActiveX >,
public IPersistPropertyBagImpl< CSOActiveX >,
- public IProvideClassInfo2Impl< &CLSID_SOActiveX,
+ public IProvideClassInfo2Impl< &CLSID_SOActiveX,
&DIID__ISOActiveXEvents,
&LIBID_SO_ACTIVEXLib >,
- public IObjectSafetyImpl< CSOActiveX,
+ public IObjectSafetyImpl< CSOActiveX,
INTERFACESAFE_FOR_UNTRUSTED_DATA >
{
protected:
- CComPtr<IWebBrowser2> mWebBrowser2;
- DWORD mCookie;
-
- CComPtr<IDispatch> mpDispFactory;
- CComPtr<IDispatch> mpDispFrame;
- CComPtr<IDispatch> mpDispWin;
- OLECHAR* mCurFileUrl;
- BOOL mbLoad;
- BOOL mbViewOnly;
+ CComPtr<IWebBrowser2> mWebBrowser2;
+ DWORD mCookie;
+
+ CComPtr<IDispatch> mpDispFactory;
+ CComPtr<IDispatch> mpDispFrame;
+ CComPtr<IDispatch> mpDispWin;
+ OLECHAR* mCurFileUrl;
+ BOOL mbLoad;
+ BOOL mbViewOnly;
WNDCLASS mPWinClass;
- HWND mParentWin;
- HWND mOffWin;
+ HWND mParentWin;
+ HWND mOffWin;
public:
CSOActiveX();
~CSOActiveX();
@@ -103,7 +103,7 @@ BEGIN_COM_MAP(CSOActiveX)
COM_INTERFACE_ENTRY(IOleObject)
COM_INTERFACE_ENTRY(IPersistStreamInit)
COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)
-// COM_INTERFACE_ENTRY(IConnectionPointContainer)
+// COM_INTERFACE_ENTRY(IConnectionPointContainer)
COM_INTERFACE_ENTRY(IProvideClassInfo)
COM_INTERFACE_ENTRY(IProvideClassInfo2)
COM_INTERFACE_ENTRY(IPersistPropertyBag)
@@ -137,14 +137,14 @@ END_MSG_MAP()
// ISOActiveX
public:
-
+
STDMETHOD(SetClientSite)( IOleClientSite* aClientSite );
- STDMETHOD(Invoke)( DISPID dispidMember,
- REFIID riid,
- LCID lcid,
- WORD wFlags,
+ STDMETHOD(Invoke)( DISPID dispidMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
DISPPARAMS* pDispParams,
- VARIANT* pvarResult,
+ VARIANT* pvarResult,
EXCEPINFO* pExcepInfo,
UINT* puArgErr);
STDMETHOD(Load) ( LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog );
@@ -160,7 +160,7 @@ public:
HRESULT HideAllBars();
HRESULT CallDispatch1PBool( OLECHAR* sUrl, OLECHAR* sArgName, BOOL sArgVal );
HRESULT GetUrlStruct( OLECHAR* sUrl, CComPtr<IDispatch>& pdispUrl );
- HRESULT Cleanup();
+ HRESULT Cleanup();
};
#endif //__SOACTIVEX_H_
diff --git a/odk/examples/OLE/activex/SOComWindowPeer.cpp b/odk/examples/OLE/activex/SOComWindowPeer.cpp
index 35982bda75a3..0b2fabfffa81 100644
--- a/odk/examples/OLE/activex/SOComWindowPeer.cpp
+++ b/odk/examples/OLE/activex/SOComWindowPeer.cpp
@@ -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.
- *
+ *
*************************************************************************/
// SOComWindowPeer.cpp : Implementation of CHelpApp and DLL registration.
@@ -44,7 +44,7 @@
STDMETHODIMP SOComWindowPeer::InterfaceSupportsErrorInfo(REFIID riid)
{
- static const IID* arr[] =
+ static const IID* arr[] =
{
&IID_ISOComWindowPeer,
};
diff --git a/odk/examples/OLE/activex/SOComWindowPeer.h b/odk/examples/OLE/activex/SOComWindowPeer.h
index dfd39b5b1859..e843aa705ee2 100644
--- a/odk/examples/OLE/activex/SOComWindowPeer.h
+++ b/odk/examples/OLE/activex/SOComWindowPeer.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.
- *
+ *
*************************************************************************/
// SOComWindowPeer.h: Definition of the SOComWindowPeer class
@@ -55,8 +55,8 @@
/////////////////////////////////////////////////////////////////////////////
// SOComWindowPeer
-class SOComWindowPeer :
- public IDispatchImpl<ISOComWindowPeer, &IID_ISOComWindowPeer, &LIBID_SO_ACTIVEXLib>,
+class SOComWindowPeer :
+ public IDispatchImpl<ISOComWindowPeer, &IID_ISOComWindowPeer, &LIBID_SO_ACTIVEXLib>,
public ISupportErrorInfo,
public CComObjectRoot,
public CComCoClass<SOComWindowPeer,&CLSID_SOComWindowPeer>
@@ -70,9 +70,9 @@ BEGIN_COM_MAP(SOComWindowPeer)
COM_INTERFACE_ENTRY(ISOComWindowPeer)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
END_COM_MAP()
-DECLARE_NOT_AGGREGATABLE(SOComWindowPeer)
-// Remove the comment from the line above if you don't want your object to
-// support aggregation.
+DECLARE_NOT_AGGREGATABLE(SOComWindowPeer)
+// Remove the comment from the line above if you don't want your object to
+// support aggregation.
DECLARE_REGISTRY_RESOURCEID(IDR_SOCOMWINDOWPEER)
@@ -80,7 +80,7 @@ DECLARE_REGISTRY_RESOURCEID(IDR_SOCOMWINDOWPEER)
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
// ISOComWindowPeer
- virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getWindowHandle(
+ virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getWindowHandle(
/* [in] */ SAFEARRAY __RPC_FAR * procId,
/* [in] */ short s,
/* [retval][out] */ long __RPC_FAR *ret)
@@ -88,57 +88,57 @@ DECLARE_REGISTRY_RESOURCEID(IDR_SOCOMWINDOWPEER)
*ret = (long) m_hwnd;
return S_OK;
}
-
- virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getToolkit(
+
+ virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE getToolkit(
/* [retval][out] */ IDispatch __RPC_FAR *__RPC_FAR *retVal)
{
*retVal = NULL;
return S_OK;
}
-
- virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setPointer(
+
+ virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setPointer(
/* [in] */ IDispatch __RPC_FAR *xPointer)
{
return S_OK;
}
-
- virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setBackground(
+
+ virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE setBackground(
/* [in] */ int nColor)
{
return S_OK;
}
-
- virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE invalidate(
+
+ virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE invalidate(
/* [in] */ short __MIDL_0015)
{
return S_OK;
}
-
- virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE invalidateRect(
+
+ virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE invalidateRect(
/* [in] */ IDispatch __RPC_FAR *aRect,
/* [in] */ short nFlags)
{
return S_OK;
}
-
+
virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE dispose( void)
{
return S_OK;
}
-
- virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addEventListener(
+
+ virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE addEventListener(
/* [in] */ IDispatch __RPC_FAR *xListener)
{
return S_OK;
}
-
- virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeEventListener(
+
+ virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE removeEventListener(
/* [in] */ IDispatch __RPC_FAR *xListener)
{
return S_OK;
}
-
- virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Bridge_implementedInterfaces(
+
+ virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Bridge_implementedInterfaces(
/* [retval][out] */ SAFEARRAY __RPC_FAR * __RPC_FAR *pVal)
{
*pVal = SafeArrayCreateVector( VT_BSTR, 0, 2 );
diff --git a/odk/examples/OLE/activex/StdAfx2.cpp b/odk/examples/OLE/activex/StdAfx2.cpp
index 3911bcf24003..12ffbc184220 100644
--- a/odk/examples/OLE/activex/StdAfx2.cpp
+++ b/odk/examples/OLE/activex/StdAfx2.cpp
@@ -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.
- *
+ *
*************************************************************************/
// stdafx1.cpp : source file that includes just the standard includes
diff --git a/odk/examples/OLE/activex/StdAfx2.h b/odk/examples/OLE/activex/StdAfx2.h
index bfb06fa7b34d..548e334fd6d4 100644
--- a/odk/examples/OLE/activex/StdAfx2.h
+++ b/odk/examples/OLE/activex/StdAfx2.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.
- *
+ *
*************************************************************************/
// stdafx1.h : include file for standard system include files,
diff --git a/odk/examples/OLE/activex/resource.h b/odk/examples/OLE/activex/resource.h
index bf1bf5c7dedc..7587e0c1a2af 100644
--- a/odk/examples/OLE/activex/resource.h
+++ b/odk/examples/OLE/activex/resource.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.
- *
+ *
*************************************************************************/
//{{NO_DEPENDENCIES}}
@@ -44,7 +44,7 @@
#define IDR_SOCOMWINDOWPEER 104
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 201
diff --git a/odk/examples/OLE/activex/so_activex.cpp b/odk/examples/OLE/activex/so_activex.cpp
index 64349fb34439..9581c21473b6 100644
--- a/odk/examples/OLE/activex/so_activex.cpp
+++ b/odk/examples/OLE/activex/so_activex.cpp
@@ -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,14 +30,14 @@
* 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.
- *
+ *
*************************************************************************/
// so_activex.cpp : Implementation of DLL Exports.
// Note: Proxy/Stub Information
-// To build a separate proxy/stub DLL,
+// To build a separate proxy/stub DLL,
// run nmake -f so_activexps.mk in the project directory.
#include "stdafx2.h"
diff --git a/odk/examples/OLE/activex/so_activex.idl b/odk/examples/OLE/activex/so_activex.idl
index 545d5643569d..23a4eb4965b8 100644
--- a/odk/examples/OLE/activex/so_activex.idl
+++ b/odk/examples/OLE/activex/so_activex.idl
@@ -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.
- *
+ *
*************************************************************************/
// so_activex.idl : IDL source for so_activex.dll
@@ -63,36 +63,36 @@ import "ocidl.idl";
]
interface ISOComWindowPeer : IDispatch
{
- [id(1), helpstring("method getWindowHandle")]
+ [id(1), helpstring("method getWindowHandle")]
HRESULT getWindowHandle( [in] SAFEARRAY(VARIANT) procId,
[in] short s,
[out,retval] long* ret);
- [id(2), helpstring("method getToolkit")]
+ [id(2), helpstring("method getToolkit")]
HRESULT getToolkit( [out,retval] IDispatch** retVal );
- [id(3), helpstring("method setPointer")]
+ [id(3), helpstring("method setPointer")]
HRESULT setPointer( [in] IDispatch* xPointer );
- [id(4), helpstring("method setBackground")]
+ [id(4), helpstring("method setBackground")]
HRESULT setBackground( [in] int nColor );
- [id(5), helpstring("method invalidate")]
+ [id(5), helpstring("method invalidate")]
HRESULT invalidate( [in] short );
- [id(6), helpstring("method invalidateRect")]
+ [id(6), helpstring("method invalidateRect")]
HRESULT invalidateRect( [in] IDispatch* aRect, [in] short nFlags );
- [id(7), helpstring("method dispose")]
+ [id(7), helpstring("method dispose")]
HRESULT dispose();
- [id(8), helpstring("method addEventListener")]
+ [id(8), helpstring("method addEventListener")]
HRESULT addEventListener( [in] IDispatch* xListener );
- [id(9), helpstring("method removeEventListener")]
+ [id(9), helpstring("method removeEventListener")]
HRESULT removeEventListener( [in] IDispatch* xListener );
- [propget, id(10), helpstring("property_implementedInterfaces")]
+ [propget, id(10), helpstring("property_implementedInterfaces")]
HRESULT Bridge_implementedInterfaces([out, retval] SAFEARRAY(BSTR) *pVal);
};
diff --git a/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx b/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx
index 6d72448c8762..9ef679db86de 100644
--- a/odk/examples/cpp/DocumentLoader/DocumentLoader.cxx
+++ b/odk/examples/cpp/DocumentLoader/DocumentLoader.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.
- *
+ *
*************************************************************************/
/*****************************************************************************
@@ -80,9 +80,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
}
if (argc == 3)
{
- sConnectionString = OUString::createFromAscii(argv[2]);
+ sConnectionString = OUString::createFromAscii(argv[2]);
}
-
+
// Creates a simple registry service instance.
Reference< XSimpleRegistry > xSimpleRegistry(
::cppu::createSimpleRegistry() );
@@ -101,7 +101,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
*/
Reference< XComponentContext > xComponentContext(
::cppu::bootstrap_InitialComponentContext( xSimpleRegistry ) );
-
+
/* Gets the service manager instance to be used (or null). This method has
been added for convenience, because the service manager is a often used
object.
@@ -113,7 +113,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
by the factory.
*/
Reference< XInterface > xInterface =
- xMultiComponentFactoryClient->createInstanceWithContext(
+ xMultiComponentFactoryClient->createInstanceWithContext(
OUString::createFromAscii( "com.sun.star.bridge.UnoUrlResolver" ),
xComponentContext );
@@ -121,8 +121,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
// Resolves the component context from the office, on the uno URL given by argv[1].
try
- {
- xInterface = Reference< XInterface >(
+ {
+ xInterface = Reference< XInterface >(
resolver->resolve( sConnectionString ), UNO_QUERY );
}
catch ( Exception& e )
@@ -130,9 +130,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
printf("Error: cannot establish a connection using '%s':\n %s\n",
OUStringToOString(sConnectionString, RTL_TEXTENCODING_ASCII_US).getStr(),
OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US).getStr());
- exit(1);
+ exit(1);
}
-
+
// gets the server component context as property of the office component factory
Reference< XPropertySet > xPropSet( xInterface, UNO_QUERY );
xPropSet->getPropertyValue( OUString::createFromAscii("DefaultContext") ) >>= xComponentContext;
@@ -140,15 +140,15 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
// gets the service manager from the office
Reference< XMultiComponentFactory > xMultiComponentFactoryServer(
xComponentContext->getServiceManager() );
-
+
/* Creates an instance of a component which supports the services specified
by the factory. Important: using the office component context.
*/
Reference < XComponentLoader > xComponentLoader(
- xMultiComponentFactoryServer->createInstanceWithContext(
+ xMultiComponentFactoryServer->createInstanceWithContext(
OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop" ) ),
xComponentContext ), UNO_QUERY );
-
+
/* Loads a component specified by an URL into the specified new or existing
frame.
*/
@@ -156,7 +156,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
osl_getProcessWorkingDir(&sWorkingDir.pData);
osl::FileBase::getFileURLFromSystemPath( OUString::createFromAscii(argv[1]), sDocPathUrl);
osl::FileBase::getAbsoluteFileURL( sWorkingDir, sDocPathUrl, sAbsoluteDocUrl);
-
+
Reference< XComponent > xComponent = xComponentLoader->loadComponentFromURL(
sAbsoluteDocUrl, OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") ), 0,
Sequence < ::com::sun::star::beans::PropertyValue >() );
diff --git a/odk/examples/cpp/complextoolbarcontrols/CalcListener.cxx b/odk/examples/cpp/complextoolbarcontrols/CalcListener.cxx
index 506e9c7b297e..fd344840d362 100644
--- a/odk/examples/cpp/complextoolbarcontrols/CalcListener.cxx
+++ b/odk/examples/cpp/complextoolbarcontrols/CalcListener.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/cpp/complextoolbarcontrols/ListenerHelper.cxx b/odk/examples/cpp/complextoolbarcontrols/ListenerHelper.cxx
index e0011e93d3e1..fa0a90560fc5 100644
--- a/odk/examples/cpp/complextoolbarcontrols/ListenerHelper.cxx
+++ b/odk/examples/cpp/complextoolbarcontrols/ListenerHelper.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -40,9 +40,9 @@ using com::sun::star::frame::FeatureStateEvent;
static AllListeners aListeners;
-void ListenerHelper::AddListener(
- const Reference < XFrame >& xFrame,
- const Reference < XStatusListener > xControl,
+void ListenerHelper::AddListener(
+ const Reference < XFrame >& xFrame,
+ const Reference < XStatusListener > xControl,
const ::rtl::OUString& aCommand )
{
sal_uInt32 i=0;
@@ -56,8 +56,8 @@ void ListenerHelper::AddListener(
}
void ListenerHelper::RemoveListener(
- const Reference < XFrame >& xFrame,
- const Reference < XStatusListener > xControl,
+ const Reference < XFrame >& xFrame,
+ const Reference < XStatusListener > xControl,
const ::rtl::OUString& aCommand )
{
sal_uInt32 nSize = aListeners.size();
@@ -73,7 +73,7 @@ void ListenerHelper::RemoveListener(
{
aL.erase( aIter );
break;
- }
+ }
aIter++;
}
@@ -81,8 +81,8 @@ void ListenerHelper::RemoveListener(
}
}
-void ListenerHelper::Notify(
- const Reference < XFrame >& xFrame,
+void ListenerHelper::Notify(
+ const Reference < XFrame >& xFrame,
const ::rtl::OUString& aCommand,
FeatureStateEvent& rEvent )
{
@@ -103,8 +103,8 @@ void ListenerHelper::Notify(
}
}
-com::sun::star::uno::Reference < XDispatch > ListenerHelper::GetDispatch(
- const Reference < XFrame >& xFrame,
+com::sun::star::uno::Reference < XDispatch > ListenerHelper::GetDispatch(
+ const Reference < XFrame >& xFrame,
const ::rtl::OUString& aCommand )
{
sal_uInt32 nSize = aListeners.size();
@@ -117,15 +117,15 @@ com::sun::star::uno::Reference < XDispatch > ListenerHelper::GetDispatch(
return Reference < XDispatch >();
}
-void ListenerHelper::AddDispatch(
+void ListenerHelper::AddDispatch(
const Reference < XDispatch > xDispatch,
- const Reference < XFrame >& xFrame,
+ const Reference < XFrame >& xFrame,
const ::rtl::OUString& aCommand )
{
- ListenerItem aItem;
+ ListenerItem aItem;
aItem.xFrame = xFrame;
aItem.xDispatch = xDispatch;
- aListeners.push_back( aItem );
+ aListeners.push_back( aItem );
xFrame->addEventListener( new ListenerItemEventListener( xFrame ) );
}
@@ -138,7 +138,7 @@ void SAL_CALL ListenerItemEventListener::disposing( const EventObject& aEvent) t
{
aListeners.erase( aIter );
break;
- }
+ }
aIter++;
}
diff --git a/odk/examples/cpp/complextoolbarcontrols/ListenerHelper.h b/odk/examples/cpp/complextoolbarcontrols/ListenerHelper.h
index 8aa8621ac841..e4255ecf8528 100644
--- a/odk/examples/cpp/complextoolbarcontrols/ListenerHelper.h
+++ b/odk/examples/cpp/complextoolbarcontrols/ListenerHelper.h
@@ -41,7 +41,7 @@ ListenerMap;
// these arrays are accessed by a hash_map (with the command string as index)
struct ListenerItem
{
- ListenerMap aContainer;
+ ListenerMap aContainer;
::com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > xDispatch;
::com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame;
};
diff --git a/odk/examples/cpp/complextoolbarcontrols/MyJob.cxx b/odk/examples/cpp/complextoolbarcontrols/MyJob.cxx
index c87f14195929..0f061b39cf9f 100644
--- a/odk/examples/cpp/complextoolbarcontrols/MyJob.cxx
+++ b/odk/examples/cpp/complextoolbarcontrols/MyJob.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/cpp/complextoolbarcontrols/MyListener.cxx b/odk/examples/cpp/complextoolbarcontrols/MyListener.cxx
index a780efcfba23..0c4f6a16b80d 100644
--- a/odk/examples/cpp/complextoolbarcontrols/MyListener.cxx
+++ b/odk/examples/cpp/complextoolbarcontrols/MyListener.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx
index d0fd2b200898..dd58c3a74f4e 100644
--- a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx
+++ b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -107,11 +107,11 @@ void BaseDispatch::ShowMessageBox( const Reference< XFrame >& rFrame, const ::rt
void BaseDispatch::SendCommand( const com::sun::star::util::URL& aURL, const ::rtl::OUString& rCommand, const Sequence< NamedValue >& rArgs, sal_Bool bEnabled )
{
- Reference < XDispatch > xDispatch =
+ Reference < XDispatch > xDispatch =
aListenerHelper.GetDispatch( mxFrame, aURL.Path );
-
+
FeatureStateEvent aEvent;
-
+
aEvent.FeatureURL = aURL;
aEvent.Source = xDispatch;
aEvent.IsEnabled = bEnabled;
@@ -120,15 +120,15 @@ void BaseDispatch::SendCommand( const com::sun::star::util::URL& aURL, const ::r
ControlCommand aCtrlCmd;
aCtrlCmd.Command = rCommand;
aCtrlCmd.Arguments = rArgs;
-
+
aEvent.State <<= aCtrlCmd;
- aListenerHelper.Notify( mxFrame, aEvent.FeatureURL.Path, aEvent );
+ aListenerHelper.Notify( mxFrame, aEvent.FeatureURL.Path, aEvent );
}
void BaseDispatch::SendCommandTo( const Reference< XStatusListener >& xControl, const URL& aURL, const ::rtl::OUString& rCommand, const Sequence< NamedValue >& rArgs, sal_Bool bEnabled )
{
FeatureStateEvent aEvent;
-
+
aEvent.FeatureURL = aURL;
aEvent.Source = (::com::sun::star::frame::XDispatch*) this;
aEvent.IsEnabled = bEnabled;
@@ -137,7 +137,7 @@ void BaseDispatch::SendCommandTo( const Reference< XStatusListener >& xControl,
ControlCommand aCtrlCmd;
aCtrlCmd.Command = rCommand;
aCtrlCmd.Arguments = rArgs;
-
+
aEvent.State <<= aCtrlCmd;
xControl->statusChanged( aEvent );
}
@@ -154,7 +154,7 @@ void SAL_CALL MyProtocolHandler::initialize( const Sequence< Any >& aArguments )
}
}
-Reference< XDispatch > SAL_CALL MyProtocolHandler::queryDispatch( const URL& aURL, const ::rtl::OUString& sTargetFrameName, sal_Int32 nSearchFlags )
+Reference< XDispatch > SAL_CALL MyProtocolHandler::queryDispatch( const URL& aURL, const ::rtl::OUString& sTargetFrameName, sal_Int32 nSearchFlags )
throw( RuntimeException )
{
Reference < XDispatch > xRet;
@@ -273,16 +273,16 @@ void SAL_CALL BaseDispatch::dispatch( const URL& aURL, const Sequence < Property
Reference< XSystemShellExecute > xSystemShellExecute( mxMSF->createInstance(
::rtl::OUString::createFromAscii( "com.sun.star.system.SystemShellExecute" )), UNO_QUERY );
if ( xSystemShellExecute.is() )
- {
+ {
try
-
+
{
xSystemShellExecute->execute( sURL, ::rtl::OUString(), SystemShellExecuteFlags::DEFAULTS );
- }
+ }
catch( Exception& rEx )
{
(void)rEx;
- }
+ }
}
}
else if ( !aURL.Path.compareToAscii("Command2" ) )
@@ -319,7 +319,7 @@ void SAL_CALL BaseDispatch::dispatch( const URL& aURL, const Sequence < Property
aCmdURL.Path = rtl::OUString::createFromAscii( "Command2" );
aCmdURL.Protocol = rtl::OUString::createFromAscii( "vnd.demo.complextoolbarcontrols.demoaddon:" );
aCmdURL.Complete = aCmdURL.Path + aCmdURL.Protocol;
-
+
// set the selected item as text into the combobox
Sequence< NamedValue > aArgs( 1 );
aArgs[0].Name = rtl::OUString::createFromAscii( "Text" );
@@ -338,9 +338,9 @@ void SAL_CALL BaseDispatch::dispatch( const URL& aURL, const Sequence < Property
break;
}
}
-
+
// just enable this command
-
+
// set enable flag according to selection
if ( aText.equalsAscii( "Button Disabled" ))
mbButtonEnabled = sal_False;
@@ -352,7 +352,7 @@ void SAL_CALL BaseDispatch::dispatch( const URL& aURL, const Sequence < Property
aCmdURL.Path = rtl::OUString::createFromAscii( "Command1" );
aCmdURL.Protocol = rtl::OUString::createFromAscii( "vnd.demo.complextoolbarcontrols.demoaddon:" );
aCmdURL.Complete = aCmdURL.Path + aCmdURL.Protocol;
-
+
// create and initialize FeatureStateEvent with IsEnabled
::com::sun::star::frame::FeatureStateEvent aEvent;
aEvent.FeatureURL = aCmdURL;
@@ -360,10 +360,10 @@ void SAL_CALL BaseDispatch::dispatch( const URL& aURL, const Sequence < Property
aEvent.IsEnabled = mbButtonEnabled;
aEvent.Requery = sal_False;
aEvent.State <<= Any();
-
+
// Notify listener about new state
Reference < XDispatch > xDispatch = aListenerHelper.GetDispatch( mxFrame, aURL.Path );
- aListenerHelper.Notify( mxFrame, aEvent.FeatureURL.Path, aEvent );
+ aListenerHelper.Notify( mxFrame, aEvent.FeatureURL.Path, aEvent );
}
else if ( !aURL.Path.compareToAscii("Command5" ) )
{
@@ -403,20 +403,20 @@ void SAL_CALL BaseDispatch::addStatusListener( const Reference< XStatusListener
// where the user can select the last issued command easily.
// E.g. a typical command group would be "Insert shape"
Sequence< NamedValue > aArgs( 1 );
-
+
// send command to set context menu content
Sequence< rtl::OUString > aContextMenu( 3 );
aContextMenu[0] = rtl::OUString::createFromAscii( "Command 1" );
aContextMenu[1] = rtl::OUString::createFromAscii( "Command 2" );
aContextMenu[2] = rtl::OUString::createFromAscii( "Command 3" );
-
+
aArgs[0].Name = rtl::OUString::createFromAscii( "List" );
aArgs[0].Value <<= aContextMenu;
SendCommandTo( xControl, aURL, rtl::OUString::createFromAscii( "SetList" ), aArgs, sal_True );
-
+
// send command to check item on pos=0
aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Pos" ));
- aArgs[0].Value <<= sal_Int32( 0 );
+ aArgs[0].Value <<= sal_Int32( 0 );
SendCommandTo( xControl, aURL, ::rtl::OUString::createFromAscii( "CheckItemPos" ), aArgs, sal_True );
}
else if ( aURL.Path.equalsAscii("Command4" ) )
@@ -425,19 +425,19 @@ void SAL_CALL BaseDispatch::addStatusListener( const Reference< XStatusListener
// the user can only select one. The modes cannot be combined.
// E.g. a typical group would be left,right,center,block.
Sequence< NamedValue > aArgs( 1 );
-
+
// send command to set context menu content
Sequence< rtl::OUString > aContextMenu( 2 );
aContextMenu[0] = rtl::OUString::createFromAscii( "Button Enabled" );
aContextMenu[1] = rtl::OUString::createFromAscii( "Button Disabled" );
-
+
aArgs[0].Name = rtl::OUString::createFromAscii( "List" );
aArgs[0].Value <<= aContextMenu;
- SendCommandTo( xControl, aURL, rtl::OUString::createFromAscii( "SetList" ), aArgs, sal_True );
+ SendCommandTo( xControl, aURL, rtl::OUString::createFromAscii( "SetList" ), aArgs, sal_True );
// set position according to enable/disable state of button
sal_Int32 nPos( mbButtonEnabled ? 0 : 1 );
-
+
// send command to check item on pos=0
aArgs[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Pos" ));
aArgs[0].Value <<= nPos;
@@ -447,7 +447,7 @@ void SAL_CALL BaseDispatch::addStatusListener( const Reference< XStatusListener
{
// A spin button
Sequence< NamedValue > aArgs( 5 );
-
+
// send command to initialize spin button
aArgs[0].Name = rtl::OUString::createFromAscii( "Value" );
aArgs[0].Value <<= double( 0.0 );
@@ -467,7 +467,7 @@ void SAL_CALL BaseDispatch::addStatusListener( const Reference< XStatusListener
// A dropdown box is normally used for a group of commands
// where the user can select one of a defined set.
Sequence< NamedValue > aArgs( 1 );
-
+
// send command to set context menu content
Sequence< rtl::OUString > aList( 10 );
aList[0] = rtl::OUString::createFromAscii( "White" );
@@ -480,7 +480,7 @@ void SAL_CALL BaseDispatch::addStatusListener( const Reference< XStatusListener
aList[7] = rtl::OUString::createFromAscii( "Orange" );
aList[8] = rtl::OUString::createFromAscii( "Brown" );
aList[9] = rtl::OUString::createFromAscii( "Pink" );
-
+
aArgs[0].Name = rtl::OUString::createFromAscii( "List" );
aArgs[0].Value <<= aList;
SendCommandTo( xControl, aURL, rtl::OUString::createFromAscii( "SetList" ), aArgs, sal_True );
@@ -515,14 +515,14 @@ void SAL_CALL BaseDispatch::controlEvent( const ControlEvent& Event ) throw (Run
break;
}
}
-
+
if ( bHasText )
maComboBoxText = aNewText;
}
}
}
}
-
+
BaseDispatch::BaseDispatch( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const ::rtl::OUString& rServiceName )
: mxMSF( rxMSF )
diff --git a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.h b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.h
index 747514272fed..3ffae431c0af 100644
--- a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.h
+++ b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.h
@@ -49,7 +49,7 @@ public:
// XDispatchProvider
virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >
- SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL,
+ SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL,
const ::rtl::OUString& sTargetFrameName, sal_Int32 nSearchFlags )
throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence < ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > >
@@ -115,10 +115,10 @@ public:
const ::com::sun::star::util::URL& aURL ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl,
const ::com::sun::star::util::URL& aURL ) throw (::com::sun::star::uno::RuntimeException);
-
+
// XControlNotificationListener
- virtual void SAL_CALL controlEvent( const ::com::sun::star::frame::ControlEvent& Event )
- throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL controlEvent( const ::com::sun::star::frame::ControlEvent& Event )
+ throw (::com::sun::star::uno::RuntimeException);
};
class WriterDispatch : public BaseDispatch
diff --git a/odk/examples/cpp/complextoolbarcontrols/WriterListener.cxx b/odk/examples/cpp/complextoolbarcontrols/WriterListener.cxx
index a45e217248d6..2d41f12d8899 100644
--- a/odk/examples/cpp/complextoolbarcontrols/WriterListener.cxx
+++ b/odk/examples/cpp/complextoolbarcontrols/WriterListener.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/cpp/complextoolbarcontrols/exports.cxx b/odk/examples/cpp/complextoolbarcontrols/exports.cxx
index 1a850cfd7458..b4e49b5bda66 100644
--- a/odk/examples/cpp/complextoolbarcontrols/exports.cxx
+++ b/odk/examples/cpp/complextoolbarcontrols/exports.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/examples/cpp/counter/XCountable.idl b/odk/examples/cpp/counter/XCountable.idl
index 290a134b2c0a..2df69c914b0d 100644
--- a/odk/examples/cpp/counter/XCountable.idl
+++ b/odk/examples/cpp/counter/XCountable.idl
@@ -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.
- *
+ *
*************************************************************************/
#include <com/sun/star/uno/XInterface.idl>
@@ -46,7 +46,7 @@ module foo
long increment();
long decrement();
};
-
+
service Counter
{
// exported interfaces:
diff --git a/odk/examples/cpp/counter/counter.cxx b/odk/examples/cpp/counter/counter.cxx
index e2c714de5398..8e5c341ca4cf 100644
--- a/odk/examples/cpp/counter/counter.cxx
+++ b/odk/examples/cpp/counter/counter.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,14 +30,14 @@
* 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.
- *
+ *
*************************************************************************/
/*************************************************************************
*************************************************************************
*
- * service implementation: foo.Counter
- * exported interfaces: foo.XCounter
+ * service implementation: foo.Counter
+ * exported interfaces: foo.XCounter
*
* simple example component implementing a counter
*
@@ -56,7 +56,7 @@
#include <foo/XCountable.hpp>
#define SERVICENAME "foo.Counter"
-#define IMPLNAME "com.sun.star.comp.example.cpp.Counter"
+#define IMPLNAME "com.sun.star.comp.example.cpp.Counter"
using namespace ::rtl;
using namespace ::osl;
@@ -74,10 +74,10 @@ class MyCounterImpl
{
// to obtain other services if needed
Reference< XMultiServiceFactory > m_xServiceManager;
-
+
sal_Int32 m_nRefCount;
sal_Int32 m_nCount;
-
+
public:
MyCounterImpl( const Reference< XMultiServiceFactory > & xServiceManager )
: m_xServiceManager( xServiceManager ), m_nRefCount( 0 )
@@ -91,12 +91,12 @@ public:
virtual void SAL_CALL release() throw ()
{ if (! --m_nRefCount) delete this; }
virtual Any SAL_CALL queryInterface( const Type & rType ) throw (RuntimeException)
- { return cppu::queryInterface(rType,
+ { return cppu::queryInterface(rType,
static_cast< XInterface* >( static_cast< XServiceInfo* >( this ) ),
static_cast< XCountable* >( this ),
static_cast< XServiceInfo* >( this ) ); }
- // XServiceInfo implementation
+ // XServiceInfo implementation
virtual OUString SAL_CALL getImplementationName( ) throw(RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(RuntimeException);
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(RuntimeException);
@@ -114,14 +114,14 @@ public:
};
//*************************************************************************
-OUString SAL_CALL MyCounterImpl::getImplementationName( )
+OUString SAL_CALL MyCounterImpl::getImplementationName( )
throw(RuntimeException)
{
return OUString( RTL_CONSTASCII_USTRINGPARAM(IMPLNAME) );
-}
+}
//*************************************************************************
-sal_Bool SAL_CALL MyCounterImpl::supportsService( const OUString& ServiceName )
+sal_Bool SAL_CALL MyCounterImpl::supportsService( const OUString& ServiceName )
throw(RuntimeException)
{
Sequence< OUString > aSNL = getSupportedServiceNames();
@@ -130,21 +130,21 @@ sal_Bool SAL_CALL MyCounterImpl::supportsService( const OUString& ServiceName )
if( pArray[i] == ServiceName )
return sal_True;
return sal_False;
-}
+}
//*************************************************************************
-Sequence<OUString> SAL_CALL MyCounterImpl::getSupportedServiceNames( )
+Sequence<OUString> SAL_CALL MyCounterImpl::getSupportedServiceNames( )
throw(RuntimeException)
{
return getSupportedServiceNames_Static();
-}
+}
//*************************************************************************
-Sequence<OUString> SAL_CALL MyCounterImpl::getSupportedServiceNames_Static( )
+Sequence<OUString> SAL_CALL MyCounterImpl::getSupportedServiceNames_Static( )
{
OUString aName( RTL_CONSTASCII_USTRINGPARAM(SERVICENAME) );
return Sequence< OUString >( &aName, 1 );
-}
+}
@@ -191,13 +191,13 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *
Reference< XRegistryKey > xNewKey(
reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLNAME "/UNO/SERVICES") ) ) );
-
+
const Sequence< OUString > & rSNL =
MyCounterImpl::getSupportedServiceNames_Static();
const OUString * pArray = rSNL.getConstArray();
for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
xNewKey->createKey( pArray[nPos] );
-
+
return sal_True;
}
catch (InvalidRegistryException &)
@@ -214,12 +214,12 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *
* @param pImplName name of implementation
* @param pServiceManager a service manager, need for component creation
* @param pRegistryKey the registry key for this component, need for persistent data
- * @return a component factory
+ * @return a component factory
*/
extern "C" void * SAL_CALL component_getFactory(const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey)
{
void * pRet = 0;
-
+
if (rtl_str_compare( pImplName, IMPLNAME ) == 0)
{
Reference< XSingleServiceFactory > xFactory( createSingleFactory(
@@ -227,14 +227,14 @@ extern "C" void * SAL_CALL component_getFactory(const sal_Char * pImplName, void
OUString( RTL_CONSTASCII_USTRINGPARAM(IMPLNAME) ),
MyCounterImpl_create,
MyCounterImpl::getSupportedServiceNames_Static() ) );
-
+
if (xFactory.is())
{
xFactory->acquire();
pRet = xFactory.get();
}
}
-
+
return pRet;
}
diff --git a/odk/examples/cpp/counter/countermain.cxx b/odk/examples/cpp/counter/countermain.cxx
index 9473ff01d1ae..99fcb7e0321c 100644
--- a/odk/examples/cpp/counter/countermain.cxx
+++ b/odk/examples/cpp/counter/countermain.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.
- *
+ *
*************************************************************************/
/*************************************************************************
@@ -69,7 +69,7 @@ using namespace ::rtl;
//=======================================================================
SAL_IMPLEMENT_MAIN()
{
- Reference< XSimpleRegistry > xReg = createSimpleRegistry();
+ Reference< XSimpleRegistry > xReg = createSimpleRegistry();
OSL_ENSURE( xReg.is(), "### cannot get service instance of \"com.sun.star.regiystry.SimpleRegistry\"!" );
xReg->open(OUString::createFromAscii("counter.uno.rdb"), sal_False, sal_False);
@@ -92,17 +92,17 @@ SAL_IMPLEMENT_MAIN()
OUString::createFromAscii("com.sun.star.loader.SharedLibrary"), // loader for component
#ifdef UNX
#ifdef MACOSX
- OUString::createFromAscii("counter.uno.dylib"), // component location
+ OUString::createFromAscii("counter.uno.dylib"), // component location
#else
- OUString::createFromAscii("counter.uno.so"), // component location
+ OUString::createFromAscii("counter.uno.so"), // component location
#endif
#else
- OUString::createFromAscii("counter.uno.dll"), // component location
+ OUString::createFromAscii("counter.uno.dll"), // component location
#endif
- Reference< XSimpleRegistry >() // registry omitted,
+ Reference< XSimpleRegistry >() // registry omitted,
// defaulting to service manager registry used
);
-
+
// get a counter instance
Reference< XInterface > xx ;
xx = xMgr->createInstanceWithContext(OUString::createFromAscii("foo.Counter"), xContext);
diff --git a/odk/examples/cpp/remoteclient/remoteclient.cxx b/odk/examples/cpp/remoteclient/remoteclient.cxx
index 47d83d1558f4..960f84ed04ab 100644
--- a/odk/examples/cpp/remoteclient/remoteclient.cxx
+++ b/odk/examples/cpp/remoteclient/remoteclient.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>
@@ -78,7 +78,7 @@ public: // Methods
virtual sal_Int32 SAL_CALL run( const Sequence< OUString >& aArguments )
throw(RuntimeException);
-
+
private: // helper methods
void testPipe( const Reference < XInterface > & rComponent );
Reference< XMultiServiceFactory > m_xSMgr;
@@ -107,8 +107,8 @@ void PipeClientMain::testPipe( const Reference< XInterface > & rxInterface )
printf( "error : Couldn't read the expected number of bytes\n" );
return;
}
-
- if( seqRead.getConstArray()[0] != 5 ||
+
+ if( seqRead.getConstArray()[0] != 5 ||
seqRead.getConstArray()[1] != 4 ||
seqRead.getConstArray()[2] != 3 )
{
@@ -191,7 +191,7 @@ sal_Int32 PipeClientMain::run( const Sequence< OUString > & aArguments ) throw (
}
else
{
- printf( "usage: (uno remoteclient-component --) uno-url\n"
+ printf( "usage: (uno remoteclient-component --) uno-url\n"
"e.g.: uno:socket,host=localhost,port=2083;urp;MyPipe\n" );
return 1;
}
@@ -244,12 +244,12 @@ sal_Bool SAL_CALL component_writeInfo(
Reference< XRegistryKey > xNewKey(
reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey(
OUString::createFromAscii( "/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) );
-
+
const Sequence< OUString > & rSNL = getSupportedServiceNames();
const OUString * pArray = rSNL.getConstArray();
for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
xNewKey->createKey( pArray[nPos] );
-
+
return sal_True;
}
catch (InvalidRegistryException &)
@@ -264,21 +264,21 @@ void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
void * pRet = 0;
-
+
if (pServiceManager && rtl_str_compare( pImplName, IMPLEMENTATION_NAME ) == 0)
{
Reference< XSingleServiceFactory > xFactory( createSingleFactory(
reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
OUString::createFromAscii( pImplName ),
CreateInstance, getSupportedServiceNames() ) );
-
+
if (xFactory.is())
{
xFactory->acquire();
pRet = xFactory.get();
}
}
-
+
return pRet;
}
}
diff --git a/odk/examples/java/ConverterServlet/ConverterServlet.java b/odk/examples/java/ConverterServlet/ConverterServlet.java
index 84279fab1016..281b47db370c 100644
--- a/odk/examples/java/ConverterServlet/ConverterServlet.java
+++ b/odk/examples/java/ConverterServlet/ConverterServlet.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.
- *
+ *
*************************************************************************/
// JDK API
@@ -71,18 +71,18 @@ import com.sun.star.lang.XMultiComponentFactory;
*/
public class ConverterServlet extends HttpServlet {
/** Specifies the temporary directory on the web server.
- */
- private String stringWorkingDirectory =
+ */
+ private String stringWorkingDirectory =
System.getProperty( "java.io.tmpdir" ).replace( '\\', '/' );
-
+
/** Specifies the host for the office server.
- */
+ */
private String stringHost = "localhost";
-
+
/** Specifies the port for the office server.
- */
+ */
private String stringPort = "2083";
-
+
/** Called by the server (via the service method) to allow a servlet to handle
* a POST request. The file from the client will be uploaded to the web server
* and converted on the web server and after all pushed to the client.
@@ -90,7 +90,7 @@ public class ConverterServlet extends HttpServlet {
* @param response Object that contains the response the servlet sends to the client.
* @throws ServletException If the request for the POST could not be handled.
* @throws IOException If an input or output error is detected when the servlet handles the request.
- */
+ */
protected void doPost( HttpServletRequest request,
HttpServletResponse response) throws ServletException, java.io.IOException {
try {
@@ -98,35 +98,35 @@ public class ConverterServlet extends HttpServlet {
if ( !stringWorkingDirectory.endsWith( "/" ) ) {
stringWorkingDirectory += "/";
}
-
+
// Construct a MultipartRequest to help read the information.
// Pass in the request, a directory to save files to, and the
// maximum POST size we should attempt to handle.
MultipartRequest multipartrequest =
new MultipartRequest( request, stringWorkingDirectory, 5 * 1024 * 1024 );
-
+
// Getting all file names from the request
Enumeration files = multipartrequest.getFileNames();
-
+
// Every received file will be converted to the specified type
while (files.hasMoreElements()) {
// Getting the name from the element
String stringName = (String)files.nextElement();
-
+
// Getting the filename from the request
String stringFilename =
multipartrequest.getFilesystemName( stringName );
-
+
// Converting the given file on the server to the specified type and
// append a special extension
File cleanupFile = null;
String stringSourceFile = stringWorkingDirectory + stringFilename;
-
+
try {
String stringConvertedFile = convertDocument(stringSourceFile,
multipartrequest.getParameter( "converttype" ),
multipartrequest.getParameter( "extension" ));
-
+
String shortFileName = stringConvertedFile.substring(
stringConvertedFile.lastIndexOf('/') + 1);
@@ -134,10 +134,10 @@ public class ConverterServlet extends HttpServlet {
// Set the filename, is used when the file will be saved (problem with mozilla)
response.addHeader( "Content-Disposition",
"attachment; filename=" + shortFileName);
-
+
// Constructing the multi part response to the client
MultipartResponse multipartresponse = new MultipartResponse(response);
-
+
// Is the convert type HTML?
if ( ( multipartrequest.getParameter( "converttype" ).equals(
"swriter: HTML (StarWriter)" ) )
@@ -152,35 +152,35 @@ public class ConverterServlet extends HttpServlet {
// at the client in order to save the converted file
multipartresponse.startResponse( "application/octet-stream" );
}
-
+
// Pushing the converted file to the client
ServletUtils.returnFile( stringConvertedFile,
response.getOutputStream() );
-
+
// Finishing the multi part response
multipartresponse.finish();
-
+
// clean up the working directory
cleanupFile = new File(stringConvertedFile);
if ( cleanupFile.exists() )
cleanupFile.delete();
-
+
} catch (Exception exc) {
response.setContentType( "text/html;charset=8859-1" );
PrintWriter out = response.getWriter();
exc.printStackTrace();
-
+
out.println( "<html><head>" );
out.println( " <title>" + "SDK Converter Servlet" + "</title>" );
out.println( "</head>" );
- out.println( "<body><br><p>");
+ out.println( "<body><br><p>");
out.println( "<b>Sorry, the conversion failed!</b></p>");
out.println( "<p><b>Error Mesage:</b><br>" + exc.getMessage() + "<br>");
exc.printStackTrace(out);
out.println( "</p></body><html>");
}
-
+
// clean up the working directory
cleanupFile = new File(stringSourceFile);
if ( cleanupFile.exists() )
@@ -191,7 +191,7 @@ public class ConverterServlet extends HttpServlet {
System.err.println( exception.toString() );
}
}
-
+
/** This method converts a document to a given type by using a running
* OpenOffice.org and saves the converted document to the specified
* working directory.
@@ -200,64 +200,64 @@ public class ConverterServlet extends HttpServlet {
* @param stringExtension This string will be appended to the file name of the converted file.
* @return The full path name of the converted file will be returned.
* @see stringWorkingDirectory
- */
+ */
private String convertDocument( String stringDocumentName,
String stringConvertType,
String stringExtension)
throws Exception
{
String stringConvertedFile = "";
-
+
// Converting the document to the favoured type
// try {
// Composing the URL
String stringUrl = "file:///" + stringDocumentName;
-
+
/* Bootstraps a component context with the jurt base components
registered. Component context to be granted to a component for running.
Arbitrary values can be retrieved from the context. */
XComponentContext xcomponentcontext =
com.sun.star.comp.helper.Bootstrap.createInitialComponentContext( null );
-
+
/* Gets the service manager instance to be used (or null). This method has
been added for convenience, because the service manager is a often used
object. */
XMultiComponentFactory xmulticomponentfactory =
xcomponentcontext.getServiceManager();
-
+
/* Creates an instance of the component UnoUrlResolver which
supports the services specified by the factory. */
Object objectUrlResolver =
xmulticomponentfactory.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", xcomponentcontext );
-
+
// Create a new url resolver
XUnoUrlResolver xurlresolver = ( XUnoUrlResolver )
UnoRuntime.queryInterface( XUnoUrlResolver.class,
objectUrlResolver );
-
+
// Resolves an object that is specified as follow:
// uno:<connection description>;<protocol description>;<initial object name>
Object objectInitial = xurlresolver.resolve(
"uno:socket,host=" + stringHost + ",port=" + stringPort +
";urp;StarOffice.ServiceManager" );
-
+
// Create a service manager from the initial object
xmulticomponentfactory = ( XMultiComponentFactory )
UnoRuntime.queryInterface( XMultiComponentFactory.class, objectInitial );
-
+
// Query for the XPropertySet interface.
XPropertySet xpropertysetMultiComponentFactory = ( XPropertySet )
UnoRuntime.queryInterface( XPropertySet.class, xmulticomponentfactory );
-
+
// Get the default context from the office server.
Object objectDefaultContext =
xpropertysetMultiComponentFactory.getPropertyValue( "DefaultContext" );
-
+
// Query for the interface XComponentContext.
xcomponentcontext = ( XComponentContext ) UnoRuntime.queryInterface(
XComponentContext.class, objectDefaultContext );
-
+
/* A desktop environment contains tasks with one or more
frames in which components can be loaded. Desktop is the
environment for components which can instanciate within
@@ -266,24 +266,24 @@ public class ConverterServlet extends HttpServlet {
UnoRuntime.queryInterface( XComponentLoader.class,
xmulticomponentfactory.createInstanceWithContext(
"com.sun.star.frame.Desktop", xcomponentcontext ) );
-
+
// Preparing properties for loading the document
PropertyValue propertyvalue[] = new PropertyValue[ 1 ];
// Setting the flag for hidding the open document
propertyvalue[ 0 ] = new PropertyValue();
propertyvalue[ 0 ].Name = "Hidden";
propertyvalue[ 0 ].Value = new Boolean(true);
-
+
// Loading the wanted document
Object objectDocumentToStore =
xcomponentloader.loadComponentFromURL(
stringUrl, "_blank", 0, propertyvalue );
-
+
// Getting an object that will offer a simple way to store a document to a URL.
XStorable xstorable =
( XStorable ) UnoRuntime.queryInterface( XStorable.class,
objectDocumentToStore );
-
+
// Preparing properties for converting the document
propertyvalue = new PropertyValue[ 2 ];
// Setting the flag for overwriting
@@ -294,20 +294,20 @@ public class ConverterServlet extends HttpServlet {
propertyvalue[ 1 ] = new PropertyValue();
propertyvalue[ 1 ].Name = "FilterName";
propertyvalue[ 1 ].Value = stringConvertType;
-
+
// Appending the favoured extension to the origin document name
int index = stringUrl.lastIndexOf('.');
if ( index >= 0 ) {
stringConvertedFile = stringUrl.substring(0, index) + "." + stringExtension;
- } else {
+ } else {
stringConvertedFile = stringUrl + "." + stringExtension;
}
-
+
// Storing and converting the document
xstorable.storeAsURL( stringConvertedFile, propertyvalue );
-
+
XCloseable xcloseable = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,xstorable );
-
+
// Closing the converted document
if ( xcloseable != null )
xcloseable.close(false);
@@ -318,18 +318,18 @@ public class ConverterServlet extends HttpServlet {
XComponent.class, xstorable );
xComponent.dispose();
}
-
+
// }
// catch( Exception exception ) {
// exception.printStackTrace();
// return( "" );
// }
-
+
if ( stringConvertedFile.startsWith( "file:///" ) ) {
// Truncating the beginning of the file name
stringConvertedFile = stringConvertedFile.substring( 8 );
}
-
+
// Returning the name of the converted file
return stringConvertedFile;
}
diff --git a/odk/examples/java/DocumentHandling/DocumentConverter.java b/odk/examples/java/DocumentHandling/DocumentConverter.java
index 69ded5e24f45..97d407935501 100644
--- a/odk/examples/java/DocumentHandling/DocumentConverter.java
+++ b/odk/examples/java/DocumentHandling/DocumentConverter.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;
@@ -59,7 +59,7 @@ public class DocumentConverter {
/** Containing the directory where the converted files are saved
*/
static String sOutputDir = "";
-
+
/** Traversing the given directory recursively and converting their files to
* the favoured type if possible
* @param fileDirectory Containing the directory
@@ -75,17 +75,17 @@ public class DocumentConverter {
// Prepare Url for the output directory
File outdir = new File(DocumentConverter.sOutputDir);
String sOutUrl = "file:///" + outdir.getAbsolutePath().replace( '\\', '/' );
-
+
System.out.println("\nThe converted documents will stored in \""
+ outdir.getPath() + "!");
-
+
System.out.println(sIndent + "[" + fileDirectory.getName() + "]");
sIndent += " ";
-
+
// Getting all files and directories in the current directory
File[] entries = fileDirectory.listFiles();
-
+
// Iterating for each file and directory
for ( int i = 0; i < entries.length; ++i ) {
// Testing, if the entry in the list is a directory
@@ -98,7 +98,7 @@ public class DocumentConverter {
// Composing the URL by replacing all backslashs
String sUrl = "file:///"
+ entries[ i ].getAbsolutePath().replace( '\\', '/' );
-
+
// Loading the wanted document
com.sun.star.beans.PropertyValue propertyValues[] =
new com.sun.star.beans.PropertyValue[1];
@@ -109,13 +109,13 @@ public class DocumentConverter {
Object oDocToStore =
DocumentConverter.xCompLoader.loadComponentFromURL(
sUrl, "_blank", 0, propertyValues);
-
+
// Getting an object that will offer a simple way to store
// a document to a URL.
com.sun.star.frame.XStorable xStorable =
(com.sun.star.frame.XStorable)UnoRuntime.queryInterface(
com.sun.star.frame.XStorable.class, oDocToStore );
-
+
// Preparing properties for converting the document
propertyValues = new com.sun.star.beans.PropertyValue[2];
// Setting the flag for overwriting
@@ -126,16 +126,16 @@ public class DocumentConverter {
propertyValues[1] = new com.sun.star.beans.PropertyValue();
propertyValues[1].Name = "FilterName";
propertyValues[1].Value = DocumentConverter.sConvertType;
-
+
// Appending the favoured extension to the origin document name
int index1 = sUrl.lastIndexOf('/');
- int index2 = sUrl.lastIndexOf('.');
+ int index2 = sUrl.lastIndexOf('.');
String sStoreUrl = sOutUrl + sUrl.substring(index1, index2 + 1)
+ DocumentConverter.sExtension;
-
+
// Storing and converting the document
xStorable.storeAsURL(sStoreUrl, propertyValues);
-
+
// Closing the converted document. Use XCloseable.clsoe if the
// interface is supported, otherwise use XComponent.dispose
com.sun.star.util.XCloseable xCloseable =
@@ -148,21 +148,21 @@ public class DocumentConverter {
com.sun.star.lang.XComponent xComp =
(com.sun.star.lang.XComponent)UnoRuntime.queryInterface(
com.sun.star.lang.XComponent.class, xStorable);
-
+
xComp.dispose();
}
}
catch( Exception e ) {
- e.printStackTrace(System.err);
+ e.printStackTrace(System.err);
}
-
+
System.out.println(sIndent + entries[ i ].getName());
}
}
-
+
sIndent = sIndent.substring(2);
}
-
+
/** Bootstrap UNO, getting the remote component context, getting a new instance
* of the desktop (used interface XComponentLoader) and calling the
* static method traverse
@@ -180,9 +180,9 @@ public class DocumentConverter {
"\"c:/myoffice\" \"swriter: MS Word 97\" \"doc\"");
System.exit(1);
}
-
+
com.sun.star.uno.XComponentContext xContext = null;
-
+
try {
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
@@ -191,35 +191,35 @@ public class DocumentConverter {
// get the remote office service manager
com.sun.star.lang.XMultiComponentFactory xMCF =
xContext.getServiceManager();
-
+
Object oDesktop = xMCF.createInstanceWithContext(
"com.sun.star.frame.Desktop", xContext);
-
+
xCompLoader = (com.sun.star.frame.XComponentLoader)
UnoRuntime.queryInterface(com.sun.star.frame.XComponentLoader.class,
oDesktop);
-
+
// Getting the given starting directory
File file = new File(args[0]);
-
+
// Getting the given type to convert to
sConvertType = args[1];
-
+
// Getting the given extension that should be appended to the
// origin document
sExtension = args[2];
-
+
// Getting the given type to convert to
sOutputDir = args[3];
// Starting the conversion of documents in the given directory
// and subdirectories
traverse(file);
-
+
System.exit(0);
} catch( Exception e ) {
e.printStackTrace(System.err);
- System.exit(1);
+ System.exit(1);
}
}
}
diff --git a/odk/examples/java/DocumentHandling/DocumentLoader.java b/odk/examples/java/DocumentHandling/DocumentLoader.java
index 8185cbf6da5f..a5a7fb5fc730 100644
--- a/odk/examples/java/DocumentHandling/DocumentLoader.java
+++ b/odk/examples/java/DocumentHandling/DocumentLoader.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;
@@ -47,21 +47,21 @@ public class DocumentLoader {
"java -jar DocumentLoader.jar \"private:factory/swriter\"" );
System.exit(1);
}
-
+
com.sun.star.uno.XComponentContext xContext = null;
try {
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
System.out.println("Connected to a running office ...");
-
+
// get the remote office service manager
com.sun.star.lang.XMultiComponentFactory xMCF =
xContext.getServiceManager();
-
+
Object oDesktop = xMCF.createInstanceWithContext(
"com.sun.star.frame.Desktop", xContext);
-
+
com.sun.star.frame.XComponentLoader xCompLoader =
(com.sun.star.frame.XComponentLoader)
UnoRuntime.queryInterface(
@@ -73,8 +73,8 @@ public class DocumentLoader {
StringBuffer sbTmp = new StringBuffer("file:///");
sbTmp.append(sourceFile.getCanonicalPath().replace('\\', '/'));
sUrl = sbTmp.toString();
- }
-
+ }
+
// Load a Writer document, which will be automaticly displayed
com.sun.star.lang.XComponent xComp = xCompLoader.loadComponentFromURL(
sUrl, "_blank", 0, new com.sun.star.beans.PropertyValue[0]);
diff --git a/odk/examples/java/DocumentHandling/DocumentPrinter.java b/odk/examples/java/DocumentHandling/DocumentPrinter.java
index e6a7a1430d4e..3331f43f809a 100644
--- a/odk/examples/java/DocumentHandling/DocumentPrinter.java
+++ b/odk/examples/java/DocumentHandling/DocumentPrinter.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;
@@ -56,10 +56,10 @@ public class DocumentPrinter {
// get the remote office service manager
com.sun.star.lang.XMultiComponentFactory xMCF =
xContext.getServiceManager();
-
+
Object oDesktop = xMCF.createInstanceWithContext(
"com.sun.star.frame.Desktop", xContext);
-
+
com.sun.star.frame.XComponentLoader xCompLoader =
(com.sun.star.frame.XComponentLoader)
UnoRuntime.queryInterface(
@@ -68,17 +68,17 @@ public class DocumentPrinter {
java.io.File sourceFile = new java.io.File(args[1]);
StringBuffer sUrl = new StringBuffer("file:///");
sUrl.append(sourceFile.getCanonicalPath().replace('\\', '/'));
-
+
// Load a Writer document, which will be automaticly displayed
com.sun.star.lang.XComponent xComp = xCompLoader.loadComponentFromURL(
sUrl.toString(), "_blank", 0,
new com.sun.star.beans.PropertyValue[0] );
-
+
// Querying for the interface XPrintable on the loaded document
com.sun.star.view.XPrintable xPrintable =
(com.sun.star.view.XPrintable)UnoRuntime.queryInterface(
com.sun.star.view.XPrintable.class, xComp);
-
+
// Setting the property "Name" for the favoured printer (name of
// IP address)
com.sun.star.beans.PropertyValue propertyValue[] =
@@ -86,19 +86,19 @@ public class DocumentPrinter {
propertyValue[0] = new com.sun.star.beans.PropertyValue();
propertyValue[0].Name = "Name";
propertyValue[0].Value = args[ 0 ];
-
+
// Setting the name of the printer
xPrintable.setPrinter( propertyValue );
-
+
// Setting the property "Pages" so that only the desired pages
// will be printed.
propertyValue[0] = new com.sun.star.beans.PropertyValue();
propertyValue[0].Name = "Pages";
propertyValue[0].Value = args[ 2 ];
-
+
// Printing the loaded document
xPrintable.print( propertyValue );
-
+
System.exit(0);
}
catch( Exception e ) {
diff --git a/odk/examples/java/DocumentHandling/DocumentSaver.java b/odk/examples/java/DocumentHandling/DocumentSaver.java
index f6f21ea48228..93d6231a4b44 100644
--- a/odk/examples/java/DocumentHandling/DocumentSaver.java
+++ b/odk/examples/java/DocumentHandling/DocumentSaver.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 @@ public class DocumentSaver {
* @param args The program needs two arguments:
* - full file name to open,
* - full file name to save.
- */
+ */
public static void main(String args[]) {
if ( args.length < 2 ) {
System.out.println("usage: java -jar DocumentSaver.jar" +
@@ -66,10 +66,10 @@ public class DocumentSaver {
// get the remote office service manager
com.sun.star.lang.XMultiComponentFactory xMCF =
xContext.getServiceManager();
-
+
Object oDesktop = xMCF.createInstanceWithContext(
"com.sun.star.frame.Desktop", xContext);
-
+
com.sun.star.frame.XComponentLoader xCompLoader =
(com.sun.star.frame.XComponentLoader)
UnoRuntime.queryInterface(
@@ -88,7 +88,7 @@ public class DocumentSaver {
propertyValue[0] = new com.sun.star.beans.PropertyValue();
propertyValue[0].Name = "Hidden";
propertyValue[0].Value = new Boolean(true);
-
+
Object oDocToStore = xCompLoader.loadComponentFromURL(
sLoadUrl.toString(), "_blank", 0, propertyValue );
com.sun.star.frame.XStorable xStorable =
@@ -106,7 +106,7 @@ public class DocumentSaver {
System.out.println("\nDocument \"" + sLoadUrl + "\" saved under \"" +
sSaveUrl + "\"\n");
-
+
com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable)
UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class,
oDocToStore );
@@ -120,7 +120,7 @@ public class DocumentSaver {
com.sun.star.lang.XComponent.class, oDocToStore );
xComp.dispose();
}
- System.out.println("document closed!");
+ System.out.println("document closed!");
System.exit(0);
}
catch( Exception e ) {
diff --git a/odk/examples/java/Drawing/SDraw.java b/odk/examples/java/Drawing/SDraw.java
index dfb544e3db02..551689c5626b 100644
--- a/odk/examples/java/Drawing/SDraw.java
+++ b/odk/examples/java/Drawing/SDraw.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.
- *
+ *
*************************************************************************/
//***************************************************************************
@@ -44,16 +44,16 @@ import java.lang.Math;
import com.sun.star.uno.UnoRuntime;
public class SDraw {
-
-
+
+
public static void main(String args[]) {
-
+
//oooooooooooooooooooooooooooStep 1oooooooooooooooooooooooooooooooooooooooo
// bootstrap UNO and get the remote component context. The context can
// be used to get the service manager
//*************************************************************************
com.sun.star.uno.XComponentContext xContext = null;
-
+
try {
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
@@ -66,19 +66,19 @@ public class SDraw {
com.sun.star.lang.XComponent xDrawDoc = null;
com.sun.star.drawing.XDrawPage xDrawPage = null;
-
+
//oooooooooooooooooooooooooooStep 2oooooooooooooooooooooooooooooooooooooooo
// open an empty document. In this case it's a draw document.
// For this purpose an instance of com.sun.star.frame.Desktop
// is created. It's interface XDesktop provides the XComponentLoader,
// which is used to open the document via loadComponentFromURL
//*************************************************************************
-
- //Open document
- //Draw
+
+ //Open document
+ //Draw
System.out.println("Opening an empty Draw document ...");
xDrawDoc = openDraw(xContext);
-
+
//oooooooooooooooooooooooooooStep 3oooooooooooooooooooooooooooooooooooooooo
// get the drawpage an insert some shapes.
// the documents DrawPageSupplier supplies the DrawPage vi IndexAccess
@@ -86,8 +86,8 @@ public class SDraw {
// instance of the ShapeType and add it to the Shapes-container
// provided by the drawpage
//*************************************************************************
-
-
+
+
// get the drawpage of drawing here
try {
System.out.println( "getting Drawpage" );
@@ -104,9 +104,9 @@ public class SDraw {
System.err.println( "Couldn't create document"+ e );
e.printStackTrace(System.err);
}
-
+
createSequence(xDrawDoc, xDrawPage);
-
+
//put something on the drawpage
System.out.println( "inserting some Shapes" );
com.sun.star.drawing.XShapes xShapes = (com.sun.star.drawing.XShapes)
@@ -115,24 +115,24 @@ public class SDraw {
xShapes.add(createShape(xDrawDoc,2000,1500,1000,1000,"Line",0));
xShapes.add(createShape(xDrawDoc,3000,4500,15000,1000,"Ellipse",16711680));
xShapes.add(createShape(xDrawDoc,5000,3500,7500,5000,"Rectangle",6710932));
-
- //*************************************************************************
- System.out.println("done");
+
+ //*************************************************************************
+ System.out.println("done");
System.exit(0);
}
-
+
public static com.sun.star.lang.XComponent openDraw(
com.sun.star.uno.XComponentContext xContext)
{
com.sun.star.frame.XComponentLoader xCLoader;
com.sun.star.text.XTextDocument xDoc = null;
com.sun.star.lang.XComponent xComp = null;
-
+
try {
// get the remote office service manager
com.sun.star.lang.XMultiComponentFactory xMCF =
xContext.getServiceManager();
-
+
Object oDesktop = xMCF.createInstanceWithContext(
"com.sun.star.frame.Desktop", xContext);
@@ -143,15 +143,15 @@ public class SDraw {
new com.sun.star.beans.PropertyValue[0];
String strDoc = "private:factory/sdraw";
xComp = xCLoader.loadComponentFromURL(strDoc, "_blank", 0, szEmptyArgs);
-
- } catch(Exception e){
+
+ } catch(Exception e){
System.err.println(" Exception " + e);
e.printStackTrace(System.err);
- }
-
+ }
+
return xComp;
}
-
+
public static com.sun.star.drawing.XShape createShape(
com.sun.star.lang.XComponent xDocComp, int height, int width, int x,
int y, String kind, int col)
@@ -160,12 +160,12 @@ public class SDraw {
com.sun.star.awt.Size size = new com.sun.star.awt.Size();
com.sun.star.awt.Point position = new com.sun.star.awt.Point();
com.sun.star.drawing.XShape xShape = null;
-
+
//get MSF
com.sun.star.lang.XMultiServiceFactory xDocMSF =
(com.sun.star.lang.XMultiServiceFactory) UnoRuntime.queryInterface(
com.sun.star.lang.XMultiServiceFactory.class, xDocComp );
-
+
try {
Object oInt = xDocMSF.createInstance("com.sun.star.drawing."
+kind + "Shape");
@@ -177,26 +177,26 @@ public class SDraw {
position.Y = y;
xShape.setSize(size);
xShape.setPosition(position);
-
+
} catch ( Exception e ) {
System.err.println( "Couldn't create instance "+ e );
e.printStackTrace(System.err);
}
-
+
com.sun.star.beans.XPropertySet xSPS = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xShape);
-
- try {
- xSPS.setPropertyValue("FillColor", new Integer(col));
- } catch (Exception e) {
- System.err.println("Can't change colors " + e);
+
+ try {
+ xSPS.setPropertyValue("FillColor", new Integer(col));
+ } catch (Exception e) {
+ System.err.println("Can't change colors " + e);
e.printStackTrace(System.err);
- }
-
- return xShape;
+ }
+
+ return xShape;
}
-
+
public static com.sun.star.drawing.XShape createSequence(
com.sun.star.lang.XComponent xDocComp, com.sun.star.drawing.XDrawPage xDP)
{
@@ -213,12 +213,12 @@ public class SDraw {
int r = 40;
int g = 0;
int b = 80;
-
+
//get MSF
com.sun.star.lang.XMultiServiceFactory xDocMSF =
(com.sun.star.lang.XMultiServiceFactory)UnoRuntime.queryInterface(
com.sun.star.lang.XMultiServiceFactory.class, xDocComp );
-
+
for (int i=0; i<370; i=i+25) {
try{
oInt = xDocMSF.createInstance("com.sun.star.drawing.EllipseShape");
@@ -231,40 +231,40 @@ public class SDraw {
(new Float(y+(Math.sin((i*Math.PI)/180))*5000)).intValue();
xShape.setSize(size);
xShape.setPosition(position);
-
+
} catch ( Exception e ) {
// Some exception occures.FAILED
System.err.println( "Couldn't get Shape "+ e );
e.printStackTrace(System.err);
}
-
+
b=b+8;
-
+
com.sun.star.beans.XPropertySet xSPS = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class,
xShape);
-
- try {
+
+ try {
xSPS.setPropertyValue("FillColor", new Integer(getCol(r,g,b)));
xSPS.setPropertyValue("Shadow", new Boolean(true));
- } catch (Exception e) {
- System.err.println("Can't change colors " + e);
+ } catch (Exception e) {
+ System.err.println("Can't change colors " + e);
e.printStackTrace(System.err);
}
xShapes.add(xShape);
}
-
+
com.sun.star.drawing.XShapeGrouper xSGrouper =
(com.sun.star.drawing.XShapeGrouper)UnoRuntime.queryInterface(
com.sun.star.drawing.XShapeGrouper.class, xDP);
-
- xShape = xSGrouper.group(xShapes);
-
+
+ xShape = xSGrouper.group(xShapes);
+
return xShape;
}
-
- public static int getCol(int r, int g, int b) {
- return r*65536+g*256+b;
+
+ public static int getCol(int r, int g, int b) {
+ return r*65536+g*256+b;
}
}
diff --git a/odk/examples/java/EmbedDocument/Container1/EmbedContApp.java b/odk/examples/java/EmbedDocument/Container1/EmbedContApp.java
index d6fd81c2e55c..9e2ff4bdf113 100644
--- a/odk/examples/java/EmbedDocument/Container1/EmbedContApp.java
+++ b/odk/examples/java/EmbedDocument/Container1/EmbedContApp.java
@@ -49,16 +49,16 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
private String m_aLinkURI;
public EmbedContApp( Frame aFrame, XMultiServiceFactory xServiceFactory )
- {
+ {
m_aFrame = aFrame;
m_xServiceFactory = xServiceFactory;
}
-
- public void init()
+
+ public void init()
{
resize( 640, 480 );
- setBackground( Color.gray );
-
+ setBackground( Color.gray );
+
m_aToolkit = Toolkit.getDefaultToolkit();
// Get a menu bar.
@@ -83,10 +83,10 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
aItem = new SaveMenuItem();
m_aFileMenu.add( aItem );
-
+
aItem = new SaveAsMenuItem();
m_aFileMenu.add( aItem );
-
+
// Object menu
m_aObjectMenu = new Menu( "Object", true );
aMenuBar.add( m_aObjectMenu );
@@ -103,8 +103,8 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
aItem = new ConvertLinkToEmbedMenuItem();
m_aObjectMenu.add( aItem );
- // Handle mouse clicks in our window.
-// addMouseListener( new MouseWatcher() );
+ // Handle mouse clicks in our window.
+// addMouseListener( new MouseWatcher() );
addMouseListener( this );
}
@@ -112,11 +112,11 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
{
paint( g );
}
-
+
public void paint( Graphics g )
{
super.paint( g );
-
+
if ( m_xEmbedObj != null )
{
synchronized( this )
@@ -139,7 +139,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
m_xEmbedObj.changeState( EmbedStates.EMBED_RUNNING );
nState = EmbedStates.EMBED_RUNNING;
}
-
+
if ( nState == EmbedStates.EMBED_ACTIVE || nState == EmbedStates.EMBED_RUNNING )
{
XComponentSupplier xCompProv = (XComponentSupplier)UnoRuntime.queryInterface(
@@ -157,7 +157,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
aFlavor.MimeType = "image/png";
aFlavor.HumanPresentableName = "Portable Network Graphics";
aFlavor.DataType = new Type( byte[].class );
-
+
byte[] aPNGData = (byte[])AnyConverter.toArray( xTransfer.getTransferData( aFlavor ) );
if ( aPNGData != null && aPNGData.length != 0 )
{
@@ -199,12 +199,12 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
}
}
}
-
+
public void mousePressed( MouseEvent e ){};
public void mouseEntered( MouseEvent e ){};
public void mouseExited( MouseEvent e ){};
public void mouseReleased( MouseEvent e ){};
-
+
// XEmbeddedClient
public void saveObject()
throws com.sun.star.uno.Exception
@@ -235,7 +235,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
{
// for now nothing to do
}
-
+
// classes
class NewMenuItem extends MenuItem implements ActionListener // Menu New
{
@@ -244,7 +244,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
super( "New", new MenuShortcut( KeyEvent.VK_A ));
addActionListener( this );
}
-
+
public void actionPerformed( ActionEvent e )
{
// clear everything
@@ -261,7 +261,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
super( "SaveAs..." );
addActionListener( this );
}
-
+
public void actionPerformed( ActionEvent e )
{
// open SaveAs dialog and store
@@ -308,7 +308,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
super( "Open", new MenuShortcut( KeyEvent.VK_C ));
addActionListener( this );
}
-
+
public void actionPerformed( ActionEvent e )
{
// clear everything
@@ -325,7 +325,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
{
// create object from specified file
String aFileURI = aFile.toURI().toASCIIString();
-
+
// load from specified file
loadFileURI( aFileURI );
@@ -357,7 +357,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
super( "Save", new MenuShortcut( KeyEvent.VK_D ));
addActionListener( this );
}
-
+
public void actionPerformed( ActionEvent e )
{
// if has persistance store there
@@ -437,7 +437,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
super( "Create", new MenuShortcut( KeyEvent.VK_N ));
addActionListener( this );
}
-
+
public void actionPerformed( ActionEvent e )
{
// remove current object an init a new one
@@ -482,7 +482,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
}
}
}
-
+
generateNewImage();
repaint();
}
@@ -495,7 +495,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
super( "Load from file", new MenuShortcut( KeyEvent.VK_L ));
addActionListener( this );
}
-
+
public void actionPerformed( ActionEvent e )
{
// first remove current object
@@ -545,7 +545,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
super( "Create link", new MenuShortcut( KeyEvent.VK_M ));
addActionListener( this );
}
-
+
public void actionPerformed( ActionEvent e )
{
// first remove current object
@@ -598,15 +598,15 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
super( "Convert link to embed", new MenuShortcut( KeyEvent.VK_M ));
addActionListener( this );
}
-
+
public void actionPerformed( ActionEvent e )
{
if ( !m_bLinkObj )
{
JOptionPane.showMessageDialog( m_aFrame, "The object is not a link!", "Error:", JOptionPane.ERROR_MESSAGE );
- return;
+ return;
}
-
+
if ( m_xEmbedObj != null )
{
if ( m_xStorage != null )
@@ -655,49 +655,49 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
int[] pTempClassID = { 0x8B, 0xC6, 0xB1, 0x65, 0xB1, 0xB2, 0x4E, 0xDD,
0xAA, 0x47, 0xDA, 0xE2, 0xEE, 0x68, 0x9D, 0xD6 };
for ( int ind = 0; ind < 16; ind++ )
- pClassID[ind] = (byte)pTempClassID[ind];
+ pClassID[ind] = (byte)pTempClassID[ind];
}
else if ( aServiceName.equals( "com.sun.star.comp.Writer.GlobalDocument" ) )
{
int[] pTempClassID = { 0xB2, 0x1A, 0x0A, 0x7C, 0xE4, 0x03, 0x41, 0xFE,
0x95, 0x62, 0xBD, 0x13, 0xEA, 0x6F, 0x15, 0xA0 };
for ( int ind = 0; ind < 16; ind++ )
- pClassID[ind] = (byte)pTempClassID[ind];
+ pClassID[ind] = (byte)pTempClassID[ind];
}
else if ( aServiceName.equals( "com.sun.star.comp.Writer.WebDocument" ) )
{
int[] pTempClassID = { 0xA8, 0xBB, 0xA6, 0x0C, 0x7C, 0x60, 0x45, 0x50,
0x91, 0xCE, 0x39, 0xC3, 0x90, 0x3F, 0xAC, 0x5E };
for ( int ind = 0; ind < 16; ind++ )
- pClassID[ind] = (byte)pTempClassID[ind];
+ pClassID[ind] = (byte)pTempClassID[ind];
}
else if ( aServiceName.equals( "com.sun.star.comp.Calc.SpreadsheetDocument" ) )
{
int[] pTempClassID = { 0x47, 0xBB, 0xB4, 0xCB, 0xCE, 0x4C, 0x4E, 0x80,
0xA5, 0x91, 0x42, 0xD9, 0xAE, 0x74, 0x95, 0x0F };
for ( int ind = 0; ind < 16; ind++ )
- pClassID[ind] = (byte)pTempClassID[ind];
+ pClassID[ind] = (byte)pTempClassID[ind];
}
else if ( aServiceName.equals( "com.sun.star.comp.Draw.PresentationDocument" ) )
{
int[] pTempClassID = { 0x91, 0x76, 0xE4, 0x8A, 0x63, 0x7A, 0x4D, 0x1F,
0x80, 0x3B, 0x99, 0xD9, 0xBF, 0xAC, 0x10, 0x47 };
for ( int ind = 0; ind < 16; ind++ )
- pClassID[ind] = (byte)pTempClassID[ind];
+ pClassID[ind] = (byte)pTempClassID[ind];
}
else if ( aServiceName.equals( "com.sun.star.comp.Draw.DrawingDocument" ) )
{
int[] pTempClassID = { 0x4B, 0xAB, 0x89, 0x70, 0x8A, 0x3B, 0x45, 0xB3,
0x99, 0x1C, 0xCB, 0xEE, 0xAC, 0x6B, 0xD5, 0xE3 };
for ( int ind = 0; ind < 16; ind++ )
- pClassID[ind] = (byte)pTempClassID[ind];
+ pClassID[ind] = (byte)pTempClassID[ind];
}
else if ( aServiceName.equals( "com.sun.star.comp.Math.FormulaDocument" ) )
{
int[] pTempClassID = { 0x07, 0x8B, 0x7A, 0xBA, 0x54, 0xFC, 0x45, 0x7F,
0x85, 0x51, 0x61, 0x47, 0xE7, 0x76, 0xA9, 0x97 };
for ( int ind = 0; ind < 16; ind++ )
- pClassID[ind] = (byte)pTempClassID[ind];
+ pClassID[ind] = (byte)pTempClassID[ind];
}
if ( pClassID != null )
@@ -858,7 +858,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
{
JOptionPane.showMessageDialog( m_aFrame, e, "Exception in createTempStorage():", JOptionPane.ERROR_MESSAGE );
}
-
+
return xTempStorage;
}
@@ -878,7 +878,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
Object oStorage = xStorageFactory.createInstanceWithArguments( aArgs );
XStorage xTargetStorage = (XStorage)UnoRuntime.queryInterface( XStorage.class, oStorage );
m_xStorage.copyToStorage( xTargetStorage );
-
+
XComponent xComponent = (XComponent)UnoRuntime.queryInterface( XComponent.class, m_xStorage );
xComponent.dispose();
@@ -895,7 +895,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
{
JOptionPane.showMessageDialog( m_aFrame, e, "Exception in saveStorageToFileURI():", JOptionPane.ERROR_MESSAGE );
}
-
+
}
public void loadFileURI( String aFileURI )
@@ -983,15 +983,15 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
if ( xLinkOutStream != null && xTruncate != null )
{
xTruncate.truncate();
-
+
char[] aLinkChar = m_aLinkURI.toCharArray();
byte[] aLinkBytes = new byte[ aLinkChar.length ];
for ( int ind = 0; ind < aLinkChar.length; ind++ )
aLinkBytes[ind] = (byte)aLinkChar[ind];
-
+
xLinkOutStream.writeBytes( aLinkBytes );
xLinkOutStream.closeOutput();
-
+
XComponent xComponent = (XComponent) UnoRuntime.queryInterface( XComponent.class,
xLinkStream );
if ( xComponent != null )
@@ -1016,7 +1016,7 @@ public class EmbedContApp extends Applet implements MouseListener, XEmbeddedClie
e,
"Exception in storeLinkToStorage:",
JOptionPane.ERROR_MESSAGE );
-
+
}
}
}
diff --git a/odk/examples/java/EmbedDocument/Container1/EmbedContFrame.java b/odk/examples/java/EmbedDocument/Container1/EmbedContFrame.java
index 28b6c036b7b0..2a29ff4cc026 100644
--- a/odk/examples/java/EmbedDocument/Container1/EmbedContFrame.java
+++ b/odk/examples/java/EmbedDocument/Container1/EmbedContFrame.java
@@ -19,7 +19,7 @@ import com.sun.star.beans.*;
import com.sun.star.lang.*;
-public class EmbedContFrame extends Frame
+public class EmbedContFrame extends Frame
{
WindowListener m_aCloser = new WindowAdapter()
{
@@ -30,7 +30,7 @@ public class EmbedContFrame extends Frame
}
};
- public EmbedContFrame( String sName )
+ public EmbedContFrame( String sName )
{
super( sName );
addWindowListener( m_aCloser );
@@ -82,18 +82,18 @@ public class EmbedContFrame extends Frame
// Get component context
XComponentContext xComponentContext =
com.sun.star.comp.helper.Bootstrap.createInitialComponentContext( null );
-
+
// initial serviceManager
XMultiComponentFactory xLocalServiceManager = xComponentContext.getServiceManager();
-
+
// create a connector, so that it can contact the office
Object oUrlResolver = xLocalServiceManager.createInstanceWithContext( "com.sun.star.bridge.UnoUrlResolver",
xComponentContext );
XUnoUrlResolver xUrlResolver = (XUnoUrlResolver)UnoRuntime.queryInterface( XUnoUrlResolver.class, oUrlResolver );
-
+
Object oInitialObject = xUrlResolver.resolve( sConnectionString );
XNamingService xName = (XNamingService)UnoRuntime.queryInterface( XNamingService.class, oInitialObject );
-
+
XMultiServiceFactory xMSF = null;
if( xName != null ) {
Object oMSF = xName.getRegisteredObject( "StarOffice.ServiceManager" );
@@ -101,8 +101,8 @@ public class EmbedContFrame extends Frame
}
else
System.out.println( "Error: Can't get XNamingService interface from url resolver!" );
-
+
return xMSF;
}
-}
+}
diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/EditorFrame.java b/odk/examples/java/EmbedDocument/EmbeddedObject/EditorFrame.java
index 098555c55e11..0be57999755a 100755
--- a/odk/examples/java/EmbedDocument/EmbeddedObject/EditorFrame.java
+++ b/odk/examples/java/EmbedDocument/EmbeddedObject/EditorFrame.java
@@ -10,12 +10,12 @@ import javax.imageio.ImageIO;
import org.openoffice.examples.embedding.OwnEmbeddedObject;
-public class EditorFrame extends JFrame
+public class EditorFrame extends JFrame
{
OwnEmbeddedObject m_aEmbObj;
JTextArea m_aTextArea;
BufferedImage m_aBufImage;
-
+
WindowListener m_aCloser = new WindowAdapter()
{
public void windowClosing( WindowEvent e )
@@ -25,13 +25,13 @@ public class EditorFrame extends JFrame
Graphics2D aGr = m_aBufImage.createGraphics();
m_aTextArea.paintAll( aGr );
aGr.dispose();
-
+
hide();
m_aEmbObj.CloseFrameRequest();
}
};
- public EditorFrame( String sName, OwnEmbeddedObject aEmbObj, int nWidth, int nHeight )
+ public EditorFrame( String sName, OwnEmbeddedObject aEmbObj, int nWidth, int nHeight )
{
super( sName );
m_aEmbObj = aEmbObj;
@@ -65,18 +65,18 @@ public class EditorFrame extends JFrame
Dimension aToSet =
new Dimension( (int)( aSize.getWidth() + aOwnSize.getWidth() - aAppSize.getWidth() ),
(int)(aSize.getHeight() + aOwnSize.getHeight() - aAppSize.getHeight() ) );
-
+
setSize( aToSet );
validate();
-
+
// pack();
}
-
+
public byte[] getReplacementImage()
{
Dimension aDim = m_aTextArea.getSize();
BufferedImage aBufImage = null;
-
+
if ( m_aBufImage != null )
aBufImage = m_aBufImage;
else
@@ -94,7 +94,7 @@ public class EditorFrame extends JFrame
catch ( java.lang.Exception e )
{}
}
-
+
if ( aBufImage != null )
{
try
@@ -117,5 +117,5 @@ public class EditorFrame extends JFrame
return new byte[0];
}
-}
+}
diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java
index 3d10824584f5..df2da9f0ebea 100755
--- a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java
+++ b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java
@@ -60,7 +60,7 @@ public final class OwnEmbeddedObject extends WeakBase
{
if ( m_aListeners == null )
m_aListeners = new Vector<Object>( 10, 10 );
-
+
return m_aListeners;
}
@@ -69,13 +69,13 @@ public final class OwnEmbeddedObject extends WeakBase
{
if ( m_nObjectState == com.sun.star.embed.EmbedStates.ACTIVE )
m_aObjSize = m_aEditorFrame.getAppSize();
-
+
if ( m_aObjSize != null )
return m_aObjSize;
else
return new Dimension();
}
-
+
// -------------------------------------------------------------
protected void SwitchOwnPersistence( XStorage xParentStorage, XStorage xOwnStorage, String aEntryName )
{
@@ -171,7 +171,7 @@ public final class OwnEmbeddedObject extends WeakBase
catch( com.sun.star.uno.Exception e )
{
throw new com.sun.star.io.IOException( "Error while switching object storage!" );
- }
+ }
}
// -------------------------------------------------------------
@@ -269,9 +269,9 @@ public final class OwnEmbeddedObject extends WeakBase
catch( com.sun.star.uno.Exception e )
{
throw new com.sun.star.io.IOException( "Error while reading one of object streams!" );
- }
+ }
}
-
+
// -------------------------------------------------------------
protected void ReadSizeFromOwnStorage() throws com.sun.star.io.IOException
{
@@ -285,7 +285,7 @@ public final class OwnEmbeddedObject extends WeakBase
m_aObjSize = new Dimension( nWidth, nHeight );
}
}
-
+
// -------------------------------------------------------------
public OwnEmbeddedObject( XComponentContext context, byte[] aClassID )
{
@@ -310,13 +310,13 @@ public final class OwnEmbeddedObject extends WeakBase
try{
xClient.saveObject();
} catch( com.sun.star.uno.Exception e ){}
-
+
m_nObjectState = com.sun.star.embed.EmbedStates.RUNNING;
StateChangeNotification( false, com.sun.star.embed.EmbedStates.ACTIVE, m_nObjectState );
PostEvent( "OnVisAreaChanged" );
}
-
+
// com.sun.star.embed.XCommonEmbedPersist:
// -------------------------------------------------------------
public void storeOwn() throws com.sun.star.embed.WrongStateException, com.sun.star.io.IOException, com.sun.star.uno.Exception
@@ -421,7 +421,7 @@ public final class OwnEmbeddedObject extends WeakBase
}
}
else if ( nEntryConnectionMode == com.sun.star.embed.EntryInitModes.TRUNCATE_INIT )
- {
+ {
SwitchOwnPersistence( xStorage, aEntryName );
m_aEditorFrame = new EditorFrame( m_aEntryName, this, 5, 20 );
m_nObjectState = com.sun.star.embed.EmbedStates.RUNNING;
@@ -446,7 +446,7 @@ public final class OwnEmbeddedObject extends WeakBase
}
else
{
- com.sun.star.embed.XStorage xSubStorage =
+ com.sun.star.embed.XStorage xSubStorage =
xStorage.openStorageElement( aEntryName,
com.sun.star.embed.ElementModes.READWRITE | com.sun.star.embed.ElementModes.TRUNCATE );
@@ -469,7 +469,7 @@ public final class OwnEmbeddedObject extends WeakBase
if ( m_nObjectState == com.sun.star.embed.EmbedStates.LOADED )
{
- xSubStorage =
+ xSubStorage =
xStorage.openStorageElement( aEntryName,
com.sun.star.embed.ElementModes.READWRITE | com.sun.star.embed.ElementModes.NOCREATE );
@@ -477,7 +477,7 @@ public final class OwnEmbeddedObject extends WeakBase
}
else
{
- xSubStorage =
+ xSubStorage =
xStorage.openStorageElement( aEntryName,
com.sun.star.embed.ElementModes.READWRITE | com.sun.star.embed.ElementModes.TRUNCATE );
@@ -786,7 +786,7 @@ public final class OwnEmbeddedObject extends WeakBase
m_aListeners.clear();
}
-
+
m_bDisposed = true;
if ( m_aEditorFrame != null )
@@ -832,7 +832,7 @@ public final class OwnEmbeddedObject extends WeakBase
&& nNewState != com.sun.star.embed.EmbedStates.RUNNING
&& nNewState != com.sun.star.embed.EmbedStates.ACTIVE )
throw new com.sun.star.embed.UnreachableStateException();
-
+
StateChangeNotification( true, nOldState, nNewState );
try
@@ -887,7 +887,7 @@ public final class OwnEmbeddedObject extends WeakBase
if ( m_aObjSize != null )
m_aEditorFrame.setAppSize( m_aObjSize );
-
+
m_xClient.visibilityChanged( true );
m_nObjectState = nNewState;
@@ -1038,15 +1038,15 @@ public final class OwnEmbeddedObject extends WeakBase
pVerbs[nInd].VerbAttributes = com.sun.star.embed.VerbAttributes.MS_VERBATTR_ONCONTAINERMENU;
}
}
-
+
m_pOwnVerbs = pVerbs;
}
}
catch( com.sun.star.uno.Exception e )
- {}
+ {}
}
- if ( m_pOwnVerbs != null )
+ if ( m_pOwnVerbs != null )
return m_pOwnVerbs;
return new com.sun.star.embed.VerbDescriptor[0];
diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java
index fd8f2793c9c5..525d13e63eef 100755
--- a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java
+++ b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObjectFactory.java
@@ -67,7 +67,7 @@ public final class OwnEmbeddedObjectFactory extends WeakBase
{
if ( xStorage == null || sEntName == null || sEntName.length() == 0 )
throw new com.sun.star.lang.IllegalArgumentException();
-
+
if ( nEntryConnectionMode == com.sun.star.embed.EntryInitModes.DEFAULT_INIT )
{
if ( aClassID != null && aClassID.length != 0 )
diff --git a/odk/examples/java/Inspector/Addons.xcu b/odk/examples/java/Inspector/Addons.xcu
index 0daa83fb392b..ee44a8d68773 100755
--- a/odk/examples/java/Inspector/Addons.xcu
+++ b/odk/examples/java/Inspector/Addons.xcu
@@ -15,7 +15,7 @@
</prop>
<prop oor:name="Context" oor:type="xs:string">
<value></value>
- </prop>
+ </prop>
</node>
</node>
</node>
diff --git a/odk/examples/java/Inspector/HideableMutableTreeNode.java b/odk/examples/java/Inspector/HideableMutableTreeNode.java
index c7f10ee69c41..37ac35f116b1 100644
--- a/odk/examples/java/Inspector/HideableMutableTreeNode.java
+++ b/odk/examples/java/Inspector/HideableMutableTreeNode.java
@@ -1,73 +1,73 @@
// *** HideableMutableTreeNode ***
import javax.swing.*;
import javax.swing.tree.*;
-
+
/**
- * <code>HideableMutableTreeNode</code> is a <code>DefaultMutableTreeNode</code>
- * implementation that works with <code>HideableTreeModel</code>.
+ * <code>HideableMutableTreeNode</code> is a <code>DefaultMutableTreeNode</code>
+ * implementation that works with <code>HideableTreeModel</code>.
*/
public class HideableMutableTreeNode extends DefaultMutableTreeNode {
/**
- * The node is visible flag.
+ * The node is visible flag.
*/
public boolean bIsvisible = true;
- private static final String SDUMMY = "Dummy";
-
-
+ private static final String SDUMMY = "Dummy";
+
+
/**
- * Creates a tree node that has no parent and no children, but which
+ * Creates a tree node that has no parent and no children, but which
* allows children.
*/
public HideableMutableTreeNode() {
super();
}
-
+
/**
- * Creates a tree node with no parent, no children, but which allows
+ * Creates a tree node with no parent, no children, but which allows
* children, and initializes it with the specified user object.
- *
- * @param userObject - an Object provided by the user that
+ *
+ * @param userObject - an Object provided by the user that
* constitutes the node's data
*/
public HideableMutableTreeNode(Object _userObject) {
super(_userObject);
}
-
+
/**
- * Creates a tree node with no parent, no children, initialized with the
+ * Creates a tree node with no parent, no children, initialized with the
* specified user object, and that allows children only if specified.
- *
+ *
* @param _userObject - an Object provided by the user that describes the node's data
* @param _ballowsChildren - if true, the node is allowed to have childnodes -- otherwise, it is always a leaf node
*/
public HideableMutableTreeNode(Object _userObject, boolean _ballowsChildren) {
super(_userObject, _ballowsChildren);
}
-
+
/**
- * Checks if the node is visible.
- *
+ * Checks if the node is visible.
+ *
* @return true if the node is visible, else false
*/
public boolean isVisible() {
return this.bIsvisible;
}
-
+
/**
- * Sets if the node is visible.
- *
+ * Sets if the node is visible.
+ *
* @param returns true if the node is visible, else false
*/
public void setVisible(boolean _bIsVisible) {
- this.bIsvisible = _bIsVisible;
+ this.bIsvisible = _bIsVisible;
}
-
+
public void addDummyNode(){
removeDummyNode();
DefaultMutableTreeNode oDefaultMutableTreeNode = new DefaultMutableTreeNode(SDUMMY);
add(oDefaultMutableTreeNode);
-
+
}
@@ -84,5 +84,5 @@ public class HideableMutableTreeNode extends DefaultMutableTreeNode {
}
return breturn;
}
-
+
} \ No newline at end of file
diff --git a/odk/examples/java/Inspector/HideableTreeModel.java b/odk/examples/java/Inspector/HideableTreeModel.java
index a4a18553ca87..91444d1478a8 100644
--- a/odk/examples/java/Inspector/HideableTreeModel.java
+++ b/odk/examples/java/Inspector/HideableTreeModel.java
@@ -8,34 +8,34 @@ import java.util.Vector;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
-
+
public class HideableTreeModel implements TreeModel {
private Vector modelListeners = new Vector();
private Object root = null;
-
-
+
+
public HideableTreeModel(TreeNode _root) {
super();
- setRoot(_root);
+ setRoot(_root);
}
-
-
+
+
public Object getRoot() {
return this.root;
}
-
+
protected void setRoot(Object r) {
this.root = r;
}
-
+
public Object[] getPathToRoot(Object node) {
return getPathToRoot(node, 0);
}
-
+
private Object[] getPathToRoot(Object node, int i) {
Object anode[];
@@ -55,22 +55,22 @@ public class HideableTreeModel implements TreeModel {
}
return anode;
}
-
+
public void addTreeModelListener(TreeModelListener l) {
modelListeners.addElement(l);
}
-
+
public void removeTreeModelListener(TreeModelListener l) {
modelListeners.removeElement(l);
}
-
+
public void reload() {
reload(getRoot());
}
-
+
public void reload(Object node) {
if(node != null) {
@@ -78,16 +78,16 @@ public class HideableTreeModel implements TreeModel {
fireTreeStructureChanged(new TreeModelEvent(this, tp));
}
}
-
+
public void valueForPathChanged(TreePath path, Object newValue) {
nodeChanged(path.getLastPathComponent());
}
-
+
public void nodeInserted(Object node, Object child) {
nodeInserted(node, child, -1);
}
-
+
public void nodeInserted(Object node, Object child, int index) {
if(index < 0) {
@@ -100,7 +100,7 @@ public class HideableTreeModel implements TreeModel {
fireTreeNodesInserted(new TreeModelEvent(this, tp, ai, ac));
}
}
-
+
public void nodeRemoved(Object node, Object child, int index) {
if(node != null && child != null && index >= 0) {
@@ -110,7 +110,7 @@ public class HideableTreeModel implements TreeModel {
fireTreeNodesRemoved(new TreeModelEvent(this, tp, ai, ac));
}
}
-
+
public void nodeChanged(Object node) {
if(node != null) {
@@ -118,41 +118,41 @@ public class HideableTreeModel implements TreeModel {
fireTreeNodesChanged(new TreeModelEvent(this, tp, null, null));
}
}
-
+
protected void fireTreeNodesChanged(TreeModelEvent event) {
for(int i = 0; i < modelListeners.size(); i++) {
((TreeModelListener)modelListeners.elementAt(i)).treeNodesChanged(event);
}
}
-
+
protected void fireTreeNodesInserted(TreeModelEvent event) {
for(int i = 0; i < modelListeners.size(); i++) {
((TreeModelListener)modelListeners.elementAt(i)).treeNodesInserted(event);
}
}
-
+
protected void fireTreeNodesRemoved(TreeModelEvent event) {
for(int i = 0; i < modelListeners.size(); i++) {
((TreeModelListener)modelListeners.elementAt(i)).treeNodesRemoved(event);
}
}
-
+
protected void fireTreeStructureChanged(TreeModelEvent event) {
for(int i = 0; i < modelListeners.size(); i++) {
((TreeModelListener)modelListeners.elementAt(i)).treeStructureChanged(event);
}
}
-
+
public ArrayList getExpandedPaths(JTree tree) {
ArrayList expandedPaths = new ArrayList();
addExpandedPaths(tree, tree.getPathForRow(0), expandedPaths);
return expandedPaths;
}
-
+
private void addExpandedPaths(JTree tree, TreePath path, ArrayList pathlist) {
Enumeration aEnum = tree.getExpandedDescendants(path);
@@ -162,14 +162,14 @@ public class HideableTreeModel implements TreeModel {
addExpandedPaths(tree, tp, pathlist);
}
}
-
+
public void expandPaths(JTree tree, ArrayList pathlist) {
for(int i = 0; i < pathlist.size(); i++) {
tree.expandPath((TreePath)pathlist.get(i));
}
}
-
+
public boolean isLeaf(Object _oNode) {
if(_oNode instanceof TreeNode) {
@@ -177,16 +177,16 @@ public class HideableTreeModel implements TreeModel {
}
return true;
}
-
-
-
+
+
+
public Object getParent(Object node) {
if(node != getRoot() && (node instanceof TreeNode)) {
return ((TreeNode)node).getParent();
}
return null;
}
-
+
public boolean isNodeVisible(Object node) {
if(node != getRoot()) {
@@ -196,7 +196,7 @@ public class HideableTreeModel implements TreeModel {
}
return true;
}
-
+
public boolean setNodeVisible(Object node, boolean v) {
// can't hide root
@@ -222,7 +222,7 @@ public class HideableTreeModel implements TreeModel {
}
return false;
}
-
+
public boolean isPathToNodeVisible(Object node) {
Object[] path = getPathToRoot(node);
@@ -233,7 +233,7 @@ public class HideableTreeModel implements TreeModel {
}
return true;
}
-
+
public void ensurePathToNodeVisible(Object node) {
Object[] path = getPathToRoot(node);
@@ -241,7 +241,7 @@ public class HideableTreeModel implements TreeModel {
setNodeVisible(path[i], true);
}
}
-
+
public Object getChild(Object parent, int index) {
if(parent instanceof TreeNode) {
@@ -258,7 +258,7 @@ public class HideableTreeModel implements TreeModel {
}
return null;
}
-
+
public int getChildCount(Object parent) {
int count = 0;
@@ -273,7 +273,7 @@ public class HideableTreeModel implements TreeModel {
}
return count;
}
-
+
public int getIndexOfChild(Object parent, Object child) {
int index = -1;
diff --git a/odk/examples/java/Inspector/Inspector.java b/odk/examples/java/Inspector/Inspector.java
index c8887d4c0344..78f5cc182ee4 100644
--- a/odk/examples/java/Inspector/Inspector.java
+++ b/odk/examples/java/Inspector/Inspector.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.awt.Rectangle;
@@ -69,19 +69,19 @@ import org.openoffice.XInstanceInspector;
public class Inspector{
public static final String sIDLDOCUMENTSUBFOLDER = "docs/common/ref/";
-
+
/** This class implements the method of the interface XInstanceInspector.
* Also the class implements the interfaces XServiceInfo, and XTypeProvider.
*/
static public class _Inspector extends WeakBase implements XInstanceInspector, XServiceInfo{
-
- static private final String __serviceName = "org.openoffice.InstanceInspector";
+
+ static private final String __serviceName = "org.openoffice.InstanceInspector";
private HashMap aApplicationHashMap = new HashMap();
private String sTitle = "Object Inspector";
private Vector aHiddenDocuments = new Vector();
// private String[] sApplicationDocUrls = new String[]{"private:factory/swriter", "private:factory/scalc", "private:factory/simpress", "private:factory/sdraw", "private:factory/sbase"};
// private String[] sApplicationDocNames = new String[]{"Text Document", "Spreadsheet", "Presentation", "Drawing", "Database"};
- private XComponentContext m_xComponentContext;
+ private XComponentContext m_xComponentContext;
private HashMap aInspectorPanes = new HashMap();
private XDialogProvider m_oSwingDialogProvider;
private TDocSupplier oTDocSupplier;
@@ -92,39 +92,39 @@ public class Inspector{
public _Inspector(XComponentContext _xComponentContext) {
m_xComponentContext = _xComponentContext;
m_oIntrospector = Introspector.getIntrospector(m_xComponentContext);
- aApplicationHashMap.put("private:factory/swriter", "Text Document");
+ aApplicationHashMap.put("private:factory/swriter", "Text Document");
aApplicationHashMap.put("private:factory/scalc", "Spreadsheet");
aApplicationHashMap.put("private:factory/simpress", "Presentation");
aApplicationHashMap.put("private:factory/sdraw", "Drawing");
aApplicationHashMap.put("private:factory/smath", "Formula");
m_oSwingDialogProvider = new SwingDialogProvider(this, sTitle);
-// aApplicationHashMap.put("private:factory/sbase", "Database");
+// aApplicationHashMap.put("private:factory/sbase", "Database");
}
-
-
+
+
public XComponentContext getXComponentContext(){
return m_xComponentContext;
}
-
-
+
+
public HashMap getInspectorPages(){
return aInspectorPanes;
}
-
-
+
+
protected String getSDKPath(){
String sRetPath = "";
try{
XNameAccess xNameAccess = getConfigurationAccess("org.openoffice.inspector.ObjectInspector", true);
XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xNameAccess);
- sRetPath = (String) xPropertySet.getPropertyValue("SDKPath");
+ sRetPath = (String) xPropertySet.getPropertyValue("SDKPath");
}catch( Exception exception ) {
exception.printStackTrace(System.out);
}
return sRetPath;
}
-
-
+
+
public String getIDLPath(){
String sRetPath = getSDKPath();
if (m_oIntrospector.isValidSDKInstallationPath(sRetPath)){
@@ -135,8 +135,8 @@ public class Inspector{
}
return sRetPath;
}
-
-
+
+
public void openIdlFileforSelectedNode(){
InspectorPane oInspectorPane = m_oSwingDialogProvider.getSelectedInspectorPage();
if (oInspectorPane != null){
@@ -146,9 +146,9 @@ public class Inspector{
oUnoNode.openIdlDescription(sPath);
}
}
- }
-
-
+ }
+
+
public void assignSDKPath() {
try {
String sInstallationFolder = "";
@@ -169,7 +169,7 @@ public class Inspector{
XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xNameAccess);
xPropertySet.setPropertyValue("SDKPath", sInstallationFolder);
XChangesBatch xBatch = (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class, xNameAccess);
- xBatch.commitChanges();
+ xBatch.commitChanges();
}
else{
XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xFolderPicker);
@@ -183,8 +183,8 @@ public class Inspector{
}catch( Exception exception ) {
exception.printStackTrace(System.out);
}}
-
-
+
+
public void showErrorMessageBox(XWindowPeer _xWindowPeer, String _sTitle, String _sMessage){
try {
Object oToolkit = m_xComponentContext.getServiceManager().createInstanceWithContext("com.sun.star.awt.Toolkit", m_xComponentContext);
@@ -199,8 +199,8 @@ public class Inspector{
} catch (com.sun.star.uno.Exception ex) {
ex.printStackTrace(System.out);
}}
-
-
+
+
public void inspect(java.lang.Object _oUserDefinedObject, String _sTitle) throws com.sun.star.uno.RuntimeException {
try {
int nPageIndex = m_oSwingDialogProvider.getInspectorPageCount();
@@ -212,23 +212,23 @@ public class Inspector{
}catch( Exception exception ) {
exception.printStackTrace(System.out);
}}
-
-
+
+
public void inspectOpenEmptyDocument(String _sApplicationDocUrl){
XComponent xComponent = getTDocSupplier().openEmptyDocument(_sApplicationDocUrl);
String sRootTitle = (String) aApplicationHashMap.get(_sApplicationDocUrl);
inspect(xComponent, sRootTitle);
aHiddenDocuments.add(xComponent);
}
-
-
+
+
public void inspectOpenDocument(String _sTDocUrl){
String sTreeNodeName = getTDocSupplier().getTitleByTDocUrl(_sTDocUrl);
XModel xTDocModel = getTDocSupplier().getXModelByTDocUrl(_sTDocUrl);
inspect(xTDocModel, sTreeNodeName);
- }
-
-
+ }
+
+
public void inspectSelectedNode(){
InspectorPane oInspectorPane = m_oSwingDialogProvider.getSelectedInspectorPage();
if (oInspectorPane != null){
@@ -241,14 +241,14 @@ public class Inspector{
}
}
-
+
public void addSourceCodeOfSelectedNode(){
InspectorPane oInspectorPane = m_oSwingDialogProvider.getSelectedInspectorPage();
if (oInspectorPane != null){
oInspectorPane.addSourceCodeOfSelectedNode();
}
}
-
+
public void invokeSelectedMethod(){
InspectorPane oInspectorPane = m_oSwingDialogProvider.getSelectedInspectorPage();
@@ -256,8 +256,8 @@ public class Inspector{
oInspectorPane.invokeSelectedMethodNode();
}
}
-
-
+
+
public void setSourceCodeLanguage(final int _nLanguage){
try{
String sLanguage = "Java";
@@ -285,11 +285,11 @@ public class Inspector{
}catch( Exception exception ) {
exception.printStackTrace(System.out);
}}
-
-
+
+
private TDocSupplier getTDocSupplier(){
if (oTDocSupplier == null){
- oTDocSupplier = new TDocSupplier(m_xComponentContext);
+ oTDocSupplier = new TDocSupplier(m_xComponentContext);
}
return oTDocSupplier;
}
@@ -297,13 +297,13 @@ public class Inspector{
public String[] getTDocUrls(){
return getTDocSupplier().getTDocUrls();
}
-
-
+
+
public String[] getTDocTitles(String[] _sTDocUrls){
return getTDocSupplier().getTDocTitles(_sTDocUrls);
}
-
-
+
+
public String[][] getApplicationUrls(){
Set aSet = aApplicationHashMap.keySet();
String[][] sReturnList = new String[aSet.size()][];
@@ -318,7 +318,7 @@ public class Inspector{
return sReturnList;
}
-
+
public void disposeHiddenDocuments(){
int nHiddenCount = aHiddenDocuments.size();
if (nHiddenCount > 0){
@@ -336,13 +336,13 @@ public class Inspector{
}
}
}
-
-
+
+
public static String[] getServiceNames() {
String[] sSupportedServiceNames = { __serviceName };
return sSupportedServiceNames;
}
-
+
// Implement the interface XServiceInfo
/** Get all supported service names.
* @return Supported service names.
@@ -350,7 +350,7 @@ public class Inspector{
public String[] getSupportedServiceNames() {
return getServiceNames();
}
-
+
// Implement the interface XServiceInfo
/** Test, if the given service will be supported.
* @param sService Service name.
@@ -359,7 +359,7 @@ public class Inspector{
public boolean supportsService( String sServiceName ) {
return sServiceName.equals( __serviceName );
}
-
+
// Implement the interface XServiceInfo
/** Get the implementation name of the component.
* @return Implementation name of the component.
@@ -367,7 +367,7 @@ public class Inspector{
public String getImplementationName() {
return _Inspector.class.getName();
}
-
+
private int getSourceCodeLanguage(){
int nLanguage = XLanguageSourceCodeGenerator.nJAVA;
@@ -378,10 +378,10 @@ public class Inspector{
nLanguage = XLanguageSourceCodeGenerator.nJAVA;
}
else if (sLanguage.toUpperCase().equals("BASIC")){
- nLanguage = XLanguageSourceCodeGenerator.nBASIC;
+ nLanguage = XLanguageSourceCodeGenerator.nBASIC;
}
else if (sLanguage.toUpperCase().equals("CPLUSPLUS")){
- nLanguage = XLanguageSourceCodeGenerator.nCPLUSPLUS;
+ nLanguage = XLanguageSourceCodeGenerator.nCPLUSPLUS;
}
else{
System.out.println("Warning: Sourcecode language " + sLanguage + " is not defined!");
@@ -391,9 +391,9 @@ public class Inspector{
exception.printStackTrace(System.out);
}
return nLanguage;
- }
-
-
+ }
+
+
public XNameAccess getConfigurationAccess(boolean _bUpdate){
return getConfigurationAccess("org.openoffice.inspector.ObjectInspector", _bUpdate);
}
@@ -411,20 +411,20 @@ public class Inspector{
}
XMultiComponentFactory xMCF = m_xComponentContext.getServiceManager();
Object oDefaultProvider = xMCF.createInstanceWithContext("com.sun.star.configuration.DefaultProvider", this.getXComponentContext());
- XMultiServiceFactory xMSFCfg = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oDefaultProvider);
+ XMultiServiceFactory xMSFCfg = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oDefaultProvider);
Object oAccess = xMSFCfg.createInstanceWithArguments(sAccess, new Object[]{new NamedValue("nodepath", _sNodePath)});
xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oAccess);
- } catch (com.sun.star.uno.Exception e) {
+ } catch (com.sun.star.uno.Exception e) {
}
return xNameAccess;
}
-
-
+
+
}
-
+
// end of inner class
-
-
+
+
/**
* Gives a factory for creating the service.
* This method is called by the <code>JavaLoader</code>
@@ -454,8 +454,8 @@ public class Inspector{
* @see com.sun.star.comp.loader.JavaLoader
*/
public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
- return (Factory.writeRegistryServiceInfo(_Inspector.class.getName(), _Inspector.getServiceNames(), regKey)
+ return (Factory.writeRegistryServiceInfo(_Inspector.class.getName(), _Inspector.getServiceNames(), regKey)
&& InspectorAddon.__writeRegistryServiceInfo(regKey));
}
}
-
+
diff --git a/odk/examples/java/Inspector/InspectorAddon.java b/odk/examples/java/Inspector/InspectorAddon.java
index be35f8a1988e..92c8ab5c43fa 100644
--- a/odk/examples/java/Inspector/InspectorAddon.java
+++ b/odk/examples/java/Inspector/InspectorAddon.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;
import com.sun.star.frame.DispatchDescriptor;
@@ -66,12 +66,12 @@ public class InspectorAddon {
"com.sun.star.frame.ProtocolHandler" };
;
private XComponentContext m_xContext = null;
-
+
/** Creates a new instance of InspectorAddon */
public InspectorAddonImpl(XComponentContext _xContext) {
m_xContext = _xContext;
}
-
+
public XDispatch queryDispatch( /*IN*/com.sun.star.util.URL aURL, /*IN*/String sTargetFrameName, /*IN*/int iSearchFlags ) {
XDispatch xRet = null;
if ( aURL.Protocol.compareTo("org.openoffice.Office.addon.Inspector:") == 0 ) {
@@ -86,37 +86,37 @@ public class InspectorAddon {
public XDispatch[] queryDispatches( /*IN*/DispatchDescriptor[] seqDescripts ) {
int nCount = seqDescripts.length;
- XDispatch[] lDispatcher = new XDispatch[nCount];
+ XDispatch[] lDispatcher = new XDispatch[nCount];
for( int i=0; i<nCount; ++i )
lDispatcher[i] = queryDispatch( seqDescripts[i].FeatureURL, seqDescripts[i].FrameName, seqDescripts[i].SearchFlags );
- return lDispatcher;
+ return lDispatcher;
}
public void initialize( Object[] object ) throws com.sun.star.uno.Exception {
if ( object.length > 0 ){
m_xFrame = ( XFrame ) UnoRuntime.queryInterface(XFrame.class, object[ 0 ] );
- }
+ }
}
-
+
public class Dispatcher implements XDispatch{
private XFrame m_xFrame = null;
private XModel xModel = null;
-
+
public Dispatcher(XFrame _xFrame){
m_xFrame = _xFrame;
if (m_xFrame != null){
XController xController = m_xFrame.getController();
if (xController != null){
xModel = xController.getModel();
- }
+ }
}
}
// XDispatch
public void dispatch( /*IN*/com.sun.star.util.URL _aURL, /*IN*/com.sun.star.beans.PropertyValue[] aArguments ) {
try{
- if ( _aURL.Protocol.compareTo("org.openoffice.Office.addon.Inspector:") == 0 ){
+ if ( _aURL.Protocol.compareTo("org.openoffice.Office.addon.Inspector:") == 0 ){
if ( _aURL.Path.equals("inspect")){
Object oUnoInspectObject = xModel;
com.sun.star.lang.XMultiComponentFactory xMCF = m_xContext.getServiceManager();
@@ -130,7 +130,7 @@ public class InspectorAddon {
oUnoInspectObject = m_xFrame;
}
XPropertySet xFramePropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, m_xFrame);
- String sTitle = (String) xFramePropertySet.getPropertyValue("Title");
+ String sTitle = (String) xFramePropertySet.getPropertyValue("Title");
String[] sTitleList = sTitle.split(" - ");
if (sTitleList.length > 0){
sTitle = sTitleList[0];
@@ -148,15 +148,15 @@ public class InspectorAddon {
public void removeStatusListener( /*IN*/XStatusListener xControl, /*IN*/com.sun.star.util.URL aURL ) {
}
-
-
+
+
}
-
-
+
+
public static String[] getServiceNames() {
return m_serviceNames;
}
-
+
// Implement the interface XServiceInfo
/** Get all supported service names.
* @return Supported service names.
@@ -164,7 +164,7 @@ public class InspectorAddon {
public String[] getSupportedServiceNames() {
return getServiceNames();
}
-
+
// Implement the interface XServiceInfo
/** Test, if the given service will be supported.
* @param sService Service name.
@@ -172,15 +172,15 @@ public class InspectorAddon {
*/
public boolean supportsService( String sServiceName ) {
int len = m_serviceNames.length;
-
+
for( int i=0; i < len; i++) {
if ( sServiceName.equals( m_serviceNames[i] ) )
return true;
}
-
+
return false;
}
-
+
// Implement the interface XServiceInfo
/** Get the implementation name of the component.
* @return Implementation name of the component.
@@ -188,10 +188,10 @@ public class InspectorAddon {
public String getImplementationName() {
return InspectorAddonImpl.class.getName();
}
-
- }
-
-
+
+ }
+
+
/**
* Gives a factory for creating the service.
* This method is called by the <code>JavaLoader</code>
@@ -221,8 +221,8 @@ public class InspectorAddon {
public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
return Factory.writeRegistryServiceInfo(InspectorAddonImpl.class.getName(), InspectorAddonImpl.getServiceNames(), regKey);
}
-
+
// __create( XComponentContext ){
//
-// }
+// }
}
diff --git a/odk/examples/java/Inspector/InspectorPane.java b/odk/examples/java/Inspector/InspectorPane.java
index 4748c1a62f77..14d144781943 100644
--- a/odk/examples/java/Inspector/InspectorPane.java
+++ b/odk/examples/java/Inspector/InspectorPane.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.
- *
+ *
*************************************************************************/
@@ -62,7 +62,7 @@ import javax.swing.event.TreeWillExpandListener;
private XTreeControlProvider m_xTreeControlProvider;
private String sTitle = "";
-
+
/** The constructor of the inner class has a XMultiServiceFactory parameter.
* @param xMultiServiceFactory XMultiServiceFactory
*/
@@ -74,15 +74,15 @@ import javax.swing.event.TreeWillExpandListener;
m_oSourceCodeGenerator = new SourceCodeGenerator(_nLanguage);
_xTreeControlProvider.addInspectorPane(this);
}
-
+
private void setMaximumOfProgressBar(Object _oUnoObject){
int nMaxValue = 0;
xIdlMethods = m_oIntrospector.getMethods(_oUnoObject);
- aProperties = m_oIntrospector.getProperties(_oUnoObject);
+ aProperties = m_oIntrospector.getProperties(_oUnoObject);
}
-
-
+
+
/** Inspect the given object for methods, properties, interfaces, and
* services.
* @param a The object to inspect
@@ -96,8 +96,8 @@ import javax.swing.event.TreeWillExpandListener;
catch( Exception exception ) {
exception.printStackTrace(System.out);
}}
-
-
+
+
public void setTitle(String _sTitle){
if (_sTitle != null){
if (_sTitle.length() > 0){
@@ -106,13 +106,13 @@ import javax.swing.event.TreeWillExpandListener;
}
}
-
+
public String getTitle(){
return sTitle;
}
-
-
-
+
+
+
private Type[] getTypes(Object _oUnoObject){
Type[] aTypes = null;
if (m_oIntrospector.isArray(_oUnoObject)){
@@ -123,8 +123,8 @@ import javax.swing.event.TreeWillExpandListener;
}
return aTypes;
}
-
-
+
+
private Object invoke(XUnoMethodNode _oUnoMethodNode){
try{
String sParamValueDescription = "";
@@ -140,23 +140,23 @@ import javax.swing.event.TreeWillExpandListener;
if (_oUnoMethodNode.getXIdlMethod().getReturnType().getTypeClass().getValue() == TypeClass.VOID_value){
sNodeDescription += _oUnoMethodNode.getXIdlMethod().getReturnType().getName() + " " + _oUnoMethodNode.getXIdlMethod().getName() + sParamValueDescription;
_oUnoMethodNode.setLabel(sNodeDescription);
- m_xTreeControlProvider.nodeChanged(_oUnoMethodNode);
+ m_xTreeControlProvider.nodeChanged(_oUnoMethodNode);
}
else if (bHasParameters || !bIsPrimitive){
if (bIsPrimitive){
sNodeDescription += m_oSourceCodeGenerator.getStringValueOfObject(oUnoReturnObject, _oUnoMethodNode.getTypeClass());
}
- else{
+ else{
Any aReturnObject = Any.complete(oUnoReturnObject);
String sShortClassName = m_oIntrospector.getShortClassName(aReturnObject.getType().getTypeName());
- sNodeDescription += m_oSourceCodeGenerator.getVariableNameforUnoObject(sShortClassName);
+ sNodeDescription += m_oSourceCodeGenerator.getVariableNameforUnoObject(sShortClassName);
}
if (m_oIntrospector.isArray(oUnoReturnObject)){
if (m_oIntrospector.isUnoTypeObject(oUnoReturnObject)){
oUnoNode = addUnoFacetteNode(_oUnoMethodNode, XUnoFacetteNode.SINTERFACEDESCRIPTION, _oUnoMethodNode.getUnoObject());
}
else if(m_oIntrospector.isUnoPropertyTypeObject(oUnoReturnObject)){
- oUnoNode = addUnoFacetteNode(_oUnoMethodNode, XUnoFacetteNode.SPROPERTYINFODESCRIPTION, oUnoReturnObject);
+ oUnoNode = addUnoFacetteNode(_oUnoMethodNode, XUnoFacetteNode.SPROPERTYINFODESCRIPTION, oUnoReturnObject);
}
else if(m_oIntrospector.isUnoPropertyValueTypeObject(oUnoReturnObject)){
oUnoNode = addUnoFacetteNode(_oUnoMethodNode, XUnoFacetteNode.SPROPERTYVALUEDESCRIPTION, oUnoReturnObject);
@@ -182,7 +182,7 @@ import javax.swing.event.TreeWillExpandListener;
if (bIsPrimitive){
sNodeDescription = _oUnoMethodNode.getStandardMethodDescription() + "=" + UnoMethodNode.getDisplayValueOfPrimitiveType(oUnoReturnObject);
_oUnoMethodNode.setLabel(sNodeDescription);
- m_xTreeControlProvider.nodeChanged(_oUnoMethodNode);
+ m_xTreeControlProvider.nodeChanged(_oUnoMethodNode);
}
}
}
@@ -192,7 +192,7 @@ import javax.swing.event.TreeWillExpandListener;
_oUnoMethodNode.setLabel(_oUnoMethodNode.getLabel() + " = null");
}
else{
- _oUnoMethodNode.setLabel(_oUnoMethodNode.getXIdlMethod().getName() + sParamValueDescription + " = null");
+ _oUnoMethodNode.setLabel(_oUnoMethodNode.getXIdlMethod().getName() + sParamValueDescription + " = null");
}
m_xTreeControlProvider.nodeChanged(_oUnoMethodNode);
}
@@ -200,8 +200,8 @@ import javax.swing.event.TreeWillExpandListener;
}catch(Exception exception ) {
return null;
}}
-
-
+
+
public void invokeSelectedMethodNode(){
XTreePathProvider xTreePathProvider = m_xTreeControlProvider.getSelectedPath();
XUnoNode oUnoNode = xTreePathProvider.getLastPathComponent();
@@ -211,7 +211,7 @@ import javax.swing.event.TreeWillExpandListener;
}
}
-
+
public void addSourceCodeOfSelectedNode(){
XTreePathProvider oTreePathProvider = m_xTreeControlProvider.getSelectedPath();
XUnoNode oUnoNode = oTreePathProvider.getLastPathComponent();
@@ -225,29 +225,29 @@ import javax.swing.event.TreeWillExpandListener;
m_xTreeControlProvider.setSourceCode(sSourceCode);
}
-
+
public void convertCompleteSourceCode(int _nLanguage){
String sSourceCode = m_oSourceCodeGenerator.convertAllUnoObjects(_nLanguage);
- m_xTreeControlProvider.setSourceCode(sSourceCode);
+ m_xTreeControlProvider.setSourceCode(sSourceCode);
}
-
- protected XUnoNode getSelectedNode(){
+
+ protected XUnoNode getSelectedNode(){
return m_xTreeControlProvider.getSelectedNode();
}
-
-
+
+
// add the object to the hashtable for a possible access in the tree
private XUnoFacetteNode addUnoFacetteNode(XUnoNode _oParentNode, String _sNodeDescription, Object _oUnoObject){
return m_xTreeControlProvider.addUnoFacetteNode( _oParentNode, _sNodeDescription, _oUnoObject);
}
-
-
+
+
private XUnoMethodNode addMethodNode(Object _objectElement, XIdlMethod _xIdlMethod){
return m_xTreeControlProvider.addMethodNode(_objectElement, _xIdlMethod);
}
-
-
-
+
+
+
public void addMethodsToTreeNode(XUnoNode _oGrandParentNode, Object _oUnoParentObject, XIdlMethod[] _xIdlMethods){
if (this.m_oIntrospector.isValid(_xIdlMethods)){
for ( int n = 0; n < _xIdlMethods.length; n++ ) {
@@ -258,11 +258,11 @@ import javax.swing.event.TreeWillExpandListener;
_oGrandParentNode.addChildNode(oChildNode);
}
}
- }
+ }
}
}
-
-
+
+
private void addFacetteNodesToTreeNode(XUnoNode _oParentNode, Object _oUnoObject){
if (m_oIntrospector.hasMethods(_oUnoObject)){
XUnoFacetteNode oUnoFacetteNode = addUnoFacetteNode(_oParentNode, XUnoFacetteNode.SMETHODDESCRIPTION, _oUnoObject);
@@ -281,7 +281,7 @@ import javax.swing.event.TreeWillExpandListener;
}
}
-
+
private void addInterfacesToTreeNode(XUnoNode _oGrandParentNode, Object _oUnoParentObject, Type[] _aTypes) {
try {
if (_oUnoParentObject != null){
@@ -293,14 +293,14 @@ import javax.swing.event.TreeWillExpandListener;
catch( Exception exception ) {
exception.printStackTrace(System.out);
}}
-
-
+
+
// add all services for the given object to the tree under the node parent
private void addServicesToTreeNode(XUnoNode _oGrandParentNode, Object _oUnoObject) {
try{
- XServiceInfo xServiceInfo = ( XServiceInfo ) UnoRuntime.queryInterface( XServiceInfo.class, _oUnoObject );
+ XServiceInfo xServiceInfo = ( XServiceInfo ) UnoRuntime.queryInterface( XServiceInfo.class, _oUnoObject );
if ( xServiceInfo != null ){
- String[] sSupportedServiceNames = xServiceInfo.getSupportedServiceNames();
+ String[] sSupportedServiceNames = xServiceInfo.getSupportedServiceNames();
for ( int m = 0; m < sSupportedServiceNames.length; m++ ) {
String sServiceName = sSupportedServiceNames[m];
if (sServiceName.length() > 0){
@@ -313,16 +313,16 @@ import javax.swing.event.TreeWillExpandListener;
catch(Exception exception) {
exception.printStackTrace(System.out);
}}
-
-
+
+
private void addPropertiesAndInterfacesOfService(XUnoNode _oUnoServiceNode){
String sServiceName = _oUnoServiceNode.getClassName();
Object oUnoObject = _oUnoServiceNode.getUnoObject();
addInterfacesToTreeNode(_oUnoServiceNode, oUnoObject, m_oIntrospector.getInterfaces(oUnoObject, sServiceName));
- addPropertiesToTreeNode(_oUnoServiceNode, oUnoObject, m_oIntrospector.getProperties(oUnoObject, sServiceName));
+ addPropertiesToTreeNode(_oUnoServiceNode, oUnoObject, m_oIntrospector.getProperties(oUnoObject, sServiceName));
}
-
+
private void addPropertiesToTreeNode(XUnoNode _oParentNode, Object _oUnoParentObject, Property[] _aProperties) {
try {
if (_aProperties.length > 0){
@@ -339,7 +339,7 @@ import javax.swing.event.TreeWillExpandListener;
_oParentNode.addChildNode(oChildNode);
}
}
- }
+ }
}
}
}
@@ -347,8 +347,8 @@ import javax.swing.event.TreeWillExpandListener;
catch(Exception exception) {
exception.printStackTrace(System.out);
}}
-
-
+
+
public void addContainerElementsToTreeNode(XUnoNode _oParentNode, Object _oUnoParentObject){
Object[] oUnoContainerElements = m_oIntrospector.getUnoObjectsOfContainer(_oUnoParentObject);
if (m_oIntrospector.isValid(oUnoContainerElements)){
@@ -361,37 +361,37 @@ import javax.swing.event.TreeWillExpandListener;
}
}
-
+
private XUnoNode addUnoNode(XUnoNode _oParentNode, Object _oUnoObject, String _sLabel ){
XUnoNode oUnoNode = this.m_xTreeControlProvider.addUnoNode(_oUnoObject);
oUnoNode.setLabel(_sLabel);
- if (_oParentNode != null){
- _oParentNode.addChildNode(oUnoNode);
+ if (_oParentNode != null){
+ _oParentNode.addChildNode(oUnoNode);
}
setNodeFoldable(oUnoNode, _oUnoObject);
return oUnoNode;
}
-
-
+
+
private void setNodeFoldable(XUnoNode _oUnoNode, Object _oUnoObject){
if (_oUnoObject != null){
if (!m_oIntrospector.isObjectPrimitive(_oUnoObject)){
_oUnoNode.setFoldable(true);
}
- }
+ }
}
-
-
+
+
private XUnoNode addUnoNode(XUnoNode _oParentNode, Object _oUnoObject, Type _aType){
XUnoNode oUnoNode = this.m_xTreeControlProvider.addUnoNode(_oUnoObject, _aType);
- if (_oParentNode != null){
- _oParentNode.addChildNode(oUnoNode);
+ if (_oParentNode != null){
+ _oParentNode.addChildNode(oUnoNode);
}
setNodeFoldable(oUnoNode, _oUnoObject);
return oUnoNode;
}
-
-
+
+
private void addPropertySetInfoNodesToTreeNode(XUnoFacetteNode _oUnoFacetteNode, Object _oUnoObject){
if (_oUnoObject.getClass().isArray()){
Object[] object = ( Object[] ) _oUnoObject;
@@ -412,19 +412,19 @@ import javax.swing.event.TreeWillExpandListener;
for ( int i = 0; i < object.length; i++ ) {
if (m_oIntrospector.isObjectPrimitive(object[i])){
XUnoNode oChildNode = addUnoNode(_oUnoNode, null, UnoNode.getNodeDescription(object[i]));
- }
+ }
}
}
else{
String[] sDisplayValues = UnoNode.getDisplayValuesofPrimitiveArray(_oUnoObject);
for ( int i = 0; i < sDisplayValues.length; i++ ) {
XUnoNode oUnoNode = addUnoNode(_oUnoNode, null, sDisplayValues[i]);
- }
+ }
}
}
}
-
-
+
+
private void addPropertySetInfoSubNodes(XUnoPropertyNode _oUnoPropertyNode){
Property aProperty = _oUnoPropertyNode.getProperty();
_oUnoPropertyNode.addChildNode(m_xTreeControlProvider.addUnoPropertyNodeWithName(aProperty));
@@ -432,8 +432,8 @@ import javax.swing.event.TreeWillExpandListener;
_oUnoPropertyNode.addChildNode(m_xTreeControlProvider.addUnoPropertyNodeWithHandle(aProperty));
_oUnoPropertyNode.addChildNode(m_xTreeControlProvider.addUnoPropertyNodeWithAttributesDescription(aProperty));
}
-
-
+
+
private void addPropertyValueSubNodes(XUnoFacetteNode _oUnoFacetteNode, Object _oUnoObject){
if (m_oIntrospector.isUnoPropertyValueTypeObject(_oUnoObject)){
Object[] object = ( Object[] ) _oUnoObject;
@@ -455,8 +455,8 @@ import javax.swing.event.TreeWillExpandListener;
}
}
}
-
-
+
+
public boolean expandNode(XUnoNode _oUnoNode, XTreePathProvider _xTreePathProvider){
if ( _oUnoNode != null ) {
_oUnoNode.setFoldable(false);
@@ -489,7 +489,7 @@ import javax.swing.event.TreeWillExpandListener;
}
else if (m_xTreeControlProvider.isFacetteNode(_oUnoNode)){
XUnoFacetteNode oUnoFacetteNode = (XUnoFacetteNode) _oUnoNode;
- Object oUnoObject = _oUnoNode.getUnoObject();
+ Object oUnoObject = _oUnoNode.getUnoObject();
if (oUnoFacetteNode.isMethodNode()){
addMethodsToTreeNode(oUnoFacetteNode, oUnoObject, m_oIntrospector.getMethods(oUnoObject));
}
@@ -512,7 +512,7 @@ import javax.swing.event.TreeWillExpandListener;
if (oUnoFacetteNode.isInterfaceNode()){
addInterfacesToTreeNode(oUnoFacetteNode, oUnoObject, getTypes(oUnoObject));
}
- if (oUnoFacetteNode.isContainerNode()){
+ if (oUnoFacetteNode.isContainerNode()){
addContainerElementsToTreeNode(oUnoFacetteNode, oUnoObject);
}
}
@@ -534,13 +534,13 @@ import javax.swing.event.TreeWillExpandListener;
else{
addFacetteNodesToTreeNode(_oUnoNode, oUnoObject);
}
- }
+ }
}
return true;
}
-
-
-
+
+
+
public void applyFilter(XUnoFacetteNode _oUnoFacetteNode, String _sFilter){
for (int i = 0; i < _oUnoFacetteNode.getChildCount(); i++){
XUnoNode oUnoNode = _oUnoFacetteNode.getChild(i);
@@ -549,8 +549,8 @@ import javax.swing.event.TreeWillExpandListener;
}
_oUnoFacetteNode.setFilter(_sFilter);
}
-
-
+
+
/** In opposition to 'getUnoObjectOfTreeNode' this method inspects the passed node if it represents a Uno object
* If not it returns null
*
@@ -563,7 +563,7 @@ import javax.swing.event.TreeWillExpandListener;
return null;
}
-
+
public String getFilter(XUnoNode _oUnoNode){
String sFilter = "";
if (_oUnoNode != null){
@@ -586,8 +586,8 @@ import javax.swing.event.TreeWillExpandListener;
}
return sFilter;
}
-
-
+
+
/** In opposition to 'getUnoObjectOfexplictTreeNode' this method inspects the passed node if it represents a Uno object
* if not it keeps checking all ancestors until it finds a Uno representation
*/
@@ -608,11 +608,11 @@ import javax.swing.event.TreeWillExpandListener;
}
xTreePathProvider = xTreePathProvider.getParentPath();
}
- return null;
- }
-
-
- public void showPopUpMenu(Object _invoker, int x, int y) throws ClassCastException{
+ return null;
+ }
+
+
+ public void showPopUpMenu(Object _invoker, int x, int y) throws ClassCastException{
XUnoNode oUnoNode = getSelectedNode();
boolean bdoEnableInvoke = oUnoNode instanceof XUnoMethodNode;
// boolean bdoEnableSourceCodeGeneration = true;
diff --git a/odk/examples/java/Inspector/InstanceInspector.idl b/odk/examples/java/Inspector/InstanceInspector.idl
index 79e43cb181e4..8de7e920acd8 100644
--- a/odk/examples/java/Inspector/InstanceInspector.idl
+++ b/odk/examples/java/Inspector/InstanceInspector.idl
@@ -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,16 +29,16 @@
* 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 INCLUDED_ORG_OPENOFFICE_INSTANCEINSPECTOR_IDL
#define INCLUDED_ORG_OPENOFFICE_INSTANCEINSPECTOR_IDL
-#include <XInstanceInspector.idl>
-
-
-module org { module openoffice {
+#include <XInstanceInspector.idl>
+
+
+module org { module openoffice {
/**
* This service describes an instance inspector which can inspect
@@ -46,7 +46,7 @@ module org { module openoffice {
* interfaces, the supported services and properties of this onject.
*/
service InstanceInspector: XInstanceInspector;
-
+
}; };
#endif
diff --git a/odk/examples/java/Inspector/Introspector.java b/odk/examples/java/Inspector/Introspector.java
index f4078931e1ed..cdae4f4d88b2 100644
--- a/odk/examples/java/Inspector/Introspector.java
+++ b/odk/examples/java/Inspector/Introspector.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.IllegalTypeException;
@@ -81,18 +81,18 @@ import java.util.Vector;
import javax.swing.JOptionPane;
public class Introspector extends WeakBase{
-
+
private XIntrospection m_xIntrospection;
private XMultiComponentFactory m_xMultiComponentFactory;
private XComponentContext m_xComponentContext;
- private XTypeDescriptionEnumerationAccess m_xTDEnumerationAccess;
+ private XTypeDescriptionEnumerationAccess m_xTDEnumerationAccess;
private static XComponentContext xOfficeComponentContext;
private XIdlReflection mxIdlReflection;
private URL openHyperlink;
private static Introspector m_oIntrospector = null;
private XSimpleFileAccess xSimpleFileAccess = null;
-
+
public static Introspector getIntrospector(){
if (m_oIntrospector == null){
@@ -102,22 +102,22 @@ public class Introspector extends WeakBase{
return m_oIntrospector;
}
}
-
+
public static Introspector getIntrospector(XComponentContext _xComponentContext){
if (m_oIntrospector == null){
m_oIntrospector = new Introspector(_xComponentContext);
}
return m_oIntrospector;
}
-
-
+
+
/** Creates a new instance of Introspection */
private Introspector(XComponentContext _xComponentContext) {
try{
m_xComponentContext = _xComponentContext;
m_xMultiComponentFactory = m_xComponentContext.getServiceManager();
Object o = m_xMultiComponentFactory.createInstanceWithContext("com.sun.star.beans.Introspection", m_xComponentContext);
- m_xIntrospection = ( XIntrospection ) UnoRuntime.queryInterface(XIntrospection.class, o );
+ m_xIntrospection = ( XIntrospection ) UnoRuntime.queryInterface(XIntrospection.class, o );
Object oCoreReflection = getXMultiComponentFactory().createInstanceWithContext("com.sun.star.reflection.CoreReflection", getXComponentContext());
mxIdlReflection = (XIdlReflection) UnoRuntime.queryInterface(XIdlReflection.class, oCoreReflection);
initTypeDescriptionManager();
@@ -125,23 +125,23 @@ public class Introspector extends WeakBase{
catch( Exception exception ) {
System.err.println( exception );
}}
-
-
+
+
protected XComponentContext getXComponentContext(){
return m_xComponentContext;
}
-
-
+
+
protected XMultiComponentFactory getXMultiComponentFactory(){
return m_xMultiComponentFactory;
}
-
-
+
+
protected XIntrospectionAccess getXIntrospectionAccess(Object _oUnoComponent){
return m_xIntrospection.inspect(_oUnoComponent);
}
-
-
+
+
public boolean isContainer(Object _oUnoObject){
boolean bIsContainer = false;
try {
@@ -164,8 +164,8 @@ public class Introspector extends WeakBase{
}
return bIsContainer;
}
-
-
+
+
// add all containers for the given object to the tree under the node
// parent
public Object[] getUnoObjectsOfContainer(Object _oUnoParentObject) {
@@ -201,36 +201,36 @@ public class Introspector extends WeakBase{
}
return oRetComponents;
}
-
+
protected XIdlMethod[] getMethodsOfInterface(Type _aType){
try{
- XIdlClass xIdlClass = mxIdlReflection.forName(_aType.getTypeName());
+ XIdlClass xIdlClass = mxIdlReflection.forName(_aType.getTypeName());
return xIdlClass.getMethods();
}
catch( Exception e ) {
System.err.println( e );
return null;
- }}
+ }}
protected XIdlField[] getFieldsOfType(Type _aType){
try{
- XIdlClass xIdlClass = mxIdlReflection.forName(_aType.getTypeName());
+ XIdlClass xIdlClass = mxIdlReflection.forName(_aType.getTypeName());
return xIdlClass.getFields();
}
catch( Exception e ) {
System.err.println( e );
return null;
- }}
-
+ }}
+
public boolean hasMethods(Object _oUnoObject){
boolean bHasMethods = (getMethods(_oUnoObject).length > 0);
return bHasMethods;
}
-
-
+
+
// add all methods for the given object to the tree under the node parent
public XIdlMethod[] getMethods(Object _oUnoParentObject) {
try {
@@ -246,18 +246,18 @@ public class Introspector extends WeakBase{
return null;
}
-
+
public boolean hasProperties(Object _oUnoObject){
boolean bHasProperties = (getProperties(_oUnoObject).length > 0);
return bHasProperties;
}
-
-
+
+
protected Property[] getProperties( Object _oUnoParentObject){
try {
XIntrospectionAccess xIntrospectionAccess = getXIntrospectionAccess(_oUnoParentObject);
if (xIntrospectionAccess != null){
- Property[] aProperties = xIntrospectionAccess.getProperties(com.sun.star.beans.PropertyConcept.ATTRIBUTES + com.sun.star.beans.PropertyConcept.PROPERTYSET);
+ Property[] aProperties = xIntrospectionAccess.getProperties(com.sun.star.beans.PropertyConcept.ATTRIBUTES + com.sun.star.beans.PropertyConcept.PROPERTYSET);
return aProperties;
}
}
@@ -266,8 +266,8 @@ public class Introspector extends WeakBase{
}
return null;
}
-
-
+
+
protected Property[] getProperties(Object _oUnoObject, String _sServiceName){
Property[] aProperties = getProperties(_oUnoObject);
List aListOfProperties = java.util.Arrays.asList(aProperties);
@@ -284,7 +284,7 @@ public class Introspector extends WeakBase{
aPropertiesVector.toArray(aRetProperties);
return aRetProperties;
}
-
+
protected Type[] getInterfaces(Object _oUnoObject, String _sServiceName){
Type[] aTypes = getInterfaces(_oUnoObject);
@@ -303,12 +303,12 @@ public class Introspector extends WeakBase{
return aRetTypes;
}
-
+
public boolean hasInterfaces(Object _oUnoObject){
return (getInterfaces(_oUnoObject).length > 0);
}
-
+
protected Type[] getInterfaces(Object _oUnoParentObject){
Type[] aTypes = new Type[]{};
XTypeProvider xTypeProvider = ( XTypeProvider ) UnoRuntime.queryInterface( XTypeProvider.class, _oUnoParentObject);
@@ -317,25 +317,25 @@ public class Introspector extends WeakBase{
}
return aTypes;
}
-
-
-
+
+
+
public static boolean isObjectSequence(Object _oUnoObject){
Type aType = AnyConverter.getType(_oUnoObject);
return aType.getTypeClass().getValue() == TypeClass.SEQUENCE_value;
}
-
-
+
+
public static boolean isObjectPrimitive(Object _oUnoObject){
boolean breturn = false;
if (_oUnoObject != null){
Type aType = AnyConverter.getType(_oUnoObject);
- breturn = isObjectPrimitive(_oUnoObject.getClass(), aType.getTypeClass());
+ breturn = isObjectPrimitive(_oUnoObject.getClass(), aType.getTypeClass());
}
return breturn;
}
-
-
+
+
public static boolean isPrimitive(TypeClass _typeClass){
return (( _typeClass == TypeClass.BOOLEAN )
|| ( _typeClass == TypeClass.BYTE )
@@ -351,7 +351,7 @@ public class Introspector extends WeakBase{
|| ( _typeClass == TypeClass.UNSIGNED_LONG )
|| ( _typeClass == TypeClass.UNSIGNED_SHORT ));
}
-
+
public static boolean isObjectPrimitive(Class _oUnoClass, TypeClass _typeClass){
return !( ( !_oUnoClass.isPrimitive() ) && ( _typeClass != TypeClass.ARRAY )
&& ( _typeClass != TypeClass.BOOLEAN )
@@ -367,9 +367,9 @@ public class Introspector extends WeakBase{
&& ( _typeClass != TypeClass.UNSIGNED_HYPER )
&& ( _typeClass != TypeClass.UNSIGNED_LONG )
&& ( _typeClass != TypeClass.UNSIGNED_SHORT ));
- }
-
-
+ }
+
+
protected void initTypeDescriptionManager() {
try {
Object oTypeDescriptionManager = getXComponentContext().getValueByName("/singletons/com.sun.star.reflection.theTypeDescriptionManager");
@@ -382,14 +382,14 @@ public class Introspector extends WeakBase{
protected XTypeDescriptionEnumerationAccess getXTypeDescriptionEnumerationAccess(){
return m_xTDEnumerationAccess;
}
-
-
+
+
protected XConstantTypeDescription[] getFieldsOfConstantGroup(String _sTypeClass){
XConstantTypeDescription[] xConstantTypeDescriptions = null;
try {
TypeClass[] eTypeClasses = new com.sun.star.uno.TypeClass[1];
eTypeClasses[0] = com.sun.star.uno.TypeClass.CONSTANTS;
- XTypeDescriptionEnumeration xTDEnumeration = m_xTDEnumerationAccess.createTypeDescriptionEnumeration(getModuleName(_sTypeClass), eTypeClasses, TypeDescriptionSearchDepth.INFINITE);
+ XTypeDescriptionEnumeration xTDEnumeration = m_xTDEnumerationAccess.createTypeDescriptionEnumeration(getModuleName(_sTypeClass), eTypeClasses, TypeDescriptionSearchDepth.INFINITE);
while (xTDEnumeration.hasMoreElements()) {
XTypeDescription xTD = xTDEnumeration.nextTypeDescription();
if (xTD.getName().equals(_sTypeClass)){
@@ -397,21 +397,21 @@ public class Introspector extends WeakBase{
xConstantTypeDescriptions = xConstantsTypeDescription.getConstants();
}
String sName = xTD.getName();
- }
+ }
return xConstantTypeDescriptions;
} catch ( java.lang.Exception e) {
System.out.println(System.out);
}
return null;
}
-
+
private XServiceTypeDescription getServiceTypeDescription(String _sServiceName, TypeClass _eTypeClass){
try{
if (_sServiceName.length() > 0){
TypeClass[] eTypeClasses = new com.sun.star.uno.TypeClass[2];
eTypeClasses[0] = com.sun.star.uno.TypeClass.SERVICE;
eTypeClasses[1] = _eTypeClass;
- XTypeDescriptionEnumeration xTDEnumeration = getXTypeDescriptionEnumerationAccess().createTypeDescriptionEnumeration(Introspector.getModuleName(_sServiceName), eTypeClasses, TypeDescriptionSearchDepth.INFINITE);
+ XTypeDescriptionEnumeration xTDEnumeration = getXTypeDescriptionEnumerationAccess().createTypeDescriptionEnumeration(Introspector.getModuleName(_sServiceName), eTypeClasses, TypeDescriptionSearchDepth.INFINITE);
while (xTDEnumeration.hasMoreElements()) {
XTypeDescription xTD = xTDEnumeration.nextTypeDescription();
if (xTD.getName().equals(_sServiceName)){
@@ -425,8 +425,8 @@ public class Introspector extends WeakBase{
ex.printStackTrace(System.out);
return null;
}}
-
-
+
+
public XPropertyTypeDescription[] getPropertyDescriptionsOfService(String _sServiceName){
try {
XServiceTypeDescription xServiceTypeDescription = getServiceTypeDescription(_sServiceName, com.sun.star.uno.TypeClass.PROPERTY);
@@ -439,8 +439,8 @@ public class Introspector extends WeakBase{
}
return new XPropertyTypeDescription[]{};
}
-
-
+
+
public XTypeDescription getReferencedType(String _sTypeName){
XTypeDescription xTypeDescription = null;
try{
@@ -458,8 +458,8 @@ public class Introspector extends WeakBase{
}
return xTypeDescription;
}
-
-
+
+
public XInterfaceTypeDescription[] getInterfaceDescriptionsOfService(String _sServiceName){
try {
XServiceTypeDescription xServiceTypeDescription = getServiceTypeDescription(_sServiceName, com.sun.star.uno.TypeClass.INTERFACE);
@@ -473,7 +473,7 @@ public class Introspector extends WeakBase{
return new XInterfaceTypeDescription[]{};
}
-
+
static boolean hasByName(XTypeDescription[] _xTypeDescriptions, String _sTypeName){
for (int i = 0; i < _xTypeDescriptions.length; i++){
if (_xTypeDescriptions[i].getName().equals(_sTypeName)){
@@ -482,8 +482,8 @@ public class Introspector extends WeakBase{
}
return false;
}
-
-
+
+
public static String getModuleName(String _sTypeClass){
int nlastindex = _sTypeClass.lastIndexOf(".");
if (nlastindex > -1){
@@ -492,9 +492,9 @@ public class Introspector extends WeakBase{
else{
return "";
}
- }
-
+ }
+
public static String getShortClassName(String _sClassName){
String sShortClassName = _sClassName;
int nindex = _sClassName.lastIndexOf(".");
@@ -502,25 +502,25 @@ public class Introspector extends WeakBase{
sShortClassName = _sClassName.substring(nindex + 1);
}
return sShortClassName;
- }
-
-
+ }
+
+
public static boolean isUnoTypeObject(Object _oUnoObject){
return isOfUnoType(_oUnoObject, "com.sun.star.uno.Type");
}
-
+
public static boolean isUnoPropertyTypeObject(Object _oUnoObject){
return isOfUnoType(_oUnoObject, "com.sun.star.beans.Property");
}
-
+
public static boolean isUnoPropertyValueTypeObject(Object _oUnoObject){
return isOfUnoType(_oUnoObject, "com.sun.star.beans.PropertyValue");
}
-
-
+
+
public static boolean isOfUnoType(Object _oUnoObject, String _sTypeName){
boolean bIsUnoObject = false;
if (_oUnoObject != null){
@@ -530,7 +530,7 @@ public class Introspector extends WeakBase{
if (oUnoArray.length > 0){
bIsUnoObject = ( oUnoArray[0].getClass().getName().equals(_sTypeName));
}
- }
+ }
}
}
else{
@@ -538,8 +538,8 @@ public class Introspector extends WeakBase{
}
return bIsUnoObject;
}
-
-
+
+
public String getConstantDisplayString(int _nValue, XConstantTypeDescription[] _xConstantTypeDescription, String _sDisplayString){
String sPrefix = "";
int[] nbits = new int[_xConstantTypeDescription.length];
@@ -553,7 +553,7 @@ public class Introspector extends WeakBase{
}
return _sDisplayString;
}
-
+
public static boolean isValid(Object[] _oObject){
if (_oObject != null){
@@ -576,20 +576,20 @@ public class Introspector extends WeakBase{
public static boolean isArray(Object _oObject){
return _oObject.getClass().isArray();
}
-
-
+
+
public boolean hasSupportedServices(Object _oUnoObject){
boolean bHasSupportedServices = false;
XServiceInfo xServiceInfo = ( XServiceInfo ) UnoRuntime.queryInterface( XServiceInfo.class, _oUnoObject);
if ( xServiceInfo != null ){
- String[] sSupportedServiceNames = xServiceInfo.getSupportedServiceNames();
+ String[] sSupportedServiceNames = xServiceInfo.getSupportedServiceNames();
bHasSupportedServices = sSupportedServiceNames.length > 0;
}
return bHasSupportedServices;
}
-
-
- public Object getValueOfText(TypeClass aTypeClass, String sText){
+
+
+ public Object getValueOfText(TypeClass aTypeClass, String sText){
Object oReturn = null;
switch (aTypeClass.getValue()){
case TypeClass.CHAR_value:
@@ -600,7 +600,7 @@ public class Introspector extends WeakBase{
case TypeClass.ENUM_value:
break;
case TypeClass.FLOAT_value:
- oReturn = Float.valueOf(sText);
+ oReturn = Float.valueOf(sText);
break;
case TypeClass.HYPER_value:
oReturn = Long.valueOf(sText);
@@ -609,7 +609,7 @@ public class Introspector extends WeakBase{
oReturn = Integer.valueOf(sText);
break;
case TypeClass.SHORT_value:
- oReturn = Byte.valueOf(sText);
+ oReturn = Byte.valueOf(sText);
break;
case TypeClass.STRING_value:
oReturn = sText;
@@ -621,14 +621,14 @@ public class Introspector extends WeakBase{
oReturn = Integer.valueOf(sText);
break;
case TypeClass.UNSIGNED_SHORT_value:
- oReturn = Byte.valueOf(sText);
+ oReturn = Byte.valueOf(sText);
break;
- default:
+ default:
}
return oReturn;
- }
-
+ }
+
public XSimpleFileAccess getXSimpleFileAccess(){
try {
if (xSimpleFileAccess == null){
@@ -640,22 +640,22 @@ public class Introspector extends WeakBase{
ex.printStackTrace(System.out);
return null;
}}
-
-
+
+
public boolean isValidSDKInstallationPath(String _sSDKInstallationPath){
boolean bIsValid = false;
try {
String sIDLFolder = Introspector.addToPath(_sSDKInstallationPath, Inspector.sIDLDOCUMENTSUBFOLDER);
String sIndexFile = Introspector.addToPath(_sSDKInstallationPath, "index.html");
if (getXSimpleFileAccess() != null){
- bIsValid = (getXSimpleFileAccess().exists(sIDLFolder) && getXSimpleFileAccess().exists(sIndexFile));
+ bIsValid = (getXSimpleFileAccess().exists(sIDLFolder) && getXSimpleFileAccess().exists(sIndexFile));
}
} catch (com.sun.star.uno.Exception ex) {
ex.printStackTrace(System.out);
}
return bIsValid;
}
-
+
public static String addToPath(String _sPath, String _sSubPath){
if (!_sPath.endsWith("/")){
@@ -663,5 +663,5 @@ public class Introspector extends WeakBase{
}
return _sPath + _sSubPath;
}
-
+
}
diff --git a/odk/examples/java/Inspector/MethodParametersDialog.java b/odk/examples/java/Inspector/MethodParametersDialog.java
index a2ebf7e66c41..803873703afb 100644
--- a/odk/examples/java/Inspector/MethodParametersDialog.java
+++ b/odk/examples/java/Inspector/MethodParametersDialog.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.reflection.ParamInfo;
@@ -63,7 +63,7 @@ public class MethodParametersDialog extends JDialog{
private ActionListener oActionListener;
private JButton jHelpButton = new JButton("Help");
private JButton jOKButton = new JButton("Ok");
- private JButton jInvokeButton = new JButton("Invoke");
+ private JButton jInvokeButton = new JButton("Invoke");
private Object m_oReturnButton = null;
private Object m_oUnoObject = null;
private Object m_oUnoReturnObject = null;
@@ -71,8 +71,8 @@ public class MethodParametersDialog extends JDialog{
private JPanel jResultPanel = null;
private boolean bisdiposed = false;
private XUnoMethodNode m_xUnoMethodNode;
-
-
+
+
public MethodParametersDialog(XUnoMethodNode _xUnoMethodNode){
m_xUnoMethodNode = _xUnoMethodNode;
m_xIdlMethod = _xUnoMethodNode.getXIdlMethod();
@@ -80,8 +80,8 @@ public class MethodParametersDialog extends JDialog{
m_oUnoObject = m_xUnoMethodNode.getUnoObject();
Object[] m_aParameterObjects = new Object[m_aParamInfo.length];
}
-
-
+
+
public Vector getMethodObjects() {
super.setModal(true);
addBorderPanel(getContentPane(), BorderLayout.NORTH);
@@ -99,7 +99,7 @@ public class MethodParametersDialog extends JDialog{
for (int i = 0; i < m_aParameterPanels.length; i++){
m_aParameterPanels[i] = new ParameterPanel(m_aParamInfo[i]);
jPnlParamContainer.add(m_aParameterPanels[i]);
- }
+ }
jPnlParamContainer.add(new ButtonPanel(), java.awt.BorderLayout.SOUTH);
getContentPane().add(jPnlParamContainer, java.awt.BorderLayout.CENTER);
pack();
@@ -108,7 +108,7 @@ public class MethodParametersDialog extends JDialog{
super.setFocusable(true);
super.setFocusableWindowState(true);
super.requestFocus();
- m_aParameterPanels[0].getInputComponent().requestFocusInWindow();
+ m_aParameterPanels[0].getInputComponent().requestFocusInWindow();
setVisible(true);
if (!bisdiposed){
Vector aMethodObjects = new Vector();
@@ -122,8 +122,8 @@ public class MethodParametersDialog extends JDialog{
return null;
}
}
-
-
+
+
private void insertResultPanel(Exception _oInvocationException){
boolean bAddPanel = false;
if (jResultPanel == null){
@@ -143,22 +143,22 @@ public class MethodParametersDialog extends JDialog{
}
jResultPanel.add(jLblResult,BorderLayout.WEST);
if (bAddPanel){
- int nPos = jPnlParamContainer.getComponentCount() - 1;
+ int nPos = jPnlParamContainer.getComponentCount() - 1;
jPnlParamContainer.add(jResultPanel, nPos);
}
super.pack();
super.validate();
}
-
-
+
+
private Object[] getParameterValues(){
Object[] oParameterValues = new Object[m_aParameterPanels.length];
for (int i = 0; i < m_aParameterPanels.length; i++){
oParameterValues[i] = m_aParameterPanels[i].getValue();
- }
+ }
return oParameterValues;
}
-
+
private boolean isCompleted(){
boolean bIsCompleted = true;
@@ -167,11 +167,11 @@ public class MethodParametersDialog extends JDialog{
if (!bIsCompleted){
break;
}
- }
+ }
return bIsCompleted;
}
-
-
+
+
private void addBorderPanel(java.awt.Container _jContainer, String _sLayout){
JPanel jPnlBorder = new JPanel();
jPnlBorder.setPreferredSize(new java.awt.Dimension(10, 10));
@@ -184,8 +184,8 @@ public class MethodParametersDialog extends JDialog{
jPnlBorder.setMaximumSize(new java.awt.Dimension(10, 10));
_jContainer.add(jPnlBorder);
}
-
-
+
+
private class ParameterPanel extends JPanel{
private JComponent m_jComponent;
private TypeClass m_aTypeClass = null;
@@ -207,13 +207,13 @@ public class MethodParametersDialog extends JDialog{
addGapPanel(jPnlCenter1);
switch (m_aTypeClass.getValue()){
case TypeClass.BOOLEAN_value:
- jComboBox.setBackground(new java.awt.Color(255, 255, 255));
+ jComboBox.setBackground(new java.awt.Color(255, 255, 255));
jComboBox.setPreferredSize(new java.awt.Dimension(50, 19));
jComboBox.addItem("True");
jComboBox.addItem("False");
jComboBox.addKeyListener(new UpdateUIAdapter());
jPnlCenter1.add(jComboBox);
- m_jComponent = jComboBox;
+ m_jComponent = jComboBox;
break;
case TypeClass.BYTE_value:
case TypeClass.CHAR_value:
@@ -230,20 +230,20 @@ public class MethodParametersDialog extends JDialog{
jTextField.setPreferredSize(new java.awt.Dimension(50, 19));
jTextField.addKeyListener(new UpdateUIAdapter());
jPnlCenter1.add(jTextField);
- m_jComponent = jTextField;
+ m_jComponent = jTextField;
break;
default:
System.out.println("Type " + m_aTypeClass.getValue() + " not yet defined in 'ParameterPanel()'");
- }
+ }
add(jPnlCenter1, java.awt.BorderLayout.CENTER);
JPanel jPnlEast = new JPanel();
- add(jPnlEast, BorderLayout.EAST);
+ add(jPnlEast, BorderLayout.EAST);
}
-
+
private JComponent getInputComponent(){
return m_jComponent;
}
-
+
public Object getValue(){
Object oReturn = null;
if (m_jComponent instanceof JTextField){
@@ -256,8 +256,8 @@ public class MethodParametersDialog extends JDialog{
}
return oReturn;
}
-
-
+
+
public boolean isCompleted(){
if (m_jComponent instanceof JTextField){
return !((JTextField) m_jComponent).getText().equals("");
@@ -268,7 +268,7 @@ public class MethodParametersDialog extends JDialog{
}
}
-
+
private class UpdateUIAdapter extends KeyAdapter{
public void keyReleased(KeyEvent e){
boolean bIsCompleted = isCompleted();
@@ -280,8 +280,8 @@ public class MethodParametersDialog extends JDialog{
}
}
}
-
-
+
+
private class ButtonPanel extends JPanel{
public ButtonPanel(){
@@ -295,7 +295,7 @@ public class MethodParametersDialog extends JDialog{
public void actionPerformed(ActionEvent e) {
oActionListener.actionPerformed(e);
}
- });
+ });
jHelpButton.setEnabled(oActionListener != null);
jPnlBottomCenter.add(jHelpButton);
addGapPanel(jPnlBottomCenter);
@@ -305,7 +305,7 @@ public class MethodParametersDialog extends JDialog{
invokeParameterMethod();
dispose();
}
- });
+ });
jOKButton.setEnabled(isCompleted());
jInvokeButton.setEnabled(isCompleted());
jInvokeButton.addActionListener(new ActionListener() {
@@ -313,7 +313,7 @@ public class MethodParametersDialog extends JDialog{
invokeParameterMethod();
}
});
-
+
jPnlBottomCenter.add(jOKButton);
addGapPanel(jPnlBottomCenter);
jPnlBottomCenter.add(jInvokeButton);
@@ -327,18 +327,18 @@ public class MethodParametersDialog extends JDialog{
dispose();
}
});
-
+
jPnlBottomCenter.add(jCancelButton);
add(jPnlBottomCenter);
}
}
-
-
+
+
public void addActionListener(ActionListener _oActionListener){
oActionListener = _oActionListener;
- jHelpButton.setEnabled(oActionListener != null);
+ jHelpButton.setEnabled(oActionListener != null);
}
-
+
public void invokeParameterMethod(){
try{
@@ -348,6 +348,6 @@ public class MethodParametersDialog extends JDialog{
} catch (Exception ex) {
insertResultPanel(ex);
m_oUnoReturnObject = null;
- }}
-
+ }}
+
}
diff --git a/odk/examples/java/Inspector/ObjectInspector.xcu b/odk/examples/java/Inspector/ObjectInspector.xcu
index 79459ab48f24..93c2711f2ec8 100755
--- a/odk/examples/java/Inspector/ObjectInspector.xcu
+++ b/odk/examples/java/Inspector/ObjectInspector.xcu
@@ -3,8 +3,8 @@
<!ENTITY ProductName "Object Inspector">
<!ENTITY ProductVersion "0.8">
]>
-<oor:component-data
- xmlns:oor="http://openoffice.org/2001/registry"
+<oor:component-data
+ xmlns:oor="http://openoffice.org/2001/registry"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
oor:name="ObjectInspector" oor:package="org.openoffice.inspector">
<prop oor:name="Language" oor:type="xs:string">
diff --git a/odk/examples/java/Inspector/ProtocolHandlerAddon.java b/odk/examples/java/Inspector/ProtocolHandlerAddon.java
index ad3b0efe8747..2844d25e3def 100644
--- a/odk/examples/java/Inspector/ProtocolHandlerAddon.java
+++ b/odk/examples/java/Inspector/ProtocolHandlerAddon.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.XComponentContext;
@@ -42,12 +42,12 @@ import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XTypeProvider;
import com.sun.star.lang.XServiceInfo;
import com.sun.star.uno.Type;
-import com.sun.star.frame.XStatusListener;
-import com.sun.star.frame.XDispatchProvider;
-import com.sun.star.frame.XDispatch;
-import com.sun.star.frame.XModel;
-import com.sun.star.frame.XFrame;
-import com.sun.star.frame.DispatchDescriptor;
+import com.sun.star.frame.XStatusListener;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XModel;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.DispatchDescriptor;
import com.sun.star.awt.XToolkit;
import com.sun.star.awt.XWindowPeer;
import com.sun.star.awt.XMessageBox;
@@ -62,14 +62,14 @@ public class ProtocolHandlerAddon {
*/
public static class ProtocolHandlerAddonImpl extends WeakBase implements
XDispatchProvider,
- XDispatch,
+ XDispatch,
XInitialization,
XServiceInfo {
/** The service name, that must be used to get an instance of this service.
*/
static private final String[] m_serviceNames = { "com.sun.star.frame.ProtocolHandler" };
-
+
/** The component context, that gives access to the service manager and all registered services.
*/
private XComponentContext m_xCmpCtx;
@@ -83,7 +83,7 @@ public class ProtocolHandlerAddon {
private XFrame m_xFrame;
private XStatusListener m_xStatusListener;
-
+
/** The constructor of the inner class has a XMultiServiceFactory parameter.
* @param xmultiservicefactoryInitialization A special service factory
* could be introduced while initializing.
@@ -91,7 +91,7 @@ public class ProtocolHandlerAddon {
public ProtocolHandlerAddonImpl( XComponentContext xComponentContext ) {
m_xCmpCtx = xComponentContext;
}
-
+
/** This method is a member of the interface for initializing an object
* directly after its creation.
* @param object This array of arbitrary objects will be passed to the
@@ -114,7 +114,7 @@ public class ProtocolHandlerAddon {
m_xCmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.awt.Toolkit",
m_xCmpCtx));
}
-
+
/** This method returns an array of all supported service names.
* @return Array of supported service names.
*/
@@ -125,7 +125,7 @@ public class ProtocolHandlerAddon {
public static String[] getServiceNames() {
return m_serviceNames;
}
-
+
/** This method returns true, if the given service will be
* supported by the component.
* @param stringService Service name.
@@ -133,22 +133,22 @@ public class ProtocolHandlerAddon {
*/
public boolean supportsService( String sService ) {
int len = m_serviceNames.length;
-
+
for( int i=0; i < len; i++) {
if ( sService.equals( m_serviceNames[i] ) )
return true;
}
-
+
return false;
}
-
+
/** Return the class name of the component.
* @return Class name of the component.
*/
public String getImplementationName() {
return ProtocolHandlerAddonImpl.class.getName();
}
-
+
// XDispatchProvider
public XDispatch queryDispatch( /*IN*/com.sun.star.util.URL aURL,
/*IN*/String sTargetFrameName,
@@ -164,23 +164,23 @@ public class ProtocolHandlerAddon {
}
return xRet;
}
-
+
public XDispatch[] queryDispatches( /*IN*/DispatchDescriptor[] seqDescripts ) {
int nCount = seqDescripts.length;
XDispatch[] lDispatcher = new XDispatch[nCount];
-
+
for( int i=0; i<nCount; ++i )
lDispatcher[i] = queryDispatch( seqDescripts[i].FeatureURL,
seqDescripts[i].FrameName,
seqDescripts[i].SearchFlags );
-
- return lDispatcher;
+
+ return lDispatcher;
}
// XDispatch
public void dispatch( /*IN*/com.sun.star.util.URL aURL,
/*IN*/com.sun.star.beans.PropertyValue[] aArguments ) {
-
+
if ( aURL.Protocol.compareTo("org.openoffice.Office.addon.example:") == 0 )
{
if ( aURL.Path.compareTo( "Function1" ) == 0 )
@@ -197,11 +197,11 @@ public class ProtocolHandlerAddon {
}
}
}
-
+
public void addStatusListener( /*IN*/XStatusListener xControl,
/*IN*/com.sun.star.util.URL aURL ) {
}
-
+
public void removeStatusListener( /*IN*/XStatusListener xControl,
/*IN*/com.sun.star.util.URL aURL ) {
}
@@ -221,7 +221,7 @@ public class ProtocolHandlerAddon {
aDescriptor.WindowAttributes = WindowAttribute.BORDER |
WindowAttribute.MOVEABLE |
WindowAttribute.CLOSEABLE;
-
+
XWindowPeer xPeer = m_xToolkit.createWindow( aDescriptor );
if ( null != xPeer ) {
XMessageBox xMsgBox = (XMessageBox)UnoRuntime.queryInterface(
@@ -235,12 +235,12 @@ public class ProtocolHandlerAddon {
}
}
} catch ( com.sun.star.uno.Exception e) {
- // do your error handling
+ // do your error handling
}
}
}
-
-
+
+
/** Gives a factory for creating the service.
* This method is called by the <code>JavaLoader</code>
* <p>
@@ -256,14 +256,14 @@ public class ProtocolHandlerAddon {
*/
public static XSingleComponentFactory __getComponentFactory( String sImplementationName ) {
XSingleComponentFactory xFactory = null;
-
+
if ( sImplementationName.equals( ProtocolHandlerAddonImpl.class.getName() ) )
xFactory = Factory.createComponentFactory(ProtocolHandlerAddonImpl.class,
ProtocolHandlerAddonImpl.getServiceNames());
-
+
return xFactory;
}
-
+
/** Writes the service information into the given registry key.
* This method is called by the <code>JavaLoader</code>.
* @return returns true if the operation succeeded
diff --git a/odk/examples/java/Inspector/SourceCodeGenerator.java b/odk/examples/java/Inspector/SourceCodeGenerator.java
index 6661fe9604ad..932854cd0d28 100644
--- a/odk/examples/java/Inspector/SourceCodeGenerator.java
+++ b/odk/examples/java/Inspector/SourceCodeGenerator.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.UnknownPropertyException;
@@ -60,12 +60,12 @@ public class SourceCodeGenerator {
private XLanguageSourceCodeGenerator m_xLanguageSourceCodeGenerator;
private String sHeaderCode = "";
private String sStatementCode = "";
- private String sMainMethodSignature = "";
-
+ private String sMainMethodSignature = "";
+
private Hashtable aVariables = new Hashtable();
private final String SSUFFIXSEPARATOR = "_";
private final String SVARIABLENAME = "VariableName";
- private final String SARRAYVARIABLENAME = "VariableNameList";
+ private final String SARRAYVARIABLENAME = "VariableNameList";
private final String SUNOOBJECTNAME = "oUnobject";
private final String SUNOSTRUCTNAME = "aUnoStruct";
private Introspector m_oIntrospector;
@@ -75,17 +75,17 @@ public class SourceCodeGenerator {
private boolean bXPropertySetExceptionsAreAdded = false;
private XUnoNode oInitialUnoNode = null;
private final String sINITIALVARIABLENAME = "_oUnoEntryObject";
-
-
+
+
/** Creates a new instance of SourceCodeGenerator */
public SourceCodeGenerator(int _nLanguage) {
this.setLanguage(_nLanguage);
m_oIntrospector = Introspector.getIntrospector();
}
-
+
public String addSourceCodeOfUnoObject(XTreePathProvider _xTreepathProvider, boolean _brememberPath, boolean _bAddMethodSignature, boolean _baddHeader){
- String sSourceCode = "";
+ String sSourceCode = "";
String sVariableName = "";
if (_xTreepathProvider != null) {
for (int i = 0; i < _xTreepathProvider.getPathCount(); i++){
@@ -106,7 +106,7 @@ public class SourceCodeGenerator {
sVariableName = oUnoReturnObjectDefinition.getVariableName();
}
}
- else if (oUnoNode instanceof XUnoPropertyNode){
+ else if (oUnoNode instanceof XUnoPropertyNode){
XUnoPropertyNode oUnoPropertyNode = (XUnoPropertyNode) oUnoNode;
Any oReturnObject = com.sun.star.uno.Any.complete(oUnoPropertyNode.getUnoReturnObject());
UnoObjectDefinition oUnoReturnObjectDefinition = new UnoObjectDefinition(oReturnObject);
@@ -118,7 +118,7 @@ public class SourceCodeGenerator {
}
}
}
- }
+ }
String sCompleteCode = combineCompleteSourceCode(sMainMethodSignature, _baddHeader);
xTreepathProvider = _xTreepathProvider;
if (_brememberPath){
@@ -126,10 +126,10 @@ public class SourceCodeGenerator {
}
return sCompleteCode;
}
-
-
+
+
private void setLanguage(int _nLanguage){
- XLanguageSourceCodeGenerator xLanguageSourceCodeGenerator = null;
+ XLanguageSourceCodeGenerator xLanguageSourceCodeGenerator = null;
switch(_nLanguage){
case XLanguageSourceCodeGenerator.nJAVA:
xLanguageSourceCodeGenerator = new JavaCodeGenerator();
@@ -147,15 +147,15 @@ public class SourceCodeGenerator {
m_xLanguageSourceCodeGenerator = xLanguageSourceCodeGenerator;
}
}
-
+
private void resetSourceCodeGeneration(int _nLanguage){
- aVariables.clear();
+ aVariables.clear();
this.sHeaderStatements.clear();
setLanguage(_nLanguage);
String sHeaderCode = "";
sStatementCode = "";
}
-
+
private String generateVariableNameFromMethod(String _sMethodName, String _sPrefix, boolean _bConsiderAll){
String sReturn = "";
if (_sMethodName.startsWith(_sPrefix)){
@@ -175,8 +175,8 @@ public class SourceCodeGenerator {
}
return sReturn;
}
-
-
+
+
private String generateVariableNameFromMethod(XIdlMethod _xIdlMethod){
// todo: refactor this!!!
String sMethodName = _xIdlMethod.getName();
@@ -208,18 +208,18 @@ public class SourceCodeGenerator {
}
return sReturn;
}
-
-
+
+
public String convertAllUnoObjects(int _nLanguage){
- String sSourceCode = "";
+ String sSourceCode = "";
resetSourceCodeGeneration(_nLanguage);
int ncount = aTreepathProviders.size();
for (int i=0; i< ncount; i++){
- sSourceCode = addSourceCodeOfUnoObject((XTreePathProvider) aTreepathProviders.get(i), false, (i==0), (i == (ncount-1)));
+ sSourceCode = addSourceCodeOfUnoObject((XTreePathProvider) aTreepathProviders.get(i), false, (i==0), (i == (ncount-1)));
}
return sSourceCode;
}
-
+
private UnoObjectDefinition getUnoObjectDefinition(XTreePathProvider _xTreePathProvider, XUnoMethodNode _oUnoMethodNode, int _nindex){
XUnoNode oUnoNode = null;
Object oUnoReturnObject = null;
@@ -250,12 +250,12 @@ public class SourceCodeGenerator {
}
return oUnoObjectDefinition;
}
-
-
+
+
private String combineCompleteSourceCode(String _sMethodSignature, boolean _bAddHeader){
String sCompleteCode = "";
if (_bAddHeader){
- sMainMethodSignature = m_xLanguageSourceCodeGenerator.getMainMethodSignatureSourceCode(oInitialUnoNode, sINITIALVARIABLENAME);
+ sMainMethodSignature = m_xLanguageSourceCodeGenerator.getMainMethodSignatureSourceCode(oInitialUnoNode, sINITIALVARIABLENAME);
m_xLanguageSourceCodeGenerator.assignqueryInterfaceHeaderSourceCode();
sCompleteCode += getHeaderSourceCode();
}
@@ -263,12 +263,12 @@ public class SourceCodeGenerator {
sCompleteCode += sStatementCode;
if (_bAddHeader){
sCompleteCode += m_xLanguageSourceCodeGenerator.getMethodTerminationSourceCode();
- sCompleteCode += "\n" + m_xLanguageSourceCodeGenerator.getCommentSign() + "...";
+ sCompleteCode += "\n" + m_xLanguageSourceCodeGenerator.getCommentSign() + "...";
}
return sCompleteCode;
}
-
+
public String getPropertyStatementSourceCode(XUnoPropertyNode _oUnoPropertyNode, String _sVariableName, UnoObjectDefinition _oUnoReturnObjectDefinition){
String sReturnObjectVariableDefinition = "";
String sStatement = "";
@@ -280,7 +280,7 @@ public class SourceCodeGenerator {
sReturnObjectVariableDefinition = getVariableInitialization(_oUnoReturnObjectDefinition, false);
sStatement += m_xLanguageSourceCodeGenerator.getStructSourceCode(sReturnObjectVariableDefinition, oUnoObjectDefinition.getVariableName(), sPropertyName);
return sStatement;
- }
+ }
}
sStatement += addQueryInterfaceSourceCode(oUnoObjectDefinition, _sVariableName, "com.sun.star.beans.XPropertySet");
if (_oUnoReturnObjectDefinition.getTypeClass().getValue() != TypeClass.VOID_value){
@@ -290,8 +290,8 @@ public class SourceCodeGenerator {
addXPropertySetRelatedExceptions();
return sStatement;
}
-
-
+
+
public String getMethodStatementSourceCode(XUnoMethodNode _oUnoMethodNode, String _sVariableName, UnoObjectDefinition _oUnoReturnObjectDefinition){
String sReturnObjectVariableDefinition = "";
String sStatement = "";
@@ -311,8 +311,8 @@ public class SourceCodeGenerator {
addExceptions(xIdlMethod);
return sStatement;
}
-
-
+
+
private String addQueryInterfaceSourceCode(UnoObjectDefinition _oUnoObjectDefinition, String _sVariableName, String _sTypeName){
String sLocStatement = "";
if (m_xLanguageSourceCodeGenerator.needsqueryInterface()){
@@ -321,13 +321,13 @@ public class SourceCodeGenerator {
sLocStatement += m_xLanguageSourceCodeGenerator.getqueryInterfaceSourceCode(_sTypeName, sObjectVariableDefinition, _sVariableName);
}
}
- else{
+ else{
_oUnoObjectDefinition.setVariableName(_sVariableName);
}
return sLocStatement;
}
-
-
+
+
private void addXPropertySetRelatedExceptions(){
if (!bXPropertySetExceptionsAreAdded){
sExceptions.add("com.sun.star.beans.UnknownPropertyException");
@@ -337,8 +337,8 @@ public class SourceCodeGenerator {
baddExceptionHandling = true;
}
}
-
-
+
+
private void addExceptions(XIdlMethod _xIdlMethod){
XIdlClass[] xIdlClasses = _xIdlMethod.getExceptionTypes();
for (int i = 0; i > xIdlClasses.length; i++){
@@ -346,12 +346,12 @@ public class SourceCodeGenerator {
baddExceptionHandling = true;
}
}
-
+
private String getRootDescription(XUnoNode _oUnoNode){
return "_o" + _oUnoNode.toString();
}
-
-
+
+
private String getHeaderSourceCode(){
Enumeration aEnumeration = aVariables.elements();
while(aEnumeration.hasMoreElements()){
@@ -369,10 +369,10 @@ public class SourceCodeGenerator {
sHeaderSourcecode += m_xLanguageSourceCodeGenerator.getFinalHeaderStatements();
return sHeaderSourcecode +"\n" + m_xLanguageSourceCodeGenerator.getCommentSign() + "...\n";
}
-
-
+
+
private class HeaderStatements extends Vector{
-
+
public boolean contains(Object _oElement){
String sCompName = (String) _oElement;
for (int i = 0; i < this.size(); i++){
@@ -383,8 +383,8 @@ public class SourceCodeGenerator {
}
return false;
}
-
-
+
+
public boolean add(Object _oElement){
if (_oElement instanceof String){
if (!contains(_oElement)){
@@ -394,9 +394,9 @@ public class SourceCodeGenerator {
}
return false;
}
- }
-
-
+ }
+
+
private boolean isVariableDeclared(UnoObjectDefinition _oUnoObjectDefinition, String _sDefaultStemName){
boolean bisDeclared = false;
if (!_sDefaultStemName.equals("")){
@@ -436,11 +436,11 @@ public class SourceCodeGenerator {
}
return bisDeclared;
}
-
-
+
+
private String addUniqueVariableName(String _sStemVariableName, UnoObjectDefinition _oUnoObjectDefinition){
boolean bElementexists = true;
- int a = 2;
+ int a = 2;
String sCompName = _sStemVariableName;
while (bElementexists){
if (! aVariables.containsKey(sCompName)){
@@ -452,9 +452,9 @@ public class SourceCodeGenerator {
return sCompName;
}
-
-
- private String getTypeString(String _sTypeName, TypeClass _aTypeClass, boolean _bAsHeaderSourceCode){
+
+
+ private String getTypeString(String _sTypeName, TypeClass _aTypeClass, boolean _bAsHeaderSourceCode){
String sTypeString = "";
switch (_aTypeClass.getValue()){
case TypeClass.BOOLEAN_value:
@@ -464,49 +464,49 @@ public class SourceCodeGenerator {
sTypeString = m_xLanguageSourceCodeGenerator.getbyteTypeDescription();
break;
case TypeClass.CHAR_value:
- sTypeString = m_xLanguageSourceCodeGenerator.getcharTypeDescription();
+ sTypeString = m_xLanguageSourceCodeGenerator.getcharTypeDescription();
break;
case TypeClass.DOUBLE_value:
- sTypeString = m_xLanguageSourceCodeGenerator.getdoubleTypeDescription();
- break;
+ sTypeString = m_xLanguageSourceCodeGenerator.getdoubleTypeDescription();
+ break;
case TypeClass.FLOAT_value:
- sTypeString = m_xLanguageSourceCodeGenerator.getfloatTypeDescription();
- break;
+ sTypeString = m_xLanguageSourceCodeGenerator.getfloatTypeDescription();
+ break;
case TypeClass.HYPER_value:
- sTypeString = m_xLanguageSourceCodeGenerator.gethyperTypeDescription();
- break;
+ sTypeString = m_xLanguageSourceCodeGenerator.gethyperTypeDescription();
+ break;
case TypeClass.LONG_value:
- sTypeString = m_xLanguageSourceCodeGenerator.getlongTypeDescription();
- break;
+ sTypeString = m_xLanguageSourceCodeGenerator.getlongTypeDescription();
+ break;
case TypeClass.SHORT_value:
- sTypeString = m_xLanguageSourceCodeGenerator.getshortTypeDescription();
- break;
+ sTypeString = m_xLanguageSourceCodeGenerator.getshortTypeDescription();
+ break;
case TypeClass.STRING_value:
- sTypeString = m_xLanguageSourceCodeGenerator.getstringTypeDescription(_bAsHeaderSourceCode);
- break;
+ sTypeString = m_xLanguageSourceCodeGenerator.getstringTypeDescription(_bAsHeaderSourceCode);
+ break;
case TypeClass.UNSIGNED_HYPER_value:
- sTypeString = m_xLanguageSourceCodeGenerator.getunsignedhyperTypeDescription();
- break;
+ sTypeString = m_xLanguageSourceCodeGenerator.getunsignedhyperTypeDescription();
+ break;
case TypeClass.UNSIGNED_LONG_value:
- sTypeString = m_xLanguageSourceCodeGenerator.getunsignedlongTypeDescription();
- break;
+ sTypeString = m_xLanguageSourceCodeGenerator.getunsignedlongTypeDescription();
+ break;
case TypeClass.UNSIGNED_SHORT_value:
- sTypeString = m_xLanguageSourceCodeGenerator.getdoubleTypeDescription();
- break;
+ sTypeString = m_xLanguageSourceCodeGenerator.getdoubleTypeDescription();
+ break;
case TypeClass.SEQUENCE_value:
//TODO consider mulitdimensional Arrays
XTypeDescription xTypeDescription = Introspector.getIntrospector().getReferencedType(_sTypeName);
if (xTypeDescription != null){
sTypeString = getTypeString(xTypeDescription.getName(), xTypeDescription.getTypeClass(), _bAsHeaderSourceCode);
}
- break;
+ break;
case TypeClass.ANY_value:
sTypeString = m_xLanguageSourceCodeGenerator.getanyTypeDescription(_bAsHeaderSourceCode);
break;
case TypeClass.TYPE_value:
sTypeString = m_xLanguageSourceCodeGenerator.getObjectTypeDescription("com.sun.star.uno.Type", _bAsHeaderSourceCode);
break;
- case TypeClass.ENUM_value:
+ case TypeClass.ENUM_value:
case TypeClass.STRUCT_value:
case TypeClass.INTERFACE_ATTRIBUTE_value:
case TypeClass.INTERFACE_METHOD_value:
@@ -514,14 +514,14 @@ public class SourceCodeGenerator {
case TypeClass.PROPERTY_value:
sTypeString = m_xLanguageSourceCodeGenerator.getObjectTypeDescription(_sTypeName, _bAsHeaderSourceCode);
break;
- default:
+ default:
}
return sTypeString;
- }
-
-
+ }
+
+
private String getVariableDeclaration(UnoObjectDefinition _oUnoObjectDefinition, boolean _bInitialize, String _sVariableDefaultName){
- TypeClass aTypeClass = _oUnoObjectDefinition.getTypeClass();
+ TypeClass aTypeClass = _oUnoObjectDefinition.getTypeClass();
TypeClass aLocTypeClass = aTypeClass;
boolean bIsArray = false;
if (_oUnoObjectDefinition.getUnoObject() != null){
@@ -543,8 +543,8 @@ public class SourceCodeGenerator {
addUniqueVariableName(sVariableName, _oUnoObjectDefinition);
return sVariableDeclaration;
}
-
-
+
+
public String getVariableInitialization(UnoObjectDefinition _oUnoObjectDefinition, boolean _bInitialize){
String sObjectVariableDeclaration = "";
String sVariableName = _oUnoObjectDefinition.getVariableName();
@@ -556,9 +556,9 @@ public class SourceCodeGenerator {
}
return sObjectVariableDeclaration;
}
-
-
-
+
+
+
public String getVariableNameforUnoObject(String _sShortClassName){
if (_sShortClassName.startsWith("X")){
return "x" + _sShortClassName.substring(1);
@@ -567,18 +567,18 @@ public class SourceCodeGenerator {
return _sShortClassName;
}
}
-
-
+
+
class UnoObjectDefinition{
Object m_oUnoObject = null;
Type aType = null;
- String sVariableStemName = "";
+ String sVariableStemName = "";
String m_sCentralVariableStemName = "";
String sVariableName = "";
String m_sTypeName = "";
TypeClass m_aTypeClass = null;
Object[] m_oParameterObjects = null;
-
+
public UnoObjectDefinition(Any _oUnoObject){
m_sTypeName = _oUnoObject.getType().getTypeName();
@@ -586,8 +586,8 @@ class UnoObjectDefinition{
m_oUnoObject = _oUnoObject;
m_sCentralVariableStemName = getCentralVariableStemName(m_aTypeClass);
}
-
-
+
+
public UnoObjectDefinition(Object _oUnoObject, String _sTypeName, TypeClass _aTypeClass){
m_oUnoObject = _oUnoObject;
m_sTypeName = _sTypeName;
@@ -595,15 +595,15 @@ class UnoObjectDefinition{
m_sCentralVariableStemName = getCentralVariableStemName(m_aTypeClass);
}
-
+
public UnoObjectDefinition(Object _oUnoObject, String _sTypeName){
m_oUnoObject = _oUnoObject;
m_sTypeName = _sTypeName;
m_aTypeClass = AnyConverter.getType(_oUnoObject).getTypeClass();
m_sCentralVariableStemName = getCentralVariableStemName(m_aTypeClass);
}
-
-
+
+
private String getCentralVariableStemName(TypeClass _aTypeClass){
String sCentralVariableStemName = "";
int nTypeClass = _aTypeClass.getValue();
@@ -614,7 +614,7 @@ class UnoObjectDefinition{
if (xTypeDescription != null){
sCentralVariableStemName = getCentralVariableStemName(xTypeDescription.getTypeClass());
}
- break;
+ break;
case TypeClass.TYPE_value:
sCentralVariableStemName = SVARIABLENAME;
break;
@@ -627,64 +627,64 @@ class UnoObjectDefinition{
case TypeClass.PROPERTY_value:
String sShortClassName = m_oIntrospector.getShortClassName(getTypeName());
sCentralVariableStemName = getVariableNameforUnoObject(sShortClassName);
- default:
+ default:
sCentralVariableStemName = SVARIABLENAME;
- }
+ }
return sCentralVariableStemName;
}
-
+
/** may return null
*/
public Object getUnoObject(){
return m_oUnoObject;
}
-
+
public void setTypeClass(TypeClass _aTypeClass){
sVariableStemName = "";
m_aTypeClass = _aTypeClass;
}
-
-
+
+
public TypeClass getTypeClass(){
return m_aTypeClass;
}
-
-
+
+
public void setTypeName(String _sTypeName){
sVariableStemName = "";
m_sTypeName = _sTypeName;
- }
-
-
+ }
+
+
public String getTypeName(){
return m_sTypeName;
- }
-
-
+ }
+
+
public void setCentralVariableStemName(String _sCentralVariableStemName){
m_sCentralVariableStemName = _sCentralVariableStemName;
}
-
-
+
+
public String getVariableStemName(){
if (sVariableStemName.equals("")){
sVariableStemName = getVariableStemName(m_aTypeClass);
}
return sVariableStemName;
}
-
-
+
+
public void addParameterObjects(Object[] _oParameterObjects){
m_oParameterObjects = _oParameterObjects;
}
-
+
public Object[] getParameterObjects(){
return m_oParameterObjects;
}
-
+
public boolean hasParameterObjects(){
boolean breturn = false;
if (m_oParameterObjects != null){
@@ -692,8 +692,8 @@ class UnoObjectDefinition{
}
return breturn;
}
-
-
+
+
public String getVariableStemName(TypeClass _aTypeClass){
int nTypeClass = _aTypeClass.getValue();
switch(nTypeClass){
@@ -703,7 +703,7 @@ class UnoObjectDefinition{
case TypeClass.DOUBLE_value:
case TypeClass.FLOAT_value:
sVariableStemName = "f" + m_sCentralVariableStemName;
- break;
+ break;
case TypeClass.BYTE_value:
case TypeClass.HYPER_value:
case TypeClass.LONG_value:
@@ -712,18 +712,18 @@ class UnoObjectDefinition{
case TypeClass.UNSIGNED_SHORT_value:
case TypeClass.SHORT_value:
sVariableStemName = "n" + m_sCentralVariableStemName;
- break;
+ break;
case TypeClass.CHAR_value:
case TypeClass.STRING_value:
sVariableStemName = "s" + m_sCentralVariableStemName;
- break;
+ break;
case TypeClass.SEQUENCE_value:
//TODO consider mulitdimensional Arrays
XTypeDescription xTypeDescription = Introspector.getIntrospector().getReferencedType(getTypeName());
if (xTypeDescription != null){
sVariableStemName = getVariableStemName(xTypeDescription.getTypeClass());
}
- break;
+ break;
case TypeClass.TYPE_value:
sVariableStemName = "a" + m_sCentralVariableStemName;
break;
@@ -731,7 +731,7 @@ class UnoObjectDefinition{
sVariableStemName = "o" + m_sCentralVariableStemName;
break;
case TypeClass.STRUCT_value:
- case TypeClass.ENUM_value:
+ case TypeClass.ENUM_value:
sVariableStemName = "a" + m_sCentralVariableStemName;
break;
case TypeClass.INTERFACE_ATTRIBUTE_value:
@@ -740,35 +740,35 @@ class UnoObjectDefinition{
case TypeClass.PROPERTY_value:
String sShortClassName = m_oIntrospector.getShortClassName(getTypeName());
sVariableStemName = getVariableNameforUnoObject(sShortClassName);
- default:
- }
+ default:
+ }
return sVariableStemName;
}
-
-
+
+
private void setVariableName(String _sVariableName){
sVariableName = _sVariableName;
}
-
-
+
+
private String getVariableName(String _sCentralVariableStemName){
if (!_sCentralVariableStemName.equals("")){
this.m_sCentralVariableStemName = _sCentralVariableStemName;
}
return getVariableName();
}
-
-
+
+
private String getVariableName() throws NullPointerException{
if (sVariableName.equals("")){
- int a = 2;
+ int a = 2;
sVariableName = getVariableStemName();
boolean bleaveloop = false;
while (!bleaveloop){
if (aVariables.containsKey(sVariableName)){
String sUnoObjectIdentity = ((UnoObjectDefinition) aVariables.get(sVariableName)).getUnoObject().toString();
if (m_oUnoObject != null){
- if ((sUnoObjectIdentity.equals(m_oUnoObject.toString()) && (!m_oIntrospector.isPrimitive(this.getTypeClass())) &&
+ if ((sUnoObjectIdentity.equals(m_oUnoObject.toString()) && (!m_oIntrospector.isPrimitive(this.getTypeClass())) &&
(! m_oIntrospector.isObjectSequence(m_oUnoObject)))){
bleaveloop = true;
}
@@ -789,8 +789,8 @@ class UnoObjectDefinition{
return sVariableName;
}
}
-
-
+
+
public String getStringValueOfObject(Object _oUnoObject, TypeClass _aTypeClass){
String sReturn = "";
switch (_aTypeClass.getValue()){
@@ -836,13 +836,13 @@ class UnoObjectDefinition{
nshortValue = ((Short) _oUnoObject).shortValue();
sReturn += Short.toString(nshortValue);
break;
- default:
+ default:
System.out.println("Type " + _aTypeClass.getValue() + " not yet defined in 'getStringValueOfObject()'");
- }
+ }
return sReturn;
}
-
-
+
+
public String getMethodParameterValueDescription(XUnoMethodNode _oUnoMethodNode, Object[] _oParamObjects, boolean _bIncludeParameterNames){
String sParamSourceCode = "";
ParamInfo[] aParamInfos = _oUnoMethodNode.getXIdlMethod().getParameterInfos();
@@ -855,7 +855,7 @@ class UnoObjectDefinition{
String sParamDescription = getStringValueOfObject(_oParamObjects[i], aTypeClass);
sParamDescription = this.m_xLanguageSourceCodeGenerator.castLiteral(sParamDescription, aTypeClass);
sParamSourceCode += sParamDescription;
-
+
if (i < _oParamObjects.length - 1){
sParamSourceCode += ", ";
}
@@ -863,33 +863,33 @@ class UnoObjectDefinition{
}
return sParamSourceCode;
}
-
-
+
+
public class JavaCodeGenerator implements XLanguageSourceCodeGenerator{
String sStatementsCode = "";
boolean bAddAnyConverter = false;
// boolean bAddTypeImport = false;
boolean bIsPropertyUnoObjectDefined = false;
-
+
public JavaCodeGenerator(){
}
-
-
+
+
public String getStatementTerminationCharacter(){
return ";";
}
-
-
+
+
public String getHeaderSourceCode(Object _oUnoObject, String _sClassName, TypeClass _aTypeClass){
String sClassName = _sClassName;
String sHeaderStatement = "";
if (_oUnoObject != null){
- if (!m_oIntrospector.isObjectPrimitive(_oUnoObject)){
+ if (!m_oIntrospector.isObjectPrimitive(_oUnoObject)){
if (m_oIntrospector.isObjectSequence(_oUnoObject)){
XTypeDescription xTypeDescription = m_oIntrospector.getReferencedType(sClassName);
if (xTypeDescription != null){
if (!m_oIntrospector.isPrimitive(xTypeDescription.getTypeClass())){
- sClassName = getTypeString(xTypeDescription.getName(), xTypeDescription.getTypeClass(), true);
+ sClassName = getTypeString(xTypeDescription.getName(), xTypeDescription.getTypeClass(), true);
}
// primitive Types are not supposed to turn up in the import section...
else{
@@ -909,27 +909,27 @@ class UnoObjectDefinition{
}
if (!sClassName.equals("")){
sHeaderStatement = "import " + sClassName + ";\n";
- }
+ }
}
return sHeaderStatement;
}
-
-
+
+
public String getFinalHeaderStatements(){
return "";
}
-
-
+
+
public void assignqueryInterfaceHeaderSourceCode(){
sHeaderStatements.add("import com.sun.star.uno.UnoRuntime;\n");
sHeaderStatements.add("import com.sun.star.uno.XInterface;\n");
if (bAddAnyConverter){
sHeaderStatements.add("import com.sun.star.uno.AnyConverter;\n");
- }
+ }
}
-
-
-
+
+
+
public String getConvertedSourceCodeValueOfObject(String _sReturnVariableName, String _sObjectDescription, TypeClass _aTypeClass, String _sTypeName){
boolean bLocAddAnyConverter = true;
String sReturn = "";
@@ -964,7 +964,7 @@ class UnoObjectDefinition{
case TypeClass.SHORT_value:
sReturn = _sReturnVariableName + " = AnyConverter.toShort(" + _sObjectDescription + ")";
break;
- case TypeClass.UNSIGNED_SHORT_value:
+ case TypeClass.UNSIGNED_SHORT_value:
sReturn = _sReturnVariableName + " = AnyConverter.toUnsignedShort(" + _sObjectDescription + ")";
break;
case TypeClass.STRING_value:
@@ -988,12 +988,12 @@ class UnoObjectDefinition{
}
return sReturn;
}
-
-
+
+
public String getStructSourceCode(String _sReturnVariableDescription, String _sObjectDescription, String _sMember){
return "\t" + _sReturnVariableDescription + " = " + _sObjectDescription + "." + _sMember + ";";
}
-
+
public String getMainMethodSignatureSourceCode(XUnoNode _oUnoNode, String _soReturnObjectDescription){
//TODO try to use + _oUnoNode.getClassName() instead of the hack
String sReturn = "public void codesnippet(XInterface " + _soReturnObjectDescription + "){";
@@ -1005,18 +1005,18 @@ class UnoObjectDefinition{
public String getMethodSeparator(){
return ".";
- }
+ }
public boolean needsqueryInterface(){
return true;
}
-
+
public String getqueryInterfaceSourceCode(String _sClassName, String _sReturnVariableName, String _sIncomingObjectName){
String sShortClassName = m_oIntrospector.getShortClassName(_sClassName);
return "\t" + _sReturnVariableName + " = (" + sShortClassName + ") UnoRuntime.queryInterface(" + sShortClassName + ".class, " + _sIncomingObjectName + ");\n";
}
-
+
public String getPropertyValueGetterSourceCode(String _sPropertyName, String _sReturnVariableName, String _sIncomingObjectName, TypeClass _aTypeClass, String _sTypeName){
String sObjectDescription = _sIncomingObjectName + ".getPropertyValue(\"" + _sPropertyName + "\")";
String sReturn = getConvertedSourceCodeValueOfObject(_sReturnVariableName, sObjectDescription, _aTypeClass, _sTypeName);
@@ -1025,8 +1025,8 @@ class UnoObjectDefinition{
return sReturn;
// return "\t" + _sReturnVariableName + " = " + _sIncomingObjectName + ".getPropertyValue(\"" + _sPropertyName + "\");";
}
-
-
+
+
public String getObjectTypeDescription(String _sClassName, boolean _bAsHeader){
String sReturn = "";
if (_bAsHeader){
@@ -1037,8 +1037,8 @@ class UnoObjectDefinition{
}
return sReturn;
}
-
-
+
+
public String getMethodTerminationSourceCode(){
String sReturn = "";
int nIndex = 1;
@@ -1063,7 +1063,7 @@ class UnoObjectDefinition{
sReturn += "\n}";
return sReturn;
}
-
+
public String castLiteral(String _sExpression, TypeClass _aTypeClass){
String sReturn = "";
switch (_aTypeClass.getValue()){
@@ -1074,7 +1074,7 @@ class UnoObjectDefinition{
sReturn = "(byte) " + _sExpression;
break;
case TypeClass.CHAR_value:
- sReturn = "'" + _sExpression + "'";
+ sReturn = "'" + _sExpression + "'";
break;
case TypeClass.DOUBLE_value:
sReturn = "(double) " + _sExpression;
@@ -1097,56 +1097,56 @@ class UnoObjectDefinition{
sReturn = _sExpression;
break;
case TypeClass.ENUM_value:
- default:
- sReturn = _sExpression;
+ default:
+ sReturn = _sExpression;
System.out.println("Type " + _aTypeClass.getValue() + " not yet defined in 'castliteral()'");
- }
+ }
return sReturn;
}
-
-
+
+
public String getbooleanTypeDescription(){
- return "boolean";
+ return "boolean";
}
public String getbyteTypeDescription(){
- return "byte";
+ return "byte";
}
public String getshortTypeDescription(){
- return "short";
+ return "short";
}
public String getunsignedshortTypeDescription(){
- return "short";
+ return "short";
}
public String getlongTypeDescription(){
- return "int";
+ return "int";
}
public String getunsignedlongTypeDescription(){
- return "int";
+ return "int";
}
public String gethyperTypeDescription(){
- return "long";
+ return "long";
}
public String getunsignedhyperTypeDescription(){
- return "long";
+ return "long";
}
public String getfloatTypeDescription(){
- return "float";
+ return "float";
}
public String getdoubleTypeDescription(){
- return "double";
+ return "double";
}
public String getcharTypeDescription(){
- return "char";
+ return "char";
}
public String getstringTypeDescription(boolean _bAsHeaderSourceCode){
@@ -1154,7 +1154,7 @@ class UnoObjectDefinition{
return "";
}
else{
- return "String";
+ return "String";
}
}
@@ -1175,13 +1175,13 @@ class UnoObjectDefinition{
return "Object";
}
}
-
-
+
+
public String getStringValue(String _sValue){
return _sValue;
}
-
-
+
+
public String getVariableDeclaration(String _sTypeString, String _sVariableName, boolean _bIsArray, TypeClass _aTypeClass, boolean _bInitialize){
String sReturn = "";
if (_bIsArray){
@@ -1192,8 +1192,8 @@ class UnoObjectDefinition{
}
return sReturn;
}
-
-
+
+
public String getArrayDeclaration(String _sVariableDeclaration){
String sReturn = "";
String[] sDeclarations = _sVariableDeclaration.split(" ");
@@ -1208,28 +1208,28 @@ class UnoObjectDefinition{
}
return sReturn;
}
-
+
public String getCommentSign(){
return "//";
}
- }
-
-
+ }
+
+
public class BasicCodeGenerator implements XLanguageSourceCodeGenerator{
String sStatementsCode = "";
-
+
public BasicCodeGenerator(){
}
-
+
public String getHeaderSourceCode(Object _oUnoObject, String _sClassName, TypeClass _aTypeClass){
String sHeaderStatement = "";
return sHeaderStatement;
}
-
+
public String getFinalHeaderStatements(){
return "";
}
-
+
public String getMainMethodSignatureSourceCode(XUnoNode _oUnoNode, String _soReturnObjectDescription){
//TODO try to use + _oUnoNode.getClassName() instead of the hack
return "Sub Main(" + _soReturnObjectDescription + " as " + getanyTypeDescription(false) + ")";
@@ -1241,41 +1241,41 @@ class UnoObjectDefinition{
public void assignqueryInterfaceHeaderSourceCode(){
}
-
+
public String getMethodSeparator(){
return ".";
- }
-
-
+ }
+
+
public String getqueryInterfaceSourceCode(String _sClassName, String _sReturnVariableName, String _sIncomingObjectName){
return _sIncomingObjectName;
}
-
+
public String getPropertyValueGetterSourceCode(String _sPropertyName, String _sReturnVariableName, String _sIncomingObjectName, TypeClass _aTypeClass, String _sTypeName){
return "\t" + _sReturnVariableName + " = " + _sIncomingObjectName + "." + _sPropertyName;
}
-
-
- public String getStructSourceCode(String _sReturnVariableDescription, String _sObjectDescription, String _sMember){
+
+
+ public String getStructSourceCode(String _sReturnVariableDescription, String _sObjectDescription, String _sMember){
return getPropertyValueGetterSourceCode(_sMember, _sReturnVariableDescription, _sObjectDescription, null, "" );
- }
+ }
public String getConvertedSourceCodeValueOfObject(String _sReturnVariableName, String _sObjectDescription, TypeClass _aTypeClass, String _sTypeName){
- return _sReturnVariableName + " = " + _sObjectDescription;
+ return _sReturnVariableName + " = " + _sObjectDescription;
}
-
+
public String getObjectTypeDescription(String _sClassName, boolean _bAsHeader){
return "Object";
}
-
-
+
+
public String getMethodTerminationSourceCode(){
- return "\nEnd Sub\n";
+ return "\nEnd Sub\n";
}
-
+
public String castLiteral(String _sExpression, TypeClass _aTypeClass){
String sReturn = "";
switch (_aTypeClass.getValue()){
@@ -1296,57 +1296,57 @@ class UnoObjectDefinition{
sReturn = "\"" +_sExpression + "\"";
break;
case TypeClass.ENUM_value:
- default:
- sReturn = _sExpression;
+ default:
+ sReturn = _sExpression;
System.out.println("Type " + _aTypeClass.getValue() + " not yet defined in 'castliteral()'");
- }
+ }
return sReturn;
- }
-
-
-
+ }
+
+
+
public String getbooleanTypeDescription(){
- return "Boolean";
+ return "Boolean";
}
public String getbyteTypeDescription(){
- return "Integer";
+ return "Integer";
}
public String getshortTypeDescription(){
- return "Integer";
+ return "Integer";
}
public String getunsignedshortTypeDescription(){
- return "Integer";
+ return "Integer";
}
public String getlongTypeDescription(){
- return "Integer";
+ return "Integer";
}
public String getunsignedlongTypeDescription(){
- return "Long";
+ return "Long";
}
public String gethyperTypeDescription(){
- return "Long";
+ return "Long";
}
public String getunsignedhyperTypeDescription(){
- return "Long";
+ return "Long";
}
public String getfloatTypeDescription(){
- return "Double";
+ return "Double";
}
public String getdoubleTypeDescription(){
- return "Double";
+ return "Double";
}
public String getcharTypeDescription(){
- return "String";
+ return "String";
}
public String getstringTypeDescription(boolean _bAsHeaderSourceCode){
@@ -1354,7 +1354,7 @@ class UnoObjectDefinition{
return "";
}
else{
- return "String";
+ return "String";
}
}
@@ -1375,12 +1375,12 @@ class UnoObjectDefinition{
return "Object";
}
}
-
+
public String getStatementTerminationCharacter(){
return "";
}
-
-
+
+
public String getVariableDeclaration(String _sTypeString, String _sVariableName, boolean bIsArray, TypeClass _aTypeClass, boolean _bInitialize){
String sReturn = "";
if (bIsArray){
@@ -1392,12 +1392,12 @@ class UnoObjectDefinition{
return sReturn;
}
-
+
public String getStringValue(String _sValue){
return _sValue;
}
-
-
+
+
public String getArrayDeclaration(String _sVariableDeclaration){
String sReturn = "";
String[] sDeclarations = _sVariableDeclaration.split(" ");
@@ -1416,37 +1416,37 @@ class UnoObjectDefinition{
public String getCommentSign(){
return "'";
}
-
- }
+
+ }
public class CPlusPlusCodeGenerator implements XLanguageSourceCodeGenerator{
String sStatementsCode = "";
boolean bIncludeStringHeader = false;
boolean bIncludeAny = false;
boolean bIncludeSequenceHeader = false;
-
+
public CPlusPlusCodeGenerator(){
}
-
+
private String getCSSNameSpaceString(){
return "css";
}
-
+
public String getStatementTerminationCharacter(){
return ";";
}
-
-
+
+
public String getHeaderSourceCode(Object _oUnoObject, String _sClassName, TypeClass _aTypeClass){
String sClassName = _sClassName;
String sHeaderStatement = "";
if (_oUnoObject != null){
- if (!m_oIntrospector.isObjectPrimitive(_oUnoObject)){
+ if (!m_oIntrospector.isObjectPrimitive(_oUnoObject)){
if (m_oIntrospector.isObjectSequence(_oUnoObject)){
XTypeDescription xTypeDescription = m_oIntrospector.getReferencedType(sClassName);
if (xTypeDescription != null){
if (!m_oIntrospector.isPrimitive(xTypeDescription.getTypeClass())){
- sClassName = getTypeString(xTypeDescription.getName(), xTypeDescription.getTypeClass(), true);
+ sClassName = getTypeString(xTypeDescription.getName(), xTypeDescription.getTypeClass(), true);
}
// primitive Types are not supposed to turn up in the import section...
else{
@@ -1465,22 +1465,22 @@ class UnoObjectDefinition{
return sHeaderStatement;
}
-
-
+
+
public String getFinalHeaderStatements(){
String sReturn = "";
sReturn += "\nnamespace " + getCSSNameSpaceString() + " = com::sun::star;\n";
sReturn += "using namespace rtl;\n";
return sReturn;
}
-
-
+
+
private String getHeaderOfClass(String _sClassName){
return "#include \"" + _sClassName.replace('.', '/') + ".hpp\"\n"; // #include <com/sun/star/uno/XComponentContext.hpp>
}
+
-
-
+
public void assignqueryInterfaceHeaderSourceCode(){
sHeaderStatements.add("#include \"sal/config.h\"\n");
sHeaderStatements.add("#include \"sal/types.h\"\n");
@@ -1496,8 +1496,8 @@ class UnoObjectDefinition{
sHeaderStatements.add(getHeaderOfClass("com.sun.star.uno.Any"));
}
}
-
-
+
+
public String getMainMethodSignatureSourceCode(XUnoNode _oUnoNode, String _soReturnObjectDescription){
String sReturn = "";
sReturn = "void codesnippet(const " + getCSSNameSpaceString() + "::uno::Reference<" + getCSSNameSpaceString() + "::uno::XInterface>& " + _soReturnObjectDescription + " ){";
@@ -1514,10 +1514,10 @@ class UnoObjectDefinition{
sReturn += ", ";
}
sReturn += getObjectTypeDescription(sCurException, false);
-
+
}
}
-
+
}
sReturn += "{";
return sReturn;
@@ -1527,13 +1527,13 @@ class UnoObjectDefinition{
public boolean needsqueryInterface(){
return true;
}
-
-
+
+
public String getqueryInterfaceSourceCode(String _sClassName, String _sReturnVariableName, String _sIncomingObjectName){
return "\t" + _sReturnVariableName + "( " + _sIncomingObjectName + ", " + getCSSNameSpaceString() + "::uno::UNO_QUERY_THROW);\n";
}
-
-
+
+
public String getPropertyValueGetterSourceCode(String _sPropertyName, String _sReturnVariableName, String _sIncomingObjectName, TypeClass _aTypeClass, String _sTypeName){
String sFirstLine = "\t";
String sReturnVariableName = _sReturnVariableName;
@@ -1552,12 +1552,12 @@ class UnoObjectDefinition{
return sFirstLine + sSecondLine;
}
-
- public String getStructSourceCode(String _sReturnVariableDescription, String _sObjectDescription, String _sMember){
+
+ public String getStructSourceCode(String _sReturnVariableDescription, String _sObjectDescription, String _sMember){
return "\t" + _sReturnVariableDescription + " = " + _sObjectDescription + "->" + _sMember + ";";
}
-
-
+
+
public String getConvertedSourceCodeValueOfObject(String _sReturnVariableName, String _sObjectDescription, TypeClass _aTypeClass, String _sTypeName){
// if (m_oIntrospector.isPrimitive(_aTypeClass)){
return _sObjectDescription + " >>= " + _sReturnVariableName;
@@ -1565,15 +1565,15 @@ class UnoObjectDefinition{
// else{
// return _sReturnVariableName + " = " + _sObjectDescription;
// }
- }
-
-
+ }
+
+
public String getStringValue(String _sValue){
bIncludeStringHeader = true;
return "OUString(RTL_CONSTASCII_USTRINGPARAM(\"" + _sValue + "\"))";
}
-
-
+
+
public String getObjectTypeDescription(String _sClassName, boolean _bAsHeader){
String sReturn = "";
if (_bAsHeader){
@@ -1586,17 +1586,17 @@ class UnoObjectDefinition{
}
return sReturn;
}
-
-
+
+
public String getMethodTerminationSourceCode(){
- return "\n}";
+ return "\n}";
}
-
+
public String getMethodSeparator(){
return "->";
- }
-
-
+ }
+
+
public String castLiteral(String _sExpression, TypeClass _aTypeClass){
String sReturn = "";
switch (_aTypeClass.getValue()){
@@ -1619,55 +1619,55 @@ class UnoObjectDefinition{
sReturn = getStringValue(_sExpression);
break;
case TypeClass.ENUM_value:
- default:
- sReturn = _sExpression;
+ default:
+ sReturn = _sExpression;
System.out.println("Type " + _aTypeClass.getValue() + " not yet defined in 'castliteral()'");
- }
+ }
return sReturn;
- }
-
+ }
+
public String getbooleanTypeDescription(){
- return "sal_Bool";
+ return "sal_Bool";
}
public String getbyteTypeDescription(){
- return "sal_Int8";
+ return "sal_Int8";
}
public String getshortTypeDescription(){
- return "sal_Int16";
+ return "sal_Int16";
}
public String getunsignedshortTypeDescription(){
- return "sal_uInt16";
+ return "sal_uInt16";
}
public String getlongTypeDescription(){
- return "sal_Int32";
+ return "sal_Int32";
}
public String getunsignedlongTypeDescription(){
- return "sal_uInt32";
+ return "sal_uInt32";
}
public String gethyperTypeDescription(){
- return "sal_Int64";
+ return "sal_Int64";
}
public String getunsignedhyperTypeDescription(){
- return "sal_uInt64";
+ return "sal_uInt64";
}
public String getfloatTypeDescription(){
- return "float";
+ return "float";
}
public String getdoubleTypeDescription(){
- return "double";
+ return "double";
}
public String getcharTypeDescription(){
- return "sal_Unicode";
+ return "sal_Unicode";
}
public String getstringTypeDescription(boolean _bAsHeaderSourceCode){
@@ -1676,7 +1676,7 @@ class UnoObjectDefinition{
return "";
}
else{
- return "OUString";
+ return "OUString";
}
}
@@ -1685,7 +1685,7 @@ class UnoObjectDefinition{
return "com/sun/star/uno/Type";
}
else{
- return "Type";
+ return "Type";
}
}
@@ -1697,8 +1697,8 @@ class UnoObjectDefinition{
return "XInterface";
}
}
-
-
+
+
public String getVariableDeclaration(String _sTypeString, String _sVariableName, boolean bIsArray, TypeClass _aTypeClass, boolean _bInitialize){
boolean bIsPrimitive = m_oIntrospector.isPrimitive(_aTypeClass);
@@ -1706,7 +1706,7 @@ class UnoObjectDefinition{
String sReturn = "";
if (bIsArray){
bIncludeSequenceHeader = true;
- sReturn = getCSSNameSpaceString() + "::uno::Sequence<" + _sTypeString + "> " + _sVariableName;
+ sReturn = getCSSNameSpaceString() + "::uno::Sequence<" + _sTypeString + "> " + _sVariableName;
}
else{
if (bIsPrimitive){
@@ -1735,10 +1735,10 @@ class UnoObjectDefinition{
case TypeClass.STRING_value:
sReturn = _sTypeString + " " + _sVariableName;
break;
- default:
+ default:
sReturn = _sTypeString + " " + _sVariableName;
System.out.println("Type " + _aTypeClass.getValue() + " not yet defined in 'getVariableDeclaration()'");
- }
+ }
}
}
else{
@@ -1747,20 +1747,20 @@ class UnoObjectDefinition{
}
return sReturn;
}
-
+
public String getArrayDeclaration(String _sVariableDeclaration){
this.bIncludeSequenceHeader = true;
String sReturn = "";
String[] sDeclarations = _sVariableDeclaration.split(" ");
if (sDeclarations.length == 2){
- sReturn = getCSSNameSpaceString() +"::uno::Sequence<" + sDeclarations[1] + ">";
+ sReturn = getCSSNameSpaceString() +"::uno::Sequence<" + sDeclarations[1] + ">";
}
return sReturn;
}
-
+
public String getCommentSign(){
return "//";
}
-
- }
+
+ }
}
diff --git a/odk/examples/java/Inspector/SwingDialogProvider.java b/odk/examples/java/Inspector/SwingDialogProvider.java
index 59a35726e11e..7b85070c2491 100644
--- a/odk/examples/java/Inspector/SwingDialogProvider.java
+++ b/odk/examples/java/Inspector/SwingDialogProvider.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.XComponentContext;
@@ -64,8 +64,8 @@ public class SwingDialogProvider implements XDialogProvider{
private Inspector._Inspector m_oInspector;
private JDialog m_jInspectorDialog = new JDialog();
private JTabbedPane m_jTabbedPane1 = new JTabbedPane();
- private Container cp;
-
+ private Container cp;
+
private JMenu jMnuOptions = new JMenu("Options");
private JRadioButtonMenuItem jJavaMenuItem = null;
private JRadioButtonMenuItem jCPlusPlusMenuItem = null;
@@ -74,31 +74,31 @@ public class SwingDialogProvider implements XDialogProvider{
/** Creates a new instance of SwingPopupMentuProvider */
public SwingDialogProvider(Inspector._Inspector _oInspector, String _sTitle) {
m_oInspector = _oInspector;
- m_xComponentContext = _oInspector.getXComponentContext();
- insertMenus();
- initializePopupMenu();
+ m_xComponentContext = _oInspector.getXComponentContext();
+ insertMenus();
+ initializePopupMenu();
cp = m_jInspectorDialog.getContentPane();
cp.setLayout(new java.awt.BorderLayout(0, 10));
- m_jTabbedPane1.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
+ m_jTabbedPane1.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
m_jInspectorDialog.addWindowListener(new InspectorWindowAdapter());
m_jInspectorDialog.addComponentListener(new InspectorComponentAdapter());
m_jInspectorDialog.setTitle(_sTitle);
m_jInspectorDialog.setLocation(100, 50);
- m_jInspectorDialog.getContentPane().add(m_jTabbedPane1);
+ m_jInspectorDialog.getContentPane().add(m_jTabbedPane1);
}
-
-
-
+
+
+
public JDialog getDialog(){
return m_jInspectorDialog;
}
-
+
public void addMenuBar(JMenuBar _jMenuBar){
- getDialog().setJMenuBar(_jMenuBar);
+ getDialog().setJMenuBar(_jMenuBar);
}
-
-
+
+
public void removeTabPaneByIndex(int _nIndex){
if (_nIndex > -1){
String sSelInspectorPanelTitle = m_jTabbedPane1.getTitleAt(_nIndex);
@@ -107,28 +107,28 @@ public class SwingDialogProvider implements XDialogProvider{
}
}
-
+
public void selectInspectorPageByIndex(int nTabIndex){
m_jTabbedPane1.setSelectedIndex(nTabIndex);
}
-
-
+
+
public int getInspectorPageCount(){
return m_jTabbedPane1.getTabCount();
}
-
-
+
+
public JTabbedPane getTabbedPane(){
return m_jTabbedPane1;
}
-
-
+
+
public InspectorPane getSelectedInspectorPage(){
int nIndex = m_jTabbedPane1.getSelectedIndex();
return getInspectorPage(nIndex);
}
-
-
+
+
public InspectorPane getInspectorPage(int _nIndex){
InspectorPane oInspectorPane = null;
if (_nIndex > -1){
@@ -138,8 +138,8 @@ public class SwingDialogProvider implements XDialogProvider{
}
return oInspectorPane;
}
-
-
+
+
public void removeTabPanes(){
int nCount = m_jTabbedPane1.getTabCount();
if (nCount > 0){
@@ -148,13 +148,13 @@ public class SwingDialogProvider implements XDialogProvider{
}
}
}
-
+
public void removeSelectedTabPane(){
int nIndex = getTabbedPane().getSelectedIndex();
removeTabPaneByIndex(nIndex);
}
-
-
+
+
private class InspectorComponentAdapter extends ComponentAdapter{
public void componentHidden(ComponentEvent e){
m_jInspectorDialog.pack();
@@ -165,23 +165,23 @@ public class SwingDialogProvider implements XDialogProvider{
public void componentShown(ComponentEvent e){
m_jInspectorDialog.pack();
m_jInspectorDialog.invalidate();
- }
+ }
}
-
+
private class InspectorWindowAdapter extends WindowAdapter{
public void windowClosed(WindowEvent e){
removeTabPanes();
m_oInspector.disposeHiddenDocuments();
}
-
+
public void windowClosing(WindowEvent e){
removeTabPanes();
m_oInspector.disposeHiddenDocuments();
}
- }
-
-
-
+ }
+
+
+
private void initializePopupMenu(){
m_jPopupMenu.add(getInspectMenuItem("Inspect"));
m_jPopupMenu.add(getSourceCodeMenuItem(SADDTOSOURCECODE));
@@ -189,8 +189,8 @@ public class SwingDialogProvider implements XDialogProvider{
m_jPopupMenu.addSeparator();
m_jPopupMenu.add(getHelpMenuItem("Help"));
}
-
-
+
+
private void addOpenDocumentMenu(JMenu _jMnuRoot){
ActionListener oActionListener = new ActionListener(){
public void actionPerformed(java.awt.event.ActionEvent evt) {
@@ -215,7 +215,7 @@ public class SwingDialogProvider implements XDialogProvider{
};
String[][] sApplUrls = m_oInspector.getApplicationUrls();
for (int i = 0; i < sApplUrls.length; i++){
- addSingleMenuItem(_jMnuRoot, sApplUrls[i][1], sApplUrls[i][0], oActionListener);
+ addSingleMenuItem(_jMnuRoot, sApplUrls[i][1], sApplUrls[i][0], oActionListener);
}
}
@@ -226,14 +226,14 @@ public class SwingDialogProvider implements XDialogProvider{
jMnuItemOpenDoc.addActionListener(_oActionListener);
_jMnuOpenDocs.add(jMnuItemOpenDoc);
}
-
-
+
+
private void addHelpMenu(JMenuBar _jInspectMenuBar){
JMenu jMnuHelp = new JMenu("Help");
jMnuHelp.add(getHelpMenuItem("Idl-Help"));
_jInspectMenuBar.add(jMnuHelp);
}
-
+
private JMenuItem getHelpMenuItem(String _sMenuTitle){
JMenuItem jMnuHelpItem = new JMenuItem(_sMenuTitle);
@@ -241,31 +241,31 @@ public class SwingDialogProvider implements XDialogProvider{
jMnuHelpItem.setMnemonic('H');
jMnuHelpItem.addActionListener(new ActionListener(){
public void actionPerformed(java.awt.event.ActionEvent evt) {
- m_oInspector.openIdlFileforSelectedNode();
+ m_oInspector.openIdlFileforSelectedNode();
}
- });
+ });
return jMnuHelpItem;
}
-
+
private void addFileMenu(JMenuBar _jInspectMenuBar){
JMenu jMnuFile = new JMenu("File");
- JMenuItem jMnuItemRemoveInspector = new JMenuItem("Remove");
+ JMenuItem jMnuItemRemoveInspector = new JMenuItem("Remove");
jMnuItemRemoveInspector.addActionListener(new ActionListener(){
public void actionPerformed(java.awt.event.ActionEvent evt) {
removeSelectedTabPane();
}
});
jMnuFile.add(jMnuItemRemoveInspector);
- JMenuItem jMnuItemExit = new JMenuItem("Exit");
+ JMenuItem jMnuItemExit = new JMenuItem("Exit");
jMnuItemExit.addActionListener(new ActionListener(){
public void actionPerformed(java.awt.event.ActionEvent evt) {
getDialog().dispose();
}
- });
- jMnuFile.add(jMnuItemExit);
+ });
+ jMnuFile.add(jMnuItemExit);
_jInspectMenuBar.add(jMnuFile);
}
-
+
private JMenuItem getInspectMenuItem(String _sLabel){
JMenuItem jMnuSelectedObject = new JMenuItem(_sLabel);
jMnuSelectedObject.addActionListener(new ActionListener(){
@@ -275,8 +275,8 @@ public class SwingDialogProvider implements XDialogProvider{
});
return jMnuSelectedObject;
}
-
-
+
+
private JMenuItem getSourceCodeMenuItem(String _sLabel){
JMenuItem jMnuSelectedObject = new JMenuItem(_sLabel);
jMnuSelectedObject.addActionListener(new ActionListener(){
@@ -286,7 +286,7 @@ public class SwingDialogProvider implements XDialogProvider{
});
return jMnuSelectedObject;
}
-
+
private JMenuItem getInvokeMenuItem(String _sLabel){
JMenuItem jMnuSelectedObject = new JMenuItem(_sLabel);
jMnuSelectedObject.addActionListener(new ActionListener(){
@@ -296,25 +296,25 @@ public class SwingDialogProvider implements XDialogProvider{
});
return jMnuSelectedObject;
}
-
-
+
+
private void addInspectMenu(JMenuBar _jInspectMenuBar){
JMenu jMnuInspect = new JMenu("Inspect");
addApplicationDocumentMenu(jMnuInspect);
jMnuInspect.addSeparator();
addGlobalServiceManagerMenu(jMnuInspect);
jMnuInspect.addSeparator();
- jMnuInspect.add(getInspectMenuItem("Selected Object"));
+ jMnuInspect.add(getInspectMenuItem("Selected Object"));
jMnuInspect.addSeparator();
- addOpenDocumentMenu(jMnuInspect);
- _jInspectMenuBar.add(jMnuInspect);
+ addOpenDocumentMenu(jMnuInspect);
+ _jInspectMenuBar.add(jMnuInspect);
}
public int getLanguage(){
return XLanguageSourceCodeGenerator.nJAVA;
}
-
-
+
+
public void selectSourceCodeLanguage(int _nLanguage){
switch (_nLanguage){
case XLanguageSourceCodeGenerator.nJAVA:
@@ -332,7 +332,7 @@ public class SwingDialogProvider implements XDialogProvider{
}
private JRadioButtonMenuItem addLanguageMenuItem(ButtonGroup _group, String _sLanguageTitle, boolean _bSelect, char _sMnemonic, final int _nLanguage){
- JRadioButtonMenuItem jMenuItem = new JRadioButtonMenuItem(_sLanguageTitle, _bSelect);
+ JRadioButtonMenuItem jMenuItem = new JRadioButtonMenuItem(_sLanguageTitle, _bSelect);
jMenuItem.setMnemonic(_sMnemonic);
_group.add(jMenuItem);
jMenuItem.addActionListener(new ActionListener(){
@@ -342,19 +342,19 @@ public class SwingDialogProvider implements XDialogProvider{
});
return jMenuItem;
}
-
-
+
+
public String getIDLPath(){
return this.m_oInspector.getIDLPath();
}
-
+
private void addOptionsMenu(JMenuBar _jInspectMenuBar){
ButtonGroup oButtonGroup = new ButtonGroup();
jJavaMenuItem = addLanguageMenuItem(oButtonGroup, "Generate Java Sourcecode", true, 'J', XLanguageSourceCodeGenerator.nJAVA);
jMnuOptions.add(jJavaMenuItem);
jCPlusPlusMenuItem = addLanguageMenuItem(oButtonGroup, "Generate C++ Sourcecode", false, 'C', XLanguageSourceCodeGenerator.nCPLUSPLUS);
jMnuOptions.add(jCPlusPlusMenuItem);
- jBasicMenuItem = addLanguageMenuItem(oButtonGroup, "Generate OpenOffice.org Basic Sourcecode", false, 'B', XLanguageSourceCodeGenerator.nBASIC);
+ jBasicMenuItem = addLanguageMenuItem(oButtonGroup, "Generate OpenOffice.org Basic Sourcecode", false, 'B', XLanguageSourceCodeGenerator.nBASIC);
jMnuOptions.add(jBasicMenuItem);
jMnuOptions.addSeparator();
JMenuItem jMenuItem = new JMenuItem("Path to SDK-Installation");
@@ -364,12 +364,12 @@ public class SwingDialogProvider implements XDialogProvider{
m_oInspector.assignSDKPath();
}
});
-
+
jMnuOptions.add(jMenuItem);
- _jInspectMenuBar.add(jMnuOptions);
+ _jInspectMenuBar.add(jMnuOptions);
}
-
-
+
+
private void insertMenus(){
JMenuBar jMenuBar1 = new javax.swing.JMenuBar();
addFileMenu(jMenuBar1);
@@ -380,10 +380,10 @@ public class SwingDialogProvider implements XDialogProvider{
jMenuBar1.setFont(new java.awt.Font("Dialog", 0, 12));
jMenuBar1.add(jMnuEdit);
jMenuBar1.add(jMnuView);
- addHelpMenu(jMenuBar1);
+ addHelpMenu(jMenuBar1);
addMenuBar(jMenuBar1);
}
-
+
private void addGlobalServiceManagerMenu(JMenu _jMnuRoot){
JMenuItem jMnuGlobalServiceManager = new JMenuItem("Global Service Manager");
jMnuGlobalServiceManager.addActionListener(new ActionListener(){
@@ -394,8 +394,8 @@ public class SwingDialogProvider implements XDialogProvider{
_jMnuRoot.add(jMnuGlobalServiceManager);
}
-
-
+
+
public void enablePopupMenuItem(String _sMenuTitle, boolean _bdoEnable){
Component[] oComponents = m_jPopupMenu.getComponents();
for (int i = 0; i < oComponents.length; i++){
@@ -414,8 +414,8 @@ public class SwingDialogProvider implements XDialogProvider{
m_jPopupMenu.show((Component) _invoker, x, y);
}
}
-
-
+
+
public void show(int _nPageIndex){
Dimension aDimension = m_jInspectorDialog.getSize();
selectInspectorPageByIndex(_nPageIndex);
@@ -430,13 +430,13 @@ public class SwingDialogProvider implements XDialogProvider{
}
public void paint(){
- m_jTabbedPane1.paintImmediately(m_jTabbedPane1.getBounds());
+ m_jTabbedPane1.paintImmediately(m_jTabbedPane1.getBounds());
}
-
+
public void addInspectorPage(String _sTitle, Object _oContainer) throws ClassCastException{
if (_oContainer instanceof Component){
m_jTabbedPane1.addTab(_sTitle, (Component) _oContainer);
}
- }
+ }
}
diff --git a/odk/examples/java/Inspector/SwingTreeControlProvider.java b/odk/examples/java/Inspector/SwingTreeControlProvider.java
index 2405e8bc36ce..bf00acd77d0b 100644
--- a/odk/examples/java/Inspector/SwingTreeControlProvider.java
+++ b/odk/examples/java/Inspector/SwingTreeControlProvider.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.Property;
@@ -75,27 +75,27 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
private JLabel jLblPath = new JLabel("Generated source code");
private JProgressBar jProgressBar1 = new JProgressBar();
private JTree jTree = new javax.swing.JTree();
- private XDialogProvider m_xDialogProvider;
+ private XDialogProvider m_xDialogProvider;
private HideableTreeModel treeModel;
private UnoTreeRenderer oUnoTreeRenderer;
private InspectorPane m_oInspectorPane;
private Object oUserDefinedObject = null;
private boolean bIsUserDefined = false;
private SwingUnoNode oRootNode;
-
+
private final int nDIALOGWIDTH = 800;
-
-
-
+
+
+
public SwingTreeControlProvider(XDialogProvider _xDialogProvider){
- m_xDialogProvider = _xDialogProvider;
+ m_xDialogProvider = _xDialogProvider;
}
-
+
public void addInspectorPane(InspectorPane _oInspectorPane){
m_oInspectorPane = _oInspectorPane;
}
-
+
public InspectorPane getInspectorPane() throws NullPointerException{
if (m_oInspectorPane == null){
throw new NullPointerException("InspectorPage has not been added to TreeControl");
@@ -104,21 +104,21 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
return m_oInspectorPane;
}
}
-
+
private void ComponentSelector(Object _oRootObject, String _sRootTreeNodeName) {
String sTreeNodeName = _sRootTreeNodeName;
oRootNode = new SwingUnoNode(_oRootObject);
oRootNode.setLabel(_sRootTreeNodeName);
treeModel = new HideableTreeModel(oRootNode);
jTree.setModel(treeModel);
- jTree.setRootVisible(true);
+ jTree.setRootVisible(true);
jTree.setVisible(true);
oRootNode.setFoldable(true);
enableFilterElements(null);
}
-
-
+
+
private void insertTopPanel(JPanel _jPnlCenter){
javax.swing.JPanel jPnlTop = new javax.swing.JPanel(new BorderLayout(10, 10));
jPnlTop.setPreferredSize(new java.awt.Dimension(nDIALOGWIDTH, 20));
@@ -129,10 +129,10 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
jtxtFilter.setPreferredSize(new java.awt.Dimension(200, 10));
jtxtFilter.addKeyListener(new InspectorKeyFilterAdapter());
jPnlTop.add(jtxtFilter, java.awt.BorderLayout.CENTER);
- _jPnlCenter.add(jPnlTop, java.awt.BorderLayout.NORTH);
+ _jPnlCenter.add(jPnlTop, java.awt.BorderLayout.NORTH);
}
-
-
+
+
private void insertBottomPanel(JSplitPane _jSplitPane){ //JPanel _jPnlCenter){
jtxtGeneratedSourceCode.setTabSize(4);
jtxtGeneratedSourceCode.getAccessibleContext().setAccessibleName("generated SourceCode");
@@ -141,7 +141,7 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
jtxtGeneratedSourceCode.setEditable(false);
_jSplitPane.setBottomComponent(jScrollPane);
}
-
+
private void insertBorderPanes(Container _cp){
JPanel jPnlEast = new JPanel(new BorderLayout());
JPanel jPnlNorth = new JPanel(new BorderLayout());
@@ -154,9 +154,9 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
_cp.add(jPnlEast, java.awt.BorderLayout.EAST);
jPnlSouth.setPreferredSize(new java.awt.Dimension(10, 10));
_cp.add(jPnlSouth, java.awt.BorderLayout.SOUTH);
- }
-
-
+ }
+
+
public String enableFilterElements(XUnoNode _oUnoNode){
String sFilter ="";
boolean bIsFacetteNode = isFacetteNode(_oUnoNode);
@@ -166,8 +166,8 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
jtxtFilter.setText(sFilter);
return sFilter;
}
-
-
+
+
private class InspectorKeyFilterAdapter extends KeyAdapter{
public void keyReleased(KeyEvent e){
String sFilter = jtxtFilter.getText();
@@ -178,16 +178,16 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
}
}
}
-
-
-
+
+
+
/** Inspect the given object for methods, properties, interfaces, and
* services.
* @param a The object to inspect
* @throws RuntimeException If
*/
public Object inspect(java.lang.Object _oUserDefinedObject, String _sTitle) throws com.sun.star.uno.RuntimeException {
- JPanel jPnlContainer = new javax.swing.JPanel(new BorderLayout(10, 10));
+ JPanel jPnlContainer = new javax.swing.JPanel(new BorderLayout(10, 10));
try {
javax.swing.JPanel jPnlCenter = new javax.swing.JPanel();
bIsUserDefined = (_oUserDefinedObject != null);
@@ -197,7 +197,7 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
}
javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
TreeSelectionModel tsm = new DefaultTreeSelectionModel();
- tsm.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+ tsm.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
jTree.setSelectionModel(tsm);
jTree.setVisible(false);
jPnlCenter.setLayout(new java.awt.BorderLayout(10, 10));
@@ -206,15 +206,15 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
jScrollPane1.setViewportView(jTree);
jScrollPane1.setPreferredSize(new java.awt.Dimension(600, 600));
jScrollPane1.getAccessibleContext().setAccessibleName("API view scroll pane");
-
+
JScrollBar jHScrollBar = jScrollPane1.createHorizontalScrollBar();
jHScrollBar.getAccessibleContext().setAccessibleName("API view horizontal scroll bar");
jScrollPane1.setHorizontalScrollBar(jHScrollBar);
-
+
JScrollBar jVScrollBar = jScrollPane1.createVerticalScrollBar();
jVScrollBar.getAccessibleContext().setAccessibleName("API view vertical scroll bar");
jScrollPane1.setVerticalScrollBar(jVScrollBar);
-
+
JSplitPane jSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
jSplitPane.setTopComponent(jScrollPane1);
jPnlCenter.add(jSplitPane, java.awt.BorderLayout.CENTER);
@@ -251,11 +251,11 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
}
//unfortunately under Windows the method "isPopupTrigger" always returns false
else if ((e.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) == MouseEvent.BUTTON3_DOWN_MASK){
- m_oInspectorPane.showPopUpMenu(e.getComponent(), e.getX(), e.getY());
+ m_oInspectorPane.showPopUpMenu(e.getComponent(), e.getX(), e.getY());
}
}
});
- jPnlContainer.add(jPnlCenter, java.awt.BorderLayout.CENTER);
+ jPnlContainer.add(jPnlCenter, java.awt.BorderLayout.CENTER);
insertBorderPanes(jPnlContainer);
if (this.bIsUserDefined){
ComponentSelector(oUserDefinedObject, m_oInspectorPane.getTitle());
@@ -265,15 +265,15 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
}
catch( Exception exception ) {
exception.printStackTrace(System.out);
- }
+ }
return jPnlContainer;
}
-
+
public HideableTreeModel getModel(){
return treeModel;
}
-
-
+
+
public void addTreeExpandListener(){
jTree.addTreeWillExpandListener(
new TreeWillExpandListener() {
@@ -288,26 +288,26 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
public void treeWillCollapse( javax.swing.event.TreeExpansionEvent evt) throws javax.swing.tree.ExpandVetoException {
}
});
- }
-
-
+ }
+
+
public void setSourceCode(String _sSourceCode){
jtxtGeneratedSourceCode.setText(_sSourceCode);
}
-
-
+
+
public XTreePathProvider getSelectedPath(){
return new SwingTreePathProvider(jTree.getSelectionPath());
}
-
-
+
+
public void expandPath(XTreePathProvider _xTreePathProvider) throws ClassCastException{
SwingTreePathProvider oSwingTreePathProvider = (SwingTreePathProvider) _xTreePathProvider;
jTree.expandPath(oSwingTreePathProvider.getSwingTreePath());
}
-
-
- public XUnoNode getSelectedNode(){
+
+
+ public XUnoNode getSelectedNode(){
XUnoNode oUnoNode = null;
TreePath aTreePath = jTree.getSelectionPath();
Object oNode = aTreePath.getLastPathComponent();
@@ -317,27 +317,27 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
return oUnoNode;
}
-
+
public void nodeInserted(XUnoNode _oParentNode, XUnoNode _oChildNode, int index) {
getModel().nodeInserted(_oParentNode, _oChildNode, _oParentNode.getChildCount()-1);
- }
-
-
+ }
+
+
public void nodeChanged(XUnoNode _oNode) {
getModel().nodeChanged(_oNode);
}
-
-
- public boolean setNodeVisible(Object node, boolean v) {
+
+
+ public boolean setNodeVisible(Object node, boolean v) {
return getModel().setNodeVisible(node, v);
- }
-
+ }
+
public boolean isPropertyNode(XUnoNode _oUnoNode){
return (_oUnoNode instanceof SwingUnoPropertyNode);
}
-
+
public boolean isMethodNode(XUnoNode _oUnoNode){
return (_oUnoNode instanceof SwingUnoMethodNode);
}
@@ -345,19 +345,19 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
public boolean isFacetteNode(XUnoNode _oUnoNode){
return (_oUnoNode instanceof SwingUnoFacetteNode);
- }
-
+ }
+
public XUnoNode addUnoNode(Object _oUnoObject){
return new SwingUnoNode(_oUnoObject);
}
-
-
+
+
public XUnoNode addUnoNode(Object _oUnoObject, Type _aType){
return new SwingUnoNode(_oUnoObject, _aType);
}
-
-
+
+
public XUnoFacetteNode addUnoFacetteNode(XUnoNode _oParentNode, String _sNodeDescription, Object _oUnoObject){
SwingUnoFacetteNode oSwingUnoFacetteNode = new SwingUnoFacetteNode(_oUnoObject);
oSwingUnoFacetteNode.setLabel(_sNodeDescription);
@@ -367,34 +367,34 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
return oSwingUnoFacetteNode;
}
-
+
public XUnoMethodNode addMethodNode(Object _objectElement, XIdlMethod _xIdlMethod){
SwingUnoMethodNode oSwingUnoMethodNode = new SwingUnoMethodNode(_xIdlMethod, _objectElement, m_xDialogProvider);
return oSwingUnoMethodNode;
}
-
-
+
+
public XUnoPropertyNode addUnoPropertyNodeWithName(Property _aProperty){
SwingUnoPropertyNode oUnoPropertyNode = new SwingUnoPropertyNode(_aProperty);
oUnoPropertyNode.setLabel("Name: " + _aProperty.Name);
return oUnoPropertyNode;
}
-
+
public XUnoPropertyNode addUnoPropertyNodeWithHandle(Property _aProperty){
SwingUnoPropertyNode oUnoPropertyNode = new SwingUnoPropertyNode(_aProperty);
oUnoPropertyNode.setLabel("Handle: " + _aProperty.Handle);
return oUnoPropertyNode;
}
-
+
public XUnoPropertyNode addUnoPropertyNodeWithType(Property _aProperty){
SwingUnoPropertyNode oUnoPropertyNode = new SwingUnoPropertyNode(_aProperty);
oUnoPropertyNode.setLabel("Type: " + _aProperty.Type.getTypeName());
return oUnoPropertyNode;
}
-
-
+
+
public XUnoPropertyNode addUnoPropertyNodeWithAttributesDescription(Property _aProperty){
SwingUnoPropertyNode oUnoPropertyNode = new SwingUnoPropertyNode(_aProperty);
XConstantTypeDescription[] xPropertyAttributesTypeDescriptions = Introspector.getIntrospector().getFieldsOfConstantGroup("com.sun.star.beans.PropertyAttribute");
@@ -402,22 +402,22 @@ public class SwingTreeControlProvider implements XTreeControlProvider{
oUnoPropertyNode.setLabel(sDisplay);
return oUnoPropertyNode;
}
-
-
+
+
public XUnoPropertyNode addUnoPropertyNode(Object _oUnoObject, Property _aProperty){
SwingUnoPropertyNode oUnoPropertyNode = new SwingUnoPropertyNode(_aProperty, _oUnoObject, null);
oUnoPropertyNode.setPropertyNodeType(XUnoPropertyNode.nPROPERTYSETINFOTYPE);
oUnoPropertyNode.setLabel(UnoPropertyNode.getStandardPropertyDescription(_aProperty, null));
return oUnoPropertyNode;
}
-
-
+
+
public XUnoPropertyNode addUnoPropertyNode(Object _oUnoObject, Property _aProperty, Object _oUnoReturnObject){
SwingUnoPropertyNode oUnoPropertyNode = new SwingUnoPropertyNode(_aProperty, _oUnoObject, _oUnoReturnObject);
oUnoPropertyNode.setLabel(UnoPropertyNode.getStandardPropertyDescription(_aProperty, _oUnoReturnObject));
return oUnoPropertyNode;
}
-
+
public XUnoPropertyNode addUnoPropertyNode(Object _oUnoObject, PropertyValue _aPropertyValue, Object _oReturnObject){
SwingUnoPropertyNode oUnoPropertyNode = new SwingUnoPropertyNode(_aPropertyValue, _oUnoObject, _oReturnObject);
diff --git a/odk/examples/java/Inspector/SwingTreePathProvider.java b/odk/examples/java/Inspector/SwingTreePathProvider.java
index 02829682bc50..37376c269b42 100644
--- a/odk/examples/java/Inspector/SwingTreePathProvider.java
+++ b/odk/examples/java/Inspector/SwingTreePathProvider.java
@@ -3,37 +3,37 @@ import javax.swing.tree.TreePath;
public class SwingTreePathProvider implements XTreePathProvider {
TreePath m_aTreePath;
-
+
/** Creates a new instance of TreePathProvider */
public SwingTreePathProvider(TreePath _aTreePath) {
m_aTreePath = _aTreePath;
}
-
-
+
+
public XUnoNode getLastPathComponent(){
return (XUnoNode) m_aTreePath.getLastPathComponent();
}
-
-
+
+
public XUnoNode getPathComponent(int i){
return (XUnoNode) m_aTreePath.getPathComponent(i);
}
-
+
public int getPathCount(){
return m_aTreePath.getPathCount();
}
-
-
+
+
public XTreePathProvider getParentPath(){
return new SwingTreePathProvider(m_aTreePath.getParentPath());
}
-
-
+
+
public XTreePathProvider pathByAddingChild(XUnoNode _oUnoNode){
TreePath aTreePath = m_aTreePath.pathByAddingChild(_oUnoNode);
return new SwingTreePathProvider(aTreePath);
}
-
+
public TreePath getSwingTreePath(){
return m_aTreePath;
}
diff --git a/odk/examples/java/Inspector/SwingUnoFacetteNode.java b/odk/examples/java/Inspector/SwingUnoFacetteNode.java
index 96374f1e5b9e..1fbc0f1acb93 100644
--- a/odk/examples/java/Inspector/SwingUnoFacetteNode.java
+++ b/odk/examples/java/Inspector/SwingUnoFacetteNode.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.reflection.XIdlMethod;
@@ -38,27 +38,27 @@ import com.sun.star.uno.XComponentContext;
import javax.swing.tree.DefaultMutableTreeNode;
public class SwingUnoFacetteNode extends SwingUnoNode implements XUnoFacetteNode{
- String m_sFilter = "";
-
+ String m_sFilter = "";
+
/** Creates a new instance of UnoMethodNode */
public SwingUnoFacetteNode(Object _oUnoObject){
super(_oUnoObject);
setFoldable(true);
}
-
-
+
+
public String getFilter(){
return m_sFilter;
}
-
+
public void setFilter(String _sFilter){
m_sFilter = _sFilter;
}
-
+
public String getName(){
return toString();
}
-
+
// TODO The implementation of the following methods is not really robust and should be changed!!!
public boolean isMethodNode(){
return ((String) getUserObject()).equals(SMETHODDESCRIPTION);
@@ -76,7 +76,7 @@ public class SwingUnoFacetteNode extends SwingUnoNode implements XUnoFacetteNode
public boolean isServiceNode(){
return ((String) getUserObject()).equals(SSERVICEDESCRIPTION);
}
-
+
public boolean isInterfaceNode(){
return ((String) getUserObject()).equals(SINTERFACEDESCRIPTION);
}
diff --git a/odk/examples/java/Inspector/SwingUnoMethodNode.java b/odk/examples/java/Inspector/SwingUnoMethodNode.java
index c01c6074b795..3487d430dfb5 100644
--- a/odk/examples/java/Inspector/SwingUnoMethodNode.java
+++ b/odk/examples/java/Inspector/SwingUnoMethodNode.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.reflection.XIdlMethod;
import com.sun.star.uno.TypeClass;
@@ -43,9 +43,9 @@ public class SwingUnoMethodNode extends SwingUnoNode implements ActionListener,
private UnoMethodNode m_oUnoMethodNode;
private XDialogProvider m_xDialogProvider = null;
-
+
public SwingUnoMethodNode(XIdlMethod _xIdlMethod, Object _oUnoObject, XDialogProvider _xDialogProvider) {
- super(_oUnoObject);
+ super(_oUnoObject);
m_oUnoMethodNode = new UnoMethodNode(_xIdlMethod, _oUnoObject, this);
m_xDialogProvider = _xDialogProvider;
setUserObject(m_oUnoMethodNode.getNodeDescription());
@@ -57,11 +57,11 @@ public class SwingUnoMethodNode extends SwingUnoNode implements ActionListener,
public boolean isFoldable(){
return m_oUnoMethodNode.isFoldable();
}
-
+
public String getName(){
return m_oUnoMethodNode.getName();
- }
-
+ }
+
public String getClassName(){
String sClassName = "";
sClassName = getXIdlMethod().getDeclaringClass().getName();
@@ -69,17 +69,17 @@ public class SwingUnoMethodNode extends SwingUnoNode implements ActionListener,
sClassName = super.getClassName();
}
return sClassName;
- }
-
+ }
+
public String getAnchor(){
return m_oUnoMethodNode.getAnchor();
}
-
+
public Object invoke(Object _oUnoObject, Object[] _oParameters) throws com.sun.star.uno.Exception{
return m_oUnoMethodNode.invoke(_oUnoObject, _oParameters);
}
-
-
+
+
public Object[] getLastParameterObjects(){
return m_oUnoMethodNode.getLastParameterObjects();
}
@@ -108,30 +108,30 @@ public class SwingUnoMethodNode extends SwingUnoNode implements ActionListener,
return m_oUnoMethodNode.isInvoked();
}
- public boolean isInvokable(){
+ public boolean isInvokable(){
return m_oUnoMethodNode.isInvokable();
}
-
+
public boolean isPrimitive() {
return m_oUnoMethodNode.isPrimitive();
}
-
+
public void actionPerformed(ActionEvent e){
openIdlDescription(m_xDialogProvider.getIDLPath());
}
-
+
public Vector getMethodObjects(){
MethodParametersDialog oMethodParametersDialog = new MethodParametersDialog(this);
oMethodParametersDialog.addActionListener(this);
- return oMethodParametersDialog.getMethodObjects();
+ return oMethodParametersDialog.getMethodObjects();
}
-
-
+
+
public String getParameterDescription(){
return m_oUnoMethodNode.getParameterDescription();
}
-
-
+
+
public String getStandardMethodDescription(){
return m_oUnoMethodNode.getStandardMethodDescription();
}
diff --git a/odk/examples/java/Inspector/SwingUnoNode.java b/odk/examples/java/Inspector/SwingUnoNode.java
index 19295cc4b4d0..14f23e94ad6d 100644
--- a/odk/examples/java/Inspector/SwingUnoNode.java
+++ b/odk/examples/java/Inspector/SwingUnoNode.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.Type;
import javax.swing.tree.TreeNode;
@@ -37,31 +37,31 @@ import javax.swing.tree.TreeNode;
public class SwingUnoNode extends HideableMutableTreeNode implements XUnoNode{
private UnoNode m_oUnoNode;
-
+
/** Creates a new instance of SwingUnoNode */
public SwingUnoNode(Object _oUnoObject) {
- super();
+ super();
m_oUnoNode = new UnoNode(_oUnoObject);
}
-
+
public SwingUnoNode(Object _oUnoObject, Type _aType) {
super();
- m_oUnoNode = new UnoNode(_oUnoObject, _aType);
+ m_oUnoNode = new UnoNode(_oUnoObject, _aType);
if (_aType != null){
this.setLabel(_aType.getTypeName());
}
}
-
-
+
+
public Object getUnoObject(){
return m_oUnoNode.getUnoObject();
}
-
+
public void setVisible(String _sFilter){
boolean bisVisible = isFilterApplicable(_sFilter);
super.setVisible(bisVisible);
- }
+ }
public boolean isFilterApplicable(String _sFilter) {
return m_oUnoNode.isFilterApplicable(_sFilter, getName());
@@ -91,13 +91,13 @@ public class SwingUnoNode extends HideableMutableTreeNode implements XUnoNode{
}
}
return sClassName;
- }
+ }
public String getAnchor() {
return m_oUnoNode.getAnchor();
}
-
-
+
+
public void setFoldable(boolean _bIsFoldable){
if (_bIsFoldable){
addDummyNode();
@@ -107,16 +107,16 @@ public class SwingUnoNode extends HideableMutableTreeNode implements XUnoNode{
}
}
-
+
public XUnoNode getParentNode(){
return (SwingUnoNode) super.getParent();
}
-
-
+
+
public void addChildNode(XUnoNode _xUnoNode) {
super.add((SwingUnoNode) _xUnoNode);
}
-
+
public void setLabel(String _sLabel){
super.setUserObject(_sLabel);
this.m_oUnoNode.setLabel(_sLabel);
@@ -126,30 +126,30 @@ public class SwingUnoNode extends HideableMutableTreeNode implements XUnoNode{
return (String) super.getUserObject();
}
-
+
public int getChildCount(){
return super.getChildCount();
}
-
-
+
+
public XUnoNode getChild(int _i){
return (SwingUnoNode) super.getChildAt(_i);
}
-
+
public int getNodeType(){
return m_oUnoNode.getNodeType();
}
-
+
public void setNodeType(int _nNodeType){
m_oUnoNode.setNodeType(_nNodeType);
}
-
-
+
+
public String getName(){
return getClassName();
}
-
-
+
+
public Type getUnoType(){
return m_oUnoNode.getUnoType();
}
diff --git a/odk/examples/java/Inspector/SwingUnoPropertyNode.java b/odk/examples/java/Inspector/SwingUnoPropertyNode.java
index f72229db6f10..34decfec1d1c 100644
--- a/odk/examples/java/Inspector/SwingUnoPropertyNode.java
+++ b/odk/examples/java/Inspector/SwingUnoPropertyNode.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,16 +29,16 @@
* 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.Property;
import com.sun.star.beans.PropertyValue;
public class SwingUnoPropertyNode extends SwingUnoNode implements XUnoPropertyNode{
-
+
private UnoPropertyNode m_oUnoPropertyNode = null;
-
-
+
+
public SwingUnoPropertyNode(Property _aProperty, Object _oUnoObject, Object _oUnoReturnObject) {
super(_oUnoObject);
m_oUnoPropertyNode = new UnoPropertyNode(_aProperty, _oUnoObject, _oUnoReturnObject);
@@ -46,51 +46,51 @@ public class SwingUnoPropertyNode extends SwingUnoNode implements XUnoPropertyNo
setFoldable(m_oUnoPropertyNode.isFoldable());
}
-
+
public SwingUnoPropertyNode(Property _aProperty){
super(null);
m_oUnoPropertyNode = new UnoPropertyNode(_aProperty);
}
-
- public SwingUnoPropertyNode(PropertyValue _aPropertyValue, Object _oUnoObject, Object _oUnoReturnObject) {
+
+ public SwingUnoPropertyNode(PropertyValue _aPropertyValue, Object _oUnoObject, Object _oUnoReturnObject) {
super(_oUnoObject);
m_oUnoPropertyNode = new UnoPropertyNode(_aPropertyValue, _oUnoObject, _oUnoReturnObject);
}
-
+
public String getName(){
return m_oUnoPropertyNode.getName();
}
-
-
+
+
public Object getUnoReturnObject(){
return m_oUnoPropertyNode.getUnoReturnObject();
}
-
+
public String getClassName(){
String sClassName = m_oUnoPropertyNode.getClassName();
if (sClassName.equals("")){
sClassName = super.getClassName();
- }
+ }
return sClassName;
- }
-
+ }
+
public String getAnchor(){
return m_oUnoPropertyNode.getAnchor();
}
-
+
public int getPropertyNodeType(){
return m_oUnoPropertyNode.getPropertyNodeType();
}
-
-
+
+
public void setPropertyNodeType(int _nPropertyType){
m_oUnoPropertyNode.setPropertyNodeType(_nPropertyType);
}
-
+
public Property getProperty(){
return m_oUnoPropertyNode.getProperty();
}
-
+
}
diff --git a/odk/examples/java/Inspector/TDocSupplier.java b/odk/examples/java/Inspector/TDocSupplier.java
index 1022507eb387..81d8ca05e533 100644
--- a/odk/examples/java/Inspector/TDocSupplier.java
+++ b/odk/examples/java/Inspector/TDocSupplier.java
@@ -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.
- *
+ *
*************************************************************************/
import com.sun.star.beans.Property;
@@ -55,31 +55,31 @@ import javax.swing.JOptionPane;
public class TDocSupplier {
private XMultiComponentFactory m_xMultiComponentFactory;
private XComponentContext m_xComponentContext;
-
-
+
+
/** Creates a new instance of TDocSupplier */
public TDocSupplier(XComponentContext _xComponentContext) {
m_xComponentContext = _xComponentContext;
m_xMultiComponentFactory = m_xComponentContext.getServiceManager();
}
-
-
+
+
protected XComponentContext getXComponentContext(){
return m_xComponentContext;
}
-
-
+
+
protected XMultiComponentFactory getXMultiComponentFactory(){
return m_xMultiComponentFactory;
}
-
+
public XModel getXModelByTDocUrl(String _sTDocUrl){
try{
XRow xRow = getXRowOfTDocUrl(_sTDocUrl, "DocumentModel");
if (xRow != null){
Object oModel = xRow.getObject(1, null);
XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, oModel);
- return xModel;
+ return xModel;
}
}catch(Exception exception){
exception.printStackTrace(System.out);
@@ -87,8 +87,8 @@ public class TDocSupplier {
JOptionPane.showMessageDialog(new javax.swing.JFrame(), "The selected Document could not be opened!", "Object Inspector", JOptionPane.ERROR_MESSAGE);
return null;
}
-
-
+
+
public String getTitleByTDocUrl(String _sTDocUrl){
try{
XRow xRow = this.getXRowOfTDocUrl(_sTDocUrl, "Title");
@@ -101,18 +101,18 @@ public class TDocSupplier {
JOptionPane.showMessageDialog(new javax.swing.JFrame(), "The selected Document could not be opened!", "Object Inspector", JOptionPane.ERROR_MESSAGE);
return "";
}
-
-
+
+
private XRow getXRowOfTDocUrl(String _sTDocUrl, String _sPropertyName){
try{
String[] keys = new String[2];
keys[ 0 ] = "Local";
keys[ 1 ] = "Office";
- Object oUCB = getXMultiComponentFactory().createInstanceWithArgumentsAndContext( "com.sun.star.ucb.UniversalContentBroker", keys, getXComponentContext() );
+ Object oUCB = getXMultiComponentFactory().createInstanceWithArgumentsAndContext( "com.sun.star.ucb.UniversalContentBroker", keys, getXComponentContext() );
XContentIdentifierFactory xIdFactory = (XContentIdentifierFactory)UnoRuntime.queryInterface(XContentIdentifierFactory.class, oUCB);
XContentProvider xProvider = (XContentProvider)UnoRuntime.queryInterface(XContentProvider.class, oUCB);
XContentIdentifier xId = xIdFactory.createContentIdentifier(_sTDocUrl);
- XContent xContent = xProvider.queryContent(xId);
+ XContent xContent = xProvider.queryContent(xId);
XCommandProcessor xCmdProcessor = (XCommandProcessor) UnoRuntime.queryInterface(XCommandProcessor.class, xContent);
Property aProperty = new Property();
aProperty.Name = _sPropertyName; // "DocumentModel"; //DocumentModel
@@ -127,8 +127,8 @@ public class TDocSupplier {
exception.printStackTrace(System.out);
return null;
}}
-
-
+
+
protected String[] getTDocTitles(String[] _sTDocUrls){
String[] sTitles = new String[_sTDocUrls.length];
for (int i = 0; i < _sTDocUrls.length; i++){
@@ -136,33 +136,33 @@ public class TDocSupplier {
}
return sTitles;
}
-
-
+
+
protected String[] getTDocUrls(){
try{
Object oSimpleFileAccess = getXMultiComponentFactory().createInstanceWithContext("com.sun.star.ucb.SimpleFileAccess", getXComponentContext());
XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) UnoRuntime.queryInterface(XSimpleFileAccess.class, oSimpleFileAccess);
String[] sContent = xSimpleFileAccess.getFolderContents("vnd.sun.star.tdoc:/", false);
- return sContent;
+ return sContent;
} catch( Exception e ) {
System.err.println( e );
return new String[]{};
}}
-
-
+
+
public XComponent openEmptyDocument(String _sUrl){
try{
PropertyValue[] aPropertyValues = new PropertyValue[1];
aPropertyValues[0] = new PropertyValue();
aPropertyValues[0].Name = "Hidden";
- aPropertyValues[0].Value = Boolean.TRUE;
+ aPropertyValues[0].Value = Boolean.TRUE;
Object oDesktop = getXMultiComponentFactory().createInstanceWithContext("com.sun.star.frame.Desktop", getXComponentContext());
XComponentLoader xCL = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, oDesktop);
- return xCL.loadComponentFromURL(_sUrl, "_default", 0, aPropertyValues);
+ return xCL.loadComponentFromURL(_sUrl, "_default", 0, aPropertyValues);
}
catch( Exception exception ) {
System.err.println( exception );
return null;
- }}
-
+ }}
+
}
diff --git a/odk/examples/java/Inspector/TestInspector.java b/odk/examples/java/Inspector/TestInspector.java
index a2255dff859a..e7583f944d09 100644
--- a/odk/examples/java/Inspector/TestInspector.java
+++ b/odk/examples/java/Inspector/TestInspector.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.XSingleComponentFactory;
@@ -38,7 +38,7 @@ import com.sun.star.uno.UnoRuntime;
import java.io.DataInputStream;
public class TestInspector {
-
+
public static void main(String args[]) {
com.sun.star.uno.XComponentContext xContext = null;
try {
@@ -55,24 +55,24 @@ public class TestInspector {
try {
com.sun.star.lang.XMultiComponentFactory xMCF = xContext.getServiceManager();
// Creating an instance of the instance inspector with arguments
-
+
XSingleComponentFactory xFactory = Inspector.__getComponentFactory(Inspector._Inspector.class.getName());
Object obj= null;
if (xFactory != null) {
- obj = xFactory.createInstanceWithContext(xContext);
+ obj = xFactory.createInstanceWithContext(xContext);
}
org.openoffice.XInstanceInspector xInstInspector = null;
if (obj != null) {
- xInstInspector = (org.openoffice.XInstanceInspector)UnoRuntime.queryInterface(org.openoffice.XInstanceInspector.class, obj);
+ xInstInspector = (org.openoffice.XInstanceInspector)UnoRuntime.queryInterface(org.openoffice.XInstanceInspector.class, obj);
}
-
+
/* A desktop environment contains tasks with one or more
frames in which components can be loaded. Desktop is the
environment for components which can instanciate within
frames. */
com.sun.star.frame.XComponentLoader xCmpLoader = (com.sun.star.frame.XComponentLoader)UnoRuntime.queryInterface( com.sun.star.frame.XComponentLoader.class,
xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", xContext));
-
+
// Load a new spreadsheet document, which will be automaticly
// displayed and is used for inspection
com.sun.star.lang.XComponent xComp = xCmpLoader.loadComponentFromURL("private:factory/scalc", "_blank", 0, new com.sun.star.beans.PropertyValue[0] );
diff --git a/odk/examples/java/Inspector/UnoFacetteNode.java b/odk/examples/java/Inspector/UnoFacetteNode.java
index 53296129b2da..0fd91e434736 100644
--- a/odk/examples/java/Inspector/UnoFacetteNode.java
+++ b/odk/examples/java/Inspector/UnoFacetteNode.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.reflection.XIdlMethod;
@@ -39,27 +39,27 @@ import javax.swing.tree.DefaultMutableTreeNode;
public class UnoFacetteNode extends UnoNode{
String m_sFilter = "";
-
-
+
+
/** Creates a new instance of UnoMethodNode */
public UnoFacetteNode(Object _oUnoObject){
super(_oUnoObject);
- addDummyNode();
+ addDummyNode();
}
-
-
+
+
public String getFilter(){
return m_sFilter;
}
-
+
public void setFilter(String _sFilter){
m_sFilter = _sFilter;
}
-
+
public String getName(){
return toString();
}
-
+
// TODO The implementation of the following nodes is not really robust and should be changed!!!
public boolean isMethodNode(){
return ((String) getUserObject()).equals(SMETHODDESCRIPTION);
@@ -77,7 +77,7 @@ public class UnoFacetteNode extends UnoNode{
public boolean isServiceNode(){
return ((String) getUserObject()).equals(SSERVICEDESCRIPTION);
}
-
+
public boolean isInterfaceNode(){
return ((String) getUserObject()).equals(SINTERFACEDESCRIPTION);
}
diff --git a/odk/examples/java/Inspector/UnoMethodNode.java b/odk/examples/java/Inspector/UnoMethodNode.java
index 57793809bc5e..d80aa6f70d6b 100644
--- a/odk/examples/java/Inspector/UnoMethodNode.java
+++ b/odk/examples/java/Inspector/UnoMethodNode.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.reflection.ParamInfo;
@@ -47,8 +47,8 @@ public class UnoMethodNode extends UnoNode{
Object m_oUnoReturnObject = null;
boolean m_bisInvoked = false;
XUnoMethodNode m_xUnoMethodNode = null;
-
-
+
+
/** Creates a new instance of UnoMethodNode */
public UnoMethodNode(XIdlMethod _xIdlMethod, Object _oUnoObject, XUnoMethodNode _xUnoMethodNode) {
super(_oUnoObject);
@@ -56,11 +56,11 @@ public class UnoMethodNode extends UnoNode{
m_oParamObjects = new Object[m_xIdlMethod.getParameterInfos().length];
m_xUnoMethodNode = _xUnoMethodNode;
}
-
+
protected boolean isFoldable(){
return ((!this.isPrimitive()) && (getTypeClass().getValue() != TypeClass.VOID_value));
}
-
+
protected boolean isInvokable(){
boolean bisFoldable = true;
XIdlClass[] xIdlClasses = m_xIdlMethod.getParameterTypes();
@@ -72,22 +72,22 @@ public class UnoMethodNode extends UnoNode{
}
return bisFoldable;
}
-
+
public XIdlMethod getXIdlMethod(){
return m_xIdlMethod;
}
-
-
+
+
public String getAnchor(){
return getXIdlMethod().getName();
}
-
+
public String getName(){
return getXIdlMethod().getName();
}
-
-
+
+
public Object invoke(){
Object oUnoReturnObject = null;
if (!hasParameters()){
@@ -109,13 +109,13 @@ public class UnoMethodNode extends UnoNode{
m_oUnoReturnObject = oUnoReturnObject;
return oUnoReturnObject;
}
-
-
+
+
public boolean isInvoked(){
return m_bisInvoked;
}
-
-
+
+
protected String getNodeDescription(){
String sNodeDescription = "";
String sParameters = getParameterDescription();
@@ -124,7 +124,7 @@ public class UnoMethodNode extends UnoNode{
}
else{
TypeClass typeClass = getTypeClass();
- if (typeClass != TypeClass.VOID){
+ if (typeClass != TypeClass.VOID){
sNodeDescription = getStandardMethodDescription();
}
else{
@@ -133,7 +133,7 @@ public class UnoMethodNode extends UnoNode{
}
return sNodeDescription;
}
-
+
public String getStandardMethodDescription(){
String sNodeDescription = m_xIdlMethod.getReturnType().getName() + " " + m_xIdlMethod.getName() + " (" + getParameterDescription() + " )";
@@ -142,23 +142,23 @@ public class UnoMethodNode extends UnoNode{
}
return sNodeDescription;
}
-
-
+
+
public boolean hasParameters(){
return (m_xIdlMethod.getParameterInfos().length > 0);
}
-
-
+
+
public Object[] getLastParameterObjects(){
return m_oParamObjects;
}
-
-
+
+
public Object getLastUnoReturnObject(){
return m_oUnoReturnObject;
}
-
+
public String getParameterDescription(){
ParamInfo[] paramInfo = m_xIdlMethod.getParameterInfos();
String sParameters = "";
@@ -180,7 +180,7 @@ public class UnoMethodNode extends UnoNode{
return sParameters;
}
-
+
// return the parameter mode (IN, OUT, INOUT)
private static String getParamMode(ParamMode paramMode) {
String toReturn = "";
@@ -195,34 +195,34 @@ public class UnoMethodNode extends UnoNode{
}
return( toReturn );
}
-
+
public TypeClass getTypeClass(){
XIdlClass xIdlClass = m_xIdlMethod.getReturnType();
return xIdlClass.getTypeClass();
}
-
+
private Object invokeParameterlessMethod(){
try {
Object[][] aParamInfo = new Object[1][];
aParamInfo[0] = new Object[] {};
- return getXIdlMethod().invoke(getUnoObject(), aParamInfo);
+ return getXIdlMethod().invoke(getUnoObject(), aParamInfo);
} catch (Exception ex) {
ex.printStackTrace(System.out);
return null;
}}
-
+
public boolean isPrimitive(){
return Introspector.isObjectPrimitive(m_xIdlMethod.getClass(), getTypeClass());
}
-
-
+
+
protected Object invoke(Object _oUnoObject, Object[] oParameters) throws com.sun.star.uno.Exception{
Object[][] aParams = new Object[1][oParameters.length];
for ( int i = 0; i < oParameters.length; i++ ) {
aParams[0][i] = oParameters[i];
}
return m_xIdlMethod.invoke(_oUnoObject, aParams);
- }
+ }
}
diff --git a/odk/examples/java/Inspector/UnoNode.java b/odk/examples/java/Inspector/UnoNode.java
index 2bfaaf34a356..50d6ec3243d5 100644
--- a/odk/examples/java/Inspector/UnoNode.java
+++ b/odk/examples/java/Inspector/UnoNode.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.PropertyValue;
@@ -56,8 +56,8 @@ import java.util.List;
import java.util.Vector;
public class UnoNode{
-
- String sPath = null;
+
+ String sPath = null;
Object m_oUnoObject;
private XMultiComponentFactory m_xMultiComponentFactory;
private XComponentContext m_xComponentContext;
@@ -65,54 +65,54 @@ public class UnoNode{
private int m_nNodeType = XUnoNode.nOTHERS;
private Type aType = null;
private String sLabel = "";
-
-
-
+
+
+
/** Creates a new instance of UnoNode */
public UnoNode(Object _oUnoObject) {
m_xComponentContext = Introspector.getIntrospector().getXComponentContext();
- m_xMultiComponentFactory = m_xComponentContext.getServiceManager();
+ m_xMultiComponentFactory = m_xComponentContext.getServiceManager();
m_oUnoObject = _oUnoObject;
}
-
+
public UnoNode(Object _oUnoObject, Type _aType) {
this(_oUnoObject);
aType = _aType;
m_nNodeType = XUnoNode.nINTERFACE;
}
-
+
public Object getUnoObject(){
return m_oUnoObject;
- }
-
-
+ }
+
+
protected XComponentContext getXComponentContext(){
return m_xComponentContext;
}
-
-
+
+
protected XMultiComponentFactory getXMultiComponentFactory(){
return m_xMultiComponentFactory;
}
-
-
+
+
private static XTypeDescriptionEnumerationAccess getXTypeDescriptionEnumerationAccess(){
return Introspector.getIntrospector().getXTypeDescriptionEnumerationAccess();
}
-
+
public String getAnchor(){
return "";
}
-
+
public int getNodeType(){
return m_nNodeType;
}
-
+
public void setNodeType(int _nNodeType){
m_nNodeType = _nNodeType;
}
-
+
public String getClassName(){
String sClassName = "";
if (m_nNodeType == XUnoNode.nINTERFACE){
@@ -123,8 +123,8 @@ public class UnoNode{
}
return sClassName;
}
-
-
+
+
public Type getUnoType(){
return aType;
}
@@ -132,7 +132,7 @@ public class UnoNode{
protected void setLabel(String _sLabel){
sLabel = _sLabel;
}
-
+
public void openIdlDescription(String _sIDLUrl, String _sClassName, String _sAnchor){
try{
String sIDLUrl = _sIDLUrl;
@@ -164,7 +164,7 @@ public class UnoNode{
getXDispatcher(openHyperlink).dispatch(openHyperlink, new PropertyValue[] {pv});
} catch(Exception exception) {
exception.printStackTrace(System.out);
- }}
+ }}
private com.sun.star.util.URL getDispatchURL(String _sURL){
@@ -204,7 +204,7 @@ public class UnoNode{
} catch (Exception e) {
e.printStackTrace(System.out);
return null;
- }}
+ }}
private PropertyValue[] loadArgs(String url) {
@@ -212,21 +212,21 @@ public class UnoNode{
pv.Name = "URL";
pv.Value = url;
return new PropertyValue[] {pv};
- }
-
-
-
+ }
+
+
+
public boolean isFilterApplicable(String _sFilter, String _sName){
boolean bFilterDoesApply = true;
if (_sFilter.length() > 0){
- if (_sName.indexOf(_sFilter) == -1){
+ if (_sName.indexOf(_sFilter) == -1){
bFilterDoesApply = false;
}
}
return bFilterDoesApply;
}
-
-
+
+
// public static String getServiceDescription(Object _oUnoObject){
// String sClassName = "";
// XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, _oUnoObject);
@@ -238,15 +238,15 @@ public class UnoNode{
// }
// return sClassName;
// }
-
-
-
+
+
+
private static String[] getMandatoryServiceNames(String _sServiceName){
String[] sMandatoryServiceNames = new String[]{};
try {
TypeClass[] eTypeClasses = new com.sun.star.uno.TypeClass[1];
eTypeClasses[0] = com.sun.star.uno.TypeClass.SERVICE;
- XTypeDescriptionEnumeration xTDEnumeration = getXTypeDescriptionEnumerationAccess().createTypeDescriptionEnumeration(Introspector.getModuleName(_sServiceName), eTypeClasses, TypeDescriptionSearchDepth.INFINITE);
+ XTypeDescriptionEnumeration xTDEnumeration = getXTypeDescriptionEnumerationAccess().createTypeDescriptionEnumeration(Introspector.getModuleName(_sServiceName), eTypeClasses, TypeDescriptionSearchDepth.INFINITE);
while (xTDEnumeration.hasMoreElements()) {
XTypeDescription xTD = xTDEnumeration.nextTypeDescription();
if (xTD.getName().equals(_sServiceName)){
@@ -257,16 +257,16 @@ public class UnoNode{
for (int i = 0; i < nlength; i++){
sMandatoryServiceNames[i] = xMandatoryServiceTypeDescriptions[i].getName();
}
-
- }
- }
+
+ }
+ }
} catch ( java.lang.Exception e) {
System.out.println(System.out);
}
return sMandatoryServiceNames;
}
-
-
+
+
private static String[] removeMandatoryServiceNames(String[] _sServiceNames){
try{
List aList = java.util.Arrays.asList(_sServiceNames);
@@ -288,8 +288,8 @@ public class UnoNode{
}
return new String[]{};
}
-
-
+
+
public static String getDisplayValueOfPrimitiveType(Object _objectElement){
String sValue ="";
try{
@@ -297,41 +297,41 @@ public class UnoNode{
sValue = AnyConverter.toString(_objectElement);
}
else if (AnyConverter.isBoolean(_objectElement)){
- sValue += AnyConverter.toBoolean(_objectElement);
+ sValue += AnyConverter.toBoolean(_objectElement);
}
else if (AnyConverter.isByte(_objectElement)){
- sValue += AnyConverter.toByte(_objectElement);
+ sValue += AnyConverter.toByte(_objectElement);
}
else if (AnyConverter.isChar(_objectElement)){
- sValue += AnyConverter.toChar(_objectElement);
+ sValue += AnyConverter.toChar(_objectElement);
}
else if (AnyConverter.isDouble(_objectElement)){
- sValue += AnyConverter.toDouble(_objectElement);
+ sValue += AnyConverter.toDouble(_objectElement);
}
else if (AnyConverter.isFloat(_objectElement)){
- sValue += AnyConverter.toFloat(_objectElement);
+ sValue += AnyConverter.toFloat(_objectElement);
}
else if (AnyConverter.isInt(_objectElement)){
- sValue += AnyConverter.toInt(_objectElement);
+ sValue += AnyConverter.toInt(_objectElement);
}
else if (AnyConverter.isLong(_objectElement)){
- sValue += AnyConverter.toLong(_objectElement);
+ sValue += AnyConverter.toLong(_objectElement);
}
else if (AnyConverter.isShort(_objectElement)){
- sValue += AnyConverter.toShort(_objectElement);
- }
+ sValue += AnyConverter.toShort(_objectElement);
+ }
}
catch( Exception e ) {
System.err.println( e );
}
return sValue;
}
-
+
protected static String[] getDisplayValuesofPrimitiveArray(Object _oUnoObject){
String[] sDisplayValues = null;
try{
Type aType = AnyConverter.getType(_oUnoObject);
- TypeClass aTypeClass = aType.getTypeClass();
+ TypeClass aTypeClass = aType.getTypeClass();
int nTypeValue = aTypeClass.getValue();
if (nTypeValue == TypeClass.SEQUENCE_value){
nTypeValue = (sequenceComponentType(aType)).getTypeClass().getValue();
@@ -387,7 +387,7 @@ public class UnoNode{
}
break;
case TypeClass.CHAR_value:
- break;
+ break;
default:
System.out.println("Value could not be retrieved: " + aType.getTypeClass().getClass().getName());
}
@@ -396,9 +396,9 @@ public class UnoNode{
catch( Exception e ) {
System.err.println( e );
return null;
- }}
-
-
+ }}
+
+
private static Type sequenceComponentType(Type sequenceType) {
// assert sequenceType.getTypeClass() == TypeClass.SEQUENCE;
String n = sequenceType.getTypeName();
@@ -406,15 +406,15 @@ public class UnoNode{
// assert n.startsWith(PREFIX);
return new Type(n.substring(PREFIX.length()));
}
-
-
+
+
public static String getNodeDescription(Object _oUnoObject, int _nIndex){
return getNodeDescription(_oUnoObject) + "[" + (_nIndex + 1) + "]";
}
public static String getNodeDescription(Object _oUnoObject){
- XServiceInfo xServiceInfo = ( XServiceInfo ) UnoRuntime.queryInterface( XServiceInfo.class, _oUnoObject );
+ XServiceInfo xServiceInfo = ( XServiceInfo ) UnoRuntime.queryInterface( XServiceInfo.class, _oUnoObject );
if ( xServiceInfo != null ) {
return xServiceInfo.getImplementationName();
}
@@ -425,13 +425,13 @@ public class UnoNode{
else{
return _oUnoObject.getClass().getName();
}
- }
-
+ }
+
public void setParameterObjects(Object[] _oParamObjects){
m_oParamObjects = _oParamObjects;
}
-
+
public Object[] getParameterObjects(){
return m_oParamObjects;
- }
+ }
}
diff --git a/odk/examples/java/Inspector/UnoPropertyNode.java b/odk/examples/java/Inspector/UnoPropertyNode.java
index 4b22b01f1b8a..e9efe526a24b 100644
--- a/odk/examples/java/Inspector/UnoPropertyNode.java
+++ b/odk/examples/java/Inspector/UnoPropertyNode.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.Property;
@@ -48,17 +48,17 @@ import com.sun.star.uno.XComponentContext;
import javax.swing.tree.DefaultMutableTreeNode;
public class UnoPropertyNode extends UnoNode{
-
+
Property aProperty;
PropertyValue aPropertyValue;
String m_sPropertyName;
Object m_oUnoReturnObject;
private int m_nPropertyType = XUnoPropertyNode.nDEFAULT;
private String sLabel = "";
-
+
private static XConstantTypeDescription[] xPropertyAttributesTypeDescriptions = null;
-
-
+
+
/** Creates a new instance of UnoMethodNode */
public UnoPropertyNode(Property _aProperty, Object _oUnoObject, Object _oUnoReturnObject) {
super(_oUnoObject);
@@ -74,7 +74,7 @@ public class UnoPropertyNode extends UnoNode{
m_sPropertyName = aProperty.Name;
m_oUnoReturnObject = null;
}
-
+
public UnoPropertyNode(PropertyValue _aPropertyValue, Object _oUnoObject, Object _oUnoReturnObject) {
super(_oUnoObject);
m_oUnoReturnObject = _oUnoReturnObject;
@@ -82,17 +82,17 @@ public class UnoPropertyNode extends UnoNode{
m_sPropertyName = aPropertyValue.Name;
}
-
+
public int getPropertyNodeType(){
return m_nPropertyType;
}
-
-
+
+
public void setPropertyNodeType(int _nPropertyType){
m_nPropertyType = _nPropertyType;
}
-
-
+
+
public String getPropertyName(){
return m_sPropertyName;
}
@@ -101,7 +101,7 @@ public class UnoPropertyNode extends UnoNode{
return this.m_sPropertyName;
}
-
+
public String getClassName(){
String sClassName = "";
if (m_oUnoObject != null){
@@ -120,15 +120,15 @@ public class UnoPropertyNode extends UnoNode{
sClassName = "com.sun.star.beans.Property";
}
return sClassName;
- }
-
-
+ }
+
+
public String getAnchor(){
return m_sPropertyName;
}
-
-
-
+
+
+
protected boolean doesServiceSupportProperty(String _sServiceName, String _sPropertyName){
try {
XPropertyTypeDescription[] xPropertyTypeDescriptions = Introspector.getIntrospector().getPropertyDescriptionsOfService(_sServiceName);
@@ -142,18 +142,18 @@ public class UnoPropertyNode extends UnoNode{
}
return false;
}
-
-
+
+
public Object getUnoReturnObject(){
return m_oUnoReturnObject;
}
-
-
+
+
private boolean isPrimitive(){
boolean bIsPrimitive = true;
if (getUnoReturnObject() != null){
if (getProperty() != null){
- bIsPrimitive = Introspector.isObjectPrimitive(getUnoReturnObject().getClass(), getProperty().Type.getTypeClass());
+ bIsPrimitive = Introspector.isObjectPrimitive(getUnoReturnObject().getClass(), getProperty().Type.getTypeClass());
}
else{
bIsPrimitive = Introspector.isObjectPrimitive(getUnoReturnObject().getClass());
@@ -164,8 +164,8 @@ public class UnoPropertyNode extends UnoNode{
}
return bIsPrimitive;
}
-
-
+
+
protected boolean isFoldable(){
boolean bIsFoldable = false;
if (! isPrimitive()){
@@ -174,8 +174,8 @@ public class UnoPropertyNode extends UnoNode{
}
return bIsFoldable;
}
-
-
+
+
protected String getLabel(){
if (!sLabel.equals("")){
if (! isPrimitive()){
@@ -186,32 +186,32 @@ public class UnoPropertyNode extends UnoNode{
sLabel = getStandardPropertyDescription(aProperty, getUnoReturnObject());
}
}
- else {
+ else {
sLabel = getStandardPropertyDescription(aProperty, getUnoReturnObject());
}
}
return sLabel;
}
-
+
public Property getProperty(){
return aProperty;
}
-
+
protected static String getPropertyTypeDescription(Property _aProperty, Object _oUnoObject){
- return _aProperty.Type.getTypeName() + " " + _aProperty.Name + " = " + _oUnoObject.toString();
- }
+ return _aProperty.Type.getTypeName() + " " + _aProperty.Name + " = " + _oUnoObject.toString();
+ }
protected static String getStandardPropertyDescription(Property _aProperty, Object _objectElement){
if (!Introspector.isObjectPrimitive(_objectElement)){
- return _aProperty.Name + " = (" + _aProperty.Type.getTypeName() + ") ";
+ return _aProperty.Name + " = (" + _aProperty.Type.getTypeName() + ") ";
}
else{
- return _aProperty.Name + " (" + _aProperty.Type.getTypeName() + ") = " + getDisplayValueOfPrimitiveType(_objectElement);
+ return _aProperty.Name + " (" + _aProperty.Type.getTypeName() + ") = " + getDisplayValueOfPrimitiveType(_objectElement);
}
}
-
+
protected static String getStandardPropertyValueDescription(PropertyValue _aPropertyValue){
if (!Introspector.isObjectPrimitive(_aPropertyValue.Value)){
return _aPropertyValue.Name;
@@ -219,7 +219,7 @@ public class UnoPropertyNode extends UnoNode{
else{
return _aPropertyValue.Name + " : " + UnoNode.getDisplayValueOfPrimitiveType(_aPropertyValue.Value);
}
- }
+ }
}
diff --git a/odk/examples/java/Inspector/UnoTreeRenderer.java b/odk/examples/java/Inspector/UnoTreeRenderer.java
index 54094275606c..9c2772124658 100644
--- a/odk/examples/java/Inspector/UnoTreeRenderer.java
+++ b/odk/examples/java/Inspector/UnoTreeRenderer.java
@@ -55,13 +55,13 @@ public class UnoTreeRenderer extends DefaultTreeCellRenderer{
private Icon m_oPropertyValueIcon;
private boolean bSelected;
private int nWidth = 0;
-
-
+
+
/** Creates a new instance of UnoTreeRenderer */
public UnoTreeRenderer(){
super();
try {
-
+
final ClassLoader loader = ClassLoader.getSystemClassLoader();
m_oMethodIcon = new ImageIcon(loader.getResource("images/methods_16.png"));
m_oPropertyIcon = new ImageIcon("images/properties_16.png");
@@ -74,14 +74,14 @@ public class UnoTreeRenderer extends DefaultTreeCellRenderer{
System.out.println("Sorry, could not locate resourecs, treecell icons will not be displayed.");
}
}
-
-
+
+
public synchronized Component getTreeCellRendererComponent(JTree tree,Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus){
try{
bSelected = sel;
DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
Component rc = super.getTreeCellRendererComponent( tree, value, sel,expanded, leaf, row,hasFocus);
- String sLabelText = (String)node.getUserObject();
+ String sLabelText = (String)node.getUserObject();
if (sLabelText != null){
if (sLabelText.equals(XUnoFacetteNode.SCONTAINERDESCRIPTION)){
// setIcon(m_oContainerIcon);
@@ -113,9 +113,9 @@ public class UnoTreeRenderer extends DefaultTreeCellRenderer{
}
return this;
}
-
-
-
+
+
+
public void paintComponent(Graphics g) {
FontMetrics fm = getFontMetrics(getFont());
int x, y;
diff --git a/odk/examples/java/Inspector/XDialogProvider.java b/odk/examples/java/Inspector/XDialogProvider.java
index e8bfadc1873f..fdf406273b7e 100644
--- a/odk/examples/java/Inspector/XDialogProvider.java
+++ b/odk/examples/java/Inspector/XDialogProvider.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,37 +29,37 @@
* 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.
- *
+ *
*************************************************************************/
public interface XDialogProvider {
-
- public static String SINVOKE = "Invoke";
-
+
+ public static String SINVOKE = "Invoke";
+
public static String SADDTOSOURCECODE = "Add to Sourcecode";
-
- public void enablePopupMenuItem(String _sMenuTitle, boolean _bdoEnable);
-
+
+ public void enablePopupMenuItem(String _sMenuTitle, boolean _bdoEnable);
+
public void showPopUpMenu(Object invoker, int x, int y) throws java.lang.ClassCastException;
-
+
public InspectorPane getSelectedInspectorPage();
public void addInspectorPage(String _sTitle, Object _oContainer);
-
+
public InspectorPane getInspectorPage(int _nIndex);
public int getInspectorPageCount();
-
+
public void selectInspectorPageByIndex(int nTabIndex);
-
+
public void show(int _nPageIndex) throws java.lang.ClassCastException;
-
+
public void selectSourceCodeLanguage(int _nLanguage);
-
+
public void paint();
-
+
// returns one of the constants defined in XLanguageSourceCodeGenerator
public int getLanguage();
-
+
public String getIDLPath();
}
diff --git a/odk/examples/java/Inspector/XInstanceInspector.idl b/odk/examples/java/Inspector/XInstanceInspector.idl
index 134879f68cee..2749535816b2 100644
--- a/odk/examples/java/Inspector/XInstanceInspector.idl
+++ b/odk/examples/java/Inspector/XInstanceInspector.idl
@@ -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,28 +29,28 @@
* 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 INCLUDED_ORG_OPENOFFICE_XINSTANCEINSPECTOR_IDL
#define INCLUDED_ORG_OPENOFFICE_XINSTANCEINSPECTOR_IDL
-#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/uno/XInterface.idl>
+
+module org { module openoffice {
-module org { module openoffice {
-
- interface XInstanceInspector {
+ interface XInstanceInspector {
/**
* For a given instance this method displays all services, interfaces,
* methods, attributes, and contents in a tree. All dependend
* instances are also inspected and displayed, so the user could browse
* the tree. If you press the key "F1", the API-documentation from
- * www.openoffice.org for the current instance will be displayed in a
+ * www.openoffice.org for the current instance will be displayed in a
* new window.
*/
- void inspect( [in] any aInstance, [in] string sTitle );
+ void inspect( [in] any aInstance, [in] string sTitle );
};
-
+
}; };
#endif
diff --git a/odk/examples/java/Inspector/XLanguageSourceCodeGenerator.java b/odk/examples/java/Inspector/XLanguageSourceCodeGenerator.java
index 832f0aa51d4b..aaf424607a8a 100644
--- a/odk/examples/java/Inspector/XLanguageSourceCodeGenerator.java
+++ b/odk/examples/java/Inspector/XLanguageSourceCodeGenerator.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,78 +29,78 @@
* 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.TypeClass;
import java.util.Vector;
public interface XLanguageSourceCodeGenerator {
-
+
public static final int nJAVA = 0;
public static final int nCPLUSPLUS = 1;
public static final int nBASIC = 2;
-
+
public String getHeaderSourceCode(Object _oUnoObject, String _sClassName, TypeClass _aTypeClass);
- public String getFinalHeaderStatements();
+ public String getFinalHeaderStatements();
public void assignqueryInterfaceHeaderSourceCode();
-
+
public String getMainMethodSignatureSourceCode(XUnoNode _oUnoNode, String _soReturnObjectDescription);
-
+
public String getMethodTerminationSourceCode();
-
+
public String getStatementTerminationCharacter();
- public boolean needsqueryInterface();
-
+ public boolean needsqueryInterface();
+
public String getqueryInterfaceSourceCode(String _sReturnValueDescription, String _sClassName, String _sObjectDescription);
-
+
public String getPropertyValueGetterSourceCode(String _sPropertyName, String _sReturnVariableName, String _sIncomingObjectName, TypeClass _aTypeClass, String _sTypeName);
-
+
public String getStructSourceCode(String _sReturnVariableDescription, String _sObjectDescription, String _sMember);
-
+
public String getObjectTypeDescription(String _sClassName, boolean _bAsHeader);
-
+
public String getbooleanTypeDescription();
public String getbyteTypeDescription();
public String getshortTypeDescription();
-
+
public String getunsignedshortTypeDescription();
public String getlongTypeDescription();
public String getunsignedlongTypeDescription();
-
+
public String gethyperTypeDescription();
public String getunsignedhyperTypeDescription();
public String getfloatTypeDescription();
-
+
public String getdoubleTypeDescription();
public String getcharTypeDescription();
-
+
public String getstringTypeDescription(boolean _bAsHeaderSourceCode);
-
+
public String gettypeTypeDescription(boolean _bAsHeaderSourceCode);
-
+
public String getanyTypeDescription(boolean _bAsHeaderSourceCode);
-
+
public String getArrayDeclaration(String sVariableDeclaration);
-
+
public String getVariableDeclaration(String _sTypeString, String _sVariableName, boolean _bIsArray, TypeClass aTypeClass, boolean _bInitialize);
-
+
public String getMethodSeparator();
-
+
public String getStringValue(String _sValue);
-
+
public String getConvertedSourceCodeValueOfObject(String _sReturnVariableName, String _sObjectDescription, TypeClass _aTypeClass, String _sTypeName);
-
+
public String castLiteral(String _sExpression, TypeClass _aTypeClass);
-
+
public String getCommentSign();
}
diff --git a/odk/examples/java/Inspector/XMethodParametersDialog.java b/odk/examples/java/Inspector/XMethodParametersDialog.java
index 8bad4f19b9c5..d8fcdb13c9b1 100644
--- a/odk/examples/java/Inspector/XMethodParametersDialog.java
+++ b/odk/examples/java/Inspector/XMethodParametersDialog.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,9 +29,9 @@
* 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.
- *
+ *
*************************************************************************/
public interface XMethodParametersDialog {
-
+
}
diff --git a/odk/examples/java/Inspector/XTreeControlProvider.java b/odk/examples/java/Inspector/XTreeControlProvider.java
index ca40d70afae2..8f0d951e1a29 100644
--- a/odk/examples/java/Inspector/XTreeControlProvider.java
+++ b/odk/examples/java/Inspector/XTreeControlProvider.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.Property;
@@ -42,52 +42,52 @@ public interface XTreeControlProvider {
public static String sTitle = "User defined";
public String enableFilterElements(XUnoNode _oUnoNode);
-
+
public void setSourceCode(String _sSourceCode);
-
+
public Object inspect(java.lang.Object _oUserDefinedObject, String _sTitle) throws com.sun.star.uno.RuntimeException;
-
+
public void nodeInserted(XUnoNode _oParentNode, XUnoNode _oChildNode, int index);
-
+
public void nodeChanged(XUnoNode _oNode);
-
- public boolean setNodeVisible(Object node, boolean v);
-
+
+ public boolean setNodeVisible(Object node, boolean v);
+
public XUnoNode getSelectedNode();
-
+
public XTreePathProvider getSelectedPath();
-
+
public void expandPath(XTreePathProvider xTreePathProvider) throws java.lang.ClassCastException;
-
+
public void addTreeExpandListener();
-
- public void addInspectorPane(InspectorPane _oInspectorPane);
-
+
+ public void addInspectorPane(InspectorPane _oInspectorPane);
+
public boolean isPropertyNode(XUnoNode _oUnoNode);
-
+
public boolean isMethodNode(XUnoNode _oUnoNode);
public boolean isFacetteNode(XUnoNode _oUnoNode);
-
+
public XUnoNode addUnoNode(Object _oUnoObject);
-
+
public XUnoNode addUnoNode(Object _oUnoObject, Type _aType);
public XUnoFacetteNode addUnoFacetteNode(XUnoNode _oParentNode, String _sNodeDescription, Object _oUnoObject);
-
+
public XUnoMethodNode addMethodNode(Object _objectElement, XIdlMethod _xIdlMethod);
-
+
public XUnoPropertyNode addUnoPropertyNodeWithName(Property _aProperty);
public XUnoPropertyNode addUnoPropertyNodeWithHandle(Property _aProperty);
public XUnoPropertyNode addUnoPropertyNodeWithType(Property _aProperty);
-
+
public XUnoPropertyNode addUnoPropertyNodeWithAttributesDescription(Property _aProperty);
-
+
public XUnoPropertyNode addUnoPropertyNode(Object _oUnoObject, Property _aProperty);
-
+
public XUnoPropertyNode addUnoPropertyNode(Object _oUnoObject, PropertyValue _aPropertyValue, Object _oReturnObject);
-
- public XUnoPropertyNode addUnoPropertyNode(Object _oUnoObject, Property _aProperty, Object _oUnoReturnObject);
+
+ public XUnoPropertyNode addUnoPropertyNode(Object _oUnoObject, Property _aProperty, Object _oUnoReturnObject);
}
diff --git a/odk/examples/java/Inspector/XTreePathProvider.java b/odk/examples/java/Inspector/XTreePathProvider.java
index 5067bad409c1..8a2f1ba58b59 100644
--- a/odk/examples/java/Inspector/XTreePathProvider.java
+++ b/odk/examples/java/Inspector/XTreePathProvider.java
@@ -12,14 +12,14 @@
* @author bc93774
*/
public interface XTreePathProvider {
-
+
public XUnoNode getLastPathComponent();
-
+
public XUnoNode getPathComponent(int i);
-
- public int getPathCount();
-
+
+ public int getPathCount();
+
public XTreePathProvider getParentPath();
-
- public XTreePathProvider pathByAddingChild(XUnoNode _oUnoNode);
+
+ public XTreePathProvider pathByAddingChild(XUnoNode _oUnoNode);
}
diff --git a/odk/examples/java/Inspector/XUnoFacetteNode.java b/odk/examples/java/Inspector/XUnoFacetteNode.java
index 6ef4bf4d67a9..9bf091b234f3 100644
--- a/odk/examples/java/Inspector/XUnoFacetteNode.java
+++ b/odk/examples/java/Inspector/XUnoFacetteNode.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.
- *
+ *
*************************************************************************/
@@ -44,20 +44,20 @@ public interface XUnoFacetteNode extends XUnoNode {
public static String SINTERFACEDESCRIPTION = "Interfaces";
public static String SCONTENTDESCRIPTION = "Content";
public static String SPROPERTYVALUEDESCRIPTION = "PropertyValues";
-
-
+
+
public boolean isMethodNode();
-
+
public boolean isPropertyNode();
-
+
public boolean isContainerNode();
-
+
public boolean isServiceNode();
-
+
public boolean isInterfaceNode();
-
+
public String getFilter();
-
+
public void setFilter(String _sFilter);
-
+
}
diff --git a/odk/examples/java/Inspector/XUnoMethodNode.java b/odk/examples/java/Inspector/XUnoMethodNode.java
index 074c2fe913ba..93167840a978 100644
--- a/odk/examples/java/Inspector/XUnoMethodNode.java
+++ b/odk/examples/java/Inspector/XUnoMethodNode.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.reflection.XIdlMethod;
@@ -38,31 +38,31 @@ import java.util.Vector;
public interface XUnoMethodNode extends XUnoNode {
-
+
public XIdlMethod getXIdlMethod();
-
+
public boolean isInvoked();
-
+
public Object invoke() throws com.sun.star.uno.Exception;
-
+
public Object invoke(Object _oUnoObject, Object[] _oParameters) throws com.sun.star.uno.Exception;
-
+
public boolean isInvokable();
-
+
public boolean hasParameters();
-
+
public Object[] getLastParameterObjects();
-
+
public Object getLastUnoReturnObject();
-
+
public TypeClass getTypeClass();
-
+
public boolean isPrimitive();
-
+
public Vector getMethodObjects();
-
+
public boolean isFoldable();
-
+
public String getStandardMethodDescription();
-
+
}
diff --git a/odk/examples/java/Inspector/XUnoNode.java b/odk/examples/java/Inspector/XUnoNode.java
index ae65374aca7a..a27c0aa3a4ab 100644
--- a/odk/examples/java/Inspector/XUnoNode.java
+++ b/odk/examples/java/Inspector/XUnoNode.java
@@ -3,7 +3,7 @@ import com.sun.star.uno.Type;
*
* 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 @@ import com.sun.star.uno.Type;
* 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.
- *
+ *
*************************************************************************/
@@ -39,44 +39,44 @@ public interface XUnoNode {
public static final int nINTERFACE = 1;
public static final int nSERVICE = 2;
public static final int nOTHERS = 3;
-
+
public String getAnchor();
-
+
public String getClassName();
-
+
public void openIdlDescription(String _sIDLUrl);
-
+
public boolean isFilterApplicable(String _sFilter);
-
+
public void setVisible(String _sFilter);
-
+
public void setParameterObjects(Object[] _oParamObjects);
-
+
public Object[] getParameterObjects();
-
+
public String getName();
-
+
public void setFoldable(boolean _bIsFoldable);
-
+
public Object getUnoObject();
-
+
public XUnoNode getParentNode();
-
+
public void addChildNode(XUnoNode _xUnoNode);
-
+
public void setLabel(String _sLabel);
public String getLabel();
-
+
public int getChildCount();
-
+
public XUnoNode getChild(int _index);
-
+
public int getNodeType();
-
+
// possible values are nINTERFACE, nSERVICE, nOTHERS
public void setNodeType(int _nNodeType);
-
+
/** delivers only the Uno-Type when the NodeType is set to nINTERFACE
* otherwise (when the NodeType has not been set returns null
*/
diff --git a/odk/examples/java/Inspector/XUnoPropertyNode.java b/odk/examples/java/Inspector/XUnoPropertyNode.java
index e4aa4caba668..27d6c5021e1d 100644
--- a/odk/examples/java/Inspector/XUnoPropertyNode.java
+++ b/odk/examples/java/Inspector/XUnoPropertyNode.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.Property;
@@ -39,13 +39,13 @@ public interface XUnoPropertyNode extends XUnoNode {
public static int nDEFAULT = 0;
public static int nPROPERTYSETINFOTYPE = 1;
public static int nPROPERTYVALUETYPE = 2;
-
+
public Object getUnoReturnObject();
-
+
public int getPropertyNodeType();
-
+
public void setPropertyNodeType(int _nPropertyType);
public Property getProperty();
-
+
}
diff --git a/odk/examples/java/MinimalComponent/BuildMinimalComponent.xml b/odk/examples/java/MinimalComponent/BuildMinimalComponent.xml
index 6aa7c5b9322f..a296f7f932c6 100644
--- a/odk/examples/java/MinimalComponent/BuildMinimalComponent.xml
+++ b/odk/examples/java/MinimalComponent/BuildMinimalComponent.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- author: Bertram Nolte
+ author: Bertram Nolte
created: 2001-10-11
revision: 1.0
-->
diff --git a/odk/examples/java/MinimalComponent/MinimalComponent.idl b/odk/examples/java/MinimalComponent/MinimalComponent.idl
index c24011ccdafc..41ee6c53c14f 100644
--- a/odk/examples/java/MinimalComponent/MinimalComponent.idl
+++ b/odk/examples/java/MinimalComponent/MinimalComponent.idl
@@ -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,14 +29,14 @@
* 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 _org_openoffice_MinimalComponent_idl_
-#define _org_openoffice_MinimalComponent_idl_
-
-#include <com/sun/star/lang/XServiceInfo.idl>
-
+#ifndef _org_openoffice_MinimalComponent_idl_
+#define _org_openoffice_MinimalComponent_idl_
+
+#include <com/sun/star/lang/XServiceInfo.idl>
+
// org
module org {
// openoffice
@@ -49,4 +49,4 @@ module org {
};
};
-#endif
+#endif
diff --git a/odk/examples/java/MinimalComponent/MinimalComponent.java b/odk/examples/java/MinimalComponent/MinimalComponent.java
index 47129efc00d2..ef75cb287c1d 100644
--- a/odk/examples/java/MinimalComponent/MinimalComponent.java
+++ b/odk/examples/java/MinimalComponent/MinimalComponent.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.lib.uno.helper.Factory;
@@ -59,7 +59,7 @@ public class MinimalComponent {
*/
static private final String __serviceName =
"org.openoffice.MinimalComponent";
-
+
/** The initial component contextr, that gives access to
* the service manager, supported singletons, ...
* It's often later used
@@ -70,7 +70,7 @@ public class MinimalComponent {
* It's often later used
*/
private XMultiComponentFactory m_xMCF;
-
+
/** The constructor of the inner class has a XMultiServiceFactory parameter.
* @param xmultiservicefactoryInitialization A special service factory
* could be introduced while initializing.
@@ -78,13 +78,13 @@ public class MinimalComponent {
public _MinimalComponent(XComponentContext xCompContext) {
try {
m_cmpCtx = xCompContext;
- m_xMCF = m_cmpCtx.getServiceManager();
+ m_xMCF = m_cmpCtx.getServiceManager();
}
catch( Exception e ) {
e.printStackTrace();
}
}
-
+
/** This method is a member of the interface for initializing an object
* directly after its creation.
* @param object This array of arbitrary objects will be passed to the
@@ -99,7 +99,7 @@ public class MinimalComponent {
* your component using these objects.
*/
}
-
+
/** This method returns an array of all supported service names.
* @return Array of supported service names.
*/
@@ -115,7 +115,7 @@ public class MinimalComponent {
String[] sSupportedServiceNames = { __serviceName };
return sSupportedServiceNames;
}
-
+
/** This method returns true, if the given service will be
* supported by the component.
* @param sServiceName Service name.
@@ -124,16 +124,16 @@ public class MinimalComponent {
public boolean supportsService( String sServiceName ) {
return sServiceName.equals( __serviceName );
}
-
+
/** Return the class name of the component.
* @return Class name of the component.
*/
public String getImplementationName() {
return _MinimalComponent.class.getName();
- }
+ }
}
-
-
+
+
/**
* Gives a factory for creating the service.
* This method is called by the <code>JavaLoader</code>
@@ -147,11 +147,11 @@ public class MinimalComponent {
public static XSingleComponentFactory __getComponentFactory(String sImplName)
{
XSingleComponentFactory xFactory = null;
-
+
if ( sImplName.equals( _MinimalComponent.class.getName() ) )
xFactory = Factory.createComponentFactory(_MinimalComponent.class,
_MinimalComponent.getServiceNames());
-
+
return xFactory;
}
diff --git a/odk/examples/java/MinimalComponent/TestMinimalComponent.java b/odk/examples/java/MinimalComponent/TestMinimalComponent.java
index 9a6df86f6fe1..219eea7ca504 100644
--- a/odk/examples/java/MinimalComponent/TestMinimalComponent.java
+++ b/odk/examples/java/MinimalComponent/TestMinimalComponent.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.XSingleComponentFactory;
@@ -42,7 +42,7 @@ import com.sun.star.lang.XServiceInfo;
public class TestMinimalComponent {
public static void main(String args[]) {
com.sun.star.uno.XComponentContext xContext = null;
-
+
try {
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
@@ -51,19 +51,19 @@ public class TestMinimalComponent {
XServiceInfo xSIMinimalComponent =
org.openoffice.MinimalComponent.create(xContext);
-
+
System.out.println("\nXServiceInfo is used to get the implementation" +
" name: " +
xSIMinimalComponent.getImplementationName() +
- "\nOk\n");
+ "\nOk\n");
xContext = null;
-
+
System.exit(0);
}
catch( Exception e ) {
System.err.println( e );
e.printStackTrace();
System.exit(1);
- }
+ }
}
}
diff --git a/odk/examples/java/NotesAccess/NotesAccess.java b/odk/examples/java/NotesAccess/NotesAccess.java
index f337304e09c7..e989c9cfa760 100644
--- a/odk/examples/java/NotesAccess/NotesAccess.java
+++ b/odk/examples/java/NotesAccess/NotesAccess.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.
- *
+ *
*************************************************************************/
// Lotus Notes Domino API
@@ -59,29 +59,29 @@ import com.sun.star.table.XCell;
* with existing values of documents from a Lotus Notes database.
*/
public class NotesAccess implements Runnable {
-
+
/** Host server of the Domino Directory.
*/
static String stringHost = "";
-
+
/** User in the host's Domino Directory.
*/
static String stringUser = "";
-
+
/** Password for the user in the host's Domino Directory.
*/
static String stringPassword = "";
-
+
/** Database with documents to get data from.
*/
static String stringDatabase = "";
-
+
/** Reading the arguments and constructing the thread.
* @param argv Holding values for the host, user, and the password of the user.
*/
public static void main( String args[] ) {
Thread thread;
-
+
if ( args.length < 4 ) {
System.out.println(
"usage: java -jar NotesAccess.jar \"<Domino Host>\" \"<User>\" " +
@@ -91,7 +91,7 @@ public class NotesAccess implements Runnable {
"java -jar NotesAccess.jar \"\" \"\" \"\" \"Stocks.nsf\"" );
System.exit( 1 );
}
-
+
if ( !args[ 0 ].trim().equals( "" ) ) {
stringHost = args[ 0 ].trim();
}
@@ -99,7 +99,7 @@ public class NotesAccess implements Runnable {
stringUser = args[ 1 ].trim();
}
stringPassword = args[ 2 ].trim();
-
+
try {
java.io.File sourceFile = new java.io.File(args[ 3 ].trim());
stringDatabase = sourceFile.getCanonicalPath();
@@ -108,31 +108,31 @@ public class NotesAccess implements Runnable {
e.printStackTrace();
System.exit( 1 );
}
-
+
if ( stringHost.equals( "" ) ) {
// Initializing.
NotesAccess notesaccess = new NotesAccess();
-
+
// Allowing only local calls to the Domino classes.
thread = new NotesThread( ( Runnable ) notesaccess );
}
else {
// Extracting the host, user, and password.
NotesAccess notesaccess = new NotesAccess();
-
+
// Allowing remote calls to the Domino classes.
thread = new Thread( ( Runnable ) notesaccess );
}
-
+
// Starting the thread.
thread.start();
}
-
+
/** This is the default constructor without arguments.
*/
public NotesAccess() {
}
-
+
/** Reading all documents from the given database and writing the data to
* an OpenOffice.org Calc spreadsheet document.
*/
@@ -141,11 +141,11 @@ public class NotesAccess implements Runnable {
// get the remote office component context
XComponentContext xContext =
com.sun.star.comp.helper.Bootstrap.bootstrap();
-
+
System.out.println("Connected to a running office ...");
-
- XMultiComponentFactory xMCF = xContext.getServiceManager();
-
+
+ XMultiComponentFactory xMCF = xContext.getServiceManager();
+
/* A desktop environment contains tasks with one or more
frames in which components can be loaded. Desktop is the
environment for components which can instanciate within
@@ -154,28 +154,28 @@ public class NotesAccess implements Runnable {
UnoRuntime.queryInterface(XComponentLoader.class,
xMCF.createInstanceWithContext(
"com.sun.star.frame.Desktop", xContext));
-
+
// Load a Writer document, which will be automaticly displayed
XComponent xComponent = xLoader.loadComponentFromURL(
"private:factory/scalc", "_blank", 0,
new PropertyValue[0] );
-
+
// Querying for the interface XSpreadsheetDocument
XSpreadsheetDocument xSpreadsheetDoc =
(XSpreadsheetDocument) UnoRuntime.queryInterface(
XSpreadsheetDocument.class, xComponent);
-
+
// Getting all sheets from the spreadsheet document.
XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets() ;
-
+
// Querying for the interface XIndexAccess.
XIndexAccess xIndexAccess = (XIndexAccess) UnoRuntime.queryInterface(
XIndexAccess.class, xSpreadsheets);
-
+
// Getting the first spreadsheet.
XSpreadsheet xSpreadsheet = (XSpreadsheet) UnoRuntime.queryInterface(
XSpreadsheet.class, xIndexAccess.getByIndex(0));
-
+
Session session;
if ( !stringHost.equals( "" ) ) {
// Creating a Notes session for remote calls to the Domino classes.
@@ -187,69 +187,69 @@ public class NotesAccess implements Runnable {
// Domino classes.
session = NotesFactory.createSession();
}
-
+
// Getting the specified Notes database.
Database database = session.getDatabase( "", stringDatabase );
-
+
// Getting a collection of all documents from the database.
DocumentCollection documentCollection = database.getAllDocuments();
-
+
// Getting the first document from the database
Document document = documentCollection.getFirstDocument();
-
+
// Start to write to cells at this row.
int intRowToStart = 0;
-
+
// The current row.
int intRow = intRowToStart;
-
+
// The current column.
int intColumn = 0;
-
+
// Process all documents
while ( document != null ) {
// Getting the name of the stock.
String stringName = document.getItemValueString("Name");
-
+
// Inserting the name to a specified cell.
insertIntoCell(intColumn, intRow, stringName, xSpreadsheet, "");
-
+
// Getting the number of stocks.
double intNumber = document.getItemValueInteger( "Number" );
-
+
// Inserting the number of stocks to a specified cell.
insertIntoCell( intColumn + 1, intRow, String.valueOf(intNumber),
xSpreadsheet, "V" );
-
+
// Getting current share price.
double doubleSharePrice = document.getItemValueDouble("SharePrice");
-
+
// Inserting the current share price to a specified cell.
insertIntoCell(intColumn + 2, intRow,
String.valueOf(doubleSharePrice),
xSpreadsheet, "V");
-
+
// Inserting the total value.
insertIntoCell(intColumn + 3, intRow, "=B"
+ String.valueOf( intRow + 1 )
+ "*C" + String.valueOf(intRow + 1),
xSpreadsheet, "");
-
+
// Increasing the current row.
intRow++;
-
+
// Getting the next document from the collection.
document = documentCollection.getNextDocument();
}
-
+
// Summing all specific amounts.
insertIntoCell(intColumn + 3, intRow, "=sum(D"
+ String.valueOf( intRowToStart + 1 ) + ":D"
+ String.valueOf( intRow ),
xSpreadsheet, "");
-
+
xContext = null;
-
+
// Leaving the program.
System.exit(0);
}
@@ -257,7 +257,7 @@ public class NotesAccess implements Runnable {
e.printStackTrace();
}
}
-
+
/** Inserting a value or formula to a cell defined by the row and column.
* @param intCellX Row.
* @param intCellY Column.
@@ -272,7 +272,7 @@ public class NotesAccess implements Runnable {
String stringFlag)
{
XCell xCell = null;
-
+
try {
xCell = xSpreadsheet.getCellByPosition( intCellX, intCellY );
} catch ( com.sun.star.lang.IndexOutOfBoundsException exception ) {
diff --git a/odk/examples/java/PropertySet/PropTest.java b/odk/examples/java/PropertySet/PropTest.java
index e8652c7689bb..fded3c08c3ec 100644
--- a/odk/examples/java/PropertySet/PropTest.java
+++ b/odk/examples/java/PropertySet/PropTest.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,11 +29,11 @@
* 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.
- *
+ *
*************************************************************************/
/*
-This example shows a UNO component that inherits com.sun.star.lib.uno.helper.PropertySet in
+This example shows a UNO component that inherits com.sun.star.lib.uno.helper.PropertySet in
order to provide implementations of these interfaces:
com.sun.star.beans.XPropertySet
@@ -140,11 +140,11 @@ public class PropTest extends PropertySet implements XServiceInfo
public Object[] arObjectA; // MAYBEVOID
public Any[] arAnyA; // MAYBEVOID
public XInterface[] arXinterfaceA; // MAYBEVOID
- public boolean[][] ar2BoolA; // MAYBEVOID
+ public boolean[][] ar2BoolA; // MAYBEVOID
public Boolean boolClassA; // MAYBEVOID
public Character charClassA; // MAYBEVOID
- public Byte byteClassA; // MAYBEVOID
- public Short shortClassA; // MAYBEVOID
+ public Byte byteClassA; // MAYBEVOID
+ public Short shortClassA; // MAYBEVOID
public Integer intClassA; // MAYBEVOID
public Long longClassA; // MAYBEVOID
public Float floatClassA; // MAYBEVOID
@@ -152,7 +152,7 @@ public class PropTest extends PropertySet implements XServiceInfo
// readonly
public int roIntA= 100;
- public Integer roIntClassA= new Integer(100);
+ public Integer roIntClassA= new Integer(100);
public Object roObjectA= new Integer(101);
public Any roAnyA= new Any( new Type(int.class), new Integer(102));
@@ -167,7 +167,7 @@ public class PropTest extends PropertySet implements XServiceInfo
public Object mvObjectA;
public Any mvAnyA;
public XInterface mvXinterfaceA;
-
+
public static final String __serviceName="PropTest";
public PropTest() {
@@ -219,7 +219,7 @@ public class PropTest extends PropertySet implements XServiceInfo
registerProperty("mvAnyA", PropertyAttribute.MAYBEVOID);
registerProperty("mvXinterfaceA", PropertyAttribute.MAYBEVOID);
}
-
+
// XServiceName
public String getImplementationName( )
@@ -234,7 +234,7 @@ public class PropTest extends PropertySet implements XServiceInfo
return true;
return false;
}
-
+
//XServiceName
public String[] getSupportedServiceNames( )
{
@@ -257,7 +257,7 @@ public class PropTest extends PropertySet implements XServiceInfo
return xSingleServiceFactory;
}
- public static boolean __writeRegistryServiceInfo(XRegistryKey regKey)
+ public static boolean __writeRegistryServiceInfo(XRegistryKey regKey)
{
return FactoryHelper.writeRegistryServiceInfo( PropTest.class.getName(),
PropTest.__serviceName, regKey);
diff --git a/odk/examples/java/Spreadsheet/CalcAddins.java b/odk/examples/java/Spreadsheet/CalcAddins.java
index 6a052a7e2eea..0f0fddad97d3 100644
--- a/odk/examples/java/Spreadsheet/CalcAddins.java
+++ b/odk/examples/java/Spreadsheet/CalcAddins.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.
- *
+ *
*************************************************************************/
// Template for an Office Calc add-in Java implementation file.
@@ -61,7 +61,7 @@ import org.openoffice.sheet.addin.XCalcAddins;
* information about the component (__writeRegistryServiceInfo()).
*/
public class CalcAddins {
-
+
/** This inner class provides the component as a concrete implementation
* of the service description. It implements the needed interfaces.
* @implements XCalcAddins, XAddIn, XServiceName, XServiceInfo, XTypeProvider
@@ -72,15 +72,15 @@ public class CalcAddins {
XServiceName,
XServiceInfo
{
-
+
/** The component will be registered under this name.
*/
static private final String __serviceName = "org.openoffice.sheet.addin.CalcAddins";
-
+
static private final String ADDIN_SERVICE = "com.sun.star.sheet.AddIn";
-
+
private Locale aFuncLoc;
-
+
private static final String[] stringFunctionName = {
/** TO DO:
* You should replace these method names by the method names of your interface.
@@ -88,19 +88,19 @@ public class CalcAddins {
"getMyFirstValue",
"getMySecondValue"
};
-
+
private static final short shortINVALID = -1;
-
+
/** TO DO:
* For each of your methods you should make up a new constant with a different value.
*/
private static final short shortGETMYFIRSTVALUE = 0;
private static final short shortGETMYSECONDVALUE = 1;
-
-
+
+
/** TO DO:
* This is where you implement all methods of your interface. The parameters have to
- * be the same as in your IDL file and their types have to be the correct
+ * be the same as in your IDL file and their types have to be the correct
* IDL-to-Java mappings of their types in the IDL file.
*/
public int getMyFirstValue(
@@ -108,39 +108,39 @@ public class CalcAddins {
) {
return (int) 1;
}
-
+
public int getMySecondValue(
com.sun.star.beans.XPropertySet xOptions,
int intDummy
) {
return( (int) ( 2 + intDummy ) );
}
-
-
+
+
// Implement method from interface XServiceName
public String getServiceName() {
return( __serviceName );
}
-
+
// Implement methods from interface XServiceInfo
public boolean supportsService(String stringServiceName) {
return( stringServiceName.equals( ADDIN_SERVICE ) ||
stringServiceName.equals( __serviceName ) );
}
-
+
public String getImplementationName() {
return( _CalcAddins.class.getName() );
}
-
+
public String[] getSupportedServiceNames() {
String[] stringSupportedServiceNames = { ADDIN_SERVICE, __serviceName };
return( stringSupportedServiceNames );
}
-
+
// Implement methods from interface XAddIn
public String getDisplayArgumentName(String stringProgrammaticFunctionName,int intArgument) {
String stringReturn = "";
-
+
switch( this.getFunctionID( stringProgrammaticFunctionName ) ) {
/** TO DO:
* You should list all argument names for each of your methods, here.
@@ -165,10 +165,10 @@ public class CalcAddins {
}
return( stringReturn );
}
-
+
public String getDisplayFunctionName(String stringProgrammaticName) {
String stringReturn = "";
-
+
switch( this.getFunctionID( stringProgrammaticName ) ) {
/** TO DO:
* Assign the name of each of your methods.
@@ -180,21 +180,21 @@ public class CalcAddins {
stringReturn = "getMySecondValue";
break;
}
-
+
return( stringReturn );
}
-
+
public String getProgrammaticCategoryName(String p1) {
return( "Add-In" );
}
-
+
public String getDisplayCategoryName(String p1) {
return( "Add-In" );
}
-
+
public String getFunctionDescription(String stringProgrammaticName) {
String stringReturn = "";
-
+
switch( this.getFunctionID( stringProgrammaticName ) ) {
/** TO DO:
* Enter a description for each of your methods that office users will understand.
@@ -206,13 +206,13 @@ public class CalcAddins {
stringReturn = "This is your second method.";
break;
}
-
+
return( stringReturn );
}
-
+
public String getArgumentDescription(String stringProgrammaticFunctionName,int intArgument) {
String stringReturn = "";
-
+
switch( this.getFunctionID( stringProgrammaticFunctionName ) ) {
/** TO DO:
* Enter a description for every argument of every method. Make them so that office users will understand.
@@ -237,20 +237,20 @@ public class CalcAddins {
}
return( stringReturn );
}
-
+
public String getProgrammaticFuntionName(String p1) {
return( "" );
}
-
+
// Implement methods from interface XLocalizable
public Locale getLocale() {
return( aFuncLoc );
}
-
+
public void setLocale(Locale p1) {
aFuncLoc = p1;
}
-
+
// Auxiliary functions
private short getFunctionID( String stringProgrammaticName ) {
for ( int i = 0; i < stringFunctionName.length; i++ ) {
@@ -258,11 +258,11 @@ public class CalcAddins {
return( ( short ) i );
}
}
-
+
return( -1 );
}
}
-
+
/**
* Returns a factory for creating the service.
* This method is called by the <code>JavaLoader</code>
@@ -277,16 +277,16 @@ public class CalcAddins {
XMultiServiceFactory multiFactory,
XRegistryKey regKey) {
XSingleServiceFactory xSingleServiceFactory = null;
-
+
if (implName.equals(_CalcAddins.class.getName()) )
xSingleServiceFactory = FactoryHelper.getServiceFactory(_CalcAddins.class,
_CalcAddins.__serviceName,
multiFactory,
regKey);
-
+
return xSingleServiceFactory;
}
-
+
/**
* Writes the service information into the given registry key.
* This method is called by the <code>JavaLoader</code>
diff --git a/odk/examples/java/Spreadsheet/ChartTypeChange.java b/odk/examples/java/Spreadsheet/ChartTypeChange.java
index 1a86ee3d0b97..ab4e44bfdc4c 100644
--- a/odk/examples/java/Spreadsheet/ChartTypeChange.java
+++ b/odk/examples/java/Spreadsheet/ChartTypeChange.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.awt.Rectangle;
@@ -73,36 +73,36 @@ import com.sun.star.uno.XComponentContext;
* @author Bertram Nolte
*/
public class ChartTypeChange {
-
+
/** Table chart, which type will be changed.
*/
private XTableChart xtablechart = null;
-
+
/** Service factory
*/
private XMultiComponentFactory xMCF = null;
-
+
/** Component context
*/
private XComponentContext xCompContext = null;
-
+
/** Beginning of the program.
* @param args No arguments will be passed to the class.
*/
public static void main(String args[]) {
try {
ChartTypeChange charttypechange = new ChartTypeChange();
-
+
// Double array holding all values the chart should be based on.
String[][] stringValues = {
{ "", "Jan", "Feb", "Mar", "Apr", "Mai" },
{ "Profit", "12.3", "43.2", "5.1", "76", "56.8" },
{ "Rival in business", "12.2", "12.6", "17.7", "20.4", "100" },
};
-
+
// Create the chart with
charttypechange.getChart( stringValues );
-
+
String[] stringChartType = {
"com.sun.star.chart.LineDiagram",
"com.sun.star.chart.BarDiagram",
@@ -112,39 +112,39 @@ public class ChartTypeChange {
"com.sun.star.chart.StockDiagram",
"com.sun.star.chart.AreaDiagram"
};
-
+
for ( int intCounter = 0; intCounter < stringChartType.length;
intCounter++ ) {
charttypechange.changeChartType( stringChartType[ intCounter ],
false );
Thread.sleep( 3000 );
}
-
+
System.exit(0);
}
catch( Exception exception ) {
System.err.println( exception );
}
}
-
+
/** The constructor connects to the OpenOffice.org.
* @param args Parameters for this constructor (connection string).
* @throws Exception All exceptions are thrown from this method.
*/
public ChartTypeChange()
throws Exception {
-
+
/* Bootstraps a component context. Component context to be granted
to a component for running. Arbitrary values can be retrieved
from the context. */
xCompContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
-
+
/* Gets the service manager instance to be used (or null). This method has
been added for convenience, because the service manager is a often used
object. */
- xMCF = xCompContext.getServiceManager();
+ xMCF = xCompContext.getServiceManager();
}
-
+
/** This method will change the type of a specified chart.
* @param stringType The chart will be converted to this type.
* @param booleanIs3D If the chart should be displayed in 3D this parameter should be set to true.
@@ -155,7 +155,7 @@ public class ChartTypeChange {
XEmbeddedObjectSupplier xEmbeddedObjSupplier = (XEmbeddedObjectSupplier)
UnoRuntime.queryInterface(XEmbeddedObjectSupplier.class, xtablechart);
XInterface xInterface = xEmbeddedObjSupplier.getEmbeddedObject();
-
+
XChartDocument xChartDoc = (XChartDocument)UnoRuntime.queryInterface(
XChartDocument.class, xInterface);
XDiagram xDiagram = (XDiagram) xChartDoc.getDiagram();
@@ -163,14 +163,14 @@ public class ChartTypeChange {
UnoRuntime.queryInterface( XMultiServiceFactory.class, xChartDoc );
Object object = xMSF.createInstance( stringType );
xDiagram = (XDiagram) UnoRuntime.queryInterface(XDiagram.class, object);
-
+
XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xDiagram );
xPropSet.setPropertyValue( "Dim3D", new Boolean( booleanIs3D ) );
-
+
xChartDoc.setDiagram(xDiagram);
}
-
+
/** Loading an OpenOffice.org Calc document and getting a chart by name.
* @param stringFileName Name of the OpenOffice.org Calc document which should
* be loaded.
@@ -186,30 +186,30 @@ public class ChartTypeChange {
UnoRuntime.queryInterface( XComponentLoader.class,
xMCF.createInstanceWithContext("com.sun.star.frame.Desktop",
xCompContext ) );
-
+
// Load a Writer document, which will be automaticly displayed
XComponent xComponent = xComponentloader.loadComponentFromURL(
"file:///" + stringFileName, "_blank", 0,
new PropertyValue[0] );
-
+
// Query for the interface XSpreadsheetDocument
XSpreadsheetDocument xSpreadSheetDocument = ( XSpreadsheetDocument )
UnoRuntime.queryInterface( XSpreadsheetDocument.class, xComponent );
-
+
XSpreadsheets xSpreadsheets = xSpreadSheetDocument.getSheets() ;
-
+
XIndexAccess xIndexAccess = (XIndexAccess)
UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets );
-
+
XSpreadsheet xSpreadsheet = (XSpreadsheet) UnoRuntime.queryInterface(
XSpreadsheet.class, xIndexAccess.getByIndex(0));
-
+
XTableChartsSupplier xTableChartsSupplier = ( XTableChartsSupplier )
UnoRuntime.queryInterface( XTableChartsSupplier.class, xSpreadsheet );
-
+
xIndexAccess = (XIndexAccess) UnoRuntime.queryInterface(
XIndexAccess.class, xTableChartsSupplier.getCharts() );
-
+
this.xtablechart = (XTableChart) UnoRuntime.queryInterface(
XTableChart.class, xIndexAccess.getByIndex( 0 ) );
}
@@ -217,7 +217,7 @@ public class ChartTypeChange {
System.err.println( exception );
}
}
-
+
/** Creating an empty OpenOffice.org Calc document, inserting data, and getting a
* chart by name.
* @param stringValues Double array with the values for the chart.
@@ -233,27 +233,27 @@ public class ChartTypeChange {
xMCF.createInstanceWithContext(
"com.sun.star.frame.Desktop",
xCompContext ) );
-
+
// Create an empty calc document, which will be automaticly displayed
XComponent xComponent = xcomponentloader.loadComponentFromURL(
"private:factory/scalc", "_blank", 0,
new PropertyValue[0] );
-
+
// Query for the interface XSpreadsheetDocument
XSpreadsheetDocument xspreadsheetdocument = ( XSpreadsheetDocument )
UnoRuntime.queryInterface( XSpreadsheetDocument.class, xComponent );
-
+
// Get all sheets of the spreadsheet document.
XSpreadsheets xspreadsheets = xspreadsheetdocument.getSheets() ;
-
+
// Get the index of the spreadsheet document.
XIndexAccess xindexaccess = (XIndexAccess) UnoRuntime.queryInterface(
XIndexAccess.class, xspreadsheets );
-
+
// Get the first spreadsheet.
XSpreadsheet xspreadsheet = (XSpreadsheet) UnoRuntime.queryInterface(
XSpreadsheet.class, xindexaccess.getByIndex(0));
-
+
// The double array will written to the spreadsheet
for ( int intY = 0; intY < stringValues.length; intY++ ) {
for ( int intX = 0; intX < stringValues[ intY ].length;
@@ -263,21 +263,21 @@ public class ChartTypeChange {
stringValues[ intY ][ intX ], xspreadsheet, "" );
}
}
-
+
// Create a rectangle, which holds the size of the chart.
Rectangle rectangle = new Rectangle();
rectangle.X = 500;
rectangle.Y = 3000;
rectangle.Width = 25000;
rectangle.Height = 11000;
-
+
// Get the cell range of the spreadsheet.
XCellRange xcellrange = ( XCellRange ) UnoRuntime.queryInterface(
XCellRange.class, xspreadsheet );
-
+
// Create the Unicode of the character for the column name.
char charRectangle = ( char ) ( 65 + stringValues.length - 1 );
-
+
// Get maximum length all rows in the double array.
int intMaximumWidthRow = 0;
for ( int intRow = 0; intRow < stringValues.length; intRow++ ) {
@@ -285,35 +285,35 @@ public class ChartTypeChange {
intMaximumWidthRow = stringValues[ intRow ].length;
}
}
-
+
// Get the cell range of the written values.
XCellRange xcellrangeChart = xcellrange.getCellRangeByName( "A1:" +
charRectangle + intMaximumWidthRow );
-
+
// Get the addressable cell range.
XCellRangeAddressable xcellrangeaddressable =
( XCellRangeAddressable ) UnoRuntime.queryInterface(
XCellRangeAddressable.class, xcellrangeChart );
-
+
// Get the cell range address.
CellRangeAddress cellrangeaddress = xcellrangeaddressable.getRangeAddress();
-
+
// Create the cell range address for the chart.
CellRangeAddress[] cellrangeaddressChart =
new CellRangeAddress[ 1 ];
cellrangeaddressChart[ 0 ] = cellrangeaddress;
-
+
// Get the table charts supplier of the spreadsheet.
XTableChartsSupplier xtablechartssupplier = ( XTableChartsSupplier )
UnoRuntime.queryInterface( XTableChartsSupplier.class, xspreadsheet );
-
+
// Get all table charts of the spreadsheet.
XTableCharts xtablecharts = xtablechartssupplier.getCharts();
-
+
// Create a table chart with all written values.
xtablecharts.addNewByName( "Example", rectangle,
cellrangeaddressChart, true, true );
-
+
// Get the created table chart.
this.xtablechart = ( XTableChart ) UnoRuntime.queryInterface(
XTableChart.class, (( XNameAccess ) UnoRuntime.queryInterface(
@@ -323,7 +323,7 @@ public class ChartTypeChange {
System.err.println( exception );
}
}
-
+
/** Inserting a given value to a cell, that is specified by the parameters intX
* and intY.
* @param intX Column on the spreadsheet.
@@ -338,7 +338,7 @@ public class ChartTypeChange {
XSpreadsheet xspreadsheet, String stringFlag )
{
XCell xcell = null;
-
+
try {
xcell = xspreadsheet.getCellByPosition( intX, intY );
}
diff --git a/odk/examples/java/Spreadsheet/EuroAdaption.java b/odk/examples/java/Spreadsheet/EuroAdaption.java
index f167f93810bd..43c2b47d138c 100644
--- a/odk/examples/java/Spreadsheet/EuroAdaption.java
+++ b/odk/examples/java/Spreadsheet/EuroAdaption.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.
- *
+ *
*************************************************************************/
//***************************************************************************
@@ -79,68 +79,68 @@ import com.sun.star.util.XNumberFormatsSupplier;
public class EuroAdaption {
- public static void main(String args[]) {
+ public static void main(String args[]) {
// You need the desktop to create a document
// The getDesktop method does the UNO bootstrapping, gets the
// remote servie manager and the desktop object.
com.sun.star.frame.XDesktop xDesktop = null;
xDesktop = getDesktop();
-
+
// create a sheet document
XSpreadsheetDocument xSheetdocument = null;
xSheetdocument = ( XSpreadsheetDocument ) createSheetdocument( xDesktop );
System.out.println( "Create a new Spreadsheet" );
-
+
// get the collection of all sheets from the document
XSpreadsheets xSheets = null;
xSheets = (XSpreadsheets) xSheetdocument.getSheets();
-
+
// the Action Interface provides methods to hide actions,
// like inserting data, on a sheet, that increase the performance
XActionLockable xActionInterface = null;
xActionInterface = (XActionLockable) UnoRuntime.queryInterface(
XActionLockable.class, xSheetdocument );
-
+
// lock all actions
xActionInterface.addActionLock();
-
+
com.sun.star.sheet.XSpreadsheet xSheet = null;
try {
// get via the index access the first sheet
XIndexAccess xElements = (XIndexAccess) UnoRuntime.queryInterface(
XIndexAccess.class, xSheets );
- // specify the first sheet from the spreadsheet
+ // specify the first sheet from the spreadsheet
xSheet = (XSpreadsheet) UnoRuntime.queryInterface(
- XSpreadsheet.class, xElements.getByIndex( 0 ));
+ XSpreadsheet.class, xElements.getByIndex( 0 ));
}
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
// get the interface to apply and create new numberformats
XNumberFormatsSupplier xNumberFormatSupplier = null;
xNumberFormatSupplier = (XNumberFormatsSupplier) UnoRuntime.queryInterface(
XNumberFormatsSupplier.class, xSheetdocument );
XNumberFormats xNumberFormats = null;
xNumberFormats = xNumberFormatSupplier.getNumberFormats();
-
+
// insert some example data in a sheet
createExampleData( xSheet, xNumberFormats );
System.out.println( "Insert example data and use the number format with the currency 'DM'" );
-
+
// Change the currency from the cells from DM to Euro
Convert( xSheet, xNumberFormats, "DM", "EUR", 1.95583f );
System.out.println( "Change the number format to EUR and divide the values with the factor 1.95583" );
-
+
// remove all locks, the user see all changes
xActionInterface.removeActionLock();
-
+
System.out.println("done");
System.exit(0);
}
-
-
+
+
public static void Convert( XSpreadsheet xSheet, XNumberFormats xNumberFormats,
String sOldSymbol, String sNewSymbol,
float fFactor ) {
@@ -148,51 +148,51 @@ public class EuroAdaption {
Locale xLanguage = new Locale();
xLanguage.Country = "de"; // Germany -> DM
xLanguage.Language = "de"; // German
-
+
// Numberformat string with sNewSymbol
String sSimple = "0 [$" + sNewSymbol + "]";
// create a number format key with the sNewSymbol
int iSimpleKey = NumberFormat( xNumberFormats, sSimple, xLanguage );
-
+
// you have to use the FormatSupplier interface to get the
// CellFormat enumeration
XCellFormatRangesSupplier xCellFormatSupplier =
(XCellFormatRangesSupplier)UnoRuntime.queryInterface(
XCellFormatRangesSupplier.class, xSheet );
-
+
// getCellFormatRanges() has the interfaces for the enumeration
XEnumerationAccess xEnumerationAccess =
(XEnumerationAccess)UnoRuntime.queryInterface(
XEnumerationAccess.class,
xCellFormatSupplier.getCellFormatRanges() );
-
+
XEnumeration xRanges = xEnumerationAccess.createEnumeration();
// create an AnyConverter for later use
AnyConverter aAnyConv = new AnyConverter();
-
+
while( xRanges.hasMoreElements() ) {
// the enumeration returns a cellrange
XCellRange xCellRange = (XCellRange) UnoRuntime.queryInterface(
XCellRange.class, xRanges.nextElement());
-
+
// the PropertySet the get and set the properties from the cellrange
XPropertySet xCellProp = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xCellRange );
-
+
// getPropertyValue returns an Object, you have to cast it to
// type that you need
Object oNumberObject = xCellProp.getPropertyValue( "NumberFormat" );
int iNumberFormat = aAnyConv.toInt(oNumberObject);
-
+
// get the properties from the cellrange numberformat
XPropertySet xFormat = (XPropertySet)
xNumberFormats.getByKey(iNumberFormat );
-
+
short fType = aAnyConv.toShort(xFormat.getPropertyValue("Type"));
String sCurrencySymbol = aAnyConv.toString(
xFormat.getPropertyValue("CurrencySymbol"));
-
+
// change the numberformat only on cellranges with a
// currency numberformat
if( ( (fType & com.sun.star.util.NumberFormat.CURRENCY) > 0) &&
@@ -208,36 +208,36 @@ public class EuroAdaption {
Locale oLocale = (Locale) aAnyConv.toObject(
new com.sun.star.uno.Type(Locale.class),
xFormat.getPropertyValue("Locale"));
-
+
// create a new numberformat string
String sNew = xNumberFormats.generateFormat( iSimpleKey,
oLocale, bThousandSep, bNegativeRed,
fDecimals, fLeadingZeros );
-
+
// get the NumberKey from the numberformat
int iNewNumberFormat = NumberFormat( xNumberFormats,
sNew, oLocale );
-
+
// set the new numberformat to the cellrange DM->EUR
xCellProp.setPropertyValue( "NumberFormat",
new Integer( iNewNumberFormat ) );
-
+
// interate over all cells from the cellrange with an
// content and use the DM/EUR factor
XCellRangesQuery xCellRangesQuery = (XCellRangesQuery)
UnoRuntime.queryInterface(
XCellRangesQuery.class, xCellRange );
-
+
XSheetCellRanges xSheetCellRanges =
xCellRangesQuery.queryContentCells(
(short) com.sun.star.sheet.CellFlags.VALUE );
-
+
if( xSheetCellRanges.getCount() > 0 ) {
XEnumerationAccess xCellEnumerationAccess =
xSheetCellRanges.getCells();
XEnumeration xCellEnumeration =
xCellEnumerationAccess.createEnumeration();
-
+
while( xCellEnumeration.hasMoreElements() ) {
XCell xCell = (XCell) UnoRuntime.queryInterface(
XCell.class, xCellEnumeration.nextElement());
@@ -251,16 +251,16 @@ public class EuroAdaption {
e.printStackTrace(System.err);
}
}
-
-
+
+
public static int NumberFormat( XNumberFormats xNumberFormat, String sFormat,
com.sun.star.lang.Locale xLanguage ) {
int nRetKey = 0;
-
+
try {
// exists the numberformat
nRetKey = xNumberFormat.queryKey( sFormat, xLanguage, true );
-
+
// if not, create a new one
if( nRetKey == -1 ) {
nRetKey = xNumberFormat.addNew( sFormat, xLanguage );
@@ -271,36 +271,36 @@ public class EuroAdaption {
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
return( nRetKey );
}
-
-
+
+
public static void createExampleData( XSpreadsheet xSheet,
XNumberFormats xNumberFormat ) {
-
+
// enter in a cellrange numbers and change the numberformat to DM
XCell xCell = null;
XCellRange xCellRange = null;
-
+
try {
Locale xLanguage = new Locale();
xLanguage.Country = "de"; // Germany -> DM
xLanguage.Language = "de"; // German
-
+
// Numberformat string from DM
String sSimple = "0 [$DM]";
-
+
// get the numberformat key
int iNumberFormatKey = NumberFormat(xNumberFormat, sSimple, xLanguage);
-
+
for( int iCounter=1; iCounter < 10; iCounter++ ) {
// get one cell and insert a number
xCell = xSheet.getCellByPosition( 2, 1 + iCounter );
xCell.setValue( (double) iCounter * 2 );
xCellRange = xSheet.getCellRangeByPosition( 2, 1 + iCounter,
2, 1 + iCounter );
-
+
// get the ProperySet from the cell, to change the numberformat
XPropertySet xCellProp = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xCellRange );
@@ -312,17 +312,17 @@ public class EuroAdaption {
e.printStackTrace(System.err);
}
}
-
+
public static XDesktop getDesktop() {
XDesktop xDesktop = null;
XMultiComponentFactory xMCF = null;
-
+
try {
XComponentContext xContext = null;
-
+
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
-
+
// get the remote office service manager
xMCF = xContext.getServiceManager();
if( xMCF != null ) {
@@ -340,50 +340,50 @@ public class EuroAdaption {
e.printStackTrace(System.err);
System.exit(1);
}
-
-
+
+
return xDesktop;
}
-
-
+
+
public static XSpreadsheetDocument createSheetdocument( XDesktop xDesktop ) {
XSpreadsheetDocument aSheetDocument = null;
-
+
try {
XComponent xComponent = null;
xComponent = CreateNewDocument( xDesktop, "scalc" );
-
+
aSheetDocument = (XSpreadsheetDocument) UnoRuntime.queryInterface(
XSpreadsheetDocument.class, xComponent);
}
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
return aSheetDocument;
}
-
+
protected static XComponent CreateNewDocument( XDesktop xDesktop,
String sDocumentType ) {
String sURL = "private:factory/" + sDocumentType;
-
+
XComponent xComponent = null;
XComponentLoader xComponentLoader = null;
PropertyValue xValues[] = new PropertyValue[1];
PropertyValue xEmptyArgs[] = new PropertyValue[0];
-
+
try {
xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(
XComponentLoader.class, xDesktop );
-
+
xComponent = xComponentLoader.loadComponentFromURL(
sURL, "_blank", 0, xEmptyArgs);
}
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
return xComponent ;
}
-
+
}
diff --git a/odk/examples/java/Spreadsheet/SCalc.java b/odk/examples/java/Spreadsheet/SCalc.java
index 1ff2c56ddbdb..1938244f5733 100644
--- a/odk/examples/java/Spreadsheet/SCalc.java
+++ b/odk/examples/java/Spreadsheet/SCalc.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.
- *
+ *
*************************************************************************/
//***************************************************************************
@@ -82,15 +82,15 @@ import com.sun.star.table.XTableChartsSupplier;
public class SCalc {
-
+
public static void main(String args[]) {
-
+
//oooooooooooooooooooooooooooStep 1oooooooooooooooooooooooooooooooooooooooooo
// call UNO bootstrap method and get the remote component context form
// the a running office (office will be started if necessary)
//***************************************************************************
XComponentContext xContext = null;
-
+
// get the remote office component context
try {
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
@@ -106,26 +106,26 @@ public class SCalc {
// is created. The desktop provides the XComponentLoader interface,
// which is used to open the document via loadComponentFromURL
//***************************************************************************
-
+
//Open document
-
+
//Calc
XSpreadsheetDocument myDoc = null;
// XCell oCell = null;
-
+
System.out.println("Opening an empty Calc document");
myDoc = openCalc(xContext);
-
+
//***************************************************************************
-
-
+
+
//oooooooooooooooooooooooooooStep 3oooooooooooooooooooooooooooooooooooooooooo
// create cell styles.
// For this purpose get the StyleFamiliesSupplier and the the familiy
// CellStyle. Create an instance of com.sun.star.style.CellStyle and
// add it to the family. Now change some properties
//***************************************************************************
-
+
try {
XStyleFamiliesSupplier xSFS = (XStyleFamiliesSupplier)
UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, myDoc);
@@ -155,9 +155,9 @@ public class SCalc {
} catch (Exception e) {
e.printStackTrace(System.err);
}
-
+
//***************************************************************************
-
+
//oooooooooooooooooooooooooooStep 4oooooooooooooooooooooooooooooooooooooooooo
// get the sheet an insert some data.
// Get the sheets from the document and then the first from this container.
@@ -165,10 +165,10 @@ public class SCalc {
// getCellByPosition and insert into this cell via setValue() (for floats)
// or setFormula() for formulas and Strings
//***************************************************************************
-
-
+
+
XSpreadsheet xSheet=null;
-
+
try {
System.out.println("Getting spreadsheet") ;
XSpreadsheets xSheets = myDoc.getSheets() ;
@@ -176,16 +176,16 @@ public class SCalc {
XIndexAccess.class, xSheets);
xSheet = (XSpreadsheet) UnoRuntime.queryInterface(
XSpreadsheet.class, oIndexSheets.getByIndex(0));
-
+
} catch (Exception e) {
System.out.println("Couldn't get Sheet " +e);
e.printStackTrace(System.err);
}
-
-
-
+
+
+
System.out.println("Creating the Header") ;
-
+
insertIntoCell(1,0,"JAN",xSheet,"");
insertIntoCell(2,0,"FEB",xSheet,"");
insertIntoCell(3,0,"MAR",xSheet,"");
@@ -199,10 +199,10 @@ public class SCalc {
insertIntoCell(11,0,"NOV",xSheet,"");
insertIntoCell(12,0,"DEC",xSheet,"");
insertIntoCell(13,0,"SUM",xSheet,"");
-
-
+
+
System.out.println("Fill the lines");
-
+
insertIntoCell(0,1,"Smith",xSheet,"");
insertIntoCell(1,1,"42",xSheet,"V");
insertIntoCell(2,1,"58.9",xSheet,"V");
@@ -217,8 +217,8 @@ public class SCalc {
insertIntoCell(11,1,"22.4",xSheet,"V");
insertIntoCell(12,1,"23.5",xSheet,"V");
insertIntoCell(13,1,"=SUM(B2:M2)",xSheet,"");
-
-
+
+
insertIntoCell(0,2,"Jones",xSheet,"");
insertIntoCell(1,2,"21",xSheet,"V");
insertIntoCell(2,2,"40.9",xSheet,"V");
@@ -233,7 +233,7 @@ public class SCalc {
insertIntoCell(11,2,"25.4",xSheet,"V");
insertIntoCell(12,2,"28.5",xSheet,"V");
insertIntoCell(13,2,"=SUM(B3:M3)",xSheet,"");
-
+
insertIntoCell(0,3,"Brown",xSheet,"");
insertIntoCell(1,3,"31.45",xSheet,"V");
insertIntoCell(2,3,"-20.9",xSheet,"V");
@@ -248,22 +248,22 @@ public class SCalc {
insertIntoCell(11,3,"25.4",xSheet,"V");
insertIntoCell(12,3,"38.5",xSheet,"V");
insertIntoCell(13,3,"=SUM(A4:L4)",xSheet,"");
-
+
//***************************************************************************
-
+
//oooooooooooooooooooooooooooStep 5oooooooooooooooooooooooooooooooooooooooooo
// apply the created cell style.
// For this purpose get the PropertySet of the Cell and change the
// property CellStyle to the appropriate value.
//***************************************************************************
-
+
// change backcolor
chgbColor( 1 , 0, 13, 0, "My Style", xSheet );
chgbColor( 0 , 1, 0, 3, "My Style", xSheet );
chgbColor( 1 , 1, 13, 3, "My Style2", xSheet );
-
+
//***************************************************************************
-
+
//oooooooooooooooooooooooooooStep 6oooooooooooooooooooooooooooooooooooooooooo
// insert a 3D chart.
// get the CellRange which holds the data for the chart and its RangeAddress
@@ -272,36 +272,36 @@ public class SCalc {
// get the ChartDocument, which provide the Diagramm. Change the properties
// Dim3D (3 dimension) and String (the title) of the diagramm.
//***************************************************************************
-
+
// insert a chart
-
+
Rectangle oRect = new Rectangle();
oRect.X = 500;
oRect.Y = 3000;
oRect.Width = 25000;
oRect.Height = 11000;
-
+
XCellRange oRange = (XCellRange)UnoRuntime.queryInterface(
XCellRange.class, xSheet);
XCellRange myRange = oRange.getCellRangeByName("A1:N4");
XCellRangeAddressable oRangeAddr = (XCellRangeAddressable)
UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange);
CellRangeAddress myAddr = oRangeAddr.getRangeAddress();
-
+
CellRangeAddress[] oAddr = new CellRangeAddress[1];
oAddr[0] = myAddr;
XTableChartsSupplier oSupp = (XTableChartsSupplier)UnoRuntime.queryInterface(
XTableChartsSupplier.class, xSheet);
-
+
XTableChart oChart = null;
-
+
System.out.println("Insert Chart");
-
+
XTableCharts oCharts = oSupp.getCharts();
oCharts.addNewByName("Example", oRect, oAddr, true, true);
-
+
// get the diagramm and Change some of the properties
-
+
try {
oChart = (XTableChart) (UnoRuntime.queryInterface(
XTableChart.class, ((XNameAccess)UnoRuntime.queryInterface(
@@ -326,19 +326,19 @@ public class SCalc {
System.err.println("Changin Properties failed "+e);
e.printStackTrace(System.err);
}
-
- System.out.println("done");
+
+ System.out.println("done");
System.exit(0);
}
-
+
public static XSpreadsheetDocument openCalc(XComponentContext xContext)
- {
+ {
//define variables
XMultiComponentFactory xMCF = null;
XComponentLoader xCLoader;
XSpreadsheetDocument xSpreadSheetDoc = null;
XComponent xComp = null;
-
+
try {
// get the servie manager rom the office
xMCF = xContext.getServiceManager();
@@ -350,28 +350,28 @@ public class SCalc {
// query the desktop object for the XComponentLoader
xCLoader = ( XComponentLoader ) UnoRuntime.queryInterface(
XComponentLoader.class, oDesktop );
-
+
PropertyValue [] szEmptyArgs = new PropertyValue [0];
String strDoc = "private:factory/scalc";
xComp = xCLoader.loadComponentFromURL(strDoc, "_blank", 0, szEmptyArgs );
xSpreadSheetDoc = (XSpreadsheetDocument) UnoRuntime.queryInterface(
XSpreadsheetDocument.class, xComp);
-
- } catch(Exception e){
+
+ } catch(Exception e){
System.err.println(" Exception " + e);
e.printStackTrace(System.err);
- }
-
+ }
+
return xSpreadSheetDoc;
}
-
-
+
+
public static void insertIntoCell(int CellX, int CellY, String theValue,
XSpreadsheet TT1, String flag)
- {
+ {
XCell xCell = null;
-
+
try {
xCell = TT1.getCellByPosition(CellX, CellY);
} catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
@@ -384,9 +384,9 @@ public class SCalc {
} else {
xCell.setFormula(theValue);
}
-
+
}
-
+
public static void chgbColor( int x1, int y1, int x2, int y2,
String template, XSpreadsheet TT )
{
@@ -397,10 +397,10 @@ public class SCalc {
System.err.println("Could not get CellRange");
ex.printStackTrace(System.err);
}
-
+
XPropertySet xCPS = (XPropertySet)UnoRuntime.queryInterface(
XPropertySet.class, xCR );
-
+
try {
xCPS.setPropertyValue("CellStyle", template);
} catch (Exception e) {
@@ -408,5 +408,5 @@ public class SCalc {
e.printStackTrace(System.err);
}
}
-
+
}
diff --git a/odk/examples/java/Spreadsheet/XCalcAddins.idl b/odk/examples/java/Spreadsheet/XCalcAddins.idl
index bd515b6ebced..403c1f138ef4 100644
--- a/odk/examples/java/Spreadsheet/XCalcAddins.idl
+++ b/odk/examples/java/Spreadsheet/XCalcAddins.idl
@@ -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.
- *
+ *
*************************************************************************/
#ifndef INCLUDED_ORG_OPENOFFICE_SHEET_ADDIN_XCALCADDIN_IDL
#define INCLUDED_ORG_OPENOFFICE_SHEET_ADDIN_XCALCADDIN_IDL
@@ -68,7 +68,7 @@ module org {
*/
[in] com::sun::star::beans::XPropertySet xOptions
);
-
+
long getMySecondValue(
/** Parameters:
You could insert further arguments after the
diff --git a/odk/examples/java/Storage/StorageFunctionality.java b/odk/examples/java/Storage/StorageFunctionality.java
index 0532259821b9..01708044f80f 100644
--- a/odk/examples/java/Storage/StorageFunctionality.java
+++ b/odk/examples/java/Storage/StorageFunctionality.java
@@ -18,7 +18,7 @@ import com.sun.star.lang.*;
import storagetesting.*;
public class StorageFunctionality {
-
+
public static void main( String args[] )
{
// connect to the office
@@ -28,9 +28,9 @@ public class StorageFunctionality {
if ( args.length == 1 ) {
sConnectionString = args[0];
}
-
+
XMultiServiceFactory xMSF = null;
-
+
// create connection(s) and get multiservicefactory
try {
xMSF = connect( sConnectionString );
@@ -44,7 +44,7 @@ public class StorageFunctionality {
System.out.println( "Error: Couldn't get MSF, exception: " + e );
return;
}
-
+
XSingleServiceFactory xStorageFactory = null;
try
{
@@ -100,11 +100,11 @@ public class StorageFunctionality {
System.out.println( "\ntesting failed" );
System.out.println( "done" );
-
+
System.exit( 0 );
- }
-
-
+ }
+
+
public static XMultiServiceFactory connect( String sConnectStr )
throws com.sun.star.uno.Exception,
com.sun.star.uno.RuntimeException,
@@ -114,34 +114,34 @@ public class StorageFunctionality {
XComponentContext xComponentContext =
com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(
null );
-
+
// initial serviceManager
XMultiComponentFactory xLocalServiceManager =
xComponentContext.getServiceManager();
-
+
// create a connector, so that it can contact the office
Object oUrlResolver = xLocalServiceManager.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", xComponentContext );
XUnoUrlResolver xUrlResolver = (XUnoUrlResolver)UnoRuntime.queryInterface(
XUnoUrlResolver.class, oUrlResolver );
-
+
Object oInitialObject = xUrlResolver.resolve( sConnectStr );
XNamingService xName = (XNamingService)UnoRuntime.queryInterface(
XNamingService.class, oInitialObject );
-
+
XMultiServiceFactory xMSF = null;
if( xName != null ) {
System.err.println( "got the remote naming service !" );
Object oMSF = xName.getRegisteredObject("StarOffice.ServiceManager" );
-
+
xMSF = (XMultiServiceFactory)
UnoRuntime.queryInterface( XMultiServiceFactory.class, oMSF );
}
else
System.out.println( "Error: Can't get XNamingService interface from url resolver!" );
-
+
return xMSF;
}
-
+
}
diff --git a/odk/examples/java/Storage/Test01.java b/odk/examples/java/Storage/Test01.java
index 7c3309dbcbbd..7c9de41c37be 100644
--- a/odk/examples/java/Storage/Test01.java
+++ b/odk/examples/java/Storage/Test01.java
@@ -36,7 +36,7 @@ public class Test01 implements StorageTest {
m_aTestHelper.Error( "No valid temporary file was created!" );
return false;
}
-
+
// create temporary storage based on arbitrary medium
// after such a storage is closed it is lost
Object oTempStorage = m_xStorageFactory.createInstance();
@@ -56,7 +56,7 @@ public class Test01 implements StorageTest {
m_aTestHelper.Error( "Can't create substorage!" );
return false;
}
-
+
byte pBytes1[] = { 1, 1, 1, 1, 1 };
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes
@@ -68,7 +68,7 @@ public class Test01 implements StorageTest {
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes
if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage, "SubStream2", "MediaType2", false, pBytes2 ) )
return false;
-
+
// set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly
if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage,
"MediaType3",
@@ -82,7 +82,7 @@ public class Test01 implements StorageTest {
false,
ElementModes.ELEMENT_WRITE ) )
return false;
-
+
// create temporary storage based on a previously created temporary file
Object pArgs[] = new Object[2];
pArgs[0] = (Object) sTempFileURL;
@@ -131,7 +131,7 @@ public class Test01 implements StorageTest {
m_aTestHelper.Error( "Can't open existing substorage!" );
return false;
}
-
+
if ( !m_aTestHelper.checkStorageProperties( xResultSubStorage, "MediaType4", false, ElementModes.ELEMENT_READ ) )
return false;
@@ -152,7 +152,7 @@ public class Test01 implements StorageTest {
m_aTestHelper.Error( "Exception: " + e );
return false;
}
- }
+ }
}
diff --git a/odk/examples/java/Storage/Test02.java b/odk/examples/java/Storage/Test02.java
index 40f8706657b9..b258f10ca999 100644
--- a/odk/examples/java/Storage/Test02.java
+++ b/odk/examples/java/Storage/Test02.java
@@ -35,7 +35,7 @@ public class Test02 implements StorageTest {
XStream xTempFileStream = m_aTestHelper.CreateTempFileStream( m_xMSF );
if ( xTempFileStream == null )
return false;
-
+
// create storage based on the temporary stream
Object pArgs[] = new Object[2];
pArgs[0] = (Object) xTempFileStream;
@@ -58,7 +58,7 @@ public class Test02 implements StorageTest {
m_aTestHelper.Error( "Can't create substorage!" );
return false;
}
-
+
byte pBytes1[] = { 1, 1, 1, 1, 1 };
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes
@@ -78,7 +78,7 @@ public class Test02 implements StorageTest {
false,
ElementModes.ELEMENT_WRITE ) )
return false;
-
+
// commit substorage first
if ( !m_aTestHelper.commitStorage( xTempSubStorage ) )
return false;
@@ -106,7 +106,7 @@ public class Test02 implements StorageTest {
if ( xTempInStream == null )
return false;
-
+
// open input stream
// since no mode is provided the result storage must be opened readonly
Object pOneArg[] = new Object[1];
@@ -132,7 +132,7 @@ public class Test02 implements StorageTest {
m_aTestHelper.Error( "Can't open existing substorage!" );
return false;
}
-
+
if ( !m_aTestHelper.checkStorageProperties( xResultSubStorage, "MediaType3", false, ElementModes.ELEMENT_READ ) )
return false;
@@ -146,7 +146,7 @@ public class Test02 implements StorageTest {
m_aTestHelper.Error( "Exception: " + e );
return false;
}
- }
+ }
}
diff --git a/odk/examples/java/Storage/Test03.java b/odk/examples/java/Storage/Test03.java
index 962e52323e6a..f1d5d415067f 100644
--- a/odk/examples/java/Storage/Test03.java
+++ b/odk/examples/java/Storage/Test03.java
@@ -50,7 +50,7 @@ public class Test03 implements StorageTest {
m_aTestHelper.Error( "Can't create substorage!" );
return false;
}
-
+
byte pBytes1[] = { 1, 1, 1, 1, 1 };
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes
@@ -72,10 +72,10 @@ public class Test03 implements StorageTest {
if ( !m_aTestHelper.commitStorage( xTempSubStorage ) )
return false;
-
+
if ( !m_aTestHelper.disposeStorage( xTempSubStorage ) )
return false;
-
+
// ================================================
// check storage hyerarchy tree
// ================================================
@@ -145,14 +145,14 @@ public class Test03 implements StorageTest {
return false;
}
- if ( !( sRootCont[0].equals( "SubStorage1" ) && sRootCont[1].equals( "SubStream1" )
+ if ( !( sRootCont[0].equals( "SubStorage1" ) && sRootCont[1].equals( "SubStream1" )
|| sRootCont[0].equals( "SubStream1" ) && sRootCont[1].equals( "SubStorage1" ) )
|| !( xRootNameAccess.hasByName( "SubStream1" ) && xRootNameAccess.hasByName( "SubStorage1" ) ) )
{
m_aTestHelper.Error( "Root storage contains wrong list of children!" );
return false;
}
-
+
// get storage through XNameAccess
XStorage xResultSubStorage = getStorageFromNameAccess( xRootNameAccess, "SubStorage1" );
if ( xResultSubStorage == null )
@@ -175,7 +175,7 @@ public class Test03 implements StorageTest {
m_aTestHelper.Error( "'SubStream2' can not be detected as child stream element of 'SubStorage1'!" );
return false;
}
-
+
return true;
}
catch( Exception e )
@@ -183,7 +183,7 @@ public class Test03 implements StorageTest {
m_aTestHelper.Error( "Exception: " + e );
return false;
}
- }
+ }
public XStorage getStorageFromNameAccess( XNameAccess xAccess, String sName )
{
diff --git a/odk/examples/java/Storage/Test04.java b/odk/examples/java/Storage/Test04.java
index 19b988f10ff5..943fcfff8a38 100644
--- a/odk/examples/java/Storage/Test04.java
+++ b/odk/examples/java/Storage/Test04.java
@@ -39,7 +39,7 @@ public class Test04 implements StorageTest {
m_aTestHelper.Error( "No valid temporary file was created!" );
return false;
}
-
+
// create temporary storage based on arbitrary medium
// after such a storage is closed it is lost
Object oTempStorage = m_xStorageFactory.createInstance();
@@ -61,7 +61,7 @@ public class Test04 implements StorageTest {
m_aTestHelper.Error( "Can't create substorage!" );
return false;
}
-
+
byte pBytes1[] = { 1, 1, 1, 1, 1 };
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes
@@ -83,7 +83,7 @@ public class Test04 implements StorageTest {
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes
if ( !m_aTestHelper.WriteBytesToSubstream( xTempSubStorage2, "SubStream2", "MediaType2", false, pBytes2 ) )
return false;
-
+
// set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly
if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage,
"MediaType3",
@@ -97,14 +97,14 @@ public class Test04 implements StorageTest {
false,
ElementModes.ELEMENT_WRITE ) )
return false;
-
+
// set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly
if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempSubStorage2,
"MediaType5",
false,
ElementModes.ELEMENT_WRITE ) )
return false;
-
+
// create temporary storage based on a previously created temporary file
Object pArgs[] = new Object[2];
pArgs[0] = (Object) sTempFileURL;
@@ -124,7 +124,7 @@ public class Test04 implements StorageTest {
// if storage is not commited before disposing all the changes will be lost
if ( !m_aTestHelper.commitStorage( xTempSubStorage2 ) )
return false;
-
+
// a storage must be disposed before moving/removing otherwise the access will be denied
if ( !m_aTestHelper.disposeStorage( xTempSubStorage2 ) )
return false;
@@ -187,7 +187,7 @@ public class Test04 implements StorageTest {
m_aTestHelper.Error( "Can't open existing substorage!" );
return false;
}
-
+
if ( !m_aTestHelper.checkStorageProperties( xResSubStorage1, "MediaType4", false, ElementModes.ELEMENT_READ ) )
return false;
@@ -227,7 +227,7 @@ public class Test04 implements StorageTest {
// remove element and check that it was removed completelly
if ( !m_aTestHelper.removeElement( xResStorage, "SubStorage2" ) )
return false;
-
+
try
{
XNameAccess xResAccess = (XNameAccess) UnoRuntime.queryInterface( XNameAccess.class, xResStorage );
@@ -267,7 +267,7 @@ public class Test04 implements StorageTest {
m_aTestHelper.Error( "Exception: " + e );
return false;
}
- }
+ }
}
diff --git a/odk/examples/java/Storage/Test05.java b/odk/examples/java/Storage/Test05.java
index 5d2f2e359136..263e2d2561c7 100644
--- a/odk/examples/java/Storage/Test05.java
+++ b/odk/examples/java/Storage/Test05.java
@@ -70,7 +70,7 @@ public class Test05 implements StorageTest {
m_aTestHelper.Error( "Can't create substorage!" );
return false;
}
-
+
byte pBytes1[] = { 1, 1, 1, 1, 1 };
@@ -83,7 +83,7 @@ public class Test05 implements StorageTest {
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes
if ( !m_aTestHelper.WriteBytesToSubstream( xSubSubStorage, "SubStream2", "MediaType2", false, pBytes2 ) )
return false;
-
+
// set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly
if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempFileStorage,
"MediaType3",
@@ -167,7 +167,7 @@ public class Test05 implements StorageTest {
m_aTestHelper.Error( "Wrong exception is thrown by disposed storage: " + e );
return false;
}
-
+
try
{
xSubStream1.getInputStream();
@@ -195,7 +195,7 @@ public class Test05 implements StorageTest {
m_aTestHelper.Error( "Wrong exception is thrown by disposed stream: " + e );
return false;
}
-
+
// dispose root storage
if ( !m_aTestHelper.disposeStorage( xTempFileStorage ) )
@@ -227,7 +227,7 @@ public class Test05 implements StorageTest {
m_aTestHelper.Error( "Can't open existing substorage 'SubSubStorage'!" );
return false;
}
-
+
if ( !m_aTestHelper.checkStorageProperties( xResSubStorage, "MediaType4", false, ElementModes.ELEMENT_READ ) )
return false;
@@ -240,7 +240,7 @@ public class Test05 implements StorageTest {
m_aTestHelper.Error( "Can't open existing substorage 'SubSubStorage'!" );
return false;
}
-
+
if ( !m_aTestHelper.checkStorageProperties( xResSubSubStorage, "MediaType5", false, ElementModes.ELEMENT_READ ) )
return false;
@@ -262,7 +262,7 @@ public class Test05 implements StorageTest {
m_aTestHelper.Error( "Exception: " + e );
return false;
}
- }
+ }
}
diff --git a/odk/examples/java/Storage/Test06.java b/odk/examples/java/Storage/Test06.java
index 854bc27b446c..7ee3a832b5f3 100644
--- a/odk/examples/java/Storage/Test06.java
+++ b/odk/examples/java/Storage/Test06.java
@@ -72,7 +72,7 @@ public class Test06 implements StorageTest {
m_aTestHelper.Error( "Can't create substorage!" );
return false;
}
-
+
// in case stream is open for reading it must exist
try
{
@@ -272,7 +272,7 @@ public class Test06 implements StorageTest {
m_aTestHelper.Error( "Exception: " + e );
return false;
}
- }
+ }
}
diff --git a/odk/examples/java/Storage/Test07.java b/odk/examples/java/Storage/Test07.java
index 25a2677f3728..25e3fedf4df3 100644
--- a/odk/examples/java/Storage/Test07.java
+++ b/odk/examples/java/Storage/Test07.java
@@ -36,7 +36,7 @@ public class Test07 implements StorageTest {
m_aTestHelper.Error( "No valid temporary file was created!" );
return false;
}
-
+
// create temporary storage based on arbitrary medium
// after such a storage is closed it is lost
Object oTempStorage = m_xStorageFactory.createInstance();
@@ -60,7 +60,7 @@ public class Test07 implements StorageTest {
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes
if ( !m_aTestHelper.WriteBytesToEncrSubstream( xTempStorage, "SubStream2", "MediaType2", false, pBytes2, pPass2 ) )
return false;
-
+
// create temporary storage based on a previously created temporary file
Object pArgs[] = new Object[2];
pArgs[0] = (Object) sTempFileURL;
@@ -131,7 +131,7 @@ public class Test07 implements StorageTest {
m_aTestHelper.Error( "Exception: " + e );
return false;
}
- }
+ }
}
diff --git a/odk/examples/java/Storage/Test08.java b/odk/examples/java/Storage/Test08.java
index 6c839943abc9..147f57262992 100644
--- a/odk/examples/java/Storage/Test08.java
+++ b/odk/examples/java/Storage/Test08.java
@@ -30,7 +30,7 @@ public class Test08 implements StorageTest {
{
try
{
-
+
// create temporary storage based on arbitrary medium
// after such a storage is closed it is lost
Object oTempStorage = m_xStorageFactory.createInstance();
@@ -50,7 +50,7 @@ public class Test08 implements StorageTest {
m_aTestHelper.Message( "Optional interface XEncryptionProtectedSource is not implemented, feature can not be tested!" );
return true;
}
-
+
byte pPass1[] = { 1, 2, 3 };
byte pPass2[] = { 3, 2, 1 };
@@ -62,7 +62,7 @@ public class Test08 implements StorageTest {
m_aTestHelper.Error( "Can't set a common encryption key for the storage, exception:" + e );
return false;
}
-
+
// open a new substorage
XStorage xTempSubStorage = m_aTestHelper.openSubStorage( xTempStorage,
"SubStorage1",
@@ -72,7 +72,7 @@ public class Test08 implements StorageTest {
m_aTestHelper.Error( "Can't create substorage!" );
return false;
}
-
+
// open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes
// the stream will be encrypted with common password
byte pBytes1[] = { 1, 1, 1, 1, 1 };
@@ -93,7 +93,7 @@ public class Test08 implements StorageTest {
// the stream will not be encrypted
if ( !m_aTestHelper.WriteBytesToEncrSubstream( xTempSubStorage, "SubStream3", "MediaType3", false, pBytes3, pPass2 ) )
return false;
-
+
// set "MediaType" property for storages and check that "IsRoot" and "OpenMode" properties are set correctly
if ( !m_aTestHelper.setStorageTypeAndCheckProps( xTempStorage,
"MediaType4",
@@ -115,7 +115,7 @@ public class Test08 implements StorageTest {
m_aTestHelper.Error( "No valid temporary file was created!" );
return false;
}
-
+
// create temporary storage based on a previously created temporary file
Object pArgs[] = new Object[2];
pArgs[0] = (Object) sTempFileURL;
@@ -164,7 +164,7 @@ public class Test08 implements StorageTest {
m_aTestHelper.Error( "Can't open existing substorage!" );
return false;
}
-
+
if ( !m_aTestHelper.checkStorageProperties( xResultSubStorage, "MediaType5", false, ElementModes.ELEMENT_READ ) )
return false;
@@ -177,7 +177,7 @@ public class Test08 implements StorageTest {
m_aTestHelper.Error( "XEncryptionProtectedSource was successfully used already, so it must be supported!" );
return false;
}
-
+
try {
xResultStorageEncryption.setEncryptionKey( pPass2 );
}
@@ -208,6 +208,6 @@ public class Test08 implements StorageTest {
m_aTestHelper.Error( "Exception: " + e );
return false;
}
- }
+ }
}
diff --git a/odk/examples/java/Storage/Test09.java b/odk/examples/java/Storage/Test09.java
index 319766024fc8..f4ae8ee879f3 100644
--- a/odk/examples/java/Storage/Test09.java
+++ b/odk/examples/java/Storage/Test09.java
@@ -30,7 +30,7 @@ public class Test09 implements StorageTest {
{
try
{
-
+
// create temporary storage based on arbitrary medium
// after such a storage is closed it is lost
Object oTempStorage = m_xStorageFactory.createInstance();
@@ -49,7 +49,7 @@ public class Test09 implements StorageTest {
// the stream will not be encrypted
if ( !m_aTestHelper.WriteBytesToEncrSubstream( xTempStorage, "SubStream1", "MediaType1", false, pBytes, pPass1 ) )
return false;
-
+
// create temporary file
String sTempFileURL = m_aTestHelper.CreateTempFile( m_xMSF );
if ( sTempFileURL == null || sTempFileURL == "" )
@@ -57,7 +57,7 @@ public class Test09 implements StorageTest {
m_aTestHelper.Error( "No valid temporary file was created!" );
return false;
}
-
+
// create temporary storage based on a previously created temporary file
Object pArgs[] = new Object[2];
pArgs[0] = (Object) sTempFileURL;
@@ -118,6 +118,6 @@ public class Test09 implements StorageTest {
m_aTestHelper.Error( "Exception: " + e );
return false;
}
- }
+ }
}
diff --git a/odk/examples/java/Storage/TestHelper.java b/odk/examples/java/Storage/TestHelper.java
index f5b487bc5730..2868de481f81 100644
--- a/odk/examples/java/Storage/TestHelper.java
+++ b/odk/examples/java/Storage/TestHelper.java
@@ -32,7 +32,7 @@ public class TestHelper {
Error( "Can't get XOutputStream implementation from substream '" + sStreamName + "'!" );
return false;
}
-
+
// get XTrucate implementation from output stream
XTruncate xTruncate = (XTruncate) UnoRuntime.queryInterface( XTruncate.class, xOutput );
if ( xTruncate == null )
@@ -40,7 +40,7 @@ public class TestHelper {
Error( "Can't get XTruncate implementation from substream '" + sStreamName + "'!" );
return false;
}
-
+
// write requested byte sequence
try
{
@@ -125,7 +125,7 @@ public class TestHelper {
Error( "Can't create substream '" + sStreamName + "', exception : " + e + "!" );
return false;
}
-
+
return WriteBytesToStream( xSubStream, sStreamName, sMediaType, bCompressed, pBytes );
}
@@ -237,7 +237,7 @@ public class TestHelper {
Message( "Optional interface XEncryptionProtectedSource is not implemented, feature can not be tested!" );
return -1;
}
-
+
try {
xStreamEncryption.setEncryptionKey( pNewPass );
}
@@ -282,7 +282,7 @@ public class TestHelper {
Error( "'IsRoot' property contains wrong value!" );
bOk = false;
}
-
+
if ( ( bIsRoot && ( nPropMode | ElementModes.ELEMENT_READ ) != ( nMode | ElementModes.ELEMENT_READ ) )
|| ( !bIsRoot && ( nPropMode & nMode ) != nMode ) )
{
@@ -325,13 +325,13 @@ public class TestHelper {
+ sMediaType + "', set '" + sPropMediaType + "' !" );
bOk = false;
}
-
+
if ( bPropIsRoot != bIsRoot )
{
Error( "'IsRoot' property contains wrong value!" );
bOk = false;
}
-
+
if ( ( bIsRoot && ( nPropMode | ElementModes.ELEMENT_READ ) != ( nMode | ElementModes.ELEMENT_READ ) )
|| ( !bIsRoot && ( nPropMode & nMode ) != nMode ) )
{
@@ -364,7 +364,7 @@ public class TestHelper {
Error( "Can't get XInputStream implementation from substream '" + sName + "'!" );
return false;
}
-
+
byte pContents[][] = new byte[1][]; // ???
// read contents
@@ -418,11 +418,11 @@ public class TestHelper {
bOk = true;
if ( !sPropMediaType.equals( sMediaType ) )
{
- Error( "'MediaType' property contains wrong value for stream '" + sName + "',\nexpected: '"
+ Error( "'MediaType' property contains wrong value for stream '" + sName + "',\nexpected: '"
+ sMediaType + "', set: '" + sPropMediaType + "'!" );
bOk = false;
}
-
+
if ( nPropSize != pBytes.length )
{
Error( "'Size' property contains wrong value for stream'" + sName + "'!" );
@@ -464,7 +464,7 @@ public class TestHelper {
Error( "Can't open substream '" + sName + "', exception : " + e + "!" );
return false;
}
-
+
return InternalCheckStream( xSubStream, sName, sMediaType, pBytes );
}
@@ -475,7 +475,7 @@ public class TestHelper {
byte[] pPass )
{
// Important: a common password for any of parent storage should not be set or
- // should be different from pPass
+ // should be different from pPass
if ( pPass.length == 0 )
{
@@ -496,7 +496,7 @@ public class TestHelper {
Error( "Unexpected exception in case of opening of encrypted stream '" + sName + "' without password: " + e + "!" );
return false;
}
-
+
byte pWrongPass[] = { 1, 1 };
pWrongPass[0] += pPass[0];
try
@@ -512,7 +512,7 @@ public class TestHelper {
Error( "Unexpected exception in case of opening of encrypted stream '" + sName + "' with wrong password: " + e + "!" );
return false;
}
-
+
XStream xSubStream = null;
try
{
@@ -529,7 +529,7 @@ public class TestHelper {
Error( "Can't open encrypted substream '" + sName + "', exception : " + e + "!" );
return false;
}
-
+
return InternalCheckStream( xSubStream, sName, sMediaType, pBytes );
}
@@ -571,7 +571,7 @@ public class TestHelper {
return true;
}
-
+
public boolean disposeStorage( XStorage xStorage )
{
// dispose the storage
@@ -639,7 +639,7 @@ public class TestHelper {
Error( "Can't close output part of a stream, exception :" + e );
return false;
}
-
+
return true;
}
@@ -681,7 +681,7 @@ public class TestHelper {
public String CreateTempFile( XMultiServiceFactory xMSF )
{
String sResult = null;
-
+
// try to get temporary file representation
XPropertySet xTempFileProps = null;
try
diff --git a/odk/examples/java/Text/BookmarkInsertion.java b/odk/examples/java/Text/BookmarkInsertion.java
index 89fb0ec4e841..03c9cb24340d 100644
--- a/odk/examples/java/Text/BookmarkInsertion.java
+++ b/odk/examples/java/Text/BookmarkInsertion.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.
- *
+ *
*************************************************************************/
//***************************************************************************
@@ -37,62 +37,62 @@
// Step 2: open an empty text document
// Step 3: enter a example text
// Step 4: insert some bookmarks
-//
+//
// Chapter 5.1.1.4 Inserting bookmarks
//***************************************************************************
import com.sun.star.uno.UnoRuntime;
public class BookmarkInsertion {
-
+
public static void main(String args[]) {
// You need the desktop to create a document
// The getDesktop method does the UNO bootstrapping, gets the
// remote servie manager and the desktop object.
com.sun.star.frame.XDesktop xDesktop = null;
xDesktop = getDesktop();
-
+
// create text document
com.sun.star.text.XTextDocument xTextDocument = null;
xTextDocument = createTextdocument(xDesktop);
-
+
// put example text in document
createExampleData(xTextDocument);
-
-
+
+
String mOffending[] = { "negro(e|es)?","bor(ed|ing)?",
"bloody?", "bleed(ing)?" };
String mBad[] = { "possib(le|ilit(y|ies))", "real(ly)+", "brilliant" };
-
+
String sOffendPrefix = "Offending";
String sBadPrefix = "BadStyle";
-
+
markList(xTextDocument, mOffending, sOffendPrefix);
markList(xTextDocument, mBad, sBadPrefix);
-
+
System.out.println("Done");
-
- System.exit(0);
+
+ System.exit(0);
}
-
+
public static void markList(com.sun.star.text.XTextDocument xTextDocument,
String mList[], String sPrefix) {
int iCounter=0;
com.sun.star.uno.XInterface xSearchInterface = null;
com.sun.star.text.XTextRange xSearchTextRange = null;
-
+
try {
for( iCounter = 0; iCounter < mList.length; iCounter++ ) {
// the findfirst returns a XInterface
xSearchInterface = (com.sun.star.uno.XInterface)FindFirst(
xTextDocument, mList[ iCounter ] );
-
+
if( xSearchInterface != null ) {
// get the TextRange form the XInterface
xSearchTextRange = (com.sun.star.text.XTextRange)
UnoRuntime.queryInterface(
com.sun.star.text.XTextRange.class, xSearchInterface);
-
+
InsertBookmark(xTextDocument, xSearchTextRange,
sPrefix + iCounter);
}
@@ -101,10 +101,10 @@ public class BookmarkInsertion {
catch( Exception e) {
e.printStackTrace(System.err);
System.exit(1);
- }
+ }
}
-
-
+
+
public static void InsertBookmark(com.sun.star.text.XTextDocument xTextDocument,
com.sun.star.text.XTextRange xTextRange,
String sBookName) {
@@ -115,25 +115,25 @@ public class BookmarkInsertion {
xDocMSF = (com.sun.star.lang.XMultiServiceFactory)
UnoRuntime.queryInterface(
com.sun.star.lang.XMultiServiceFactory.class, xTextDocument);
-
+
// the bookmark service is a context dependend service, you need
// the MultiServiceFactory from the document
Object xObject = xDocMSF.createInstance("com.sun.star.text.Bookmark");
-
+
// set the name from the bookmark
com.sun.star.container.XNamed xNameAccess = null;
xNameAccess = (com.sun.star.container.XNamed)
UnoRuntime.queryInterface(
com.sun.star.container.XNamed.class, xObject);
-
+
xNameAccess.setName(sBookName);
-
+
// create a XTextContent, for the method 'insertTextContent'
com.sun.star.text.XTextContent xTextContent = null;
xTextContent = (com.sun.star.text.XTextContent)
UnoRuntime.queryInterface(
com.sun.star.text.XTextContent.class, xNameAccess);
-
+
// insertTextContent need a TextRange not a cursor to specify the
// position from the bookmark
xTextDocument.getText().insertTextContent(xTextRange, xTextContent, true);
@@ -144,74 +144,74 @@ public class BookmarkInsertion {
e.printStackTrace(System.err);
}
}
-
+
protected static com.sun.star.uno.XInterface FindFirst(
com.sun.star.text.XTextDocument xTextDocument, String sSearchString)
{
com.sun.star.util.XSearchDescriptor xSearchDescriptor = null;
com.sun.star.util.XSearchable xSearchable = null;
com.sun.star.uno.XInterface xSearchInterface = null;
-
+
try {
xSearchable = (com.sun.star.util.XSearchable)
UnoRuntime.queryInterface(
com.sun.star.util.XSearchable.class, xTextDocument);
xSearchDescriptor = (com.sun.star.util.XSearchDescriptor)
xSearchable.createSearchDescriptor();
-
+
xSearchDescriptor.setSearchString(sSearchString);
-
+
com.sun.star.beans.XPropertySet xPropertySet = null;
xPropertySet = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xSearchDescriptor);
-
+
xPropertySet.setPropertyValue("SearchRegularExpression",
new Boolean( true ) );
-
+
xSearchInterface = (com.sun.star.uno.XInterface)
xSearchable.findFirst(xSearchDescriptor);
}
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
return xSearchInterface;
}
-
+
protected static void createExampleData(
com.sun.star.text.XTextDocument xTextDocument )
{
com.sun.star.text.XTextCursor xTextCursor = null;
-
+
try {
xTextCursor = (com.sun.star.text.XTextCursor)
xTextDocument.getText().createTextCursor();
-
+
xTextCursor.setString( "He heard quiet steps behind him. That didn't bode well. Who could be following him this late at night and in this deadbeat part of town? And at this particular moment, just after he pulled off the big time and was making off with the greenbacks. Was there another crook who'd had the same idea, and was now watching him and waiting for a chance to grab the fruit of his labor?" );
xTextCursor.collapseToEnd();
xTextCursor.setString( "Or did the steps behind him mean that one of many bloody officers in town was on to him and just waiting to pounce and snap those cuffs on his wrists? He nervously looked all around. Suddenly he saw the alley. Like lightening he darted off to the left and disappeared between the two warehouses almost falling over the trash can lying in the middle of the sidewalk. He tried to nervously tap his way along in the inky darkness and suddenly stiffened: it was a dead-end, he would have to go back the way he had come" );
xTextCursor.collapseToEnd();
xTextCursor.setString( "The steps got louder and louder, he saw the black outline of a figure coming around the corner. Is this the end of the line? he thought pressing himself back against the wall trying to make himself invisible in the dark, was all that planning and energy wasted? He was dripping with sweat now, cold and wet, he could smell the brilliant fear coming off his clothes. Suddenly next to him, with a barely noticeable squeak, a door swung quietly to and fro in the night's breeze." );
-
+
xTextCursor.gotoStart(false);
}
catch( Exception e) {
e.printStackTrace(System.err);
}
-
- }
-
+
+ }
+
public static com.sun.star.frame.XDesktop getDesktop() {
com.sun.star.frame.XDesktop xDesktop = null;
com.sun.star.lang.XMultiComponentFactory xMCF = null;
-
+
try {
com.sun.star.uno.XComponentContext xContext = null;
-
+
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
-
+
// get the remote office service manager
xMCF = xContext.getServiceManager();
if( xMCF != null ) {
@@ -229,16 +229,16 @@ public class BookmarkInsertion {
e.printStackTrace(System.err);
System.exit(1);
}
-
-
+
+
return xDesktop;
}
-
+
public static com.sun.star.text.XTextDocument createTextdocument(
com.sun.star.frame.XDesktop xDesktop )
{
com.sun.star.text.XTextDocument aTextDocument = null;
-
+
try {
com.sun.star.lang.XComponent xComponent = CreateNewDocument(xDesktop,
"swriter");
@@ -249,36 +249,36 @@ public class BookmarkInsertion {
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
return aTextDocument;
}
-
-
+
+
protected static com.sun.star.lang.XComponent CreateNewDocument(
com.sun.star.frame.XDesktop xDesktop,
String sDocumentType )
{
String sURL = "private:factory/" + sDocumentType;
-
+
com.sun.star.lang.XComponent xComponent = null;
com.sun.star.frame.XComponentLoader xComponentLoader = null;
com.sun.star.beans.PropertyValue xValues[] =
new com.sun.star.beans.PropertyValue[1];
com.sun.star.beans.PropertyValue xEmptyArgs[] =
new com.sun.star.beans.PropertyValue[0];
-
+
try {
xComponentLoader = (com.sun.star.frame.XComponentLoader)
UnoRuntime.queryInterface(
com.sun.star.frame.XComponentLoader.class, xDesktop);
-
+
xComponent = xComponentLoader.loadComponentFromURL(
sURL, "_blank", 0, xEmptyArgs);
}
catch( Exception e) {
e.printStackTrace(System.out);
}
-
+
return xComponent ;
}
}
diff --git a/odk/examples/java/Text/GraphicsInserter.java b/odk/examples/java/Text/GraphicsInserter.java
index 866da1c0849f..a42ccaabf119 100644
--- a/odk/examples/java/Text/GraphicsInserter.java
+++ b/odk/examples/java/Text/GraphicsInserter.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;
@@ -52,7 +52,7 @@ public class GraphicsInserter {
}
com.sun.star.uno.XComponentContext xContext = null;
-
+
try {
// bootstrap UNO and get the remote component context. The context can
@@ -62,8 +62,8 @@ public class GraphicsInserter {
// get the remote office service manager
com.sun.star.lang.XMultiComponentFactory xMCF =
- xContext.getServiceManager();
-
+ xContext.getServiceManager();
+
/* A desktop environment contains tasks with one or more
frames in which components can be loaded. Desktop is the
environment for components which can instanciate within
@@ -72,30 +72,30 @@ public class GraphicsInserter {
UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class,
xMCF.createInstanceWithContext("com.sun.star.frame.Desktop",
xContext ) );
-
+
com.sun.star.frame.XComponentLoader xCompLoader =
(com.sun.star.frame.XComponentLoader)UnoRuntime.queryInterface(
com.sun.star.frame.XComponentLoader.class, xDesktop);
-
+
// Load a Writer document, which will be automaticly displayed
com.sun.star.lang.XComponent xComp = xCompLoader.loadComponentFromURL(
"private:factory/swriter", "_blank", 0,
new com.sun.star.beans.PropertyValue[0]);
-
+
// Querying for the interface XTextDocument on the xcomponent
com.sun.star.text.XTextDocument xTextDoc =
(com.sun.star.text.XTextDocument)UnoRuntime.queryInterface(
com.sun.star.text.XTextDocument.class, xComp);
-
+
// Querying for the interface XMultiServiceFactory on the xtextdocument
com.sun.star.lang.XMultiServiceFactory xMSFDoc =
(com.sun.star.lang.XMultiServiceFactory)UnoRuntime.queryInterface(
com.sun.star.lang.XMultiServiceFactory.class, xTextDoc);
-
+
// Providing a log file for output
PrintWriter printwriterLog = new PrintWriter(
new BufferedWriter( new FileWriter("log.txt") ) );
-
+
Object oGraphic = null;
try {
// Creating the service GraphicObject
@@ -106,18 +106,18 @@ public class GraphicsInserter {
System.out.println( "Could not create instance" );
exception.printStackTrace( printwriterLog );
}
-
+
// Getting the text
com.sun.star.text.XText xText = xTextDoc.getText();
-
+
// Getting the cursor on the document
com.sun.star.text.XTextCursor xTextCursor = xText.createTextCursor();
-
+
// Querying for the interface XTextContent on the GraphicObject
com.sun.star.text.XTextContent xTextContent =
(com.sun.star.text.XTextContent)UnoRuntime.queryInterface(
com.sun.star.text.XTextContent.class, oGraphic );
-
+
// Printing information to the log file
printwriterLog.println( "inserting graphic" );
try {
@@ -127,10 +127,10 @@ public class GraphicsInserter {
System.out.println( "Could not insert Content" );
exception.printStackTrace(System.err);
}
-
+
// Printing information to the log file
printwriterLog.println( "adding graphic" );
-
+
// Querying for the interface XPropertySet on GraphicObject
com.sun.star.beans.XPropertySet xPropSet =
(com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
@@ -141,34 +141,34 @@ public class GraphicsInserter {
StringBuffer sUrl = new StringBuffer("file:///");
sUrl.append(sourceFile.getCanonicalPath().replace('\\', '/'));
System.out.println( "insert graphic \"" + sUrl + "\"");
-
+
// Setting the anchor type
xPropSet.setPropertyValue("AnchorType",
com.sun.star.text.TextContentAnchorType.AT_PARAGRAPH );
-
+
// Setting the graphic url
xPropSet.setPropertyValue( "GraphicURL", sUrl.toString() );
-
+
// Setting the horizontal position
xPropSet.setPropertyValue( "HoriOrientPosition",
new Integer( 5500 ) );
-
+
// Setting the vertical position
xPropSet.setPropertyValue( "VertOrientPosition",
new Integer( 4200 ) );
-
+
// Setting the width
xPropSet.setPropertyValue( "Width", new Integer( 4400 ) );
-
+
// Setting the height
xPropSet.setPropertyValue( "Height", new Integer( 4000 ) );
} catch ( Exception exception ) {
System.out.println( "Couldn't set property 'GraphicURL'" );
exception.printStackTrace( printwriterLog );
}
-
+
xContext = null;
-
+
System.exit(0);
}
catch( Exception e ) {
diff --git a/odk/examples/java/Text/HardFormatting.java b/odk/examples/java/Text/HardFormatting.java
index b1ec48da7cb7..7d8bf94f5971 100644
--- a/odk/examples/java/Text/HardFormatting.java
+++ b/odk/examples/java/Text/HardFormatting.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.
- *
+ *
*************************************************************************/
//***************************************************************************
@@ -45,64 +45,64 @@
import com.sun.star.uno.UnoRuntime;
public class HardFormatting {
-
+
public static void main(String args[]) {
// You need the desktop to create a document
// The getDesktop method does the UNO bootstrapping, gets the
// remote servie manager and the desktop object.
com.sun.star.frame.XDesktop xDesktop = null;
xDesktop = getDesktop();
-
+
try {
// create text document
com.sun.star.text.XTextDocument xTextDocument = null;
xTextDocument = createTextdocument(xDesktop);
-
+
// the text interface contains all methods and properties to
// manipulate the content from a text document
com.sun.star.text.XText xText = null;
xText = xTextDocument.getText();
-
+
String sMyText = "A very short paragraph for illustration only";
-
+
// you can travel with the cursor throught the text document.
// you travel only at the model, not at the view. The cursor that you can
// see on the document doesn't change the position
com.sun.star.text.XTextCursor xTextCursor = null;
xTextCursor = (com.sun.star.text.XTextCursor)
xTextDocument.getText().createTextCursor();
-
+
xText.insertString( xTextCursor, "Headline", false );
xText.insertControlCharacter(xTextCursor,
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false);
-
+
xText.insertString(xTextCursor, sMyText, false);
-
+
com.sun.star.text.XTextRange xTextRange = null;
com.sun.star.beans.XPropertySet xPropertySet = null;
-
- // BEGIN: 'Hard formating'
+
+ // BEGIN: 'Hard formating'
// the text range not the cursor contains the 'parastyle' property
xTextRange = xText.getEnd();
xPropertySet = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xTextRange);
-
+
// create a paragraph cursor to travel throught the paragraphs
com.sun.star.text.XParagraphCursor xParagraphCursor = null;
xParagraphCursor = (com.sun.star.text.XParagraphCursor)
UnoRuntime.queryInterface(
com.sun.star.text.XParagraphCursor.class, xTextRange);
-
+
xParagraphCursor.gotoStart( false );
xParagraphCursor.gotoEndOfParagraph( true );
xTextRange = xParagraphCursor.getText().getStart();
-
+
// create a WordCursor to travel into the paragraph
com.sun.star.text.XWordCursor xWordCursor = null;
xWordCursor = (com.sun.star.text.XWordCursor) UnoRuntime.queryInterface(
com.sun.star.text.XWordCursor.class, xTextRange);
-
+
// the PropertySet from the cursor contains the text attributes
xPropertySet = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(
@@ -114,18 +114,18 @@ public class HardFormatting {
+ xPropertySet.getPropertyValue("CharFontName").toString()
+ "\nWeight : "
+ xPropertySet.getPropertyValue("CharWeight").toString() );
-
+
xWordCursor.gotoNextWord(false);
xWordCursor.gotoNextWord(false);
xWordCursor.gotoEndOfWord(true);
-
+
xPropertySet = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xWordCursor);
xPropertySet.setPropertyValue("CharWeight",
new Float(com.sun.star.awt.FontWeight.BOLD));
xPropertySet.setPropertyValue("CharColor", new Integer( 255 ) );
-
+
System.out.println(
"Parastyle : "
+ xPropertySet.getPropertyValue("ParaStyleName").toString()
@@ -133,46 +133,46 @@ public class HardFormatting {
+ xPropertySet.getPropertyValue("CharFontName").toString()
+ "\nWeight : "
+ xPropertySet.getPropertyValue("CharWeight").toString() );
-
+
// the PropertyState contains information where the attribute is set,
// is a text part hard formated or not.
com.sun.star.beans.XPropertyState xPropertyState = null;
xPropertyState = (com.sun.star.beans.XPropertyState)
UnoRuntime.queryInterface(
com.sun.star.beans.XPropertyState.class, xWordCursor);
-
+
com.sun.star.beans.PropertyState xPropertyStateValue =
xPropertyState.getPropertyState("CharWeight");
-
+
checkPropertyState( xWordCursor, xPropertyStateValue );
-
+
xWordCursor.goRight( (short) 3 , true );
xPropertyStateValue = xPropertyState.getPropertyState("CharWeight");
-
+
System.out.println("Increase the selection with three characters");
checkPropertyState(xWordCursor, xPropertyStateValue);
-
+
xPropertyState.setPropertyToDefault("CharWeight");
-
+
System.out.println("Set the default value on the selection");
xPropertyStateValue = xPropertyState.getPropertyState("CharWeight");
checkPropertyState(xWordCursor, xPropertyStateValue);
-
+
// END: 'Hard formating' Section from the Cookbook
}
catch( Exception e) {
e.printStackTrace(System.err);
System.exit(1);
}
-
-
+
+
System.out.println("Done");
-
+
System.exit(0);
-
+
}
-
-
+
+
public static void checkPropertyState(
com.sun.star.text.XWordCursor xWordCursor,
com.sun.star.beans.PropertyState xPropertyStateValue )
@@ -184,36 +184,36 @@ public class HardFormatting {
+ "' completly hard formated" );
break;
}
-
+
case com.sun.star.beans.PropertyState.DEFAULT_VALUE_value: {
System.out.println( "-> The selection '"
+ xWordCursor.getString()
+ "' isn't hard formated" );
break;
}
-
+
case com.sun.star.beans.PropertyState.AMBIGUOUS_VALUE_value: {
System.out.println( "-> The selection '"
+ xWordCursor.getString()
+ "' isn't completly hard formated" );
break;
}
-
+
default:
System.out.println( "No PropertyState found" );
}
}
-
+
public static com.sun.star.frame.XDesktop getDesktop() {
com.sun.star.frame.XDesktop xDesktop = null;
com.sun.star.lang.XMultiComponentFactory xMCF = null;
-
+
try {
com.sun.star.uno.XComponentContext xContext = null;
-
+
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
-
+
// get the remote office service manager
xMCF = xContext.getServiceManager();
if( xMCF != null ) {
@@ -231,16 +231,16 @@ public class HardFormatting {
e.printStackTrace(System.err);
System.exit(1);
}
-
-
+
+
return xDesktop;
}
-
+
public static com.sun.star.text.XTextDocument createTextdocument(
com.sun.star.frame.XDesktop xDesktop )
{
com.sun.star.text.XTextDocument aTextDocument = null;
-
+
try {
com.sun.star.lang.XComponent xComponent = CreateNewDocument(xDesktop,
"swriter");
@@ -251,36 +251,36 @@ public class HardFormatting {
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
return aTextDocument;
}
-
-
+
+
protected static com.sun.star.lang.XComponent CreateNewDocument(
com.sun.star.frame.XDesktop xDesktop,
String sDocumentType )
{
String sURL = "private:factory/" + sDocumentType;
-
+
com.sun.star.lang.XComponent xComponent = null;
com.sun.star.frame.XComponentLoader xComponentLoader = null;
com.sun.star.beans.PropertyValue xValues[] =
new com.sun.star.beans.PropertyValue[1];
com.sun.star.beans.PropertyValue xEmptyArgs[] =
new com.sun.star.beans.PropertyValue[0];
-
+
try {
xComponentLoader = (com.sun.star.frame.XComponentLoader)
UnoRuntime.queryInterface(
com.sun.star.frame.XComponentLoader.class, xDesktop);
-
+
xComponent = xComponentLoader.loadComponentFromURL(
sURL, "_blank", 0, xEmptyArgs);
}
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
return xComponent ;
}
}
diff --git a/odk/examples/java/Text/SWriter.java b/odk/examples/java/Text/SWriter.java
index 18ae35481189..ca7696b4cf4b 100644
--- a/odk/examples/java/Text/SWriter.java
+++ b/odk/examples/java/Text/SWriter.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.
- *
+ *
*************************************************************************/
//***************************************************************************
@@ -44,16 +44,16 @@
import com.sun.star.uno.UnoRuntime;
public class SWriter {
-
+
public static void main(String args[]) {
-
-
+
+
//oooooooooooooooooooooooooooStep 1oooooooooooooooooooooooooooooooooooooooo
// bootstrap UNO and get the remote component context. The context can
// be used to get the service manager
//*************************************************************************
com.sun.star.uno.XComponentContext xContext = null;
-
+
try {
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
@@ -70,39 +70,39 @@ public class SWriter {
// For this purpose an instance of com.sun.star.frame.Desktop
// is created. It's interface XDesktop provides the XComponentLoader,
// which is used to open the document via loadComponentFromURL
- //*************************************************************************
-
+ //*************************************************************************
+
//Open Writer document
-
+
System.out.println("Opening an empty Writer document");
com.sun.star.text.XTextDocument myDoc = openWriter(xContext);
-
+
//*************************************************************************
-
-
+
+
//oooooooooooooooooooooooooooStep 3oooooooooooooooooooooooooooooooooooooooo
// insert some text.
// For this purpose get the Text-Object of the document an create the
// cursor. Now it is possible to insert a text at the cursor-position
// via insertString
//*************************************************************************
-
-
+
+
//getting the text object
com.sun.star.text.XText xText = myDoc.getText();
-
+
//create a cursor object
com.sun.star.text.XTextCursor xTCursor = xText.createTextCursor();
-
+
//inserting some Text
xText.insertString( xTCursor, "The first line in the newly created text document.\n", false );
-
+
//inserting a second line
xText.insertString( xTCursor, "Now we're in the second line\n", false );
-
+
//*************************************************************************
-
-
+
+
//oooooooooooooooooooooooooooStep 4oooooooooooooooooooooooooooooooooooooooo
// insert a text table.
// For this purpose get MultiServiceFactory of the document, create an
@@ -110,18 +110,18 @@ public class SWriter {
// be inserted at the cursor position via insertTextContent.
// After that some properties are changed and some data is inserted.
//*************************************************************************
-
- //inserting a text table
+
+ //inserting a text table
System.out.println("Inserting a text table");
-
+
//getting MSF of the document
com.sun.star.lang.XMultiServiceFactory xDocMSF =
(com.sun.star.lang.XMultiServiceFactory) UnoRuntime.queryInterface(
com.sun.star.lang.XMultiServiceFactory.class, myDoc);
-
+
//create instance of a text table
com.sun.star.text.XTextTable xTT = null;
-
+
try {
Object oInt = xDocMSF.createInstance("com.sun.star.text.TextTable");
xTT = (com.sun.star.text.XTextTable)
@@ -130,12 +130,12 @@ public class SWriter {
System.err.println("Couldn't create instance "+ e);
e.printStackTrace(System.err);
}
-
+
//initialize the text table with 4 columns an 4 rows
xTT.initialize(4,4);
-
+
com.sun.star.beans.XPropertySet xTTRowPS = null;
-
+
//insert the table
try {
xText.insertTextContent(xTCursor, xTT, false);
@@ -143,71 +143,71 @@ public class SWriter {
com.sun.star.container.XIndexAccess xTTRows = xTT.getRows();
xTTRowPS = (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xTTRows.getByIndex(0));
-
+
} catch (Exception e) {
System.err.println("Couldn't insert the table " + e);
e.printStackTrace(System.err);
}
-
-
+
+
// get the property set of the text table
-
+
com.sun.star.beans.XPropertySet xTTPS = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class, xTT);
-
+
// Change the BackColor
- try {
+ try {
xTTPS.setPropertyValue("BackTransparent", new Boolean(false));
xTTPS.setPropertyValue("BackColor",new Integer(13421823));
xTTRowPS.setPropertyValue("BackTransparent", new Boolean(false));
xTTRowPS.setPropertyValue("BackColor",new Integer(6710932));
-
+
} catch (Exception e) {
System.err.println("Couldn't change the color " + e);
e.printStackTrace(System.err);
- }
-
+ }
+
// write Text in the Table headers
System.out.println("Write text in the table headers");
-
+
insertIntoCell("A1","FirstColumn", xTT);
insertIntoCell("B1","SecondColumn", xTT) ;
insertIntoCell("C1","ThirdColumn", xTT) ;
insertIntoCell("D1","SUM", xTT) ;
-
-
+
+
//Insert Something in the text table
System.out.println("Insert something in the text table");
-
+
(xTT.getCellByName("A2")).setValue(22.5);
(xTT.getCellByName("B2")).setValue(5615.3);
(xTT.getCellByName("C2")).setValue(-2315.7);
(xTT.getCellByName("D2")).setFormula("sum <A2:C2>");
-
+
(xTT.getCellByName("A3")).setValue(21.5);
(xTT.getCellByName("B3")).setValue(615.3);
(xTT.getCellByName("C3")).setValue(-315.7);
(xTT.getCellByName("D3")).setFormula("sum <A3:C3>");
-
+
(xTT.getCellByName("A4")).setValue(121.5);
(xTT.getCellByName("B4")).setValue(-615.3);
(xTT.getCellByName("C4")).setValue(415.7);
(xTT.getCellByName("D4")).setFormula("sum <A4:C4>");
-
-
+
+
//oooooooooooooooooooooooooooStep 5oooooooooooooooooooooooooooooooooooooooo
// insert a colored text.
// Get the propertySet of the cursor, change the CharColor and add a
// shadow. Then insert the Text via InsertString at the cursor position.
//*************************************************************************
-
+
// get the property set of the cursor
com.sun.star.beans.XPropertySet xTCPS = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class,
xTCursor);
-
+
Object oldValue = null;
-
+
// Change the CharColor and add a Shadow
try {
xTCPS.setPropertyValue("CharColor",new Integer(255));
@@ -216,33 +216,33 @@ public class SWriter {
System.err.println("Couldn't change the color " + e);
e.printStackTrace(System.err);
}
-
+
//create a paragraph break
- try {
+ try {
xText.insertControlCharacter(xTCursor,
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false);
-
+
} catch (Exception e) {
System.err.println("Couldn't insert break "+ e);
e.printStackTrace(System.err);
- }
-
+ }
+
//inserting colored Text
System.out.println("Inserting colored Text");
-
+
xText.insertString(xTCursor, " This is a colored Text - blue with shadow\n",
false );
-
+
//create a paragraph break
try {
xText.insertControlCharacter(xTCursor,
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false);
-
+
} catch (Exception e) {
System.err.println("Couldn't insert break "+ e);
e.printStackTrace(System.err);
}
-
+
//oooooooooooooooooooooooooooStep 6oooooooooooooooooooooooooooooooooooooooo
// insert a text frame.
// create an instance of com.sun.star.text.TextFrame using the MSF of the
@@ -250,32 +250,32 @@ public class SWriter {
// Now get the text-Object of the frame an the corresponding cursor.
// Insert some text via insertString.
//*************************************************************************
-
- // Create a TextFrame
+
+ // Create a TextFrame
com.sun.star.text.XTextFrame xTF = null;
com.sun.star.drawing.XShape xTFS = null;
-
+
try {
Object oInt = xDocMSF.createInstance("com.sun.star.text.TextFrame");
xTF = (com.sun.star.text.XTextFrame) UnoRuntime.queryInterface(
com.sun.star.text.XTextFrame.class,oInt);
xTFS = (com.sun.star.drawing.XShape) UnoRuntime.queryInterface(
com.sun.star.drawing.XShape.class,oInt);
-
+
com.sun.star.awt.Size aSize = new com.sun.star.awt.Size();
aSize.Height = 400;
aSize.Width = 15000;
-
- xTFS.setSize(aSize);
+
+ xTFS.setSize(aSize);
} catch (Exception e) {
System.err.println("Couldn't create instance "+ e);
e.printStackTrace(System.err);
- }
-
- // get the property set of the text frame
+ }
+
+ // get the property set of the text frame
com.sun.star.beans.XPropertySet xTFPS = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class, xTF);
-
+
// Change the AnchorType
try {
xTFPS.setPropertyValue("AnchorType",
@@ -283,42 +283,42 @@ public class SWriter {
} catch (Exception e) {
System.err.println("Couldn't change the color " + e);
e.printStackTrace(System.err);
- }
-
+ }
+
//insert the frame
System.out.println("Insert the text frame");
-
+
try {
xText.insertTextContent(xTCursor, xTF, false);
} catch (Exception e) {
System.err.println("Couldn't insert the frame " + e);
e.printStackTrace(System.err);
- }
-
+ }
+
//getting the text object of Frame
com.sun.star.text.XText xTextF = xTF.getText();
-
+
//create a cursor object
com.sun.star.text.XTextCursor xTCF = xTextF.createTextCursor();
-
+
//inserting some Text
xTextF.insertString(xTCF,
"The first line in the newly created text frame.", false);
-
-
+
+
xTextF.insertString(xTCF,
"\nWith this second line the height of the frame raises.", false);
-
+
//insert a paragraph break
- try {
+ try {
xText.insertControlCharacter(xTCursor,
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false );
-
+
} catch (Exception e) {
System.err.println("Couldn't insert break "+ e);
e.printStackTrace(System.err);
}
-
+
// Change the CharColor and add a Shadow
try {
xTCPS.setPropertyValue("CharColor",new Integer(65536));
@@ -326,24 +326,24 @@ public class SWriter {
} catch (Exception e) {
System.err.println("Couldn't change the color " + e);
e.printStackTrace(System.err);
- }
-
+ }
+
xText.insertString(xTCursor, " That's all for now !!", false );
-
+
System.out.println("done");
-
- System.exit(0);
+
+ System.exit(0);
}
-
-
+
+
public static com.sun.star.text.XTextDocument openWriter(
com.sun.star.uno.XComponentContext xContext)
- {
+ {
//define variables
com.sun.star.frame.XComponentLoader xCLoader;
com.sun.star.text.XTextDocument xDoc = null;
com.sun.star.lang.XComponent xComp = null;
-
+
try {
// get the remote office service manager
com.sun.star.lang.XMultiComponentFactory xMCF =
@@ -362,36 +362,36 @@ public class SWriter {
xDoc = (com.sun.star.text.XTextDocument)
UnoRuntime.queryInterface(com.sun.star.text.XTextDocument.class,
xComp);
-
- } catch(Exception e){
+
+ } catch(Exception e){
System.err.println(" Exception " + e);
e.printStackTrace(System.err);
- }
+ }
return xDoc;
}
-
+
public static void insertIntoCell(String CellName, String theText,
com.sun.star.text.XTextTable xTTbl) {
-
+
com.sun.star.text.XText xTableText = (com.sun.star.text.XText)
UnoRuntime.queryInterface(com.sun.star.text.XText.class,
xTTbl.getCellByName(CellName));
-
+
//create a cursor object
com.sun.star.text.XTextCursor xTC = xTableText.createTextCursor();
-
+
com.sun.star.beans.XPropertySet xTPS = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class, xTC);
-
+
try {
xTPS.setPropertyValue("CharColor",new Integer(16777215));
} catch (Exception e) {
System.err.println(" Exception " + e);
e.printStackTrace(System.err);
- }
-
+ }
+
//inserting some Text
xTableText.setString( theText );
-
+
}
}
diff --git a/odk/examples/java/Text/StyleCreation.java b/odk/examples/java/Text/StyleCreation.java
index 91cfb3f7a8c6..362604af6311 100644
--- a/odk/examples/java/Text/StyleCreation.java
+++ b/odk/examples/java/Text/StyleCreation.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.
- *
+ *
*************************************************************************/
//***************************************************************************
@@ -51,108 +51,108 @@ public class StyleCreation {
// remote servie manager and the desktop object.
com.sun.star.frame.XDesktop xDesktop = null;
xDesktop = getDesktop();
-
+
try {
// create text document
com.sun.star.text.XTextDocument xTextDocument = null;
xTextDocument = createTextdocument(xDesktop);
-
+
// the service '..ParagraphStyle' is context dependend, you need
// the multi service factory from the document to use the service
com.sun.star.lang.XMultiServiceFactory xDocMSF =
(com.sun.star.lang.XMultiServiceFactory)UnoRuntime.queryInterface(
com.sun.star.lang.XMultiServiceFactory.class, xTextDocument);
-
+
// use the service 'com.sun.star.style.ParagraphStyle'
com.sun.star.uno.XInterface xInterface = (com.sun.star.uno.XInterface)
xDocMSF.createInstance("com.sun.star.style.ParagraphStyle");
-
+
// create a supplier to get the Style family collection
com.sun.star.style.XStyleFamiliesSupplier xSupplier =
(com.sun.star.style.XStyleFamiliesSupplier)UnoRuntime.queryInterface(
com.sun.star.style.XStyleFamiliesSupplier.class, xTextDocument );
-
+
// get the NameAccess interface from the Style family collection
com.sun.star.container.XNameAccess xNameAccess =
xSupplier.getStyleFamilies();
-
+
// select the Paragraph styles, you get the Paragraph style collection
com.sun.star.container.XNameContainer xParaStyleCollection =
(com.sun.star.container.XNameContainer) UnoRuntime.queryInterface(
com.sun.star.container.XNameContainer.class,
xNameAccess.getByName("ParagraphStyles"));
-
+
// create a PropertySet to set the properties for the new Paragraphstyle
com.sun.star.beans.XPropertySet xPropertySet =
(com.sun.star.beans.XPropertySet) UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xInterface );
System.out.println( "create a PropertySet to set the properties for the new Paragraphstyle" );
-
+
// set some properties from the Paragraph style
xPropertySet.setPropertyValue("CharFontName", new String( "Helvetica" ) );
System.out.println( "set name of the font to 'Helvetica'" );
-
+
xPropertySet.setPropertyValue("CharHeight", new Float( 36 ) );
System.out.println( "Change the height of th font to 36" );
-
+
xPropertySet.setPropertyValue("CharWeight",
new Float( com.sun.star.awt.FontWeight.BOLD ) );
System.out.println( "set the font attribute 'Bold'" );
-
+
xPropertySet.setPropertyValue("CharAutoKerning", new Boolean( true ) );
System.out.println( "set the paragraph attribute 'AutoKerning'" );
xPropertySet.setPropertyValue("ParaAdjust",
new Integer( com.sun.star.style.ParagraphAdjust.CENTER_value ) );
System.out.println( "set the paragraph adjust to LEFT" );
-
+
xPropertySet.setPropertyValue("ParaFirstLineIndent", new Integer( 0 ) );
System.out.println( "set the first line indent to 0 cm" );
-
+
xPropertySet.setPropertyValue("BreakType",
com.sun.star.style.BreakType.PAGE_AFTER );
System.out.println( "set the paragraph attribute Breaktype to PageAfter" );
-
+
// insert the new Paragraph style in the Paragraph style collection
xParaStyleCollection.insertByName( "myheading", xPropertySet );
System.out.println( "create new paragraph style, with the values from the Propertyset");
-
+
// get the Textrange from the document
com.sun.star.text.XTextRange xTextRange =
xTextDocument.getText().getStart();
-
+
// get the PropertySet from the current paragraph
com.sun.star.beans.XPropertySet xParagraphPropertySet =
(com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xTextRange );
// change the value from the property 'ParaStyle' to apply the
- // Paragraph style
+ // Paragraph style
// To run the sample with StarOffice 5.2 you'll have to change
// 'ParaStyleName' to 'ParaStyle' in the next line
xParagraphPropertySet.setPropertyValue("ParaStyleName",
new String( "myheading" ) );
- System.out.println( "apply the new paragraph style");
+ System.out.println( "apply the new paragraph style");
}
catch( Exception e) {
e.printStackTrace(System.err);
System.exit(1);
}
-
+
System.out.println("done");
-
+
System.exit(0);
}
-
-
+
+
public static com.sun.star.frame.XDesktop getDesktop() {
com.sun.star.frame.XDesktop xDesktop = null;
com.sun.star.lang.XMultiComponentFactory xMCF = null;
-
+
try {
com.sun.star.uno.XComponentContext xContext = null;
-
+
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
-
+
// get the remote office service manager
xMCF = xContext.getServiceManager();
if( xMCF != null ) {
@@ -170,16 +170,16 @@ public class StyleCreation {
e.printStackTrace(System.err);
System.exit(1);
}
-
-
+
+
return xDesktop;
}
-
+
public static com.sun.star.text.XTextDocument createTextdocument(
com.sun.star.frame.XDesktop xDesktop )
{
com.sun.star.text.XTextDocument aTextDocument = null;
-
+
try {
com.sun.star.lang.XComponent xComponent = CreateNewDocument(xDesktop,
"swriter");
@@ -190,36 +190,36 @@ public class StyleCreation {
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
return aTextDocument;
}
-
-
+
+
protected static com.sun.star.lang.XComponent CreateNewDocument(
com.sun.star.frame.XDesktop xDesktop,
String sDocumentType )
{
String sURL = "private:factory/" + sDocumentType;
-
+
com.sun.star.lang.XComponent xComponent = null;
com.sun.star.frame.XComponentLoader xComponentLoader = null;
com.sun.star.beans.PropertyValue xValues[] =
new com.sun.star.beans.PropertyValue[1];
com.sun.star.beans.PropertyValue xEmptyArgs[] =
new com.sun.star.beans.PropertyValue[0];
-
+
try {
xComponentLoader = (com.sun.star.frame.XComponentLoader)
UnoRuntime.queryInterface(
com.sun.star.frame.XComponentLoader.class, xDesktop);
-
+
xComponent = xComponentLoader.loadComponentFromURL(
sURL, "_blank", 0, xEmptyArgs);
}
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
return xComponent ;
}
}
diff --git a/odk/examples/java/Text/StyleInitialization.java b/odk/examples/java/Text/StyleInitialization.java
index c08243609499..22d8eb4d063e 100644
--- a/odk/examples/java/Text/StyleInitialization.java
+++ b/odk/examples/java/Text/StyleInitialization.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.
- *
+ *
*************************************************************************/
//***************************************************************************
@@ -44,35 +44,35 @@ import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.AnyConverter;
public class StyleInitialization {
-
+
public static void main(String args[]) {
// You need the desktop to create a document
// The getDesktop method does the UNO bootstrapping, gets the
// remote servie manager and the desktop object.
com.sun.star.frame.XDesktop xDesktop = null;
xDesktop = getDesktop();
-
+
try {
// BEGIN: 'Style basics' Section from the Tutorial
-
+
// create text document
com.sun.star.text.XTextDocument xTextDocument = null;
xTextDocument = createTextdocument( xDesktop );
-
+
// the text interface contains all methods and properties to
// manipulate the content from a text document
com.sun.star.text.XText xText = null;
xText = xTextDocument.getText();
-
+
String sMyText = "A very short paragraph for illustration only";
-
+
// you can travel with the cursor throught the text document.
// you travel only at the model, not at the view. The cursor that you can
// see on the document doesn't change the position
com.sun.star.text.XTextCursor xTextCursor = null;
xTextCursor = (com.sun.star.text.XTextCursor)
xTextDocument.getText().createTextCursor();
-
+
com.sun.star.beans.XPropertySet oCPS = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xTextCursor);
@@ -80,64 +80,64 @@ public class StyleInitialization {
oCPS.setPropertyValue("CharFontName","Helvetica");
}
catch (Exception ex) {
-
+
}
-
+
xText.insertString( xTextCursor, "Headline", false );
-
+
try {
oCPS.setPropertyValue("CharFontName","Times");
}
catch (Exception ex) {
-
+
}
xText.insertControlCharacter(xTextCursor,
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false);
-
+
xText.insertString( xTextCursor, sMyText, false );
-
+
com.sun.star.text.XTextRange xTextRange = null;
com.sun.star.beans.XPropertySet xPropertySet = null;
-
+
// the text range not the cursor contains the 'parastyle' property
xTextRange = xText.getEnd();
xPropertySet = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xTextRange );
-
+
// To run the sample with StarOffice 5.2 you'll have to change
// 'ParaStyleName' to 'ParaStyle' in the next line
System.out.println( "Current Parastyle : "
+ xPropertySet.getPropertyValue("ParaStyleName") );
-
+
// END: 'Style basics' Section from the Tutorial
-
+
// There are two way to travel throught the paragraphs, with a
// paragraph cursor, or a enumeration.
// You find both ways in this example
-
+
// The first way, with the paragraph cursor
com.sun.star.text.XParagraphCursor xParagraphCursor = null;
xParagraphCursor = (com.sun.star.text.XParagraphCursor)
UnoRuntime.queryInterface(
com.sun.star.text.XParagraphCursor.class, xTextRange );
-
+
xParagraphCursor.gotoStart( false );
xParagraphCursor.gotoEndOfParagraph( true );
-
+
// The second way, with the paragraph enumeration
com.sun.star.container.XEnumerationAccess xEnumerationAccess = null;
xEnumerationAccess = (com.sun.star.container.XEnumerationAccess)
UnoRuntime.queryInterface(
com.sun.star.container.XEnumerationAccess.class, xText );
-
+
// the enumeration contains all paragraph form the document
com.sun.star.container.XEnumeration xParagraphEnumeration = null;
xParagraphEnumeration = xEnumerationAccess.createEnumeration();
-
+
com.sun.star.text.XTextContent xParagraph = null;
com.sun.star.text.XTextRange xWord = null;
-
+
com.sun.star.container.XEnumerationAccess xParaEnumerationAccess = null;
com.sun.star.container.XEnumeration xPortionEnumeration = null;
@@ -148,26 +148,26 @@ public class StyleInitialization {
UnoRuntime.queryInterface(
com.sun.star.text.XTextContent.class,
xParagraphEnumeration.nextElement());
-
+
// you need the method getAnchor to a TextRange -> to manipulate
// the paragraph
String sText = xParagraph.getAnchor().getString();
-
+
// create a cursor from this paragraph
com.sun.star.text.XTextCursor xParaCursor = null;
xParaCursor = xParagraph.getAnchor().getText().createTextCursor();
-
+
// goto the start and end of the paragraph
xParaCursor.gotoStart( false );
xParaCursor.gotoEnd( true );
-
+
// The enumeration from the paragraphs contain parts from the
// paragraph with a different attributes.
xParaEnumerationAccess = (com.sun.star.container.XEnumerationAccess)
UnoRuntime.queryInterface(
com.sun.star.container.XEnumerationAccess.class, xParagraph);
xPortionEnumeration = xParaEnumerationAccess.createEnumeration();
-
+
while ( xPortionEnumeration.hasMoreElements() ) {
// output of all parts from the paragraph with different attributes
xWord = (com.sun.star.text.XTextRange) UnoRuntime.queryInterface(
@@ -177,22 +177,22 @@ public class StyleInitialization {
System.out.println( "Content of the paragraph : " + sWordString );
}
}
-
+
// BEGIN: 'Finding a suitable style' Section from the Tutorial
-
+
// craete a supplier to get the styles-collection
com.sun.star.style.XStyleFamiliesSupplier xSupplier = null;
xSupplier = ( com.sun.star.style.XStyleFamiliesSupplier ) UnoRuntime.queryInterface(
com.sun.star.style.XStyleFamiliesSupplier.class, xTextDocument );
-
+
// use the name access from the collection
com.sun.star.container.XNameAccess xNameAccess = null;
xNameAccess = xSupplier.getStyleFamilies();
-
+
com.sun.star.container.XNameContainer xParaStyleCollection = null;
xParaStyleCollection = (com.sun.star.container.XNameContainer) UnoRuntime.queryInterface(
com.sun.star.container.XNameContainer.class, xNameAccess.getByName( "ParagraphStyles" ));
-
+
// create a array from strings with the name of all paragraph styles from the text document
String[] sElementNames = xParaStyleCollection.getElementNames();
int iElementCount = sElementNames.length;
@@ -203,21 +203,21 @@ public class StyleInitialization {
xStyle = (com.sun.star.style.XStyle) UnoRuntime.queryInterface(
com.sun.star.style.XStyle.class,
xParaStyleCollection.getByName( sElementNames[iCounter] ));
-
+
// create a property set of all properties from the style
xPropertySet = (com.sun.star.beans.XPropertySet) UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xStyle );
-
+
AnyConverter aAnyConv = new AnyConverter();
String sFontname = aAnyConv.toString(xPropertySet.getPropertyValue("CharFontName"));
sFontname = sFontname.toLowerCase();
-
+
// if the style use the font 'Albany', apply it to the current paragraph
if( sFontname.compareTo("albany") == 0 ) {
// create a property set from the current paragraph, to change the paragraph style
xPropertySet = (com.sun.star.beans.XPropertySet) UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xTextRange );
-
+
// To run the sample with StarOffice 5.2 you'll have to change 'ParaStyleName'
// to 'ParaStyle' in the next line
xPropertySet.setPropertyValue("ParaStyleName", new String( sElementNames[iCounter] ) );
@@ -230,24 +230,24 @@ public class StyleInitialization {
catch( Exception e) {
e.printStackTrace(System.err);
}
-
-
+
+
System.out.println("Done");
-
+
System.exit(0);
-
+
}
-
+
public static com.sun.star.frame.XDesktop getDesktop() {
com.sun.star.frame.XDesktop xDesktop = null;
com.sun.star.lang.XMultiComponentFactory xMCF = null;
-
+
try {
com.sun.star.uno.XComponentContext xContext = null;
-
+
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
-
+
// get the remote office service manager
xMCF = xContext.getServiceManager();
if( xMCF != null ) {
@@ -265,16 +265,16 @@ public class StyleInitialization {
e.printStackTrace(System.err);
System.exit(1);
}
-
-
+
+
return xDesktop;
}
-
+
public static com.sun.star.text.XTextDocument createTextdocument(
com.sun.star.frame.XDesktop xDesktop )
{
com.sun.star.text.XTextDocument aTextDocument = null;
-
+
try {
com.sun.star.lang.XComponent xComponent = CreateNewDocument(xDesktop,
"swriter");
@@ -285,36 +285,36 @@ public class StyleInitialization {
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
return aTextDocument;
}
-
-
+
+
protected static com.sun.star.lang.XComponent CreateNewDocument(
com.sun.star.frame.XDesktop xDesktop,
String sDocumentType )
{
String sURL = "private:factory/" + sDocumentType;
-
+
com.sun.star.lang.XComponent xComponent = null;
com.sun.star.frame.XComponentLoader xComponentLoader = null;
com.sun.star.beans.PropertyValue xValues[] =
new com.sun.star.beans.PropertyValue[1];
com.sun.star.beans.PropertyValue xEmptyArgs[] =
new com.sun.star.beans.PropertyValue[0];
-
+
try {
xComponentLoader = (com.sun.star.frame.XComponentLoader)
UnoRuntime.queryInterface(
com.sun.star.frame.XComponentLoader.class, xDesktop);
-
+
xComponent = xComponentLoader.loadComponentFromURL(
sURL, "_blank", 0, xEmptyArgs);
}
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
return xComponent ;
}
}
diff --git a/odk/examples/java/Text/TextDocumentStructure.java b/odk/examples/java/Text/TextDocumentStructure.java
index f60ce98c937d..1d91f6f1f44c 100644
--- a/odk/examples/java/Text/TextDocumentStructure.java
+++ b/odk/examples/java/Text/TextDocumentStructure.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.
- *
+ *
*************************************************************************/
//***************************************************************************
@@ -42,10 +42,10 @@
import com.sun.star.uno.UnoRuntime;
public class TextDocumentStructure {
-
+
public static void main(String args[]) {
com.sun.star.uno.XComponentContext xContext = null;
-
+
try {
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
@@ -70,7 +70,7 @@ public class TextDocumentStructure {
String strDoc = "private:factory/swriter";
System.out.println("create new text document");
-
+
com.sun.star.lang.XComponent xComp = xCLoader.loadComponentFromURL(
strDoc, "_blank", 0, szEmptyArgs);
@@ -81,16 +81,16 @@ public class TextDocumentStructure {
// create some example data
com.sun.star.text.XText xText = xTextDocument.getText();
- createExampleData( xText );
-
+ createExampleData( xText );
+
// Begin section 'The structure of text documents' of the Tutorial
-
+
com.sun.star.container.XEnumeration xParagraphEnumeration = null;
com.sun.star.container.XEnumerationAccess xParaEnumerationAccess = null;
com.sun.star.container.XEnumeration xPortionEnumeration = null;
com.sun.star.container.XEnumeration xTextPortionEnum;
com.sun.star.text.XTextContent xTextElement = null;
-
+
System.out.println("create an enumeration of all paragraphs");
// create an enumeration access of all paragraphs of a document
com.sun.star.container.XEnumerationAccess xEnumerationAccess =
@@ -98,7 +98,7 @@ public class TextDocumentStructure {
UnoRuntime.queryInterface(
com.sun.star.container.XEnumerationAccess.class, xText);
xParagraphEnumeration = xEnumerationAccess.createEnumeration();
-
+
// Loop through all paragraphs of the document
while ( xParagraphEnumeration.hasMoreElements() ) {
xTextElement = (com.sun.star.text.XTextContent)
@@ -108,14 +108,14 @@ public class TextDocumentStructure {
com.sun.star.lang.XServiceInfo xServiceInfo =
(com.sun.star.lang.XServiceInfo)UnoRuntime.queryInterface(
com.sun.star.lang.XServiceInfo.class, xTextElement);
-
+
// check ifs the current paragraph really a paragraph or an
// anchor of a frame or picture
if( xServiceInfo.supportsService("com.sun.star.text.Paragraph") ) {
com.sun.star.text.XTextRange xTextRange =
xTextElement.getAnchor();
System.out.println( "This is a Paragraph" );
-
+
// create another enumeration to get all text portions of
// the paragraph
xParaEnumerationAccess =
@@ -124,7 +124,7 @@ public class TextDocumentStructure {
com.sun.star.container.XEnumerationAccess.class,
xTextElement);
xTextPortionEnum = xParaEnumerationAccess.createEnumeration();
-
+
while ( xTextPortionEnum.hasMoreElements() ) {
com.sun.star.text.XTextRange xTextPortion =
(com.sun.star.text.XTextRange)UnoRuntime.queryInterface(
@@ -132,7 +132,7 @@ public class TextDocumentStructure {
xTextPortionEnum.nextElement());
System.out.println( "Text from the portion : "
+ xTextPortion.getString() );
-
+
com.sun.star.beans.XPropertySet xPropertySet =
(com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(
@@ -140,22 +140,22 @@ public class TextDocumentStructure {
xTextPortion);
System.out.println( "Name of the font : "
+ xPropertySet.getPropertyValue( "CharFontName" ) );
-
+
// PropertyState status of each text portion.
com.sun.star.beans.XPropertyState xPropertyState =
(com.sun.star.beans.XPropertyState)
UnoRuntime.queryInterface(
com.sun.star.beans.XPropertyState.class,
xTextPortion);
-
+
if( xPropertyState.getPropertyState("CharWeight").equals(
com.sun.star.beans.PropertyState.AMBIGUOUS_VALUE) )
System.out.println( "- The text range contains more than one different attributes" );
-
+
if( xPropertyState.getPropertyState( "CharWeight" ).equals(
com.sun.star.beans.PropertyState.DIRECT_VALUE ) )
System.out.println( " - The text range contains hard formats" );
-
+
if( xPropertyState.getPropertyState( "CharWeight" ).equals(
com.sun.star.beans.PropertyState.DEFAULT_VALUE ) )
System.out.println( " - The text range doesn't contains hard formats" );
@@ -170,36 +170,36 @@ public class TextDocumentStructure {
e.printStackTrace(System.err);
System.exit(1);
}
-
+
System.out.println("done");
System.exit(0);
}
-
+
public static void createExampleData( com.sun.star.text.XText xText ) {
-
+
try {
xText.setString( "This is an example sentence" );
-
+
com.sun.star.text.XWordCursor xWordCursor =
(com.sun.star.text.XWordCursor)UnoRuntime.queryInterface(
com.sun.star.text.XWordCursor.class, xText.getStart());
-
+
xWordCursor.gotoNextWord(false);
xWordCursor.gotoNextWord(false);
xWordCursor.gotoEndOfWord(true);
-
+
com.sun.star.beans.XPropertySet xPropertySet =
(com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xWordCursor );
xPropertySet.setPropertyValue("CharWeight",
new Float( com.sun.star.awt.FontWeight.BOLD ));
-
+
System.out.println("create example data");
}
catch( Exception e) {
e.printStackTrace(System.err);
}
-
-
+
+
}
}
diff --git a/odk/examples/java/Text/TextReplace.java b/odk/examples/java/Text/TextReplace.java
index 980b955e990f..0194d79b9825 100644
--- a/odk/examples/java/Text/TextReplace.java
+++ b/odk/examples/java/Text/TextReplace.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.
- *
+ *
*************************************************************************/
//***************************************************************************
@@ -43,37 +43,37 @@
import com.sun.star.uno.UnoRuntime;
public class TextReplace {
-
+
public static void main(String args[]) {
// You need the desktop to create a document
// The getDesktop method does the UNO bootstrapping, gets the
// remote servie manager and the desktop object.
com.sun.star.frame.XDesktop xDesktop = null;
xDesktop = getDesktop();
-
+
com.sun.star.text.XTextDocument xTextDocument =
createTextdocument( xDesktop );
createExampleData( xTextDocument );
-
+
String mBritishWords[] = {"colour", "neighbour", "centre", "behaviour",
"metre", "through" };
String mUSWords[] = { "color", "neighbor", "center", "behavior",
- "meter", "thru" };
-
+ "meter", "thru" };
+
try {
com.sun.star.util.XReplaceDescriptor xReplaceDescr = null;
com.sun.star.util.XSearchDescriptor xSearchDescriptor = null;
com.sun.star.util.XReplaceable xReplaceable = null;
-
+
xReplaceable = (com.sun.star.util.XReplaceable)
UnoRuntime.queryInterface(
com.sun.star.util.XReplaceable.class, xTextDocument);
-
+
// You need a descriptor to set properies for Replace
xReplaceDescr = (com.sun.star.util.XReplaceDescriptor)
xReplaceable.createReplaceDescriptor();
-
+
System.out.println("Change all occurrences of ...");
for( int iArrayCounter = 0; iArrayCounter < mBritishWords.length;
iArrayCounter++ )
@@ -83,37 +83,37 @@ public class TextReplace {
// Set the properties the replace method need
xReplaceDescr.setSearchString(mBritishWords[iArrayCounter] );
xReplaceDescr.setReplaceString(mUSWords[iArrayCounter] );
-
+
// Replace all words
xReplaceable.replaceAll( xReplaceDescr );
}
-
+
}
catch( Exception e) {
e.printStackTrace(System.err);
- }
-
+ }
+
System.out.println("Done");
-
+
System.exit(0);
-
+
}
-
+
protected static void createExampleData(
com.sun.star.text.XTextDocument xTextDocument )
{
// Create textdocument and insert example text
com.sun.star.text.XTextCursor xTextCursor = null;
-
+
try {
xTextCursor = (com.sun.star.text.XTextCursor)
xTextDocument.getText().createTextCursor();
com.sun.star.text.XText xText = (com.sun.star.text.XText)
xTextDocument.getText();
-
+
xText.insertString( xTextCursor,
"He nervously looked all around. Suddenly he saw his ", false );
-
+
xText.insertString( xTextCursor, "neighbour ", true );
com.sun.star.beans.XPropertySet xCPS = (com.sun.star.beans.XPropertySet)
UnoRuntime.queryInterface(
@@ -123,9 +123,9 @@ public class TextReplace {
// Go to last character
xTextCursor.gotoEnd(false);
xCPS.setPropertyValue( "CharColor", new Integer( 0 ) );
-
+
xText.insertString( xTextCursor, "in the alley. Like lightening he darted off to the left and disappeared between the two warehouses almost falling over the trash can lying in the ", false );
-
+
xText.insertString( xTextCursor, "centre ", true );
xCPS = (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface(
com.sun.star.beans.XPropertySet.class, xTextCursor);
@@ -134,31 +134,31 @@ public class TextReplace {
// Go to last character
xTextCursor.gotoEnd(false);
xCPS.setPropertyValue( "CharColor", new Integer( 0 ) );
-
+
xText.insertString( xTextCursor, "of the sidewalk.", false );
-
+
xText.insertControlCharacter( xTextCursor,
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false );
xText.insertString( xTextCursor, "He tried to nervously tap his way along in the inky darkness and suddenly stiffened: it was a dead-end, he would have to go back the way he had come.", false );
-
+
xTextCursor.gotoStart(false);
}
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
}
-
+
public static com.sun.star.frame.XDesktop getDesktop() {
com.sun.star.frame.XDesktop xDesktop = null;
com.sun.star.lang.XMultiComponentFactory xMCF = null;
-
+
try {
com.sun.star.uno.XComponentContext xContext = null;
-
+
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
-
+
// get the remote office service manager
xMCF = xContext.getServiceManager();
if( xMCF != null ) {
@@ -176,16 +176,16 @@ public class TextReplace {
e.printStackTrace(System.err);
System.exit(1);
}
-
-
+
+
return xDesktop;
}
-
+
public static com.sun.star.text.XTextDocument createTextdocument(
com.sun.star.frame.XDesktop xDesktop )
{
com.sun.star.text.XTextDocument aTextDocument = null;
-
+
try {
com.sun.star.lang.XComponent xComponent = CreateNewDocument(xDesktop,
"swriter");
@@ -196,36 +196,36 @@ public class TextReplace {
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
return aTextDocument;
}
-
-
+
+
protected static com.sun.star.lang.XComponent CreateNewDocument(
com.sun.star.frame.XDesktop xDesktop,
String sDocumentType )
{
String sURL = "private:factory/" + sDocumentType;
-
+
com.sun.star.lang.XComponent xComponent = null;
com.sun.star.frame.XComponentLoader xComponentLoader = null;
com.sun.star.beans.PropertyValue xValues[] =
new com.sun.star.beans.PropertyValue[1];
com.sun.star.beans.PropertyValue xEmptyArgs[] =
new com.sun.star.beans.PropertyValue[0];
-
+
try {
xComponentLoader = (com.sun.star.frame.XComponentLoader)
UnoRuntime.queryInterface(
com.sun.star.frame.XComponentLoader.class, xDesktop);
-
+
xComponent = xComponentLoader.loadComponentFromURL(
sURL, "_blank", 0, xEmptyArgs);
}
catch( Exception e) {
e.printStackTrace(System.err);
}
-
+
return xComponent ;
}
}
diff --git a/odk/examples/java/Text/WriterSelector.java b/odk/examples/java/Text/WriterSelector.java
index 6fd00189d657..5c90aabc62dd 100644
--- a/odk/examples/java/Text/WriterSelector.java
+++ b/odk/examples/java/Text/WriterSelector.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 @@ public class WriterSelector {
*/
public static void main(String args[]) {
com.sun.star.uno.XComponentContext xContext = null;
-
+
try {
// bootstrap UNO and get the remote component context. The context can
@@ -54,14 +54,14 @@ public class WriterSelector {
// get the remote office service manager
com.sun.star.lang.XMultiComponentFactory xMCF =
- xContext.getServiceManager();
-
+ xContext.getServiceManager();
+
// get a new instance of the desktop
com.sun.star.frame.XDesktop xDesktop = (com.sun.star.frame.XDesktop)
UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class,
xMCF.createInstanceWithContext("com.sun.star.frame.Desktop",
xContext ) );
-
+
com.sun.star.frame.XComponentLoader xCompLoader =
(com.sun.star.frame.XComponentLoader)UnoRuntime.queryInterface(
com.sun.star.frame.XComponentLoader.class, xDesktop);
@@ -76,15 +76,15 @@ public class WriterSelector {
xDoc.getText().setString("Please select something in this text and press then \"return\" in the shell where you have started the example.\n");
// 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);
-
+
com.sun.star.view.XViewSettingsSupplier xViewSettings =
(com.sun.star.view.XViewSettingsSupplier)UnoRuntime.queryInterface(
com.sun.star.view.XViewSettingsSupplier.class, xModel.getCurrentController());
xViewSettings.getViewSettings().setPropertyValue(
- "ZoomType", new Short((short)0));
+ "ZoomType", new Short((short)0));
}
// test document will be closed later
@@ -93,23 +93,23 @@ public class WriterSelector {
do{
c = (char) System.in.read();
}while ((c != 13) && (c != 10));
-
+
// Getting the current frame from the OpenOffice.org Server.
com.sun.star.frame.XFrame xframe = xDesktop.getCurrentFrame();
-
+
// Getting the controller.
com.sun.star.frame.XController xController = xframe.getController();
-
+
com.sun.star.view.XSelectionSupplier xSelSupplier =
(com.sun.star.view.XSelectionSupplier)UnoRuntime.queryInterface(
com.sun.star.view.XSelectionSupplier.class, xController );
-
+
Object oSelection = xSelSupplier.getSelection();
-
+
com.sun.star.lang.XServiceInfo xServInfo =
(com.sun.star.lang.XServiceInfo)UnoRuntime.queryInterface(
com.sun.star.lang.XServiceInfo.class, oSelection );
-
+
if ( xServInfo.supportsService("com.sun.star.text.TextRanges") )
{
com.sun.star.container.XIndexAccess xIndexAccess =
@@ -123,17 +123,17 @@ public class WriterSelector {
UnoRuntime.queryInterface(
com.sun.star.text.XTextRange.class,
xIndexAccess.getByIndex(i));
-
+
System.out.println( "You have selected a text range: \""
+ xTextRange.getString() + "\"." );
}
}
-
+
if ( xServInfo.supportsService("com.sun.star.text.TextGraphicObject") )
{
System.out.println( "You have selected a graphics." );
}
-
+
if ( xServInfo.supportsService("com.sun.star.text.TextTableCursor") )
{
System.out.println( "You have selected a text table." );
@@ -150,8 +150,8 @@ public class WriterSelector {
} else
{
xComponent.dispose();
- }
-
+ }
+
System.exit(0);
}
catch( Exception e ) {
diff --git a/odk/examples/java/ToDo/ToDo.idl b/odk/examples/java/ToDo/ToDo.idl
index 3aa45ccf4448..317671d1bf7e 100644
--- a/odk/examples/java/ToDo/ToDo.idl
+++ b/odk/examples/java/ToDo/ToDo.idl
@@ -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.
- *
+ *
*************************************************************************/
#ifndef INCLUDED_ORG_OPENOFFICE_TODO_IDL
diff --git a/odk/examples/java/ToDo/ToDo.java b/odk/examples/java/ToDo/ToDo.java
index 87257c406903..df6310b360d3 100644
--- a/odk/examples/java/ToDo/ToDo.java
+++ b/odk/examples/java/ToDo/ToDo.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.lib.uno.helper.Factory;
@@ -78,17 +78,17 @@ import java.util.Arrays;
* (<CODE>__writeRegistryServiceInfo</CODE>).
*/
public class ToDo {
-
+
/** This class implements the component. At least the interfaces
* XInterface, XTypeProvider, and XWeak implemented by the helper class
* WeakBase and XServiceInfo should be provided by the service.
*/
public static class ToDoImpl extends WeakBase implements XServiceInfo, XToDo {
-
+
/** The service name, that must be used to get an instance of this service.
*/
private static final String __serviceName = "org.openoffice.ToDo";
-
+
/** The initial component contextr, that gives access to
* the service manager, supported singletons, ...
* It's often later used
@@ -110,28 +110,28 @@ public class ToDo {
static private final int INT_COLUMN_END_DAY_OF_WEEK = 6;
static private final int INT_COLUMN_DUEDATE = 7;
static private final int INT_COLUMN_STATUS = 8;
-
+
static private final int INT_ROW_FROM = 14; // 8
-
+
static private final int INT_ROW_HOLIDAYS_START = 4;
static private final int INT_COLUMN_HOLIDAYS_START = 7; // 10
-
+
static private final String STRING_SEPARATOR = "/";
-
+
/** The constructor of the inner class has a XComponenContext parameter.
* @param xCompContext the initial component context
*/
public ToDoImpl(XComponentContext xCompContext) {
try {
m_cmpCtx = xCompContext;
- m_xMCF = m_cmpCtx.getServiceManager();
+ m_xMCF = m_cmpCtx.getServiceManager();
}
catch( Exception e ) {
e.printStackTrace(System.err);
}
}
-
+
/** This method returns an array of all supported service names.
* @return Array of supported service names.
*/
@@ -142,8 +142,8 @@ public class ToDo {
public static String[] getServiceNames() {
String[] sSupportedServiceNames = { __serviceName };
return sSupportedServiceNames;
- }
-
+ }
+
/** This method returns true, if the given service will be
* supported by the component.
* @param sService Service name.
@@ -152,14 +152,14 @@ public class ToDo {
public boolean supportsService(String sServiceName) {
return sServiceName.equals( __serviceName );
}
-
+
/** Return the class name of the component.
* @return Class name of the component.
*/
public String getImplementationName() {
return ToDoImpl.class.getName();
}
-
+
/** For every bug/feature listed in a spreadsheet document this method
* calculates the start date, day of week of the start date, the end date
* and the day of week of the end date. All calculations are dependent
@@ -181,74 +181,74 @@ public class ToDo {
XSpreadsheetDocument xspreadsheetdocument =
( XSpreadsheetDocument ) UnoRuntime.queryInterface(
XSpreadsheetDocument.class, aInstance );
-
+
// Querying for the interface XIndexAccess
XIndexAccess xindexaccess = ( XIndexAccess )
UnoRuntime.queryInterface( XIndexAccess.class,
xspreadsheetdocument.getSheets() );
-
+
// Getting the first XSpreadsheet
XSpreadsheet xspreadsheet = (XSpreadsheet)UnoRuntime.queryInterface(
XSpreadsheet.class, xindexaccess.getByIndex( 0 ));
-
+
// Querying for the interface XCellRange on the XSpeadsheet
XCellRange xcellrange = ( XCellRange )
UnoRuntime.queryInterface( XCellRange.class, xspreadsheet );
-
+
/* Getting the gregorian calendar with the date on which to start
the calculation */
GregorianCalendar gregCalAbsoluteStartDate =
this.getGregorianCalendarFromString(this.getStringFromCell(
xcellrange, 5, 2 ) );
gregCalAbsoluteStartDate.add( Calendar.DATE, -1 );
-
+
// Set the start date with the absolute start date
GregorianCalendar gregCalStartDate =
(GregorianCalendar) gregCalAbsoluteStartDate.clone();
-
+
/* Creating the service FunctionAccess, which allows generic
access to all spreadsheet functions */
Object objectFunctionAccess =
m_xMCF.createInstanceWithContext(
"com.sun.star.sheet.FunctionAccess", m_cmpCtx );
-
+
// Querying for the interface XFunctionAccess on service
// FunctionAccess
XFunctionAccess xfunctionaccess = (XFunctionAccess)
UnoRuntime.queryInterface(XFunctionAccess.class,
objectFunctionAccess );
-
+
// Creating vector for holidays
Vector vectorHolidays = new Vector();
-
+
// Get the Official Holidays
this.getOfficialHolidays( vectorHolidays, xcellrange,
xfunctionaccess,
gregCalStartDate.get(
Calendar.YEAR ) );
-
+
// Get the private holidays
this.getPrivateHolidays(vectorHolidays, xcellrange,
xfunctionaccess);
-
+
// Getting the object array of holidays
Object[] objectSortedHolidays = vectorHolidays.toArray();
-
+
// Sorting the holidays
Arrays.sort( objectSortedHolidays );
-
+
// Collect the Official Holidays and the private holidays
Object [][]objectHolidays =
new Object[][] { objectSortedHolidays };
-
+
// Row index
int intRowTo = this.INT_ROW_FROM - 1;
-
+
// Getting the feature of the first cell
String sFeature = this.getStringFromCell(xcellrange,
intRowTo + 1,
this.INT_COLUMN_FEATURE);
-
+
// Determine the last row with an entry in the first column
while ( ( sFeature != null ) &&
( !sFeature.equals( "" ) ) ) {
@@ -256,10 +256,10 @@ public class ToDo {
sFeature = this.getStringFromCell( xcellrange,
intRowTo + 1, this.INT_COLUMN_FEATURE );
}
-
+
// Setting the last row to be calculated
final int INT_ROW_TO = intRowTo + 1;
-
+
// Deleting cells which will be recalculated
for ( int intRow = this.INT_ROW_FROM; intRow < INT_ROW_TO + 5;
intRow++ ) {
@@ -269,11 +269,11 @@ public class ToDo {
this.setStringToCell(xcellrange, intRow, intColumn, "");
}
}
-
+
/* Clearing the background color of the due date cells and setting
the hyperlink to the bugtracker */
for (int intRow = this.INT_ROW_FROM; intRow < INT_ROW_TO; intRow++)
- {
+ {
// Querying for the interface XPropertySet for the cell
// providing the due date
XPropertySet xpropertyset = ( XPropertySet )
@@ -281,73 +281,73 @@ public class ToDo {
xcellrange.getCellByPosition(
this.INT_COLUMN_DUEDATE,
intRow ));
-
+
// Changing the background color of the cell to white
xpropertyset.setPropertyValue( "CellBackColor",
new Integer( 16777215 ) );
-
+
// Getting the cell of the bug id
XCell xcell = xcellrange.getCellByPosition(
this.INT_COLUMN_FEATURE, intRow );
-
+
// Querying for the interface XSimpleText
XSimpleText xsimpletext = ( XSimpleText )
UnoRuntime.queryInterface( XSimpleText.class, xcell );
-
+
// Getting the text cursor
XTextCursor xtextcursor = xsimpletext.createTextCursor();
-
+
// Querying for the interface XTextRange
XTextRange xtextrange = ( XTextRange )
UnoRuntime.queryInterface( XTextRange.class, xtextcursor );
-
+
// Getting the bug ID from the cell
- String sBugID = xtextrange.getString();
+ String sBugID = xtextrange.getString();
if ( !sBugID.startsWith(
"http://www.openoffice.org/issues/show_bug.cgi?id=") ) {
String sBugIDLink =
"http://www.openoffice.org/issues/show_bug.cgi?id=" + sBugID;
-
+
// Querying for the interface XMultiServiceFactory
XMultiServiceFactory xMSFTextField =
(XMultiServiceFactory)UnoRuntime.queryInterface(
XMultiServiceFactory.class, aInstance );
-
+
// Creating an instance of the text field URL
Object objectTextField =
xMSFTextField.createInstance(
"com.sun.star.text.TextField.URL" );
-
+
// Querying for the interface XTextField
XTextField xtextfield = ( XTextField )
UnoRuntime.queryInterface( XTextField.class,
objectTextField );
-
+
// Querying for the interface XPropertySet
XPropertySet xpropertysetTextField = ( XPropertySet )
UnoRuntime.queryInterface( XPropertySet.class,
xtextfield );
-
+
// Setting the URL
xpropertysetTextField.setPropertyValue( "URL",
sBugIDLink );
-
+
// Setting the representation of the URL
xpropertysetTextField.setPropertyValue( "Representation",
sBugID );
-
+
// Querying for the interface XText
XText xtext = ( XText )UnoRuntime.queryInterface(
XText.class, xcell );
-
+
// Delete cell content
xtextrange.setString( "" );
-
+
// Inserting the text field URL to the cell
xtext.insertTextContent( xtextrange, xtextfield, false );
}
}
-
+
// Processing all features/bugs in the table
for (int intRow = this.INT_ROW_FROM; intRow < INT_ROW_TO; intRow++)
{
@@ -358,11 +358,11 @@ public class ToDo {
// Getting the number of needed days to perform the feature
int intNeededDays = (int) Math.round( xcell.getValue() );
-
+
// Getting the content of a specified cell
String sStatus = this.getStringFromCell( xcellrange,
intRow, this.INT_COLUMN_STATUS );
-
+
/* Testing if the number of needed days is greater than
zero and if
the status is not "done" */
@@ -373,54 +373,54 @@ public class ToDo {
gregCalStartDate = this.getWorkday(
gregCalStartDate, 1, objectHolidays,
xfunctionaccess );
-
+
// Getting a string with the date format jjjj-mm-dd from
// the gregorian calendar
String sDate = this.getStringFromGregorianCalendar(
gregCalStartDate );
-
+
// Set the start date in the specified cell of the table
this.setStringToCell(xcellrange, intRow,
this.INT_COLUMN_STARTDATE, sDate);
-
+
// For the start day set the day of week in the specified
// cell of the table
this.setDayOfWeek( gregCalStartDate,
xcellrange, intRow,
this.INT_COLUMN_START_DAY_OF_WEEK );
-
+
// Getting the end date after a specified number of workdays
GregorianCalendar gregCalEndDate =
this.getWorkday( gregCalStartDate,
intNeededDays - 1,
objectHolidays, xfunctionaccess );
-
+
// Creating a string with the date format jjjj-mm-dd
sDate = this.getStringFromGregorianCalendar(
gregCalEndDate );
-
+
// Set the end date in the specified cell of the table
this.setStringToCell( xcellrange, intRow,
this.INT_COLUMN_ENDDATE, sDate );
-
+
// For the end day set the day of week in the specified
// cell of the table
this.setDayOfWeek(gregCalEndDate, xcellrange,
intRow, this.INT_COLUMN_END_DAY_OF_WEEK);
-
+
// Set the initial date for the next loop
gregCalStartDate = ( GregorianCalendar )
gregCalEndDate.clone();
-
+
// Get the due date from the table
String sDueDate = this.getStringFromCell(
xcellrange, intRow, this.INT_COLUMN_DUEDATE );
-
+
// Testing if the due date is not empty
if ( !sDueDate.equals( "" ) ) {
GregorianCalendar gregCalDueDate =
this.getGregorianCalendarFromString(sDueDate);
-
+
// Testing if the due date is before the calculated
// end date
if ( gregCalDueDate.before(
@@ -433,10 +433,10 @@ public class ToDo {
-( intNeededDays - 1 ),
objectHolidays,
xfunctionaccess);
-
+
// Begin with the current row
int intRowToInsert = intRow;
-
+
// Get the start date for the feature/bug in the
// current row
GregorianCalendar gregCalPreviousStartDate =
@@ -444,7 +444,7 @@ public class ToDo {
this.getStringFromCell(
xcellrange, intRowToInsert,
this.INT_COLUMN_STARTDATE ) );
-
+
// Testing if we have to search for an earlier date
// to begin
while ((gregCalLatestDateToStart.before(
@@ -452,32 +452,32 @@ public class ToDo {
(INT_ROW_FROM != intRowToInsert)) {
// Decrease the row
intRowToInsert--;
-
+
// Get the start date for the feature/bug in
// the current row
String sStartDate = this.getStringFromCell(
xcellrange, intRowToInsert,
this.INT_COLUMN_STARTDATE );
-
+
// Search until a valid start date is found
while ( sStartDate.equals( "" ) ) {
// Decrease the row
intRowToInsert--;
-
+
// Get the start date for the feature/bug
// in the current row
sStartDate = this.getStringFromCell(
xcellrange, intRowToInsert,
this.INT_COLUMN_STARTDATE );
}
-
+
// Get the GregorianCalender format for the
// start date
gregCalPreviousStartDate =
this.getGregorianCalendarFromString(
sStartDate );
}
-
+
// Getting the cell of the column "Needed Days"
// in the row where to insert
XCell xcellNeededDaysWhereToInsert =
@@ -488,25 +488,25 @@ public class ToDo {
int intNeededDaysWhereToInsert = (int)
Math.round(
xcellNeededDaysWhereToInsert.getValue());
-
+
GregorianCalendar gregCalPreviousNewEndDate =
this.getWorkday(gregCalPreviousStartDate,
intNeededDays - 1 +
intNeededDaysWhereToInsert,
objectHolidays,
- xfunctionaccess);
+ xfunctionaccess);
String sPreviousDueDate = this.getStringFromCell(
xcellrange, intRowToInsert,
this.INT_COLUMN_DUEDATE );
-
+
GregorianCalendar gregCalPreviousDueDate = null;
-
+
if ( !sPreviousDueDate.equals( "" ) ) {
gregCalPreviousDueDate =
this.getGregorianCalendarFromString(
sPreviousDueDate );
}
-
+
if ( ( intRowToInsert == intRow ) ||
( gregCalPreviousNewEndDate.after(
gregCalPreviousDueDate ) ) ) {
@@ -518,7 +518,7 @@ public class ToDo {
xcellrange.getCellByPosition(
this.INT_COLUMN_DUEDATE,
intRow ) );
-
+
// Changing the background color of the cell
// to red
xpropertyset.setPropertyValue(
@@ -533,19 +533,19 @@ public class ToDo {
XTableRows xTableRows =
xcolumnrowrange.getRows();
xTableRows.insertByIndex( intRowToInsert, 1 );
-
+
// Querying for the interface
// XCellRangeMovement on XCellRange
XCellRangeMovement xcellrangemovement =
(XCellRangeMovement)UnoRuntime.queryInterface(
XCellRangeMovement.class, xcellrange );
-
+
// Creating the cell address of the destination
CellAddress celladdress = new CellAddress();
celladdress.Sheet = 0;
celladdress.Column = 0;
celladdress.Row = intRowToInsert;
-
+
// Creating the cell range of the source
CellRangeAddress cellrangeaddress =
new CellRangeAddress();
@@ -554,20 +554,20 @@ public class ToDo {
cellrangeaddress.StartRow = intRow + 1;
cellrangeaddress.EndColumn = 8;
cellrangeaddress.EndRow = intRow + 1;
-
+
// Moves the cell range to another position in
// the document
xcellrangemovement.moveRange(celladdress,
cellrangeaddress);
-
+
// Removing the row not needed anymore
xcolumnrowrange.getRows().removeByIndex(intRow
+ 1, 1);
-
+
// Set the current row, because we want to
// recalculate all rows below
intRow = intRowToInsert - 1;
-
+
// Tests at which line we want to insert
if ( intRow >= this.INT_ROW_FROM ) {
// Get the start date
@@ -591,8 +591,8 @@ public class ToDo {
catch( Exception exception ) {
showExceptionMessage( exception );
}
- }
-
+ }
+
/** Getting a string from a gregorian calendar.
* @param gregCal Date to be converted.
* @return string (converted gregorian calendar).
@@ -602,45 +602,45 @@ public class ToDo {
+ STRING_SEPARATOR + gregCal.get( Calendar.DATE )
// + STRING_SEPARATOR + ( gregCal.get( Calendar.MONTH ) + 1 )
+ STRING_SEPARATOR + gregCal.get( Calendar.YEAR );
-
+
return sDate;
}
-
+
/** Getting a GregorianCalendar from a string.
* @param sDate String to be converted.
* @return The result of the converting of the string.
*/
public GregorianCalendar getGregorianCalendarFromString( String sDate ) {
int []intDateValue = this.getDateValuesFromString( sDate );
-
+
return( new GregorianCalendar( intDateValue[ 2 ], intDateValue[ 0 ],
intDateValue[ 1 ] ) );
}
-
+
/** Getting the day, month and year from a string.
* @param sDate String to be parsed.
* @return Returns an array of integer variables.
*/
public int[] getDateValuesFromString( String sDate) {
int[] intDateValues = new int[ 3 ];
-
+
int intPositionFirstTag = sDate.indexOf( STRING_SEPARATOR );
int intPositionSecondTag = sDate.indexOf(STRING_SEPARATOR,
intPositionFirstTag + 1);
-
+
// Getting the value of the month
intDateValues[ 0 ] = Integer.parseInt(
sDate.substring(0, intPositionFirstTag)) - 1;
// Getting the value of the day
intDateValues[ 1 ] = Integer.parseInt(
- sDate.substring(intPositionFirstTag + 1, intPositionSecondTag));
+ sDate.substring(intPositionFirstTag + 1, intPositionSecondTag));
// Getting the value of the year
intDateValues[ 2 ] = Integer.parseInt(
sDate.substring(intPositionSecondTag + 1, sDate.length()));
-
+
return intDateValues;
}
-
+
/** Getting a content from a specified cell.
* @param xcellrange Providing access to cells.
* @param intRow Number of row.
@@ -650,7 +650,7 @@ public class ToDo {
public String getStringFromCell( XCellRange xcellrange, int intRow,
int intColumn ) {
XTextRange xtextrangeStartDate = null;
-
+
try {
// Getting the cell holding the information about the start date
XCell xcellStartDate = xcellrange.getCellByPosition(intColumn,
@@ -662,11 +662,11 @@ public class ToDo {
catch( Exception exception ) {
this.showExceptionMessage( exception );
}
-
+
// Getting the start date
return xtextrangeStartDate.getString().trim();
}
-
+
/** Writing a specified string to a specified cell.
* @param xcellrange Providing access to the cells.
* @param intRow Number of row.
@@ -689,7 +689,7 @@ public class ToDo {
this.showExceptionMessage( exception );
}
}
-
+
/** Calculates the week of day and calls the method "setStringToCell".
* @param gregCal Day to be written to the cell.
* @param xcellrange Providing access to the cells.
@@ -712,11 +712,11 @@ public class ToDo {
} else if ( intDayOfWeek == Calendar.FRIDAY ) {
sDayOfWeek = "FRI";
}
-
+
this.setStringToCell( xcellrange, intRow, intColumn,
sDayOfWeek );
}
-
+
/** Calculates the dates of the official holidays with help of Calc
* functions.
* @param vectorHolidays Holding all holidays.
@@ -738,15 +738,15 @@ public class ToDo {
intNumberOfYear <= ( intHowManyYears - 1 );
intNumberOfYear++ ) {
intYear += intNumberOfYear;
-
+
// Getting the Easter sunday
Double dEasterSunday = ( Double )
xfunctionaccess.callFunction(
"EASTERSUNDAY", new Object[] { new Integer(intYear) });
-
+
int intEasterSunday = (int)Math.round(
dEasterSunday.doubleValue());
-
+
// New-year
vectorHolidays.addElement( xfunctionaccess.callFunction(
"DATE",
@@ -754,15 +754,15 @@ public class ToDo {
new Integer( intYear ),
new Integer( 1 ),
new Integer( 1 ) } ));
-
+
// Good Friday
vectorHolidays.addElement(
new Double( intEasterSunday - 2 ) );
-
+
// Easter monday
vectorHolidays.addElement(
new Double( intEasterSunday + 1 ) );
-
+
// Labour Day
vectorHolidays.addElement( xfunctionaccess.callFunction(
"DATE",
@@ -770,13 +770,13 @@ public class ToDo {
new Integer( intYear ),
new Integer( 5 ),
new Integer( 1 ) } ));
-
+
// Ascension Day
vectorHolidays.addElement(new Double(intEasterSunday + 39 ));
-
+
// Pentecost monday
vectorHolidays.addElement(new Double(intEasterSunday + 50 ));
-
+
// German Unification
vectorHolidays.addElement( xfunctionaccess.callFunction(
"DATE",
@@ -784,7 +784,7 @@ public class ToDo {
new Integer( intYear ),
new Integer( 10 ),
new Integer( 3 ) } ));
-
+
// Christmas Day First
vectorHolidays.addElement( xfunctionaccess.callFunction(
"DATE",
@@ -792,7 +792,7 @@ public class ToDo {
new Integer( intYear ),
new Integer( 12 ),
new Integer( 25 ) } ));
-
+
// Christmas Day Second
vectorHolidays.addElement( xfunctionaccess.callFunction(
"DATE",
@@ -806,7 +806,7 @@ public class ToDo {
this.showExceptionMessage( exception );
}
}
-
+
/** Returns the serial number of the date before or after a specified
* number of workdays.
* @param gregCalStartDate Date to start with the calculation.
@@ -821,7 +821,7 @@ public class ToDo {
int intDays, Object[][] objectHolidays,
XFunctionAccess xfunctionaccess ) {
GregorianCalendar gregCalWorkday = null;
-
+
try {
// Getting the value of the start date
Double dDate = ( Double ) xfunctionaccess.callFunction(
@@ -831,18 +831,18 @@ public class ToDo {
new Integer( gregCalStartDate.get( Calendar.MONTH ) + 1 ),
new Integer( gregCalStartDate.get( Calendar.DATE ) )
} );
-
+
Double dWorkday = ( Double ) xfunctionaccess.callFunction(
"com.sun.star.sheet.addin.Analysis.getWorkday",
new Object[] { dDate, new Integer( intDays ), objectHolidays } );
-
+
Double dYear = ( Double ) xfunctionaccess.callFunction(
"YEAR", new Object[] { dWorkday } );
Double dMonth = ( Double ) xfunctionaccess.callFunction(
"MONTH", new Object[] { dWorkday } );
Double dDay = ( Double ) xfunctionaccess.callFunction(
"DAY", new Object[] { dWorkday } );
-
+
gregCalWorkday = new GregorianCalendar(
dYear.intValue(),
dMonth.intValue() - 1,
@@ -851,10 +851,10 @@ public class ToDo {
catch( Exception exception ) {
this.showExceptionMessage( exception );
}
-
+
return gregCalWorkday;
}
-
+
/** Getting the holidays from the spreadsheet.
* @param vectorHolidays Holding all holidays.
* @param xcellrange Providing the cells.
@@ -866,13 +866,13 @@ public class ToDo {
try {
int intRow = this.INT_ROW_HOLIDAYS_START;
int intColumn = this.INT_COLUMN_HOLIDAYS_START;
-
+
double dHolidayStart = xcellrange.getCellByPosition(
intColumn, intRow ).getValue();
-
+
double dHolidayEnd = xcellrange.getCellByPosition(
intColumn + 1, intRow ).getValue();
-
+
while ( dHolidayStart != 0 ) {
if ( dHolidayEnd == 0 ) {
vectorHolidays.addElement(
@@ -887,7 +887,7 @@ public class ToDo {
vectorHolidays.addElement( new Double( intHoliday ) );
}
}
-
+
intRow++;
dHolidayStart = xcellrange.getCellByPosition(
intColumn, intRow).getValue();
@@ -899,7 +899,7 @@ public class ToDo {
this.showExceptionMessage( exception );
}
}
-
+
/** Showing the stack trace in a JOptionPane.
* @param sMessage The message to show.
*/
@@ -913,7 +913,7 @@ public class ToDo {
javax.swing.JOptionPane.INFORMATION_MESSAGE);
jframe.dispose();
}
-
+
/** Writing the stack trace from an exception to a string and calling
* the method showMessage() with this string.
* @param exception The occured exception.
@@ -926,9 +926,9 @@ public class ToDo {
exception.printStackTrace( printwriter);
System.err.println( exception );
this.showMessage( swriter.getBuffer().substring(0) );
- }
+ }
}
-
+
/**
* Gives a factory for creating the service.
* This method is called by the <code>JavaLoader</code>
@@ -941,11 +941,11 @@ public class ToDo {
*/
public static XSingleComponentFactory __getComponentFactory(String sImplName) {
XSingleComponentFactory xFactory = null;
-
+
if ( sImplName.equals( ToDoImpl.class.getName() ) )
xFactory = Factory.createComponentFactory(ToDoImpl.class,
ToDoImpl.getServiceNames());
-
+
return xFactory;
}
diff --git a/odk/examples/java/ToDo/XToDo.idl b/odk/examples/java/ToDo/XToDo.idl
index 5cae425c4ea0..10d592f77aad 100644
--- a/odk/examples/java/ToDo/XToDo.idl
+++ b/odk/examples/java/ToDo/XToDo.idl
@@ -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.
- *
+ *
*************************************************************************/
#ifndef INCLUDED_ORG_OPENOFFICE_XTODO_IDL
@@ -40,10 +40,10 @@
module org {
/// openoffice
module openoffice {
- /// example interface
+ /// example interface
interface XToDo {
- void recalc( [in] any aInstance );
- };
+ void recalc( [in] any aInstance );
+ };
};
};
diff --git a/odk/inc/pch/precompiled_odk.cxx b/odk/inc/pch/precompiled_odk.cxx
index 91a2a6a1dfd6..1002adaae84a 100644
--- a/odk/inc/pch/precompiled_odk.cxx
+++ b/odk/inc/pch/precompiled_odk.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/inc/pch/precompiled_odk.hxx b/odk/inc/pch/precompiled_odk.hxx
index c9c85aa5e12c..82f2d4a9cc69 100644
--- a/odk/inc/pch/precompiled_odk.hxx
+++ b/odk/inc/pch/precompiled_odk.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/odk/source/com/sun/star/lib/loader/InstallationFinder.java b/odk/source/com/sun/star/lib/loader/InstallationFinder.java
index cb1ec7ad1143..da8117eb74d8 100644
--- a/odk/source/com/sun/star/lib/loader/InstallationFinder.java
+++ b/odk/source/com/sun/star/lib/loader/InstallationFinder.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -51,10 +51,10 @@ import java.util.Vector;
* enviroment variable won't work with those Java versions.
* If no UNO installation is specified by the user, the default installation
* on the system will be returned.</p>
- *
+ *
* <p>On the Windows platform the default installation is read from the Windows
* Registry.</p>
- *
+ *
* <p>On the Unix/Linux platforms the default installation is found from the
* PATH environment variable. Note, that for Java 1.3.1 and Java 1.4 the
* default installation is found by using the 'which' command, because
@@ -72,19 +72,19 @@ final class InstallationFinder {
"com.sun.star.lib.loader.unopath";
private static final String ENVVAR_NAME = "UNO_PATH";
private static final String SOFFICE = "soffice"; // Unix/Linux only
-
+
private InstallationFinder() {} // do not instantiate
-
+
/**
* Gets the path of a UNO installation.
- *
+ *
* @return the installation path or <code>null</code>, if no installation
- * was specified or found, or if an error occured
- */
+ * was specified or found, or if an error occured
+ */
public static String getPath() {
-
+
String path = null;
-
+
// get the installation path from the Java system property
// com.sun.star.lib.loader.unopath
// (all platforms)
@@ -116,7 +116,7 @@ final class InstallationFinder {
// get the installation path from the 'which'
// command (Unix/Linux platforms only)
path = getPathFromWhich();
- if ( path == null ) {
+ if ( path == null ) {
// get the installation path from the
// .sversionrc file (Unix/Linux platforms only,
// for older versions than OOo 2.0)
@@ -127,10 +127,10 @@ final class InstallationFinder {
}
}
}
-
+
return path;
}
-
+
/**
* Gets the installation path from a Java system property.
*
@@ -138,82 +138,82 @@ final class InstallationFinder {
* The Java system property can be passed into the application by using
* the -D flag, e.g.
* java -D<property name>=<installation path> -jar application.jar.</p>
- *
+ *
* @return the installation path or <code>null</code>, if no installation
* was specified in the Java system property or if an error occured
- */
+ */
private static String getPathFromProperty( String prop ) {
String path = null;
-
+
try {
path = System.getProperty( prop );
} catch ( SecurityException e ) {
// if a SecurityException was thrown, return <code>null</code>
}
- return path;
+ return path;
}
/**
* Gets the installation path from an environment variable.
- *
+ *
* <p>This method is called on all platforms.
- * Note, that in Java 1.3.1 and Java 1.4 System.getenv() throws
- * java.lang.Error and therefore this method returns null for those
+ * Note, that in Java 1.3.1 and Java 1.4 System.getenv() throws
+ * java.lang.Error and therefore this method returns null for those
* Java versions.</p>
*
* @return the installation path or <code>null</code>, if no installation
* was specified in the environment variable or if an error occured
*/
- private static String getPathFromEnvVar( String var ) {
+ private static String getPathFromEnvVar( String var ) {
String path = null;
-
+
try {
- path = System.getenv( var );
+ path = System.getenv( var );
} catch ( SecurityException e ) {
// if a SecurityException was thrown, return <code>null</code>
} catch ( java.lang.Error err ) {
- // System.getenv() throws java.lang.Error in Java 1.3.1 and
+ // System.getenv() throws java.lang.Error in Java 1.3.1 and
// Java 1.4
}
-
+
return path;
}
-
+
/**
* Gets the installation path from the Windows Registry.
*
* <p>This method is called on the Windows platform only.</p>
- *
+ *
* @return the installation path or <code>null</code>, if no installation
- * was found or if an error occured
- */
+ * was found or if an error occured
+ */
private static String getPathFromWindowsRegistry() {
final String SUBKEYNAME = "Software\\LibreOffice\\UNO\\InstallPath";
String path = null;
-
+
try {
// read the key's default value from HKEY_CURRENT_USER
WinRegKey key = new WinRegKey( "HKEY_CURRENT_USER", SUBKEYNAME );
- path = key.getStringValue( "" ); // default
+ path = key.getStringValue( "" ); // default
} catch ( WinRegKeyException e ) {
try {
// read the key's default value from HKEY_LOCAL_MACHINE
WinRegKey key = new WinRegKey( "HKEY_LOCAL_MACHINE",
SUBKEYNAME );
- path = key.getStringValue( "" ); // default
+ path = key.getStringValue( "" ); // default
} catch ( WinRegKeyException we ) {
System.err.println( "com.sun.star.lib.loader." +
"InstallationFinder::getPathFromWindowsRegistry: " +
"reading key from Windows Registry failed: " + we );
- }
+ }
}
-
- return path;
+
+ return path;
}
/**
@@ -232,17 +232,17 @@ final class InstallationFinder {
private static String getPathFromPathEnvVar() {
final String PATH_ENVVAR_NAME = "PATH";
-
+
String path = null;
String str = null;
-
+
try {
str = System.getenv( PATH_ENVVAR_NAME );
} catch ( SecurityException e ) {
// if a SecurityException was thrown, return <code>null</code>
return null;
} catch ( java.lang.Error err ) {
- // System.getenv() throws java.lang.Error in Java 1.3.1 and
+ // System.getenv() throws java.lang.Error in Java 1.3.1 and
// Java 1.4
return null;
}
@@ -254,7 +254,7 @@ final class InstallationFinder {
File file = new File( tokens.nextToken(), SOFFICE );
try {
if ( file.exists() ) {
- try {
+ try {
// resolve symlink
path = file.getCanonicalFile().getParent();
if ( path != null )
@@ -265,7 +265,7 @@ final class InstallationFinder {
System.err.println( "com.sun.star.lib.loader." +
"InstallationFinder::getPathFromEnvVar: " +
"bad path: " + e );
- }
+ }
}
} catch ( SecurityException e ) {
// if a SecurityException was thrown, ignore this path
@@ -273,10 +273,10 @@ final class InstallationFinder {
}
}
}
-
+
return path;
}
-
+
/**
* Gets the installation path from the 'which' command on Unix/Linux
* platforms.
@@ -284,16 +284,16 @@ final class InstallationFinder {
* <p>This method is called on Unix/Linux platforms only.
* An installation is found, if the executable 'soffice' or a symbolic link
* is in one of the directories listed in the PATH environment variable.</p>
- *
+ *
* @return the installation path or <code>null</code>, if no installation
* was found or if an error occured
- */
+ */
private static String getPathFromWhich() {
final String WHICH = "which";
-
+
String path = null;
-
+
// start the which process
String[] cmdArray = new String[2];
cmdArray[0] = WHICH;
@@ -311,15 +311,15 @@ final class InstallationFinder {
"which command failed: " + e );
return null;
}
-
+
// empty standard error stream in a seperate thread
StreamGobbler gobbler = new StreamGobbler( proc.getErrorStream() );
gobbler.start();
-
+
// read the which output from standard input stream
BufferedReader br = new BufferedReader(
new InputStreamReader( proc.getInputStream() ) );
- String line = null;
+ String line = null;
try {
while ( ( line = br.readLine() ) != null ) {
if ( path == null ) {
@@ -351,28 +351,28 @@ final class InstallationFinder {
return null;
} finally {
if ( br != null ) {
- try {
+ try {
br.close();
} catch ( IOException e ) {
// closing standard input stream failed, ignore
- }
+ }
}
- }
-
+ }
+
try {
// wait until the which process has terminated
proc.waitFor();
} catch ( InterruptedException e ) {
// the current thread was interrupted by another thread,
// kill the which process
- proc.destroy();
+ proc.destroy();
// set the interrupted status
- Thread.currentThread().interrupt();
+ Thread.currentThread().interrupt();
}
-
+
return path;
}
-
+
/**
* Gets the installation path from the .sverionrc file in the user's home
* directory.
@@ -382,16 +382,16 @@ final class InstallationFinder {
* OOo 2.0.</p>
*
* @return the installation path or <code>null</code>, if no installation
- * was found or if an error occured
+ * was found or if an error occured
*/
private static String getPathFromSVersionFile() {
final String SVERSION = ".sversionrc"; // Unix/Linux only
final String VERSIONS = "[Versions]";
-
+
String path = null;
-
- try {
+
+ try {
File fSVersion = new File(
System.getProperty( "user.home" ) ,SVERSION );
if ( fSVersion.exists() ) {
@@ -400,7 +400,7 @@ final class InstallationFinder {
try {
br = new BufferedReader( new InputStreamReader(
new FileInputStream( fSVersion ), "UTF-8" ) );
- String line = null;
+ String line = null;
while ( ( line = br.readLine() ) != null &&
( line.equals( VERSIONS ) ) != true ) {
// read lines until [Versions] is found
@@ -418,32 +418,32 @@ final class InstallationFinder {
"reading .sversionrc file failed: " + e );
} finally {
if ( br != null ) {
- try {
+ try {
br.close();
} catch ( IOException e ) {
// closing .sversionrc failed, ignore
- }
+ }
}
- }
+ }
for ( int i = lines.size() - 1; i >= 0; i-- ) {
StringTokenizer tokens = new StringTokenizer(
(String)lines.elementAt( i ), "=" );
if ( tokens.countTokens() != 2 )
- continue;
+ continue;
String key = tokens.nextToken();
String url = tokens.nextToken();
- path = getCanonicalPathFromFileURL( url );
+ path = getCanonicalPathFromFileURL( url );
if ( path != null )
- break;
- }
- }
+ break;
+ }
+ }
} catch ( SecurityException e ) {
return null;
- }
-
+ }
+
return path;
}
-
+
/**
* Translates an OOo-internal absolute file URL reference (encoded using
* UTF-8) into a Java canonical pathname.
@@ -456,14 +456,14 @@ final class InstallationFinder {
* <code>null</code> is returned
*/
private static String getCanonicalPathFromFileURL( String oooUrl ) {
-
+
String prefix = "file://";
if (oooUrl.length() < prefix.length()
|| !oooUrl.substring(0, prefix.length()).toLowerCase().equals(
prefix))
{
return null;
- }
+ }
StringBuffer buf = new StringBuffer(prefix);
int n = oooUrl.indexOf('/', prefix.length());
if (n < 0) {
@@ -546,12 +546,12 @@ final class InstallationFinder {
ret = file.getCanonicalFile().getParent();
} catch ( IOException e ) {
return null;
- }
+ }
}
} catch ( SecurityException e ) {
return null;
}
-
+
return ret;
}
diff --git a/odk/source/com/sun/star/lib/loader/Loader.java b/odk/source/com/sun/star/lib/loader/Loader.java
index c4ef7fee6e81..c9589e2e77ef 100644
--- a/odk/source/com/sun/star/lib/loader/Loader.java
+++ b/odk/source/com/sun/star/lib/loader/Loader.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -67,7 +67,7 @@ public final class Loader {
* as first parameter in the argument list.
*/
public static void main( String[] arguments ) throws Exception {
-
+
// get the name of the class to be loaded from the manifest
String className = null;
Class clazz = Loader.class;
@@ -108,13 +108,13 @@ public final class Loader {
System.err.println( "com.sun.star.lib.loader.Loader::" +
"main: cannot get manifest resources: " + e );
}
-
+
// if no manifest entry was found, get the name of the class
// to be loaded from the argument list
- String[] args;
+ String[] args;
if ( className == null ) {
- if ( arguments.length > 0 ) {
- className = arguments[0];
+ if ( arguments.length > 0 ) {
+ className = arguments[0];
args = new String[arguments.length - 1];
System.arraycopy( arguments, 1, args, 0, args.length );
} else {
@@ -125,9 +125,9 @@ public final class Loader {
"of the manifest file or as a command line argument." );
}
} else {
- args = arguments;
+ args = arguments;
}
-
+
// load the class with the customized class loader and
// invoke the main method
if ( className != null ) {
@@ -143,15 +143,15 @@ public final class Loader {
* Gets the customized class loader with the UNO jar files added to the
* search path.
*
- * @return the customized class loader
+ * @return the customized class loader
*/
public static synchronized ClassLoader getCustomLoader() {
final String CLASSESDIR = "classes";
final String JUHJAR = "juh.jar";
-
+
if ( m_Loader == null ) {
-
+
// get the urls from which to load classes and resources
// from the class path
Vector vec = new Vector();
@@ -168,17 +168,17 @@ public final class Loader {
if ( classpath != null ) {
addUrls(vec, classpath, File.pathSeparator);
}
-
- // get the urls from which to load classes and resources
+
+ // get the urls from which to load classes and resources
// from the UNO installation
- String path = InstallationFinder.getPath();
- if ( path != null ) {
+ String path = InstallationFinder.getPath();
+ if ( path != null ) {
File fClassesDir = new File( path, CLASSESDIR );
File fJuh = new File( fClassesDir, JUHJAR );
if ( fJuh.exists() ) {
URL[] clurls = new URL[1];
try {
- clurls[0] = fJuh.toURL();
+ clurls[0] = fJuh.toURL();
ClassLoader cl = new CustomURLClassLoader( clurls );
Class c = cl.loadClass(
"com.sun.star.comp.helper.UnoInfo" );
@@ -221,16 +221,16 @@ public final class Loader {
System.err.println( "com.sun.star.lib.loader.Loader::" +
"getCustomLoader: no UNO installation found!" );
}
-
+
// copy urls to array
URL[] urls = new URL[vec.size()];
vec.toArray( urls );
// instantiate class loader
- m_Loader = new CustomURLClassLoader( urls );
+ m_Loader = new CustomURLClassLoader( urls );
}
- return m_Loader;
+ return m_Loader;
}
private static void addUrls(Vector urls, String data, String delimiter) {
@@ -348,7 +348,7 @@ public final class Loader {
* from a search path of user-defined URLs.
*/
private static final class CustomURLClassLoader extends URLClassLoader {
-
+
public CustomURLClassLoader( URL[] urls ) {
super( urls );
}
@@ -362,7 +362,7 @@ public final class Loader {
protected Class loadClass( String name, boolean resolve )
throws ClassNotFoundException
- {
+ {
Class c = findLoadedClass( name );
if ( c == null ) {
try {
diff --git a/odk/source/com/sun/star/lib/loader/WinRegKey.java b/odk/source/com/sun/star/lib/loader/WinRegKey.java
index d9203b3b37c0..b68a87a3a483 100644
--- a/odk/source/com/sun/star/lib/loader/WinRegKey.java
+++ b/odk/source/com/sun/star/lib/loader/WinRegKey.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -39,10 +39,10 @@ import java.io.InputStream;
* Windows Registry. It requires the native library unowinreg.dll.
*/
final class WinRegKey {
-
+
private String m_rootKeyName;
private String m_subKeyName;
-
+
// native methods to access the windows registry
private static native boolean winreg_RegOpenClassesRoot( long[] hkresult );
private static native boolean winreg_RegOpenCurrentConfig(
@@ -52,21 +52,21 @@ final class WinRegKey {
private static native boolean winreg_RegOpenUsers( long[] hkresult );
private static native boolean winreg_RegOpenKeyEx( long parent, String name,
long[] hkresult );
- private static native boolean winreg_RegCloseKey( long hkey );
+ private static native boolean winreg_RegCloseKey( long hkey );
private static native boolean winreg_RegQueryValueEx(
- long hkey, String value, long[] type,
+ long hkey, String value, long[] type,
byte[] data, long[] size );
private static native boolean winreg_RegQueryInfoKey(
- long hkey, long[] subkeys, long[] maxSubkeyLen,
+ long hkey, long[] subkeys, long[] maxSubkeyLen,
long[] values, long[] maxValueNameLen,
long[] maxValueLen, long[] secDescriptor );
-
+
// load the native library unowinreg.dll
- static {
+ static {
try {
- ClassLoader cl = WinRegKey.class.getClassLoader();
+ ClassLoader cl = WinRegKey.class.getClassLoader();
InputStream is = cl.getResourceAsStream( "win/unowinreg.dll" );
- if ( is != null ) {
+ if ( is != null ) {
// generate a temporary name for lib file and write to temp
// location
BufferedInputStream istream = new BufferedInputStream( is );
@@ -78,23 +78,23 @@ final class WinRegKey {
byte[] buffer = new byte[bsize];
while ( ( n = istream.read( buffer, 0, bsize ) ) != -1 ) {
ostream.write( buffer, 0, n );
- }
+ }
istream.close();
- ostream.close();
+ ostream.close();
// load library
System.load( libfile.getPath() );
} else {
// If the library cannot be found as a class loader resource,
// try the global System.loadLibrary(). The JVM will look for
- // it in the java.library.path.
+ // it in the java.library.path.
System.loadLibrary( "unowinreg" );
- }
+ }
} catch ( java.lang.Exception e ) {
System.err.println( "com.sun.star.lib.loader.WinRegKey: " +
"loading of native library failed!" + e );
}
}
-
+
/**
* Constructs a <code>WinRegKey</code>.
*/
@@ -105,7 +105,7 @@ final class WinRegKey {
/**
* Reads a string value for the specified value name.
- */
+ */
public String getStringValue( String valueName ) throws WinRegKeyException {
byte[] data = getValue( valueName );
// remove terminating null character
@@ -116,10 +116,10 @@ final class WinRegKey {
* Reads a value for the specified value name.
*/
private byte[] getValue( String valueName ) throws WinRegKeyException {
-
+
byte[] result = null;
long[] hkey = {0};
-
+
// open the specified registry key
boolean bRet = false;
long[] hroot = {0};
@@ -144,10 +144,10 @@ final class WinRegKey {
if ( !winreg_RegCloseKey( hroot[0] ) ) {
throw new WinRegKeyException( "opening registry key and " +
"releasing root registry key handle failed!" );
- }
+ }
throw new WinRegKeyException( "opening registry key failed!" );
}
-
+
// get the size of the longest data component among the key's values
long[] subkeys = {0};
long[] maxSubkeyLen = {0};
@@ -162,13 +162,13 @@ final class WinRegKey {
throw new WinRegKeyException( "retrieving information about " +
"the registry key and releasing registry key handles " +
"failed!" );
- }
+ }
throw new WinRegKeyException( "retrieving information about " +
"the registry key failed!" );
}
-
+
// get the data for the specified value name
- byte[] buffer = new byte[ (int) maxValueLen[0] ];
+ byte[] buffer = new byte[ (int) maxValueLen[0] ];
long[] size = new long[1];
size[0] = buffer.length;
long[] type = new long[1];
@@ -184,17 +184,17 @@ final class WinRegKey {
throw new WinRegKeyException( "retrieving data for the " +
"specified value name failed!" );
}
-
+
// release registry key handles
if ( !winreg_RegCloseKey( hkey[0] ) ||
!winreg_RegCloseKey( hroot[0] ) ) {
throw new WinRegKeyException( "releasing registry key handles " +
"failed!" );
}
-
+
result = new byte[ (int) size[0] ];
System.arraycopy( buffer, 0, result, 0, (int)size[0] );
-
+
return result;
- }
+ }
}
diff --git a/odk/source/com/sun/star/lib/loader/WinRegKeyException.java b/odk/source/com/sun/star/lib/loader/WinRegKeyException.java
index bd66f3e4b933..f476def51a45 100644
--- a/odk/source/com/sun/star/lib/loader/WinRegKeyException.java
+++ b/odk/source/com/sun/star/lib/loader/WinRegKeyException.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,8 +30,8 @@ package com.sun.star.lib.loader;
/**
* WinRegKeyException is a checked exception.
*/
-final class WinRegKeyException extends java.lang.Exception {
-
+final class WinRegKeyException extends java.lang.Exception {
+
/**
* Constructs a <code>WinRegKeyException</code>.
*/
diff --git a/odk/source/unoapploader/unx/unoapploader.c b/odk/source/unoapploader/unx/unoapploader.c
index a44c01285918..a36f8fddfcd6 100644
--- a/odk/source/unoapploader/unx/unoapploader.c
+++ b/odk/source/unoapploader/unx/unoapploader.c
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -50,15 +50,15 @@ const char* PATHSEPARATOR = ":";
/*
* The main function implements a loader for applications which use UNO.
- *
+ *
* <p>This code runs on the Unix/Linux platforms only.</p>
*
* <p>The main function detects a UNO installation on the system and adds the
* relevant directories of the installation to the LD_LIBRARY_PATH environment
- * variable. After that, the application process is loaded and started, whereby
+ * variable. After that, the application process is loaded and started, whereby
* the new process inherits the environment of the calling process, including
- * the modified LD_LIBRARY_PATH environment variable. The application's
- * executable name must be the same as the name of this executable, prefixed
+ * the modified LD_LIBRARY_PATH environment variable. The application's
+ * executable name must be the same as the name of this executable, prefixed
* by '_'.</p>
* <p>On MACOSX DYLD_LIBRARY_PATH is used instead of LD_LIBRARY_PATH!<p>
*
@@ -66,8 +66,8 @@ const char* PATHSEPARATOR = ":";
* environment variable to the program directory of the UNO installation.
* If no installation is specified by the user, the default installation on
* the system will be taken. The default installation is found from the
- * PATH environment variable. This requires that the 'soffice' executable or
- * a symbolic link is in one of the directories listed in the PATH environment
+ * PATH environment variable. This requires that the 'soffice' executable or
+ * a symbolic link is in one of the directories listed in the PATH environment
* variable.</p>
*/
int main( int argc, char *argv[] )
@@ -75,7 +75,7 @@ int main( int argc, char *argv[] )
char const* path;
char* cmdname;
- (void) argc; /* avoid warning about unused parameter */
+ (void) argc; /* avoid warning about unused parameter */
/* get the path of the UNO installation */
path = getPath();
@@ -216,7 +216,7 @@ int main( int argc, char *argv[] )
cmdname = createCommandName( argv[0] );
argv[0] = cmdname;
- /*
+ /*
* create the application process;
* if successful, execvp doesn't return to the calling process
*/
@@ -229,9 +229,9 @@ int main( int argc, char *argv[] )
/*
* Gets the path of a UNO installation.
- *
+ *
* @return the installation path or NULL, if no installation was specified or
- * found, or if an error occured
+ * found, or if an error occured
*/
char const* getPath()
{
@@ -246,7 +246,7 @@ char const* getPath()
return path;
}
-
+
/*
* Creates the application's executable file name.
*
@@ -273,7 +273,7 @@ char* createCommandName( char* argv0 )
prgname = argv0;
#ifndef AIX
- /*
+ /*
* if argv0 doesn't contain an absolute path name, try to get the absolute
* path name from dladdr; note that this only works for Solaris, not for
* Linux
@@ -294,7 +294,7 @@ char* createCommandName( char* argv0 )
if ( sep != NULL )
{
pos = ++sep - prgname;
- strncpy( cmdname, prgname, pos );
+ strncpy( cmdname, prgname, pos );
cmdname[ pos ] = '\0';
strcat( cmdname, CMDPREFIX );
strcat( cmdname, sep );
diff --git a/odk/source/unoapploader/win/unoapploader.c b/odk/source/unoapploader/win/unoapploader.c
index ee806f1b4976..b4897dff5aab 100644
--- a/odk/source/unoapploader/win/unoapploader.c
+++ b/odk/source/unoapploader/win/unoapploader.c
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -52,7 +52,7 @@ void closeErrorFile();
/*
* The main function implements a loader for applications which use UNO.
- *
+ *
* <p>This code runs on the Windows platform only.</p>
*
* <p>The main function detects a UNO installation on the system and adds the
@@ -66,11 +66,11 @@ void closeErrorFile();
* environment variable to the program directory of the UNO installation.
* If no installation is specified by the user, the default installation on
* the system will be taken. The default installation is read from the
- * default value of the key "Software\OpenOffice.org\UNO\InstallPath" from the
- * root key HKEY_CURRENT_USER in the Windows Registry. If this key is missing,
+ * default value of the key "Software\OpenOffice.org\UNO\InstallPath" from the
+ * root key HKEY_CURRENT_USER in the Windows Registry. If this key is missing,
* the key is read from the root key HKEY_LOCAL_MACHINE.</p>
*/
-int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
+int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow )
{
const char* ENVVARNAME = "PATH";
@@ -225,9 +225,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
/* get the value of the PATH environment variable */
value = getenv( ENVVARNAME );
- /*
+ /*
* add the UNO installation path to the PATH environment variable;
- * note that this only affects the environment variable of the current
+ * note that this only affects the environment variable of the current
* process, the command processor's environment is not changed
*/
size = strlen( ENVVARNAME ) + strlen( "=" ) + strlen( path ) + 1;
@@ -265,7 +265,7 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
bCreate = CreateProcess( NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL,
&startup_info, &process_info );
free( cmdline );
- if ( !bCreate )
+ if ( !bCreate )
{
writeError( "Error: cannot create process!\n" );
closeErrorFile();
@@ -280,9 +280,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
/*
* Gets the path of a UNO installation.
- *
+ *
* @return the installation path or NULL, if no installation was specified or
- * found, or if an error occured
+ * found, or if an error occured
*/
char const* getPath()
{
@@ -302,7 +302,7 @@ char const* getPath()
* prefixed by '_'.</p>
*
* @param appendix specifies the command line for the application excluding
- * the executable name
+ * the executable name
*
* @return the command line for the application process or NULL, if an error
* occured
@@ -332,7 +332,7 @@ char* createCommandLine( char* appendix )
_makepath( cmdname, drive, dir, newbase, ext );
/* create the command line */
- cmdline = (char*) malloc( strlen( DQUOTE ) + strlen( cmdname ) +
+ cmdline = (char*) malloc( strlen( DQUOTE ) + strlen( cmdname ) +
strlen ( DQUOTE ) + strlen( SPACE ) + strlen( appendix ) + 1 );
strcpy( cmdline, DQUOTE );
strcat( cmdline, cmdname );
@@ -356,7 +356,7 @@ char* createCommandLine( char* appendix )
* @param create specifies, if the error file should be created (create != 0)
*
- * @return the pointer to the open error file or NULL, if no error file is
+ * @return the pointer to the open error file or NULL, if no error file is
* open or can be created
*/
FILE* getErrorFile( int create )
@@ -392,7 +392,7 @@ FILE* getErrorFile( int create )
GetTempPath( sizeof( fname ), fname );
strcat( fname, newbase );
strcat( fname, EXTENSION );
- ferr = fopen( fname, MODE );
+ ferr = fopen( fname, MODE );
}
}
}
diff --git a/odk/source/unowinreg/win/unowinreg.cxx b/odk/source/unowinreg/win/unowinreg.cxx
index 127a580d1e84..bab1a3f9bba7 100644
--- a/odk/source/unowinreg/win/unowinreg.cxx
+++ b/odk/source/unowinreg/win/unowinreg.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -44,59 +44,59 @@ extern "C" BOOL __stdcall _DllMainCRTStartup(HINSTANCE, DWORD, LPVOID)
return TRUE;
}
-extern "C" JNIEXPORT jboolean JNICALL
+extern "C" JNIEXPORT jboolean JNICALL
Java_com_sun_star_lib_loader_WinRegKey_winreg_1RegOpenClassesRoot(
JNIEnv *env, jclass, jlongArray hkresult)
{
jboolean ret = JNI_FALSE;
PHKEY phkey = (PHKEY)env->GetLongArrayElements(hkresult, 0);
- if (RegOpenKeyEx(HKEY_CLASSES_ROOT, NULL, 0, KEY_READ, phkey)
+ if (RegOpenKeyEx(HKEY_CLASSES_ROOT, NULL, 0, KEY_READ, phkey)
== ERROR_SUCCESS)
ret = JNI_TRUE;
env->ReleaseLongArrayElements(hkresult, (jlong *)phkey, 0);
return ret;
}
-extern "C" JNIEXPORT jboolean JNICALL
+extern "C" JNIEXPORT jboolean JNICALL
Java_com_sun_star_lib_loader_WinRegKey_winreg_1RegOpenCurrentConfig(
JNIEnv *env, jclass, jlongArray hkresult)
{
jboolean ret = JNI_FALSE;
PHKEY phkey = (PHKEY)env->GetLongArrayElements(hkresult, 0);
- if (RegOpenKeyEx(HKEY_CURRENT_CONFIG, NULL, 0, KEY_READ, phkey)
+ if (RegOpenKeyEx(HKEY_CURRENT_CONFIG, NULL, 0, KEY_READ, phkey)
== ERROR_SUCCESS)
ret = JNI_TRUE;
env->ReleaseLongArrayElements(hkresult, (jlong *)phkey, 0);
return ret;
}
-extern "C" JNIEXPORT jboolean JNICALL
+extern "C" JNIEXPORT jboolean JNICALL
Java_com_sun_star_lib_loader_WinRegKey_winreg_1RegOpenCurrentUser(
JNIEnv *env, jclass, jlongArray hkresult)
{
jboolean ret = JNI_FALSE;
PHKEY phkey = (PHKEY)env->GetLongArrayElements(hkresult, 0);
- if (RegOpenKeyEx(HKEY_CURRENT_USER, NULL, 0, KEY_READ, phkey)
+ if (RegOpenKeyEx(HKEY_CURRENT_USER, NULL, 0, KEY_READ, phkey)
== ERROR_SUCCESS)
ret = JNI_TRUE;
env->ReleaseLongArrayElements(hkresult, (jlong *)phkey, 0);
return ret;
}
-extern "C" JNIEXPORT jboolean JNICALL
+extern "C" JNIEXPORT jboolean JNICALL
Java_com_sun_star_lib_loader_WinRegKey_winreg_1RegOpenLocalMachine(
JNIEnv *env, jclass, jlongArray hkresult)
{
jboolean ret = JNI_FALSE;
PHKEY phkey = (PHKEY)env->GetLongArrayElements(hkresult, 0);
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, NULL, 0, KEY_READ, phkey)
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, NULL, 0, KEY_READ, phkey)
== ERROR_SUCCESS)
ret = JNI_TRUE;
env->ReleaseLongArrayElements(hkresult, (jlong *)phkey, 0);
return ret;
}
-extern "C" JNIEXPORT jboolean JNICALL
+extern "C" JNIEXPORT jboolean JNICALL
Java_com_sun_star_lib_loader_WinRegKey_winreg_1RegOpenUsers(
JNIEnv *env, jclass, jlongArray hkresult)
{
@@ -108,14 +108,14 @@ extern "C" JNIEXPORT jboolean JNICALL
return ret;
}
-extern "C" JNIEXPORT jboolean JNICALL
+extern "C" JNIEXPORT jboolean JNICALL
Java_com_sun_star_lib_loader_WinRegKey_winreg_1RegOpenKeyEx(
JNIEnv *env, jclass, jlong parent, jstring name, jlongArray hkresult)
-{
+{
jboolean ret = JNI_FALSE;
const char *namestr = env->GetStringUTFChars(name, 0);
PHKEY phkey = (PHKEY)env->GetLongArrayElements(hkresult, 0);
- if (RegOpenKeyEx((HKEY)parent, namestr, 0, KEY_READ, phkey)
+ if (RegOpenKeyEx((HKEY)parent, namestr, 0, KEY_READ, phkey)
== ERROR_SUCCESS)
ret = JNI_TRUE;
env->ReleaseStringUTFChars(name, namestr);
@@ -124,7 +124,7 @@ extern "C" JNIEXPORT jboolean JNICALL
}
-extern "C" JNIEXPORT jboolean JNICALL
+extern "C" JNIEXPORT jboolean JNICALL
Java_com_sun_star_lib_loader_WinRegKey_winreg_1RegCloseKey(
JNIEnv *, jclass, jlong hkey)
{
@@ -134,7 +134,7 @@ extern "C" JNIEXPORT jboolean JNICALL
return ret;
}
-extern "C" JNIEXPORT jboolean
+extern "C" JNIEXPORT jboolean
JNICALL Java_com_sun_star_lib_loader_WinRegKey_winreg_1RegQueryValueEx(
JNIEnv *env, jclass, jlong hkey, jstring value, jlongArray type,
jbyteArray data, jlongArray size)
@@ -144,7 +144,7 @@ extern "C" JNIEXPORT jboolean
LPDWORD ptype = (LPDWORD)env->GetLongArrayElements(type, 0);
LPBYTE pdata = (LPBYTE)env->GetByteArrayElements(data, 0);
LPDWORD psize = (LPDWORD)env->GetLongArrayElements(size, 0);
- if (RegQueryValueEx((HKEY)hkey, valuestr, NULL, ptype, pdata, psize)
+ if (RegQueryValueEx((HKEY)hkey, valuestr, NULL, ptype, pdata, psize)
== ERROR_SUCCESS)
ret = JNI_TRUE;
env->ReleaseStringUTFChars(value, valuestr);
@@ -154,26 +154,26 @@ extern "C" JNIEXPORT jboolean
return ret;
}
-extern "C" JNIEXPORT jboolean JNICALL
+extern "C" JNIEXPORT jboolean JNICALL
Java_com_sun_star_lib_loader_WinRegKey_winreg_1RegQueryInfoKey(
- JNIEnv *env, jclass, jlong hkey, jlongArray subkeys,
+ JNIEnv *env, jclass, jlong hkey, jlongArray subkeys,
jlongArray maxSubkeyLen, jlongArray values, jlongArray maxValueNameLen,
jlongArray maxValueLen, jlongArray secDescriptor)
{
jboolean ret = JNI_FALSE;
LPDWORD psubkeys = (LPDWORD)env->GetLongArrayElements(subkeys, 0);
- LPDWORD pmaxSubkeyLen =
+ LPDWORD pmaxSubkeyLen =
(LPDWORD)env->GetLongArrayElements(maxSubkeyLen, 0);
LPDWORD pvalues = (LPDWORD)env->GetLongArrayElements(values, 0);
- LPDWORD pmaxValueNameLen =
+ LPDWORD pmaxValueNameLen =
(LPDWORD)env->GetLongArrayElements(maxValueNameLen, 0);
- LPDWORD pmaxValueLen =
+ LPDWORD pmaxValueLen =
(LPDWORD)env->GetLongArrayElements(maxValueLen, 0);
- LPDWORD psecDescriptor =
+ LPDWORD psecDescriptor =
(LPDWORD)env->GetLongArrayElements(secDescriptor, 0);
FILETIME ft;
- if (RegQueryInfoKey((HKEY)hkey, NULL, NULL, NULL, psubkeys, pmaxSubkeyLen,
- NULL, pvalues, pmaxValueNameLen, pmaxValueLen,
+ if (RegQueryInfoKey((HKEY)hkey, NULL, NULL, NULL, psubkeys, pmaxSubkeyLen,
+ NULL, pvalues, pmaxValueNameLen, pmaxValueLen,
psecDescriptor, &ft) == ERROR_SUCCESS)
ret = JNI_TRUE;
env->ReleaseLongArrayElements(subkeys, (jlong*)psubkeys, 0);
diff --git a/odk/util/check.pl b/odk/util/check.pl
index 0ba7f05a6ed2..23d2fbaa1162 100644
--- a/odk/util/check.pl
+++ b/odk/util/check.pl
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -84,13 +84,13 @@ if (-d "$StartDir") {
my @filelist = ( "install.html",
"notsupported.html","sdk_styles.css","tools.html",
"images/arrow-1.gif", "images/arrow-3.gif",
- "images/odk-footer-logo.gif",
+ "images/odk-footer-logo.gif",
"images/bg_table.png","images/bg_table2.png",
"images/bg_table3.png", "images/nav_down.png",
"images/nav_home.png","images/nav_left.png",
"images/nav_right.png","images/nav_up.png",
"images/sdk_head-1.png", "images/sdk_head-2.png",
- "images/sdk_line-1.gif", "images/sdk_line-2.gif",
+ "images/sdk_line-1.gif", "images/sdk_line-2.gif",
"common/ref/idl.css", "images/nada.gif",
"images/arrow-2.gif", "images/bluball.gif",
"images/orc-main-app_32.png", "images/ooo-main-app_32.png");
@@ -310,8 +310,8 @@ if (-d "$StartDir") {
my @dir_list = ( "lib","lib/uno","lib/uno/helper","lib/uno/helper/class-use",
"uno","uno/class-use","comp","comp/helper",
"comp/helper/class-use");
-
- foreach $i (@dir_list)
+
+ foreach $i (@dir_list)
{
if (! -d "$StartDir/docs/java/ref/com/sun/star/$i") {
$return++;
@@ -343,7 +343,7 @@ if (-d "$StartDir") {
$return++;
}
- my @idl_dirlist = ( "accessibility",
+ my @idl_dirlist = ( "accessibility",
"animations",
"auth",
"awt",
diff --git a/odk/util/checkdiff.pl b/odk/util/checkdiff.pl
index 33d38ff80f32..5574923e22c9 100644
--- a/odk/util/checkdiff.pl
+++ b/odk/util/checkdiff.pl
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite