diff options
author | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-12-27 12:33:29 +0100 |
---|---|---|
committer | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2010-12-27 12:33:29 +0100 |
commit | 865df52045d3770fc83054711a50290cc19a3e81 (patch) | |
tree | 26540babd0f93d33be8ad45bf449d42f7b18160a | |
parent | 4584f69f0d1f72fda0b312dc1bd711586a33e6a1 (diff) | |
parent | 77ffc6a41ba05725442df132131597fca78a84ea (diff) |
dr77: rebase to DEV300m96
74 files changed, 1132 insertions, 1733 deletions
diff --git a/bridges/source/jni_uno/makefile.mk b/bridges/source/jni_uno/makefile.mk index da0942cdad29..1474a86cd741 100644 --- a/bridges/source/jni_uno/makefile.mk +++ b/bridges/source/jni_uno/makefile.mk @@ -67,6 +67,7 @@ SHL1STDLIBS= \ SHL1VERSIONMAP=$(TARGET).map +SHL1CREATEJNILIB=TRUE SHL1IMPLIB=i$(TARGET) SHL1LIBS=$(SLB)$/$(TARGET).lib SHL1DEF=$(MISC)$/$(SHL1TARGET).def diff --git a/bridges/source/remote/urp/urp_job.hxx b/bridges/source/remote/urp/urp_job.hxx index ce58b1f3f779..1bafaf9f5162 100644 --- a/bridges/source/remote/urp/urp_job.hxx +++ b/bridges/source/remote/urp/urp_job.hxx @@ -303,6 +303,7 @@ inline ClientJob::ClientJob( uno_Any **ppException ) : Job( pEnvRemote, pContext, pBridgeImpl, ::bridges_remote::RTC_HOLDENVWEAK ) + , m_bExceptionOccured( false ) , m_ppArgs( ppArgs ) , m_pReturn( pReturn ) , m_pInterfaceType( pInterfaceType ) // weak diff --git a/cppu/source/threadpool/jobqueue.cxx b/cppu/source/threadpool/jobqueue.cxx index 6029505fe4ee..333a350c0b23 100644 --- a/cppu/source/threadpool/jobqueue.cxx +++ b/cppu/source/threadpool/jobqueue.cxx @@ -98,6 +98,10 @@ namespace cppu_threadpool { if( 0 == m_lstCallstack.front() ) { // disposed ! + if( m_lstJob.empty() ) + { + osl_resetCondition( m_cndWait ); + } break; } diff --git a/cppuhelper/inc/cppuhelper/propshlp.hxx b/cppuhelper/inc/cppuhelper/propshlp.hxx index 98103e58185b..82bbd2bdcdbe 100644 --- a/cppuhelper/inc/cppuhelper/propshlp.hxx +++ b/cppuhelper/inc/cppuhelper/propshlp.hxx @@ -595,6 +595,29 @@ protected: ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const = 0; + /** sets an dependent property's value + + <p>Sometimes setting a given property needs to implicitly modify another property's value. Calling |setPropertyValue| + from within |setFastPropertyValue_NoBroadcast| is not an option here, as it would notify the property listeners + while our mutex is still locked. Setting the dependent property's value directly (e.g. by calling |setFastPropertyValue_NoBroadcast| + recursively) is not an option, too, since it would miss firing the property change event.</p> + + <p>So, in such cases, you use |setDependentFastPropertyValue| from within |setFastPropertyValue_NoBroadcast|. + It will convert and actually set the property value (invoking |convertFastPropertyValue| and |setFastPropertyValue_NoBroadcast| + for the given handle and value), and add the property change event to the list of events to be notified + when the bottom-most |setFastPropertyValue_NoBroadcast| on the stack returns.</p> + + <p><strong>Note</strong>: The method will <em>not</em> invoke veto listeners for the property.</p> + + <p><strong>Note</strong>: It's the caller's responsibility to ensure that our mutex is locked. This is + canonically given when the method is invoked from within |setFastPropertyValue_NoBroadcast|, in other + contexts, you might need to take own measures.</p> + */ + void setDependentFastPropertyValue( + sal_Int32 i_handle, + const ::com::sun::star::uno::Any& i_value + ); + /** The common data of a broadcaster. Use the mutex, disposing state and the listener container. */ OBroadcastHelper &rBHelper; /** @@ -610,12 +633,22 @@ protected: /** reserved for future use. finally, the future has arrived... */ - const std::auto_ptr<const Impl> m_pReserved; + const std::auto_ptr<Impl> m_pReserved; private: OPropertySetHelper( const OPropertySetHelper & ) SAL_THROW( () ); OPropertySetHelper & operator = ( const OPropertySetHelper & ) SAL_THROW( () ); + /** notifies the given changes in property's values, <em>plus</em> all property changes collected during recent + |setDependentFastPropertyValue| calls. + */ + void impl_fireAll( + sal_Int32* i_handles, + const ::com::sun::star::uno::Any * i_newValues, + const ::com::sun::star::uno::Any * i_oldValues, + sal_Int32 i_count + ); + public: // Suppress warning about virtual functions but non-virtual destructor: #if defined __GNUC__ diff --git a/cppuhelper/prj/build.lst b/cppuhelper/prj/build.lst index de66b2d61a4b..ff837f90dd1a 100644 --- a/cppuhelper/prj/build.lst +++ b/cppuhelper/prj/build.lst @@ -1,4 +1,4 @@ -ch cppuhelper : BOOST:boost codemaker cppu offuh NULL +ch cppuhelper : BOOST:boost LIBXSLT:libxslt codemaker cppu offuh NULL ch cppuhelper usr1 - all ch_mkout NULL ch cppuhelper\inc nmake - all ch_include NULL ch cppuhelper\source nmake - all ch_source ch_unotypes ch_include NULL diff --git a/cppuhelper/source/cc5_solaris_sparc.map b/cppuhelper/source/cc5_solaris_sparc.map index d43ea690e11a..5dd703cf9fc9 100755 --- a/cppuhelper/source/cc5_solaris_sparc.map +++ b/cppuhelper/source/cc5_solaris_sparc.map @@ -387,3 +387,9 @@ UDK_3.7 { # OOo 3.3 __1cDcomDsunEstarDunoTWeakReferenceHelperFclear6M_v_; __1cEcppubHcreateOneInstanceComponentFactory6FpFrknDcomDsunEstarDunoJReference4n0ERXComponentContext____n0EJReference4n0EKXInterface___rknDrtlIOUString_rkn0EISequence4n0K___pnQ_rtl_ModuleCount__n0EJReference4n0DElangXXSingleComponentFactory____; } UDK_3.6; + +UDK_3.8 { # OOo 3.4 + global: + __1cEcppuSOPropertySetHelperbDsetDependentFastPropertyValue6MlrknDcomDsunEstarDunoDAny__v_; +} UDK_3.7; + diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index 96faf2272231..20adf05391b9 100644 --- a/cppuhelper/source/factory.cxx +++ b/cppuhelper/source/factory.cxx @@ -232,9 +232,17 @@ Reference< XInterface > OSingleFactoryHelper::createInstanceWithArgumentsAndCont else { if ( rArguments.getLength() ) + { + // dispose the here created UNO object before throwing out exception + // to avoid risk of memory leaks #i113722# + Reference<XComponent> xComp( xRet, UNO_QUERY ); + if (xComp.is()) + xComp->dispose(); + throw lang::IllegalArgumentException( OUString( RTL_CONSTASCII_USTRINGPARAM("cannot pass arguments to component => no XInitialization implemented!") ), Reference< XInterface >(), 0 ); + } } return xRet; diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map index 59ab83e34e82..7017d274c95d 100644 --- a/cppuhelper/source/gcc3.map +++ b/cppuhelper/source/gcc3.map @@ -382,3 +382,9 @@ UDK_3.6 { # OOo 3.3 _ZN4cppu33createOneInstanceComponentFactoryEPFN3com3sun4star3uno9ReferenceINS3_10XInterfaceEEERKNS4_INS3_17XComponentContextEEEERKN3rtl8OUStringERKNS3_8SequenceISE_EEP16_rtl_ModuleCount; } UDK_3.5; + +UDK_3.7 { # OOo 3.4 + global: + _ZN4cppu18OPropertySetHelper29setDependentFastPropertyValueE?RKN3com3sun4star3uno3AnyE; +} UDK_3.6; + diff --git a/cppuhelper/source/msvc_win32_intel.map b/cppuhelper/source/msvc_win32_intel.map index 6d5a491ab925..7069276e2baa 100644 --- a/cppuhelper/source/msvc_win32_intel.map +++ b/cppuhelper/source/msvc_win32_intel.map @@ -278,3 +278,9 @@ UDK_3.6 { # OOo 3.3 ?clear@WeakReferenceHelper@uno@star@sun@com@@QAAXXZ; ?createOneInstanceComponentFactory@cppu@@YA?AV?$Reference@VXSingleComponentFactory@lang@star@sun@com@@@uno@star@sun@com@@P6A?AV?$Reference@VXInterface@uno@star@sun@com@@@3456@ABV?$Reference@VXComponentContext@uno@star@sun@com@@@3456@@ZABVOUString@rtl@@ABV?$Sequence@VOUString@rtl@@@3456@PAU_rtl_ModuleCount@@@Z; } UDK_3.5; + +UDK_3.7 { # OOo 3.4 + global: + ?setDependentFastPropertyValue@OPropertySetHelper@cppu@@IAEXJABVAny@uno@star@sun@com@@@Z; +} UDK_3.6; + diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx index fe455781a1a7..e43f93272e16 100644 --- a/cppuhelper/source/propshlp.cxx +++ b/cppuhelper/source/propshlp.cxx @@ -32,6 +32,7 @@ #include "cppuhelper/implbase1.hxx" #include "cppuhelper/weak.hxx" #include "cppuhelper/propshlp.hxx" +#include "cppuhelper/exc_hlp.hxx" #include "com/sun/star/beans/PropertyAttribute.hpp" #include "com/sun/star/lang/DisposedException.hpp" @@ -144,15 +145,20 @@ sal_Bool OPropertySetHelperInfo_Impl::hasPropertyByName( const OUString & Proper class OPropertySetHelper::Impl { public: - Impl ( bool i_bIgnoreRuntimeExceptionsWhileFiring, - IEventNotificationHook *i_pFireEvents) - : m_bIgnoreRuntimeExceptionsWhileFiring( - i_bIgnoreRuntimeExceptionsWhileFiring ), - m_pFireEvents( i_pFireEvents ) - { } + Impl( bool i_bIgnoreRuntimeExceptionsWhileFiring, + IEventNotificationHook *i_pFireEvents + ) + :m_bIgnoreRuntimeExceptionsWhileFiring( i_bIgnoreRuntimeExceptionsWhileFiring ) + ,m_pFireEvents( i_pFireEvents ) + { + } bool m_bIgnoreRuntimeExceptionsWhileFiring; class IEventNotificationHook * const m_pFireEvents; + + ::std::vector< sal_Int32 > m_handles; + ::std::vector< Any > m_newValues; + ::std::vector< Any > m_oldValues; }; @@ -432,6 +438,57 @@ void OPropertySetHelper::removeVetoableChangeListener( } } +void OPropertySetHelper::setDependentFastPropertyValue( sal_Int32 i_handle, const ::com::sun::star::uno::Any& i_value ) +{ + //OSL_PRECOND( rBHelper.rMutex.isAcquired(), "OPropertySetHelper::setDependentFastPropertyValue: to be called with a locked mutex only!" ); + // there is no such thing as Mutex.isAcquired, sadly ... + + sal_Int16 nAttributes(0); + IPropertyArrayHelper& rInfo = getInfoHelper(); + if ( !rInfo.fillPropertyMembersByHandle( NULL, &nAttributes, i_handle ) ) + // unknown property + throw UnknownPropertyException(); + + // no need to check for READONLY-ness of the property. The method is intended to be called internally, which + // implies it might be invoked for properties which are read-only to the instance's clients, but well allowed + // to change their value. + + Any aConverted, aOld; + sal_Bool bChanged = convertFastPropertyValue( aConverted, aOld, i_handle, i_value ); + if ( !bChanged ) + return; + + // don't fire vetoable events. This method is called with our mutex locked, so calling into listeners would not be + // a good idea. The caler is responsible for not invoking this for constrained properties. + OSL_ENSURE( ( nAttributes & PropertyAttribute::CONSTRAINED ) == 0, + "OPropertySetHelper::setDependentFastPropertyValue: not to be used for constrained properties!" ); + (void)nAttributes; + + // actually set the new value + try + { + setFastPropertyValue_NoBroadcast( i_handle, aConverted ); + } + catch (const UnknownPropertyException& ) { throw; /* allowed to leave */ } + catch (const PropertyVetoException& ) { throw; /* allowed to leave */ } + catch (const IllegalArgumentException& ) { throw; /* allowed to leave */ } + catch (const WrappedTargetException& ) { throw; /* allowed to leave */ } + catch (const RuntimeException& ) { throw; /* allowed to leave */ } + catch (const Exception& ) + { + // not allowed to leave this meathod + WrappedTargetException aWrapped; + aWrapped.TargetException <<= ::cppu::getCaughtException(); + aWrapped.Context = static_cast< XPropertySet* >( this ); + throw aWrapped; + } + + // remember the handle/values, for the events to be fired later + m_pReserved->m_handles.push_back( i_handle ); + m_pReserved->m_newValues.push_back( aConverted ); // TODO: setFastPropertyValue notifies the unconverted value here ...? + m_pReserved->m_oldValues.push_back( aOld ); +} + // XFastPropertySet void OPropertySetHelper::setFastPropertyValue( sal_Int32 nHandle, const Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, @@ -498,7 +555,7 @@ void OPropertySetHelper::setFastPropertyValue( sal_Int32 nHandle, const Any& rVa // release guard to fire events } // file a change event, if the value changed - fire( &nHandle, &rValue, &aOldVal, 1, sal_False ); + impl_fireAll( &nHandle, &rValue, &aOldVal, 1 ); } } @@ -521,6 +578,42 @@ Any OPropertySetHelper::getFastPropertyValue( sal_Int32 nHandle ) } //-------------------------------------------------------------------------- +void OPropertySetHelper::impl_fireAll( sal_Int32* i_handles, const Any* i_newValues, const Any* i_oldValues, sal_Int32 i_count ) +{ + ClearableMutexGuard aGuard( rBHelper.rMutex ); + if ( m_pReserved->m_handles.empty() ) + { + aGuard.clear(); + fire( i_handles, i_newValues, i_oldValues, i_count, sal_False ); + return; + } + + const size_t additionalEvents = m_pReserved->m_handles.size(); + OSL_ENSURE( additionalEvents == m_pReserved->m_newValues.size() + && additionalEvents == m_pReserved->m_oldValues.size(), + "OPropertySetHelper::impl_fireAll: inconsistency!" ); + + ::std::vector< sal_Int32 > allHandles( additionalEvents + i_count ); + ::std::copy( m_pReserved->m_handles.begin(), m_pReserved->m_handles.end(), allHandles.begin() ); + ::std::copy( i_handles, i_handles + i_count, allHandles.begin() + additionalEvents ); + + ::std::vector< Any > allNewValues( additionalEvents + i_count ); + ::std::copy( m_pReserved->m_newValues.begin(), m_pReserved->m_newValues.end(), allNewValues.begin() ); + ::std::copy( i_newValues, i_newValues + i_count, allNewValues.begin() + additionalEvents ); + + ::std::vector< Any > allOldValues( additionalEvents + i_count ); + ::std::copy( m_pReserved->m_oldValues.begin(), m_pReserved->m_oldValues.end(), allOldValues.begin() ); + ::std::copy( i_oldValues, i_oldValues + i_count, allOldValues.begin() + additionalEvents ); + + m_pReserved->m_handles.clear(); + m_pReserved->m_newValues.clear(); + m_pReserved->m_oldValues.clear(); + + aGuard.clear(); + fire( &allHandles[0], &allNewValues[0], &allOldValues[0], additionalEvents + i_count, sal_False ); +} + +//-------------------------------------------------------------------------- void OPropertySetHelper::fire ( sal_Int32 * pnHandles, @@ -803,7 +896,7 @@ void OPropertySetHelper::setFastPropertyValues( } // fire change events - fire( pHandles, pConvertedValues, pOldValues, n, sal_False ); + impl_fireAll( pHandles, pConvertedValues, pOldValues, n ); } catch( ... ) { diff --git a/io/prj/build.lst b/io/prj/build.lst index 2fa4900f52e6..f2be62d2aa1e 100644 --- a/io/prj/build.lst +++ b/io/prj/build.lst @@ -1,4 +1,4 @@ -io io : rdbmaker NULL +io io : LIBXSLT:libxslt rdbmaker NULL io io usr1 - all io_mkout NULL io io\inc nmake - all io_inc NULL io io\source\acceptor nmake - all io_acceptor io_connector io_inc NULL diff --git a/javaunohelper/com/sun/star/lib/uno/helper/Factory.java b/javaunohelper/com/sun/star/lib/uno/helper/Factory.java index 33d107279633..0780f26486f2 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/Factory.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/Factory.java @@ -53,6 +53,30 @@ public class Factory @param impl_class implementation class + @param impl_name + implementation name + @param supported_services + services implemented + @return + object factory + + @since UDK 3.2.13 + */ + public static XSingleComponentFactory createComponentFactory( + Class impl_class, String impl_name, String supported_services [] ) + throws com.sun.star.uno.RuntimeException + { + return new Factory( impl_class, impl_name, supported_services ); + } + + /** Creates an object factory supporting interfaces + com.sun.star.lang.XSingleComponentFactory and + com.sun.star.lang.XServiceInfo + + The implementation name is the name of the implementation class. + + @param impl_class + implementation class @param supported_services services implemented @return @@ -62,7 +86,8 @@ public class Factory Class impl_class, String supported_services [] ) throws com.sun.star.uno.RuntimeException { - return new Factory( impl_class, supported_services ); + return createComponentFactory( + impl_class, impl_class.getName(), supported_services ); } /** Writes component's implementation info to given registry key. @@ -106,11 +131,10 @@ public class Factory private java.lang.reflect.Method m_method; private java.lang.reflect.Constructor m_ctor; - // ctor - private Factory( Class impl_class, String supported_services [] ) - throws com.sun.star.uno.RuntimeException + private Factory( + Class impl_class, String impl_name, String supported_services [] ) { - m_impl_name = impl_class.getName(); + m_impl_name = impl_name; m_supported_services = supported_services; m_impl_class = impl_class; m_method = null; diff --git a/javaunohelper/prj/build.lst b/javaunohelper/prj/build.lst index c18dd3eb94dc..d97a6450d06a 100644 --- a/javaunohelper/prj/build.lst +++ b/javaunohelper/prj/build.lst @@ -1,4 +1,4 @@ -jh javaunohelper : bridges cppuhelper jurt ridljar unoil NULL +jh javaunohelper : LIBXSLT:libxslt bridges cppuhelper jurt ridljar unoil NULL jh javaunohelper usr1 - all jh_mkout NULL jh javaunohelper\inc nmake - all jh_inc NULL jh javaunohelper\com\sun\star\comp\helper nmake - all jh_helper jh_inc NULL diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java index b81db391966f..ae2719f1c07d 100644 --- a/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java +++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java @@ -148,11 +148,22 @@ final class ProxyFactory { private Object request(String operation, Object[] args) throws Throwable { - return requestHandler.sendRequest(oid, type, operation, args); + Object res = requestHandler.sendRequest(oid, type, operation, args); + // Avoid early finalization of this object, while an invoke -> + // request call is still ongoing; as finalize also calls request, + // this should fulfil the condition from The Java Language + // Specification, 3rd ed., that "if an object's finalizer can result + // in synchronization on that object, then that object must be alive + // and considered reachable whenever a lock is held on it:" + synchronized (this) { + ++dummy; + } + return res; } private final String oid; private final Type type; + private int dummy = 0; } private static final Method METHOD_EQUALS; diff --git a/jurt/prj/d.lst b/jurt/prj/d.lst index 848435f61138..74f5b60d7748 100644 --- a/jurt/prj/d.lst +++ b/jurt/prj/d.lst @@ -3,5 +3,6 @@ ..\%__SRC%\bin\jpipx.dll %_DEST%\bin%_EXT%\jpipx.dll ..\%__SRC%\lib\libjpipe*.so %_DEST%\lib%_EXT%\libjpipe*.so ..\%__SRC%\lib\libjpipe*.dylib %_DEST%\lib%_EXT%\libjpipe*.dylib +..\%__SRC%\lib\libjpipe*.jnilib %_DEST%\lib%_EXT%\libjpipe*.jnilib ..\%__SRC%\bin\jurt_src.zip %COMMON_DEST%\bin%_EXT%\jurt_src.zip diff --git a/jurt/source/pipe/makefile.mk b/jurt/source/pipe/makefile.mk index 5be6f1ebfd10..4a6dc59c89c2 100644 --- a/jurt/source/pipe/makefile.mk +++ b/jurt/source/pipe/makefile.mk @@ -41,6 +41,7 @@ SHL1TARGET = jpipe .END SHL1CODETYPE = C +SHL1CREATEJNILIB=TRUE SHL1IMPLIB = i$(SHL1TARGET) SHL1OBJS = $(SLO)/com_sun_star_lib_connections_pipe_PipeConnection.obj SHL1RPATH = URELIB diff --git a/jvmaccess/util/cc5_solaris_sparc.map b/jvmaccess/util/cc5_solaris_sparc.map index bb59a648f4c5..e2cb767dc65e 100644 --- a/jvmaccess/util/cc5_solaris_sparc.map +++ b/jvmaccess/util/cc5_solaris_sparc.map @@ -25,7 +25,7 @@ # #************************************************************************* -UDK_3_0_0 { +UDK_3.1 { global: # jvmaccess/virtualmachine.hxx: __1cJjvmaccessOVirtualMachineLAttachGuardRCreationException2t6M_v_; # jvmaccess::VirtualMachine::AttachGuard::CreationException::CreationException() @@ -52,7 +52,7 @@ UDK_3.2 { __1cJjvmaccesscQ__RTTI__1CpnJjvmaccessOVirtualMachineLAttachGuardRCreationException__; # RTTI for jvmaccess::VirtualMachine::AttachGuard::CreationException * __1cJjvmaccesscR__RTTI__1CpknJjvmaccessOVirtualMachineLAttachGuardRCreationException__; # RTTI for jvmaccess::VirtualMachine::AttachGuard::CreationException const * __1cJjvmaccessOVirtualMachine2t5B6MpnHJavaVM__ibpnHJNIEnv___v_; # jvmaccess::VirtualMachine::VirtualMachine(JavaVM *, int, bool, JNIEnv *) #Nvariant 1 -} UDK_3_0_0; +} UDK_3.1; UDK_3.3 { global: diff --git a/jvmaccess/util/gcc3.map b/jvmaccess/util/gcc3.map index 707645d2c829..330651a1cf6e 100644 --- a/jvmaccess/util/gcc3.map +++ b/jvmaccess/util/gcc3.map @@ -25,7 +25,7 @@ # #************************************************************************* -UDK_3_0_0 { +UDK_3.1 { global: # jvmaccess/virtualmachine.hxx: _ZN9jvmaccess14VirtualMachine11AttachGuard17CreationExceptionC1Ev; # jvmaccess::VirtualMachine::AttachGuard::CreationException::CreationException() @@ -59,7 +59,7 @@ UDK_3.2 { # We put the '*' at the beginning because its unlikely that these symbols will ever be a postfix of another symbol. _*ZN9jvmaccess14VirtualMachineC1EP10_Jv_JavaVMibP10_Jv_JNIEnv; # jvmaccess::VirtualMachine::VirtualMachine(JavaVM *, int, bool, JNIEnv *) _*ZN9jvmaccess14VirtualMachineC2EP10_Jv_JavaVMibP10_Jv_JNIEnv; # jvmaccess::VirtualMachine::VirtualMachine(JavaVM *, int, bool, JNIEnv *) -} UDK_3_0_0; +} UDK_3.1; UDK_3.3 { global: diff --git a/jvmaccess/util/msvc_win32_intel.map b/jvmaccess/util/msvc_win32_intel.map index 4620b1caa940..fd148b1892ba 100644 --- a/jvmaccess/util/msvc_win32_intel.map +++ b/jvmaccess/util/msvc_win32_intel.map @@ -1,4 +1,4 @@ -UDK_3_0_0 { +UDK_3.1 { global: # jvmaccess/virtualmachine.hxx: ??0CreationException@AttachGuard@VirtualMachine@jvmaccess@@QAE@XZ; # jvmaccess::VirtualMachine::AttachGuard::CreationException::CreationException() @@ -15,7 +15,7 @@ UDK_3_0_0 { UDK_3.2 { global: -} UDK_3_0_0; +} UDK_3.1; UDK_3.3 { global: diff --git a/offapi/com/sun/star/deployment/XPackage.idl b/offapi/com/sun/star/deployment/XPackage.idl index 9709b579bc2e..a6a2f6adf851 100644..100755 --- a/offapi/com/sun/star/deployment/XPackage.idl +++ b/offapi/com/sun/star/deployment/XPackage.idl @@ -262,6 +262,14 @@ interface XPackage string getDescription() raises (ExtensionRemovedException); + /** returns a string containing the license text. + + @return + license + */ + string getLicenseText() + raises (ExtensionRemovedException); + /** returns a sequence of update information URLs. The sequence may be empty in case no update information is available. diff --git a/offapi/com/sun/star/document/MediaDescriptor.idl b/offapi/com/sun/star/document/MediaDescriptor.idl index 36da721cc159..a0aaed88a929 100644 --- a/offapi/com/sun/star/document/MediaDescriptor.idl +++ b/offapi/com/sun/star/document/MediaDescriptor.idl @@ -39,6 +39,10 @@ #include <com/sun/star/awt/Rectangle.idl> #endif +#ifndef __com_sun_star_beans_NamedValue_idl__ +#include <com/sun/star/beans/NamedValue.idl> +#endif + #ifndef __com_sun_star_util_URL_idl__ #include <com/sun/star/util/URL.idl> #endif @@ -144,7 +148,7 @@ published service MediaDescriptor <p> For extensibility, it is recommended to use values of type - sequence<com.sun.star.beans.PropertyValue> with this property. + sequence<com.sun.star.beans.NamedValue> with this property. </p> */ [optional,property] any ComponentData; @@ -164,6 +168,23 @@ published service MediaDescriptor [optional,property] string DocumentTitle; //------------------------------------------------------------------------- + /** encryption information for encryption/decryption of documents + + <p> + It contains the necessary information for encryption/decryption of + a component (if necessary). + If neither password nor encryption data is specified, loading of + a password protected document will fail, storing will be done without + encryption. If both are provided, the encryption data is used + ( if the filter supports it ). + </p> + <p> + The encryption data is generated based on the password. + </p> + */ + [optional,property] sequence< ::com::sun::star::beans::NamedValue > EncryptionData; + + //------------------------------------------------------------------------- /** same as <member>MediaDescriptor::URL</member> <p> @@ -365,9 +386,11 @@ published service MediaDescriptor /** pasword for loading storing documents <p> - It caontains a password for loading or storing a component (if necessary). - If no password is specified, loading of a password protected document - will fail, storing will be done without encryption. + It contains a password for loading or storing a component (if necessary). + If neither password nor encryption data is specified, loading of + a password protected document will fail, storing will be done without + encryption. If both are provided, the encryption data is used + ( if the filter supports it ). </p> */ [optional,property] string Password; diff --git a/offapi/com/sun/star/embed/XEncryptionProtectedSource2.idl b/offapi/com/sun/star/embed/XEncryptionProtectedSource2.idl new file mode 100644 index 000000000000..e590a5764178 --- /dev/null +++ b/offapi/com/sun/star/embed/XEncryptionProtectedSource2.idl @@ -0,0 +1,65 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_embed_XEncryptionProtectedSource2_idl__ +#define __com_sun_star_embed_XEncryptionProtectedSource2_idl__ + +#ifndef __com_sun_star_embed_XEncryptionProtectedSource_idl__ +#include <com/sun/star/embed/XEncryptionProtectedSource.idl> +#endif + +#ifndef __com_sun_star_beans_NamedValue_idl__ +#include <com/sun/star/beans/NamedValue.idl> +#endif + +//============================================================================ + +module com { module sun { module star { module embed { + +//============================================================================ +/** This interface allows to set a password for an object. + */ +published interface XEncryptionProtectedSource2: XEncryptionProtectedSource +{ + // ----------------------------------------------------------------------- + /** sets an encryption data for the object. + + @param aEncryptionData + the new encryption data + + @throws ::com::sun::star::io::IOException + in case the data could not be set + */ + void setEncryptionData( [in] sequence< ::com::sun::star::beans::NamedValue > aEncryptionData ) + raises( ::com::sun::star::io::IOException ); +}; + +//============================================================================ + +}; }; }; }; + +#endif + diff --git a/offapi/com/sun/star/embed/XHierarchicalStorageAccess2.idl b/offapi/com/sun/star/embed/XHierarchicalStorageAccess2.idl new file mode 100644 index 000000000000..0df83ea33580 --- /dev/null +++ b/offapi/com/sun/star/embed/XHierarchicalStorageAccess2.idl @@ -0,0 +1,109 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_embed_XHierarchicalStorageAccess2_idl__ +#define __com_sun_star_embed_XHierarchicalStorageAccess2_idl__ + +#ifndef __com_sun_star_embed_XHierarchicalStorageAccess_idl__ +#include <com/sun/star/embed/XHierarchicalStorageAccess.idl> +#endif + +#ifndef __com_sun_star_beans_NamedValue_idl__ +#include <com/sun/star/beans/NamedValue.idl> +#endif + +//============================================================================ + + module com { module sun { module star { module embed { + +//============================================================================ +/** This interface extends XHierarchicalStorageAccess interface. + */ +interface XHierarchicalStorageAccess2 : XHierarchicalStorageAccess +{ + // ----------------------------------------------------------------------- + /** allows to get access to a child encrypted stream with encryption data + using hierarchical path. + + <p> + If storage does not allow any encryption this method will always throw + <type scope="com::sun::star::packages">NoEncryptionException</type>. + </p> + + <p> + In case the stream is open in readonly mode the + <method scope="com::sun::star::io">XStream::getOutputStream</method> + method will return an empty reference. + </p> + + @param sStreamPath + the path to the substream that should be open + + @param nOpenMode + a mode the stream should be open in, + can be a combination of <type>ElementModes</type> values + + @param aEncryptionData + this parameter allowes to specify an encryption data for the + stream, the data must be correct, otherwise an + exception will be thrown + + @throws ::com::sun::star::embed::InvalidStorageException + this storage is in invalid state for any reason + + @throws ::com::sun::star::lang::IllegalArgumentException + one of provided arguments is illegal + + @throws ::com::sun::star::packages::NoEncryptionException + the stream is not encrypted + + @throws ::com::sun::star::packages::WrongPasswordException + the provided password is wrong + + @throws ::com::sun::star::io::IOException + in case of io errors during stream opening + + @throws ::com::sun::star::embed::StorageWrappedTargetException + wraps other exceptions + */ + XExtendedStorageStream openEncryptedStreamByHierarchicalName( + [in] string sStreamName, + [in] long nOpenMode, + [in] sequence< ::com::sun::star::beans::NamedValue > aEncryptionData ) + raises( ::com::sun::star::embed::InvalidStorageException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::packages::NoEncryptionException, + ::com::sun::star::packages::WrongPasswordException, + ::com::sun::star::io::IOException, + ::com::sun::star::embed::StorageWrappedTargetException ); +}; + +//============================================================================ + +}; }; }; }; + +#endif + diff --git a/offapi/com/sun/star/embed/XStorage2.idl b/offapi/com/sun/star/embed/XStorage2.idl new file mode 100644 index 000000000000..cf4f9907b66e --- /dev/null +++ b/offapi/com/sun/star/embed/XStorage2.idl @@ -0,0 +1,165 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_embed_XStorage2_idl__ +#define __com_sun_star_embed_XStorage2_idl__ + +#ifndef __com_sun_star_embed_XStorage_idl__ +#include <com/sun/star/embed/XStorage.idl> +#endif + +#ifndef __com_sun_star_beans_NamedValue_idl__ +#include <com/sun/star/beans/NamedValue.idl> +#endif + + +//============================================================================ + + module com { module sun { module star { module embed { + +//============================================================================ +/** This interface extends the base XStorage interface. + */ +interface XStorage2 : XStorage +{ + // ----------------------------------------------------------------------- + /** allows to get access to a child encrypted stream with EncryptionData. + + <p> + If storage does not allow any encryption this method will always throw + <type scope="com::sun::star::packages">NoEncryptionException</type>. + </p> + + <p> + In case the stream is open in readonly mode the + <method scope="com::sun::star::io">XStream::getOutputStream</method> + method will return an empty reference. + </p> + + @param sStreamName + the name of the substream that should be open + + @param nOpenMode + a mode the stream should be open in, + can be a combination of <type>ElementModes</type> values + + @param aEncryptionData + this parameter allowes to specify an encryption data to decrypt the + stream, the encryption data must be correct, otherwise an + exception will be thrown + + @throws ::com::sun::star::embed::InvalidStorageException + this storage is in invalid state for any reason + + @throws ::com::sun::star::lang::IllegalArgumentException + one of provided arguments is illegal + + @throws ::com::sun::star::packages::NoEncryptionException + the stream is not encrypted + + @throws ::com::sun::star::packages::WrongPasswordException + the provided encryption data is wrong + + @throws ::com::sun::star::io::IOException + in case of io errors during stream opening + + @throws ::com::sun::star::embed::StorageWrappedTargetException + wraps other exceptions + */ + ::com::sun::star::io::XStream openEncryptedStream( + [in] string sStreamName, + [in] long nOpenMode, + [in] sequence< ::com::sun::star::beans::NamedValue > aEncryptionData ) + raises( ::com::sun::star::embed::InvalidStorageException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::packages::NoEncryptionException, + ::com::sun::star::packages::WrongPasswordException, + ::com::sun::star::io::IOException, + ::com::sun::star::embed::StorageWrappedTargetException ); + + // ----------------------------------------------------------------------- + /** allows to get readonly copy of a child encrypted stream with encryption + data. + + <p> + If storage does not allow any encryption this method will always throw + <type scope="com::sun::star::packages">NoEncryptionException</type>. + </p> + + <p> + The stream is open in readonly mode so the + <method scope="com::sun::star::io">XStream::getOutputStream</method> + method will return an empty reference. + </p> + + <p> + This method allows to specify encryption data for the child stream + explicitly. + </p> + + @param sStreamName + the name of the substream that should be copied + + @param aEncryptionData + this parameter allowes to specify an encryption data for the + stream, the encryption data must be correct, otherwise an + exception will be thrown + + @throws ::com::sun::star::embed::InvalidStorageException + this storage is in invalid state for any reason + + @throws ::com::sun::star::lang::IllegalArgumentException + one of provided arguments is illegal + + @throws ::com::sun::star::packages::NoEncryptionException + the stream is not encrypted + + @throws ::com::sun::star::packages::WrongPasswordException + the provided encryption data is wrong + + @throws ::com::sun::star::io::IOException + in case of io errors during stream opening + + @throws ::com::sun::star::embed::StorageWrappedTargetException + wraps other exceptions + */ + ::com::sun::star::io::XStream cloneEncryptedStream( + [in] string sStreamName, + [in] sequence< ::com::sun::star::beans::NamedValue > aEncryptionData ) + raises( ::com::sun::star::embed::InvalidStorageException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::packages::NoEncryptionException, + ::com::sun::star::packages::WrongPasswordException, + ::com::sun::star::io::IOException, + ::com::sun::star::embed::StorageWrappedTargetException ); +}; + +//============================================================================ + +}; }; }; }; + +#endif + diff --git a/offapi/com/sun/star/embed/makefile.mk b/offapi/com/sun/star/embed/makefile.mk index 349017452ef3..8ee156af48ba 100644 --- a/offapi/com/sun/star/embed/makefile.mk +++ b/offapi/com/sun/star/embed/makefile.mk @@ -77,6 +77,7 @@ IDLFILES=\ XLinkCreator.idl\ XLinkFactory.idl\ XEncryptionProtectedSource.idl\ + XEncryptionProtectedSource2.idl\ XInplaceClient.idl\ XInsertObjectDialog.idl\ XWindowSupplier.idl\ @@ -89,9 +90,11 @@ IDLFILES=\ XTransferableSupplier.idl\ XComponentSupplier.idl\ XStorage.idl\ + XStorage2.idl\ XStorageRawAccess.idl\ XExtendedStorageStream.idl\ XHierarchicalStorageAccess.idl\ + XHierarchicalStorageAccess2.idl\ XHatchWindowController.idl\ XHatchWindowFactory.idl\ XHatchWindow.idl\ diff --git a/offapi/com/sun/star/formula/FormulaProperties.idl b/offapi/com/sun/star/formula/FormulaProperties.idl index d6f0f6bfeb28..4e03ff36c3a5 100644 --- a/offapi/com/sun/star/formula/FormulaProperties.idl +++ b/offapi/com/sun/star/formula/FormulaProperties.idl @@ -338,6 +338,14 @@ published service FormulaProperties /** contains the metric value of the right margin of the formula. */ [property] short RightMargin; + + //------------------------------------------------------------------------- + + /** contains the baselines offset in respect to the top of the formula rectangle + + @since OOo 3.4 + */ + [property, optional] short BaseLine; }; //============================================================================= diff --git a/offapi/com/sun/star/script/ModuleInfo.idl b/offapi/com/sun/star/script/ModuleInfo.idl index 158ba387be6b..f9f3b3639c14 100644 --- a/offapi/com/sun/star/script/ModuleInfo.idl +++ b/offapi/com/sun/star/script/ModuleInfo.idl @@ -1,35 +1,27 @@ /************************************************************************* * - * OpenOffice.org - a multi-platform office productivity suite + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * $RCSfile: ModuleInfo.idl,v $ + * Copyright 2000, 2010 Oracle and/or its affiliates. * - * $Revision: 1.2 $ + * OpenOffice.org - a multi-platform office productivity suite * - * last change: $Author: rt $ $Date: 2006/05/05 10:14:46 $ + * This file is part of OpenOffice.org. * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. + * 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). * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library 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 for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * 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. * ************************************************************************/ diff --git a/offapi/com/sun/star/script/ModuleType.idl b/offapi/com/sun/star/script/ModuleType.idl index a9bde042fa5a..fb0b08692219 100644 --- a/offapi/com/sun/star/script/ModuleType.idl +++ b/offapi/com/sun/star/script/ModuleType.idl @@ -1,35 +1,27 @@ /************************************************************************* * - * OpenOffice.org - a multi-platform office productivity suite + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * $RCSfile: ModuleType.idl,v $ + * Copyright 2000, 2010 Oracle and/or its affiliates. * - * $Revision: 1.2 $ + * OpenOffice.org - a multi-platform office productivity suite * - * last change: $Author: rt $ $Date: 2006/05/05 10:14:46 $ + * This file is part of OpenOffice.org. * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. + * 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). * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library 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 for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * 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. * ************************************************************************/ diff --git a/offapi/com/sun/star/script/NativeObjectWrapper.idl b/offapi/com/sun/star/script/NativeObjectWrapper.idl new file mode 100755 index 000000000000..93281a061d6e --- /dev/null +++ b/offapi/com/sun/star/script/NativeObjectWrapper.idl @@ -0,0 +1,42 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_script_NativeObjectWrapper_idl__ +#define __com_sun_star_script_NativeObjectWrapper_idl__ + +//============================================================================= +module com { module sun { module star { module script { +struct NativeObjectWrapper +{ + any ObjectId; +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/script/makefile.mk b/offapi/com/sun/star/script/makefile.mk index da8e9110d1fa..9c0a38fa44c2 100644 --- a/offapi/com/sun/star/script/makefile.mk +++ b/offapi/com/sun/star/script/makefile.mk @@ -50,7 +50,8 @@ IDLFILES=\ XStorageBasedLibraryContainer.idl\ ModuleSizeExceededRequest.idl\ ModuleInfo.idl\ - ModuleType.idl + ModuleType.idl\ + NativeObjectWrapper.idl # ------------------------------------------------------------------ diff --git a/offapi/com/sun/star/task/PDFExportException.idl b/offapi/com/sun/star/task/PDFExportException.idl new file mode 100644 index 000000000000..8547aea76418 --- /dev/null +++ b/offapi/com/sun/star/task/PDFExportException.idl @@ -0,0 +1,52 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_task_PDFExportException_idl__ +#define __com_sun_star_task_PDFExportException_idl__ + +#ifndef __com_sun_star_uno_Exception_idl__ +#include <com/sun/star/uno/Exception.idl> +#endif + + module com { module sun { module star { module task { + + +/** is an exception that provides information on an error during PDF export. + */ +published exception PDFExportException: com::sun::star::uno::Exception +{ + /** contains a number of errors that occured during PDFExport + */ + sequence< long > ErrorCodes; +}; + +//============================================================================= + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif diff --git a/offapi/com/sun/star/task/makefile.mk b/offapi/com/sun/star/task/makefile.mk index 16b0be56e36c..cd9db6b5a738 100755..100644 --- a/offapi/com/sun/star/task/makefile.mk +++ b/offapi/com/sun/star/task/makefile.mk @@ -59,6 +59,7 @@ IDLFILES=\ PasswordContainerInteractionHandler.idl\ PasswordRequest.idl\ PasswordRequestMode.idl\ + PDFExportException.idl\ OfficeRestartManager.idl\ UnsupportedOverwriteRequest.idl\ UrlRecord.idl\ diff --git a/offapi/com/sun/star/text/DocumentSettings.idl b/offapi/com/sun/star/text/DocumentSettings.idl index 3ab98fdd2ddc..19c4d75997cb 100644 --- a/offapi/com/sun/star/text/DocumentSettings.idl +++ b/offapi/com/sun/star/text/DocumentSettings.idl @@ -195,10 +195,20 @@ published service DocumentSettings */ [optional, property] boolean ConsiderTextWrapOnObjPos; + // ------------------------------------------------------------ + /** specifies if Math objects should automatically vertically aligned to + match the baseline of the surrounding text. + + <p>If activated formula object that are anchored 'As Character' will be + vertically aligned to have their baseline match with the one from the text.</p> + + @since OOo 3.4 + */ + [optional, property] boolean MathBaselineAlignment; }; //============================================================================= }; }; }; }; -#endif +#endif
\ No newline at end of file diff --git a/offapi/com/sun/star/text/TextMarkupType.idl b/offapi/com/sun/star/text/TextMarkupType.idl index 5137d47d217f..f5ea4e59f1ec 100644 --- a/offapi/com/sun/star/text/TextMarkupType.idl +++ b/offapi/com/sun/star/text/TextMarkupType.idl @@ -44,27 +44,32 @@ module com { module sun { module star { module text { constants TextMarkupType { - /// Markup originates from spell checking. + /** Markup originates from spell checking. + */ const long SPELLCHECK = 1; - /// Markup originates from proofreading - /// @since OOo 3.0.1 + /** Markup originates from proofreading + @since OOo 3.0.1 + */ const long PROOFREADING = 2; - /// Markup originates from smart tag checking. + /** Markup originates from smart tag checking. + */ const long SMARTTAG = 3; - /// Markup originates from proofreading - /// An inivisible markup used to identify sentence boundaries. - /// @since OOo 3.0.1 + /** Markup originates from proofreading + An inivisible markup type used in proofreading API calls. + @since OOo 3.0.1 + */ const long SENTENCE = 4; - /// Markups originates from change tracking. - /// @since OOo 3.3 + /** Markups originates from change tracking. + @since OOo 3.3 + */ const long TRACK_CHANGE_INSERTION = 5; const long TRACK_CHANGE_DELETION = 6; const long TRACK_CHANGE_FORMATCHANGE = 7; }; }; }; }; }; -#endif +#endif
\ No newline at end of file diff --git a/offapi/com/sun/star/ui/UIElementType.idl b/offapi/com/sun/star/ui/UIElementType.idl index f87d91ca6243..0b4301f54f2a 100644 --- a/offapi/com/sun/star/ui/UIElementType.idl +++ b/offapi/com/sun/star/ui/UIElementType.idl @@ -2,10 +2,13 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * + * $RCSfile: UIElementType.idl,v $ + * $Revision: 1.4 $ + * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -78,6 +81,11 @@ constants UIElementType const short TOOLPANEL = 7; //------------------------------------------------------------------------- + /** specifies a window that can be docked. + */ + const short DOCKINGWINDOW = 7; + + //------------------------------------------------------------------------- /** specifies the number of constants. */ const short COUNT = 8; diff --git a/offapi/com/sun/star/util/OfficeInstallationDirectories.idl b/offapi/com/sun/star/util/OfficeInstallationDirectories.idl index 3c127fa701d2..2a79d6affd48 100644 --- a/offapi/com/sun/star/util/OfficeInstallationDirectories.idl +++ b/offapi/com/sun/star/util/OfficeInstallationDirectories.idl @@ -52,7 +52,7 @@ module com { module sun { module star { module util { @since OOo 2.0.0 */ -service OfficeInstallationDirectories +published service OfficeInstallationDirectories { /** provides access to the current office installation directories (office base installation and user data). @@ -67,7 +67,7 @@ service OfficeInstallationDirectories @see OfficeInstallationDirectories */ -singleton theOfficeInstallationDirectories +published singleton theOfficeInstallationDirectories { service com::sun::star::util::OfficeInstallationDirectories; }; diff --git a/offapi/com/sun/star/util/XOfficeInstallationDirectories.idl b/offapi/com/sun/star/util/XOfficeInstallationDirectories.idl index c70fde8867e5..d79d0cffc79f 100644 --- a/offapi/com/sun/star/util/XOfficeInstallationDirectories.idl +++ b/offapi/com/sun/star/util/XOfficeInstallationDirectories.idl @@ -47,7 +47,7 @@ module com { module sun { module star { module util { @since OOo 2.0.0 */ -interface XOfficeInstallationDirectories : com::sun::star::uno::XInterface +published interface XOfficeInstallationDirectories : com::sun::star::uno::XInterface { //------------------------------------------------------------------------ /** returns the absolute URL containing the directory of the current office @@ -61,7 +61,8 @@ interface XOfficeInstallationDirectories : com::sun::star::uno::XInterface //------------------------------------------------------------------------ /** returns the absolute URL containing the directory where the current - office installation expects its user data (e.g. "file:///home/kso".) + office installation expects its user data (e.g. + "file:///home/kso/.openoffice.org".) @returns the absolute URL containing the directory of the current office diff --git a/offuh/prj/build.lst b/offuh/prj/build.lst index f8f8ca45ba1a..e98f3565b60c 100644 --- a/offuh/prj/build.lst +++ b/offuh/prj/build.lst @@ -1,4 +1,4 @@ -ou offuh :: offapi codemaker NULL +ou offuh :: offapi oovbaapi codemaker NULL ou offuh usr1 - all ou_mkout NULL ou offuh\prj get - all ou_prj NULL ou offuh\source nmake - all ou_source NULL diff --git a/offuh/prj/d.lst b/offuh/prj/d.lst index a88257dc695d..486c08f1c655 100644 --- a/offuh/prj/d.lst +++ b/offuh/prj/d.lst @@ -134,6 +134,21 @@ mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\xml\wrapper #i20156 - end mkdir: %_DEST%\inc%_EXT%\offuh\com\sun\star\rdf +mkdir: %_DEST%\inc%_EXT%\offuh\ooo +mkdir: %_DEST%\inc%_EXT%\offuh\ooo\vba +mkdir: %_DEST%\inc%_EXT%\offuh\ooo\vba\access +mkdir: %_DEST%\inc%_EXT%\offuh\ooo\vba\adodb +mkdir: %_DEST%\inc%_EXT%\offuh\ooo\vba\dao +mkdir: %_DEST%\inc%_EXT%\offuh\ooo\vba\excel +mkdir: %_DEST%\inc%_EXT%\offuh\ooo\vba\msforms +mkdir: %_DEST%\inc%_EXT%\offuh\ooo\vba\office +mkdir: %_DEST%\inc%_EXT%\offuh\ooo\vba\powerpoint +mkdir: %_DEST%\inc%_EXT%\offuh\ooo\vba\stdole +mkdir: %_DEST%\inc%_EXT%\offuh\ooo\vba\word +mkdir: %_DEST%\inc%_EXT%\offuh\msforms + + + ..\%__SRC%\inc\offuh\com\sun\star\auth\*.hdl %_DEST%\inc%_EXT%\offuh\com\sun\star\auth\*.hdl ..\%__SRC%\inc\offuh\com\sun\star\auth\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\auth\*.hpp ..\%__SRC%\inc\offuh\com\sun\star\accessibility\*.hpp %_DEST%\inc%_EXT%\offuh\com\sun\star\accessibility\*.hpp @@ -377,3 +392,29 @@ 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 + +..\%__SRC%\inc\offuh\ooo\vba\*.hpp %_DEST%\inc%_EXT%\offuh\ooo\vba\*.hpp +..\%__SRC%\inc\offuh\ooo\vba\*.hdl %_DEST%\inc%_EXT%\offuh\ooo\vba\*.hdl +..\%__SRC%\inc\offuh\ooo\vba\*.hpp %_DEST%\inc%_EXT%\offuh\ooo\vba\*.hpp +..\%__SRC%\inc\offuh\ooo\vba\*.hdl %_DEST%\inc%_EXT%\offuh\ooo\vba\*.hdl +..\%__SRC%\inc\offuh\ooo\vba\access\*.hpp %_DEST%\inc%_EXT%\offuh\ooo\vba\access\*.hpp +..\%__SRC%\inc\offuh\ooo\vba\access\*.hdl %_DEST%\inc%_EXT%\offuh\ooo\vba\access\*.hdl +..\%__SRC%\inc\offuh\ooo\vba\adodb\*.hpp %_DEST%\inc%_EXT%\offuh\ooo\vba\adodb\*.hpp +..\%__SRC%\inc\offuh\ooo\vba\adodb\*.hdl %_DEST%\inc%_EXT%\offuh\ooo\vba\adodb\*.hdl +..\%__SRC%\inc\offuh\ooo\vba\dao\*.hpp %_DEST%\inc%_EXT%\offuh\ooo\vba\dao\*.hpp +..\%__SRC%\inc\offuh\ooo\vba\dao\*.hdl %_DEST%\inc%_EXT%\offuh\ooo\vba\dao\*.hdl +..\%__SRC%\inc\offuh\ooo\vba\excel\*.hpp %_DEST%\inc%_EXT%\offuh\ooo\vba\excel\*.hpp +..\%__SRC%\inc\offuh\ooo\vba\excel\*.hdl %_DEST%\inc%_EXT%\offuh\ooo\vba\excel\*.hdl +..\%__SRC%\inc\offuh\ooo\vba\msforms\*.hpp %_DEST%\inc%_EXT%\offuh\ooo\vba\msforms\*.hpp +..\%__SRC%\inc\offuh\ooo\vba\msforms\*.hdl %_DEST%\inc%_EXT%\offuh\ooo\vba\msforms\*.hdl +..\%__SRC%\inc\offuh\ooo\vba\office\*.hpp %_DEST%\inc%_EXT%\offuh\ooo\vba\office\*.hpp +..\%__SRC%\inc\offuh\ooo\vba\office\*.hdl %_DEST%\inc%_EXT%\offuh\ooo\vba\office\*.hdl +..\%__SRC%\inc\offuh\ooo\vba\powerpoint\*.hpp %_DEST%\inc%_EXT%\offuh\ooo\vba\powerpoint\*.hpp +..\%__SRC%\inc\offuh\ooo\vba\powerpoint\*.hdl %_DEST%\inc%_EXT%\offuh\ooo\vba\powerpoint\*.hdl +..\%__SRC%\inc\offuh\ooo\vba\stdole\*.hpp %_DEST%\inc%_EXT%\offuh\ooo\vba\stdole\*.hpp +..\%__SRC%\inc\offuh\ooo\vba\stdole\*.hdl %_DEST%\inc%_EXT%\offuh\ooo\vba\stdole\*.hdl +..\%__SRC%\inc\offuh\ooo\vba\word\*.hpp %_DEST%\inc%_EXT%\offuh\ooo\vba\word\*.hpp +..\%__SRC%\inc\offuh\ooo\vba\word\*.hdl %_DEST%\inc%_EXT%\offuh\ooo\vba\word\*.hdl +..\%__SRC%\inc\offuh\msforms\*.hpp %_DEST%\inc%_EXT%\offuh\msforms\*.hpp +..\%__SRC%\inc\offuh\msforms\*.hdl %_DEST%\inc%_EXT%\offuh\msforms\*.hdl + diff --git a/offuh/source/makefile.mk b/offuh/source/makefile.mk index e773d7ff3a69..230dc750aa90 100644 --- a/offuh/source/makefile.mk +++ b/offuh/source/makefile.mk @@ -33,12 +33,16 @@ TARGET= offuh .INCLUDE : settings.mk -# ------------------------------------------------------------------ +# --- Targets ------------------------------------------------------ +.INCLUDE : target.mk + +ALLTAR : $(MISC)$/oovbaapi.don $(MISC)$/$(TARGET).don $(MISC)$/$(TARGET).don : $(UNOUCRRDB) @@-$(RM) $@ $(CPPUMAKER) -Gc $(CPPUMAKERFLAGS) -B$(UNOUCRBASE) -O$(UNOUCROUT) $(UNOUCRRDB) && echo > $@ -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk +$(MISC)$/oovbaapi.don : $(SOLARBINDIR)$/oovbaapi.rdb + @@-$(RM) $@ + $(CPPUMAKER) -Gc $(CPPUMAKERFLAGS) -B$(UNOUCRBASE) -O$(UNOUCROUT) $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@ + echo $@ diff --git a/pyuno/prj/build.lst b/pyuno/prj/build.lst index 92449162071d..5a3b2c179e7d 100644 --- a/pyuno/prj/build.lst +++ b/pyuno/prj/build.lst @@ -1,4 +1,4 @@ -bgpu pyuno : stoc cpputools cppuhelper bridges tools PYTHON:python NULL +bgpu pyuno : stoc cpputools cppuhelper bridges tools PYTHON:python LIBXSLT:libxslt NULL pu pyuno usr1 - all br_mkout NULL pu pyuno\zipcore nmake - all pu_zipcore NULL pu pyuno\source\module nmake - all pu_module NULL diff --git a/remotebridges/prj/build.lst b/remotebridges/prj/build.lst index 30a376462d7c..a1f16dbd60d2 100644 --- a/remotebridges/prj/build.lst +++ b/remotebridges/prj/build.lst @@ -1,4 +1,4 @@ -rb remotebridges : bridges rdbmaker NULL +rb remotebridges : LIBXSLT:libxslt bridges rdbmaker NULL rb remotebridges usr1 - all rb_mkout NULL rb remotebridges\source\bridge nmake - all rb_iiop NULL rb remotebridges\source\factory nmake - all rb_factory NULL diff --git a/sal/inc/osl/diagnose.h b/sal/inc/osl/diagnose.h index 055a7971e7b6..033b24c84360 100644 --- a/sal/inc/osl/diagnose.h +++ b/sal/inc/osl/diagnose.h @@ -78,15 +78,7 @@ pfunc_osl_printDetailedDebugMessage SAL_CALL osl_setDetailedDebugMessageFunc( pf #define OSL_THIS_FILE __FILE__ /* the macro OSL_THIS_FUNC is intended to be an office internal macro for now */ -#ifdef __func__ -#define OSL_THIS_FUNC __func__ -#elifdef __PRETTY_FUNCTION__ -#define OSL_THIS_FUNC __PRETTY_FUNCTION__ -#elifdef __FUNCTION__ -#define OSL_THIS_FUNC __FUNCTION__ -#else -#define OSL_THIS_FUNC " " -#endif +#define OSL_THIS_FUNC "<unknown>" /* the macro OSL_TO_STRING is intended to be an office internal macro for now */ #define OSL_TO_STRING( x ) #x diff --git a/sal/inc/rtl/math.h b/sal/inc/rtl/math.h index 985ce700b049..fa81108df29f 100644 --- a/sal/inc/rtl/math.h +++ b/sal/inc/rtl/math.h @@ -319,7 +319,9 @@ void SAL_CALL rtl_math_doubleToUString(rtl_uString ** pResult, @param pParsedEnd If non-null, returns one past the position of the last character parsed away. Thus if [pBegin..pEnd) only contains the numerical string to be - parsed, *pParsedEnd == pEnd on return. + parsed, *pParsedEnd == pEnd on return. If no numerical (sub-)string is + found, *pParsedEnd == pBegin on return, even if there was leading + whitespace. */ double SAL_CALL rtl_math_stringToDouble( sal_Char const * pBegin, sal_Char const * pEnd, sal_Char cDecSeparator, @@ -357,7 +359,9 @@ double SAL_CALL rtl_math_stringToDouble( @param pParsedEnd If non-null, returns one past the position of the last character parsed away. Thus if [pBegin..pEnd) only contains the numerical string to be - parsed, *pParsedEnd == pEnd on return. + parsed, *pParsedEnd == pEnd on return. If no numerical (sub-)string is + found, *pParsedEnd == pBegin on return, even if there was leading + whitespace. */ double SAL_CALL rtl_math_uStringToDouble( sal_Unicode const * pBegin, sal_Unicode const * pEnd, diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index 331b91cb1626..452d3eb2db70 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -1022,66 +1022,31 @@ static int oslDoCopyFile(const sal_Char* pszSourceFileName, const sal_Char* pszD return nRet; } - /* HACK: because memory mapping fails on various - platforms if the size of the source file is 0 byte */ - if (0 == nSourceSize) - { - close(SourceFileFD); - close(DestFileFD); - return 0; - } - - // read and lseek are used to check the possibility to access the data - // not a nice solution, but it allows to avoid a crash in case it is an opened samba file - // generally, reading of one byte should not affect the performance - char nCh; - if ( 1 != read( SourceFileFD, &nCh, 1 ) - || -1 == lseek( SourceFileFD, 0, SEEK_SET ) ) - { - nRet = errno; - close( SourceFileFD ); - close( DestFileFD ); - return nRet; - } - size_t nWritten = 0; size_t nRemains = nSourceSize; - /* mmap file -- open dest file -- write -- fsync it at the end */ - void* pSourceFile = mmap( 0, nSourceSize, PROT_READ, MAP_SHARED, SourceFileFD, 0 ); - if ( pSourceFile != MAP_FAILED ) - { - nWritten = write( DestFileFD, pSourceFile, nSourceSize ); - nRemains -= nWritten; - munmap( (char*)pSourceFile, nSourceSize ); - } - if ( nRemains ) { /* mmap has problems, try the direct streaming */ - char pBuffer[32000]; + char pBuffer[0x8000]; size_t nRead = 0; nRemains = nSourceSize; - if ( -1 != lseek( SourceFileFD, 0, SEEK_SET ) - && -1 != lseek( DestFileFD, 0, SEEK_SET ) ) + do { - do - { - nRead = 0; - nWritten = 0; + nRead = 0; + nWritten = 0; - size_t nToRead = std::min( (size_t)32000, nRemains ); - nRead = read( SourceFileFD, pBuffer, nToRead ); - if ( (size_t)-1 != nRead ) - nWritten = write( DestFileFD, pBuffer, nRead ); + size_t nToRead = std::min( (size_t)0x8000, nRemains ); + nRead = read( SourceFileFD, pBuffer, nToRead ); + if ( (size_t)-1 != nRead ) + nWritten = write( DestFileFD, pBuffer, nRead ); - if ( (size_t)-1 != nWritten ) - nRemains -= nWritten; - } - while( nRemains && (size_t)-1 != nRead && nRead == nWritten ); + if ( (size_t)-1 != nWritten ) + nRemains -= nWritten; } + while( nRemains && (size_t)-1 != nRead && nRead == nWritten ); } if ( nRemains ) diff --git a/sal/osl/unx/nlsupport.c b/sal/osl/unx/nlsupport.c index c9f4fd18df21..af7d420ee524 100644 --- a/sal/osl/unx/nlsupport.c +++ b/sal/osl/unx/nlsupport.c @@ -844,9 +844,9 @@ void _imp_getProcessLocale( rtl_Locale ** ppLocale ) if ( NULL == locale ) { - locale = (char *)malloc( 20 ); + locale = (char *)malloc( 128 ); if ( locale ) - macosx_getLocale( locale, 20 ); + macosx_getLocale( locale, 128 ); else fprintf( stderr, "nlsupport.c: locale allocation returned NULL!\n" ); } diff --git a/sal/prj/build.lst b/sal/prj/build.lst index c96c3977f725..06e3958443e9 100644 --- a/sal/prj/build.lst +++ b/sal/prj/build.lst @@ -20,3 +20,4 @@ sa sal\qa\OStringBuffer nmake - all sa_qa_OStringBuffer sa_cppunittester sa_util sa sal\qa\osl\mutex nmake - all sa_qa_osl_mutex sa_cppunittester sa_util NULL sa sal\qa\osl\pipe nmake - all sa_qa_osl_pipe sa_cppunittester sa_util NULL sa sal\qa\osl\profile nmake - all sa_qa_osl_profile sa_cppunittester sa_util NULL +sa sal\qa\rtl\math nmake - all sa_qa_rtl_math sa_cppunittester sa_util NULL diff --git a/sal/qa/OStringBuffer/makefile.mk b/sal/qa/OStringBuffer/makefile.mk index d46168dc4d0e..e0c1a81d66e3 100644 --- a/sal/qa/OStringBuffer/makefile.mk +++ b/sal/qa/OStringBuffer/makefile.mk @@ -33,8 +33,6 @@ PRJ=..$/.. PRJNAME=sal TARGET=qa_ostringbuffer -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/sal/qa/osl/process/makefile.mk b/sal/qa/osl/process/makefile.mk index 6bbee03b6aaf..e113ac86edee 100644 --- a/sal/qa/osl/process/makefile.mk +++ b/sal/qa/osl/process/makefile.mk @@ -28,8 +28,6 @@ PRJ=..$/..$/.. PRJNAME=sal TARGET=qa_osl_process -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/sal/qa/osl/profile/makefile.mk b/sal/qa/osl/profile/makefile.mk index a95db211c2a6..67ad60057c07 100644 --- a/sal/qa/osl/profile/makefile.mk +++ b/sal/qa/osl/profile/makefile.mk @@ -33,7 +33,6 @@ PRJ=..$/..$/.. PRJNAME=sal TARGET=qa_osl_profile -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/sal/qa/rtl/alloc/makefile.mk b/sal/qa/rtl/alloc/makefile.mk index 37ae3718b40d..db4f01eb439b 100755 --- a/sal/qa/rtl/alloc/makefile.mk +++ b/sal/qa/rtl/alloc/makefile.mk @@ -28,8 +28,6 @@ PRJ=..$/..$/.. PRJNAME=sal TARGET=qa_rtl_alloc -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/sal/qa/rtl/crc32/makefile.mk b/sal/qa/rtl/crc32/makefile.mk index 6bd3bd89d5a6..704c149d45cd 100755 --- a/sal/qa/rtl/crc32/makefile.mk +++ b/sal/qa/rtl/crc32/makefile.mk @@ -28,8 +28,6 @@ PRJ=..$/..$/.. PRJNAME=sal TARGET=qa_rtl_crc32 -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/sal/qa/rtl/digest/makefile.mk b/sal/qa/rtl/digest/makefile.mk index 415183b7e9a0..7798004ed854 100644 --- a/sal/qa/rtl/digest/makefile.mk +++ b/sal/qa/rtl/digest/makefile.mk @@ -29,8 +29,6 @@ INCPRE+= $(PRJ)$/qa$/inc PRJNAME=sal TARGET=rtl_digest -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/sal/qa/rtl/doublelock/makefile.mk b/sal/qa/rtl/doublelock/makefile.mk index b13ccf420c06..45259fd3cba0 100644 --- a/sal/qa/rtl/doublelock/makefile.mk +++ b/sal/qa/rtl/doublelock/makefile.mk @@ -28,8 +28,6 @@ PRJ=..$/..$/.. PRJNAME=sal TARGET=qa_rtl_doublelock -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/sal/qa/rtl/locale/makefile.mk b/sal/qa/rtl/locale/makefile.mk index 329769b5d3ec..d6c9c6b674a3 100644 --- a/sal/qa/rtl/locale/makefile.mk +++ b/sal/qa/rtl/locale/makefile.mk @@ -28,8 +28,6 @@ PRJ=..$/..$/.. PRJNAME=sal TARGET=qa_rtl_locale -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/sal/qa/rtl/math/export.exp b/sal/qa/rtl/math/export.exp deleted file mode 100644 index a13529da5876..000000000000 --- a/sal/qa/rtl/math/export.exp +++ /dev/null @@ -1 +0,0 @@ -registerAllTestFunction diff --git a/sal/qa/rtl/math/makefile.mk b/sal/qa/rtl/math/makefile.mk index 3b35e52ab1f4..59f2ecc495bb 100644 --- a/sal/qa/rtl/math/makefile.mk +++ b/sal/qa/rtl/math/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -23,75 +23,33 @@ # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. # -#************************************************************************* -PRJ=..$/..$/.. -INCPRE+= $(PRJ)$/qa$/inc +#***********************************************************************/ -PRJNAME=sal -TARGET=rtl_math -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -ENABLE_EXCEPTIONS=TRUE +PRJ = ../../.. +PRJNAME = sal +TARGET = qa_rtl_profile -# --- Settings ----------------------------------------------------- +ENABLE_EXCEPTIONS = TRUE -.INCLUDE : settings.mk - -CFLAGS+= $(LFS_CFLAGS) -CXXFLAGS+= $(LFS_CFLAGS) +.INCLUDE: settings.mk CFLAGSCXX += $(CPPUNIT_CFLAGS) -#----------------------------------- OStringBuffer ----------------------------------- - -SHL1OBJS= \ - $(SLO)$/test_rtl_math.obj - -SHL1TARGET= rtl_math -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) - -SHL1IMPLIB= i$(SHL1TARGET) -# SHL1DEF= $(MISC)$/$(SHL1TARGET).def - -DEF1NAME =$(SHL1TARGET) -# DEF1EXPORTFILE= export.exp -SHL1VERSIONMAP = $(PRJ)$/qa$/export.map - -# --- BEGIN -------------------------------------------------------- -SHL2OBJS= \ - $(SLO)$/rtl_math.obj -SHL2TARGET= rtl_math2 -SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) - -SHL2IMPLIB= i$(SHL2TARGET) -DEF2NAME= $(SHL2TARGET) -SHL2VERSIONMAP = $(PRJ)$/qa$/export.map - - - -# # --- BEGIN -------------------------------------------------------- -# LLA: this is an old test, which seems not to work -# sal_setInt64() -# sal_getInt64() -# does not exist. -# -# SHL3OBJS= \ -# $(SLO)$/rtl_old_testint64.obj -# SHL3TARGET= rtl_old_testint64 -# SHL3STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) -# -# SHL3IMPLIB= i$(SHL3TARGET) -# DEF3NAME= $(SHL3TARGET) -# SHL3VERSIONMAP = $(PRJ)$/qa$/export.map -# - -#------------------------------- All object files ------------------------------- -# do this here, so we get right dependencies -# SLOFILES=$(SHL1OBJS) +SHL1IMPLIB = i$(SHL1TARGET) +SHL1OBJS = $(SLO)/test-rtl-math.obj +SHL1RPATH = NONE +SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB) +SHL1TARGET = test-rtl-math +SHL1VERSIONMAP = $(PRJ)/qa/export.map +DEF1NAME = $(SHL1TARGET) -# --- Targets ------------------------------------------------------ +SLOFILES = $(SHL1OBJS) -.INCLUDE : target.mk -.INCLUDE : _cppunit.mk +.INCLUDE: target.mk +.INCLUDE: _cppunit.mk +.END diff --git a/sal/qa/rtl/math/rtl_math.cxx b/sal/qa/rtl/math/rtl_math.cxx deleted file mode 100644 index 653106ce0e30..000000000000 --- a/sal/qa/rtl/math/rtl_math.cxx +++ /dev/null @@ -1,626 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sal.hxx" -#ifdef WIN32 -// LLA: take a look into Microsofts math.h implementation, why this define is need -#define _USE_MATH_DEFINES -#endif - -#include <math.h> -#include <testshl/simpleheader.hxx> -#include <rtl/math.h> -#include <rtl/string.hxx> - -#include "valueequal.hxx" - -namespace rtl_math -{ - -class test : public CppUnit::TestFixture -{ -public: - // initialise your test code values here. - void setUp() - { - } - - void tearDown() - { - } - - - void equalCheck(double _nResult, double _nExpect) /* throws Exception */ - { - bool bEqualResult = is_double_equal(_nResult, _nExpect); - - rtl::OString sError = "rtl_math_round expected result is wrong should:("; - sError += rtl::OString::valueOf(_nExpect); - sError += ") but is:("; - sError += rtl::OString::valueOf(_nResult); - sError += ")"; - - CPPUNIT_ASSERT_MESSAGE(sError.getStr(), bEqualResult == true); - } - - // insert your test code here. - void round_000() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nValue = M_PI; - double nResult = 0.0; - - nResult = rtl_math_round(nValue, 0, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(3.0)); - - nResult = rtl_math_round(nValue, 2, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(3.14)); - - nResult = rtl_math_round(nValue, 3, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(3.142)); - - nResult = rtl_math_round(nValue, 10, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(3.1415926536)); - } - - // insert your test code here. - void round_001_positiv() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(0.2)); - } - - void round_001_negativ() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Corrected); - equalCheck(nResult, double(-0.2)); - } -// ----------------------------------------------------------------------------- - void round_002_positiv() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(0.1)); - } - - void round_002_negativ() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Down); - equalCheck(nResult, double(-0.1)); - } -// ----------------------------------------------------------------------------- - void round_003_positiv() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(0.2)); - } - - void round_003_negativ() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Up); - equalCheck(nResult, double(-0.2)); - } -// ----------------------------------------------------------------------------- - void round_004_positiv() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(0.1)); - } - - void round_004_negativ() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Floor); - equalCheck(nResult, double(-0.2)); - } -// ----------------------------------------------------------------------------- - void round_005_positiv() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(0.2)); - } - - void round_005_negativ() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Ceiling); - equalCheck(nResult, double(-0.1)); - } -// ----------------------------------------------------------------------------- - void round_006_positiv() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(0.2)); - } - - void round_006_negativ() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_HalfDown); - equalCheck(nResult, double(-0.2)); - } -// ----------------------------------------------------------------------------- - void round_007_positiv() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(0.1)); - - nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(0.2)); - - nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(0.2)); - } - - void round_007_negativ() - { - // this is demonstration code - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - - double nResult = 0.0; - - nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(-0.1)); - - nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(-0.2)); - - nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_HalfUp); - equalCheck(nResult, double(-0.2)); - } - - // Change the following lines only, if you add, remove or rename - // member functions of the current class, - // because these macros are need by auto register mechanism. - - CPPUNIT_TEST_SUITE(test); - CPPUNIT_TEST(round_000); - - CPPUNIT_TEST(round_001_positiv); - CPPUNIT_TEST(round_001_negativ); - - CPPUNIT_TEST(round_002_positiv); - CPPUNIT_TEST(round_002_negativ); - - CPPUNIT_TEST(round_003_positiv); - CPPUNIT_TEST(round_003_negativ); - - CPPUNIT_TEST(round_004_positiv); - CPPUNIT_TEST(round_004_negativ); - - CPPUNIT_TEST(round_005_positiv); - CPPUNIT_TEST(round_005_negativ); - - CPPUNIT_TEST(round_006_positiv); - CPPUNIT_TEST(round_006_negativ); - - CPPUNIT_TEST(round_007_positiv); - CPPUNIT_TEST(round_007_negativ); - - CPPUNIT_TEST_SUITE_END(); -}; // class test - -// ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_math::test, "rtl_math"); -} // namespace rtl_math - - -// ----------------------------------------------------------------------------- - -// this macro creates an empty function, which will called by the RegisterAllFunctions() -// to let the user the possibility to also register some functions by hand. -NOADDITIONAL; - diff --git a/sal/qa/rtl/math/rtl_old_testint64.cxx b/sal/qa/rtl/math/rtl_old_testint64.cxx deleted file mode 100644 index e1f30ac03be6..000000000000 --- a/sal/qa/rtl/math/rtl_old_testint64.cxx +++ /dev/null @@ -1,122 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sal.hxx" - -// LLA: -// this file is converted to use with testshl2 -// original was placed in sal/test/textenc.cxx - -// fndef _OSL_DIAGNOSE_H_ -// nclude <osl/diagnose.h> -// #endif - -#include <sal/types.h> - -#define TEST_ENSURE(c, m) CPPUNIT_ASSERT_MESSAGE((m), (c)) - -// #if OSL_DEBUG_LEVEL > 0 -// #define TEST_ENSURE(c, m) OSL_ENSURE(c, m) -// #else -// #define TEST_ENSURE(c, m) OSL_VERIFY(c) -// #endif - -#include <testshl/simpleheader.hxx> - -// ----------------------------------------------------------------------------- -namespace rtl_math -{ - class int64 : public CppUnit::TestFixture - { - public: - void test_int64(); - - CPPUNIT_TEST_SUITE( int64 ); - CPPUNIT_TEST( test_int64 ); - CPPUNIT_TEST_SUITE_END( ); - }; - -void int64::test_int64() -{ -#ifndef SAL_INT64_IS_STRUCT -#ifdef UNX - sal_Int64 i1 = -3223372036854775807LL; - sal_uInt64 u1 = 5223372036854775807ULL; -#else - sal_Int64 i1 = -3223372036854775807; - sal_uInt64 u1 = 5223372036854775807; -#endif - sal_Int64 i2 = 0; - sal_uInt64 u2 = 0; -#else - sal_Int64 i1; - sal_setInt64(&i1, 3965190145L, -750499787L); - - sal_Int64 i2 = { 0, 0 }; - - sal_uInt64 u1; - sal_setUInt64(&u1, 1651507199UL, 1216161073UL); - - sal_uInt64 u2 = {0, 0 }; - -#endif - sal_uInt32 low = 0; - sal_Int32 high = 0; - - sal_getInt64(i1, &low, &high); - sal_setInt64(&i2, low, high); - - sal_uInt32 ulow = 0; - sal_uInt32 uhigh = 0; - - sal_getUInt64(u1, &ulow, &uhigh); - sal_setUInt64(&u2, ulow, uhigh); - -#ifndef SAL_INT64_IS_STRUCT - TEST_ENSURE( i1 == i2, "test_int64 error 1"); - - TEST_ENSURE( u1 == u2, "test_int64 error 2"); -#else - TEST_ENSURE( (i1.Part1 == i2.Part1) && (i1.Part2 == i2.Part2), - "test_int64 error 1"); - - TEST_ENSURE( (u1.Part1 == u2.Part1) && (u1.Part2 == u2.Part2), - "test_int64 error 2"); -#endif - return; -} - -} // namespace rtl_math - -// ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( rtl_math::int64, "rtl_math" ); - -// ----------------------------------------------------------------------------- -NOADDITIONAL; - - diff --git a/sal/qa/rtl/math/test-rtl-math.cxx b/sal/qa/rtl/math/test-rtl-math.cxx new file mode 100644 index 000000000000..8e9875444280 --- /dev/null +++ b/sal/qa/rtl/math/test-rtl-math.cxx @@ -0,0 +1,76 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +#include "precompiled_sal.hxx" +#include "sal/config.h" + +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" +#include "rtl/math.hxx" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" + +namespace { + +class Test: public CppUnit::TestFixture { +public: + void test_stringToDouble_good() { + rtl_math_ConversionStatus status; + sal_Int32 end; + double res = rtl::math::stringToDouble( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" +1.E01foo")), + sal_Unicode('.'), sal_Unicode(','), &status, &end); + CPPUNIT_ASSERT_EQUAL(rtl_math_ConversionStatus_Ok, status); + CPPUNIT_ASSERT_EQUAL(sal_Int32(RTL_CONSTASCII_LENGTH(" +1.E01")), end); + CPPUNIT_ASSERT_EQUAL(10.0, res); + } + + void test_stringToDouble_bad() { + rtl_math_ConversionStatus status; + sal_Int32 end; + double res = rtl::math::stringToDouble( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" +Efoo")), + sal_Unicode('.'), sal_Unicode(','), &status, &end); + CPPUNIT_ASSERT_EQUAL(rtl_math_ConversionStatus_Ok, status); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), end); + CPPUNIT_ASSERT_EQUAL(0.0, res); + } + + CPPUNIT_TEST_SUITE(Test); + CPPUNIT_TEST(test_stringToDouble_good); + CPPUNIT_TEST(test_stringToDouble_bad); + CPPUNIT_TEST_SUITE_END(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(Test); + +} + +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sal/qa/rtl/math/test_rtl_math.cxx b/sal/qa/rtl/math/test_rtl_math.cxx deleted file mode 100644 index 887e3ddd1214..000000000000 --- a/sal/qa/rtl/math/test_rtl_math.cxx +++ /dev/null @@ -1,674 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sal.hxx" - -#include "rtl/math.h" -#include "rtl/math.hxx" -#include "rtl/strbuf.hxx" -#include "rtl/string.h" -#include "rtl/string.hxx" -#include "rtl/textenc.h" -// #include "rtl/tres.h" -#include <testshl/tresstatewrapper.hxx> -#include "rtl/ustring.hxx" -#include "sal/types.h" - -#include <stdlib.h> - -namespace { - -struct FloatTraits -{ - typedef float Number; - - static inline char const * getPrefix() { return "float"; } -}; - -struct DoubleTraits -{ - typedef double Number; - - static inline char const * getPrefix() { return "double"; } -}; - -struct StringTraits -{ - typedef rtl::OString String; - - static inline char const * getPrefix() { return "OString"; } - - static inline rtl::OString createFromAscii(char const * pString) - { return rtl::OString(pString); } - - static inline void appendBuffer(rtl::OStringBuffer & rBuffer, - rtl::OString const & rString) - { rBuffer.append(rString); } - - static inline rtl::OString doubleToString(double fValue, - rtl_math_StringFormat eFormat, - sal_Int32 nDecPlaces, - sal_Char cDecSeparator, - bool bEraseTrailingDecZeros) - { - return rtl::math::doubleToString(fValue, eFormat, nDecPlaces, - cDecSeparator, bEraseTrailingDecZeros); - } -}; - -struct UStringTraits -{ - typedef rtl::OUString String; - - static inline char const * getPrefix() { return "OUString"; } - - static inline rtl::OUString createFromAscii(char const * pString) - { return rtl::OUString::createFromAscii(pString); } - - static inline void appendBuffer(rtl::OStringBuffer & rBuffer, - rtl::OUString const & rString) - { rBuffer.append(rtl::OUStringToOString(rString, RTL_TEXTENCODING_UTF8)); } - - static inline rtl::OUString doubleToString(double fValue, - rtl_math_StringFormat eFormat, - sal_Int32 nDecPlaces, - sal_Unicode cDecSeparator, - bool bEraseTrailingDecZeros) - { - return rtl::math::doubleToUString(fValue, eFormat, nDecPlaces, - cDecSeparator, - bEraseTrailingDecZeros); - } -}; - -struct TestNumberToString -{ - double fValue; - rtl_math_StringFormat eFormat; - sal_Int32 nDecPlaces; - char cDecSeparator; - bool bEraseTrailingDecZeros; - char const * pResult; -}; - -template< typename StringT, typename NumberT > -bool testNumberToString(hTestResult pTestResult, - TestNumberToString const & rTest) -{ - typename NumberT::Number fValue = static_cast< typename NumberT::Number >(rTest.fValue); - if (fValue != rTest.fValue) - return true; - - // LLA: t_print("size: %d ", sizeof(fValue)); - typename StringT::String aResult1; - - aResult1 = StringT::doubleToString(fValue, rTest.eFormat, rTest.nDecPlaces, - rTest.cDecSeparator, - rTest.bEraseTrailingDecZeros); - - typename StringT::String aResult2(StringT::createFromAscii(rTest.pResult)); - - // LLA: rtl::OStringBuffer aBuf; - // LLA: StringT::appendBuffer(aBuf, aResult1); - // LLA: t_print("aResult1: %s ", aBuf.getStr()); - // LLA: - // LLA: rtl::OStringBuffer aBuf2; - // LLA: StringT::appendBuffer(aBuf2, aResult2); - // LLA: t_print("aResult2: %s\n", aBuf2.getStr()); - - bool bSuccess = aResult1 == aResult2; - - rtl::OStringBuffer aBuffer; - aBuffer.append(StringT::getPrefix()); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM("/")); - aBuffer.append(NumberT::getPrefix()); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM(" doubleToString(")); - aBuffer.append(fValue); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", ")); - aBuffer.append(static_cast< sal_Int32 >(rTest.eFormat)); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", ")); - aBuffer.append(rTest.nDecPlaces); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", ")); - aBuffer.append(rTest.cDecSeparator); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", ")); - aBuffer.append(static_cast< sal_Int32 >(rTest.bEraseTrailingDecZeros)); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM("): ")); - StringT::appendBuffer(aBuffer, aResult1); - if (!bSuccess) - { - aBuffer.append(RTL_CONSTASCII_STRINGPARAM(" != ")); - StringT::appendBuffer(aBuffer, aResult2); - } - // call to the real test checker - // pTestResult->pFuncs->state_(pTestResult, bSuccess, "test_rtl_math", - // aBuffer.getStr(), false); - c_rtl_tres_state(pTestResult, bSuccess, aBuffer.getStr(), "testNumberToString"); - return bSuccess; -} - -template< typename StringT, typename NumberT > -bool testNumberToString(hTestResult pTestResult, - TestNumberToString const * pTests, size_t nCount) -{ - bool bSuccess = true; - for (size_t i = 0; i < nCount; ++i) - bSuccess &= testNumberToString< StringT, NumberT >(pTestResult, - pTests[i]); - return bSuccess; -} - -struct TestStringToNumberToString -{ - char const * pValue; - rtl_math_StringFormat eFormat; - sal_Int32 nDecPlaces; - char cDecSeparator; - bool bEraseTrailingDecZeros; - char const * pResult; -}; - -template< typename StringT > -bool testStringToNumberToString(hTestResult pTestResult, - TestStringToNumberToString const & rTest) -{ - double d = rtl::math::stringToDouble(StringT::createFromAscii(rTest.pValue), - rTest.cDecSeparator, 0, 0, 0); - typename StringT::String aResult1( - StringT::doubleToString(d, rTest.eFormat, rTest.nDecPlaces, - rTest.cDecSeparator, - rTest.bEraseTrailingDecZeros)); - typename StringT::String aResult2(StringT::createFromAscii(rTest.pResult)); - bool bSuccess = aResult1 == aResult2; - rtl::OStringBuffer aBuffer; - aBuffer.append(StringT::getPrefix()); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM( - " doubleToString(stringToDouble(")); - aBuffer.append(rTest.pValue); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", ")); - aBuffer.append(rTest.cDecSeparator); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM("), ")); - aBuffer.append(static_cast< sal_Int32 >(rTest.eFormat)); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", ")); - aBuffer.append(rTest.nDecPlaces); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", ")); - aBuffer.append(rTest.cDecSeparator); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", ")); - aBuffer.append(static_cast< sal_Int32 >(rTest.bEraseTrailingDecZeros)); - aBuffer.append(RTL_CONSTASCII_STRINGPARAM("): ")); - StringT::appendBuffer(aBuffer, aResult1); - if (!bSuccess) - { - aBuffer.append(RTL_CONSTASCII_STRINGPARAM(" != ")); - StringT::appendBuffer(aBuffer, aResult2); - } - // call to the real test checker - // pTestResult->pFuncs->state_(pTestResult, bSuccess, "test_rtl_math", - // aBuffer.getStr(), false); - c_rtl_tres_state(pTestResult, bSuccess, aBuffer.getStr(), "testStringToNumberToString"); - - return bSuccess; -} - -template< typename StringT > -bool testStringToNumberToString(hTestResult pTestResult, - TestStringToNumberToString const * pTests, - size_t nCount) -{ - bool bSuccess = true; - for (size_t i = 0; i < nCount; ++i) - bSuccess &= testStringToNumberToString< StringT >(pTestResult, - pTests[i]); - return bSuccess; -} - -} - -extern "C" sal_Bool SAL_CALL test_rtl_math(hTestResult pTestResult) -{ - bool bReturn = true; - - { - static TestNumberToString const aTest[] - = { // 1, 1+2^-1, ..., 1+2^-52 - // Too few decimal digits are printed, so that various different - // double values lead to the same output: - { 1, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1" }, - { 1.5, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.5" }, - { 1.25, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.25" }, - { 1.125, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.125" }, - { 1.0625, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.0625" }, - { 1.03125, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.03125" }, - { 1.015625, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.015625" }, - { 1.0078125, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.0078125" }, - { 1.00390625, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00390625" }, - { 1.001953125, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.001953125" }, - { 1.0009765625, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.0009765625" }, - { 1.00048828125, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00048828125" }, - { 1.000244140625, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.000244140625" }, - { 1.0001220703125, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.0001220703125" }, - { 1.00006103515625, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00006103515625" }, - { 1.000030517578125, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00003051757813" }, - { 1.0000152587890625, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00001525878906" }, - { 1.00000762939453125, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00000762939453" }, - { 1.000003814697265625, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00000381469727" }, - { 1.0000019073486328125, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00000190734863" }, - { 1.00000095367431640625, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00000095367432" }, - { 1.000000476837158203125, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00000047683716" }, - { 1.0000002384185791015625, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00000023841858" }, - { 1.00000011920928955078125, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00000011920929" }, - { 1.000000059604644775390625, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00000005960464" }, - { 1.0000000298023223876953125, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00000002980232" }, - { 1.00000001490116119384765625, rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1.00000001490116" }, - { 1.000000007450580596923828125, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000745058" }, - { 1.0000000037252902984619140625, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000372529" }, - { 1.00000000186264514923095703125, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000186265" }, - { 1.000000000931322574615478515625, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000093132" }, - { 1.0000000004656612873077392578125, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000046566" }, - { 1.00000000023283064365386962890625, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000023283" }, - { 1.000000000116415321826934814453125, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000011642" }, - { 1.0000000000582076609134674072265625, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000005821" }, - { 1.00000000002910383045673370361328125, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.0000000000291" }, - { 1.000000000014551915228366851806640625, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000001455" }, - { 1.0000000000072759576141834259033203125, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000000728" }, - { 1.00000000000363797880709171295166015625, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000000364" }, - { 1.000000000001818989403545856475830078125, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000000182" }, - { 1.0000000000009094947017729282379150390625, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000000091" }, - { 1.00000000000045474735088646411895751953125, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000000045" }, - { 1.000000000000227373675443232059478759765625, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000000023" }, - { 1.0000000000001136868377216160297393798828125, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000000011" }, - { 1.00000000000005684341886080801486968994140625, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000000006" }, - { 1.000000000000028421709430404007434844970703125, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000000003" }, - { 1.0000000000000142108547152020037174224853515625, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000000001" }, - { 1.00000000000000710542735760100185871124267578125, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1.00000000000001" }, - { 1.000000000000003552713678800500929355621337890625, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1" }, - { 1.0000000000000017763568394002504646778106689453125, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1" }, - { 1.00000000000000088817841970012523233890533447265625, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1" }, - { 1.000000000000000444089209850062616169452667236328125, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1" }, - { 1.0000000000000002220446049250313080847263336181640625, - rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, - '.', true, "1" }, - - // 1, 1+2^-1, ..., 1+2^-52 - // Too few decimal digits are printed, so that various different - // double values lead to the same output: - { 1, rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000000000000000000000000000000000000000000000" }, - { 1.5, rtl_math_StringFormat_F, 53, '.', false, - "1.50000000000000000000000000000000000000000000000000000" }, - { 1.25, rtl_math_StringFormat_F, 53, '.', false, - "1.25000000000000000000000000000000000000000000000000000" }, - { 1.125, rtl_math_StringFormat_F, 53, '.', false, - "1.12500000000000000000000000000000000000000000000000000" }, - { 1.0625, rtl_math_StringFormat_F, 53, '.', false, - "1.06250000000000000000000000000000000000000000000000000" }, - { 1.03125, rtl_math_StringFormat_F, 53, '.', false, - "1.03125000000000000000000000000000000000000000000000000" }, - { 1.015625, rtl_math_StringFormat_F, 53, '.', false, - "1.01562500000000000000000000000000000000000000000000000" }, - { 1.0078125, rtl_math_StringFormat_F, 53, '.', false, - "1.00781250000000000000000000000000000000000000000000000" }, - { 1.00390625, rtl_math_StringFormat_F, 53, '.', false, - "1.00390625000000000000000000000000000000000000000000000" }, - { 1.001953125, rtl_math_StringFormat_F, 53, '.', false, - "1.00195312500000000000000000000000000000000000000000000" }, - { 1.0009765625, rtl_math_StringFormat_F, 53, '.', false, - "1.00097656250000000000000000000000000000000000000000000" }, - { 1.00048828125, rtl_math_StringFormat_F, 53, '.', false, - "1.00048828125000000000000000000000000000000000000000000" }, - { 1.000244140625, rtl_math_StringFormat_F, 53, '.', false, - "1.00024414062500000000000000000000000000000000000000000" }, - { 1.0001220703125, rtl_math_StringFormat_F, 53, '.', false, - "1.00012207031250000000000000000000000000000000000000000" }, - { 1.00006103515625, rtl_math_StringFormat_F, 53, '.', false, - "1.00006103515625000000000000000000000000000000000000000" }, - { 1.000030517578125, rtl_math_StringFormat_F, 53, '.', false, - "1.00003051757813000000000000000000000000000000000000000" }, - { 1.0000152587890625, rtl_math_StringFormat_F, 53, '.', false, - "1.00001525878906000000000000000000000000000000000000000" }, - { 1.00000762939453125, rtl_math_StringFormat_F, 53, '.', false, - "1.00000762939453000000000000000000000000000000000000000" }, - { 1.000003814697265625, rtl_math_StringFormat_F, 53, '.', false, - "1.00000381469727000000000000000000000000000000000000000" }, - { 1.0000019073486328125, rtl_math_StringFormat_F, 53, '.', - false, - "1.00000190734863000000000000000000000000000000000000000" }, - { 1.00000095367431640625, rtl_math_StringFormat_F, 53, '.', - false, - "1.00000095367432000000000000000000000000000000000000000" }, - { 1.000000476837158203125, rtl_math_StringFormat_F, 53, '.', - false, - "1.00000047683716000000000000000000000000000000000000000" }, - { 1.0000002384185791015625, rtl_math_StringFormat_F, 53, '.', - false, - "1.00000023841858000000000000000000000000000000000000000" }, - { 1.00000011920928955078125, rtl_math_StringFormat_F, 53, '.', - false, - "1.00000011920929000000000000000000000000000000000000000" }, - { 1.000000059604644775390625, rtl_math_StringFormat_F, 53, '.', - false, - "1.00000005960464000000000000000000000000000000000000000" }, - { 1.0000000298023223876953125, rtl_math_StringFormat_F, 53, '.', - false, - "1.00000002980232000000000000000000000000000000000000000" }, - { 1.00000001490116119384765625, rtl_math_StringFormat_F, 53, - '.', false, - "1.00000001490116000000000000000000000000000000000000000" }, - { 1.000000007450580596923828125, rtl_math_StringFormat_F, 53, - '.', false, - "1.00000000745058000000000000000000000000000000000000000" }, - { 1.0000000037252902984619140625, rtl_math_StringFormat_F, 53, - '.', false, - "1.00000000372529000000000000000000000000000000000000000" }, - { 1.00000000186264514923095703125, rtl_math_StringFormat_F, 53, - '.', false, - "1.00000000186265000000000000000000000000000000000000000" }, - { 1.000000000931322574615478515625, rtl_math_StringFormat_F, 53, - '.', false, - "1.00000000093132000000000000000000000000000000000000000" }, - { 1.0000000004656612873077392578125, rtl_math_StringFormat_F, - 53, '.', false, - "1.00000000046566000000000000000000000000000000000000000" }, - { 1.00000000023283064365386962890625, rtl_math_StringFormat_F, - 53, '.', false, - "1.00000000023283000000000000000000000000000000000000000" }, - { 1.000000000116415321826934814453125, rtl_math_StringFormat_F, - 53, '.', false, - "1.00000000011642000000000000000000000000000000000000000" }, - { 1.0000000000582076609134674072265625, rtl_math_StringFormat_F, - 53, '.', false, - "1.00000000005821000000000000000000000000000000000000000" }, - { 1.00000000002910383045673370361328125, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000002910000000000000000000000000000000000000000" }, - { 1.000000000014551915228366851806640625, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000001455000000000000000000000000000000000000000" }, - { 1.0000000000072759576141834259033203125, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000728000000000000000000000000000000000000000" }, - { 1.00000000000363797880709171295166015625, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000364000000000000000000000000000000000000000" }, - { 1.000000000001818989403545856475830078125, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000182000000000000000000000000000000000000000" }, - { 1.0000000000009094947017729282379150390625, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000091000000000000000000000000000000000000000" }, - { 1.00000000000045474735088646411895751953125, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000045000000000000000000000000000000000000000" }, - { 1.000000000000227373675443232059478759765625, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000023000000000000000000000000000000000000000" }, - { 1.0000000000001136868377216160297393798828125, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000011000000000000000000000000000000000000000" }, - { 1.00000000000005684341886080801486968994140625, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000006000000000000000000000000000000000000000" }, - { 1.000000000000028421709430404007434844970703125, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000003000000000000000000000000000000000000000" }, - { 1.0000000000000142108547152020037174224853515625, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000001000000000000000000000000000000000000000" }, - { 1.00000000000000710542735760100185871124267578125, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000001000000000000000000000000000000000000000" }, - { 1.000000000000003552713678800500929355621337890625, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000000000000000000000000000000000000000000000" }, - { 1.0000000000000017763568394002504646778106689453125, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000000000000000000000000000000000000000000000" }, - { 1.00000000000000088817841970012523233890533447265625, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000000000000000000000000000000000000000000000" }, - { 1.000000000000000444089209850062616169452667236328125, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000000000000000000000000000000000000000000000" }, - { 1.0000000000000002220446049250313080847263336181640625, - rtl_math_StringFormat_F, 53, '.', false, - "1.00000000000000000000000000000000000000000000000000000" } }; - size_t const nCount = sizeof aTest / sizeof aTest[0]; - -//LLA: the float tests are wrong here, due to the fact that -// we calculate with too less digits after the point - -// bReturn &= testNumberToString< StringTraits, FloatTraits >( -// pTestResult, aTest, nCount); - bReturn &= testNumberToString< StringTraits, DoubleTraits >( - pTestResult, aTest, nCount); -// bReturn &= testNumberToString< UStringTraits, FloatTraits >( -// pTestResult, aTest, nCount); - bReturn &= testNumberToString< UStringTraits, DoubleTraits >( - pTestResult, aTest, nCount); - } - - { - static TestStringToNumberToString const aTest[] - = { { "1", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1" }, - { " 1", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1" }, - { " 1", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1" }, - { "\t1", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1" }, - { "\t 1", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1" }, - { " \t1", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "1" }, - - { "-1", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "-1" }, - { " -1", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "-1" }, - { " -1", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "-1" }, - { "\t-1", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "-1" }, - { "\t -1", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "-1" }, - { " \t-1", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true, "-1" }, - - { "1.#INF", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" }, - { " 1.#INF", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" }, - { " 1.#INF", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" }, - { "\t1.#INF", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" }, - { "\t 1.#INF", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" }, - { " \t1.#INF", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" }, - - { "-1.#INF", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" }, - { " -1.#INF", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" }, - { " -1.#INF", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" }, - { "\t-1.#INF", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" }, - { "\t -1.#INF", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" }, - { " \t-1.#INF", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" }, - - { "1.#NAN", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" }, - { " 1.#NAN", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" }, - { " 1.#NAN", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" }, - { "\t1.#NAN", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" }, - { "\t 1.#NAN", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" }, - { " \t1.#NAN", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" }, - - { "-1.#NAN", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" }, - { " -1.#NAN", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" }, - { " -1.#NAN", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" }, - { "\t-1.#NAN", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" }, - { "\t -1.#NAN", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" }, - { " \t-1.#NAN", rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" }, - - { "3.14E-2000", rtl_math_StringFormat_E, 4, '.', false, - "0.0000E+000" }, - { "3.14E-200", rtl_math_StringFormat_E, 4, '.', false, - "3.1400E-200" }, - { "3.14E-20", rtl_math_StringFormat_E, 4, '.', false, - "3.1400E-020" }, - { "3.14E-2", rtl_math_StringFormat_E, 4, '.', false, - "3.1400E-002" }, - { "3.14E2", rtl_math_StringFormat_E, 4, '.', false, - "3.1400E+002" }, - { "3.14E20", rtl_math_StringFormat_E, 4, '.', false, - "3.1400E+020" }, - { "3.14E200", rtl_math_StringFormat_E, 4, '.', false, - "3.1400E+200" }, - { "3.14E2000", rtl_math_StringFormat_E, 4, '.', false, - "1.#INF" }, - }; - size_t const nCount = sizeof aTest / sizeof aTest[0]; - bReturn &= testStringToNumberToString< StringTraits >( - pTestResult, aTest, nCount); - bReturn &= testStringToNumberToString< UStringTraits >( - pTestResult, aTest, nCount); - } - - return bReturn; -} - -// ----------------------------------------------------------------------------- -extern "C" void /* sal_Bool */ SAL_CALL test_rtl_math2( hTestResult hRtlTestResult ) -{ - c_rtl_tres_state_start(hRtlTestResult, "rtl_math" ); - - test_rtl_math( hRtlTestResult ); - - c_rtl_tres_state_end(hRtlTestResult, "rtl_math" ); -} -// ----------------------------------------------------------------------------- -void RegisterAdditionalFunctions(FktRegFuncPtr _pFunc) -{ - if (_pFunc) - { - (_pFunc)(&test_rtl_math2, ""); - } -} diff --git a/sal/qa/rtl/random/makefile.mk b/sal/qa/rtl/random/makefile.mk index cd57ec9bcc13..ef8616a90916 100644 --- a/sal/qa/rtl/random/makefile.mk +++ b/sal/qa/rtl/random/makefile.mk @@ -28,8 +28,6 @@ PRJ=..$/..$/.. PRJNAME=sal TARGET=qa_rtl_random -# this is removed at the moment because we need some enhancements -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/sal/qa/rtl_strings/makefile.mk b/sal/qa/rtl_strings/makefile.mk index 387f0675ace8..708a41a87887 100644 --- a/sal/qa/rtl_strings/makefile.mk +++ b/sal/qa/rtl_strings/makefile.mk @@ -28,7 +28,6 @@ PRJ=..$/.. PRJNAME=sal TARGET=qa_rtl_strings -# TESTDIR=TRUE ENABLE_EXCEPTIONS=TRUE diff --git a/sal/rtl/source/math.cxx b/sal/rtl/source/math.cxx index d983c5726230..34b940a301c9 100644 --- a/sal/rtl/source/math.cxx +++ b/sal/rtl/source/math.cxx @@ -923,7 +923,7 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd, if (pStatus != 0) *pStatus = eStatus; if (pParsedEnd != 0) - *pParsedEnd = p; + *pParsedEnd = p == p0 ? pBegin : p; return fVal; } diff --git a/sal/systools/win32/kill/kill.cxx b/sal/systools/win32/kill/kill.cxx index dd7ae85a0af2..ec1379ccfa6b 100644 --- a/sal/systools/win32/kill/kill.cxx +++ b/sal/systools/win32/kill/kill.cxx @@ -272,7 +272,7 @@ static void ParseCommandArgs( LPDWORD lpProcesses, LPDWORD lpdwNumProcesses, int { for ( int n = 0; n < NumSupportedSignals; n++ ) { - _tprintf( _T("%s "), SupportedSignals[n] ); + _tprintf( _T("%s "), SupportedSignals[n].lpSignalName ); } _tprintf( _T("\n") ); ExitProcess( 0 ); diff --git a/sal/textenc/convertiscii.tab b/sal/textenc/convertiscii.tab index 60672b8c0188..96f5dc8582c5 100644 --- a/sal/textenc/convertiscii.tab +++ b/sal/textenc/convertiscii.tab @@ -108,5 +108,5 @@ static ImplTextEncodingData const aImplIsciiDevanagariTextEncodingData 1, 1, NULL, - NULL, + "x-iscii-de", RTL_TEXTENCODING_INFO_ASCII }; diff --git a/sal/textenc/tencinfo.c b/sal/textenc/tencinfo.c index 0c51a98206e5..30a2fef0da72 100644 --- a/sal/textenc/tencinfo.c +++ b/sal/textenc/tencinfo.c @@ -910,6 +910,9 @@ rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromMimeCharset( const sal_Char* pM { "csptcp154", RTL_TEXTENCODING_PT154 }, { "pt154", RTL_TEXTENCODING_PT154 }, { "cp154", RTL_TEXTENCODING_PT154 }, + { "xisciide", RTL_TEXTENCODING_ISCII_DEVANAGARI }, + /* This is no official MIME character set name, but is in use by + various windows APIs. */ { NULL, RTL_TEXTENCODING_DONTKNOW } }; @@ -1072,6 +1075,7 @@ rtl_getTextEncodingFromWindowsCodePage(sal_uInt32 nCodePage) case 51932: return RTL_TEXTENCODING_EUC_JP; case 51936: return RTL_TEXTENCODING_EUC_CN; case 51949: return RTL_TEXTENCODING_EUC_KR; + case 57002: return RTL_TEXTENCODING_ISCII_DEVANAGARI; case 65000: return RTL_TEXTENCODING_UTF7; case 65001: return RTL_TEXTENCODING_UTF8; default: return RTL_TEXTENCODING_DONTKNOW; @@ -1147,6 +1151,7 @@ rtl_getWindowsCodePageFromTextEncoding(rtl_TextEncoding nEncoding) case RTL_TEXTENCODING_EUC_JP: return 51932; case RTL_TEXTENCODING_EUC_CN: return 51936; case RTL_TEXTENCODING_EUC_KR: return 51949; + case RTL_TEXTENCODING_ISCII_DEVANAGARI: return 57002; case RTL_TEXTENCODING_UTF7: return 65000; case RTL_TEXTENCODING_UTF8: return 65001; default: return 0; diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index 2faf13fd159c..cbb49c162fe1 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -1153,36 +1153,24 @@ static void prepareRegistry( { // update entries in SERVICES section Sequence< Reference < XRegistryKey > > serviceKeys = xKey->openKeys(); - OUString implName; + const Reference < XRegistryKey > * pServiceKeys = serviceKeys.getConstArray(); - if (serviceKeys.getLength()) - { - const Reference < XRegistryKey > * pServiceKeys = serviceKeys.getConstArray(); - - implName = OUString(xImplKey->getKeyName().getStr() + 1); - sal_Int32 firstDot = implName.indexOf('/'); - - if (firstDot >= 0) - implName = implName.copy(firstDot + 1); - - sal_Int32 offset = xKey->getKeyName().getLength() + 1; + OUString implName = OUString(xImplKey->getKeyName().getStr() + 1); + sal_Int32 firstDot = implName.indexOf('/'); - for (sal_Int32 j = 0; j < serviceKeys.getLength(); j++) - { - OUString serviceName = pServiceKeys[j]->getKeyName().copy(offset); + if (firstDot >= 0) + implName = implName.copy(firstDot + 1); - createUniqueSubEntry( - xDest->getRootKey()->createKey( - pool.slash_SERVICES + serviceName ), - implName); - } + sal_Int32 offset = xKey->getKeyName().getLength() + 1; - } - else + for (sal_Int32 j = 0; j < serviceKeys.getLength(); j++) { - throw InvalidRegistryException( - OUString( RTL_CONSTASCII_USTRINGPARAM( "prepareRegistry(): no service names given by component" ) ), - Reference< XInterface > () ); + OUString serviceName = pServiceKeys[j]->getKeyName().copy(offset); + + createUniqueSubEntry( + xDest->getRootKey()->createKey( + pool.slash_SERVICES + serviceName ), + implName); } xKey = xImplKey->openKey( pool.slash_UNO ); @@ -1205,38 +1193,38 @@ static void prepareRegistry( } } } + } - // update LOCATION entry - xKey = xImplKey->createKey( pool.slash_UNO_slash_LOCATION ); + // update LOCATION entry + xKey = xImplKey->createKey( pool.slash_UNO_slash_LOCATION ); - if (xKey.is()) - { - xKey->setAsciiValue(locationUrl); - } + if (xKey.is()) + { + xKey->setAsciiValue(locationUrl); + } - // update ACTIVATOR entry - xKey = xImplKey->createKey( pool.slash_UNO_slash_ACTIVATOR ); + // update ACTIVATOR entry + xKey = xImplKey->createKey( pool.slash_UNO_slash_ACTIVATOR ); - if (xKey.is()) - { - xKey->setAsciiValue(implementationLoaderUrl); - } + if (xKey.is()) + { + xKey->setAsciiValue(implementationLoaderUrl); + } - xKey = xImplKey->openKey( pool.slash_UNO_slash_SERVICES ); + xKey = xImplKey->openKey( pool.slash_UNO_slash_SERVICES ); + + if (xKey.is() && (xKey->getValueType() == RegistryValueType_ASCIILIST)) + { + // update link entries in REGISTRY_LINKS section + Sequence<OUString> linkNames = xKey->getAsciiListValue(); - if (xKey.is() && (xKey->getValueType() == RegistryValueType_ASCIILIST)) + if (linkNames.getLength()) { - // update link entries in REGISTRY_LINKS section - Sequence<OUString> linkNames = xKey->getAsciiListValue(); + const OUString* pLinkNames = linkNames.getConstArray(); - if (linkNames.getLength()) + for (sal_Int32 j = 0; j < linkNames.getLength(); j++) { - const OUString* pLinkNames = linkNames.getConstArray(); - - for (sal_Int32 j = 0; j < linkNames.getLength(); j++) - { - prepareLink(xDest, xImplKey, pLinkNames[j]); - } + prepareLink(xDest, xImplKey, pLinkNames[j]); } } } diff --git a/stoc/source/registry_tdprovider/tdprovider.cxx b/stoc/source/registry_tdprovider/tdprovider.cxx index 1d62657beba9..2cf26706993c 100644 --- a/stoc/source/registry_tdprovider/tdprovider.cxx +++ b/stoc/source/registry_tdprovider/tdprovider.cxx @@ -172,6 +172,8 @@ public: virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); // XHierarchicalNameAccess + Any getByHierarchicalNameImpl( const OUString & rName ); + virtual Any SAL_CALL getByHierarchicalName( const OUString & rName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); virtual sal_Bool SAL_CALL hasByHierarchicalName( const OUString & rName ) throw(::com::sun::star::uno::RuntimeException); @@ -223,14 +225,7 @@ Any ProviderImpl::TypeDescriptionManagerWrapper::getByHierarchicalName( sal_Bool ProviderImpl::TypeDescriptionManagerWrapper::hasByHierarchicalName( OUString const & name ) throw (RuntimeException) { - try - { - return getByHierarchicalName( name ).hasValue(); - } - catch (container::NoSuchElementException &) - { - return false; - } + return m_xTDMgr->hasByHierarchicalName( name ) || m_xThisProvider->hasByHierarchicalName( name ); } //______________________________________________________________________________ @@ -344,8 +339,7 @@ Sequence< OUString > ProviderImpl::getSupportedServiceNames() // XHierarchicalNameAccess //__________________________________________________________________________________________________ -Any SAL_CALL ProviderImpl::getByHierarchicalName( const OUString & rName ) - throw(::com::sun::star::uno::RuntimeException, com::sun::star::container::NoSuchElementException) +Any ProviderImpl::getByHierarchicalNameImpl( const OUString & rName ) { Any aRet; @@ -432,7 +426,17 @@ Any SAL_CALL ProviderImpl::getByHierarchicalName( const OUString & rName ) // Don't stop iteration in this case. } + catch ( NoSuchElementException const & ) + { + } } + return aRet; +} + +Any SAL_CALL ProviderImpl::getByHierarchicalName( const OUString & rName ) + throw(::com::sun::star::uno::RuntimeException, com::sun::star::container::NoSuchElementException) +{ + Any aRet( getByHierarchicalNameImpl( rName ) ); if ( !aRet.hasValue() ) throw NoSuchElementException( @@ -445,14 +449,7 @@ Any SAL_CALL ProviderImpl::getByHierarchicalName( const OUString & rName ) sal_Bool ProviderImpl::hasByHierarchicalName( const OUString & rName ) throw(::com::sun::star::uno::RuntimeException) { - try - { - return getByHierarchicalName( rName ).hasValue(); - } - catch (NoSuchElementException &) - { - } - return sal_False; + return getByHierarchicalNameImpl( rName ).hasValue(); } // XTypeDescriptionEnumerationAccess diff --git a/stoc/source/simpleregistry/textualservices.cxx b/stoc/source/simpleregistry/textualservices.cxx index 932c639124d0..5a50a5aa62c6 100644 --- a/stoc/source/simpleregistry/textualservices.cxx +++ b/stoc/source/simpleregistry/textualservices.cxx @@ -41,8 +41,10 @@ #include "com/sun/star/uno/XInterface.hpp" #include "cppuhelper/implbase1.hxx" #include "osl/diagnose.h" +#include "rtl/malformeduriexception.hxx" #include "rtl/ref.hxx" #include "rtl/string.h" +#include "rtl/uri.hxx" #include "rtl/ustrbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" @@ -306,6 +308,16 @@ void Parser::handleComponent() { ": <component> is missing \"loader\" attribute"))), css::uno::Reference< css::uno::XInterface >()); } + try { + attrUri_ = rtl::Uri::convertRelToAbs(reader_.getUrl(), attrUri_); + } catch (rtl::MalformedUriException & e) { + throw css::registry::InvalidRegistryException( + (reader_.getUrl() + + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM(": bad \"uri\" attribute: ")) + + e.getMessage()), + css::uno::Reference< css::uno::XInterface >()); + } } void Parser::handleImplementation() { diff --git a/udkapi/com/sun/star/script/XDirectInvocation.idl b/udkapi/com/sun/star/script/XDirectInvocation.idl new file mode 100644 index 000000000000..8a37c47dd781 --- /dev/null +++ b/udkapi/com/sun/star/script/XDirectInvocation.idl @@ -0,0 +1,82 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_script_XDirectInvocation_idl__ +#define __com_sun_star_script_XDirectInvocation_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ +#include <com/sun/star/lang/IllegalArgumentException.idl> +#endif + +#ifndef __com_sun_star_script_CannotConvertException_idl__ +#include <com/sun/star/script/CannotConvertException.idl> +#endif + +#ifndef __com_sun_star_reflection_InvocationTargetException_idl__ +#include <com/sun/star/reflection/InvocationTargetException.idl> +#endif + +#ifndef __com_sun_star_beans_UnknownPropertyException_idl__ +#include <com/sun/star/beans/UnknownPropertyException.idl> +#endif + + +//============================================================================= + + module com { module sun { module star { module script { + +//============================================================================= +/** provides access to an object's methods and properties. + */ +published interface XDirectInvocation: com::sun::star::uno::XInterface +{ + //------------------------------------------------------------------------- + /** provides access to methods and properties exposed by an object. + + @param aParams all parameters, out parameters are not supported + */ + any directInvoke( [in] string aName, + [in] sequence<any> aParams ) + raises( com::sun::star::lang::IllegalArgumentException, + com::sun::star::script::CannotConvertException, + com::sun::star::reflection::InvocationTargetException ); + + //------------------------------------------------------------------------- + /** returns <TRUE/> if the method or property with the specified name exists, else <FALSE/>. + */ + boolean hasMember( [in] string aName ); +}; + +//============================================================================= + +}; }; }; }; + +#endif + diff --git a/udkapi/com/sun/star/script/makefile.mk b/udkapi/com/sun/star/script/makefile.mk index 32aa58fefa6d..c457b4a78657 100644 --- a/udkapi/com/sun/star/script/makefile.mk +++ b/udkapi/com/sun/star/script/makefile.mk @@ -60,6 +60,7 @@ IDLFILES=\ XAllListener.idl\ XAllListenerAdapterService.idl\ XDebugging.idl\ + XDirectInvocation.idl\ XEngine.idl\ XEngineListener.idl\ XEventAttacher.idl\ diff --git a/ure/prj/build.lst b/ure/prj/build.lst index 7d3e23edc058..1f9b694ed554 100644 --- a/ure/prj/build.lst +++ b/ure/prj/build.lst @@ -1,2 +1,2 @@ -ur ure : cli_ure io javaunohelper remotebridges solenv stoc NULL +ur ure : LIBXSLT:libxslt cli_ure io javaunohelper remotebridges solenv stoc NULL ur ure\source nmake - all ur_source NULL diff --git a/xmlreader/inc/xmlreader/README b/xmlreader/inc/xmlreader/README new file mode 100644 index 000000000000..cf238a695c61 --- /dev/null +++ b/xmlreader/inc/xmlreader/README @@ -0,0 +1,34 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#***********************************************************************/ + +<http://qa.openoffice.org/issues/show_bug.cgi?id=115203>: "Issue 113189 +extracted xmlreader from configmgr, to make the former available within URE. +The xmlreader library is for now considered a private part of URE (cf. +ure/source/README), for simplicity uses OOO_DLLPUBLIC_XMLREADER-based symbol +visibility (and thus no symbol versioning), but is of course used from outside +URE in configmgr. This works as long as its ABI does not change. If it ever +changes, symbol versioning will have to be added (in some form or other)." |