diff options
author | os <os@openoffice.org> | 2009-11-10 15:32:07 +0100 |
---|---|---|
committer | os <os@openoffice.org> | 2009-11-10 15:32:07 +0100 |
commit | aac70bea305ac118fc74c43f9d323d6bcf509d9c (patch) | |
tree | 307bd028826dcc18a5a6fa7e051cedc92c933e55 | |
parent | 6902c6cc538e1a40cbe8ab201163e49e72528397 (diff) | |
parent | 40ab64211cc89ec112e5baf8c7ff78ad4680b7a3 (diff) |
rebase
128 files changed, 2326 insertions, 1514 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx index 6141efd7964a..e474dce7268c 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx @@ -33,6 +33,7 @@ #include "precompiled_bridges.hxx" #include <stdio.h> +#include <string.h> #include <dlfcn.h> #include <cxxabi.h> #include <hash_map> diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx index 0f0fdbf351ca..e3f4d36e3962 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx @@ -110,6 +110,9 @@ static void callVirtualMethod( /* set up a pointer to the stack parameter area */ __asm__ ( "addi %0,r1,24" : "=r" (p) : /* no inputs */ ); + // #i94421#, work around compiler error: + volatile long * pCopy = p; + (void) pCopy; // avoid warning about unused variable // never called // if (! pAdjustedThisPtr )CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything("xxx"); // address something diff --git a/bridges/source/cpp_uno/gcc3_os2_intel/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_os2_intel/cpp2uno.cxx index d4584227cdc1..d6589b8d86cf 100644 --- a/bridges/source/cpp_uno/gcc3_os2_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_os2_intel/cpp2uno.cxx @@ -163,7 +163,8 @@ static typelib_TypeClass cpp2uno_call( (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, ">cpp2uno_call pUnoExc %x\n", pUnoExc); + if (pUnoExc != NULL) + fprintf( stderr, ">cpp2uno_call pUnoExc %x\n", pUnoExc); #endif // in case an exception occured... diff --git a/bridges/source/cpp_uno/mingw_intel/call.s b/bridges/source/cpp_uno/mingw_intel/call.s index b4a9ba031cf5..47327d9a4650 100644 --- a/bridges/source/cpp_uno/mingw_intel/call.s +++ b/bridges/source/cpp_uno/mingw_intel/call.s @@ -1,7 +1,6 @@ .text .globl _privateSnippetExecutorGeneral - .type _privateSnippetExecutorGeneral,@function _privateSnippetExecutorGeneral: .LFBg: movl %esp,%ecx @@ -19,10 +18,9 @@ _privateSnippetExecutorGeneral: leave ret .LFEg: - .size _privateSnippetExecutorGeneral,.-_privateSnippetExecutorGeneral + .long .-_privateSnippetExecutorGeneral .globl _privateSnippetExecutorVoid - .type _privateSnippetExecutorVoid,@function _privateSnippetExecutorVoid: .LFBv: movl %esp,%ecx @@ -38,10 +36,9 @@ _privateSnippetExecutorVoid: leave ret .LFEv: - .size _privateSnippetExecutorVoid,.-_privateSnippetExecutorVoid + .long .-_privateSnippetExecutorVoid .globl _privateSnippetExecutorHyper - .type _privateSnippetExecutorHyper,@function _privateSnippetExecutorHyper: .LFBh: movl %esp,%ecx @@ -60,10 +57,9 @@ _privateSnippetExecutorHyper: leave ret .LFEh: - .size _privateSnippetExecutorHyper,.-_privateSnippetExecutorHyper + .long .-_privateSnippetExecutorHyper .globl _privateSnippetExecutorFloat - .type _privateSnippetExecutorFloat,@function _privateSnippetExecutorFloat: .LFBf: movl %esp,%ecx @@ -81,10 +77,9 @@ _privateSnippetExecutorFloat: leave ret .LFEf: - .size _privateSnippetExecutorFloat,.-_privateSnippetExecutorFloat + .long .-_privateSnippetExecutorFloat .globl _privateSnippetExecutorDouble - .type _privateSnippetExecutorDouble,@function _privateSnippetExecutorDouble: .LFBd: movl %esp,%ecx @@ -102,10 +97,9 @@ _privateSnippetExecutorDouble: leave ret .LFEd: - .size _privateSnippetExecutorDouble,.-_privateSnippetExecutorDouble + .long .-_privateSnippetExecutorDouble .globl _privateSnippetExecutorClass - .type _privateSnippetExecutorClass,@function _privateSnippetExecutorClass: .LFBc: movl %esp,%ecx @@ -123,9 +117,9 @@ _privateSnippetExecutorClass: leave ret $4 .LFEc: - .size _privateSnippetExecutorClass,.-_privateSnippetExecutorClass + .long .-_privateSnippetExecutorClass - .section .eh_frame,"a",@progbits + .section .eh_frame,"dr" .Lframe1: .long .LECIE1-.LSCIE1 # length .LSCIE1: @@ -265,4 +259,3 @@ _privateSnippetExecutorClass: .uleb128 5 .align 4 .LEFDEc: - .section .note.GNU-stack,"",@progbits diff --git a/bridges/test/com/sun/star/lib/TestBed.java b/bridges/test/com/sun/star/lib/TestBed.java index 7242b56438f0..5e2c5e7859c8 100644 --- a/bridges/test/com/sun/star/lib/TestBed.java +++ b/bridges/test/com/sun/star/lib/TestBed.java @@ -130,7 +130,7 @@ public final class TestBed { throws com.sun.star.uno.Exception { XConnector connector = Connector.create(context); - XBridgeFactory factory = (XBridgeFactory) UnoRuntime.queryInterface( + XBridgeFactory factory = UnoRuntime.queryInterface( XBridgeFactory.class, context.getServiceManager().createInstanceWithContext( "com.sun.star.bridge.BridgeFactory", context)); @@ -169,7 +169,7 @@ public final class TestBed { = Bootstrap.createInitialComponentContext(null); XAcceptor acceptor = Acceptor.create(context); XBridgeFactory factory - = (XBridgeFactory) UnoRuntime.queryInterface( + = UnoRuntime.queryInterface( XBridgeFactory.class, context.getServiceManager().createInstanceWithContext( "com.sun.star.bridge.BridgeFactory", context)); diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug107753_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug107753_Test.java index a2c4122d3017..2c7e314afc82 100644 --- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug107753_Test.java +++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug107753_Test.java @@ -68,22 +68,19 @@ public final class Bug107753_Test extends ComplexTestCase { protected boolean run(XComponentContext context) throws Throwable { boolean success = true; - XTransport transport = (XTransport) UnoRuntime.queryInterface( + XTransport transport = UnoRuntime.queryInterface( XTransport.class, getBridge(context).getInstance("Transport")); Object obj1a = new XType1() {}; - XType1 obj1b = (XType1) UnoRuntime.queryInterface(XType1.class, - obj1a); + XType1 obj1b = UnoRuntime.queryInterface(XType1.class, obj1a); success &= test("obj1a == obj1b", obj1a == obj1b); Object obj2a = new XType2() {}; - XType2 obj2b = (XType2) UnoRuntime.queryInterface(XType2.class, - obj2a); + XType2 obj2b = UnoRuntime.queryInterface(XType2.class, obj2a); success &= test("obj2a == obj2b", obj2a == obj2b); Object obj3a = transport.getType1(); - XType1 obj3b = (XType1) UnoRuntime.queryInterface(XType1.class, - obj3a); + XType1 obj3b = UnoRuntime.queryInterface(XType1.class, obj3a); success &= test( "obj3a != obj3b; only meaningful as long as different proxy" + " instances are used for different UNO interfaces of one UNO" @@ -91,8 +88,7 @@ public final class Bug107753_Test extends ComplexTestCase { obj3a != obj3b); Object obj4a = transport.getType2(); - XType2 obj4b = (XType2) UnoRuntime.queryInterface(XType2.class, - obj4a); + XType2 obj4b = UnoRuntime.queryInterface(XType2.class, obj4a); success &= test( "obj4a != obj4b; only meaningful as long as different proxy" + " instances are used for different UNO interfaces of one UNO" diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug108825_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug108825_Test.java index 6e9d97f7034d..0585e1c8f650 100644 --- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug108825_Test.java +++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug108825_Test.java @@ -68,7 +68,7 @@ public final class Bug108825_Test extends ComplexTestCase { } protected boolean run(XComponentContext context) throws Throwable { - XTest test = (XTest) UnoRuntime.queryInterface( + XTest test = UnoRuntime.queryInterface( XTest.class, getBridge(context).getInstance("Test")); // Send the XObject that is held on the server side amidst two // dummies that are not held on the server side; then wait for the diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug110892_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug110892_Test.java index 76bd9d37a10c..1a537895b0ed 100644 --- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug110892_Test.java +++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug110892_Test.java @@ -71,7 +71,7 @@ public final class Bug110892_Test extends ComplexTestCase { } protected boolean run(XComponentContext context) throws Throwable { - XTest test = (XTest) UnoRuntime.queryInterface( + XTest test = UnoRuntime.queryInterface( XTest.class, getBridge(context).getInstance("Test")); test.start(new ClientObject()); synchronized (lock) { diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug111153_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug111153_Test.java index d1f09509d9a3..40eccdba2cc6 100644 --- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug111153_Test.java +++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug111153_Test.java @@ -63,7 +63,7 @@ public final class Bug111153_Test extends ComplexTestCase { } protected boolean run(XComponentContext context) throws Throwable { - XTransport t = (XTransport) UnoRuntime.queryInterface( + XTransport t = UnoRuntime.queryInterface( XTransport.class, getBridge(context).getInstance("Transport")); XDerived d = new XDerived() {}; t.setDerived(d); diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug51323_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug51323_Test.java index 32bfe9d832a3..247bf65ba185 100644 --- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug51323_Test.java +++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug51323_Test.java @@ -67,7 +67,7 @@ public final class Bug51323_Test extends ComplexTestCase { protected boolean run(XComponentContext context) throws Throwable { XConnection connection = Connector.create(context).connect(getConnectionDescription()); - XBridgeFactory factory = (XBridgeFactory) UnoRuntime.queryInterface( + XBridgeFactory factory = UnoRuntime.queryInterface( XBridgeFactory.class, context.getServiceManager().createInstanceWithContext( "com.sun.star.bridge.BridgeFactory", context)); diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug92174_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug92174_Test.java index 292dabde4758..13b61447c320 100644 --- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug92174_Test.java +++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug92174_Test.java @@ -55,7 +55,7 @@ public final class Bug92174_Test extends ComplexTestCase { } protected boolean run(XComponentContext context) throws Throwable { - XTransport t = (XTransport) UnoRuntime.queryInterface( + XTransport t = UnoRuntime.queryInterface( XTransport.class, getBridge(context).getInstance("Transport")); t.setDerived(new XDerived() { public void fn() {} diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug97697_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug97697_Test.java index f235ccfd6475..2fdd457f0dcb 100644 --- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug97697_Test.java +++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug97697_Test.java @@ -72,7 +72,7 @@ public final class Bug97697_Test extends ComplexTestCase { } protected boolean run(XComponentContext context) throws Throwable { - XTransport transport = (XTransport) UnoRuntime.queryInterface( + XTransport transport = UnoRuntime.queryInterface( XTransport.class, getBridge(context).getInstance("Transport")); try { transport.getAny(); diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug98508_Test.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug98508_Test.java index b713deaa352e..79e373014c4a 100644 --- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug98508_Test.java +++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/Bug98508_Test.java @@ -76,7 +76,7 @@ public final class Bug98508_Test extends ComplexTestCase { protected boolean run(XComponentContext context) throws Throwable { Test98508Interface ifc - = (Test98508Interface) UnoRuntime.queryInterface( + = UnoRuntime.queryInterface( Test98508Interface.class, getBridge(context).getInstance("")); try { diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/MethodIdTest.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/MethodIdTest.java index c22811502e14..407164c66c7f 100755 --- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/MethodIdTest.java +++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/MethodIdTest.java @@ -64,7 +64,7 @@ public final class MethodIdTest extends ComplexTestCase { } protected boolean run(XComponentContext context) throws Throwable { - XTest t = (XTest) UnoRuntime.queryInterface( + XTest t = UnoRuntime.queryInterface( XTest.class, getBridge(context).getInstance("Test")); return t.f129() == 129; } diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/PolyStructTest.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/PolyStructTest.java index 2f17041a52fb..1c9e387ddb32 100644 --- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/PolyStructTest.java +++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/PolyStructTest.java @@ -61,7 +61,7 @@ public final class PolyStructTest extends ComplexTestCase { } protected boolean run(XComponentContext context) throws Throwable { - TestTransport t = (TestTransport) UnoRuntime.queryInterface( + TestTransport t = UnoRuntime.queryInterface( TestTransport.class, getBridge(context).getInstance("")); assertEquals( diff --git a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/StopMessageDispatcherTest.java b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/StopMessageDispatcherTest.java index 7590a89fdd0e..37fb8ffee05b 100644 --- a/bridges/test/com/sun/star/lib/uno/bridges/java_remote/StopMessageDispatcherTest.java +++ b/bridges/test/com/sun/star/lib/uno/bridges/java_remote/StopMessageDispatcherTest.java @@ -63,7 +63,7 @@ public final class StopMessageDispatcherTest extends ComplexTestCase { } protected boolean run(XComponentContext context) throws Throwable { - XTest test = (XTest) UnoRuntime.queryInterface( + XTest test = UnoRuntime.queryInterface( XTest.class, getBridge(context).getInstance("Test")); Thread[] threads = new Thread[101]; int n = Thread.enumerate(threads); diff --git a/bridges/test/java_uno/acquire/TestAcquire.java b/bridges/test/java_uno/acquire/TestAcquire.java index 7d54c00d480d..e219b3adbf72 100644 --- a/bridges/test/java_uno/acquire/TestAcquire.java +++ b/bridges/test/java_uno/acquire/TestAcquire.java @@ -71,7 +71,7 @@ public final class TestAcquire { private static void execClient(XComponentContext context, String url) throws Exception { - XTest test = (XTest) UnoRuntime.queryInterface( + XTest test = UnoRuntime.queryInterface( XTest.class, UnoUrlResolver.create(context).resolve(url)); WaitUnreachable u; @@ -184,7 +184,7 @@ public final class TestAcquire { throws Exception { XAcceptor acceptor = Acceptor.create(context); - XBridgeFactory factory = (XBridgeFactory) UnoRuntime.queryInterface( + XBridgeFactory factory = UnoRuntime.queryInterface( XBridgeFactory.class, context.getServiceManager().createInstanceWithContext( "com.sun.star.bridge.BridgeFactory", context)); diff --git a/bridges/test/java_uno/any/TestRemote.java b/bridges/test/java_uno/any/TestRemote.java index db33efc139e9..ec533054579d 100644 --- a/bridges/test/java_uno/any/TestRemote.java +++ b/bridges/test/java_uno/any/TestRemote.java @@ -49,7 +49,7 @@ public final class TestRemote { } protected boolean run(XComponentContext context) throws Throwable { - XTransport transport = (XTransport) UnoRuntime.queryInterface( + XTransport transport = UnoRuntime.queryInterface( XTransport.class, getBridge(context).getInstance("Transport")); return TestAny.test(transport, true); } diff --git a/bridges/test/java_uno/equals/TestEquals.java b/bridges/test/java_uno/equals/TestEquals.java index 31b735473c9b..38c9500629e3 100644 --- a/bridges/test/java_uno/equals/TestEquals.java +++ b/bridges/test/java_uno/equals/TestEquals.java @@ -91,10 +91,10 @@ public final class TestEquals { } protected boolean run(XComponentContext context) throws Throwable { - XTestFrame f = (XTestFrame) UnoRuntime.queryInterface( + XTestFrame f = UnoRuntime.queryInterface( XTestFrame.class, getBridge(context).getInstance("TestFrame")); XAcceptor acceptor = Acceptor.create(context); - XBridgeFactory factory = (XBridgeFactory) UnoRuntime.queryInterface( + XBridgeFactory factory = UnoRuntime.queryInterface( XBridgeFactory.class, context.getServiceManager().createInstanceWithContext( "com.sun.star.bridge.BridgeFactory", context)); @@ -160,17 +160,15 @@ public final class TestEquals { public void run() { try { Object test1Aa = object1; - XBase test1Ab = (XBase) - UnoRuntime.queryInterface( - XBase.class, test1Aa); - XDerived test1Ac = (XDerived) + XBase test1Ab = UnoRuntime.queryInterface( + XBase.class, test1Aa); + XDerived test1Ac = UnoRuntime.queryInterface( XDerived.class, test1Aa); Object test2Aa = object2; - XBase test2Ab = (XBase) - UnoRuntime.queryInterface( - XBase.class, test2Aa); - XDerived test2Ac = (XDerived) + XBase test2Ab = UnoRuntime.queryInterface( + XBase.class, test2Aa); + XDerived test2Ac = UnoRuntime.queryInterface( XDerived.class, test2Aa); @@ -182,16 +180,14 @@ public final class TestEquals { null, params); XMultiComponentFactory factory = context.getServiceManager(); - XImplementationLoader loader - = (XImplementationLoader) + XImplementationLoader loader = UnoRuntime.queryInterface( XImplementationLoader.class, factory.createInstanceWithContext( "com.sun.star.loader." + "SharedLibrary", context)); - XSingleComponentFactory factory2 - = (XSingleComponentFactory) + XSingleComponentFactory factory2 = UnoRuntime.queryInterface( XSingleComponentFactory.class, loader.activate( @@ -199,7 +195,7 @@ public final class TestEquals { + "testequals.impl", "", "../lib/testequals.uno", null)); - XTestInterface test = (XTestInterface) + XTestInterface test = UnoRuntime.queryInterface( XTestInterface.class, factory2.createInstanceWithContext( @@ -211,17 +207,15 @@ public final class TestEquals { PROTOCOL_DESCRIPTION); Object test1Ba = test.get(INSTANCE1); - XBase test1Bb = (XBase) - UnoRuntime.queryInterface( - XBase.class, test1Ba); - XDerived test1Bc = (XDerived) + XBase test1Bb = UnoRuntime.queryInterface( + XBase.class, test1Ba); + XDerived test1Bc = UnoRuntime.queryInterface( XDerived.class, test1Ba); Object test2Ba = test.get(INSTANCE2); - XBase test2Bb = (XBase) - UnoRuntime.queryInterface( - XBase.class, test2Ba); - XDerived test2Bc = (XDerived) + XBase test2Bb = UnoRuntime.queryInterface( + XBase.class, test2Ba); + XDerived test2Bc = UnoRuntime.queryInterface( XDerived.class, test2Ba); diff --git a/bridges/test/java_uno/nativethreadpool/Relay.java b/bridges/test/java_uno/nativethreadpool/Relay.java index b7e304c4a3c9..03cf6795c596 100644 --- a/bridges/test/java_uno/nativethreadpool/Relay.java +++ b/bridges/test/java_uno/nativethreadpool/Relay.java @@ -63,7 +63,7 @@ public final class Relay implements XRelay, XSource { final XAcceptor acceptor = Acceptor.create(context); final XBridgeFactory factory; try { - factory = (XBridgeFactory) UnoRuntime.queryInterface( + factory = UnoRuntime.queryInterface( XBridgeFactory.class, context.getServiceManager().createInstanceWithContext( "com.sun.star.bridge.BridgeFactory", context)); diff --git a/bridges/test/testclient.java b/bridges/test/testclient.java index 244264fa8686..e1733bbc8b10 100644 --- a/bridges/test/testclient.java +++ b/bridges/test/testclient.java @@ -121,7 +121,7 @@ public class testclient XConnector xConnector = - ( XConnector ) UnoRuntime.queryInterface( XConnector.class , x ); + UnoRuntime.queryInterface( XConnector.class , x ); XConnection xConnection = xConnector.connect(args[0]); @@ -138,7 +138,7 @@ public class testclient System.out.println( "after building bridge" ); // Object rInitialObject = m_bridge.mapInterfaceFrom(rootOid, XInterface.class); -// XTestFactory rFactory = (XTestFactory ) +// XTestFactory rFactory = // UnoRuntime.queryInterface(XTestFactory.class,rInitialObject ); // XCallMe callMerFactory-> diff --git a/cpputools/source/regcomplazy/regcomplazy.cxx b/cpputools/source/regcomplazy/regcomplazy.cxx index 69fd77446156..abcb2c187c08 100755 --- a/cpputools/source/regcomplazy/regcomplazy.cxx +++ b/cpputools/source/regcomplazy/regcomplazy.cxx @@ -131,6 +131,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) sBuffer.append(pBuffer, readSize); } } + fclose(fDescr); + fDescr = 0; // just to be sure noone tries to use the file ever after } OString sDescr = sBuffer.makeStringAndClear(); diff --git a/idlc/inc/idlc/options.hxx b/idlc/inc/idlc/options.hxx index e55dc961903b..11bc0fe4d657 100644 --- a/idlc/inc/idlc/options.hxx +++ b/idlc/inc/idlc/options.hxx @@ -69,11 +69,15 @@ public: const StringVector& getInputFiles() const { return m_inputFiles; } bool readStdin() const { return m_stdin; } + bool verbose() const { return m_verbose; } + bool quiet() const { return m_quiet; } protected: ::rtl::OString m_program; StringVector m_inputFiles; bool m_stdin; + bool m_verbose; + bool m_quiet; OptionMap m_options; }; diff --git a/idlc/source/idlcmain.cxx b/idlc/source/idlcmain.cxx index 1ce3a9fa05b0..68c1ae7cf5a5 100644 --- a/idlc/source/idlcmain.cxx +++ b/idlc/source/idlcmain.cxx @@ -56,11 +56,12 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) sal_Int32 nErrors = 0; if (options.readStdin()) { - fprintf( - stdout, "%s: compile stdin...\n", - options.getProgramName().getStr()); + if ( !options.quiet() ) + fprintf( + stdout, "%s: Compiling stdin\n", + options.getProgramName().getStr()); nErrors = compileFile(0); - if (idlc()->getWarningCount() > 0) { + if ( ( idlc()->getWarningCount() > 0 ) && !options.quiet() ) { fprintf( stdout, "%s: detected %lu warnings compiling stdin\n", options.getProgramName().getStr(), @@ -85,16 +86,23 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) idlc()->reset(); } StringVector const & files = options.getInputFiles(); + if ( options.verbose() ) + { + fprintf( stdout, "%s: compiling %i source files ... \n", + options.getProgramName().getStr(), (int)files.size() ); + fflush( stdout ); + } for (StringVector::const_iterator i(files.begin()); i != files.end() && nErrors == 0; ++i) { OString sysFileName( convertToAbsoluteSystemPath(*i) ); - fprintf(stdout, "%s: compile '%s' ... \n", - options.getProgramName().getStr(), (*i).getStr()); + if ( !options.quiet() ) + fprintf(stdout, "Compiling: %s\n", + (*i).getStr()); nErrors = compileFile(&sysFileName); - if ( idlc()->getWarningCount() ) + if ( idlc()->getWarningCount() && !options.quiet() ) fprintf(stdout, "%s: detected %lu warnings compiling file '%s'\n", options.getProgramName().getStr(), sal::static_int_cast< unsigned long >( @@ -128,15 +136,16 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) if ( nErrors > 0 ) { - fprintf(stdout, "%s: detected %ld errors%s", + fprintf(stderr, "%s: detected %ld errors%s", options.getProgramName().getStr(), sal::static_int_cast< long >(nErrors), options.prepareVersion().getStr()); } else { - fprintf(stdout, "%s: returned successful%s", - options.getProgramName().getStr(), - options.prepareVersion().getStr()); + if ( options.verbose() ) + fprintf(stdout, "%s: returned successful%s", + options.getProgramName().getStr(), + options.prepareVersion().getStr()); } return nErrors; } diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx index 6bfbcc9e443e..963ddafda8d0 100644 --- a/idlc/source/options.cxx +++ b/idlc/source/options.cxx @@ -37,7 +37,7 @@ using namespace rtl; -Options::Options(): m_stdin(false) +Options::Options(): m_stdin(false), m_verbose(false), m_quiet(false) { } @@ -190,6 +190,22 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile) } else throw IllegalArgument(OString(av[j]) + ", please check your input"); break; + case 'v': + if ( 0 == strcmp( &av[j][1], "verbose" ) ) + { + m_verbose = true; + } + else + throw IllegalArgument(OString(av[j]) + ", please check your input"); + break; + case 'q': + if ( 0 == strcmp( &av[j][1], "quiet" ) ) + { + m_quiet = true; + } + else + throw IllegalArgument(OString(av[j]) + ", please check your input"); + break; case 'w': if (av[j][2] == 'e' && av[j][3] == '\0') { if (m_options.count("-we") == 0) diff --git a/io/inc/makefile.mk b/io/inc/makefile.mk index 7a15edc58216..ce9aa9036c6a 100644 --- a/io/inc/makefile.mk +++ b/io/inc/makefile.mk @@ -36,16 +36,18 @@ TARGET=inc # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk - +.IF "$(L10N_framework)"=="" # --- Files -------------------------------------------------------- # --- Targets ------------------------------------------------------- +.ENDIF # L10N_framework .INCLUDE : target.mk - +.IF "$(L10N_framework)"=="" .IF "$(ENABLE_PCH)"!="" ALLTAR : \ $(SLO)$/precompiled.pch \ $(SLO)$/precompiled_ex.pch .ENDIF # "$(ENABLE_PCH)"!="" +.ENDIF # L10N_framework diff --git a/io/source/TextInputStream/makefile.mk b/io/source/TextInputStream/makefile.mk index fcca36f0e576..1fb5aa33743a 100644 --- a/io/source/TextInputStream/makefile.mk +++ b/io/source/TextInputStream/makefile.mk @@ -37,6 +37,7 @@ ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.IF "$(L10N_framework)"=="" DLLPRE = SLOFILES= \ @@ -59,5 +60,6 @@ SHL1RPATH= URELIB DEF1NAME= $(SHL1TARGET) # --- Targets ------------------------------------------------------ +.ENDIF # L10N_framework .INCLUDE : target.mk diff --git a/io/source/TextOutputStream/makefile.mk b/io/source/TextOutputStream/makefile.mk index 5359458ad8b4..7a4c0d6ba37f 100644 --- a/io/source/TextOutputStream/makefile.mk +++ b/io/source/TextOutputStream/makefile.mk @@ -37,6 +37,7 @@ ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.IF "$(L10N_framework)"=="" DLLPRE = # ------------------------------------------------------------------ @@ -60,5 +61,6 @@ SHL1RPATH= URELIB DEF1NAME= $(SHL1TARGET) # --- Targets ------------------------------------------------------ +.ENDIF # L10N_framework .INCLUDE : target.mk diff --git a/io/source/acceptor/makefile.mk b/io/source/acceptor/makefile.mk index b537b2087078..843f26296dae 100644 --- a/io/source/acceptor/makefile.mk +++ b/io/source/acceptor/makefile.mk @@ -40,6 +40,7 @@ COMPRDB=$(SOLARBINDIR)$/udkapi.rdb # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.IF "$(L10N_framework)"=="" DLLPRE = # ------------------------------------------------------------------ @@ -71,4 +72,6 @@ SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) # --- Targets ------------------------------------------------------ +.ENDIF # L10N_framework + .INCLUDE : target.mk diff --git a/io/source/connector/makefile.mk b/io/source/connector/makefile.mk index d726ac4c87c7..471f6b9d258f 100644 --- a/io/source/connector/makefile.mk +++ b/io/source/connector/makefile.mk @@ -40,6 +40,7 @@ COMPRDB=$(SOLARBINDIR)$/udkapi.rdb # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.IF "$(L10N_framework)"=="" DLLPRE = # ------------------------------------------------------------------ @@ -71,5 +72,6 @@ SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) # --- Targets ------------------------------------------------------ +.ENDIF # L10N_framework .INCLUDE : target.mk diff --git a/io/source/stm/makefile.mk b/io/source/stm/makefile.mk index e4b8ad326b1d..43b6f2566ddf 100644 --- a/io/source/stm/makefile.mk +++ b/io/source/stm/makefile.mk @@ -32,6 +32,7 @@ PRJ=..$/.. PRJNAME=io TARGET = streams.uno + ENABLE_EXCEPTIONS=TRUE NO_BSYMBOLIC=TRUE COMP1TYPELIST = stm @@ -39,6 +40,7 @@ COMPRDB=$(SOLARBINDIR)$/udkapi.rdb # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.IF "$(L10N_framework)"=="" DLLPRE = # --- Files -------------------------------------------------------- UNOUCRDEP=$(SOLARBINDIR)$/udkapi.rdb @@ -73,5 +75,7 @@ DEF1NAME= $(SHL1TARGET) # --- Targets ------------------------------------------------------ +.ENDIF # L10N_framework + .INCLUDE : target.mk diff --git a/io/test/makefile.mk b/io/test/makefile.mk index af032ba8efb1..b7acf670684f 100644 --- a/io/test/makefile.mk +++ b/io/test/makefile.mk @@ -41,6 +41,7 @@ ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.IF "$(L10N_framework)"=="" # --- Files -------------------------------------------------------- OBJFILES= $(OBJ)$/testcomponent.obj \ @@ -90,5 +91,6 @@ $(BIN)$/applicat.rdb: $(SOLARBINDIR)$/udkapi.rdb rm -f $@ regmerge $@ / $? +.ENDIF # L10N_framework .INCLUDE : target.mk diff --git a/io/test/stm/makefile.mk b/io/test/stm/makefile.mk index cb5f6b0c803a..01d334edb998 100644 --- a/io/test/stm/makefile.mk +++ b/io/test/stm/makefile.mk @@ -37,6 +37,7 @@ ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.IF "$(L10N_framework)"=="" # --- Files -------------------------------------------------------- UNOUCRDEP=$(SOLARBINDIR)$/udkapi.rdb UNOUCRRDB=$(SOLARBINDIR)$/udkapi.rdb @@ -97,5 +98,6 @@ DEF1EXPORTFILE= exports.dxp # --- Targets ------------------------------------------------------ +.ENDIF # L10N_framework .INCLUDE : target.mk diff --git a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java index c5037b2f1566..d80b8a6b9df0 100644 --- a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java +++ b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java @@ -67,7 +67,7 @@ import java.util.Random; Other services can be inserted into the service manager by using its XSet interface: <pre> - XSet xSet = (XSet)UnoRuntime.queryInterface( XSet.class, aMultiComponentFactory ); + XSet xSet = UnoRuntime.queryInterface( XSet.class, aMultiComponentFactory ); // insert the service manager xSet.insert( aSingleComponentFactory ); </pre> @@ -108,20 +108,20 @@ public class Bootstrap { static public XComponentContext createInitialComponentContext( Hashtable context_entries ) throws Exception { - XImplementationLoader xImpLoader = (XImplementationLoader)UnoRuntime.queryInterface( + XImplementationLoader xImpLoader = UnoRuntime.queryInterface( XImplementationLoader.class, new JavaLoader() ); // Get the factory of the ServiceManager - XSingleComponentFactory smgr_fac = (XSingleComponentFactory)UnoRuntime.queryInterface( + XSingleComponentFactory smgr_fac = UnoRuntime.queryInterface( XSingleComponentFactory.class, xImpLoader.activate( "com.sun.star.comp.servicemanager.ServiceManager", null, null, null ) ); // Create an instance of the ServiceManager - XMultiComponentFactory xSMgr = (XMultiComponentFactory)UnoRuntime.queryInterface( + XMultiComponentFactory xSMgr = UnoRuntime.queryInterface( XMultiComponentFactory.class, smgr_fac.createInstanceWithContext( null ) ); // post init loader - XInitialization xInit = (XInitialization)UnoRuntime.queryInterface( + XInitialization xInit = UnoRuntime.queryInterface( XInitialization.class, xImpLoader ); Object[] args = new Object [] { xSMgr }; xInit.initialize( args ); @@ -137,12 +137,12 @@ public class Bootstrap { XComponentContext xContext = new ComponentContext( context_entries, null ); // post init smgr - xInit = (XInitialization)UnoRuntime.queryInterface( + xInit = UnoRuntime.queryInterface( XInitialization.class, xSMgr ); args = new Object [] { null, xContext }; // no registry, default context xInit.initialize( args ); - XSet xSet = (XSet)UnoRuntime.queryInterface( XSet.class, xSMgr ); + XSet xSet = UnoRuntime.queryInterface( XSet.class, xSMgr ); // insert the service manager xSet.insert( smgr_fac ); // and basic jurt factories @@ -159,7 +159,7 @@ public class Bootstrap { */ static public XMultiServiceFactory createSimpleServiceManager() throws Exception { - return (XMultiServiceFactory)UnoRuntime.queryInterface( + return UnoRuntime.queryInterface( XMultiServiceFactory.class, createInitialComponentContext( null ).getServiceManager() ); } @@ -206,7 +206,7 @@ public class Bootstrap { NativeLibraryLoader.loadLibrary( Bootstrap.class.getClassLoader(), "juh" ); m_loaded_juh = true; } - return (XComponentContext)UnoRuntime.queryInterface( + return UnoRuntime.queryInterface( XComponentContext.class, cppuhelper_bootstrap( ini_file, pairs, Bootstrap.class.getClassLoader() ) ); @@ -283,7 +283,7 @@ public class Bootstrap { try { // try to connect to office Object context = xUrlResolver.resolve( sConnect ); - xContext = (XComponentContext) UnoRuntime.queryInterface( + xContext = UnoRuntime.queryInterface( XComponentContext.class, context); if ( xContext == null ) throw new BootstrapException( "no component context!" ); diff --git a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java index 938cc0543901..1c3df0d4844b 100644 --- a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java +++ b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java @@ -101,7 +101,7 @@ public class ComponentContext implements XComponentContext, XComponent { o = ((ComponentContextEntry)o).m_value; } - m_xSMgr = (XMultiComponentFactory)UnoRuntime.queryInterface( + m_xSMgr = UnoRuntime.queryInterface( XMultiComponentFactory.class, o ); } if (m_xSMgr != null) @@ -114,7 +114,7 @@ public class ComponentContext implements XComponentContext, XComponent } // listen for delegate - XComponent xComp = (XComponent)UnoRuntime.queryInterface( + XComponent xComp = UnoRuntime.queryInterface( XComponent.class, m_xDelegate ); if (xComp != null) { @@ -154,7 +154,7 @@ public class ComponentContext implements XComponentContext, XComponent else { XSingleComponentFactory xCompFac = - (XSingleComponentFactory)UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XSingleComponentFactory.class, entry.m_lateInit ); if (xCompFac != null) { @@ -185,7 +185,7 @@ public class ComponentContext implements XComponentContext, XComponent else // inited in the meantime { // dispose fresh service instance - XComponent xComp = (XComponent)UnoRuntime.queryInterface( + XComponent xComp = UnoRuntime.queryInterface( XComponent.class, xInstance ); if (xComp != null) { @@ -253,7 +253,7 @@ public class ComponentContext implements XComponentContext, XComponent o = ((ComponentContextEntry)o).m_value; } - XComponent xComp = (XComponent)UnoRuntime.queryInterface( XComponent.class, o ); + XComponent xComp = UnoRuntime.queryInterface( XComponent.class, o ); if (xComp != null) { if (name.equals( TDMGR_NAME )) @@ -272,7 +272,7 @@ public class ComponentContext implements XComponentContext, XComponent // smgr if (m_bDisposeSMgr) { - XComponent xComp = (XComponent)UnoRuntime.queryInterface( + XComponent xComp = UnoRuntime.queryInterface( XComponent.class, m_xSMgr ); if (xComp != null) { diff --git a/javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java b/javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java index 4b5db3753da3..9523fbba7716 100644 --- a/javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java +++ b/javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java @@ -124,7 +124,7 @@ public class RegistryServiceFactory { Object obj = createRegistryServiceFactory( writeRegistryFile, readRegistryFile, readOnly, RegistryServiceFactory.class.getClassLoader() ); - return (XMultiServiceFactory) UnoRuntime.queryInterface( + return UnoRuntime.queryInterface( XMultiServiceFactory.class, obj ); } diff --git a/javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java b/javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java index eda51f8cb1f7..a1bf4d3a168c 100644 --- a/javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java +++ b/javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java @@ -85,7 +85,7 @@ public class SharedLibraryLoader { XMultiServiceFactory smgr, XRegistryKey regKey ) { - return (XSingleServiceFactory) UnoRuntime.queryInterface( + return UnoRuntime.queryInterface( XSingleServiceFactory.class, component_getFactory( DEFAULT_LIBRARY, DEFAULT_IMPLEMENTATION, smgr, regKey, @@ -110,7 +110,7 @@ public class SharedLibraryLoader { XMultiServiceFactory smgr, XRegistryKey regKey ) { - return (XSingleServiceFactory) UnoRuntime.queryInterface( + return UnoRuntime.queryInterface( XSingleServiceFactory.class, component_getFactory( libName, impName, smgr, regKey, diff --git a/javaunohelper/com/sun/star/comp/juhtest/SmoketestCommandEnvironment.java b/javaunohelper/com/sun/star/comp/juhtest/SmoketestCommandEnvironment.java index cafa7e0a412d..a508a209ad2c 100644 --- a/javaunohelper/com/sun/star/comp/juhtest/SmoketestCommandEnvironment.java +++ b/javaunohelper/com/sun/star/comp/juhtest/SmoketestCommandEnvironment.java @@ -119,7 +119,6 @@ class InteractionImpl implements com.sun.star.task.XInteractionHandler if (approve) { com.sun.star.task.XInteractionApprove xApprove = - (com.sun.star.task.XInteractionApprove) UnoRuntime.queryInterface(com.sun.star.task.XInteractionApprove.class, conts[i]); if (xApprove != null) xApprove.select(); @@ -129,7 +128,6 @@ class InteractionImpl implements com.sun.star.task.XInteractionHandler else if (abort) { com.sun.star.task.XInteractionAbort xAbort = - (com.sun.star.task.XInteractionAbort) UnoRuntime.queryInterface(com.sun.star.task.XInteractionAbort.class, conts[i]); if (xAbort != null) xAbort.select(); diff --git a/javaunohelper/com/sun/star/lib/uno/helper/Factory.java b/javaunohelper/com/sun/star/lib/uno/helper/Factory.java index 6eb261ff0eb8..5842c8eaf7f4 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/Factory.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/Factory.java @@ -210,7 +210,7 @@ public class Factory throws com.sun.star.uno.Exception { Object inst = instantiate( xContext ); - XInitialization xInit = (XInitialization)UnoRuntime.queryInterface( + XInitialization xInit = UnoRuntime.queryInterface( XInitialization.class, inst ); if (null == xInit) { diff --git a/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java b/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java index 44a6be5e5f7a..d7bc61cbcbad 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java @@ -715,7 +715,7 @@ public class InterfaceContainer implements Cloneable try { Object o= aIt.next(); - XEventListener evtListener= (XEventListener) UnoRuntime.queryInterface( + XEventListener evtListener= UnoRuntime.queryInterface( XEventListener.class, o); if( evtListener != null ) evtListener.disposing( evt ); diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java index b4b2d02ab148..d77c1600def3 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java @@ -671,7 +671,7 @@ XMultiPropertySet // We try to get an XInterface of setVal and set an XInterface type. if (setVal instanceof XInterface) { - XInterface xint= (XInterface) UnoRuntime.queryInterface(XInterface.class, setVal); + XInterface xint= UnoRuntime.queryInterface(XInterface.class, setVal); if (xint != null) convObj= new Any(new Type(XInterface.class), xint); } diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java index af33c5ea3ee9..40c69a90f8a6 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java @@ -143,13 +143,13 @@ public final class PropertySetMixin { idlClass = getReflection(type.getTypeName()); XTypeDescription ifc; try { - ifc = (XTypeDescription) UnoRuntime.queryInterface( + ifc = UnoRuntime.queryInterface( XTypeDescription.class, - (((XHierarchicalNameAccess) UnoRuntime.queryInterface( - XHierarchicalNameAccess.class, - context.getValueByName( - "/singletons/com.sun.star.reflection." - + "theTypeDescriptionManager"))). + (UnoRuntime.queryInterface( + XHierarchicalNameAccess.class, + context.getValueByName( + "/singletons/com.sun.star.reflection." + + "theTypeDescriptionManager")). getByHierarchicalName(type.getTypeName()))); } catch (NoSuchElementException e) { throw new RuntimeException( @@ -585,7 +585,7 @@ public final class PropertySetMixin { private XIdlClass getReflection(String typeName) { XIdlReflection refl; try { - refl = (XIdlReflection) UnoRuntime.queryInterface( + refl = UnoRuntime.queryInterface( XIdlReflection.class, context.getServiceManager().createInstanceWithContext( "com.sun.star.reflection.CoreReflection", context)); @@ -599,8 +599,7 @@ public final class PropertySetMixin { try { return refl.forName(typeName); } finally { - XComponent comp = (XComponent) UnoRuntime.queryInterface( - XComponent.class, refl); + XComponent comp = UnoRuntime.queryInterface(XComponent.class, refl); if (comp != null) { comp.dispose(); } @@ -610,9 +609,8 @@ public final class PropertySetMixin { private void initProperties( XTypeDescription type, HashMap map, ArrayList handleNames, HashSet seen) { - XInterfaceTypeDescription2 ifc = (XInterfaceTypeDescription2) - UnoRuntime.queryInterface( - XInterfaceTypeDescription2.class, resolveTypedefs(type)); + XInterfaceTypeDescription2 ifc = UnoRuntime.queryInterface( + XInterfaceTypeDescription2.class, resolveTypedefs(type)); if (seen.add(ifc.getName())) { XTypeDescription[] bases = ifc.getBaseTypes(); for (int i = 0; i < bases.length; ++i) { @@ -622,11 +620,10 @@ public final class PropertySetMixin { for (int i = 0; i < members.length; ++i) { if (members[i].getTypeClass() == TypeClass.INTERFACE_ATTRIBUTE) { - XInterfaceAttributeTypeDescription2 attr - = ((XInterfaceAttributeTypeDescription2) - UnoRuntime.queryInterface( - XInterfaceAttributeTypeDescription2.class, - members[i])); + XInterfaceAttributeTypeDescription2 attr = + UnoRuntime.queryInterface( + XInterfaceAttributeTypeDescription2.class, + members[i]); short attrAttribs = 0; if (attr.isBound()) { attrAttribs |= PropertyAttribute.BOUND; @@ -685,7 +682,7 @@ public final class PropertySetMixin { break; } attrAttribs |= n; - t = ((XStructTypeDescription) UnoRuntime.queryInterface( + t = (UnoRuntime.queryInterface( XStructTypeDescription.class, t)). getTypeArguments()[0]; } @@ -747,14 +744,14 @@ public final class PropertySetMixin { object, illegalArgumentPosition); } - XIdlField2 f = (XIdlField2) UnoRuntime.queryInterface( + XIdlField2 f = UnoRuntime.queryInterface( XIdlField2.class, idlClass.getField(name)); Object[] o = new Object[] { new Any(type, UnoRuntime.queryInterface(type, object)) }; Object v = wrapValue( value, - ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, idlClass.getField(name))).getType(), + UnoRuntime.queryInterface( + XIdlField2.class, idlClass.getField(name)).getType(), (p.property.Attributes & PropertyAttribute.MAYBEAMBIGUOUS) != 0, isAmbiguous, (p.property.Attributes & PropertyAttribute.MAYBEDEFAULT) != 0, @@ -807,7 +804,7 @@ public final class PropertySetMixin { if (p == null) { throw new UnknownPropertyException(name, object); } - XIdlField2 field = (XIdlField2) UnoRuntime.queryInterface( + XIdlField2 field = UnoRuntime.queryInterface( XIdlField2.class, idlClass.getField(name)); Object value; try { @@ -848,12 +845,12 @@ public final class PropertySetMixin { XIdlClass ambiguous = getReflection(typeName); try { isAmbiguous = AnyConverter.toBoolean( - ((XIdlField2) UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XIdlField2.class, - ambiguous.getField("IsAmbiguous"))).get(value)); - value = ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, - ambiguous.getField("Value"))).get(value); + ambiguous.getField("IsAmbiguous")).get(value)); + value = UnoRuntime.queryInterface( + XIdlField2.class, + ambiguous.getField("Value")).get(value); } catch (com.sun.star.lang.IllegalArgumentException e) { throw new RuntimeException( "unexpected" @@ -867,12 +864,12 @@ public final class PropertySetMixin { XIdlClass defaulted = getReflection(typeName); try { isDefaulted = AnyConverter.toBoolean( - ((XIdlField2) UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XIdlField2.class, - defaulted.getField("IsDefaulted"))).get(value)); - value = ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, - defaulted.getField("Value"))).get(value); + defaulted.getField("IsDefaulted")).get(value)); + value = UnoRuntime.queryInterface( + XIdlField2.class, + defaulted.getField("Value")).get(value); } catch (com.sun.star.lang.IllegalArgumentException e) { throw new RuntimeException( "unexpected" @@ -886,16 +883,16 @@ public final class PropertySetMixin { XIdlClass optional = getReflection(typeName); try { boolean present = AnyConverter.toBoolean( - ((XIdlField2) UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XIdlField2.class, - optional.getField("IsPresent"))).get(value)); + optional.getField("IsPresent")).get(value)); if (!present) { value = Any.VOID; break; } - value = ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, - optional.getField("Value"))).get(value); + value = UnoRuntime.queryInterface( + XIdlField2.class, + optional.getField("Value")).get(value); } catch (com.sun.star.lang.IllegalArgumentException e) { throw new RuntimeException( "unexpected" @@ -932,15 +929,15 @@ public final class PropertySetMixin { Object[] strct = new Object[1]; type.createObject(strct); try { - XIdlField2 field = (XIdlField2) UnoRuntime.queryInterface( + XIdlField2 field = UnoRuntime.queryInterface( XIdlField2.class, type.getField("Value")); field.set( strct, wrapValue( value, field.getType(), false, false, wrapDefaulted, isDefaulted, wrapOptional)); - ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, type.getField("IsAmbiguous"))).set( + UnoRuntime.queryInterface( + XIdlField2.class, type.getField("IsAmbiguous")).set( strct, new Boolean(isAmbiguous)); } catch (com.sun.star.lang.IllegalArgumentException e) { throw new RuntimeException( @@ -959,15 +956,15 @@ public final class PropertySetMixin { Object[] strct = new Object[1]; type.createObject(strct); try { - XIdlField2 field = (XIdlField2) UnoRuntime.queryInterface( + XIdlField2 field = UnoRuntime.queryInterface( XIdlField2.class, type.getField("Value")); field.set( strct, wrapValue( value, field.getType(), wrapAmbiguous, isAmbiguous, false, false, wrapOptional)); - ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, type.getField("IsDefaulted"))).set( + UnoRuntime.queryInterface( + XIdlField2.class, type.getField("IsDefaulted")).set( strct, new Boolean(isDefaulted)); } catch (com.sun.star.lang.IllegalArgumentException e) { throw new RuntimeException( @@ -986,11 +983,11 @@ public final class PropertySetMixin { type.createObject(strct); boolean present = !AnyConverter.isVoid(value); try { - ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, type.getField("IsPresent"))).set( + UnoRuntime.queryInterface( + XIdlField2.class, type.getField("IsPresent")).set( strct, new Boolean(present)); if (present) { - XIdlField2 field = (XIdlField2) UnoRuntime.queryInterface( + XIdlField2 field = UnoRuntime.queryInterface( XIdlField2.class, type.getField("Value")); field.set( strct, @@ -1018,9 +1015,8 @@ public final class PropertySetMixin { private static XTypeDescription resolveTypedefs(XTypeDescription type) { while (type.getTypeClass() == TypeClass.TYPEDEF) { - type = ((XIndirectTypeDescription) UnoRuntime.queryInterface( - XIndirectTypeDescription.class, type)). - getReferencedType(); + type = UnoRuntime.queryInterface( + XIndirectTypeDescription.class, type).getReferencedType(); } return type; } diff --git a/javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java b/javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java index 9c330539e620..b94b85771d8d 100644 --- a/javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java +++ b/javaunohelper/test/com/sun/star/comp/helper/Bootstrap_Test.java @@ -62,7 +62,7 @@ public class Bootstrap_Test { "no /singletons/com.sun.star.reflection.theTypeDescriptionManager!" ); } - XMultiServiceFactory msf = (XMultiServiceFactory)UnoRuntime.queryInterface( + XMultiServiceFactory msf = UnoRuntime.queryInterface( XMultiServiceFactory.class, xContext.getServiceManager() ); String services[] = msf.getAvailableServiceNames(); System.out.println("Available services are:"); @@ -74,7 +74,7 @@ public class Bootstrap_Test { for ( int i=0; i<services.length; i++ ) System.out.println(services[i]); - XComponent xComp = (XComponent)UnoRuntime.queryInterface( + XComponent xComp = UnoRuntime.queryInterface( XComponent.class, xContext ); xComp.dispose(); diff --git a/javaunohelper/test/com/sun/star/comp/helper/ComponentContext_Test.java b/javaunohelper/test/com/sun/star/comp/helper/ComponentContext_Test.java index 1188f8752135..f88864f2d3ba 100644 --- a/javaunohelper/test/com/sun/star/comp/helper/ComponentContext_Test.java +++ b/javaunohelper/test/com/sun/star/comp/helper/ComponentContext_Test.java @@ -88,7 +88,7 @@ public class ComponentContext_Test { System.err.println( "### bootstrap context test failed: 2!" ); } - XComponent xComp = (XComponent)UnoRuntime.queryInterface( + XComponent xComp = UnoRuntime.queryInterface( XComponent.class, xInitialContext ); xComp.dispose(); } diff --git a/javaunohelper/test/com/sun/star/comp/helper/SharedLibraryLoader_Test.java b/javaunohelper/test/com/sun/star/comp/helper/SharedLibraryLoader_Test.java index d12e1accf797..fc4c2c06f463 100644 --- a/javaunohelper/test/com/sun/star/comp/helper/SharedLibraryLoader_Test.java +++ b/javaunohelper/test/com/sun/star/comp/helper/SharedLibraryLoader_Test.java @@ -91,7 +91,7 @@ public class SharedLibraryLoader_Test { if ( ! test_getSharedLibraryLoaderFactory() ) return false; - sharedLibraryLoader = (XImplementationLoader) UnoRuntime.queryInterface( + sharedLibraryLoader = UnoRuntime.queryInterface( XImplementationLoader.class, sharedLibraryLoaderFactory.createInstance() ); System.out.print("Test - "); @@ -115,11 +115,11 @@ public class SharedLibraryLoader_Test { System.err.println("- get the native ServiceManger factory"); XSingleServiceFactory aSMgrFac = - (XSingleServiceFactory) UnoRuntime.queryInterface( XSingleServiceFactory.class, + UnoRuntime.queryInterface( XSingleServiceFactory.class, sharedLibraryLoader.activate(NATIVE_SERVICE_MANAGER_IMP_NAME, null, NATIVE_SERVICE_MANAGER_LIB_NAME, null)); System.err.println("- instantiate the native ServiceManger"); - nativeServiceManager = (XMultiServiceFactory) UnoRuntime.queryInterface( XMultiServiceFactory.class, aSMgrFac.createInstance() ); + nativeServiceManager = UnoRuntime.queryInterface( XMultiServiceFactory.class, aSMgrFac.createInstance() ); System.out.print("Test - "); System.out.println(nativeServiceManager == null? "failed" : "successfull"); @@ -141,12 +141,12 @@ public class SharedLibraryLoader_Test { System.err.println("- get factory of the Registry"); XSingleServiceFactory aRegFac = - (XSingleServiceFactory) UnoRuntime.queryInterface( XSingleServiceFactory.class, + UnoRuntime.queryInterface( XSingleServiceFactory.class, sharedLibraryLoader.activate(NATIVE_REGISTRY_IMP_NAME, null, NATIVE_REGISTRY_LIB_NAME, null) ); System.err.println("- instantiate the Registry"); simpleRegistry = - (XSimpleRegistry) UnoRuntime.queryInterface( XSimpleRegistry.class, aRegFac.createInstance() ); + UnoRuntime.queryInterface( XSimpleRegistry.class, aRegFac.createInstance() ); System.out.print("Test - "); System.out.println(simpleRegistry == null? "failed" : "successfull"); System.out.println("*******************************************************************"); diff --git a/javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java b/javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java index 1629920ad481..46e7f60b7def 100644 --- a/javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java +++ b/javaunohelper/test/com/sun/star/lib/uno/helper/ComponentBase_Test.java @@ -67,9 +67,9 @@ public class ComponentBase_Test comp.addEventListener(obj1); comp.addEventListener(obj2); comp.addEventListener(obj3); - comp.addEventListener((XEventListener) UnoRuntime.queryInterface(XEventListener.class, proxyObj1Weak1)); - comp.addEventListener((XEventListener) UnoRuntime.queryInterface(XEventListener.class, proxyObj3Weak2)); - comp.addEventListener((XEventListener) UnoRuntime.queryInterface(XEventListener.class, proxyObj3TypeProv)); + comp.addEventListener(UnoRuntime.queryInterface(XEventListener.class, proxyObj1Weak1)); + comp.addEventListener(UnoRuntime.queryInterface(XEventListener.class, proxyObj3Weak2)); + comp.addEventListener(UnoRuntime.queryInterface(XEventListener.class, proxyObj3TypeProv)); obj1.nDisposingCalled = 0; obj2.nDisposingCalled = 0; obj3.nDisposingCalled = 0; diff --git a/javaunohelper/test/com/sun/star/lib/uno/helper/Factory_Test.java b/javaunohelper/test/com/sun/star/lib/uno/helper/Factory_Test.java index 2732fa54331a..732db947b97a 100644 --- a/javaunohelper/test/com/sun/star/lib/uno/helper/Factory_Test.java +++ b/javaunohelper/test/com/sun/star/lib/uno/helper/Factory_Test.java @@ -120,7 +120,7 @@ public class Factory_Test //============================================================================================== static void service_info_test( Object inst ) { - XServiceInfo xInfo = (XServiceInfo)UnoRuntime.queryInterface( XServiceInfo.class, inst ); + XServiceInfo xInfo = UnoRuntime.queryInterface( XServiceInfo.class, inst ); if (! xInfo.getImplementationName().equals( m_impl_name )) { @@ -159,7 +159,7 @@ public class Factory_Test // bootstrap service manager XMultiServiceFactory xMgr = RegistryServiceFactory.create( rdb ); - XPropertySet xProps = (XPropertySet)UnoRuntime.queryInterface( + XPropertySet xProps = UnoRuntime.queryInterface( XPropertySet.class, xMgr ); XComponentContext xContext = (XComponentContext)AnyConverter.toObject( new Type( XComponentContext.class ), xProps.getPropertyValue( "DefaultContext" ) ); @@ -172,7 +172,7 @@ public class Factory_Test new Type( XSimpleRegistry.class ), xProps.getPropertyValue( "Registry" ) ); // register impl XImplementationRegistration xImpReg = - (XImplementationRegistration)UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XImplementationRegistration.class, xContext.getServiceManager().createInstanceWithContext( "com.sun.star.registry.ImplementationRegistration", xContext ) ); @@ -196,7 +196,7 @@ public class Factory_Test m_supported_services[ nPos ], xContext ) ); } - XComponent xComp = (XComponent)UnoRuntime.queryInterface( XComponent.class, xContext ); + XComponent xComp = UnoRuntime.queryInterface( XComponent.class, xContext ); xComp.dispose(); } catch (Exception exc) diff --git a/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java b/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java index 819ef024acfa..6dd90b3dd590 100644 --- a/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java +++ b/jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java @@ -134,7 +134,7 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ { if (hasName) { IBridge iBridges[] = UnoRuntime.getBridges(); for(int i = 0; i < iBridges.length; ++ i) { - XBridge xBridge = (XBridge)UnoRuntime.queryInterface(XBridge.class, iBridges[i]); + XBridge xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]); if(xBridge != null) { if(xBridge.getName().equals(sName)) @@ -148,7 +148,7 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ { try { IBridge iBridge = UnoRuntime.getBridgeByName("java", context, "remote", context, hasName ? new Object[]{sProtocol, aConnection, anInstanceProvider, sName} : new Object[]{sProtocol, aConnection, anInstanceProvider}); - xBridge = (XBridge)UnoRuntime.queryInterface(XBridge.class, iBridge); + xBridge = UnoRuntime.queryInterface(XBridge.class, iBridge); } catch(Exception exception) { throw new com.sun.star.lang.IllegalArgumentException(exception.getMessage()); @@ -171,7 +171,7 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ { IBridge iBridges[] = UnoRuntime.getBridges(); for(int i = 0; i < iBridges.length; ++ i) { - xBridge = (XBridge)UnoRuntime.queryInterface(XBridge.class, iBridges[i]); + xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]); if(xBridge != null) { if(xBridge.getName().equals(sName)) @@ -199,7 +199,7 @@ public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ { IBridge iBridges[] = UnoRuntime.getBridges(); for(int i = 0; i < iBridges.length; ++ i) { - XBridge xBridge = (XBridge)UnoRuntime.queryInterface(XBridge.class, iBridges[i]); + XBridge xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]); if(xBridge != null) vector.addElement(xBridge); diff --git a/jurt/com/sun/star/comp/loader/FactoryHelper.java b/jurt/com/sun/star/comp/loader/FactoryHelper.java index 451e387eb7d6..83c1c567509f 100644 --- a/jurt/com/sun/star/comp/loader/FactoryHelper.java +++ b/jurt/com/sun/star/comp/loader/FactoryHelper.java @@ -174,7 +174,7 @@ public class FactoryHelper { { if (xContext != null) { - return (XMultiServiceFactory)UnoRuntime.queryInterface( + return UnoRuntime.queryInterface( XMultiServiceFactory.class, xContext.getServiceManager() ); } else @@ -302,7 +302,7 @@ public class FactoryHelper { Object instance = _constructor.newInstance( args ); if (bInitCall) { - XInitialization xInitialization = (XInitialization)UnoRuntime.queryInterface( + XInitialization xInitialization = UnoRuntime.queryInterface( XInitialization.class, instance ); if (xInitialization != null) { diff --git a/jurt/com/sun/star/comp/loader/JavaLoader.java b/jurt/com/sun/star/comp/loader/JavaLoader.java index 3565be7031a3..cf0d9995d7f6 100644 --- a/jurt/com/sun/star/comp/loader/JavaLoader.java +++ b/jurt/com/sun/star/comp/loader/JavaLoader.java @@ -102,7 +102,7 @@ public class JavaLoader implements XImplementationLoader, { if (m_xMacroExpander == null) { - XPropertySet xProps = (XPropertySet) + XPropertySet xProps = UnoRuntime.queryInterface( XPropertySet.class, multiServiceFactory ); if (xProps == null) diff --git a/jurt/com/sun/star/comp/servicemanager/ServiceManager.java b/jurt/com/sun/star/comp/servicemanager/ServiceManager.java index adb0c54c7e28..b791c6501a36 100644 --- a/jurt/com/sun/star/comp/servicemanager/ServiceManager.java +++ b/jurt/com/sun/star/comp/servicemanager/ServiceManager.java @@ -158,7 +158,7 @@ public class ServiceManager implements XMultiServiceFactory, if (loaderObj == null) throw new com.sun.star.uno.Exception("Can get an instance of com.sun.star.loader.Java"); - return (XImplementationLoader) UnoRuntime.queryInterface( XImplementationLoader.class, loaderObj ); + return UnoRuntime.queryInterface( XImplementationLoader.class, loaderObj ); } /** @@ -380,7 +380,7 @@ public class ServiceManager implements XMultiServiceFactory, Object fac = queryServiceFactory( rServiceSpecifier ); if (fac != null) { - XSingleComponentFactory xCompFac = (XSingleComponentFactory)UnoRuntime.queryInterface( + XSingleComponentFactory xCompFac = UnoRuntime.queryInterface( XSingleComponentFactory.class, fac ); if (xCompFac != null) { @@ -388,7 +388,7 @@ public class ServiceManager implements XMultiServiceFactory, } else { - XSingleServiceFactory xServiceFac = (XSingleServiceFactory)UnoRuntime.queryInterface( + XSingleServiceFactory xServiceFac = UnoRuntime.queryInterface( XSingleServiceFactory.class, fac ); if (xServiceFac != null) { @@ -422,7 +422,7 @@ public class ServiceManager implements XMultiServiceFactory, Object fac = queryServiceFactory( rServiceSpecifier ); if (fac != null) { - XSingleComponentFactory xCompFac = (XSingleComponentFactory)UnoRuntime.queryInterface( + XSingleComponentFactory xCompFac = UnoRuntime.queryInterface( XSingleComponentFactory.class, fac ); if (xCompFac != null) { @@ -430,7 +430,7 @@ public class ServiceManager implements XMultiServiceFactory, } else { - XSingleServiceFactory xServiceFac = (XSingleServiceFactory)UnoRuntime.queryInterface( + XSingleServiceFactory xServiceFac = UnoRuntime.queryInterface( XSingleServiceFactory.class, fac ); if (xServiceFac != null) { @@ -528,7 +528,7 @@ public class ServiceManager implements XMultiServiceFactory, if (object == null) throw new com.sun.star.uno.RuntimeException("The parameter must not been null"); - XServiceInfo xServiceInfo = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, object); + XServiceInfo xServiceInfo = UnoRuntime.queryInterface(XServiceInfo.class, object); if (xServiceInfo != null) { return UnoRuntime.areSame(factoriesByImplNames.get(xServiceInfo.getImplementationName()), object); @@ -552,7 +552,7 @@ public class ServiceManager implements XMultiServiceFactory, if (object == null) throw new com.sun.star.lang.IllegalArgumentException(); XServiceInfo xServiceInfo = - (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, object); + UnoRuntime.queryInterface(XServiceInfo.class, object); if (xServiceInfo == null) throw new com.sun.star.lang.IllegalArgumentException( @@ -606,7 +606,7 @@ public class ServiceManager implements XMultiServiceFactory, ); XServiceInfo xServiceInfo = - (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, object); + UnoRuntime.queryInterface(XServiceInfo.class, object); if (xServiceInfo == null) throw new com.sun.star.lang.IllegalArgumentException( @@ -614,7 +614,7 @@ public class ServiceManager implements XMultiServiceFactory, ); XSingleServiceFactory xSingleServiceFactory = - (XSingleServiceFactory) UnoRuntime.queryInterface(XSingleServiceFactory.class, object); + UnoRuntime.queryInterface(XSingleServiceFactory.class, object); if (xSingleServiceFactory == null) throw new com.sun.star.lang.IllegalArgumentException( diff --git a/jurt/com/sun/star/comp/urlresolver/UrlResolver.java b/jurt/com/sun/star/comp/urlresolver/UrlResolver.java index cabd51d42404..6c63ccbd8490 100644 --- a/jurt/com/sun/star/comp/urlresolver/UrlResolver.java +++ b/jurt/com/sun/star/comp/urlresolver/UrlResolver.java @@ -102,7 +102,7 @@ public class UrlResolver { Object rootObject = null; XBridgeFactory xBridgeFactory= null; try { - xBridgeFactory = (XBridgeFactory)UnoRuntime.queryInterface(XBridgeFactory.class, + xBridgeFactory = UnoRuntime.queryInterface(XBridgeFactory.class, _xMultiServiceFactory.createInstance("com.sun.star.bridge.BridgeFactory")); } catch (com.sun.star.uno.Exception e) { throw new com.sun.star.uno.RuntimeException(e.getMessage()); @@ -117,7 +117,7 @@ public class UrlResolver { throw new com.sun.star.uno.RuntimeException(e.getMessage()); } - XConnector connector_xConnector = (XConnector)UnoRuntime.queryInterface(XConnector.class, connector); + XConnector connector_xConnector = UnoRuntime.queryInterface(XConnector.class, connector); // connect to the server XConnection xConnection = connector_xConnector.connect(conDcp); diff --git a/jurt/com/sun/star/uno/WeakReference.java b/jurt/com/sun/star/uno/WeakReference.java index 3c954efe1cf9..fc3b6f8100ba 100644 --- a/jurt/com/sun/star/uno/WeakReference.java +++ b/jurt/com/sun/star/uno/WeakReference.java @@ -61,7 +61,7 @@ public class WeakReference Object weakImpl= obj.get(); if (weakImpl != null) { - XWeak weak= (XWeak) UnoRuntime.queryInterface(XWeak.class, weakImpl); + XWeak weak= UnoRuntime.queryInterface(XWeak.class, weakImpl); if (weak != null) { XAdapter adapter= (XAdapter) weak.queryAdapter(); @@ -77,7 +77,7 @@ public class WeakReference */ public WeakReference(Object obj) { - XWeak weak= (XWeak) UnoRuntime.queryInterface(XWeak.class, obj); + XWeak weak= UnoRuntime.queryInterface(XWeak.class, obj); if (weak != null) { XAdapter adapter= (XAdapter) weak.queryAdapter(); diff --git a/jurt/demo/com/sun/star/demo/DemoServer.java b/jurt/demo/com/sun/star/demo/DemoServer.java index 8715215dcc70..5b0b8201f274 100644 --- a/jurt/demo/com/sun/star/demo/DemoServer.java +++ b/jurt/demo/com/sun/star/demo/DemoServer.java @@ -92,12 +92,12 @@ public class DemoServer { ServiceManager serviceManager = new ServiceManager(); serviceManager.addFactories(neededServices); - XAcceptor xAcceptor = (XAcceptor)UnoRuntime.queryInterface(XAcceptor.class, serviceManager.createInstance("com.sun.star.connection.Acceptor")); + XAcceptor xAcceptor = UnoRuntime.queryInterface(XAcceptor.class, serviceManager.createInstance("com.sun.star.connection.Acceptor")); System.err.println("waiting for connect..."); XConnection xConnection = xAcceptor.accept(conDcp); - XBridgeFactory xBridgeFactory = (XBridgeFactory)UnoRuntime.queryInterface(XBridgeFactory.class, serviceManager.createInstance("com.sun.star.bridge.BridgeFactory")); + XBridgeFactory xBridgeFactory = UnoRuntime.queryInterface(XBridgeFactory.class, serviceManager.createInstance("com.sun.star.bridge.BridgeFactory")); XBridge xBridge = xBridgeFactory.createBridge(conDcp + ";" + protDcp, protDcp, xConnection, new InstanceProvider()); } diff --git a/jurt/demo/com/sun/star/demo/TestOffice.java b/jurt/demo/com/sun/star/demo/TestOffice.java index 811889898c48..7b86c8e2dd7e 100644 --- a/jurt/demo/com/sun/star/demo/TestOffice.java +++ b/jurt/demo/com/sun/star/demo/TestOffice.java @@ -76,7 +76,7 @@ public class TestOffice { { byte bytes[][] = new byte[1][]; - XInputStream rIn = (XInputStream)UnoRuntime.queryInterface(XInputStream.class, rOut); + XInputStream rIn = UnoRuntime.queryInterface(XInputStream.class, rOut); if(rIn.available() != 10) System.err.println("wrong bytes available\n"); @@ -90,11 +90,11 @@ public class TestOffice { static void testWriter(XComponent rCmp) throws IOException { - XTextDocument rTextDoc = (XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, rCmp); + XTextDocument rTextDoc = UnoRuntime.queryInterface(XTextDocument.class, rCmp); - XText rText = (XText)UnoRuntime.queryInterface(XText.class, rTextDoc.getText()); - XTextCursor rCursor = (XTextCursor)UnoRuntime.queryInterface(XTextCursor.class, rText.createTextCursor()); - XTextRange rRange = (XTextRange)UnoRuntime.queryInterface(XTextRange.class, rCursor); + XText rText = UnoRuntime.queryInterface(XText.class, rTextDoc.getText()); + XTextCursor rCursor = UnoRuntime.queryInterface(XTextCursor.class, rText.createTextCursor()); + XTextRange rRange = UnoRuntime.queryInterface(XTextRange.class, rCursor); byte pcText[] = new byte[1024]; pcText[0] = 0; @@ -112,7 +112,7 @@ public class TestOffice { } static void testDocument(XMultiServiceFactory rSmgr) throws com.sun.star.uno.Exception, IOException { - XComponentLoader rLoader = (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, rSmgr.createInstance("com.sun.star.frame.Desktop")); + XComponentLoader rLoader = UnoRuntime.queryInterface(XComponentLoader.class, rSmgr.createInstance("com.sun.star.frame.Desktop")); String urls[] = new String[] { "private:factory/swriter", @@ -148,13 +148,13 @@ public class TestOffice { } static void doSomething(Object r) throws com.sun.star.uno.Exception, IOException { - XNamingService rName = (XNamingService)UnoRuntime.queryInterface(XNamingService.class, r); + XNamingService rName = UnoRuntime.queryInterface(XNamingService.class, r); if(rName != null) { System.err.println("got the remote naming service !"); Object rXsmgr = rName.getRegisteredObject("StarOffice.ServiceManager"); - XMultiServiceFactory rSmgr = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr); + XMultiServiceFactory rSmgr = UnoRuntime.queryInterface(XMultiServiceFactory.class, rXsmgr); if(rSmgr != null) { System.err.println("got the remote service manager !"); // testPipe(rSmgr); @@ -183,7 +183,7 @@ public class TestOffice { smgr.addFactories(neededServices); Object resolver = smgr.createInstance("com.sun.star.bridge.UnoUrlResolver" ); - XUnoUrlResolver resolver_xUnoUrlResolver = (XUnoUrlResolver)UnoRuntime.queryInterface(XUnoUrlResolver.class, resolver); + XUnoUrlResolver resolver_xUnoUrlResolver = UnoRuntime.queryInterface(XUnoUrlResolver.class, resolver); Object rInitialObject = resolver_xUnoUrlResolver.resolve(argv[0]); diff --git a/jurt/test/com/sun/star/comp/bridgefactory/BridgeFactory_Test.java b/jurt/test/com/sun/star/comp/bridgefactory/BridgeFactory_Test.java index 8c6722c9f69a..a5fdccf613f8 100644 --- a/jurt/test/com/sun/star/comp/bridgefactory/BridgeFactory_Test.java +++ b/jurt/test/com/sun/star/comp/bridgefactory/BridgeFactory_Test.java @@ -75,7 +75,7 @@ public final class BridgeFactory_Test extends ComplexTestCase { assure("", UnoRuntime.areSame(xBridge, xBridges[0])); // dispose the bridge - XComponent xComponent = (XComponent)UnoRuntime.queryInterface(XComponent.class, xBridge); + XComponent xComponent = UnoRuntime.queryInterface(XComponent.class, xBridge); xComponent.dispose(); @@ -103,7 +103,7 @@ public final class BridgeFactory_Test extends ComplexTestCase { && UnoRuntime.areSame(xBridge_new, xBridges[0])); // dispose the new bridge - XComponent xComponent_new = (XComponent)UnoRuntime.queryInterface(XComponent.class, xBridge_new); + XComponent xComponent_new = UnoRuntime.queryInterface(XComponent.class, xBridge_new); xComponent_new.dispose(); } } diff --git a/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java b/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java index 8e71d51a0c6f..ffef8f7664a0 100644 --- a/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java +++ b/jurt/test/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge_Test.java @@ -132,17 +132,17 @@ public final class java_remote_bridge_Test extends ComplexTestCase { proxyBXInterface[i] = (XInterface) bridgeB.getInstance(name); // map object: - proxyBTestInterface[i] = (TestInterface) UnoRuntime.queryInterface( + proxyBTestInterface[i] = UnoRuntime.queryInterface( TestInterface.class, proxyBXInterface[i]); proxyBTestInterface[i].function(); // remap object once: - TestInterface remapped = (TestInterface) UnoRuntime.queryInterface( + TestInterface remapped = UnoRuntime.queryInterface( TestInterface.class, proxyBXInterface[i]); remapped.function(); // remap object twice: - remapped = (TestInterface) UnoRuntime.queryInterface( + remapped = UnoRuntime.queryInterface( TestInterface.class, proxyBXInterface[i]); remapped.function(); } diff --git a/jurt/workbench/com/sun/star/comp/urlresolver/UrlResolver_Test.java b/jurt/workbench/com/sun/star/comp/urlresolver/UrlResolver_Test.java index 5e3110d140fa..94686e7135fd 100644 --- a/jurt/workbench/com/sun/star/comp/urlresolver/UrlResolver_Test.java +++ b/jurt/workbench/com/sun/star/comp/urlresolver/UrlResolver_Test.java @@ -58,19 +58,19 @@ public class UrlResolver_Test Object initialObject = urlResolver.resolve( "uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" ); - XMultiComponentFactory xOfficeFactory= (XMultiComponentFactory) UnoRuntime.queryInterface( + XMultiComponentFactory xOfficeFactory= UnoRuntime.queryInterface( XMultiComponentFactory.class, initialObject ); // retrieve the component context (it's not yet exported from the office) // Query for the XPropertySet interface. - XPropertySet xProperySet = ( XPropertySet ) UnoRuntime.queryInterface( + XPropertySet xProperySet = UnoRuntime.queryInterface( XPropertySet.class, xOfficeFactory); // Get the default context from the office server. Object oDefaultContext = xProperySet.getPropertyValue( "DefaultContext" ); // Query for the interface XComponentContext. - XComponentContext xOfficeComponentContext = ( XComponentContext ) UnoRuntime.queryInterface( + XComponentContext xOfficeComponentContext = UnoRuntime.queryInterface( XComponentContext.class, oDefaultContext ); // now create the desktop service diff --git a/jvmfwk/distributions/OpenOfficeorg/javavendors_freebsd.xml b/jvmfwk/distributions/OpenOfficeorg/javavendors_freebsd.xml index 020c11b4973e..2dd5fe35f555 100644 --- a/jvmfwk/distributions/OpenOfficeorg/javavendors_freebsd.xml +++ b/jvmfwk/distributions/OpenOfficeorg/javavendors_freebsd.xml @@ -7,13 +7,13 @@ <vendorInfos> <vendor name="Sun Microsystems Inc."> - <minVersion>1.3.1</minVersion> + <minVersion>1.5.0</minVersion> </vendor> <vendor name="The FreeBSD Foundation"> <minVersion>1.6.0</minVersion> </vendor> <vendor name="Free Software Foundation, Inc."> - <minVersion>1.4.2</minVersion> + <minVersion>1.5.0</minVersion> </vendor> </vendorInfos> diff --git a/jvmfwk/distributions/OpenOfficeorg/javavendors_os2.xml b/jvmfwk/distributions/OpenOfficeorg/javavendors_os2.xml index 372254d4ee71..2de585472b86 100644 --- a/jvmfwk/distributions/OpenOfficeorg/javavendors_os2.xml +++ b/jvmfwk/distributions/OpenOfficeorg/javavendors_os2.xml @@ -7,10 +7,10 @@ <vendorInfos> <vendor name="Sun Microsystems Inc."> - <minVersion>1.5.0</minVersion> + <minVersion>1.4.2</minVersion> </vendor> <vendor name="IBM Corporation"> - <minVersion>1.5.0</minVersion> + <minVersion>1.4.2</minVersion> </vendor> </vendorInfos> diff --git a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx index c80d1c091571..b59a30f887d2 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx @@ -65,11 +65,15 @@ char const* const* OtherInfo::getJavaExePaths(int * size) char const* const* OtherInfo::getRuntimePaths(int * size) { static char const* ar[]= { -#if defined(WNT) || defined(OS2) +#if defined(WNT) "/bin/client/jvm.dll", "/bin/hotspot/jvm.dll", "/bin/classic/jvm.dll", "/bin/jrockit/jvm.dll" +#elif defined(OS2) + "/bin/classic/jvm.dll", + "/bin/client/jvm.dll", + "/bin/hotspot/jvm.dll" #elif UNX #ifdef MACOSX "/../../../JavaVM" diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx index fec7d0b60136..247c5092ab44 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx @@ -74,8 +74,6 @@ char const* const* SunInfo::getRuntimePaths(int * size) "/bin/classic/jvm.dll" #elif defined(OS2) "/bin/classic/jvm.dll", - "/bin/client/jvm.dll", - "/bin/hotspot/jvm.dll" #elif UNX "/lib/" JFW_PLUGIN_ARCH "/client/libjvm.so", "/lib/" JFW_PLUGIN_ARCH "/server/libjvm.so", diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index 57b7166d01f6..a823d551af88 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -65,6 +65,7 @@ using namespace rtl; using namespace osl; using namespace std; +#define CHAR_POINTER(oustr) ::rtl::OUStringToOString(oustr,RTL_TEXTENCODING_UTF8).pData->buffer #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) #ifdef WNT #define HKEY_SUN_JRE L"Software\\JavaSoft\\Java Runtime Environment" @@ -449,7 +450,11 @@ bool getJavaProps(const OUString & exePath, rs = stdoutReader.readLine( & aLine); if (rs != FileHandleReader::RESULT_OK) break; + JFW_TRACE2(OString("[Java framework] line:\" ") + + aLine + OString(" \".\n")); OUString sLine = decodeOutput(aLine); + JFW_TRACE2(OString("[Java framework] line:\" ") + + OString( CHAR_POINTER(sLine)) + OString(" \".\n")); sLine = sLine.trim(); if (sLine.getLength() == 0) continue; diff --git a/offapi/com/sun/star/chart2/XDataSeries.idl b/offapi/com/sun/star/chart2/XDataSeries.idl index 206dac223578..eeebc966511c 100644 --- a/offapi/com/sun/star/chart2/XDataSeries.idl +++ b/offapi/com/sun/star/chart2/XDataSeries.idl @@ -58,22 +58,28 @@ module chart2 */ interface XDataSeries : ::com::sun::star::uno::XInterface { - /** set the coordinate system in which this series should be - represented. - */ -// void setCoordinateSystem( [in] XCoordinateSystem aCoordSystem ); - /** @returns the element at the specified index. - @param Index - specifies the position in the array. The first index is 0. + @param nIndex + specifies the index of the data point within the series. The first index is 0. @throws com::sun::star::lang::IndexOutOfBoundException if the index is not valid. */ ::com::sun::star::beans::XPropertySet getDataPointByIndex( [in] long nIndex ) raises( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** the formatting of the specified data point is cleared + + @param nIndex + specifies the index of the data point within the series. The first index is 0. + */ + void resetDataPoint( [in] long nIndex ); + + /** all data point formattings are cleared + */ + void resetAllDataPoints(); }; } ; // chart2 diff --git a/offapi/com/sun/star/chart2/XDefaultSizeTransmitter.idl b/offapi/com/sun/star/chart2/XDefaultSizeTransmitter.idl new file mode 100644 index 000000000000..a834bb310eda --- /dev/null +++ b/offapi/com/sun/star/chart2/XDefaultSizeTransmitter.idl @@ -0,0 +1,67 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XDefaultSizeTransmitter.idl,v $ + * $Revision: 1.3 $ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef com_sun_star_chart2_xdefaultsizetransmitter_idl +#define com_sun_star_chart2_xdefaultsizetransmitter_idl + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +#ifndef __com_sun_star_awt_Size_idl__ +#include <com/sun/star/awt/Size.idl> +#endif + +module com +{ +module sun +{ +module star +{ +module chart2 +{ + +/** Allows to set a default size. This size will be used in case no further informations are available. + */ +interface XDefaultSizeTransmitter : ::com::sun::star::uno::XInterface +{ + /** set a default size + @param aSize_100TH_MM + specifies a size in hundredth mm. + */ + void setDefaultSize( [in] ::com::sun::star::awt::Size aSize_100TH_MM ); +}; + +} ; // chart2 +} ; // com +} ; // sun +} ; // star + + +#endif diff --git a/offapi/com/sun/star/chart2/makefile.mk b/offapi/com/sun/star/chart2/makefile.mk index d82862c69268..700ecc633d7a 100644 --- a/offapi/com/sun/star/chart2/makefile.mk +++ b/offapi/com/sun/star/chart2/makefile.mk @@ -85,6 +85,7 @@ IDLFILES= \ XDataInterpreter.idl \ XDataSeries.idl \ XDataSeriesContainer.idl \ + XDefaultSizeTransmitter.idl \ XDiagram.idl \ XDiagramProvider.idl \ XFastPropertyState.idl \ diff --git a/offapi/com/sun/star/drawing/framework/XPane2.idl b/offapi/com/sun/star/drawing/framework/XPane2.idl new file mode 100644 index 000000000000..d1b646f73a31 --- /dev/null +++ b/offapi/com/sun/star/drawing/framework/XPane2.idl @@ -0,0 +1,79 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XPane.idl,v $ + * $Revision: 1.4 $ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_drawing_framework_XPane2_idl__ +#define __com_sun_star_drawing_framework_XPane2_idl__ + +#ifndef __com_sun_star_accessibility_XAccessible_idl__ +#include <com/sun/star/accessibility/XAccessible.idl> +#endif + +module com { module sun { module star { module drawing { module framework { + +/** An extension of the XPane interface that adds support for + a) showing and hiding the windows that internally belong to the pane and + b) setting the accessibility object. + This is typically an optional interface. +*/ +interface XPane2 +{ + /** Return whether all windows that are used to implement the pane are + visible. + @Returns <TRUE> when all windows of the pane are visible. + */ + boolean isVisible (); + + /** Hide or show the pane. If there is more than one window used to + implement the pane then it is left to the implementation if one, + some, or all windows are hidden or shown as long as the pane becomes + hidden or visible. + @param bIsVisible + When <TRUE> then show the pane. Hide it otherwise. + */ + void setVisible ([in] boolean bIsVisible); + + /** Set the accessibility object for the pane. When there is more than + one window used to implement the pane then the given accessibility + object is usually set at the topmost window. However, the details + are implementation dependent. + @param xAccessible + May be an empty reference. + */ + void setAccessible ([in] ::com::sun::star::accessibility::XAccessible xAccessible); + + /** Return the accessibility object that is currently associated with + the windows that implement the pane. + */ + ::com::sun::star::accessibility::XAccessible getAccessible (); +}; + +}; }; }; }; }; // ::com::sun::star::drawing::framework + +#endif diff --git a/offapi/com/sun/star/drawing/framework/makefile.mk b/offapi/com/sun/star/drawing/framework/makefile.mk index 9b6706ad14d6..b5dd8cbcc936 100644 --- a/offapi/com/sun/star/drawing/framework/makefile.mk +++ b/offapi/com/sun/star/drawing/framework/makefile.mk @@ -62,6 +62,7 @@ IDLFILES= \ XControllerManager.idl \ XModuleController.idl \ XPane.idl \ + XPane2.idl \ XPaneBorderPainter.idl \ XRelocatableResource.idl \ XResource.idl \ diff --git a/offapi/com/sun/star/embed/Storage.idl b/offapi/com/sun/star/embed/Storage.idl index b7c85707cf7f..70e91a66e765 100644 --- a/offapi/com/sun/star/embed/Storage.idl +++ b/offapi/com/sun/star/embed/Storage.idl @@ -347,6 +347,19 @@ service Storage </p> */ [property, optional, readonly] boolean HasEncryptedEntries; + + // ----------------------------------------------------------------------- + /** allows to detect if the storage contains nonencrypted entries. + + <p> + In case it is set to <TRUE/> the storage itself and/or a tree of + substorages contains nonencrypted streams. Usually in case this + property is supported the implementation supports + <type>XEncryptionProtectedSource</type> interface. + </p> + */ + [property, optional, readonly] boolean HasNonEncryptedEntries; + }; //============================================================================ diff --git a/offapi/com/sun/star/modules.idl b/offapi/com/sun/star/modules.idl index 4a0f4efcd12c..d91c8edad1ff 100644 --- a/offapi/com/sun/star/modules.idl +++ b/offapi/com/sun/star/modules.idl @@ -90,6 +90,9 @@ module datatransfer {}; /// Office document related interfaces. module document {}; +/// Office document content related interfaces. +module office {}; + /// Drawing and shape specific interfaces. module drawing {}; diff --git a/offapi/com/sun/star/office/XAnnotation.idl b/offapi/com/sun/star/office/XAnnotation.idl new file mode 100644 index 000000000000..ff7c4127bb82 --- /dev/null +++ b/offapi/com/sun/star/office/XAnnotation.idl @@ -0,0 +1,105 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XGalleryItem.idl,v $ + * $Revision: 1.4 $ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_office_XAnnotation_idl__ +#define __com_sun_star_office_XAnnotation_idl__ + +#ifndef __com_sun_star_beans_XPropertySet_idl__ +#include <com/sun/star/beans/XPropertySet.idl> +#endif + +#ifndef __com_sun_star_beans_XMultiPropertySet_idl__ +#include <com/sun/star/beans/XMultiPropertySet.idl> +#endif + +#ifndef __com_sun_star_util_DateTime_idl__ +#include <com/sun/star/util/DateTime.idl> +#endif + +#ifndef __com_sun_star_text_XText_idl__ +#include <com/sun/star/text/XText.idl> +#endif + +#ifndef __com_sun_star_geometry_RealPoint2D_idl__ +#include <com/sun/star/geometry/RealPoint2D.idl> +#endif + +#ifndef __com_sun_star_geometry_RealSize2D_idl__ +#include <com/sun/star/geometry/RealSize2D.idl> +#endif + +#ifndef __com_sun_star_lang_XComponent_idl__ +#include <com/sun/star/lang/XComponent.idl> +#endif + +//============================================================================= + +module com { module sun { module star { module office { + +//============================================================================= + +/** This interface gives access to an annotation inside a document. + */ +interface XAnnotation +{ + /** All attributes are also available as properties. */ + interface ::com::sun::star::beans::XPropertySet; + + /** manages the lifetime of this annotation, should only be used + by the owner of the annotation which should be the document itself. */ + interface ::com::sun::star::lang::XComponent; + + /** a reference to the document content this annotation is anchored to. */ + [attribute, readonly] any Anchor; + + /** this is an optional position that gives the user interface a hint where + the annotation should be rendered. This could be an offset to the + annotations anchor. */ + [attribute] ::com::sun::star::geometry::RealPoint2D Position; + + /** this is an optional size that gives the user interface a hint how + large the annotation should be rendered. */ + [attribute] ::com::sun::star::geometry::RealSize2D Size; + + /** stores the full name of the author who created this annotation. */ + [attribute] string Author; + + /** stores the date and time this annotation was last edited. */ + [attribute] ::com::sun::star::util::DateTime DateTime; + + /** gives access to the annotations text. */ + [attribute, readonly] ::com::sun::star::text::XText TextRange; +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/office/XAnnotationAccess.idl b/offapi/com/sun/star/office/XAnnotationAccess.idl new file mode 100644 index 000000000000..074312ef6fec --- /dev/null +++ b/offapi/com/sun/star/office/XAnnotationAccess.idl @@ -0,0 +1,75 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XGalleryItem.idl,v $ + * $Revision: 1.4 $ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_office_XAnnotationAccess_idl__ +#define __com_sun_star_office_XAnnotationAccess_idl__ + +#ifndef __com_sun_star_office_XAnnotationEnumeration_idl__ +#include <com/sun/star/office/XAnnotationEnumeration.idl> +#endif + +#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ +#include <com/sun/star/office/IllegalArgumentException.idl> +#endif + +#ifndef __com_sun_star_office_XAnnotation_idl__ +#include <com/sun/star/office/XAnnotation.idl> +#endif + +//============================================================================= + +module com { module sun { module star { module office { + +//============================================================================= + +/** This interface gives access to the annotation for a document content. + */ +interface XAnnotationAccess +{ + /** creates a new annotation and inserts it into the document content. + */ + XAnnotation createAndInsertAnnotation(); + + /** removes the annotation from this document content. + */ + void removeAnnotation( [in] XAnnotation annotation ) raises ( com::sun::star::lang::IllegalArgumentException ); + + /** @returns + a new enumeration object for this annotation container. + It returns NULL if there are no objects in this container. + */ + XAnnotationEnumeration createAnnotationEnumeration(); +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/office/XAnnotationEnumeration.idl b/offapi/com/sun/star/office/XAnnotationEnumeration.idl new file mode 100644 index 000000000000..e81666e0b698 --- /dev/null +++ b/offapi/com/sun/star/office/XAnnotationEnumeration.idl @@ -0,0 +1,74 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XEnumeration.idl,v $ + * $Revision: 1.12 $ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_office_XAnnotationEnumeration_idl__ +#define __com_sun_star_office_XAnnotationEnumeration_idl__ + +#ifndef __com_sun_star_office_XAnnotation_idl__ +#include <com/sun/star/office/XAnnotation.idl> +#endif + +#ifndef __com_sun_star_container_NoSuchElementException_idl__ +#include <com/sun/star/container/NoSuchElementException.idl> +#endif + +//============================================================================= + +module com { module sun { module star { module office { + +//============================================================================= + +/** An enumeration for a set of annotations. + */ +interface XAnnotationEnumeration +{ + //------------------------------------------------------------------------- + + /** tests whether this enumeration contains more elements. + */ + boolean hasMoreElements(); + + //------------------------------------------------------------------------- + + /** @returns + the next element of this enumeration. + + @throws NoSuchElementException + if no more elements exist. + */ + XAnnotation nextElement() + raises( com::sun::star::container::NoSuchElementException ); + +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/office/makefile.mk b/offapi/com/sun/star/office/makefile.mk new file mode 100644 index 000000000000..404c23c45e32 --- /dev/null +++ b/offapi/com/sun/star/office/makefile.mk @@ -0,0 +1,51 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.5 $ +# +# 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> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/..$/.. +PRJNAME=offapi +TARGET=cssoffice +PACKAGE=com$/sun$/star$/office + +# --- Settings ----------------------------------------------------- + +.INCLUDE : $(PRJ)$/util$/makefile.pmk + +# ------------------------------------------------------------------------ + +IDLFILES=\ + XAnnotation.idl\ + XAnnotationEnumeration.idl\ + XAnnotationAccess.idl + +# ------------------------------------------------------------------ + +.INCLUDE : target.mk +.INCLUDE : $(PRJ)$/util$/target.pmk diff --git a/offapi/com/sun/star/security/DocumentSignatureInformation.idl b/offapi/com/sun/star/security/DocumentSignatureInformation.idl index da418ebac2d4..4ed6d972705c 100644 --- a/offapi/com/sun/star/security/DocumentSignatureInformation.idl +++ b/offapi/com/sun/star/security/DocumentSignatureInformation.idl @@ -59,6 +59,25 @@ struct DocumentSignatureInformation <type scope="com::sun::star::security">CertificateValidity</type>. */ long CertificateStatus; + /* indicates what content of a document is signed. + <p> + This value can be ignored when this struct is returned as part of + a macro signature validation. + As of OpenOffice.org 3.2 and ODF 1.2 the document signature comprises + all files except the signature file itself. + Signatures in OOo 2.x were only + applied to the files in the root of the document, except mimetype, the + Pictures and ObjectReplacements/Objects folder. That is, macros + were not part of the document signature. + OOo 3.0 signed everthing, execept mimetype and the META-INF folder. + <p> + If PartialDocumentSignature is true, then the signature was created by OOo + with a version less then 3.2. In this case, not all files are signed. The + signature can still be regarded as valid, as long as SignatureIsValid is true + and the certificate could be validated. However, users should be notified about + the fact, that not everything in this document is signed. + */ + boolean PartialDocumentSignature; }; diff --git a/offapi/com/sun/star/task/DocumentMSPasswordRequest.idl b/offapi/com/sun/star/task/DocumentMSPasswordRequest.idl index 6e4adec10720..717e590c12ba 100644 --- a/offapi/com/sun/star/task/DocumentMSPasswordRequest.idl +++ b/offapi/com/sun/star/task/DocumentMSPasswordRequest.idl @@ -49,7 +49,7 @@ module com { module sun { module star { module task { the mentioned service are Abort and Approve. </P> - @since OOo 3.x.x + @since OOo 3.2 */ published exception DocumentMSPasswordRequest: PasswordRequest { diff --git a/offapi/com/sun/star/task/DocumentMacroConfirmationRequest2.idl b/offapi/com/sun/star/task/DocumentMacroConfirmationRequest2.idl new file mode 100644 index 000000000000..422f1ab2a9d0 --- /dev/null +++ b/offapi/com/sun/star/task/DocumentMacroConfirmationRequest2.idl @@ -0,0 +1,83 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: DocumentMacroConfirmationRequest.idl,v $ + * $Revision: 1.3 $ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_task_DocumentMacroConfirmationRequest2_idl__ +#define __com_sun_star_task_DocumentMacroConfirmationRequest2_idl__ + +#include <com/sun/star/task/ClassifiedInteractionRequest.idl> +#include <com/sun/star/embed/XStorage.idl> +#include <com/sun/star/security/DocumentSignatureInformation.idl> + + +//============================================================================= + +module com { module sun { module star { module task { + +//============================================================================= + +/** describes the request to approve or deny the execution of macros contained in + a document. + */ +exception DocumentMacroConfirmationRequest2 : ClassifiedInteractionRequest +{ + /** specifies the URL of the document which contains macros whose execution + should be approved or rejected. + */ + string DocumentURL; + + /** refers to the zip-storage related to the last commited version of the + document. + + This storage is necessary e.g. for displaying the existing signatures to + the user, to allow him a decision whether or not to trust those signatures + and thus the signed macros. + + @see ::com::sun::star::security::XDocumentDigitalSignatures::showScriptingContentSignatures + */ + ::com::sun::star::embed::XStorage + DocumentZipStorage; + + /** contains informations about the ODF version of the document + */ + string DocumentVersion; + + /** contains informations about the signatures in the document + */ + sequence< ::com::sun::star::security::DocumentSignatureInformation > + DocumentSignatureInformation; +}; + +//============================================================================= + +}; }; }; }; + +//============================================================================= + +#endif diff --git a/offapi/com/sun/star/task/XUrlContainer.idl b/offapi/com/sun/star/task/XUrlContainer.idl new file mode 100644 index 000000000000..93839e68fb07 --- /dev/null +++ b/offapi/com/sun/star/task/XUrlContainer.idl @@ -0,0 +1,92 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XPasswordContainer.idl,v $ + * $Revision: 1.9 $ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_task_XUrlContainer_idl__ +#define __com_sun_star_task_XUrlContainer_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +#ifndef __com_sun_star_task_XInteractionHandler_idl__ +#include <com/sun/star/task/XInteractionHandler.idl> +#endif + + +//============================================================================= + +module com { module sun { module star { module task { + +//============================================================================= +/** Allows to store and retrieve URLs. URLs can be stored persistently or + until end of OOo session. +*/ +/*published*/ interface XUrlContainer : com::sun::star::uno::XInterface +{ + //------------------------------------------------------------------------- + /** Add a URL to the container. + + @param Url URL to add to the container + @param MakePersistent indicates whether the URL shall be stored + persistently or just in memory (until end of + OOo session) + */ + void addUrl( [in] string Url, [in] boolean MakePersistent ); + + //------------------------------------------------------------------------- + /** Lookup a URL in the container. + + @param Url URL to lookup. + @returns Best matched URL or empty string. + */ + string findUrl( [in] string Url ); + + //------------------------------------------------------------------------- + /** Remove a URL from the container. + + @param Url URL to remove. + */ + void removeUrl( [in] string Url ); + + //------------------------------------------------------------------------- + /** Get all URLs. + + @param OnlyPersistent Only URLs taht are stored persistently shall + be returned. + @returns List of URLs. + */ + sequence<string> getUrls( [in] boolean OnlyPersistent ); + +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/task/makefile.mk b/offapi/com/sun/star/task/makefile.mk index 1559901f740c..dc54f6fd3883 100644 --- a/offapi/com/sun/star/task/makefile.mk +++ b/offapi/com/sun/star/task/makefile.mk @@ -45,6 +45,7 @@ PACKAGE=com$/sun$/star$/task IDLFILES=\ ClassifiedInteractionRequest.idl\ DocumentMacroConfirmationRequest.idl\ + DocumentMacroConfirmationRequest2.idl\ DocumentPasswordRequest.idl\ DocumentMSPasswordRequest.idl\ ErrorCodeRequest.idl\ @@ -79,7 +80,8 @@ IDLFILES=\ XStatusIndicatorSupplier.idl\ XAbortChannel.idl\ XInteractionRequestStringResolver.idl\ - InteractionRequestStringResolver.idl + InteractionRequestStringResolver.idl\ + XUrlContainer.idl # ------------------------------------------------------------------ diff --git a/offapi/com/sun/star/text/InContentMetadata.idl b/offapi/com/sun/star/text/InContentMetadata.idl new file mode 100755 index 000000000000..7a7a20adc877 --- /dev/null +++ b/offapi/com/sun/star/text/InContentMetadata.idl @@ -0,0 +1,81 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: TextField.idl,v $ + * $Revision: 1.11 $ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_text_InContentMetadata_idl__ +#define __com_sun_star_text_InContentMetadata_idl__ + +#ifndef __com_sun_star_container_XEnumerationAccess_idl__ +#include <com/sun/star/container/XEnumerationAccess.idl> +#endif + +#ifndef __com_sun_star_text_TextContent_idl__ +#include <com/sun/star/text/TextContent.idl> +#endif + +#ifndef __com_sun_star_rdf_XMetadatable_idl__ +#include <com/sun/star/rdf/XMetadatable.idl> +#endif + + +//============================================================================= + +module com { module sun { module star { module text { + +//============================================================================= + +/** is a <type>TextContent</type> that can be used to attach RDF metadata + to a range of text. + + @since OOo 3.2 + */ +service InContentMetadata +{ + //------------------------------------------------------------------------- + /** None of the properties of <type>TextContent</type> are + supported. */ + service com::sun::star::text::TextContent; + + //------------------------------------------------------------------------- + /** The <type>InContentMetadata</type> can have RDF metadata attached. */ + interface com::sun::star::rdf::XMetadatable; + + //------------------------------------------------------------------------- + /** The <type>TextContent</type>s that are contained in the + annotated range of text can be enumerated. */ + interface com::sun::star::container::XEnumerationAccess; + +}; + + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/text/TextPortion.idl b/offapi/com/sun/star/text/TextPortion.idl index 26ad5bd5ba6c..d4ab79f88323 100644 --- a/offapi/com/sun/star/text/TextPortion.idl +++ b/offapi/com/sun/star/text/TextPortion.idl @@ -113,6 +113,7 @@ published service TextPortion <dt>Ruby</dt><dd>a ruby attribute which is used in Asian text</dd> <dt>Frame</dt><dd>a frame</dd> <dt>SoftPageBreak</dt><dd>a soft page break</dd> + <dt>InContentMetadata</dt><dd>a text range with attached metadata</dd> </dl> <p>For Reference marks, document index marks, etc., 2 text portions will be generated, one for the start position and one for the @@ -123,6 +124,7 @@ published service TextPortion //------------------------------------------------------------------------- /** contains the control character of a text portion of type ControlCharacter. + @deprecated type ControlCharacter no longer implemented */ [readonly, property] short ControlCharacter; @@ -153,6 +155,13 @@ published service TextPortion ::com::sun::star::text::XTextField TextField; //------------------------------------------------------------------------- + /** contains the text range of a text portion of type InContentMetadata. + @since OOo 3.2 + */ + [optional, readonly, property] + ::com::sun::star::text::XTextContent InContentMetadata; + + //------------------------------------------------------------------------- /** contains whether the portion is a point only. */ [optional, readonly, property] boolean IsCollapsed; diff --git a/offapi/com/sun/star/text/makefile.mk b/offapi/com/sun/star/text/makefile.mk index 18ad6abbe2a1..c018c9479049 100644 --- a/offapi/com/sun/star/text/makefile.mk +++ b/offapi/com/sun/star/text/makefile.mk @@ -107,6 +107,7 @@ IDLFILES=\ HorizontalAdjust.idl\ HypertextDocument.idl\ IllustrationsIndex.idl\ + InContentMetadata.idl\ InvalidTextContentException.idl\ LabelFollow.idl\ LineNumberingProperties.idl\ diff --git a/offapi/com/sun/star/text/textfield/MetadataField.idl b/offapi/com/sun/star/text/textfield/MetadataField.idl new file mode 100755 index 000000000000..f82276213527 --- /dev/null +++ b/offapi/com/sun/star/text/textfield/MetadataField.idl @@ -0,0 +1,102 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: MetadataField.idl,v $ + * $Revision: 1.12 $ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_text_textfield_MetadataField_idl__ +#define __com_sun_star_text_textfield_MetadataField_idl__ + +#ifndef __com_sun_star_container_XEnumerationAccess_idl__ +#include <com/sun/star/container/XEnumerationAccess.idl> +#endif + +#ifndef __com_sun_star_text_TextField_idl__ +#include <com/sun/star/text/TextField.idl> +#endif + +#ifndef __com_sun_star_text_XText_idl__ +#include <com/sun/star/text/XText.idl> +#endif + +#ifndef __com_sun_star_rdf_XMetadatable_idl__ +#include <com/sun/star/rdf/XMetadatable.idl> +#endif + + +//============================================================================= + +module com { module sun { module star { module text { module textfield { + +//============================================================================= +/** is a <type>TextField</type> whose content is specified by RDF metadata. + + @since OOo 3.2 + + @see com::sun::star::rdf +*/ +service MetadataField +{ + //------------------------------------------------------------------------- + /** None of the properties of <type>TextContent</type> are + supported. */ + service com::sun::star::text::TextField; + + //------------------------------------------------------------------------- + /** The <type>MetadataField</type> can have RDF metadata attached. */ + interface com::sun::star::rdf::XMetadatable; + + //------------------------------------------------------------------------- + /** Allows for insertion of text content into, and creating cursors + that are bound within, the <type>MetadataField</type>. */ + interface com::sun::star::text::XText; + + //------------------------------------------------------------------------- + /** The <type>TextContent</type>s that are contained in the + <type>MetadataField</type> can be enumerated. */ + interface com::sun::star::container::XEnumerationAccess; + + //------------------------------------------------------------------------- + /** this is the number format for this field. + @see com::sun::star::util::NumberFormatter + */ + [optional, property] long NumberFormat; + + //------------------------------------------------------------------------- + /** determines whether changes in language attributes at the + position of the text field also change the number format + as appropriate for this language. + */ + [optional, property] boolean IsFixedLanguage; +}; + +//============================================================================= + +}; }; }; }; }; + +#endif + diff --git a/offapi/com/sun/star/text/textfield/makefile.mk b/offapi/com/sun/star/text/textfield/makefile.mk index 46506a4eff8c..0defebd69dfc 100644 --- a/offapi/com/sun/star/text/textfield/makefile.mk +++ b/offapi/com/sun/star/text/textfield/makefile.mk @@ -70,6 +70,7 @@ IDLFILES=\ InputUser.idl\ JumpEdit.idl\ Macro.idl\ + MetadataField.idl\ PageCount.idl\ PageNumber.idl\ ParagraphCount.idl\ diff --git a/offapi/com/sun/star/ucb/URLAuthenticationRequest.idl b/offapi/com/sun/star/ucb/URLAuthenticationRequest.idl new file mode 100644 index 000000000000..1b19830df81e --- /dev/null +++ b/offapi/com/sun/star/ucb/URLAuthenticationRequest.idl @@ -0,0 +1,58 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AuthenticationRequest.idl,v $ + * $Revision: 1.6 $ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_ucb_URLAuthenticationRequest_idl__ +#define __com_sun_star_ucb_URLAuthenticationRequest_idl__ + +#ifndef __com_sun_star_ucb_AuthenticationRequest_idl__ +#include <com/sun/star/ucb/AuthenticationRequest.idl> +#endif + + +//============================================================================= + +module com { module sun { module star { module ucb { + +//============================================================================= +/** An error specifing lack of correct authentication data (e.g., to log into + an account). +*/ +/*published*/ exception URLAuthenticationRequest : AuthenticationRequest +{ + //------------------------------------------------------------------------- + /** The URL for which authentication is requested. + */ + string URL; +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/ucb/XInteractionSupplyAuthentication2.idl b/offapi/com/sun/star/ucb/XInteractionSupplyAuthentication2.idl new file mode 100644 index 000000000000..a3c4bdb3d5f3 --- /dev/null +++ b/offapi/com/sun/star/ucb/XInteractionSupplyAuthentication2.idl @@ -0,0 +1,79 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XInteractionSupplyAuthentication.idl,v $ + * $Revision: 1.9 $ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_ucb_XInteractionSupplyAuthentication2_idl__ +#define __com_sun_star_ucb_XInteractionSupplyAuthentication2_idl__ + +#ifndef __com_sun_star_ucb_XInteractionSupplyAuthentication_idl__ +#include <com/sun/star/ucb/XInteractionSupplyAuthentication.idl> +#endif + + + +//============================================================================= + +module com { module sun { module star { module ucb { + +//============================================================================= +/** An interaction continuation handing back some authentication data. + + <p> This continuation is typically used in conjunction with + <type>AuthenticationRequest</type>. </p> +*/ +/*published*/ interface XInteractionSupplyAuthentication2 : XInteractionSupplyAuthentication +{ + //------------------------------------------------------------------------- + /** Specifies if 'system credentials' can be obtained and used by the issuer + of the authentiction request. + + @param Default + Returns the default behavior for system credentials handling (to be + initially displayed to the user). + + @returns + <true/> if the issuer is able to obtain and use system credentials. + <false/> otherwise. + */ + boolean canUseSystemCredentials( [out] boolean Default ); + + //------------------------------------------------------------------------- + /** Set a new 'use system credentials' value to hand back. + + @param UseSystemCredentials + <true/> means the request issuer shall obtain and use system credentials. + */ + void setUseSystemCredentials( [in] boolean UseSystemCredentials ); + +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/ucb/makefile.mk b/offapi/com/sun/star/ucb/makefile.mk index 2cf5394dcaf4..19320b716634 100644 --- a/offapi/com/sun/star/ucb/makefile.mk +++ b/offapi/com/sun/star/ucb/makefile.mk @@ -45,6 +45,7 @@ IDLFILES=\ AlreadyInitializedException.idl\ AnyCompareFactory.idl\ AuthenticationRequest.idl\ + URLAuthenticationRequest.idl\ CachedContentResultSet.idl\ CachedContentResultSetFactory.idl\ CachedContentResultSetStub.idl\ @@ -99,7 +100,7 @@ IDLFILES=\ FTPContent.idl\ FTPContentProvider.idl\ GlobalTransferCommandArgument.idl\ - GIOContentProvider.idl\ + GIOContentProvider.idl\ GnomeVFSContentProvider.idl\ GnomeVFSDocumentContent.idl\ GnomeVFSFolderContent.idl\ @@ -142,125 +143,126 @@ IDLFILES=\ LockType.idl\ MissingInputStreamException.idl\ MissingPropertiesException.idl\ - NameClash.idl\ - NameClashException.idl\ - NameClashResolveRequest.idl\ - NumberedSortingInfo.idl\ - ODMAContent.idl\ - ODMAContentProvider.idl\ - OpenCommandArgument.idl\ - OpenCommandArgument2.idl\ - OpenMode.idl\ - OutgoingMessageState.idl\ - PackageContentProvider.idl\ - PackageFolderContent.idl\ - PackageStreamContent.idl\ - PersistentPropertySet.idl\ - PostCommandArgument.idl\ - PostCommandArgument2.idl\ - Priority.idl\ - PropertiesManager.idl\ - PropertySetRegistry.idl\ - PropertyValueInfo.idl\ - PropertyValueState.idl\ - RecipientInfo.idl\ - RememberAuthentication.idl\ - RemoteAccessContentProvider.idl\ - RemoteContentProviderAcceptor.idl\ - RemoteContentProviderChangeAction.idl\ - RemoteContentProviderChangeEvent.idl\ - RemoteProxyContentProvider.idl\ - ResultSetException.idl\ + NameClash.idl\ + NameClashException.idl\ + NameClashResolveRequest.idl\ + NumberedSortingInfo.idl\ + ODMAContent.idl\ + ODMAContentProvider.idl\ + OpenCommandArgument.idl\ + OpenCommandArgument2.idl\ + OpenMode.idl\ + OutgoingMessageState.idl\ + PackageContentProvider.idl\ + PackageFolderContent.idl\ + PackageStreamContent.idl\ + PersistentPropertySet.idl\ + PostCommandArgument.idl\ + PostCommandArgument2.idl\ + Priority.idl\ + PropertiesManager.idl\ + PropertySetRegistry.idl\ + PropertyValueInfo.idl\ + PropertyValueState.idl\ + RecipientInfo.idl\ + RememberAuthentication.idl\ + RemoteAccessContentProvider.idl\ + RemoteContentProviderAcceptor.idl\ + RemoteContentProviderChangeAction.idl\ + RemoteContentProviderChangeEvent.idl\ + RemoteProxyContentProvider.idl\ + ResultSetException.idl\ Rule.idl\ - RuleAction.idl\ - RuleOperator.idl\ - RuleSet.idl\ - RuleTerm.idl\ - SearchCommandArgument.idl\ - SearchCriterium.idl\ - SearchInfo.idl\ - SearchRecursion.idl\ - SendInfo.idl\ - SendMediaTypes.idl\ - ServiceNotFoundException.idl\ - SimpleFileAccess.idl\ - SortedDynamicResultSetFactory.idl\ - SortingInfo.idl\ - Store.idl\ - SynchronizePolicy.idl\ - TransferCommandOperation.idl\ - TransferInfo.idl\ - TransferResult.idl\ + RuleAction.idl\ + RuleOperator.idl\ + RuleSet.idl\ + RuleTerm.idl\ + SearchCommandArgument.idl\ + SearchCriterium.idl\ + SearchInfo.idl\ + SearchRecursion.idl\ + SendInfo.idl\ + SendMediaTypes.idl\ + ServiceNotFoundException.idl\ + SimpleFileAccess.idl\ + SortedDynamicResultSetFactory.idl\ + SortingInfo.idl\ + Store.idl\ + SynchronizePolicy.idl\ + TransferCommandOperation.idl\ + TransferInfo.idl\ + TransferResult.idl\ TransientDocumentsContentProvider.idl\ TransientDocumentsRootContent.idl\ TransientDocumentsDocumentContent.idl\ TransientDocumentsFolderContent.idl\ TransientDocumentsStreamContent.idl\ - UniversalContentBroker.idl\ - UnsupportedCommandException.idl\ - UnsupportedDataSinkException.idl\ - UnsupportedNameClashException.idl\ - UnsupportedOpenModeException.idl\ - VerificationMode.idl\ - WebDAVContentProvider.idl\ - WebDAVDocumentContent.idl\ - WebDAVFolderContent.idl\ - WelcomeDynamicResultSetStruct.idl\ - XAnyCompare.idl\ - XAnyCompareFactory.idl\ - XCachedContentResultSetFactory.idl\ - XCachedContentResultSetStubFactory.idl\ - XCachedDynamicResultSetFactory.idl\ - XCachedDynamicResultSetStubFactory.idl\ - XCommandEnvironment.idl\ - XCommandInfo.idl\ - XCommandInfoChangeListener.idl\ - XCommandInfoChangeNotifier.idl\ - XCommandProcessor.idl\ - XCommandProcessor2.idl\ - XContent.idl\ - XContentAccess.idl\ - XContentCreator.idl\ - XContentEventListener.idl\ - XContentIdentifier.idl\ - XContentIdentifierFactory.idl\ - XContentIdentifierMapping.idl\ - XContentProvider.idl\ - XContentProviderFactory.idl\ - XContentProviderManager.idl\ - XContentProviderSupplier.idl\ - XContentTransmitter.idl\ - XDataContainer.idl\ - XDynamicResultSet.idl\ - XDynamicResultSetListener.idl\ - XFetchProvider.idl\ - XFetchProviderForContentAccess.idl\ - XFileIdentifierConverter.idl\ - XInteractionCookieHandling.idl\ - XInteractionHandlerSupplier.idl\ - XInteractionReplaceExistingData.idl\ - XInteractionSupplyAuthentication.idl\ - XInteractionSupplyName.idl\ - XParameterizedContentProvider.idl\ - XPersistentPropertySet.idl\ - XProgressHandler.idl\ - XPropertyMatcher.idl\ - XPropertyMatcherFactory.idl\ - XPropertySetRegistry.idl\ - XPropertySetRegistryFactory.idl\ - XRecycler.idl\ - XRemoteContentProviderAcceptor.idl\ - XRemoteContentProviderActivator.idl\ - XRemoteContentProviderChangeListener.idl\ - XRemoteContentProviderChangeNotifier.idl\ - XRemoteContentProviderConnectionControl.idl\ - XRemoteContentProviderDistributor.idl\ - XRemoteContentProviderDoneListener.idl\ - XRemoteContentProviderSupplier.idl\ - XSimpleFileAccess.idl\ - XSimpleFileAccess2.idl\ - XSimpleFileAccess3.idl\ - XSortedDynamicResultSetFactory.idl\ + UniversalContentBroker.idl\ + UnsupportedCommandException.idl\ + UnsupportedDataSinkException.idl\ + UnsupportedNameClashException.idl\ + UnsupportedOpenModeException.idl\ + VerificationMode.idl\ + WebDAVContentProvider.idl\ + WebDAVDocumentContent.idl\ + WebDAVFolderContent.idl\ + WelcomeDynamicResultSetStruct.idl\ + XAnyCompare.idl\ + XAnyCompareFactory.idl\ + XCachedContentResultSetFactory.idl\ + XCachedContentResultSetStubFactory.idl\ + XCachedDynamicResultSetFactory.idl\ + XCachedDynamicResultSetStubFactory.idl\ + XCommandEnvironment.idl\ + XCommandInfo.idl\ + XCommandInfoChangeListener.idl\ + XCommandInfoChangeNotifier.idl\ + XCommandProcessor.idl\ + XCommandProcessor2.idl\ + XContent.idl\ + XContentAccess.idl\ + XContentCreator.idl\ + XContentEventListener.idl\ + XContentIdentifier.idl\ + XContentIdentifierFactory.idl\ + XContentIdentifierMapping.idl\ + XContentProvider.idl\ + XContentProviderFactory.idl\ + XContentProviderManager.idl\ + XContentProviderSupplier.idl\ + XContentTransmitter.idl\ + XDataContainer.idl\ + XDynamicResultSet.idl\ + XDynamicResultSetListener.idl\ + XFetchProvider.idl\ + XFetchProviderForContentAccess.idl\ + XFileIdentifierConverter.idl\ + XInteractionCookieHandling.idl\ + XInteractionHandlerSupplier.idl\ + XInteractionReplaceExistingData.idl\ + XInteractionSupplyAuthentication.idl\ + XInteractionSupplyAuthentication2.idl\ + XInteractionSupplyName.idl\ + XParameterizedContentProvider.idl\ + XPersistentPropertySet.idl\ + XProgressHandler.idl\ + XPropertyMatcher.idl\ + XPropertyMatcherFactory.idl\ + XPropertySetRegistry.idl\ + XPropertySetRegistryFactory.idl\ + XRecycler.idl\ + XRemoteContentProviderAcceptor.idl\ + XRemoteContentProviderActivator.idl\ + XRemoteContentProviderChangeListener.idl\ + XRemoteContentProviderChangeNotifier.idl\ + XRemoteContentProviderConnectionControl.idl\ + XRemoteContentProviderDistributor.idl\ + XRemoteContentProviderDoneListener.idl\ + XRemoteContentProviderSupplier.idl\ + XSimpleFileAccess.idl\ + XSimpleFileAccess2.idl\ + XSimpleFileAccess3.idl\ + XSortedDynamicResultSetFactory.idl\ XSourceInitialization.idl\ XWebDAVCommandEnvironment.idl \ CertificateValidationRequest.idl diff --git a/offapi/prj/build.lst b/offapi/prj/build.lst index 6b4a0b95a054..6ddea0190596 100644 --- a/offapi/prj/build.lst +++ b/offapi/prj/build.lst @@ -103,5 +103,6 @@ oa offapi\com\sun\star\xml\wrapper nmake - all oa_wrapper oa_sax NULL oa offapi\com\sun\star\geometry nmake - all oa_geometry NULL oa offapi\com\sun\star\rendering nmake - all oa_rendering oa_geometry NULL oa offapi\com\sun\star\rdf nmake - all oa_rdf oa_datatransfer oa_text NULL +oa offapi\com\sun\star\office nmake - all oa_office oa_text NULL
oa offapi\drafts\com\sun\star\form nmake - all oa_drafts_form NULL -oa offapi\util nmake - all oa_util oa_auth oa_awt oa_awttree oa_awtgrid oa_chart oa_chart2 oa_chart2_data oa_config oa_configbootstrap oa_configbackend oa_configbackend_xml oa_datatrans_clip oa_datatrans_dnd oa_datatransfer oa_docu oa_draw oa_draw_framework oa_embed oa_fcomp oa_finsp oa_fcontr oa_fieldmaster oa_form oa_xforms oa_formula oa_frame oa_i18n oa_inst oa_ldap oa_ling2 oa_logging oa_mail oa_media oa_mozilla oa_packages oa_manifest oa_zippackage oa_plug oa_pres oa_animations oa_putil oa_resrc oa_sax oa_xml_input oa_scan oa_sdb oa_sdbtools oa_sdbapp oa_sdbc oa_sdbcx oa_setup oa_sheet oa_style oa_svg oa_sync oa_sync2 oa_system oa_table oa_task oa_text oa_textfield oa_docinfo oa_ucb oa_view oa_xml oa_xml_dom oa_xml_xpath oa_xml_views oa_xml_events oa_image oa_xsd oa_inspection oa_ui oa_ui_dialogs oa_accessibility oa_form_binding oa_form_validation oa_form_submission oa_fruntime oa_geometry oa_rendering oa_sfprovider oa_sfbrowse oa_drafts_form oa_deployment oa_deploymenttest oa_deployment_ui oa_frame_status oa_gallery oa_graphic oa_security oa_crypto_sax oa_crypto oa_csax oa_wrapper oa_script oa_smarttags oa_report oa_reportins oa_reportmeta oa_rdf oa_oooimprovement NULL +oa offapi\util nmake - all oa_util oa_auth oa_awt oa_awttree oa_awtgrid oa_chart oa_chart2 oa_chart2_data oa_config oa_configbootstrap oa_configbackend oa_configbackend_xml oa_datatrans_clip oa_datatrans_dnd oa_datatransfer oa_docu oa_draw oa_draw_framework oa_embed oa_fcomp oa_finsp oa_fcontr oa_fieldmaster oa_form oa_xforms oa_formula oa_frame oa_i18n oa_inst oa_ldap oa_ling2 oa_logging oa_mail oa_media oa_mozilla oa_packages oa_manifest oa_zippackage oa_plug oa_pres oa_animations oa_putil oa_resrc oa_sax oa_xml_input oa_scan oa_sdb oa_sdbtools oa_sdbapp oa_sdbc oa_sdbcx oa_setup oa_sheet oa_style oa_svg oa_sync oa_sync2 oa_system oa_table oa_task oa_text oa_textfield oa_docinfo oa_ucb oa_view oa_xml oa_xml_dom oa_xml_xpath oa_xml_views oa_xml_events oa_image oa_xsd oa_inspection oa_ui oa_ui_dialogs oa_accessibility oa_form_binding oa_form_validation oa_form_submission oa_fruntime oa_geometry oa_rendering oa_sfprovider oa_sfbrowse oa_drafts_form oa_deployment oa_deploymenttest oa_deployment_ui oa_frame_status oa_gallery oa_graphic oa_security oa_crypto_sax oa_crypto oa_csax oa_wrapper oa_script oa_smarttags oa_report oa_reportins oa_reportmeta oa_rdf oa_oooimprovement oa_office NULL diff --git a/offapi/util/makefile.mk b/offapi/util/makefile.mk index fcf3e4bd6c02..d3157dac31df 100644 --- a/offapi/util/makefile.mk +++ b/offapi/util/makefile.mk @@ -144,6 +144,7 @@ UNOIDLDBFILES= \ $(UCR)$/cssreport.db \ $(UCR)$/cssrptins.db \ $(UCR)$/cssrptmeta.db \ + $(UCR)$/cssoffice.db \ $(UCR)$/cssrdf.db @@ -163,14 +164,14 @@ ALLTAR : $(UCR)$/types.db \ $(UNOTYPE_STATISTICS) $(UCR)$/types.db : $(UCR)$/offapi.db $(SOLARBINDIR)$/udkapi.rdb - -$(RM) $(REGISTRYCHECKFLAG) - $(GNUCOPY) -f $(UCR)$/offapi.db $@ - $(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi.rdb + @-$(RM) $(REGISTRYCHECKFLAG) + @$(GNUCOPY) -f $(UCR)$/offapi.db $@ + $(COMMAND_ECHO)$(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi.rdb $(OUT)$/ucrdoc$/types_doc.db : $(OUT)$/ucrdoc$/offapi_doc.db $(SOLARBINDIR)$/udkapi_doc.rdb - -$(RM) $(REGISTRYCHECKFLAG) - $(GNUCOPY) -f $(OUT)$/ucrdoc$/offapi_doc.db $@ - $(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi_doc.rdb + @-$(RM) $(REGISTRYCHECKFLAG) + @$(GNUCOPY) -f $(OUT)$/ucrdoc$/offapi_doc.db $@ + $(COMMAND_ECHO)$(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi_doc.rdb #JSC: The type library has changed, all temporary not checked types are removed # and will be check from now on. diff --git a/offapi/util/target.pmk b/offapi/util/target.pmk index 08912b011857..63804f3e554a 100644 --- a/offapi/util/target.pmk +++ b/offapi/util/target.pmk @@ -30,8 +30,8 @@ #************************************************************************* $(OUT)$/misc$/$(TARGET).idls: makefile.mk - -$(RM) $@ - $(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@ + $(COMMAND_ECHO)-$(RM) $@ + $(COMMAND_ECHO)$(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@ ALLTAR: $(OUT)$/misc$/$(TARGET).idls diff --git a/offuh/prj/d.lst b/offuh/prj/d.lst index 0e85b261e8e2..bedbc8d112d4 100644 --- a/offuh/prj/d.lst +++ b/offuh/prj/d.lst @@ -51,6 +51,7 @@ mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\lang mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\linguistic2 mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\logging mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\oooimprovement +mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\office mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\mail mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\media mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\packages @@ -226,6 +227,8 @@ mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\rdf ..\%__SRC%\inc\offuh\com\sun\star\linguistic2\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\linguistic2\*.hpp ..\%__SRC%\inc\offuh\com\sun\star\logging\*.hdl %_DEST%\inc%_EXT%\offuh\com\sun\star\logging\*.hdl ..\%__SRC%\inc\offuh\com\sun\star\logging\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\logging\*.hpp +..\%__SRC%\inc\offuh\com\sun\star\office\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\office\*.hpp
+..\%__SRC%\inc\offuh\com\sun\star\office\*.hdl %_DEST%\inc%_EXT%\offuh\com\sun\star\office\*.hdl
..\%__SRC%\inc\offuh\com\sun\star\oooimprovement\*.hdl %_DEST%\inc%_EXT%\offuh\com\sun\star\oooimprovement\*.hdl ..\%__SRC%\inc\offuh\com\sun\star\oooimprovement\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\oooimprovement\*.hpp ..\%__SRC%\inc\offuh\com\sun\star\mail\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\mail\*.hpp @@ -371,4 +374,3 @@ mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\rdf ..\%__SRC%\inc\offuh\com\sun\star\rdf\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\rdf\*.hpp ..\%__SRC%\inc\offuh\com\sun\star\rdf\*.hdl %_DEST%\inc%_EXT%\offuh\com\sun\star\rdf\*.hdl - diff --git a/pyuno/prj/d.lst b/pyuno/prj/d.lst index 16631ada6fbd..5fe7400a8d58 100644 --- a/pyuno/prj/d.lst +++ b/pyuno/prj/d.lst @@ -16,6 +16,7 @@ mkdir: %_DEST%\lib%_EXT%\pyuno ..\%__SRC%\bin\uno.py %_DEST%\bin%_EXT%\pyuno\uno.py ..\%__SRC%\bin\pyuno_services.rdb %_DEST%\bin%_EXT%\pyuno_services.rdb ..\%__SRC%\bin\pyuno.pyd %_DEST%\bin%_EXT%\pyuno.pyd +..\%__SRC%\bin\pyuno.dll %_DEST%\bin%_EXT%\pyuno.dll ..\%__SRC%\bin\pythonl*.dll %_DEST%\bin%_EXT%\pythonl*.dll ..\%__SRC%\misc\pyunorc %_DEST%\lib%_EXT%\pyunorc diff --git a/pyuno/source/loader/makefile.mk b/pyuno/source/loader/makefile.mk index 11ece4796301..6e4f96ed7014 100644 --- a/pyuno/source/loader/makefile.mk +++ b/pyuno/source/loader/makefile.mk @@ -37,7 +37,7 @@ ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk - +.IF "$(L10N_framework)"=="" DLLPRE = #------------------------------------------------------------------- @@ -101,18 +101,16 @@ COMPONENTS= \ ALL : ALLTAR \ $(DLLDEST)$/pythonloader.py \ $(DLLDEST)$/pyuno_services.rdb +.ENDIF # L10N_framework .INCLUDE : target.mk - +.IF "$(L10N_framework)"=="" $(DLLDEST)$/%.py: %.py cp $? $@ $(DLLDEST)$/pyuno_services.rdb : makefile.mk $(DLLDEST)$/$(DLLPRE)$(TARGET)$(DLLPOST) -rm -f $@ $(DLLDEST)$/pyuno_services.tmp $(DLLDEST)$/pyuno_services.rdb -.IF "$(GUI)$(COM)"=="WNTGCC" - cd $(DLLDEST) && sh -c "export PATH='$(PATH):$(OUT)$/bin'; $(REGCOMP) -register -r pyuno_services.tmp -wop $(foreach,i,$(COMPONENTS) -c $(i))" -.ELSE cd $(DLLDEST) && $(REGCOMP) -register -r pyuno_services.tmp -wop $(foreach,i,$(COMPONENTS) -c $(i)) -.ENDIF # "$(GUI)$(COM)"=="WNTGCC" cd $(DLLDEST) && mv pyuno_services.tmp pyuno_services.rdb +.ENDIF # L10N_framework diff --git a/pyuno/source/module/makefile.mk b/pyuno/source/module/makefile.mk index 94de195e750f..2357d0062ed0 100644 --- a/pyuno/source/module/makefile.mk +++ b/pyuno/source/module/makefile.mk @@ -39,6 +39,7 @@ LINKFLAGSDEFS = # do not fail with missing symbols # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.IF "$(L10N_framework)"=="" #------------------------------------------------------------------- .IF "$(OS)$(CPU)$(COMEX)" == "SOLARISS4" @@ -56,6 +57,9 @@ EXTRA_FRAMEWORK_FLAG=-framework Python # pyuno.so even on Mac OS X, because it is a python module PYUNO_MODULE=$(DLLDEST)$/pyuno.so PYUNORC=pyunorc +.ELIF "$(GUI)" == "OS2" +.INCLUDE : pyversion.mk +PYUNORC=pyuno.ini .ELSE .INCLUDE : pyversion.mk PYUNORC=pyuno.ini @@ -125,10 +129,11 @@ ALLTAR : \ $(DLLDEST)$/unohelper.py \ $(PYUNO_MODULE) \ $(MISC)$/$(PYUNORC) +.ENDIF .ENDIF .INCLUDE : target.mk - +.IF "$(L10N_framework)"=="" $(DLLDEST)$/%.py: %.py cp $? $@ @@ -160,4 +165,5 @@ $(MISC)$/$(PYUNORC) : pyuno $(MISC)$/pyuno.flt : pyuno.flt -rm -f $@ cat $? > $@ +.ENDIF # L10N_framework diff --git a/pyuno/zipcore/makefile.mk b/pyuno/zipcore/makefile.mk index f46106dc8afe..a820c1a59f4f 100755 --- a/pyuno/zipcore/makefile.mk +++ b/pyuno/zipcore/makefile.mk @@ -36,7 +36,7 @@ TARGET=zipcore LIBTARGET=NO .INCLUDE : settings.mk - +.IF "$(L10N_framework)"=="" UWINAPILIB = .IF "$(SYSTEM_PYTHON)" == "YES" || "$(GUI)" == "OS2" @@ -74,6 +74,7 @@ APP1RPATH = BRAND OBJFILES = $(OBJ)$/python.obj .ENDIF + .INCLUDE: target.mk ALLTAR: \ @@ -129,3 +130,7 @@ $(DESTROOT)$/bin$/python$(EXECPOST) : $(SOLARBINDIR)$/python$(EXECPOST) .ENDIF .ENDIF +.ELSE +ivo: + $(ECHO) +.ENDIF # L10N_framework diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index f8de7e20b148..281c8e27cbf0 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -365,6 +365,7 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal return REG_SET_VALUE_FAILED; } + rValue.flush(); rtl_freeMemory(pBuffer); return REG_NO_ERROR; } @@ -423,6 +424,7 @@ RegError ORegKey::setLongListValue(const OUString& valueName, sal_Int32* pValueL return REG_SET_VALUE_FAILED; } + rValue.flush(); rtl_freeMemory(pBuffer); return REG_NO_ERROR; } @@ -490,6 +492,7 @@ RegError ORegKey::setStringListValue(const OUString& valueName, sal_Char** pValu return REG_SET_VALUE_FAILED; } + rValue.flush(); rtl_freeMemory(pBuffer); return REG_NO_ERROR; } @@ -557,6 +560,7 @@ RegError ORegKey::setUnicodeListValue(const OUString& valueName, sal_Unicode** p return REG_SET_VALUE_FAILED; } + rValue.flush(); rtl_freeMemory(pBuffer); return REG_NO_ERROR; } diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 86165b42bd1d..8a4dd8b88ee9 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -550,6 +550,7 @@ RegError ORegistry::closeRegistry() if (m_file.isValid()) { closeKey(m_openKeyTable[ROOT]); + m_file.flush(); m_file.close(); m_isOpen = sal_False; return REG_NO_ERROR; @@ -847,6 +848,7 @@ RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName) { return REG_DELETE_KEY_FAILED; } + sFile.flush(); // set flag deleted !!! ((ORegKey*)hOldKey)->setDeleted(sal_True); @@ -892,6 +894,7 @@ RegError ORegistry::deleteSubkeysAndValues(ORegKey* pKey) { return REG_DELETE_VALUE_FAILED; } + ((OStoreFile&)pKey->getStoreFile()).flush(); } _err = rStoreDir.next(iter); @@ -1062,6 +1065,7 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey, { return REG_VALUE_NOT_EXISTS; } + pSourceKey->getStoreFile().flush(); pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE); @@ -1133,6 +1137,7 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey, rtl_freeMemory(pBuffer); return REG_INVALID_VALUE; } + rTargetFile.flush(); if (rwBytes != nSize) { diff --git a/remotebridges/source/bridge/makefile.mk b/remotebridges/source/bridge/makefile.mk index ef02b1bcebc9..75b5f3a6152e 100644 --- a/remotebridges/source/bridge/makefile.mk +++ b/remotebridges/source/bridge/makefile.mk @@ -38,6 +38,7 @@ COMP1TYPELIST = remotebridge # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.IF "$(L10N_framework)"=="" DLLPRE = # ------------------------------------------------------------------ @@ -61,6 +62,7 @@ SHL1DEF= $(MISC)$/$(SHL1TARGET).def SHL1RPATH= URELIB DEF1NAME= $(SHL1TARGET) +.ENDIF # L10N_framework # --- Targets ------------------------------------------------------ .INCLUDE : target.mk diff --git a/remotebridges/source/dynamicloader/makefile.mk b/remotebridges/source/dynamicloader/makefile.mk index 1a4364c74062..95a80e107ffb 100755 --- a/remotebridges/source/dynamicloader/makefile.mk +++ b/remotebridges/source/dynamicloader/makefile.mk @@ -39,6 +39,7 @@ COMP1TYPELIST = dynamicloader # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.IF "$(L10N_framework)"=="" DLLPRE = # ------------------------------------------------------------------ @@ -65,6 +66,7 @@ SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) +.ENDIF # L10N_framework # --- Targets ------------------------------------------------------ diff --git a/remotebridges/source/factory/makefile.mk b/remotebridges/source/factory/makefile.mk index 280ed38829f8..97eb02415a47 100644 --- a/remotebridges/source/factory/makefile.mk +++ b/remotebridges/source/factory/makefile.mk @@ -38,6 +38,7 @@ COMP1TYPELIST = brdgfctr # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.IF "$(L10N_framework)"=="" DLLPRE = # ------------------------------------------------------------------ @@ -61,6 +62,7 @@ SHL1DEF= $(MISC)$/$(SHL1TARGET).def SHL1RPATH= URELIB DEF1NAME= $(SHL1TARGET) +.ENDIF # L10N_framework # --- Targets ------------------------------------------------------ diff --git a/remotebridges/source/unourl_resolver/makefile.mk b/remotebridges/source/unourl_resolver/makefile.mk index bb005dc167c4..81f8b1c67609 100644 --- a/remotebridges/source/unourl_resolver/makefile.mk +++ b/remotebridges/source/unourl_resolver/makefile.mk @@ -38,6 +38,7 @@ COMP1TYPELIST = uuresolver # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.IF "$(L10N_framework)"=="" DLLPRE = # ------------------------------------------------------------------ @@ -60,6 +61,7 @@ SHL1DEF= $(MISC)$/$(SHL1TARGET).def SHL1RPATH= URELIB DEF1NAME= $(SHL1TARGET) +.ENDIF # L10N_framework # --- Targets ------------------------------------------------------ diff --git a/ridljar/com/sun/star/uno/UnoRuntime.java b/ridljar/com/sun/star/uno/UnoRuntime.java index dcf7ff42b10c..28ee8fb1e2bd 100644 --- a/ridljar/com/sun/star/uno/UnoRuntime.java +++ b/ridljar/com/sun/star/uno/UnoRuntime.java @@ -179,8 +179,9 @@ public class UnoRuntime { * otherwise <code>null</code> * @see #queryInterface(Type, Object) */ - public static Object queryInterface(Class zInterface, Object object) { - return queryInterface(new Type(zInterface), object); + @SuppressWarnings("unchecked") + public static <T> T queryInterface(Class<T> zInterface, Object object) { + return (T) queryInterface(new Type(zInterface), object); } /** diff --git a/ridljar/test/com/sun/star/uno/UnoRuntime_Test.java b/ridljar/test/com/sun/star/uno/UnoRuntime_Test.java index 06af7828039e..a9eef19b0a64 100644 --- a/ridljar/test/com/sun/star/uno/UnoRuntime_Test.java +++ b/ridljar/test/com/sun/star/uno/UnoRuntime_Test.java @@ -54,7 +54,7 @@ public final class UnoRuntime_Test extends ComplexTestCase { // Test if a delegator object has the same OID as its creator: Test4 test4 = new Test4(); - Ifc ifc = (Ifc) UnoRuntime.queryInterface(Ifc.class, test4); + Ifc ifc = UnoRuntime.queryInterface(Ifc.class, test4); assure( "Test4", UnoRuntime.generateOid(test4).equals(UnoRuntime.generateOid(ifc))); @@ -64,19 +64,19 @@ public final class UnoRuntime_Test extends ComplexTestCase { // Test if a query for an interface which is not supported returns null: assure( "Test1", - (Ifc) UnoRuntime.queryInterface(Ifc.class, new Test1()) == null); + UnoRuntime.queryInterface(Ifc.class, new Test1()) == null); // Test if a query for an interface which is supported through // IQueryInterface succeeds: assure( "Test2", - (Ifc) UnoRuntime.queryInterface(Ifc.class, new Test2()) != null); + UnoRuntime.queryInterface(Ifc.class, new Test2()) != null); // Test if a query for an interface which is directly supported (through // inheritance) succeeds: assure( "Test3", - (Ifc) UnoRuntime.queryInterface(Ifc.class, new Test3()) != null); + UnoRuntime.queryInterface(Ifc.class, new Test3()) != null); } public void test_areSame() { diff --git a/sal/inc/rtl/math.h b/sal/inc/rtl/math.h index 4d72bcaa39d1..fed06e511b26 100644 --- a/sal/inc/rtl/math.h +++ b/sal/inc/rtl/math.h @@ -434,6 +434,42 @@ double SAL_CALL rtl_math_log1p(double fValue) SAL_THROW_EXTERN_C(); */ double SAL_CALL rtl_math_atanh(double fValue) SAL_THROW_EXTERN_C(); +/** Returns values of the Errorfunction erf. + + erf is part of the C99 standard, but not provided by some compilers. + + @param fValue + The value x in the term erf(x). + */ +double SAL_CALL rtl_math_erf(double fValue) SAL_THROW_EXTERN_C(); + +/** Returns values of the complement Errorfunction erfc. + + erfc is part of the C99 standard, but not provided by some compilers. + + @param fValue + The value x in the term erfc(x). + */ +double SAL_CALL rtl_math_erfc(double fValue) SAL_THROW_EXTERN_C(); + +/** Returns values of the inverse hyperbolic sine. + + asinh is part of the C99 standard, but not provided by some compilers. + + @param fValue + The value x in the term asinh(x). + */ +double SAL_CALL rtl_math_asinh(double fValue) SAL_THROW_EXTERN_C(); + +/** Returns values of the inverse hyperbolic cosine. + + acosh is part of the C99 standard, but not provided by some compilers. + + @param fValue + The value x in the term acosh(x). + */ +double SAL_CALL rtl_math_acosh(double fValue) SAL_THROW_EXTERN_C(); + #if defined __cplusplus } #endif /* __cplusplus */ diff --git a/sal/inc/rtl/math.hxx b/sal/inc/rtl/math.hxx index b61cf9b9806f..5760340cc6a4 100644 --- a/sal/inc/rtl/math.hxx +++ b/sal/inc/rtl/math.hxx @@ -221,6 +221,35 @@ inline double atanh(double fValue) return rtl_math_atanh(fValue); } +/** A wrapper around rtl_math_erf. + */ +inline double erf(double fValue) +{ + return rtl_math_erf(fValue); +} + +/** A wrapper around rtl_math_erfc. + */ +inline double erfc(double fValue) +{ + return rtl_math_erfc(fValue); +} + +/** A wrapper around rtl_math_asinh. + */ +inline double asinh(double fValue) +{ + return rtl_math_asinh(fValue); +} + +/** A wrapper around rtl_math_acosh. + */ +inline double acosh(double fValue) +{ + return rtl_math_acosh(fValue); +} + + /** Test equality of two values with an accuracy of the magnitude of the given values scaled by 2^-48 (4 bits roundoff stripped). diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h index 23c7529eed26..eec07286f2c5 100644 --- a/sal/inc/sal/types.h +++ b/sal/inc/sal/types.h @@ -124,10 +124,17 @@ typedef unsigned char sal_uInt8; #define SAL_CONST_INT64(x) x##ll #define SAL_CONST_UINT64(x) x##ull + #ifdef __MINGW32__ + #define SAL_PRIdINT64 "I64d" + #define SAL_PRIuUINT64 "I64u" + #define SAL_PRIxUINT64 "I64x" + #define SAL_PRIXUINT64 "I64X" + #else #define SAL_PRIdINT64 "lld" #define SAL_PRIuUINT64 "llu" #define SAL_PRIxUINT64 "llx" #define SAL_PRIXUINT64 "llX" + #endif #else #error "Could not find 64-bit type, add support for your architecture" #endif @@ -170,7 +177,7 @@ typedef void * sal_Handle; /* printf-style conversion specification length modifiers for size_t and ptrdiff_t (most platforms support C99, MSC has its own extension) */ -#if defined _MSC_VER +#if defined(_MSC_VER) || defined(__MINGW32__) #define SAL_PRI_SIZET "I" #define SAL_PRI_PTRDIFFT "I" #else diff --git a/sal/osl/os2/debug.c b/sal/osl/os2/debug.c index 67fc7a1e709f..78a2df07056e 100644 --- a/sal/osl/os2/debug.c +++ b/sal/osl/os2/debug.c @@ -1,3 +1,33 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile:$ + * $Revision:$ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + /* *@@sourcefile debug.c: * this file contains debugging functions for the @@ -27,20 +57,15 @@ */ /* - * This file Copyright (C) 1992-99 Ulrich Mller, + * This file Copyright (C) 1992-99 Ulrich M�ller, * Kim Rasmussen, * Marc Fiammante, * John Currier, * Anthony Cruise. * This file is part of the "XWorkplace helpers" source package. - * This is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published - * by the Free Software Foundation, in version 2 as it comes in the - * "COPYING" file of the XWorkplace main distribution. - * This program 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 General Public License for more details. + * + * 2009-06-15 published under LGPL3 with Ulrich M�ller permission. + * */ //#define DEBUG_SYMDUMP // enable to dump sym file to log @@ -1484,7 +1509,7 @@ void dbgPrintVariables(FILE *LogFile, // in: text log file to write to (PVOID)stackofs, func_name); fprintf(LogFile, " Offset Name Type Value \n"); - fprintf(LogFile, " \n"); + fprintf(LogFile, " ������ �������������������� ��������������������������������� �����������������\n"); } // If it's one of the simple types @@ -1880,7 +1905,7 @@ VOID dbgPrintStack(FILE *LogFile, // in: text log file to write to fprintf(LogFile, "\n\nCall stack:\n"); fprintf(LogFile, " Source Line Nearest\n"); fprintf(LogFile, " EBP Address Module Obj# File Numbr Public Symbol\n"); - fprintf(LogFile, " - -\n"); + fprintf(LogFile, " �������� ��������- �������� ���� ������������ ����� ������������-\n"); do { diff --git a/sal/osl/os2/except.c b/sal/osl/os2/except.c index e1ae9fb7bd06..0dd2a35d1fcd 100644 --- a/sal/osl/os2/except.c +++ b/sal/osl/os2/except.c @@ -1,3 +1,32 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile:$ + * $Revision:$ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ /* *@@sourcefile except.c: @@ -178,7 +207,7 @@ * exception handling DLL, available at Hobbes). * * If not explicitly stated otherwise, the code has been written - * by me, Ulrich Mller. + * by me, Ulrich M�ller. * * Note: Version numbering in this file relates to XWorkplace version * numbering. @@ -187,7 +216,7 @@ */ /* - * This file Copyright (C) 1992-99 Ulrich Mller, + * This file Copyright (C) 1992-99 Ulrich M�ller, * Monte Copeland, * Roman Stangl, * Kim Rasmussen, @@ -195,14 +224,9 @@ * John Currier, * Anthony Cruise. * This file is part of the "XWorkplace helpers" source package. - * This is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published - * by the Free Software Foundation, in version 2 as it comes in the - * "COPYING" file of the XWorkplace main distribution. - * This program 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 General Public License for more details. + * + * 2009-06-15 published under LGPL3 with Ulrich M�ller permission. + * */ #define OS2EMX_PLAIN_CHAR diff --git a/sal/osl/os2/helpers/debug.h b/sal/osl/os2/helpers/debug.h index be35be3d3326..b03508b70379 100644 --- a/sal/osl/os2/helpers/debug.h +++ b/sal/osl/os2/helpers/debug.h @@ -1,3 +1,32 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile:$ + * $Revision:$ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ /* *@@sourcefile debug.h: @@ -21,19 +50,14 @@ * Anthony Cruise (EXCEPT3.ZIP package for a generic * exception handling DLL, available at Hobbes). * - * This file Copyright (C) 1992-99 Ulrich Mller, + * This file Copyright (C) 1992-99 Ulrich M�ller, * Kim Rasmussen, * Marc Fiammante, * John Currier, * Anthony Cruise. - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, in version 2 as it comes in the COPYING - * file of the XFolder main distribution. - * This program 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 General Public License for more details. + * + * 2009-06-15 published under LGPL3 with Ulrich M�ller permission. + * */ #ifndef DEBUG_HEADER_INCLUDED diff --git a/sal/osl/os2/helpers/dosh.h b/sal/osl/os2/helpers/dosh.h index d2e936a57447..518f979fd4de 100644 --- a/sal/osl/os2/helpers/dosh.h +++ b/sal/osl/os2/helpers/dosh.h @@ -1,28 +1,39 @@ - -/* - *@@sourcefile dosh.h: - * header file for dosh.c. See remarks there. +/************************************************************************* * - * Note: Version numbering in this file relates to XWorkplace version - * numbering. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - *@@include #define INCL_DOSPROCESS - *@@include #define INCL_DOSDEVIOCTL // for doshQueryDiskParams only - *@@include #include <os2.h> - *@@include #include "helpers\dosh.h" - */ + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile:$ + * $Revision:$ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ -/* This file Copyright (C) 1997-2001 Ulrich Mller, +/* This file Copyright (C) 1997-2006 Ulrich M�ller, * Dmitry A. Steklenev. * This file is part of the "XWorkplace helpers" source package. - * This is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published - * by the Free Software Foundation, in version 2 as it comes in the - * "COPYING" file of the XWorkplace main distribution. - * This program 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 General Public License for more details. + * + * 2009-06-15 published under LGPL3 with Ulrich M�ller permission. + * */ #if __cplusplus @@ -32,886 +43,10 @@ extern "C" { #ifndef DOSH_HEADER_INCLUDED #define DOSH_HEADER_INCLUDED - /* ****************************************************************** - * - * Wrappers - * - ********************************************************************/ - - // if DOSH_STANDARDWRAPPERS is #define'd before including dosh.h, - // all the following Dos* API calls are redirected to the dosh* - // counterparts - - #ifdef DOSH_STANDARDWRAPPERS - - #ifdef INCL_DOSPROCESS - - APIRET XWPENTRY doshSleep(ULONG msec); - #define DosSleep(a) doshSleep((a)) - - #endif - - #ifdef INCL_DOSSEMAPHORES - - APIRET XWPENTRY doshCreateMutexSem(PSZ pszName, - PHMTX phmtx, - ULONG flAttr, - BOOL32 fState); - #define DosCreateMutexSem(a, b, c, d) doshCreateMutexSem((a), (b), (c), (d)) - - APIRET XWPENTRY doshRequestMutexSem(HMTX hmtx, ULONG ulTimeout); - #define DosRequestMutexSem(h, t) doshRequestMutexSem((h), (t)) - - APIRET XWPENTRY doshReleaseMutexSem(HMTX hmtx); - #define DosReleaseMutexSem(h) doshReleaseMutexSem((h)) - - #endif - - #ifdef INCL_DOSEXCEPTIONS - - APIRET XWPENTRY doshSetExceptionHandler(PEXCEPTIONREGISTRATIONRECORD pERegRec); - #define DosSetExceptionHandler(a) doshSetExceptionHandler((a)) - - APIRET XWPENTRY doshUnsetExceptionHandler(PEXCEPTIONREGISTRATIONRECORD pERegRec); - #define DosUnsetExceptionHandler(a) doshUnsetExceptionHandler((a)) - - #endif - - #endif - - /* ****************************************************************** - * - * Miscellaneous - * - ********************************************************************/ - - CHAR doshGetChar(VOID); - - BOOL doshQueryShiftState(VOID); - - ULONG doshIsWarp4(VOID); - - PSZ doshQuerySysErrorMsg(APIRET arc); - - ULONG doshQuerySysUptime(VOID); - - /* ****************************************************************** - * - * Memory helpers - * - ********************************************************************/ - - PVOID doshMalloc(ULONG cb, - APIRET *parc); - - APIRET doshAllocArray(ULONG c, - ULONG cbArrayItem, - PBYTE *ppv, - PULONG pcbAllocated); - - PVOID doshAllocSharedMem(ULONG ulSize, - const char* pcszName); - - PVOID doshRequestSharedMem(PCSZ pcszName); - - /* ****************************************************************** - * - * Drive helpers - * - ********************************************************************/ - - APIRET doshIsFixedDisk(ULONG ulLogicalDrive, - PBOOL pfFixed); - - #ifdef INCL_DOSDEVIOCTL - - // #pragma pack(1) - - /* - * DRIVEPARAMS: - * structure used for doshQueryDiskParams. - * removed this, we can directly use BIOSPARAMETERBLOCK - * V0.9.13 (2001-06-14) [umoeller] - */ - - /* typedef struct _DRIVEPARAMS - { - BIOSPARAMETERBLOCK bpb; - // BIOS parameter block. This is the first sector - // (at byte 0) in each partition. This is defined - // in the OS2 headers as follows: - - typedef struct _BIOSPARAMETERBLOCK { - 0 USHORT usBytesPerSector; - // Number of bytes per sector. - 2 BYTE bSectorsPerCluster; - // Number of sectors per cluster. - 3 USHORT usReservedSectors; - // Number of reserved sectors. - 5 BYTE cFATs; - // Number of FATs. - 6 USHORT cRootEntries; - // Number of root directory entries. - 8 USHORT cSectors; - // Number of sectors. - 10 BYTE bMedia; - // Media descriptor. - 11 USHORT usSectorsPerFAT; - // Number of secctors per FAT. - 13 USHORT usSectorsPerTrack; - // Number of sectors per track. - 15 USHORT cHeads; - // Number of heads. - 17 ULONG cHiddenSectors; - // Number of hidden sectors. - 21 ULONG cLargeSectors; - // Number of large sectors. - 25 BYTE abReserved[6]; - // Reserved. - 31 USHORT cCylinders; - // Number of cylinders defined for the physical - // device. - 33 BYTE bDeviceType; - // Physical layout of the specified device. - 34 USHORT fsDeviceAttr; - // A bit field that returns flag information - // about the specified drive. - } BIOSPARAMETERBLOCK; - - // removed the following fields... these are already - // in the extended BPB structure, as defined in the - // Toolkit's BIOSPARAMETERBLOCK struct. Checked this, - // the definition is the same for the Toolkit 3 and 4.5. - - USHORT usCylinders; - // no. of cylinders - UCHAR ucDeviceType; - // device type; according to the IBM Control - // Program Reference (see DSK_GETDEVICEPARAMS), - // this value can be: - // -- 0: 48 TPI low-density diskette drive - // -- 1: 96 TPI high-density diskette drive - // -- 2: 3.5-inch 720KB diskette drive - // -- 3: 8-Inch single-density diskette drive - // -- 4: 8-Inch double-density diskette drive - // -- 5: Fixed disk - // -- 6: Tape drive - // -- 7: Other (includes 1.44MB 3.5-inch diskette drive - // and CD-ROMs) - // -- 8: R/W optical disk - // -- 9: 3.5-inch 4.0MB diskette drive (2.88MB formatted) - USHORT usDeviceAttrs; - // DEVATTR_* flags - } DRIVEPARAMS, *PDRIVEPARAMS; - #pragma pack() */ - - APIRET doshQueryDiskParams(ULONG ulLogicalDrive, - PBIOSPARAMETERBLOCK pdp); - - BYTE doshQueryDriveType(ULONG ulLogicalDrive, - PBIOSPARAMETERBLOCK pdp, - BOOL fFixed); - - APIRET XWPENTRY doshHasAudioCD(ULONG ulLogicalDrive, - HFILE hfDrive, - BOOL fMixedModeCD, - PBOOL pfAudio); - - #endif - - VOID XWPENTRY doshEnumDrives(PSZ pszBuffer, - PCSZ pcszFileSystem, - BOOL fSkipRemoveables); - typedef VOID XWPENTRY DOSHENUMDRIVES(PSZ pszBuffer, - PCSZ pcszFileSystem, - BOOL fSkipRemoveables); - typedef DOSHENUMDRIVES *PDOSHENUMDRIVES; - CHAR doshQueryBootDrive(VOID); - #define ERROR_AUDIO_CD_ROM 10000 - - #define DRVFL_MIXEDMODECD 0x0001 - #define DRVFL_TOUCHFLOPPIES 0x0002 - #define DRVFL_CHECKEAS 0x0004 - #define DRVFL_CHECKLONGNAMES 0x0008 - - APIRET doshAssertDrive(ULONG ulLogicalDrive, - ULONG fl); - - #ifdef INCL_DOSDEVIOCTL - - /* - *@@ XDISKINFO: - * - *@@added V0.9.16 (2002-01-13) [umoeller] - */ - - typedef struct _XDISKINFO - { - CHAR cDriveLetter; // drive letter - CHAR cLogicalDrive; // logical drive no. - - BOOL fPresent; // if FALSE, drive does not exist - - // the following are only valid if fPresent == TRUE - - BIOSPARAMETERBLOCK bpb; - // 0x00 USHORT usBytesPerSector; - // 0x02 BYTE bSectorsPerCluster; - // 0x03 USHORT usReservedSectors; - // 0x05 BYTE cFATs; - // 0x06 USHORT cRootEntries; - // 0x08 USHORT cSectors; - // 0x0a BYTE bMedia; - // 0x0b USHORT usSectorsPerFAT; - // 0x0d USHORT usSectorsPerTrack; - // 0x0f USHORT cHeads; - // 0x11 ULONG cHiddenSectors; - // 0x15 ULONG cLargeSectors; - // 0x19 BYTE abReserved[6]; - // 0x1a USHORT cCylinders; - // 0x1c BYTE bDeviceType; - #ifndef DEVTYPE_48TPI - #define DEVTYPE_48TPI 0x0000 - #define DEVTYPE_96TPI 0x0001 - #define DEVTYPE_35 0x0002 - #define DEVTYPE_8SD 0x0003 - #define DEVTYPE_8DD 0x0004 - #define DEVTYPE_FIXED 0x0005 - #define DEVTYPE_TAPE 0x0006 - #endif - #define DEVTYPE_OTHER 0x0007 - // includes 1.44 3.5" floppy - #define DEVTYPE_RWOPTICAL 0x0008 - #define DEVTYPE_35_288MB 0x0009 - // 0x1d USHORT fsDeviceAttr; - #define DEVATTR_REMOVEABLE 0x0001 - // drive is removeable - #define DEVATTR_CHANGELINE 0x0002 - // device can determine whether media has - // been removed since last I/O operation - #define DEVATTR_GREATER16MB 0x0004 - // physical device driver supports physical - // addresses > 16 MB - #define DEVATTR_PARTITIONALREMOVEABLE 0x0008 - // undocumented flag; set for ZIP drives - - BYTE bType; - // do not change these codes, XWorkplace relies - // on them too to parse WPDisk data - #define DRVTYPE_HARDDISK 0 - #define DRVTYPE_FLOPPY 1 - #define DRVTYPE_TAPE 2 - #define DRVTYPE_VDISK 3 - #define DRVTYPE_CDROM 4 - #define DRVTYPE_LAN 5 - #define DRVTYPE_PARTITIONABLEREMOVEABLE 6 - #define DRVTYPE_UNKNOWN 255 - - ULONG flDevice; - // any combination of the following: - #define DFL_REMOTE 0x0001 - // drive is remote (not local) - #define DFL_FIXED 0x0002 - // drive is fixed; otherwise it is removeable! - // always set for harddisks and zip drives - #define DFL_PARTITIONABLEREMOVEABLE 0x0004 - // set for zip drives; - // in that case, DFL_FIXED is set also - #define DFL_BOOTDRIVE 0x0008 - // drive was booted from - - // media flags: - - #define DFL_MEDIA_PRESENT 0x1000 - // media is present in drive; - // -- always set for harddisks, - // unless the file system is not - // understood - // -- always set for remove drives - // -- always set for A: and B: - // -- set for CD-ROMS only if data - // CD-ROM is inserted - #define DFL_AUDIO_CD 0x2000 - // set for CD-ROMs only, if an audio CD - // is currently inserted; in that case, - // DFL_MEDIA_PRESENT is _not_ set - #define DFL_SUPPORTS_EAS 0x4000 - // drive supports extended attributes - // (assumption based on DosFSCtl, - // might not be correct for remote drives; - // reports correctly for FAT32 though) - #define DFL_SUPPORTS_LONGNAMES 0x8000 - // drive supports long names; this does not - // necessarily mean that we support all IFS - // characters also - - // the following are only valid if DFL_MEDIA_PRESENT is set; - // they are always set for drives A: and B: - - CHAR szFileSystem[30]; - // e.g. "FAT" or "HPFS" or "JFS" or "CDFS" - - LONG lFileSystem; - // do not change these codes, XWorkplace relies - // on them too to parse WPDisk data - #define FSYS_UNKNOWN 0 - // drive not formatted, or unknown file system - #define FSYS_FAT 1 - #define FSYS_HPFS_JFS 2 - #define FSYS_CDFS 3 - #define FSYS_CDWFS 6 // not used by WPS! - // added V0.9.19 (2002-04-25) [umoeller] - #define FSYS_TVFS 7 // not used by WPS! - #define FSYS_FAT32_EXT2 8 // not used by WPS! - #define FSYS_RAMFS 9 // not used by WPS! - #define FSYS_REMOTE 10 - // NOTE: if this has a negative value, this is - // the APIRET code from DosQueryFSAttach - - // error codes for various operations - APIRET arcIsFixedDisk, - arcQueryDiskParams, - arcQueryMedia, - arcOpenLongnames; - - } XDISKINFO, *PXDISKINFO; - - APIRET doshGetDriveInfo(ULONG ulLogicalDrive, - ULONG fl, - PXDISKINFO pdi); - - #endif - - APIRET doshSetLogicalMap(ULONG ulLogicalDrive); - - APIRET XWPENTRY doshQueryDiskSize(ULONG ulLogicalDrive, double *pdSize); - typedef APIRET XWPENTRY DOSHQUERYDISKSIZE(ULONG ulLogicalDrive, double *pdSize); - typedef DOSHQUERYDISKSIZE *PDOSHQUERYDISKSIZE; - - APIRET XWPENTRY doshQueryDiskFree(ULONG ulLogicalDrive, double *pdFree); - typedef APIRET XWPENTRY DOSHQUERYDISKFREE(ULONG ulLogicalDrive, double *pdFree); - typedef DOSHQUERYDISKFREE *PDOSHQUERYDISKFREE; - - APIRET XWPENTRY doshQueryDiskFSType(ULONG ulLogicalDrive, PSZ pszBuf, ULONG cbBuf); - typedef APIRET XWPENTRY DOSHQUERYDISKFSTYPE(ULONG ulLogicalDrive, PSZ pszBuf, ULONG cbBuf); - typedef DOSHQUERYDISKFSTYPE *PDOSHQUERYDISKFSTYPE; - - APIRET doshQueryDiskLabel(ULONG ulLogicalDrive, - PSZ pszVolumeLabel); - - APIRET doshSetDiskLabel(ULONG ulLogicalDrive, - PSZ pszNewLabel); - - /* ****************************************************************** - * - * Module handling helpers - * - ********************************************************************/ - - APIRET doshQueryProcAddr(PCSZ pcszModuleName, - ULONG ulOrdinal, - PFN *ppfn); - - /* - *@@ RESOLVEFUNCTION: - * one of these structures each define - * a single function import to doshResolveImports. - * - *@@added V0.9.3 (2000-04-25) [umoeller] - */ - - typedef struct _RESOLVEFUNCTION - { - const char *pcszFunctionName; - PFN *ppFuncAddress; - } RESOLVEFUNCTION, *PRESOLVEFUNCTION; - - typedef const struct _RESOLVEFUNCTION *PCRESOLVEFUNCTION; - - APIRET doshResolveImports(PCSZ pcszModuleName, - HMODULE *phmod, - PCRESOLVEFUNCTION paResolves, - ULONG cResolves); - - /* ****************************************************************** - * - * Performance Counters (CPU Load) - * - ********************************************************************/ - - #define CMD_PERF_INFO 0x41 - #define CMD_KI_ENABLE 0x60 - #define CMD_KI_DISABLE 0x61 - #ifndef CMD_KI_RDCNT - #define CMD_KI_RDCNT 0x63 - typedef APIRET APIENTRY FNDOSPERFSYSCALL(ULONG ulCommand, - ULONG ulParm1, - ULONG ulParm2, - ULONG ulParm3); - typedef FNDOSPERFSYSCALL *PFNDOSPERFSYSCALL; - #endif - - typedef struct _CPUUTIL - { - ULONG ulTimeLow; // low 32 bits of time stamp - ULONG ulTimeHigh; // high 32 bits of time stamp - ULONG ulIdleLow; // low 32 bits of idle time - ULONG ulIdleHigh; // high 32 bits of idle time - ULONG ulBusyLow; // low 32 bits of busy time - ULONG ulBusyHigh; // high 32 bits of busy time - ULONG ulIntrLow; // low 32 bits of interrupt time - ULONG ulIntrHigh; // high 32 bits of interrupt time - } CPUUTIL, *PCPUUTIL; - - // macro to convert 8-byte (low, high) time value to double - #define LL2F(high, low) (4294967296.0*(high)+(low)) - - /* - *@@ DOSHPERFSYS: - * structure used with doshPerfOpen. - * - *@@added V0.9.7 (2000-12-02) [umoeller] - *@@changed V0.9.9 (2001-03-14) [umoeller]: added interrupt load - */ - - typedef struct _DOSHPERFSYS - { - // output: no. of processors on the system - ULONG cProcessors; - // output: one CPU load for each CPU - PLONG palLoads; - - // output: one CPU interrupt load for each CPU - PLONG palIntrs; - - // each of the following ptrs points to an array of cProcessors items - PCPUUTIL paCPUUtils; // CPUUTIL structures - double *padBusyPrev; // previous "busy" calculations - double *padTimePrev; // previous "time" calculations - double *padIntrPrev; // previous "intr" calculations - - // private stuff - HMODULE hmod; - BOOL fInitialized; - PFNDOSPERFSYSCALL pDosPerfSysCall; - } DOSHPERFSYS, *PDOSHPERFSYS; - - APIRET doshPerfOpen(PDOSHPERFSYS *ppPerfSys); - - APIRET doshPerfGet(PDOSHPERFSYS pPerfSys); - - APIRET doshPerfClose(PDOSHPERFSYS *ppPerfSys); - - /* ****************************************************************** - * - * File name parsing - * - ********************************************************************/ - - APIRET doshGetDriveSpec(PCSZ pcszFullFile, - PSZ pszDrive, - PULONG pulDriveLen, - PBOOL pfIsUNC); - - PSZ doshGetExtension(PCSZ pcszFilename); - - /* ****************************************************************** - * - * File helpers - * - ********************************************************************/ - - BOOL doshIsFileOnFAT(const char* pcszFileName); - - APIRET doshIsValidFileName(const char* pcszFile, - BOOL fFullyQualified); - - BOOL doshMakeRealName(PSZ pszTarget, PSZ pszSource, CHAR cReplace, BOOL fIsFAT); - - APIRET doshQueryFileSize(HFILE hFile, - PULONG pulSize); - - APIRET doshQueryPathSize(PCSZ pcszFile, - PULONG pulSize); - - APIRET doshQueryPathAttr(const char* pcszFile, - PULONG pulAttr); - - APIRET doshSetPathAttr(const char* pcszFile, - ULONG ulAttr); - - /* ****************************************************************** - * - * XFILEs - * - ********************************************************************/ - - /* - *@@ XFILE: - * - *@@added V0.9.16 (2001-10-19) [umoeller] - */ - - typedef struct _XFILE - { - HFILE hf; - - PSZ pszFilename; // as given to doshOpen - ULONG flOpenMode; // as given to doshOpen - - ULONG cbInitial, // intial file size on open (can be 0 if new) - cbCurrent; // current file size (raised with each write) - - PBYTE pbCache; // if != NULL, cached data from doshReadAt - ULONG cbCache, // size of data in cbCache - ulReadFrom; // file offset where pbCache was read from - } XFILE, *PXFILE; - - #define XOPEN_READ_EXISTING 0x0001 - #define XOPEN_READWRITE_EXISTING 0x0002 - #define XOPEN_READWRITE_APPEND 0x0003 - #define XOPEN_READWRITE_NEW 0x0004 - #define XOPEN_ACCESS_MASK 0xffff - - #define XOPEN_BINARY 0x10000000 - - APIRET doshOpen(PCSZ pcszFilename, - ULONG flOpenMode, - PULONG pcbFile, - PXFILE *ppFile); - - #define DRFL_NOCACHE 0x0001 - #define DRFL_FAILIFLESS 0x0002 - - APIRET doshReadAt(PXFILE pFile, - ULONG ulOffset, - PULONG pcb, - PBYTE pbData, - ULONG fl); - - APIRET doshWrite(PXFILE pFile, - ULONG cb, - PCSZ pbData); - - APIRET doshWriteAt(PXFILE pFile, - ULONG ulOffset, - ULONG cb, - PCSZ pbData); - - APIRET doshWriteLogEntry(PXFILE pFile, - const char* pcszFormat, - ...); - - APIRET doshClose(PXFILE *ppFile); - - APIRET doshReadText(PXFILE pFile, - PSZ* ppszContent, - PULONG pcbRead); - - APIRET doshLoadTextFile(PCSZ pcszFile, - PSZ* ppszContent, - PULONG pcbRead); - - PSZ doshCreateBackupFileName(const char* pszExisting); - - APIRET doshCreateTempFileName(PSZ pszTempFileName, - PCSZ pcszDir, - PCSZ pcszPrefix, - PCSZ pcszExt); - - APIRET doshWriteTextFile(const char* pszFile, - const char* pszContent, - PULONG pulWritten, - PSZ pszBackup); - - - /* ****************************************************************** - * - * Directory helpers - * - ********************************************************************/ - - BOOL doshQueryDirExist(PCSZ pcszDir); - - APIRET doshCreatePath(PCSZ pcszPath, - BOOL fHidden); - - APIRET doshQueryCurrentDir(PSZ pszBuf); - - APIRET doshSetCurrentDir(PCSZ pcszDir); - - #define DOSHDELDIR_RECURSE 0x0001 - #define DOSHDELDIR_DELETEFILES 0x0002 - - APIRET doshDeleteDir(PCSZ pcszDir, - ULONG flFlags, - PULONG pulDirs, - PULONG pulFiles); - - APIRET doshCanonicalize(PCSZ pcszFileIn, - PSZ pszFileOut, - ULONG cbFileOut); - - /* ****************************************************************** - * - * Process helpers - * - ********************************************************************/ - - ULONG XWPENTRY doshMyPID(VOID); - typedef ULONG XWPENTRY DOSHMYPID(VOID); - typedef DOSHMYPID *PDOSHMYPID; - - ULONG XWPENTRY doshMyTID(VOID); - typedef ULONG XWPENTRY DOSHMYTID(VOID); - typedef DOSHMYTID *PDOSHMYTID; - - APIRET doshExecVIO(PCSZ pcszExecWithArgs, - PLONG plExitCode); - - APIRET doshQuickStartSession(PCSZ pcszPath, - PCSZ pcszParams, - BOOL fForeground, - USHORT usPgmCtl, - BOOL fWait, - PULONG pulSID, - PPID ppid, - PUSHORT pusReturn); - - APIRET doshSearchPath(PCSZ pcszPath, - PCSZ pcszFile, - PSZ pszExecutable, - ULONG cbExecutable); - - APIRET doshFindExecutable(PCSZ pcszCommand, - PSZ pszExecutable, - ULONG cbExecutable, - PCSZ *papcszExtensions, - ULONG cExtensions); - - /******************************************************************** - * - * Partition functions - * - ********************************************************************/ - - /* - *@@ LVMINFO: - * informational structure created by - * doshQueryLVMInfo. - * - *@@added V0.9.9 (2001-04-07) [umoeller] - */ - - typedef struct _LVMINFO - { - HMODULE hmodLVM; - - } LVMINFO, *PLVMINFO; - - /* #define DOSH_PARTITIONS_LIMIT 10 - - #define PAR_UNUSED 0x00 // Unused - #define PAR_FAT12SMALL 0x01 // DOS FAT 12-bit < 10 Mb - #define PAR_XENIXROOT 0x02 // XENIX root - #define PAR_XENIXUSER 0x03 // XENIX user - #define PAR_FAT16SMALL 0x04 // DOS FAT 16-bit < 32 Mb - #define PAR_EXTENDED 0x05 // Extended partition - #define PAR_FAT16BIG 0x06 // DOS FAT 16-bit > 32 Mb - #define PAR_HPFS 0x07 // OS/2 HPFS - #define PAR_AIXBOOT 0x08 // AIX bootable partition - #define PAR_AIXDATA 0x09 // AIX bootable partition - #define PAR_BOOTMANAGER 0x0A // OS/2 Boot Manager - #define PAR_WINDOWS95 0x0B // Windows 95 32-bit FAT - #define PAR_WINDOWS95LB 0x0C // Windows 95 32-bit FAT with LBA - #define PAR_VFAT16BIG 0x0E // LBA VFAT (same as 06h but using LBA-mode) - #define PAR_VFAT16EXT 0x0F // LBA VFAT (same as 05h but using LBA-mode) - #define PAR_OPUS 0x10 // OPUS - #define PAR_HID12SMALL 0x11 // OS/2 hidden DOS FAT 12-bit - #define PAR_COMPAQDIAG 0x12 // Compaq diagnostic - #define PAR_HID16SMALL 0x14 // OS/2 hidden DOS FAT 16-bit - #define PAR_HID16BIG 0x16 // OS/2 hidden DOS FAT 16-bit - #define PAR_HIDHPFS 0x17 // OS/2 hidden HPFS - #define PAR_WINDOWSSWP 0x18 // AST Windows Swap File - #define PAR_NECDOS 0x24 // NEC MS-DOS 3.x - #define PAR_THEOS 0x38 // THEOS - #define PAR_VENIX 0x40 // VENIX - #define PAR_RISCBOOT 0x41 // Personal RISC boot - #define PAR_SFS 0x42 // SFS - #define PAR_ONTRACK 0x50 // Ontrack - #define PAR_ONTRACKEXT 0x51 // Ontrack extended partition - #define PAR_CPM 0x52 // CP/M - #define PAR_UNIXSYSV 0x63 // UNIX SysV/386 - #define PAR_NOVELL_64 0x64 // Novell - #define PAR_NOVELL_65 0x65 // Novell - #define PAR_NOVELL_67 0x67 // Novell - #define PAR_NOVELL_68 0x68 // Novell - #define PAR_NOVELL_69 0x69 // Novell - #define PAR_PCIX 0x75 // PCIX - #define PAR_MINIX 0x80 // MINIX - #define PAR_LINUX 0x81 // Linux - #define PAR_LINUXSWAP 0x82 // Linux Swap Partition - #define PAR_LINUXFILE 0x83 // Linux File System - #define PAR_FREEBSD 0xA5 // FreeBSD - #define PAR_BBT 0xFF // BBT - */ - - // one-byte alignment - #pragma pack(1) - - /* - *@@ PAR_INFO: - * partition table - */ - - typedef struct _PAR_INFO - { - BYTE bBootFlag; // 0=not active, 80H = active (boot this partition - BYTE bBeginHead; // partition begins at this head... - USHORT rBeginSecCyl; // ...and this sector and cylinder (see below) - BYTE bFileSysCode; // file system type - BYTE bEndHead; // partition ends at this head... - USHORT bEndSecCyl; // ...and this sector and cylinder (see below) - ULONG lBeginAbsSec; // partition begins at this absolute sector # - ULONG lTotalSects; // total sectors in this partition - } PAR_INFO, *PPAR_INFO; - - /* - *@@ MBR_INFO: - * master boot record table. - * This has the four primary partitions. - */ - - typedef struct _MBR_INFO // MBR - { - BYTE aBootCode[0x1BE]; // abBootCode master boot executable code - PAR_INFO sPrtnInfo[4]; // primary partition entries - USHORT wPrtnTblSig; // partition table signature (aa55H) - } MBR_INFO, *PMBR_INFO; - - /* - *@@ SYS_INFO: - * - */ - - typedef struct _SYS_INFO - { - BYTE startable; - BYTE unknown[3]; - BYTE bootable; - BYTE name[8]; - BYTE reservd[3]; - } SYS_INFO, *PSYS_INFO; - - /* - *@@ SYE_INFO: - * - */ - - typedef struct _SYE_INFO - { - BYTE bootable; - BYTE name[8]; - } SYE_INFO, *PSYE_INFO; - - /* - *@@ EXT_INFO: - * - */ - - typedef struct _EXT_INFO - { - BYTE aBootCode[0x18A]; // abBootCode master boot executable code - SYE_INFO sBmNames[4]; // System Names - BYTE bReserved[16]; // reserved - PAR_INFO sPrtnInfo[4]; // partitioms entrys - USHORT wPrtnTblSig; // partition table signature (aa55H) - } EXT_INFO, *PEXT_INFO; - - typedef struct _PARTITIONINFO *PPARTITIONINFO; - - /* - *@@ PARTITIONINFO: - * informational structure returned - * by doshGetPartitionsList. One of - * these items is created for each - * bootable partition. - */ - - typedef struct _PARTITIONINFO - { - BYTE bDisk; // drive number - CHAR cLetter; // probable drive letter or ' ' if none - BYTE bFSType; // file system type - PCSZ pcszFSType; // file system name (as returned by - // doshType2FSName, can be NULL!) - BOOL fPrimary; // primary partition? - BOOL fBootable; // bootable by Boot Manager? - CHAR szBootName[21]; // Boot Manager name, if (fBootable) - // extended for LVM names V0.9.20 (2002-08-10) [umoeller] - ULONG ulSize; // size MBytes - PPARTITIONINFO pNext; // next info or NULL if last - } PARTITIONINFO; - - UINT doshQueryDiskCount(VOID); - - APIRET doshReadSector(USHORT disk, - void *buff, - USHORT head, - USHORT cylinder, - USHORT sector); - - // restore original alignment - #pragma pack() - - const char* doshType2FSName(unsigned char bFSType); - - APIRET doshGetBootManager(USHORT *pusDisk, - USHORT *pusPart, - PAR_INFO *BmInfo); - - typedef struct _PARTITIONSLIST - { - PLVMINFO pLVMInfo; // != NULL if LVM is installed - - // partitions array - PPARTITIONINFO pPartitionInfo; - USHORT cPartitions; - } PARTITIONSLIST, *PPARTITIONSLIST; - - APIRET doshGetPartitionsList(PPARTITIONSLIST *ppList, - PUSHORT pusContext); - - APIRET doshFreePartitionsList(PPARTITIONSLIST ppList); - - APIRET doshQueryLVMInfo(PLVMINFO *ppLVMInfo); - - APIRET doshReadLVMPartitions(PLVMINFO pInfo, - PPARTITIONINFO *ppPartitionInfo, - PUSHORT pcPartitions); - - VOID doshFreeLVMInfo(PLVMINFO pInfo); - - /* ****************************************************************** - * - * Wildcard matching - * - ********************************************************************/ - - BOOL doshMatchCase(PCSZ pcszMask, - PCSZ pcszName); - - BOOL doshMatchCaseNoPath(const char *pcszMask, - const char *pcszName); - - BOOL doshMatch(PCSZ pcszMask, - PCSZ pcszName); - #endif #if __cplusplus } #endif - diff --git a/sal/osl/os2/helpers/except.h b/sal/osl/os2/helpers/except.h index 6a898ba84c99..b2d6b17ca702 100644 --- a/sal/osl/os2/helpers/except.h +++ b/sal/osl/os2/helpers/except.h @@ -1,3 +1,32 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile:$ + * $Revision:$ + * + * 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> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ /* *@@sourcefile except.h: @@ -15,15 +44,10 @@ */ /* - * Copyright (C) 1999-2000 Ulrich Mller. - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, in version 2 as it comes in the COPYING - * file of the XFolder main distribution. - * This program 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 General Public License for more details. + * Copyright (C) 1999-2000 Ulrich M�ller. + * + * 2009-06-15 published under LGPL3 with Ulrich M�ller permission. + * */ #if __cplusplus diff --git a/sal/osl/os2/helpers/setup.h b/sal/osl/os2/helpers/setup.h index 015d93019f21..6c02d8b655fb 100644 --- a/sal/osl/os2/helpers/setup.h +++ b/sal/osl/os2/helpers/setup.h @@ -1,3 +1,35 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile:$ + * $Revision:$ + * + * 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> + * for a copy of the LGPLv3 License. + * + * 2009-06-15 published under LGPL3 with Ulrich M�ller permission. + * + * + ************************************************************************/ /* * setup.h: diff --git a/sal/osl/os2/module.c b/sal/osl/os2/module.c index c8c9731a95ed..901c029429c4 100644 --- a/sal/osl/os2/module.c +++ b/sal/osl/os2/module.c @@ -109,7 +109,7 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *ustrModuleName, sal_Int32 nRtldMo pModule = (oslModule)hModule; else { - sal_Char szError[ 120 ]; + sal_Char szError[ PATH_MAX*2 ]; sprintf( szError, "Module: %s; rc: %d;\nReason: %s;\n" "Please contact technical support and report above informations.\n\n", buffer, rc, szErrorMessage ); diff --git a/sal/osl/os2/process.c b/sal/osl/os2/process.c index 793be57950b6..a3408ddbf7d0 100644 --- a/sal/osl/os2/process.c +++ b/sal/osl/os2/process.c @@ -551,7 +551,8 @@ oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, { for (i = first; pszArguments[i] != NULL; i++) n += strlen(pszArguments[i]) + 1; - args = (sal_Char*)malloc(n); + // YD DosStartSession requires low-mem buffers! + args = (sal_Char*)_tmalloc(n); *args = '\0'; for (i = first; pszArguments[i] != NULL; i++) { @@ -567,7 +568,8 @@ oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, { for (i = 0; pszEnvironments[i] != NULL; i++) n += strlen(pszEnvironments[i]) + 1; - envs = (sal_Char*)malloc(n + 1); + // YD DosStartSession requires low-mem buffers! + envs = (sal_Char*)_tmalloc(n + 1); pStr = (sal_Char*)envs; for (i = 0; pszEnvironments[i] != NULL; i++) { @@ -660,9 +662,9 @@ oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, if(envs) - free(envs); + _tfree(envs); if(args) - free(args); + _tfree(args); if( rc != NO_ERROR ) return osl_Process_E_Unknown; diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index c8ebf5ad11c5..8e7d76cda614 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -44,6 +44,7 @@ #include <limits> #include <string.h> +#include <pthread.h> #include <sys/mman.h> #if defined(MACOSX) @@ -74,8 +75,9 @@ ******************************************************************/ struct FileHandle_Impl { - rtl_String * m_strFilePath; /* holds native file path */ - int m_fd; + pthread_mutex_t m_mutex; + rtl_String * m_strFilePath; /* holds native file path */ + int m_fd; /** State */ @@ -110,6 +112,7 @@ struct FileHandle_Impl oslFileError setPos (sal_uInt64 uPos); sal_uInt64 getSize() const; + oslFileError setSize (sal_uInt64 uSize); oslFileError readAt ( off_t nOffset, @@ -168,6 +171,17 @@ struct FileHandle_Impl Allocator(); ~Allocator(); }; + + /** Guard. + */ + class Guard + { + pthread_mutex_t * m_mutex; + + public: + explicit Guard(pthread_mutex_t * pMutex); + ~Guard(); + }; }; /******************************************************************* @@ -212,6 +226,18 @@ void FileHandle_Impl::Allocator::deallocate (sal_uInt8 * pBuffer) rtl_cache_free (m_cache, pBuffer); } +FileHandle_Impl::Guard::Guard(pthread_mutex_t * pMutex) + : m_mutex (pMutex) +{ + OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::Guard(): null pointer."); + (void) pthread_mutex_lock (m_mutex); // ignoring EINVAL ... +} +FileHandle_Impl::Guard::~Guard() +{ + OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::~Guard(): null pointer."); + (void) pthread_mutex_unlock (m_mutex); +} + FileHandle_Impl::FileHandle_Impl (int fd, char const * path) : m_strFilePath (0), m_fd (fd), @@ -224,6 +250,7 @@ FileHandle_Impl::FileHandle_Impl (int fd, char const * path) m_bufsiz (0), m_buffer (0) { + (void) pthread_mutex_init(&m_mutex, 0); rtl_string_newFromStr (&m_strFilePath, path); Allocator::get().allocate (&m_buffer, &m_bufsiz); if (0 != m_buffer) @@ -233,6 +260,7 @@ FileHandle_Impl::~FileHandle_Impl() { Allocator::get().deallocate (m_buffer), m_buffer = 0; rtl_string_release (m_strFilePath), m_strFilePath = 0; + (void) pthread_mutex_destroy(&m_mutex); // ignoring EBUSY ... } void* FileHandle_Impl::operator new (size_t n) @@ -271,6 +299,47 @@ sal_uInt64 FileHandle_Impl::getSize() const return std::max(m_size, sal::static_int_cast< sal_uInt64 >(bufend)); } +oslFileError FileHandle_Impl::setSize (sal_uInt64 uSize) +{ + off_t const nSize = sal::static_int_cast< off_t >(uSize); + if (-1 == ftruncate (m_fd, nSize)) + { + /* Failure. Save original result. Try fallback algorithm */ + oslFileError result = oslTranslateFileError (OSL_FET_ERROR, errno); + + /* Check against current size. Fail upon 'shrink' */ + if (uSize <= getSize()) + { + /* Failure upon 'shrink'. Return original result */ + return (result); + } + + /* Save current position */ + off_t const nCurPos = (off_t)lseek (m_fd, (off_t)0, SEEK_CUR); + if (nCurPos == (off_t)(-1)) + return (result); + + /* Try 'expand' via 'lseek()' and 'write()' */ + if (-1 == lseek (m_fd, (off_t)(nSize - 1), SEEK_SET)) + return (result); + + if (-1 == write (m_fd, (char*)"", (size_t)1)) + { + /* Failure. Restore saved position */ + (void) lseek (m_fd, (off_t)(nCurPos), SEEK_SET); + return (result); + } + + /* Success. Restore saved position */ + if (-1 == lseek (m_fd, (off_t)nCurPos, SEEK_SET)) + return (result); + } + + OSL_FILE_TRACE("osl_setFileSize(%d, %lld) => %ld", m_fd, getSize(), nSize); + m_size = sal::static_int_cast< sal_uInt64 >(nSize); + return osl_File_E_None; +} + oslFileError FileHandle_Impl::readAt ( off_t nOffset, void * pBuffer, @@ -906,6 +975,8 @@ SAL_CALL osl_closeFile( oslFileHandle Handle ) if ((pImpl == 0) || (pImpl->m_fd < 0)) return osl_File_E_INVAL; + (void) pthread_mutex_lock (&(pImpl->m_mutex)); + /* close(2) implicitly (and unconditionally) unlocks */ OSL_TRACE("osl_closeFile(%d) => %s", pImpl->m_fd, rtl_string_getStr(pImpl->m_strFilePath)); oslFileError result = pImpl->syncFile(); @@ -920,6 +991,7 @@ SAL_CALL osl_closeFile( oslFileHandle Handle ) result = oslTranslateFileError (OSL_FET_ERROR, errno); } + (void) pthread_mutex_unlock (&(pImpl->m_mutex)); delete pImpl; return (result); } @@ -935,6 +1007,8 @@ SAL_CALL osl_syncFile(oslFileHandle Handle) if ((0 == pImpl) || (-1 == pImpl->m_fd)) return osl_File_E_INVAL; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); + OSL_FILE_TRACE("osl_syncFile(%d)", pImpl->m_fd); oslFileError result = pImpl->syncFile(); if (result != osl_File_E_None) @@ -1044,6 +1118,7 @@ SAL_CALL osl_readLine ( sal_uInt64 uBytesRead = 0; // read at current fileptr; fileptr += uBytesRead; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); oslFileError result = pImpl->readLineAt ( pImpl->m_fileptr, ppSequence, &uBytesRead); if (result == osl_File_E_None) @@ -1072,6 +1147,7 @@ SAL_CALL osl_readFile ( size_t const nBytesRequested = sal::static_int_cast< size_t >(uBytesRequested); // read at current fileptr; fileptr += *pBytesRead; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); oslFileError result = pImpl->readFileAt ( pImpl->m_fileptr, pBuffer, nBytesRequested, pBytesRead); if (result == osl_File_E_None) @@ -1102,6 +1178,7 @@ SAL_CALL osl_writeFile ( size_t const nBytesToWrite = sal::static_int_cast< size_t >(uBytesToWrite); // write at current fileptr; fileptr += *pBytesWritten; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); oslFileError result = pImpl->writeFileAt ( pImpl->m_fileptr, pBuffer, nBytesToWrite, pBytesWritten); if (result == osl_File_E_None) @@ -1138,6 +1215,7 @@ SAL_CALL osl_readFileAt ( size_t const nBytesRequested = sal::static_int_cast< size_t >(uBytesRequested); // read at specified fileptr + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); return pImpl->readFileAt (nOffset, pBuffer, nBytesRequested, pBytesRead); } @@ -1172,6 +1250,7 @@ SAL_CALL osl_writeFileAt ( size_t const nBytesToWrite = sal::static_int_cast< size_t >(uBytesToWrite); // write at specified fileptr + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); return pImpl->writeFileAt (nOffset, pBuffer, nBytesToWrite, pBytesWritten); } @@ -1186,6 +1265,7 @@ SAL_CALL osl_isEndOfFile( oslFileHandle Handle, sal_Bool *pIsEOF ) if ((0 == pImpl) || (-1 == pImpl->m_fd) || (0 == pIsEOF)) return osl_File_E_INVAL; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); *pIsEOF = (pImpl->getPos() == pImpl->getSize()); return osl_File_E_None; } @@ -1201,6 +1281,7 @@ SAL_CALL osl_getFilePos( oslFileHandle Handle, sal_uInt64* pPos ) if ((0 == pImpl) || (-1 == pImpl->m_fd) || (0 == pPos)) return osl_File_E_INVAL; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); *pPos = pImpl->getPos(); return osl_File_E_None; } @@ -1221,6 +1302,7 @@ SAL_CALL osl_setFilePos (oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uOffse return osl_File_E_OVERFLOW; off_t nPos = 0, nOffset = sal::static_int_cast< off_t >(uOffset); + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); switch(uHow) { case osl_Pos_Absolut: @@ -1262,6 +1344,7 @@ SAL_CALL osl_getFileSize( oslFileHandle Handle, sal_uInt64* pSize ) if ((0 == pImpl) || (-1 == pImpl->m_fd) || (0 == pSize)) return osl_File_E_INVAL; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); *pSize = pImpl->getSize(); return osl_File_E_None; } @@ -1282,62 +1365,11 @@ SAL_CALL osl_setFileSize( oslFileHandle Handle, sal_uInt64 uSize ) static sal_uInt64 const g_limit_off_t = std::numeric_limits< off_t >::max(); if (g_limit_off_t < uSize) return osl_File_E_OVERFLOW; - off_t const nSize = sal::static_int_cast< off_t >(uSize); oslFileError result = pImpl->syncFile(); if (result != osl_File_E_None) return (result); + pImpl->m_bufptr = -1, pImpl->m_buflen = 0; - if (-1 == ftruncate (pImpl->m_fd, nSize)) - { - /* Failure. Try fallback algorithm */ - off_t nCurPos; - - /* Save original result */ - result = oslTranslateFileError (OSL_FET_ERROR, errno); - PERROR("ftruncate", "Try osl_setFileSize [fallback]\n"); - - /* Check against current size. Fail upon 'shrink' */ - if (uSize <= pImpl->getSize()) - { - /* Failure upon 'shrink'. Return original result */ - return (result); - } - - /* Save current position *//* @@@ pImpl->m_offset @@@ */ - nCurPos = (off_t)lseek (pImpl->m_fd, (off_t)0, SEEK_CUR); - if (nCurPos == (off_t)(-1)) - { - PERROR("ftruncate: lseek", "Out osl_setFileSize [error]\n"); - return (result); - } - - /* Try 'expand' via 'lseek()' and 'write()' */ - if (lseek (pImpl->m_fd, (off_t)(nSize - 1), SEEK_SET) < 0) - { - PERROR("ftruncate: lseek", "Out osl_setFileSize [error]\n"); - return (result); - } - if (write (pImpl->m_fd, (char*)"", (size_t)1) < 0) - { - /* Failure. Restore saved position */ - PERROR("ftruncate: write", "Out osl_setFileSize [error]\n"); - if (lseek (pImpl->m_fd, (off_t)nCurPos, SEEK_SET) < 0) - { - PERROR("ftruncate: lseek", "ignoring"); - } - return (result); - } - - /* Success. Restore saved position */ - if (lseek (pImpl->m_fd, (off_t)nCurPos, SEEK_SET) < 0) - { - PERROR("ftruncate: lseek", "Out osl_setFileSize [error]"); - return (result); - } - } - - OSL_FILE_TRACE("osl_setFileSize(%d, %lld) => %ld", pImpl->m_fd, pImpl->getSize(), nSize); - pImpl->m_size = sal::static_int_cast< sal_uInt64 >(nSize); - return osl_File_E_None; + return pImpl->setSize (uSize); } diff --git a/sal/osl/unx/process.c b/sal/osl/unx/process.c index e5faf46548a6..a1f47cdf76a5 100644 --- a/sal/osl/unx/process.c +++ b/sal/osl/unx/process.c @@ -466,7 +466,7 @@ static void ChildStatusProc(void *pData) if ((pid = fork()) == 0) { /* Child */ - close(channel[0]); + if (channel[0] != -1) close(channel[0]); if ((data.m_uid != (uid_t)-1) && ((data.m_uid != getuid()) || (data.m_gid != getgid()))) { @@ -500,32 +500,32 @@ static void ChildStatusProc(void *pData) /* Connect std IO to pipe ends */ /* Write end of stdInput not used in child process */ - close( stdInput[1] ); + if (stdInput[1] != -1) close( stdInput[1] ); /* Read end of stdOutput not used in child process */ - close( stdOutput[0] ); + if (stdOutput[0] != -1) close( stdOutput[0] ); /* Read end of stdError not used in child process */ - close( stdError[0] ); + if (stdError[0] != -1) close( stdError[0] ); /* Redirect pipe ends to std IO */ if ( stdInput[0] != STDIN_FILENO ) { dup2( stdInput[0], STDIN_FILENO ); - close( stdInput[0] ); + if (stdInput[0] != -1) close( stdInput[0] ); } if ( stdOutput[1] != STDOUT_FILENO ) { dup2( stdOutput[1], STDOUT_FILENO ); - close( stdOutput[1] ); + if (stdOutput[1] != -1) close( stdOutput[1] ); } if ( stdError[1] != STDERR_FILENO ) { dup2( stdError[1], STDERR_FILENO ); - close( stdError[1] ); + if (stdError[1] != -1) close( stdError[1] ); } pid=execv(data.m_pszArgs[0], (sal_Char **)data.m_pszArgs); @@ -539,7 +539,7 @@ static void ChildStatusProc(void *pData) /* if we reach here, something went wrong */ write(channel[1], &errno, sizeof(errno)); - close(channel[1]); + if (channel[1] != -1) close(channel[1]); _exit(255); } @@ -547,12 +547,12 @@ static void ChildStatusProc(void *pData) { /* Parent */ int status; - close(channel[1]); + if (channel[1] != -1) close(channel[1]); /* Close unused pipe ends */ - close( stdInput[0] ); - close( stdOutput[1] ); - close( stdError[1] ); + if (stdInput[0] != -1) close( stdInput[0] ); + if (stdOutput[1] != -1) close( stdOutput[1] ); + if (stdError[1] != -1) close( stdError[1] ); while (((i = read(channel[0], &status, sizeof(status))) < 0)) { @@ -560,7 +560,7 @@ static void ChildStatusProc(void *pData) break; } - close(channel[0]); + if (channel[0] != -1) close(channel[0]); if ((pid > 0) && (i == 0)) @@ -646,9 +646,9 @@ static void ChildStatusProc(void *pData) if ( pdata->m_pErrorRead ) *pdata->m_pErrorRead = NULL; - close( stdInput[1] ); - close( stdOutput[0] ); - close( stdError[0] ); + if (stdInput[1] != -1) close( stdInput[1] ); + if (stdOutput[0] != -1) close( stdOutput[0] ); + if (stdError[0] != -1) close( stdError[0] ); //if pid > 0 then a process was created, even if it later failed //e.g. bash searching for a command to execute, and we still @@ -1124,15 +1124,6 @@ struct osl_procStat unsigned long nswap; /* ? */ unsigned long cnswap; /* ? */ - /* from 'statm' */ - long size; /* numbers of pages in memory */ - long resident; /* number of resident pages */ - long share; /* number of shared pages */ - long trs; /* text resident size */ - long lrs; /* library resident size */ - long drs; /* data resident size */ - long dt; /* ditry pages */ - /* from 'status' */ int ruid; /* real uid */ int euid; /* effective uid */ @@ -1155,9 +1146,10 @@ struct osl_procStat osl_getProcStat *********************************************/ -void osl_getProcStat(pid_t pid, struct osl_procStat* procstat) +sal_Bool osl_getProcStat(pid_t pid, struct osl_procStat* procstat) { int fd = 0; + sal_Bool bRet = sal_False; char name[PATH_MAX + 1]; snprintf(name, sizeof(name), "/proc/%u/stat", pid); @@ -1166,11 +1158,13 @@ void osl_getProcStat(pid_t pid, struct osl_procStat* procstat) char* tmp=0; char prstatbuf[512]; memset(prstatbuf,0,512); - read(fd,prstatbuf,511); + bRet = read(fd,prstatbuf,511) == 511; close(fd); /*printf("%s\n\n",prstatbuf);*/ + if (!bRet) + return sal_False; tmp = strrchr(prstatbuf, ')'); *tmp = '\0'; @@ -1198,57 +1192,35 @@ void osl_getProcStat(pid_t pid, struct osl_procStat* procstat) &procstat->wchan, &procstat->nswap, &procstat->cnswap ); } -} - -/********************************************** - osl_getProcStatm - *********************************************/ - -void osl_getProcStatm(pid_t pid, struct osl_procStat* procstat) -{ - int fd = 0; - char name[PATH_MAX + 1]; - snprintf(name, sizeof(name), "/proc/%u/statm", pid); - - if ((fd = open(name,O_RDONLY)) >=0 ) - { - char prstatmbuf[512]; - memset(prstatmbuf,0,512); - read(fd,prstatmbuf,511); - - close(fd); - - /* printf("\n\n%s\n\n",prstatmbuf);*/ - - sscanf(prstatmbuf,"%li %li %li %li %li %li %li", - &procstat->size, &procstat->resident, &procstat->share, - &procstat->trs, &procstat->lrs, &procstat->drs, - &procstat->dt - ); - } + return bRet; } /********************************************** osl_getProcStatus *********************************************/ -void osl_getProcStatus(pid_t pid, struct osl_procStat* procstat) +sal_Bool osl_getProcStatus(pid_t pid, struct osl_procStat* procstat) { int fd = 0; char name[PATH_MAX + 1]; snprintf(name, sizeof(name), "/proc/%u/status", pid); + sal_Bool bRet = sal_False; + if ((fd = open(name,O_RDONLY)) >=0 ) { char* tmp=0; char prstatusbuf[512]; memset(prstatusbuf,0,512); - read(fd,prstatusbuf,511); + bRet = read(fd,prstatusbuf,511) == 511; close(fd); /* printf("\n\n%s\n\n",prstatusbuf);*/ + if (!bRet) + return sal_False; + tmp = strstr(prstatusbuf,"Uid:"); if(tmp) { @@ -1290,6 +1262,7 @@ void osl_getProcStatus(pid_t pid, struct osl_procStat* procstat) ); } } + return bRet; } #endif @@ -1439,56 +1412,54 @@ oslProcessError SAL_CALL osl_getProcessInfo(oslProcess Process, oslProcessData F #elif defined(LINUX) -/* int fd = 0;*/ - struct osl_procStat procstat; - memset(&procstat,0,sizeof(procstat)); + if ( (Fields & osl_Process_CPUTIMES) || (Fields & osl_Process_HEAPUSAGE) ) + { + struct osl_procStat procstat; + memset(&procstat,0,sizeof(procstat)); - osl_getProcStat(pid, &procstat); - osl_getProcStatm(pid, &procstat); - osl_getProcStatus(pid, &procstat); + if ( (Fields & osl_Process_CPUTIMES) && osl_getProcStat(pid, &procstat) ) + { + /* + * mfe: + * We calculate only time of the process proper. + * Threads are processes, we do not consider their time here! + * (For this, cutime and cstime should be used, it seems not + * to work in 2.0.36) + */ + + long clktck; + unsigned long hz; + unsigned long userseconds; + unsigned long systemseconds; + + clktck = sysconf(_SC_CLK_TCK); + if (clktck < 0) { + return osl_Process_E_Unknown; + } + hz = (unsigned long) clktck; - if ( Fields & osl_Process_CPUTIMES) - { - /* - * mfe: - * We calculate only time of the process proper. - * Threads are processes, we do not consider their time here! - * (For this, cutime and cstime should be used, it seems not - * to work in 2.0.36) - */ - - long clktck; - unsigned long hz; - unsigned long userseconds; - unsigned long systemseconds; - - clktck = sysconf(_SC_CLK_TCK); - if (clktck < 0) { - return osl_Process_E_Unknown; - } - hz = (unsigned long) clktck; + userseconds = procstat.utime/hz; + systemseconds = procstat.stime/hz; - userseconds = procstat.utime/hz; - systemseconds = procstat.stime/hz; + pInfo->UserTime.Seconds = userseconds; + pInfo->UserTime.Nanosec = procstat.utime - (userseconds * hz); + pInfo->SystemTime.Seconds = systemseconds; + pInfo->SystemTime.Nanosec = procstat.stime - (systemseconds * hz); - pInfo->UserTime.Seconds = userseconds; - pInfo->UserTime.Nanosec = procstat.utime - (userseconds * hz); - pInfo->SystemTime.Seconds = systemseconds; - pInfo->SystemTime.Nanosec = procstat.stime - (systemseconds * hz); + pInfo->Fields |= osl_Process_CPUTIMES; + } - pInfo->Fields |= osl_Process_CPUTIMES; - } + if ( (Fields & osl_Process_HEAPUSAGE) && osl_getProcStatus(pid, &procstat) ) + { + /* + * mfe: + * vm_data (found in status) shows the size of the data segment + * it a rough approximation of the core heap size + */ + pInfo->HeapUsage = procstat.vm_data*1024; - if (Fields & osl_Process_HEAPUSAGE) - { - /* - * mfe: - * vm_data (found in status) shows the size of the data segment - * it a rough approximation of the core heap size - */ - pInfo->HeapUsage = procstat.vm_data*1024; - - pInfo->Fields |= osl_Process_HEAPUSAGE; + pInfo->Fields |= osl_Process_HEAPUSAGE; + } } return (pInfo->Fields == Fields) ? osl_Process_E_None : osl_Process_E_Unknown; diff --git a/sal/osl/unx/signal.c b/sal/osl/unx/signal.c index 77633dd81269..35884e11c9ba 100644 --- a/sal/osl/unx/signal.c +++ b/sal/osl/unx/signal.c @@ -46,6 +46,7 @@ #ifdef LINUX #include <execinfo.h> +#include <link.h> #define INCLUDE_BACKTRACE #define STACKTYPE "Linux" #endif @@ -392,6 +393,88 @@ static int fputs_xml( const char *string, FILE *stream ) #define REPORTENV_PARAM "-crashreportenv:" +#if defined SAL_ENABLE_CRASH_REPORT && defined INCLUDE_BACKTRACE && \ + defined LINUX + +typedef struct +{ + const char *name; + ElfW(Off) offset; +} dynamic_entry; + +static int +callback(struct dl_phdr_info *info, size_t size, void *data) +{ + const ElfW(Phdr) *pDynamic = NULL; + + if (size == sizeof(struct dl_phdr_info)) + { + int i; + for (i = 0; i < info->dlpi_phnum; ++i) + { + if (info->dlpi_phdr[i].p_type == PT_DYNAMIC) + { + pDynamic = &(info->dlpi_phdr[i]); + break; + } + } + } + + if (pDynamic) + { + char buffer[100]; + int len; + char exe[PATH_MAX]; + const char *dsoname = info->dlpi_name; + + dynamic_entry* entry = (dynamic_entry*)data; + + if (strcmp(dsoname, "") == 0) + { + snprintf(buffer, sizeof(buffer), "/proc/%d/exe", getpid()); + if ((len = readlink(buffer, exe, PATH_MAX)) != -1) + { + exe[len] = '\0'; + dsoname = exe; + } + } + + if (strcmp(dsoname, entry->name) == 0) + { + entry->offset = pDynamic->p_offset; + return 1; + } + } + return 0; +} + +/* Get the location of the .dynamic section offset for the given elf file. + * i.e. same as the "Offset" value shown for DYNAMIC from readelf -l foo + * + * We want to know this value so that if the binaries have been modifed + * by prelink then we can still process the call stack on server side + * by comparing this value to that of an "un-prelinked but known to be + * otherwise equivalent" version of those binaries and adjust the call + * stack addresses by the differences between .dynamic addresses so as + * to be able to map the prelinked addresses back to the unprelinked + * addresses + * + * cmc@openoffice.org + */ +static ElfW(Off) +dynamic_section_offset(const char *name) +{ + dynamic_entry entry; + + entry.name = name; + entry.offset = 0; + + dl_iterate_phdr(callback, &entry); + + return entry.offset; +} +#endif + static int ReportCrash( int Signal ) { #ifdef SAL_ENABLE_CRASH_REPORT @@ -572,6 +655,11 @@ static int ReportCrash( int Signal ) if ( dl_info.dli_fbase && dl_info.dli_fname ) { +#ifdef LINUX + ElfW(Off) dynamic_offset = dynamic_section_offset(dl_info.dli_fname); + fprintf( stackout, " 0x%" SAL_PRI_SIZET "x:", dynamic_offset); +#endif + fprintf( stackout, " %s + 0x%" SAL_PRI_PTRDIFFT "x", dl_info.dli_fname, (char*)stackframes[iFrame] - (char*)dl_info.dli_fbase @@ -583,6 +671,10 @@ static int ReportCrash( int Signal ) if ( dli_fdir ) fprintf( xmlout, " path=\"%s\"", dli_fdir ); + +#ifdef LINUX + fprintf( xmlout, " dynamicoffset=\"0x%" SAL_PRI_SIZET "x\"", dynamic_offset ); +#endif } else fprintf( stackout, " ????????" ); diff --git a/sal/osl/w32/diagnose.c b/sal/osl/w32/diagnose.c index 6a67c1aa5b0f..b2d22808dcd7 100644 --- a/sal/osl/w32/diagnose.c +++ b/sal/osl/w32/diagnose.c @@ -92,7 +92,10 @@ void SAL_CALL osl_trace(const sal_Char* lpszFormat, ...) sal_Char szMessage[512]; szMessage[sizeof(szMessage)-1] = 0; written = _vsnprintf( szMessage, sizeof(szMessage) - 2, lpszFormat, args ); - szMessage[ written == -1 ? sizeof(szMessage) - 2 : written ] = '\n'; + if ( written == -1 ) + written = sizeof(szMessage) - 2; + szMessage[ written++ ] = '\n'; + szMessage[ written ] = 0; OutputDebugString( szMessage ); } diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx index b6a7c64ee873..34deba2293da 100644 --- a/sal/osl/w32/file.cxx +++ b/sal/osl/w32/file.cxx @@ -69,7 +69,8 @@ //################################################################## struct FileHandle_Impl { - HANDLE m_hFile; + CRITICAL_SECTION m_mutex; + HANDLE m_hFile; /** State */ @@ -103,6 +104,7 @@ struct FileHandle_Impl oslFileError setPos (sal_uInt64 uPos); sal_uInt64 getSize() const; + oslFileError setSize (sal_uInt64 uPos); oslFileError readAt ( LONGLONG nOffset, @@ -161,6 +163,17 @@ struct FileHandle_Impl Allocator(); ~Allocator(); }; + + /** Guard. + */ + class Guard + { + LPCRITICAL_SECTION m_mutex; + + public: + explicit Guard(LPCRITICAL_SECTION pMutex); + ~Guard(); + }; }; FileHandle_Impl::Allocator & @@ -198,6 +211,18 @@ void FileHandle_Impl::Allocator::deallocate (sal_uInt8 * pBuffer) rtl_cache_free (m_cache, pBuffer); } +FileHandle_Impl::Guard::Guard(LPCRITICAL_SECTION pMutex) + : m_mutex (pMutex) +{ + OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::Guard(): null pointer."); + ::EnterCriticalSection (m_mutex); +} +FileHandle_Impl::Guard::~Guard() +{ + OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::~Guard(): null pointer."); + ::LeaveCriticalSection (m_mutex); +} + FileHandle_Impl::FileHandle_Impl(HANDLE hFile) : m_hFile (hFile), m_state (STATE_READABLE | STATE_WRITEABLE), @@ -209,6 +234,7 @@ FileHandle_Impl::FileHandle_Impl(HANDLE hFile) m_bufsiz (0), m_buffer (0) { + ::InitializeCriticalSection (&m_mutex); Allocator::get().allocate (&m_buffer, &m_bufsiz); if (m_buffer != 0) memset (m_buffer, 0, m_bufsiz); @@ -217,6 +243,7 @@ FileHandle_Impl::FileHandle_Impl(HANDLE hFile) FileHandle_Impl::~FileHandle_Impl() { Allocator::get().deallocate (m_buffer), m_buffer = 0; + ::DeleteCriticalSection (&m_mutex); } void * FileHandle_Impl::operator new(size_t n) @@ -253,6 +280,23 @@ sal_uInt64 FileHandle_Impl::getSize() const return std::max(m_size, sal::static_int_cast< sal_uInt64 >(bufend)); } +oslFileError FileHandle_Impl::setSize (sal_uInt64 uSize) +{ + LARGE_INTEGER nDstPos; nDstPos.QuadPart = sal::static_int_cast< LONGLONG >(uSize); + if (!::SetFilePointerEx(m_hFile, nDstPos, 0, FILE_BEGIN)) + return oslTranslateFileError( GetLastError() ); + + if (!::SetEndOfFile(m_hFile)) + return oslTranslateFileError( GetLastError() ); + m_size = uSize; + + nDstPos.QuadPart = m_offset; + if (!::SetFilePointerEx(m_hFile, nDstPos, 0, FILE_BEGIN)) + return oslTranslateFileError( GetLastError() ); + + return osl_File_E_None; +} + oslFileError FileHandle_Impl::readAt ( LONGLONG nOffset, void * pBuffer, @@ -711,6 +755,8 @@ SAL_CALL osl_syncFile(oslFileHandle Handle) if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile)) return osl_File_E_INVAL; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); + oslFileError result = pImpl->syncFile(); if (result != osl_File_E_None) return result; @@ -729,6 +775,8 @@ SAL_CALL osl_closeFile(oslFileHandle Handle) if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile)) return osl_File_E_INVAL; + ::EnterCriticalSection (&(pImpl->m_mutex)); + oslFileError result = pImpl->syncFile(); if (result != osl_File_E_None) { @@ -741,6 +789,7 @@ SAL_CALL osl_closeFile(oslFileHandle Handle) result = oslTranslateFileError( GetLastError() ); } + ::LeaveCriticalSection (&(pImpl->m_mutex)); delete pImpl; return (result); } @@ -852,6 +901,7 @@ SAL_CALL osl_readLine( sal_uInt64 uBytesRead = 0; // read at current filepos; filepos += uBytesRead; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); oslFileError result = pImpl->readLineAt ( pImpl->m_filepos, ppSequence, &uBytesRead); if (result == osl_File_E_None) @@ -872,6 +922,7 @@ SAL_CALL osl_readFile( return osl_File_E_INVAL; // read at current filepos; filepos += *pBytesRead; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); oslFileError result = pImpl->readFileAt ( pImpl->m_filepos, pBuffer, uBytesRequested, pBytesRead); if (result == osl_File_E_None) @@ -893,6 +944,7 @@ SAL_CALL osl_writeFile( return osl_File_E_INVAL; // write at current filepos; filepos += *pBytesWritten; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); oslFileError result = pImpl->writeFileAt ( pImpl->m_filepos, pBuffer, uBytesToWrite, pBytesWritten); if (result == osl_File_E_None) @@ -922,6 +974,7 @@ SAL_CALL osl_readFileAt( LONGLONG const nOffset = sal::static_int_cast< LONGLONG >(uOffset); // read at specified fileptr + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); return pImpl->readFileAt (nOffset, pBuffer, uBytesRequested, pBytesRead); } @@ -947,6 +1000,7 @@ SAL_CALL osl_writeFileAt( LONGLONG const nOffset = sal::static_int_cast< LONGLONG >(uOffset); // write at specified fileptr + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); return pImpl->writeFileAt (nOffset, pBuffer, uBytesToWrite, pBytesWritten); } @@ -959,6 +1013,7 @@ SAL_CALL osl_isEndOfFile (oslFileHandle Handle, sal_Bool *pIsEOF) if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile) || (0 == pIsEOF)) return osl_File_E_INVAL; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); *pIsEOF = (pImpl->getPos() == pImpl->getSize()); return osl_File_E_None; } @@ -971,6 +1026,7 @@ SAL_CALL osl_getFilePos(oslFileHandle Handle, sal_uInt64 *pPos) if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile) || (0 == pPos)) return osl_File_E_INVAL; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); *pPos = pImpl->getPos(); return osl_File_E_None; } @@ -988,6 +1044,7 @@ SAL_CALL osl_setFilePos(oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uOffset return osl_File_E_OVERFLOW; LONGLONG nPos = 0, nOffset = sal::static_int_cast< LONGLONG >(uOffset); + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); switch (uHow) { case osl_Pos_Absolut: @@ -1027,6 +1084,7 @@ SAL_CALL osl_getFileSize (oslFileHandle Handle, sal_uInt64 *pSize) if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile) || (0 == pSize)) return osl_File_E_INVAL; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); *pSize = pImpl->getSize(); return osl_File_E_None; } @@ -1046,23 +1104,13 @@ SAL_CALL osl_setFileSize (oslFileHandle Handle, sal_uInt64 uSize) if (g_limit_longlong < uSize) return osl_File_E_OVERFLOW; + FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); oslFileError result = pImpl->syncFile(); if (result != osl_File_E_None) return (result); + pImpl->m_bufptr = -1, pImpl->m_buflen = 0; - LARGE_INTEGER nDstPos; nDstPos.QuadPart = sal::static_int_cast< LONGLONG >(uSize); - if (!::SetFilePointerEx(pImpl->m_hFile, nDstPos, 0, FILE_BEGIN)) - return oslTranslateFileError( GetLastError() ); - - if (!::SetEndOfFile(pImpl->m_hFile)) - return oslTranslateFileError( GetLastError() ); - pImpl->m_size = uSize; - - nDstPos.QuadPart = pImpl->m_offset; - if (!::SetFilePointerEx(pImpl->m_hFile, nDstPos, 0, FILE_BEGIN)) - return oslTranslateFileError( GetLastError() ); - - return osl_File_E_None; + return pImpl->setSize (uSize); } //################################################################## diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx index 53aa1c40cd2b..5ea839ae215d 100644 --- a/sal/osl/w32/file_dirvol.cxx +++ b/sal/osl/w32/file_dirvol.cxx @@ -45,6 +45,9 @@ #include "rtl/ustring.hxx" #include <tchar.h> +#ifdef __MINGW32__ +#include <ctype.h> +#endif //##################################################### #define ELEMENTS_OF_ARRAY(arr) (sizeof(arr)/(sizeof((arr)[0]))) @@ -718,9 +721,9 @@ oslFileError SAL_CALL osl_createDirectory(rtl_uString* strPath) sal_Int32 nLen = rtl_uString_getLength( strSysPath ); if ( - ( pBuffer[0] >= 'A' && pBuffer[0] <= 'Z' || - pBuffer[0] >= 'a' && pBuffer[0] <= 'z' ) && - pBuffer[1] == ':' && ( nLen ==2 || nLen == 3 && pBuffer[2] == '\\' ) + ( ( pBuffer[0] >= 'A' && pBuffer[0] <= 'Z' ) || + ( pBuffer[0] >= 'a' && pBuffer[0] <= 'z' ) ) && + pBuffer[1] == ':' && ( nLen ==2 || ( nLen == 3 && pBuffer[2] == '\\' ) ) ) SetLastError( ERROR_ALREADY_EXISTS ); @@ -1151,8 +1154,8 @@ bool is_floppy_volume_mount_point(const rtl::OUString& path) { // determines if a volume mount point shows to a floppy // disk by comparing the unique volume names - static const LPWSTR FLOPPY_A = L"A:\\"; - static const LPWSTR FLOPPY_B = L"B:\\"; + static const LPCWSTR FLOPPY_A = L"A:\\"; + static const LPCWSTR FLOPPY_B = L"B:\\"; rtl::OUString p(path); osl::systemPathEnsureSeparator(p); @@ -1177,7 +1180,7 @@ bool is_floppy_volume_mount_point(const rtl::OUString& path) //################################################ static bool is_floppy_drive(const rtl::OUString& path) { - static const LPWSTR FLOPPY_DRV_LETTERS = TEXT("AaBb"); + static const LPCWSTR FLOPPY_DRV_LETTERS = TEXT("AaBb"); // we must take into account that even a floppy // drive may be mounted to a directory so checking diff --git a/sal/rtl/source/math.cxx b/sal/rtl/source/math.cxx index 3f41d5a9c105..a255ca21b13a 100644 --- a/sal/rtl/source/math.cxx +++ b/sal/rtl/source/math.cxx @@ -79,6 +79,130 @@ static double getN10Exp( int nExp ) return 1.0; } +/** Approximation algorithm for erf for 0 < x < 0.65. */ +void lcl_Erf0065( double x, double& fVal ) +{ + static const double pn[] = { + 1.12837916709551256, + 1.35894887627277916E-1, + 4.03259488531795274E-2, + 1.20339380863079457E-3, + 6.49254556481904354E-5 + }; + static const double qn[] = { + 1.00000000000000000, + 4.53767041780002545E-1, + 8.69936222615385890E-2, + 8.49717371168693357E-3, + 3.64915280629351082E-4 + }; + double fPSum = 0.0; + double fQSum = 0.0; + double fXPow = 1.0; + for ( unsigned int i = 0; i <= 4; ++i ) + { + fPSum += pn[i]*fXPow; + fQSum += qn[i]*fXPow; + fXPow *= x*x; + } + fVal = x * fPSum / fQSum; +} + +/** Approximation algorithm for erfc for 0.65 < x < 6.0. */ +void lcl_Erfc0600( double x, double& fVal ) +{ + double fPSum = 0.0; + double fQSum = 0.0; + double fXPow = 1.0; + const double *pn; + const double *qn; + + if ( x < 2.2 ) + { + static const double pn22[] = { + 9.99999992049799098E-1, + 1.33154163936765307, + 8.78115804155881782E-1, + 3.31899559578213215E-1, + 7.14193832506776067E-2, + 7.06940843763253131E-3 + }; + static const double qn22[] = { + 1.00000000000000000, + 2.45992070144245533, + 2.65383972869775752, + 1.61876655543871376, + 5.94651311286481502E-1, + 1.26579413030177940E-1, + 1.25304936549413393E-2 + }; + pn = pn22; + qn = qn22; + } + else /* if ( x < 6.0 ) this is true, but the compiler does not know */ + { + static const double pn60[] = { + 9.99921140009714409E-1, + 1.62356584489366647, + 1.26739901455873222, + 5.81528574177741135E-1, + 1.57289620742838702E-1, + 2.25716982919217555E-2 + }; + static const double qn60[] = { + 1.00000000000000000, + 2.75143870676376208, + 3.37367334657284535, + 2.38574194785344389, + 1.05074004614827206, + 2.78788439273628983E-1, + 4.00072964526861362E-2 + }; + pn = pn60; + qn = qn60; + } + + for ( unsigned int i = 0; i < 6; ++i ) + { + fPSum += pn[i]*fXPow; + fQSum += qn[i]*fXPow; + fXPow *= x; + } + fQSum += qn[6]*fXPow; + fVal = exp( -1.0*x*x )* fPSum / fQSum; +} + +/** Approximation algorithm for erfc for 6.0 < x < 26.54 (but used for all + x > 6.0). */ +void lcl_Erfc2654( double x, double& fVal ) +{ + static const double pn[] = { + 5.64189583547756078E-1, + 8.80253746105525775, + 3.84683103716117320E1, + 4.77209965874436377E1, + 8.08040729052301677 + }; + static const double qn[] = { + 1.00000000000000000, + 1.61020914205869003E1, + 7.54843505665954743E1, + 1.12123870801026015E2, + 3.73997570145040850E1 + }; + + double fPSum = 0.0; + double fQSum = 0.0; + double fXPow = 1.0; + + for ( unsigned int i = 0; i <= 4; ++i ) + { + fPSum += pn[i]*fXPow; + fQSum += qn[i]*fXPow; + fXPow /= x*x; + } + fVal = exp(-1.0*x*x)*fPSum / (x*fQSum); +} namespace { @@ -991,3 +1115,129 @@ double SAL_CALL rtl_math_atanh( double fValue ) SAL_THROW_EXTERN_C() { return 0.5 * rtl_math_log1p( 2.0 * fValue / (1.0-fValue) ); } + + +/** Parent error function (erf) that calls different algorithms based on the + value of x. It takes care of cases where x is negative as erf is an odd + function i.e. erf(-x) = -erf(x). + + Kramer, W., and Blomquist, F., 2000, Algorithms with Guaranteed Error Bounds + for the Error Function and the Complementary Error Function + + http://www.math.uni-wuppertal.de/wrswt/literatur_en.html + + @author Kohei Yoshida <kohei@openoffice.org> + + @see #i55735# + */ +double SAL_CALL rtl_math_erf( double x ) SAL_THROW_EXTERN_C() +{ + if( x == 0.0 ) + return 0.0; + + bool bNegative = false; + if ( x < 0.0 ) + { + x = fabs( x ); + bNegative = true; + } + + double fErf = 1.0; + if ( x < 1.0e-10 ) + fErf = (double) (x*1.1283791670955125738961589031215452L); + else if ( x < 0.65 ) + lcl_Erf0065( x, fErf ); + else + fErf = 1.0 - rtl_math_erfc( x ); + + if ( bNegative ) + fErf *= -1.0; + + return fErf; +} + + +/** Parent complementary error function (erfc) that calls different algorithms + based on the value of x. It takes care of cases where x is negative as erfc + satisfies relationship erfc(-x) = 2 - erfc(x). See the comment for Erf(x) + for the source publication. + + @author Kohei Yoshida <kohei@openoffice.org> + + @see #i55735#, moved from module scaddins (#i97091#) + + */ +double SAL_CALL rtl_math_erfc( double x ) SAL_THROW_EXTERN_C() +{ + if ( x == 0.0 ) + return 1.0; + + bool bNegative = false; + if ( x < 0.0 ) + { + x = fabs( x ); + bNegative = true; + } + + double fErfc = 0.0; + if ( x >= 0.65 ) + { + if ( x < 6.0 ) + lcl_Erfc0600( x, fErfc ); + else + lcl_Erfc2654( x, fErfc ); + } + else + fErfc = 1.0 - rtl_math_erf( x ); + + if ( bNegative ) + fErfc = 2.0 - fErfc; + + return fErfc; +} + +/** improved accuracy of asinh for |x| large and for x near zero + @see #i97605# + */ +double SAL_CALL rtl_math_asinh( double fX ) SAL_THROW_EXTERN_C() +{ + double fSign = 1.0; + if ( fX == 0.0 ) + return 0.0; + else + { + if ( fX < 0.0 ) + { + fX = - fX; + fSign = -1.0; + } + if ( fX < 0.125 ) + return fSign * rtl_math_log1p( fX + fX*fX / (1.0 + sqrt( 1.0 + fX*fX))); + else if ( fX < 1.25e7 ) + return fSign * log( fX + sqrt( 1.0 + fX*fX)); + else + return fSign * log( 2.0*fX); + } +} + +/** improved accuracy of acosh for x large and for x near 1 + @see #i97605# + */ +double SAL_CALL rtl_math_acosh( double fX ) SAL_THROW_EXTERN_C() +{ + volatile double fZ = fX - 1.0; + if ( fX < 1.0 ) + { + double fResult; + ::rtl::math::setNan( &fResult ); + return fResult; + } + else if ( fX == 1.0 ) + return 0.0; + else if ( fX < 1.1 ) + return rtl_math_log1p( fZ + sqrt( fZ*fZ + 2.0*fZ)); + else if ( fX < 1.25e7 ) + return log( fX + sqrt( fX*fX - 1.0)); + else + return log( 2.0*fX); +} diff --git a/sal/util/sal.map b/sal/util/sal.map index ad063f3794d4..d5faa563ae3f 100755 --- a/sal/util/sal.map +++ b/sal/util/sal.map @@ -591,6 +591,10 @@ UDK_3.9 { # OOo 3.1 UDK_3.10 { # OOo 3.2 global: rtl_logfile_hasLogFile; + rtl_math_erf; + rtl_math_erfc; + rtl_math_asinh; + rtl_math_acosh; } UDK_3.9; PRIVATE_1.0 { diff --git a/stoc/prj/build.lst b/stoc/prj/build.lst index 4748ffcff26f..2550563c8c34 100644 --- a/stoc/prj/build.lst +++ b/stoc/prj/build.lst @@ -21,4 +21,4 @@ tc stoc\source\typeconv nmake - all tc_tcv tc_stserv tc_nservice tc_inc NULL tc stoc\source\javavm nmake - all tc_jvm tc_inc NULL tc stoc\source\javaloader nmake - all tc_jvload tc_inc NULL tc stoc\source\uriproc nmake - all tc_uriproc tc_stserv tc_inc NULL -tc stoc\util nmake - all tc_util tc_boot tc_stserv tc_tcv tc_uriproc tc_smgr tc_inc tc_sreg tc_defr tc_ireg tc_regtd tc_tdmng NULL +tc stoc\util nmake - all tc_util tc_boot tc_stserv tc_tcv tc_uriproc tc_smgr tc_inc tc_sreg tc_defr tc_ireg tc_regtd tc_tdmng tc_sec NULL diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index 011fafe9d6e9..518c6029ddd2 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -43,6 +43,7 @@ #endif #include <osl/diagnose.h> #include <osl/mutex.hxx> +#include <osl/thread.h> #include <cppuhelper/queryinterface.hxx> #include <cppuhelper/weak.hxx> #include <cppuhelper/component.hxx> @@ -1421,28 +1422,29 @@ Sequence< Reference<XIdlMethod> > ImplIntrospectionAccess::getMethods(sal_Int32 if( nConcept & MethodConcepts ) pDestMethods[ iDest++ ] = pSourceMethods[ i ]; - /* - // Methode mit Concepts ausgeben - const XIdlMethodRef& rxMethod = pSourceMethods[ i ]; - OUString aMethName = rxMethod->getName(); - String aNameStr = OOUStringToString(aMethName, CHARSET_SYSTEM); - String ConceptStr; - if( nConcept & DANGEROUS ) - ConceptStr += "DANGEROUS |"; - if( nConcept & PROPERTY ) - ConceptStr += "PROPERTY |"; - if( nConcept & LISTENER ) - ConceptStr += "LISTENER |"; - if( nConcept & ENUMERATION ) - ConceptStr += "ENUMERATION |"; - if( nConcept & NAMECONTAINER ) - ConceptStr += "NAMECONTAINER |"; - if( nConcept & INDEXCONTAINER ) - ConceptStr += "INDEXCONTAINER |"; - if( nConcept & NORMAL_IMPL ) - ConceptStr += "NORMAL_IMPL |"; - printf( "Method %ld: %s, Concepts = %s\n", i, aNameStr.GetStr(), ConceptStr.GetStr() ); - */ + #if OSL_DEBUG_LEVEL > 0 + static bool debug = false; + if ( debug ) + { + // Methode mit Concepts ausgeben + const Reference< XIdlMethod >& rxMethod = pSourceMethods[ i ]; + ::rtl::OString aNameStr = ::rtl::OUStringToOString( rxMethod->getName(), osl_getThreadTextEncoding() ); + ::rtl::OString ConceptStr; + if( nConcept & MethodConcept::DANGEROUS ) + ConceptStr += "DANGEROUS |"; + if( nConcept & MethodConcept::PROPERTY ) + ConceptStr += "PROPERTY |"; + if( nConcept & MethodConcept::LISTENER ) + ConceptStr += "LISTENER |"; + if( nConcept & MethodConcept::ENUMERATION ) + ConceptStr += "ENUMERATION |"; + if( nConcept & MethodConcept::NAMECONTAINER ) + ConceptStr += "NAMECONTAINER |"; + if( nConcept & MethodConcept::INDEXCONTAINER ) + ConceptStr += "INDEXCONTAINER |"; + OSL_TRACE( "Method %ld: %s, Concepts = %s", i, aNameStr.getStr(), ConceptStr.getStr() ); + } + #endif } // Auf die richtige Laenge bringen diff --git a/udkapi/util/target.pmk b/udkapi/util/target.pmk index f6e7bc9beb3c..2a01738e7eb7 100644 --- a/udkapi/util/target.pmk +++ b/udkapi/util/target.pmk @@ -30,8 +30,8 @@ #************************************************************************* $(OUT)$/misc$/$(TARGET).idls: makefile.mk - -$(RM) $@ - $(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@ + $(COMMAND_ECHO)-$(RM) $@ + $(COMMAND_ECHO)$(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@ ALLTAR: $(OUT)$/misc$/$(TARGET).idls diff --git a/ure/source/makefile.mk b/ure/source/makefile.mk index 17dbdb322de2..9736ca597aed 100644 --- a/ure/source/makefile.mk +++ b/ure/source/makefile.mk @@ -35,7 +35,7 @@ TARGET := $(PRJNAME) .INCLUDE: settings.mk -.IF "$(OS)" == "WNT" +.IF "$(OS)" == "WNT" || "$(OS)" == "OS2" MY_RC = .ini .ELSE MY_RC = rc diff --git a/ure/source/uretest/JavaClient.java b/ure/source/uretest/JavaClient.java index e7b6a6ed54d2..fbb35a910c96 100644 --- a/ure/source/uretest/JavaClient.java +++ b/ure/source/uretest/JavaClient.java @@ -50,7 +50,7 @@ public final class JavaClient { if (manager == null) { throw new NullPointerException("no service manager"); } - XBridgeFactory factory = (XBridgeFactory) UnoRuntime.queryInterface( + XBridgeFactory factory = UnoRuntime.queryInterface( XBridgeFactory.class, manager.createInstanceWithContext( "com.sun.star.bridge.BridgeFactory", context)); @@ -63,11 +63,9 @@ public final class JavaClient { Connector.create(context).connect( url.getConnectionAndParametersAsString()), null); - Data d = - ((XServer) UnoRuntime.queryInterface( - XServer.class, bridge.getInstance(url.getRootOid()))).getData(); - ((XComponent) UnoRuntime.queryInterface(XComponent.class, bridge)). - dispose(); + Data d = UnoRuntime.queryInterface( + XServer.class, bridge.getInstance(url.getRootOid())).getData(); + UnoRuntime.queryInterface(XComponent.class, bridge).dispose(); if (!d.m1.equals("Hello") || d.m2 != 42) { throw new RuntimeException("Data object contains bad values"); } diff --git a/xml2cmp/source/xcd/filebuff.cxx b/xml2cmp/source/xcd/filebuff.cxx index e958c274b552..8035d697ae4d 100644 --- a/xml2cmp/source/xcd/filebuff.cxx +++ b/xml2cmp/source/xcd/filebuff.cxx @@ -59,11 +59,7 @@ LoadXmlFile( Buffer & o_rBuffer, // Read file: aXmlFile.read(o_rBuffer.Data(), (int) nBufferSize); -#ifdef OS2 // YD eof&fail are set, so check for fail&bad - bool ret = aXmlFile.fail() != 0; -#else bool ret = aXmlFile.good() != 0; -#endif aXmlFile.close(); return ret; } |