This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO42X by this push:
new d75c37a Fixed mixed style (space/tabs) in indentation
d75c37a is described below
commit d75c37ae50f762fb7bf77ac564316a95b739a869
Author: mseidel <[email protected]>
AuthorDate: Wed Sep 1 16:29:22 2021 +0200
Fixed mixed style (space/tabs) in indentation
(cherry picked from commit b9a4ae0fa8e1446f2d3d30226e5244245afa6a63)
---
.../source/eventattachermgr/eventattachermgr.cxx | 1246 ++++++++++----------
main/comphelper/source/misc/mediadescriptor.cxx | 871 +++++++-------
.../source/property/ChainablePropertySet.cxx | 88 +-
main/comphelper/source/streaming/memorystream.cxx | 84 +-
.../source/streaming/otransactedfilestream.cxx | 21 +-
.../source/streaming/seqinputstreamserv.cxx | 202 ++--
6 files changed, 1254 insertions(+), 1258 deletions(-)
diff --git a/main/comphelper/source/eventattachermgr/eventattachermgr.cxx
b/main/comphelper/source/eventattachermgr/eventattachermgr.cxx
index f33c10b..c34b3a0 100644
--- a/main/comphelper/source/eventattachermgr/eventattachermgr.cxx
+++ b/main/comphelper/source/eventattachermgr/eventattachermgr.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -26,7 +26,7 @@
#include <deque>
-#if defined( OS2 ) || defined( UNX )
+#if defined( OS2 ) || defined( UNX )
#include <wchar.h>
#endif
#include <osl/mutex.hxx>
@@ -71,102 +71,102 @@ namespace comphelper
//-----------------------------------------------------------------------------
struct AttachedObject_Impl
{
- Reference< XInterface > xTarget;
- Sequence< Reference< XEventListener > > aAttachedListenerSeq;
- Any aHelper;
+ Reference< XInterface > xTarget;
+ Sequence< Reference< XEventListener > > aAttachedListenerSeq;
+ Any
aHelper;
- bool operator<( const AttachedObject_Impl & ) const;
- bool operator==( const AttachedObject_Impl & ) const;
+ bool operator<( const AttachedObject_Impl & ) const;
+ bool operator==( const AttachedObject_Impl & ) const;
};
struct AttacherIndex_Impl
{
#ifdef DEQUE_OK
- ::std::deque< ScriptEventDescriptor > aEventList;
+ ::std::deque< ScriptEventDescriptor > aEventList;
#else
- Sequence< ScriptEventDescriptor > aEventList;
+ Sequence< ScriptEventDescriptor > aEventList;
#endif
- ::std::deque< AttachedObject_Impl > aObjList;
+ ::std::deque< AttachedObject_Impl > aObjList;
- bool operator<( const AttacherIndex_Impl & ) const;
- bool operator==( const AttacherIndex_Impl & ) const;
+ bool operator<( const AttacherIndex_Impl & ) const;
+ bool operator==( const AttacherIndex_Impl & ) const;
};
#if 0
bool AttachedObject_Impl::operator<( const AttachedObject_Impl & r ) const
{
- VOS_ENSHURE( FALSE, "not implemented" );
- return FALSE;
- return this < &r;
+ VOS_ENSHURE( FALSE, "not implemented" );
+ return FALSE;
+ return this < &r;
}
bool AttachedObject_Impl::operator==( const AttachedObject_Impl & r ) const
{
- VOS_ENSHURE( FALSE, "not implemented" );
- return this == &r;
+ VOS_ENSHURE( FALSE, "not implemented" );
+ return this == &r;
}
bool AttacherIndex_Impl::operator<( const AttacherIndex_Impl & r ) const
{
- VOS_ENSHURE( FALSE, "not implemented" );
- return this < &r;
+ VOS_ENSHURE( FALSE, "not implemented" );
+ return this < &r;
}
bool AttacherIndex_Impl::operator==( const AttacherIndex_Impl & r ) const
{
- VOS_ENSHURE( FALSE, "not implemented" );
- return this == &r;
+ VOS_ENSHURE( FALSE, "not implemented" );
+ return this == &r;
}
#endif
//-----------------------------------------------------------------------------
class ImplEventAttacherManager
- : public WeakImplHelper2< XEventAttacherManager, XPersistObject >
+ : public WeakImplHelper2< XEventAttacherManager, XPersistObject >
{
- friend class AttacherAllListener_Impl;
- ::std::deque< AttacherIndex_Impl > aIndex;
- Mutex aLock;
- // Container fuer die ScriptListener
- OInterfaceContainerHelper aScriptListeners;
- // EventAttacher-Instanz
- Reference< XEventAttacher > xAttacher;
+ friend class AttacherAllListener_Impl;
+ ::std::deque< AttacherIndex_Impl > aIndex;
+ Mutex aLock;
+ // Container fuer die ScriptListener
+ OInterfaceContainerHelper aScriptListeners;
+ // EventAttacher-Instanz
+ Reference< XEventAttacher > xAttacher;
Reference< XMultiServiceFactory > mxSMgr;
Reference< XIdlReflection > mxCoreReflection;
- Reference< XIntrospection > mxIntrospection;
- Reference< XTypeConverter > xConverter;
- sal_Int16 nVersion;
+ Reference< XIntrospection > mxIntrospection;
+ Reference< XTypeConverter > xConverter;
+ sal_Int16
nVersion;
public:
- ImplEventAttacherManager( const Reference< XIntrospection > &
rIntrospection,
+ ImplEventAttacherManager( const Reference< XIntrospection > &
rIntrospection,
const Reference<
XMultiServiceFactory > rSMgr );
- ~ImplEventAttacherManager();
-
- // Methoden von XEventAttacherManager
- virtual void SAL_CALL registerScriptEvent(sal_Int32 Index, const
ScriptEventDescriptor& ScriptEvent)
- throw( IllegalArgumentException, RuntimeException );
- virtual void SAL_CALL registerScriptEvents(sal_Int32 Index, const
Sequence< ScriptEventDescriptor >& ScriptEvents)
- throw( IllegalArgumentException, RuntimeException );
- virtual void SAL_CALL revokeScriptEvent(sal_Int32 Index, const OUString&
ListenerType, const OUString& EventMethod, const OUString& removeListenerParam)
- throw( IllegalArgumentException, RuntimeException );
- virtual void SAL_CALL revokeScriptEvents(sal_Int32 Index)
- throw( IllegalArgumentException, RuntimeException );
- virtual void SAL_CALL insertEntry(sal_Int32 Index)
- throw( IllegalArgumentException, RuntimeException );
- virtual void SAL_CALL removeEntry(sal_Int32 Index)
- throw( IllegalArgumentException, RuntimeException );
- virtual Sequence< ScriptEventDescriptor > SAL_CALL
getScriptEvents(sal_Int32 Index)
- throw( IllegalArgumentException, RuntimeException );
- virtual void SAL_CALL attach(sal_Int32 Index, const Reference< XInterface
>& Object, const Any& Helper)
- throw( IllegalArgumentException, ServiceNotRegisteredException,
RuntimeException );
- virtual void SAL_CALL detach(sal_Int32 nIndex, const Reference< XInterface
>& xObject)
- throw( IllegalArgumentException, RuntimeException );
- virtual void SAL_CALL addScriptListener(const Reference< XScriptListener
>& aListener)
- throw( IllegalArgumentException, RuntimeException );
- virtual void SAL_CALL removeScriptListener(const Reference<
XScriptListener >& Listener)
- throw( IllegalArgumentException, RuntimeException );
-
- // Methoden von XPersistObject
- virtual OUString SAL_CALL getServiceName(void) throw( RuntimeException );
- virtual void SAL_CALL write(const Reference< XObjectOutputStream >&
OutStream) throw( IOException, RuntimeException );
- virtual void SAL_CALL read(const Reference< XObjectInputStream >&
InStream) throw( IOException, RuntimeException );
+ ~ImplEventAttacherManager();
+
+ // Methoden von XEventAttacherManager
+ virtual void SAL_CALL registerScriptEvent(sal_Int32 Index, const
ScriptEventDescriptor& ScriptEvent)
+ throw( IllegalArgumentException, RuntimeException );
+ virtual void SAL_CALL registerScriptEvents(sal_Int32 Index, const
Sequence< ScriptEventDescriptor >& ScriptEvents)
+ throw( IllegalArgumentException, RuntimeException );
+ virtual void SAL_CALL revokeScriptEvent(sal_Int32 Index, const
OUString& ListenerType, const OUString& EventMethod, const OUString&
removeListenerParam)
+ throw( IllegalArgumentException, RuntimeException );
+ virtual void SAL_CALL revokeScriptEvents(sal_Int32 Index)
+ throw( IllegalArgumentException, RuntimeException );
+ virtual void SAL_CALL insertEntry(sal_Int32 Index)
+ throw( IllegalArgumentException, RuntimeException );
+ virtual void SAL_CALL removeEntry(sal_Int32 Index)
+ throw( IllegalArgumentException, RuntimeException );
+ virtual Sequence< ScriptEventDescriptor > SAL_CALL
getScriptEvents(sal_Int32 Index)
+ throw( IllegalArgumentException, RuntimeException );
+ virtual void SAL_CALL attach(sal_Int32 Index, const Reference<
XInterface >& Object, const Any& Helper)
+ throw( IllegalArgumentException, ServiceNotRegisteredException,
RuntimeException );
+ virtual void SAL_CALL detach(sal_Int32 nIndex, const Reference<
XInterface >& xObject)
+ throw( IllegalArgumentException, RuntimeException );
+ virtual void SAL_CALL addScriptListener(const Reference<
XScriptListener >& aListener)
+ throw( IllegalArgumentException, RuntimeException );
+ virtual void SAL_CALL removeScriptListener(const Reference<
XScriptListener >& Listener)
+ throw( IllegalArgumentException, RuntimeException );
+
+ // Methoden von XPersistObject
+ virtual OUString SAL_CALL getServiceName(void) throw( RuntimeException
);
+ virtual void SAL_CALL write(const Reference< XObjectOutputStream >&
OutStream) throw( IOException, RuntimeException );
+ virtual void SAL_CALL read(const Reference< XObjectInputStream >&
InStream) throw( IOException, RuntimeException );
private:
Reference< XIdlReflection > getReflection() throw( Exception );
@@ -188,38 +188,38 @@ private:
// nur einzelne Events an einen allgemeinen AllListener weiterleitet
class AttacherAllListener_Impl : public WeakImplHelper1< XAllListener >
{
- ImplEventAttacherManager* mpManager;
- Reference< XEventAttacherManager > xManager;
- OUString aScriptType;
- OUString aScriptCode;
- sal_Int16 nVersion;
-
- void convertToEventReturn( Any & rRet, const Type & rRetType )
- throw( CannotConvertException );
+ ImplEventAttacherManager* mpManager;
+ Reference< XEventAttacherManager > xManager;
+ OUString
aScriptType;
+ OUString
aScriptCode;
+ sal_Int16
nVersion;
+
+ void convertToEventReturn( Any & rRet, const Type & rRetType )
+ throw( CannotConvertException );
public:
- AttacherAllListener_Impl( ImplEventAttacherManager* pManager_, const
OUString &rScriptType_,
- const OUString & rScriptCode_ );
+ AttacherAllListener_Impl( ImplEventAttacherManager* pManager_, const
OUString &rScriptType_,
+ const OUString
& rScriptCode_ );
- // Methoden von XAllListener
- virtual void SAL_CALL firing(const AllEventObject& Event) throw(
RuntimeException );
- virtual Any SAL_CALL approveFiring(const AllEventObject& Event) throw(
InvocationTargetException, RuntimeException );
+ // Methoden von XAllListener
+ virtual void SAL_CALL firing(const AllEventObject& Event) throw(
RuntimeException );
+ virtual Any SAL_CALL approveFiring(const AllEventObject& Event) throw(
InvocationTargetException, RuntimeException );
- // Methoden von XEventListener
- virtual void SAL_CALL disposing(const EventObject& Source) throw(
RuntimeException );
+ // Methoden von XEventListener
+ virtual void SAL_CALL disposing(const EventObject& Source) throw(
RuntimeException );
};
//========================================================================
AttacherAllListener_Impl::AttacherAllListener_Impl
(
- ImplEventAttacherManager* pManager_,
- const OUString & rScriptType_,
- const OUString & rScriptCode_
+ ImplEventAttacherManager* pManager_,
+ const OUString & rScriptType_,
+ const OUString & rScriptCode_
)
- : mpManager( pManager_ )
- , xManager( pManager_ )
- , aScriptType( rScriptType_ )
- , aScriptCode( rScriptCode_ )
- , nVersion( 2 )
+ : mpManager( pManager_ )
+ , xManager( pManager_ )
+ , aScriptType( rScriptType_ )
+ , aScriptCode( rScriptCode_ )
+ , nVersion( 2 )
{
}
@@ -227,163 +227,163 @@ AttacherAllListener_Impl::AttacherAllListener_Impl
//========================================================================
// Methoden von XAllListener
void SAL_CALL AttacherAllListener_Impl::firing(const AllEventObject& Event)
- throw( RuntimeException )
+ throw( RuntimeException )
{
- ScriptEvent aScriptEvent;
- aScriptEvent.Source = (OWeakObject *)mpManager; // get correct
XInterface
- aScriptEvent.ListenerType = Event.ListenerType;
- aScriptEvent.MethodName = Event.MethodName;
- aScriptEvent.Arguments = Event.Arguments;
- aScriptEvent.Helper = Event.Helper;
- aScriptEvent.ScriptType = aScriptType;
- aScriptEvent.ScriptCode = aScriptCode;
-
- // ueber alle Listener iterieren und Events senden
- OInterfaceIteratorHelper aIt( mpManager->aScriptListeners );
- while( aIt.hasMoreElements() )
- ((XScriptListener *)aIt.next())->firing( aScriptEvent );
+ ScriptEvent aScriptEvent;
+ aScriptEvent.Source = (OWeakObject *)mpManager; //
get correct XInterface
+ aScriptEvent.ListenerType = Event.ListenerType;
+ aScriptEvent.MethodName = Event.MethodName;
+ aScriptEvent.Arguments = Event.Arguments;
+ aScriptEvent.Helper = Event.Helper;
+ aScriptEvent.ScriptType = aScriptType;
+ aScriptEvent.ScriptCode = aScriptCode;
+
+ // ueber alle Listener iterieren und Events senden
+ OInterfaceIteratorHelper aIt( mpManager->aScriptListeners );
+ while( aIt.hasMoreElements() )
+ ((XScriptListener *)aIt.next())->firing( aScriptEvent );
}
//========================================================================
// Convert to the standard event return
void AttacherAllListener_Impl::convertToEventReturn( Any & rRet, const Type &
rRetType )
- throw( CannotConvertException )
+ throw( CannotConvertException )
{
- // no return value? Set to the specified values
- if( rRet.getValueType().getTypeClass() == TypeClass_VOID )
- {
- switch( rRetType.getTypeClass() )
- {
- case TypeClass_INTERFACE:
- {
- rRet <<= Reference< XInterface >();
- }
- break;
-
- case TypeClass_BOOLEAN:
- rRet <<= sal_True;
- break;
-
- case TypeClass_STRING:
- rRet <<= OUString();
- break;
-
- case TypeClass_FLOAT: rRet <<= float(0); break;
- case TypeClass_DOUBLE: rRet <<= double(0.0); break;
- case TypeClass_BYTE: rRet <<= sal_uInt8(0); break;
+ // no return value? Set to the specified values
+ if( rRet.getValueType().getTypeClass() == TypeClass_VOID )
+ {
+ switch( rRetType.getTypeClass() )
+ {
+ case TypeClass_INTERFACE:
+ {
+ rRet <<= Reference< XInterface >();
+ }
+ break;
+
+ case TypeClass_BOOLEAN:
+ rRet <<= sal_True;
+ break;
+
+ case TypeClass_STRING:
+ rRet <<= OUString();
+ break;
+
+ case TypeClass_FLOAT: rRet <<=
float(0); break;
+ case TypeClass_DOUBLE: rRet <<=
double(0.0); break;
+ case TypeClass_BYTE: rRet <<=
sal_uInt8(0); break;
case TypeClass_SHORT: rRet <<=
sal_Int16( 0 ); break;
case TypeClass_LONG: rRet <<=
sal_Int32( 0 ); break;
case TypeClass_UNSIGNED_SHORT: rRet <<= sal_uInt16( 0
); break;
case TypeClass_UNSIGNED_LONG: rRet <<= sal_uInt32( 0
); break;
- default:
- OSL_ASSERT(false);
- break;
- }
- }
- else if( !rRet.getValueType().equals( rRetType ) )
- {
- if( mpManager->xConverter.is() )
- rRet = mpManager->xConverter->convertTo( rRet, rRetType );
- else
- throw CannotConvertException();
- }
+ default:
+ OSL_ASSERT(false);
+ break;
+ }
+ }
+ else if( !rRet.getValueType().equals( rRetType ) )
+ {
+ if( mpManager->xConverter.is() )
+ rRet = mpManager->xConverter->convertTo( rRet, rRetType
);
+ else
+ throw CannotConvertException();
+ }
}
//========================================================================
// Methoden von XAllListener
Any SAL_CALL AttacherAllListener_Impl::approveFiring( const AllEventObject&
Event )
- throw( InvocationTargetException, RuntimeException )
+ throw( InvocationTargetException, RuntimeException )
{
- ScriptEvent aScriptEvent;
- aScriptEvent.Source = (OWeakObject *)mpManager; // get correct
XInterface
- aScriptEvent.ListenerType = Event.ListenerType;
- aScriptEvent.MethodName = Event.MethodName;
- aScriptEvent.Arguments = Event.Arguments;
- aScriptEvent.Helper = Event.Helper;
- aScriptEvent.ScriptType = aScriptType;
- aScriptEvent.ScriptCode = aScriptCode;
-
- Any aRet;
- // ueber alle Listener iterieren und Events senden
- OInterfaceIteratorHelper aIt( mpManager->aScriptListeners );
- while( aIt.hasMoreElements() )
- {
- aRet = ((XScriptListener *)aIt.next())->approveFiring( aScriptEvent );
- try
- {
+ ScriptEvent aScriptEvent;
+ aScriptEvent.Source = (OWeakObject *)mpManager; //
get correct XInterface
+ aScriptEvent.ListenerType = Event.ListenerType;
+ aScriptEvent.MethodName = Event.MethodName;
+ aScriptEvent.Arguments = Event.Arguments;
+ aScriptEvent.Helper = Event.Helper;
+ aScriptEvent.ScriptType = aScriptType;
+ aScriptEvent.ScriptCode = aScriptCode;
+
+ Any aRet;
+ // ueber alle Listener iterieren und Events senden
+ OInterfaceIteratorHelper aIt( mpManager->aScriptListeners );
+ while( aIt.hasMoreElements() )
+ {
+ aRet = ((XScriptListener *)aIt.next())->approveFiring(
aScriptEvent );
+ try
+ {
Reference< XIdlClass > xListenerType =
mpManager->getReflection()->
forName(
Event.ListenerType.getTypeName() );
- Reference< XIdlMethod > xMeth = xListenerType->getMethod(
Event.MethodName );
- if( xMeth.is() )
- {
- Reference< XIdlClass > xRetType = xMeth->getReturnType();
+ Reference< XIdlMethod > xMeth =
xListenerType->getMethod( Event.MethodName );
+ if( xMeth.is() )
+ {
+ Reference< XIdlClass > xRetType =
xMeth->getReturnType();
Type aRetType(xRetType->getTypeClass(),
xRetType->getName());
- convertToEventReturn( aRet, aRetType );
- }
-
- switch( aRet.getValueType().getTypeClass() )
- {
- case TypeClass_INTERFACE:
- {
- // Interface not null, return
- Reference< XInterface > x;
+ convertToEventReturn( aRet, aRetType );
+ }
+
+ switch( aRet.getValueType().getTypeClass() )
+ {
+ case TypeClass_INTERFACE:
+ {
+ // Interface not null, return
+ Reference< XInterface > x;
aRet >>= x;
- if( x.is() )
- return aRet;
- }
- break;
-
- case TypeClass_BOOLEAN:
- // FALSE -> Return
- if( !(*(sal_Bool*)aRet.getValue()) )
- return aRet;
- break;
-
- case TypeClass_STRING:
- // none empty string -> return
- if( ((OUString*)aRet.getValue())->isEmpty() == false )
- return aRet;
- break;
-
- // none zero number -> return
- case TypeClass_FLOAT: if( *((float*)aRet.getValue())
) return aRet; break;
- case TypeClass_DOUBLE: if(
*((double*)aRet.getValue()) ) return aRet; break;
- case TypeClass_BYTE: if(
*((sal_uInt8*)aRet.getValue()) ) return aRet; break;
- case TypeClass_SHORT: if(
*((sal_Int16*)aRet.getValue()) ) return aRet; break;
- case TypeClass_LONG: if(
*((sal_Int32*)aRet.getValue()) ) return aRet; break;
- case TypeClass_UNSIGNED_SHORT: if(
*((sal_uInt16*)aRet.getValue()) ) return aRet; break;
- case TypeClass_UNSIGNED_LONG: if(
*((sal_uInt32*)aRet.getValue()) ) return aRet; break;
-
- default:
- OSL_ASSERT(false);
- break;
- }
- }
- catch( CannotConvertException& )
- {
- // silent ignore conversions errors from a script call
+ if( x.is() )
+ return aRet;
+ }
+ break;
+
+ case TypeClass_BOOLEAN:
+ // FALSE -> Return
+ if( !(*(sal_Bool*)aRet.getValue()) )
+ return aRet;
+ break;
+
+ case TypeClass_STRING:
+ // none empty string -> return
+ if(
((OUString*)aRet.getValue())->isEmpty() == false )
+ return aRet;
+ break;
+
+ // none zero number -> return
+ case TypeClass_FLOAT: if(
*((float*)aRet.getValue()) ) return aRet; break;
+ case TypeClass_DOUBLE: if(
*((double*)aRet.getValue()) ) return aRet; break;
+ case TypeClass_BYTE: if(
*((sal_uInt8*)aRet.getValue()) ) return aRet; break;
+ case TypeClass_SHORT: if(
*((sal_Int16*)aRet.getValue()) ) return aRet; break;
+ case TypeClass_LONG: if(
*((sal_Int32*)aRet.getValue()) ) return aRet; break;
+ case TypeClass_UNSIGNED_SHORT: if(
*((sal_uInt16*)aRet.getValue()) ) return aRet; break;
+ case TypeClass_UNSIGNED_LONG: if(
*((sal_uInt32*)aRet.getValue()) ) return aRet; break;
+
+ default:
+ OSL_ASSERT(false);
+ break;
+ }
+ }
+ catch( CannotConvertException& )
+ {
+ // silent ignore conversions errors from a script call
Reference< XIdlClass > xListenerType =
mpManager->getReflection()->
forName(
Event.ListenerType.getTypeName() );
- Reference< XIdlMethod > xMeth = xListenerType->getMethod(
Event.MethodName );
- if( xMeth.is() )
- {
- Reference< XIdlClass > xRetType = xMeth->getReturnType();
+ Reference< XIdlMethod > xMeth =
xListenerType->getMethod( Event.MethodName );
+ if( xMeth.is() )
+ {
+ Reference< XIdlClass > xRetType =
xMeth->getReturnType();
Type aRetType(xRetType->getTypeClass(),
xRetType->getName());
- aRet.clear();
- convertToEventReturn( aRet, aRetType );
- }
- }
- }
- return aRet;
+ aRet.clear();
+ convertToEventReturn( aRet, aRetType );
+ }
+ }
+ }
+ return aRet;
}
//========================================================================
// Methoden von XEventListener
void SAL_CALL AttacherAllListener_Impl::disposing(const EventObject& )
- throw( RuntimeException )
+ throw( RuntimeException )
{
- // It is up to the container to release the object
+ // It is up to the container to release the object
}
@@ -396,7 +396,7 @@ Reference< XEventAttacherManager >
createEventAttacherManager( const Reference<
const Reference<
XMultiServiceFactory > & rSMgr )
throw( Exception )
{
- return new ImplEventAttacherManager( rIntrospection, rSMgr );
+ return new ImplEventAttacherManager( rIntrospection, rSMgr );
}
// Create-Methode fuer EventAttacherManager
@@ -408,8 +408,8 @@ Reference< XEventAttacherManager >
createEventAttacherManager( const Reference<
Reference< XInterface > xIFace( rSMgr->createInstance(
OUString::createFromAscii("com.sun.star.beans.Introspection") ) );
if ( xIFace.is() )
{
- Reference< XIntrospection > xIntrospection( xIFace,
UNO_QUERY);
- return new ImplEventAttacherManager( xIntrospection, rSMgr
);
+ Reference< XIntrospection > xIntrospection( xIFace,
UNO_QUERY);
+ return new ImplEventAttacherManager( xIntrospection,
rSMgr );
}
}
@@ -419,31 +419,31 @@ Reference< XEventAttacherManager >
createEventAttacherManager( const Reference<
//-----------------------------------------------------------------------------
ImplEventAttacherManager::ImplEventAttacherManager( const Reference<
XIntrospection > & rIntrospection,
const Reference< XMultiServiceFactory > rSMgr )
- : aScriptListeners( aLock )
+ : aScriptListeners( aLock )
, mxSMgr( rSMgr )
- , mxIntrospection( rIntrospection )
+ , mxIntrospection( rIntrospection )
{
if ( rSMgr.is() )
{
- Reference< XInterface > xIFace( rSMgr->createInstance(
OUString::createFromAscii("com.sun.star.script.EventAttacher") ) );
+ Reference< XInterface > xIFace( rSMgr->createInstance(
OUString::createFromAscii("com.sun.star.script.EventAttacher") ) );
if ( xIFace.is() )
{
xAttacher = Reference< XEventAttacher >::query( xIFace
);
}
- xIFace = rSMgr->createInstance(
OUString::createFromAscii("com.sun.star.script.Converter") );
+ xIFace = rSMgr->createInstance(
OUString::createFromAscii("com.sun.star.script.Converter") );
if ( xIFace.is() )
{
xConverter = Reference< XTypeConverter >::query( xIFace
);
}
}
- Reference< XInitialization > xInit( xAttacher, UNO_QUERY );
- if( xInit.is() )
- {
- Sequence< Any > Arguments( 1 );
- Arguments[0] <<= rIntrospection;
- xInit->initialize( Arguments );
- }
+ Reference< XInitialization > xInit( xAttacher, UNO_QUERY );
+ if( xInit.is() )
+ {
+ Sequence< Any > Arguments( 1 );
+ Arguments[0] <<= rIntrospection;
+ xInit->initialize( Arguments );
+ }
}
//-----------------------------------------------------------------------------
@@ -468,14 +468,14 @@ Reference< XIdlReflection >
ImplEventAttacherManager::getReflection() throw( Exc
::std::deque<AttacherIndex_Impl>::iterator
ImplEventAttacherManager::implCheckIndex( sal_Int32 _nIndex ) SAL_THROW ( (
IllegalArgumentException ) )
{
if (_nIndex < 0)
- throw IllegalArgumentException();
+ throw IllegalArgumentException();
- ::std::deque<AttacherIndex_Impl>::iterator aIt = aIndex.begin();
- for ( sal_Int32 i = 0; (i < _nIndex) && (aIt != aIndex.end()); ++i, ++aIt )
+ ::std::deque<AttacherIndex_Impl>::iterator aIt = aIndex.begin();
+ for ( sal_Int32 i = 0; (i < _nIndex) && (aIt != aIndex.end()); ++i,
++aIt )
;
- if( aIt == aIndex.end() )
- throw IllegalArgumentException();
+ if( aIt == aIndex.end() )
+ throw IllegalArgumentException();
return aIt;
}
@@ -483,165 +483,165 @@ Reference< XIdlReflection >
ImplEventAttacherManager::getReflection() throw( Exc
//-----------------------------------------------------------------------------
void detachAll_Impl
(
- ImplEventAttacherManager * pMgr,
- sal_Int32 nIdx,
- ::std::deque< AttachedObject_Impl > & rList
+ ImplEventAttacherManager * pMgr,
+ sal_Int32 nIdx,
+ ::std::deque< AttachedObject_Impl > & rList
)
{
- ::std::deque< AttachedObject_Impl >::iterator aObjIt = rList.begin();
- ::std::deque< AttachedObject_Impl >::iterator aObjEnd = rList.end();
- while( aObjIt != aObjEnd )
- {
- pMgr->detach( nIdx, (*aObjIt).xTarget );
- aObjIt++;
- }
+ ::std::deque< AttachedObject_Impl >::iterator aObjIt = rList.begin();
+ ::std::deque< AttachedObject_Impl >::iterator aObjEnd = rList.end();
+ while( aObjIt != aObjEnd )
+ {
+ pMgr->detach( nIdx, (*aObjIt).xTarget );
+ aObjIt++;
+ }
}
//-----------------------------------------------------------------------------
void attachAll_Impl
(
- ImplEventAttacherManager * pMgr,
- sal_Int32 nIdx,
- ::std::deque< AttachedObject_Impl > & rList
+ ImplEventAttacherManager * pMgr,
+ sal_Int32 nIdx,
+ ::std::deque< AttachedObject_Impl > & rList
)
{
- ::std::deque< AttachedObject_Impl >::iterator aObjIt = rList.begin();
- ::std::deque< AttachedObject_Impl >::iterator aObjEnd = rList.end();
- while( aObjIt != aObjEnd )
- {
- pMgr->attach( nIdx, (*aObjIt).xTarget, (*aObjIt).aHelper );
- aObjIt++;
- }
+ ::std::deque< AttachedObject_Impl >::iterator aObjIt = rList.begin();
+ ::std::deque< AttachedObject_Impl >::iterator aObjEnd = rList.end();
+ while( aObjIt != aObjEnd )
+ {
+ pMgr->attach( nIdx, (*aObjIt).xTarget, (*aObjIt).aHelper );
+ aObjIt++;
+ }
}
//-----------------------------------------------------------------------------
//*** Methoden von XEventAttacherManager ***
void SAL_CALL ImplEventAttacherManager::registerScriptEvent
(
- sal_Int32 nIndex,
- const ScriptEventDescriptor& ScriptEvent
+ sal_Int32 nIndex,
+ const ScriptEventDescriptor& ScriptEvent
)
- throw( IllegalArgumentException, RuntimeException )
+ throw( IllegalArgumentException, RuntimeException )
{
- Guard< Mutex > aGuard( aLock );
-
+ Guard< Mutex > aGuard( aLock );
+
// Index pruefen und Array anpassen
::std::deque<AttacherIndex_Impl>::iterator aIt = implCheckIndex( nIndex
);
- ::std::deque< AttachedObject_Impl > aList = (*aIt).aObjList;
+ ::std::deque< AttachedObject_Impl > aList = (*aIt).aObjList;
- ScriptEventDescriptor aEvt = ScriptEvent;
- const sal_Unicode* pLastDot = aEvt.ListenerType.getStr();
- pLastDot += rtl_ustr_lastIndexOfChar( pLastDot, '.' );
- if( pLastDot )
- aEvt.ListenerType = pLastDot +1;
+ ScriptEventDescriptor aEvt = ScriptEvent;
+ const sal_Unicode* pLastDot = aEvt.ListenerType.getStr();
+ pLastDot += rtl_ustr_lastIndexOfChar( pLastDot, '.' );
+ if( pLastDot )
+ aEvt.ListenerType = pLastDot +1;
#ifdef DEQUE_OK
- (*aIt).aEventList.push_back( aEvt );
+ (*aIt).aEventList.push_back( aEvt );
#else
- (*aIt).aEventList.realloc( (*aIt).aEventList.getLength() +1 );
- (*aIt).aEventList.getArray()[(*aIt).aEventList.getLength() -1] = aEvt;
+ (*aIt).aEventList.realloc( (*aIt).aEventList.getLength() +1 );
+ (*aIt).aEventList.getArray()[(*aIt).aEventList.getLength() -1] = aEvt;
#endif
- // register new new Event
- ::std::deque< AttachedObject_Impl >::iterator aObjIt =
(*aIt).aObjList.begin();
- ::std::deque< AttachedObject_Impl >::iterator aObjEnd =
(*aIt).aObjList.end();
- while( aObjIt != aObjEnd )
- {
- // resize
- sal_Int32 nPos = (*aObjIt).aAttachedListenerSeq.getLength();
- (*aObjIt).aAttachedListenerSeq.realloc( nPos + 1 );
- Reference< XEventListener > * pArray =
(*aObjIt).aAttachedListenerSeq.getArray();
-
- Reference< XAllListener > xAll =
- new AttacherAllListener_Impl( this, ScriptEvent.ScriptType,
ScriptEvent.ScriptCode );
- try
- {
- pArray[nPos] = xAttacher->attachSingleEventListener(
(*aObjIt).xTarget, xAll,
- (*aObjIt).aHelper, ScriptEvent.ListenerType,
- ScriptEvent.AddListenerParam, ScriptEvent.EventMethod
);
- }
- catch( Exception& )
- {
- }
-
- aObjIt++;
- }
+ // register new new Event
+ ::std::deque< AttachedObject_Impl >::iterator aObjIt =
(*aIt).aObjList.begin();
+ ::std::deque< AttachedObject_Impl >::iterator aObjEnd =
(*aIt).aObjList.end();
+ while( aObjIt != aObjEnd )
+ {
+ // resize
+ sal_Int32 nPos = (*aObjIt).aAttachedListenerSeq.getLength();
+ (*aObjIt).aAttachedListenerSeq.realloc( nPos + 1 );
+ Reference< XEventListener > * pArray =
(*aObjIt).aAttachedListenerSeq.getArray();
+
+ Reference< XAllListener > xAll =
+ new AttacherAllListener_Impl( this,
ScriptEvent.ScriptType, ScriptEvent.ScriptCode );
+ try
+ {
+ pArray[nPos] = xAttacher->attachSingleEventListener(
(*aObjIt).xTarget, xAll,
+ (*aObjIt).aHelper,
ScriptEvent.ListenerType,
+ ScriptEvent.AddListenerParam,
ScriptEvent.EventMethod );
+ }
+ catch( Exception& )
+ {
+ }
+
+ aObjIt++;
+ }
}
//-----------------------------------------------------------------------------
void SAL_CALL ImplEventAttacherManager::registerScriptEvents
(
- sal_Int32 nIndex,
- const Sequence< ScriptEventDescriptor >& ScriptEvents
+ sal_Int32 nIndex,
+ const Sequence< ScriptEventDescriptor >& ScriptEvents
)
- throw( IllegalArgumentException, RuntimeException )
+ throw( IllegalArgumentException, RuntimeException )
{
- Guard< Mutex > aGuard( aLock );
+ Guard< Mutex > aGuard( aLock );
- // Index pruefen und Array anpassen
+ // Index pruefen und Array anpassen
::std::deque<AttacherIndex_Impl>::iterator aIt = implCheckIndex( nIndex
);
- ::std::deque< AttachedObject_Impl > aList = (*aIt).aObjList;
- detachAll_Impl( this, nIndex, aList );
+ ::std::deque< AttachedObject_Impl > aList = (*aIt).aObjList;
+ detachAll_Impl( this, nIndex, aList );
- const ScriptEventDescriptor* pArray = ScriptEvents.getConstArray();
- sal_Int32 nLen = ScriptEvents.getLength();
- for( sal_Int32 i = 0 ; i < nLen ; i++ )
- registerScriptEvent( nIndex, pArray[ i ] );
+ const ScriptEventDescriptor* pArray = ScriptEvents.getConstArray();
+ sal_Int32 nLen = ScriptEvents.getLength();
+ for( sal_Int32 i = 0 ; i < nLen ; i++ )
+ registerScriptEvent( nIndex, pArray[ i ] );
- attachAll_Impl( this, nIndex, aList );
+ attachAll_Impl( this, nIndex, aList );
}
//-----------------------------------------------------------------------------
void SAL_CALL ImplEventAttacherManager::revokeScriptEvent
(
- sal_Int32 nIndex,
- const OUString& ListenerType,
- const OUString& EventMethod,
- const OUString& ToRemoveListenerParam
+ sal_Int32 nIndex,
+ const OUString& ListenerType,
+ const OUString& EventMethod,
+ const OUString& ToRemoveListenerParam
)
- throw( IllegalArgumentException, RuntimeException )
+ throw( IllegalArgumentException, RuntimeException )
{
- Guard< Mutex > aGuard( aLock );
+ Guard< Mutex > aGuard( aLock );
::std::deque<AttacherIndex_Impl>::iterator aIt = implCheckIndex( nIndex
);
- ::std::deque< AttachedObject_Impl > aList = (*aIt).aObjList;
- detachAll_Impl( this, nIndex, aList );
+ ::std::deque< AttachedObject_Impl > aList = (*aIt).aObjList;
+ detachAll_Impl( this, nIndex, aList );
- OUString aLstType = ListenerType;
- const sal_Unicode * pLastDot = aLstType.getStr();
- pLastDot += rtl_ustr_lastIndexOfChar( pLastDot, '.' );
- if( pLastDot )
- aLstType = pLastDot +1;
+ OUString aLstType = ListenerType;
+ const sal_Unicode * pLastDot = aLstType.getStr();
+ pLastDot += rtl_ustr_lastIndexOfChar( pLastDot, '.' );
+ if( pLastDot )
+ aLstType = pLastDot +1;
#ifdef DEQUE_OK
- ::std::deque< ScriptEventDescriptor >::iterator aEvtIt =
(*aIt).aEventList.begin();
- ::std::deque< ScriptEventDescriptor >::iterator aEvtEnd =
(*aIt).aEventList.end();
- while( aEvtIt != aEvtEnd )
- {
- if( aLstType == (*aEvtIt).ListenerType
- && EventMethod == (*aEvtIt).EventMethod
- && ToRemoveListenerParam == (*aEvtIt).AddListenerParam )
- {
- (*aIt).aEventList.erase( aEvtIt );
- break;
- }
-
- aEvtIt++;
- }
+ ::std::deque< ScriptEventDescriptor >::iterator aEvtIt =
(*aIt).aEventList.begin();
+ ::std::deque< ScriptEventDescriptor >::iterator aEvtEnd =
(*aIt).aEventList.end();
+ while( aEvtIt != aEvtEnd )
+ {
+ if( aLstType ==
(*aEvtIt).ListenerType
+ && EventMethod == (*aEvtIt).EventMethod
+ && ToRemoveListenerParam ==
(*aEvtIt).AddListenerParam )
+ {
+ (*aIt).aEventList.erase( aEvtIt );
+ break;
+ }
+
+ aEvtIt++;
+ }
#else
Sequence< ScriptEventDescriptor >& rEventList = (*aIt).aEventList;
ScriptEventDescriptor* pEventList =
rEventList.getArray();
const ScriptEventDescriptor* pEventListEnd = pEventList +
rEventList.getLength();
- for( ; pEventList < pEventListEnd; ++pEventList )
- {
- if ( (aLstType ==
pEventList->ListenerType )
- && (EventMethod ==
pEventList->EventMethod )
- && (ToRemoveListenerParam ==
pEventList->AddListenerParam)
+ for( ; pEventList < pEventListEnd; ++pEventList )
+ {
+ if ( (aLstType ==
pEventList->ListenerType )
+ && (EventMethod ==
pEventList->EventMethod )
+ && (ToRemoveListenerParam ==
pEventList->AddListenerParam)
)
- {
+ {
ScriptEventDescriptor* pMoveTo = pEventList;
const ScriptEventDescriptor* pMoveFrom = pMoveTo + 1;
while (pMoveFrom < pEventListEnd)
@@ -649,384 +649,382 @@ void SAL_CALL
ImplEventAttacherManager::revokeScriptEvent
*pMoveTo++ = *pMoveFrom++;
}
rEventList.realloc( rEventList.getLength() - 1 );
- break;
- }
- }
+ break;
+ }
+ }
#endif
- attachAll_Impl( this, nIndex, aList );
+ attachAll_Impl( this, nIndex, aList );
}
//-----------------------------------------------------------------------------
void SAL_CALL ImplEventAttacherManager::revokeScriptEvents(sal_Int32 nIndex )
- throw( IllegalArgumentException, RuntimeException )
+ throw( IllegalArgumentException, RuntimeException )
{
- Guard< Mutex > aGuard( aLock );
+ Guard< Mutex > aGuard( aLock );
::std::deque<AttacherIndex_Impl>::iterator aIt = implCheckIndex( nIndex
);
- ::std::deque< AttachedObject_Impl > aList = (*aIt).aObjList;
- detachAll_Impl( this, nIndex, aList );
+ ::std::deque< AttachedObject_Impl > aList = (*aIt).aObjList;
+ detachAll_Impl( this, nIndex, aList );
#ifdef DEQUE_OK
- (*aIt).aEventList = ::std::deque< ScriptEventDescriptor >();
+ (*aIt).aEventList = ::std::deque< ScriptEventDescriptor >();
#else
- (*aIt).aEventList.realloc( 0 );
+ (*aIt).aEventList.realloc( 0 );
#endif
- attachAll_Impl( this, nIndex, aList );
+ attachAll_Impl( this, nIndex, aList );
}
//-----------------------------------------------------------------------------
void SAL_CALL ImplEventAttacherManager::insertEntry(sal_Int32 nIndex)
- throw( IllegalArgumentException, RuntimeException )
+ throw( IllegalArgumentException, RuntimeException )
{
- Guard< Mutex > aGuard( aLock );
- if( nIndex < 0 )
- throw IllegalArgumentException();
+ Guard< Mutex > aGuard( aLock );
+ if( nIndex < 0 )
+ throw IllegalArgumentException();
-// ::std::deque<AttacherIndex_Impl>::iterator aIt = aIndex.begin();
-// while( nIndex-- )
-// aIt++;
+// ::std::deque<AttacherIndex_Impl>::iterator aIt = aIndex.begin();
+// while( nIndex-- )
+// aIt++;
if ( static_cast< ::std::deque< AttacherIndex_Impl
>::size_type>(nIndex) >= aIndex.size() )
aIndex.resize(nIndex+1);
- AttacherIndex_Impl aTmp;
- aIndex.insert( aIndex.begin() + nIndex, aTmp );
+ AttacherIndex_Impl aTmp;
+ aIndex.insert( aIndex.begin() + nIndex, aTmp );
}
//-----------------------------------------------------------------------------
void SAL_CALL ImplEventAttacherManager::removeEntry(sal_Int32 nIndex)
- throw( IllegalArgumentException, RuntimeException )
+ throw( IllegalArgumentException, RuntimeException )
{
- Guard< Mutex > aGuard( aLock );
+ Guard< Mutex > aGuard( aLock );
::std::deque<AttacherIndex_Impl>::iterator aIt = implCheckIndex( nIndex
);
- ::std::deque< AttachedObject_Impl > aList = (*aIt).aObjList;
- detachAll_Impl( this, nIndex, aList );
- aIndex.erase( aIt );
+ ::std::deque< AttachedObject_Impl > aList = (*aIt).aObjList;
+ detachAll_Impl( this, nIndex, aList );
+ aIndex.erase( aIt );
}
//-----------------------------------------------------------------------------
Sequence< ScriptEventDescriptor > SAL_CALL
ImplEventAttacherManager::getScriptEvents(sal_Int32 nIndex)
- throw( IllegalArgumentException, RuntimeException )
+ throw( IllegalArgumentException, RuntimeException )
{
- Guard< Mutex > aGuard( aLock );
+ Guard< Mutex > aGuard( aLock );
::std::deque<AttacherIndex_Impl>::iterator aIt = implCheckIndex( nIndex
);
#ifdef DEQUE_OK
- Sequence< ScriptEventDescriptor > aSeq( (*aIt).aEventList.size() );
- ScriptEventDescriptor * pArray = aSeq.getArray();
-
- ::std::deque< ScriptEventDescriptor >::iterator aEvtIt =
(*aIt).aEventList.begin();
- ::std::deque< ScriptEventDescriptor >::iterator aEvtEnd =
(*aIt).aEventList.end();
- sal_Int32 i = 0;
- while( aEvtIt != aEvtEnd )
- {
- pArray[i++] = *aEvtIt;
- aEvtIt++;
- }
- return aSeq;
+ Sequence< ScriptEventDescriptor > aSeq( (*aIt).aEventList.size() );
+ ScriptEventDescriptor * pArray = aSeq.getArray();
+
+ ::std::deque< ScriptEventDescriptor >::iterator aEvtIt =
(*aIt).aEventList.begin();
+ ::std::deque< ScriptEventDescriptor >::iterator aEvtEnd =
(*aIt).aEventList.end();
+ sal_Int32 i = 0;
+ while( aEvtIt != aEvtEnd )
+ {
+ pArray[i++] = *aEvtIt;
+ aEvtIt++;
+ }
+ return aSeq;
#else
- return (*aIt).aEventList;
+ return (*aIt).aEventList;
#endif
}
//-----------------------------------------------------------------------------
void SAL_CALL ImplEventAttacherManager::attach(sal_Int32 nIndex, const
Reference< XInterface >& xObject, const Any & Helper)
- throw( IllegalArgumentException, ServiceNotRegisteredException,
RuntimeException )
+ throw( IllegalArgumentException, ServiceNotRegisteredException,
RuntimeException )
{
- Guard< Mutex > aGuard( aLock );
- if( nIndex < 0 || !xObject.is() )
- throw IllegalArgumentException();
-
- if( static_cast< ::std::deque< AttacherIndex_Impl >::size_type>(nIndex) >=
aIndex.size() )
- {
- // alte Dateien lesen
- if( nVersion == 1 )
- {
- insertEntry( nIndex );
- attach( nIndex, xObject, Helper );
- return;
- }
- else
- throw IllegalArgumentException();
- }
+ Guard< Mutex > aGuard( aLock );
+ if( nIndex < 0 || !xObject.is() )
+ throw IllegalArgumentException();
+
+ if( static_cast< ::std::deque< AttacherIndex_Impl >::size_type>(nIndex)
>= aIndex.size() )
+ {
+ // alte Dateien lesen
+ if( nVersion == 1 )
+ {
+ insertEntry( nIndex );
+ attach( nIndex, xObject, Helper );
+ return;
+ }
+ else
+ throw IllegalArgumentException();
+ }
::std::deque< AttacherIndex_Impl >::iterator aCurrentPosition =
aIndex.begin() + nIndex;
AttachedObject_Impl aTmp;
- aTmp.xTarget = xObject;
- aTmp.aHelper = Helper;
- aCurrentPosition->aObjList.push_back( aTmp );
+ aTmp.xTarget = xObject;
+ aTmp.aHelper = Helper;
+ aCurrentPosition->aObjList.push_back( aTmp );
- //::std::deque< AttachedObject_Impl >::iterator aObjIt =
(*aIt).aObjList.back();
- AttachedObject_Impl & rCurObj = aCurrentPosition->aObjList.back();
+ //::std::deque< AttachedObject_Impl >::iterator aObjIt =
(*aIt).aObjList.back();
+ AttachedObject_Impl & rCurObj = aCurrentPosition->aObjList.back();
#ifdef DEQUE_OK
- rCurObj.aAttachedListenerSeq = Sequence< Reference< XEventListener > >(
aCurrentPosition->aEventList.size() );
+ rCurObj.aAttachedListenerSeq = Sequence< Reference< XEventListener > >(
aCurrentPosition->aEventList.size() );
#else
- rCurObj.aAttachedListenerSeq = Sequence< Reference< XEventListener > >(
aCurrentPosition->aEventList.getLength() );
+ rCurObj.aAttachedListenerSeq = Sequence< Reference< XEventListener > >(
aCurrentPosition->aEventList.getLength() );
#endif
- Reference< XEventListener > * pArray =
rCurObj.aAttachedListenerSeq.getArray();
+ Reference< XEventListener > * pArray =
rCurObj.aAttachedListenerSeq.getArray();
#ifdef DEQUE_OK
- ::std::deque< ScriptEventDescriptor >::iterator aEvtIt =
aCurrentPosition->aEventList.begin();
- ::std::deque< ScriptEventDescriptor >::iterator aEvtEnd =
aCurrentPosition->aEventList.end();
- sal_Int32 i = 0;
- while( aEvtIt != aEvtEnd )
- {
- Reference< XAllListener > xAll =
- new AttacherAllListener_Impl( this, (*aEvtIt).ScriptType,
(*aEvtIt).ScriptCode );
- Reference< XEventListener > xAdapter;
- try
- {
- xAdapter = xAttacher->attachSingleEventListener( rCurObj.xTarget, xAll,
- rCurObj.aHelper, (*aEvtIt).ScriptType,
- (*aEvtIt).AddListenerParam, (*aEvtIt).EventMethod );
- }
- catch( Exception& )
- {
- }
-
- pArray[i++] = xAdapter;
- aEvtIt++;
- }
+ ::std::deque< ScriptEventDescriptor >::iterator aEvtIt =
aCurrentPosition->aEventList.begin();
+ ::std::deque< ScriptEventDescriptor >::iterator aEvtEnd =
aCurrentPosition->aEventList.end();
+ sal_Int32 i = 0;
+ while( aEvtIt != aEvtEnd )
+ {
+ Reference< XAllListener > xAll =
+ new AttacherAllListener_Impl( this,
(*aEvtIt).ScriptType, (*aEvtIt).ScriptCode );
+ Reference< XEventListener > xAdapter;
+ try
+ {
+ xAdapter = xAttacher->attachSingleEventListener(
rCurObj.xTarget, xAll,
+ rCurObj.aHelper,
(*aEvtIt).ScriptType,
+ (*aEvtIt).AddListenerParam,
(*aEvtIt).EventMethod );
+ }
+ catch( Exception& )
+ {
+ }
+
+ pArray[i++] = xAdapter;
+ aEvtIt++;
+ }
#else
- sal_Int32 nLen = aCurrentPosition->aEventList.getLength();
- ScriptEventDescriptor * pEL = aCurrentPosition->aEventList.getArray();
- for(sal_Int32 i = 0; i < nLen; ++i )
- {
- Reference< XAllListener > xAll =
- new AttacherAllListener_Impl( this, pEL[i].ScriptType,
pEL[i].ScriptCode );
- Reference< XEventListener > xAdapter;
- try
- {
- xAdapter = xAttacher->attachSingleEventListener( rCurObj.xTarget, xAll,
- rCurObj.aHelper, pEL[i].ListenerType,
- pEL[i].AddListenerParam, pEL[i].EventMethod );
- }
- catch( Exception& )
- {
- }
-
- pArray[i] = xAdapter;
- }
+ sal_Int32 nLen = aCurrentPosition->aEventList.getLength();
+ ScriptEventDescriptor * pEL = aCurrentPosition->aEventList.getArray();
+ for(sal_Int32 i = 0; i < nLen; ++i )
+ {
+ Reference< XAllListener > xAll =
+ new AttacherAllListener_Impl( this, pEL[i].ScriptType,
pEL[i].ScriptCode );
+ Reference< XEventListener > xAdapter;
+ try
+ {
+ xAdapter = xAttacher->attachSingleEventListener(
rCurObj.xTarget, xAll,
+ rCurObj.aHelper,
pEL[i].ListenerType,
+ pEL[i].AddListenerParam,
pEL[i].EventMethod );
+ }
+ catch( Exception& )
+ {
+ }
+
+ pArray[i] = xAdapter;
+ }
#endif
}
//-----------------------------------------------------------------------------
void SAL_CALL ImplEventAttacherManager::detach(sal_Int32 nIndex, const
Reference< XInterface >& xObject)
- throw( IllegalArgumentException, RuntimeException )
+ throw( IllegalArgumentException, RuntimeException )
{
- Guard< Mutex > aGuard( aLock );
- //return;
- if( nIndex < 0 || static_cast< ::std::deque< AttacherIndex_Impl
>::size_type>(nIndex) >= aIndex.size() || !xObject.is() )
- throw IllegalArgumentException();
+ Guard< Mutex > aGuard( aLock );
+ //return;
+ if( nIndex < 0 || static_cast< ::std::deque< AttacherIndex_Impl
>::size_type>(nIndex) >= aIndex.size() || !xObject.is() )
+ throw IllegalArgumentException();
::std::deque< AttacherIndex_Impl >::iterator aCurrentPosition =
aIndex.begin() + nIndex;
- ::std::deque< AttachedObject_Impl >::iterator aObjIt =
aCurrentPosition->aObjList.begin();
- ::std::deque< AttachedObject_Impl >::iterator aObjEnd =
aCurrentPosition->aObjList.end();
- while( aObjIt != aObjEnd )
- {
- if( (*aObjIt).xTarget == xObject )
- {
- Reference< XEventListener > * pArray =
(*aObjIt).aAttachedListenerSeq.getArray();
+ ::std::deque< AttachedObject_Impl >::iterator aObjIt =
aCurrentPosition->aObjList.begin();
+ ::std::deque< AttachedObject_Impl >::iterator aObjEnd =
aCurrentPosition->aObjList.end();
+ while( aObjIt != aObjEnd )
+ {
+ if( (*aObjIt).xTarget == xObject )
+ {
+ Reference< XEventListener > * pArray =
(*aObjIt).aAttachedListenerSeq.getArray();
#ifdef DEQUE_OK
- ::std::deque< ScriptEventDescriptor >::iterator aEvtIt =
aCurrentPosition->aEventList.begin();
- ::std::deque< ScriptEventDescriptor >::iterator aEvtEnd =
aCurrentPosition->aEventList.end();
- sal_Int32 i = 0;
- while( aEvtIt != aEvtEnd )
- {
- if( pArray[i].is() )
- {
- try
- {
- xAttacher->removeListener( (*aObjIt).xTarget,
(*aEvtIt).ListenerType,
- (*aEvtIt).AddListenerParam,
pArray[i] );
- }
- catch( Exception& )
- {
- }
- }
- i++;
- aEvtIt++;
- }
+ ::std::deque< ScriptEventDescriptor >::iterator aEvtIt
= aCurrentPosition->aEventList.begin();
+ ::std::deque< ScriptEventDescriptor >::iterator aEvtEnd
= aCurrentPosition->aEventList.end();
+ sal_Int32 i = 0;
+ while( aEvtIt != aEvtEnd )
+ {
+ if( pArray[i].is() )
+ {
+ try
+ {
+ xAttacher->removeListener(
(*aObjIt).xTarget, (*aEvtIt).ListenerType,
+
(*aEvtIt).AddListenerParam, pArray[i] );
+ }
+ catch( Exception& )
+ {
+ }
+ }
+ i++;
+ aEvtIt++;
+ }
#else
- sal_Int32 nLen = aCurrentPosition->aEventList.getLength();
- ScriptEventDescriptor * pEL =
aCurrentPosition->aEventList.getArray();
- for( sal_Int32 i = 0; i < nLen; i++ )
- {
- if( pArray[i].is() )
- {
- try
- {
- xAttacher->removeListener( (*aObjIt).xTarget,
pEL[i].ListenerType,
- pEL[i].AddListenerParam,
pArray[i] );
- }
- catch( Exception& )
- {
- }
- }
- }
+ sal_Int32 nLen =
aCurrentPosition->aEventList.getLength();
+ ScriptEventDescriptor * pEL =
aCurrentPosition->aEventList.getArray();
+ for( sal_Int32 i = 0; i < nLen; i++ )
+ {
+ if( pArray[i].is() )
+ {
+ try
+ {
+ xAttacher->removeListener(
(*aObjIt).xTarget, pEL[i].ListenerType,
+
pEL[i].AddListenerParam, pArray[i] );
+ }
+ catch( Exception& )
+ {
+ }
+ }
+ }
#endif
- aCurrentPosition->aObjList.erase( aObjIt );
- break;
- }
- aObjIt++;
- }
+ aCurrentPosition->aObjList.erase( aObjIt );
+ break;
+ }
+ aObjIt++;
+ }
}
void SAL_CALL ImplEventAttacherManager::addScriptListener(const Reference<
XScriptListener >& aListener)
- throw( IllegalArgumentException, RuntimeException )
+ throw( IllegalArgumentException, RuntimeException )
{
- Guard< Mutex > aGuard( aLock );
- aScriptListeners.addInterface( aListener );
+ Guard< Mutex > aGuard( aLock );
+ aScriptListeners.addInterface( aListener );
}
void SAL_CALL ImplEventAttacherManager::removeScriptListener(const Reference<
XScriptListener >& aListener)
- throw( IllegalArgumentException, RuntimeException )
+ throw( IllegalArgumentException, RuntimeException )
{
- Guard< Mutex > aGuard( aLock );
- aScriptListeners.removeInterface( aListener );
+ Guard< Mutex > aGuard( aLock );
+ aScriptListeners.removeInterface( aListener );
}
// Methoden von XPersistObject
OUString SAL_CALL ImplEventAttacherManager::getServiceName(void)
- throw( RuntimeException )
+ throw( RuntimeException )
{
- return OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.script.EventAttacherManager") );
+ return OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.script.EventAttacherManager") );
}
void SAL_CALL ImplEventAttacherManager::write(const Reference<
XObjectOutputStream >& OutStream)
- throw( IOException, RuntimeException )
+ throw( IOException, RuntimeException )
{
- Guard< Mutex > aGuard( aLock );
- // Ohne XMarkableStream laeuft nichts
- Reference< XMarkableStream > xMarkStream( OutStream, UNO_QUERY );
- if( !xMarkStream.is() )
- return;
-
- // Version schreiben
- OutStream->writeShort( 2 );
-
- // Position fuer Laenge merken
- sal_Int32 nObjLenMark = xMarkStream->createMark();
- OutStream->writeLong( 0L );
-
- OutStream->writeLong( aIndex.size() );
-
- // Sequences schreiben
- ::std::deque<AttacherIndex_Impl>::iterator aIt = aIndex.begin();
- ::std::deque<AttacherIndex_Impl>::iterator aEnd = aIndex.end();
- while( aIt != aEnd )
- {
+ Guard< Mutex > aGuard( aLock );
+ // Ohne XMarkableStream laeuft nichts
+ Reference< XMarkableStream > xMarkStream( OutStream, UNO_QUERY );
+ if( !xMarkStream.is() )
+ return;
+
+ // Version schreiben
+ OutStream->writeShort( 2 );
+
+ // Position fuer Laenge merken
+ sal_Int32 nObjLenMark = xMarkStream->createMark();
+ OutStream->writeLong( 0L );
+
+ OutStream->writeLong( aIndex.size() );
+
+ // Sequences schreiben
+ ::std::deque<AttacherIndex_Impl>::iterator aIt = aIndex.begin();
+ ::std::deque<AttacherIndex_Impl>::iterator aEnd = aIndex.end();
+ while( aIt != aEnd )
+ {
#ifdef DEQUE_OK
- // Laenge der Sequence und alle Descriptoren schreiben
- OutStream->writeLong( (*aIt).aEventList.size() );
- ::std::deque< ScriptEventDescriptor >::iterator aEvtIt =
(*aIt).aEventList.begin();
- ::std::deque< ScriptEventDescriptor >::iterator aEvtEnd =
(*aIt).aEventList.end();
- while( aEvtIt != aEvtEnd )
- {
- const ScriptEventDescriptor& rDesc = (*aEvtIt);
- OutStream->writeUTF( rDesc.ListenerType );
- OutStream->writeUTF( rDesc.EventMethod );
- OutStream->writeUTF( rDesc.AddListenerParam );
- OutStream->writeUTF( rDesc.ScriptType );
- OutStream->writeUTF( rDesc.ScriptCode );
-
- aEvtIt++;
- }
+ // Laenge der Sequence und alle Descriptoren schreiben
+ OutStream->writeLong( (*aIt).aEventList.size() );
+ ::std::deque< ScriptEventDescriptor >::iterator aEvtIt =
(*aIt).aEventList.begin();
+ ::std::deque< ScriptEventDescriptor >::iterator aEvtEnd =
(*aIt).aEventList.end();
+ while( aEvtIt != aEvtEnd )
+ {
+ const ScriptEventDescriptor& rDesc = (*aEvtIt);
+ OutStream->writeUTF( rDesc.ListenerType );
+ OutStream->writeUTF( rDesc.EventMethod );
+ OutStream->writeUTF( rDesc.AddListenerParam );
+ OutStream->writeUTF( rDesc.ScriptType );
+ OutStream->writeUTF( rDesc.ScriptCode );
+
+ aEvtIt++;
+ }
#else
- sal_Int32 nLen = (*aIt).aEventList.getLength();
- // Laenge der Sequence und alle Descriptoren schreiben
- OutStream->writeLong( nLen );
- ScriptEventDescriptor * pEL = (*aIt).aEventList.getArray();
- for( sal_Int32 i = 0; i < nLen; i++ )
- {
- const ScriptEventDescriptor& rDesc = pEL[i];
- OutStream->writeUTF( rDesc.ListenerType );
- OutStream->writeUTF( rDesc.EventMethod );
- OutStream->writeUTF( rDesc.AddListenerParam );
- OutStream->writeUTF( rDesc.ScriptType );
- OutStream->writeUTF( rDesc.ScriptCode );
- }
+ sal_Int32 nLen = (*aIt).aEventList.getLength();
+ // Laenge der Sequence und alle Descriptoren schreiben
+ OutStream->writeLong( nLen );
+ ScriptEventDescriptor * pEL = (*aIt).aEventList.getArray();
+ for( sal_Int32 i = 0; i < nLen; i++ )
+ {
+ const ScriptEventDescriptor& rDesc = pEL[i];
+ OutStream->writeUTF( rDesc.ListenerType );
+ OutStream->writeUTF( rDesc.EventMethod );
+ OutStream->writeUTF( rDesc.AddListenerParam );
+ OutStream->writeUTF( rDesc.ScriptType );
+ OutStream->writeUTF( rDesc.ScriptCode );
+ }
#endif
- aIt++;
- }
-
- // Die jetzt bekannte Laenge eintragen
- sal_Int32 nObjLen = xMarkStream->offsetToMark( nObjLenMark ) -4;
- xMarkStream->jumpToMark( nObjLenMark );
- OutStream->writeLong( nObjLen );
- xMarkStream->jumpToFurthest();
- xMarkStream->deleteMark( nObjLenMark );
+ aIt++;
+ }
+
+ // Die jetzt bekannte Laenge eintragen
+ sal_Int32 nObjLen = xMarkStream->offsetToMark( nObjLenMark ) -4;
+ xMarkStream->jumpToMark( nObjLenMark );
+ OutStream->writeLong( nObjLen );
+ xMarkStream->jumpToFurthest();
+ xMarkStream->deleteMark( nObjLenMark );
}
void SAL_CALL ImplEventAttacherManager::read(const Reference<
XObjectInputStream >& InStream)
- throw( IOException, RuntimeException )
+ throw( IOException, RuntimeException )
{
- Guard< Mutex > aGuard( aLock );
- // Ohne XMarkableStream laeuft nichts
- Reference< XMarkableStream > xMarkStream( InStream, UNO_QUERY );
- if( !xMarkStream.is() )
- return;
-
- // Version lesen
- nVersion = InStream->readShort();
-
- // Zunaechst kommen die Daten gemaess Version 1,
- // muss auch bei hoeheren Versionen beibehalten werden
- sal_Int32 nLen = InStream->readLong();
-
- // Position fuer Vergleichszwecke
- sal_Int32 nObjLenMark = xMarkStream->createMark();
-
- // Anzahl der zu lesenden Sequences
- sal_Int32 nItemCount = InStream->readLong();
-
- for( sal_Int32 i = 0 ; i < nItemCount ; i++ )
- {
- insertEntry( i );
- // Laenge der Sequence lesen
- sal_Int32 nSeqLen = InStream->readLong();
-
- // Sequence anlegen und Descriptoren lesen
- Sequence< ScriptEventDescriptor > aSEDSeq( nSeqLen );
- ScriptEventDescriptor* pArray = aSEDSeq.getArray();
- for( sal_Int32 j = 0 ; j < nSeqLen ; j++ )
- {
- ScriptEventDescriptor& rDesc = pArray[ j ];
- rDesc.ListenerType = InStream->readUTF();
- rDesc.EventMethod = InStream->readUTF();
- rDesc.AddListenerParam = InStream->readUTF();
- rDesc.ScriptType = InStream->readUTF();
- rDesc.ScriptCode = InStream->readUTF();
- }
- registerScriptEvents( i, aSEDSeq );
- }
-
- // Haben wir die angegebene Laenge gelesen?
- sal_Int32 nRealLen = xMarkStream->offsetToMark( nObjLenMark );
- if( nRealLen != nLen )
- {
- // Nur wenn die StreamVersion > 1 ist und noch Daten folgen, kann das
- // Ganze richtig sein. Sonst ist etwas voellig daneben gegangen.
- if( nRealLen > nLen || nVersion == 1 )
- {
- VOS_ENSHURE( sal_False, "ImplEventAttacherManager::read(): Fatal
Error, wrong object length" );
- }
- else
- {
- // TODO: Pruefen, ob Zwischen-Speicherung der Daten sinnvoll sein
koennte
-
- // Vorerst einfach nur Skippen
- sal_Int32 nSkipCount = nLen - nRealLen;
- InStream->skipBytes( nSkipCount );
- }
- }
- xMarkStream->jumpToFurthest();
- xMarkStream->deleteMark( nObjLenMark );
-}
+ Guard< Mutex > aGuard( aLock );
+ // Ohne XMarkableStream laeuft nichts
+ Reference< XMarkableStream > xMarkStream( InStream, UNO_QUERY );
+ if( !xMarkStream.is() )
+ return;
-} // namesapce comphelper
+ // Version lesen
+ nVersion = InStream->readShort();
+ // Zunaechst kommen die Daten gemaess Version 1,
+ // muss auch bei hoeheren Versionen beibehalten werden
+ sal_Int32 nLen = InStream->readLong();
+ // Position fuer Vergleichszwecke
+ sal_Int32 nObjLenMark = xMarkStream->createMark();
+
+ // Anzahl der zu lesenden Sequences
+ sal_Int32 nItemCount = InStream->readLong();
+
+ for( sal_Int32 i = 0 ; i < nItemCount ; i++ )
+ {
+ insertEntry( i );
+ // Laenge der Sequence lesen
+ sal_Int32 nSeqLen = InStream->readLong();
+
+ // Sequence anlegen und Descriptoren lesen
+ Sequence< ScriptEventDescriptor > aSEDSeq( nSeqLen );
+ ScriptEventDescriptor* pArray = aSEDSeq.getArray();
+ for( sal_Int32 j = 0 ; j < nSeqLen ; j++ )
+ {
+ ScriptEventDescriptor& rDesc = pArray[ j ];
+ rDesc.ListenerType = InStream->readUTF();
+ rDesc.EventMethod = InStream->readUTF();
+ rDesc.AddListenerParam = InStream->readUTF();
+ rDesc.ScriptType = InStream->readUTF();
+ rDesc.ScriptCode = InStream->readUTF();
+ }
+ registerScriptEvents( i, aSEDSeq );
+ }
+
+ // Haben wir die angegebene Laenge gelesen?
+ sal_Int32 nRealLen = xMarkStream->offsetToMark( nObjLenMark );
+ if( nRealLen != nLen )
+ {
+ // Nur wenn die StreamVersion > 1 ist und noch Daten folgen,
kann das
+ // Ganze richtig sein. Sonst ist etwas voellig daneben gegangen.
+ if( nRealLen > nLen || nVersion == 1 )
+ {
+ VOS_ENSHURE( sal_False,
"ImplEventAttacherManager::read(): Fatal Error, wrong object length" );
+ }
+ else
+ {
+ // TODO: Pruefen, ob Zwischen-Speicherung der Daten
sinnvoll sein koennte
+
+ // Vorerst einfach nur Skippen
+ sal_Int32 nSkipCount = nLen - nRealLen;
+ InStream->skipBytes( nSkipCount );
+ }
+ }
+ xMarkStream->jumpToFurthest();
+ xMarkStream->deleteMark( nObjLenMark );
+}
+
+} // namesapce comphelper
diff --git a/main/comphelper/source/misc/mediadescriptor.cxx
b/main/comphelper/source/misc/mediadescriptor.cxx
index 4bc4f91..c2e2c02 100644
--- a/main/comphelper/source/misc/mediadescriptor.cxx
+++ b/main/comphelper/source/misc/mediadescriptor.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -65,499 +65,499 @@ namespace css = ::com::sun::star;
// definitions
/*-----------------------------------------------
- 10.03.2004 07:35
+ 10.03.2004 07:35
-----------------------------------------------*/
const ::rtl::OUString& MediaDescriptor::PROP_ABORTED()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Aborted"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Aborted"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_ASTEMPLATE()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("AsTemplate"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("AsTemplate"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_CHARACTERSET()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("CharacterSet"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("CharacterSet"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_COMPONENTDATA()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("ComponentData"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("ComponentData"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_DEEPDETECTION()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("DeepDetection"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("DeepDetection"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_DETECTSERVICE()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("DetectService"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("DetectService"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_DOCUMENTSERVICE()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("DocumentService"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("DocumentService"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_ENCRYPTIONDATA()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("EncryptionData"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("EncryptionData"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_EXTENSION()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Extension"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Extension"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_FILENAME()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("FileName"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("FileName"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_FILTERNAME()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("FilterName"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("FilterName"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_FILTEROPTIONS()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("FilterOptions"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("FilterOptions"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_FORMAT()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Format"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Format"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_FRAME()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Frame"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Frame"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_FRAMENAME()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("FrameName"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("FrameName"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_HIDDEN()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Hidden"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Hidden"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_INPUTSTREAM()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("InputStream"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("InputStream"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_INTERACTIONHANDLER()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_AUTHENTICATIONHANDLER()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("AuthenticationHandler"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("AuthenticationHandler"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_JUMPMARK()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("JumpMark"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("JumpMark"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_MACROEXECUTIONMODE()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_MEDIATYPE()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_MINIMIZED()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Minimized"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Minimized"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_NOAUTOSAVE()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("NoAutoSave"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("NoAutoSave"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_OPENNEWVIEW()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("OpenNewView"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("OpenNewView"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_OUTPUTSTREAM()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("OutputStream"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("OutputStream"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_PATTERN()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Pattern"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Pattern"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_POSSIZE()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("PosSize"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("PosSize"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_POSTDATA()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("PostData"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("PostData"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_POSTSTRING()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("PostString"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("PostString"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_PREVIEW()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Preview"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Preview"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_READONLY()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("ReadOnly"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("ReadOnly"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_REFERRER()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Referer"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Referer"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_SILENT()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Silent"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Silent"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_STATUSINDICATOR()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("StatusIndicator"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("StatusIndicator"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_STREAM()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Stream"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Stream"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_STREAMFOROUTPUT()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("StreamForOutput"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("StreamForOutput"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_TEMPLATENAME()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("TemplateName"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("TemplateName"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_TEMPLATEREGIONNAME()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("TemplateRegionName"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("TemplateRegionName"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_TYPENAME()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("TypeName"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("TypeName"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_UCBCONTENT()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("UCBContent"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("UCBContent"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_UPDATEDOCMODE()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("UpdateDocMode"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("UpdateDocMode"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_URL()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("URL"));
- return sProp;
+ static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("URL"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_VERSION()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Version"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Version"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_VIEWID()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("ViewId"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("ViewId"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_REPAIRPACKAGE()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("RepairPackage"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("RepairPackage"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_DOCUMENTTITLE()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_MODEL()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Model"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Model"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_PASSWORD()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Password"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Password"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_TITLE()
{
- static const ::rtl::OUString sProp(RTL_CONSTASCII_USTRINGPARAM("Title"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("Title"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_SALVAGEDFILE()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("SalvagedFile"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("SalvagedFile"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_VIEWONLY()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("ViewOnly"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("ViewOnly"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_DOCUMENTBASEURL()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("DocumentBaseURL"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("DocumentBaseURL"));
+ return sProp;
}
const ::rtl::OUString& MediaDescriptor::PROP_VIEWCONTROLLERNAME()
{
- static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("ViewControllerName"));
- return sProp;
+ static const ::rtl::OUString
sProp(RTL_CONSTASCII_USTRINGPARAM("ViewControllerName"));
+ return sProp;
}
/*-----------------------------------------------
- 10.03.2004 08:09
+ 10.03.2004 08:09
-----------------------------------------------*/
MediaDescriptor::MediaDescriptor()
- : SequenceAsHashMap()
+ : SequenceAsHashMap()
{
}
/*-----------------------------------------------
- 10.03.2004 08:09
+ 10.03.2004 08:09
-----------------------------------------------*/
MediaDescriptor::MediaDescriptor(const css::uno::Any& aSource)
- : SequenceAsHashMap(aSource)
+ : SequenceAsHashMap(aSource)
{
}
/*-----------------------------------------------
- 10.03.2004 08:09
+ 10.03.2004 08:09
-----------------------------------------------*/
MediaDescriptor::MediaDescriptor(const css::uno::Sequence<
css::beans::PropertyValue >& lSource)
- : SequenceAsHashMap(lSource)
+ : SequenceAsHashMap(lSource)
{
}
/*-----------------------------------------------
- 10.03.2004 08:09
+ 10.03.2004 08:09
-----------------------------------------------*/
MediaDescriptor::MediaDescriptor(const css::uno::Sequence<
css::beans::NamedValue >& lSource)
- : SequenceAsHashMap(lSource)
+ : SequenceAsHashMap(lSource)
{
}
/*-----------------------------------------------
- 18.11.2004 13:37
+ 18.11.2004 13:37
-----------------------------------------------*/
sal_Bool MediaDescriptor::isStreamReadOnly() const
{
- static ::rtl::OUString CONTENTSCHEME_FILE =
::rtl::OUString::createFromAscii("file");
- static ::rtl::OUString CONTENTPROP_ISREADONLY =
::rtl::OUString::createFromAscii("IsReadOnly");
- static sal_Bool READONLY_FALLBACK = sal_False;
+ static ::rtl::OUString CONTENTSCHEME_FILE =
::rtl::OUString::createFromAscii("file");
+ static ::rtl::OUString CONTENTPROP_ISREADONLY =
::rtl::OUString::createFromAscii("IsReadOnly");
+ static sal_Bool READONLY_FALLBACK =
sal_False;
- sal_Bool bReadOnly = READONLY_FALLBACK;
+ sal_Bool bReadOnly = READONLY_FALLBACK;
- // check for explicit readonly state
- const_iterator pIt = find(MediaDescriptor::PROP_READONLY());
- if (pIt != end())
- {
+ // check for explicit readonly state
+ const_iterator pIt = find(MediaDescriptor::PROP_READONLY());
+ if (pIt != end())
+ {
pIt->second >>= bReadOnly;
- return bReadOnly;
- }
-
- // streams based on post data are readonly by definition
- pIt = find(MediaDescriptor::PROP_POSTDATA());
- if (pIt != end())
- return sal_True;
-
- // A XStream capsulate XInputStream and XOutputStream ...
- // If it exists - the file must be open in read/write mode!
- pIt = find(MediaDescriptor::PROP_STREAM());
- if (pIt != end())
- return sal_False;
-
- // Only file system content provider is able to provide XStream
- // so for this content impossibility to create XStream triggers
- // switch to readonly mode.
- try
- {
- css::uno::Reference< css::ucb::XContent > xContent =
getUnpackedValueOrDefault(MediaDescriptor::PROP_UCBCONTENT(),
css::uno::Reference< css::ucb::XContent >());
- if (xContent.is())
- {
- css::uno::Reference< css::ucb::XContentIdentifier >
xId(xContent->getIdentifier(), css::uno::UNO_QUERY);
- ::rtl::OUString aScheme;
- if (xId.is())
- aScheme = xId->getContentProviderScheme();
-
- if (aScheme.equalsIgnoreAsciiCase(CONTENTSCHEME_FILE))
- bReadOnly = sal_True;
- else
- {
- ::ucbhelper::Content aContent(xContent, css::uno::Reference<
css::ucb::XCommandEnvironment >());
- aContent.getPropertyValue(CONTENTPROP_ISREADONLY) >>=
bReadOnly;
- }
- }
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- {}
-
- return bReadOnly;
+ return bReadOnly;
+ }
+
+ // streams based on post data are readonly by definition
+ pIt = find(MediaDescriptor::PROP_POSTDATA());
+ if (pIt != end())
+ return sal_True;
+
+ // A XStream capsulate XInputStream and XOutputStream ...
+ // If it exists - the file must be open in read/write mode!
+ pIt = find(MediaDescriptor::PROP_STREAM());
+ if (pIt != end())
+ return sal_False;
+
+ // Only file system content provider is able to provide XStream
+ // so for this content impossibility to create XStream triggers
+ // switch to readonly mode.
+ try
+ {
+ css::uno::Reference< css::ucb::XContent > xContent =
getUnpackedValueOrDefault(MediaDescriptor::PROP_UCBCONTENT(),
css::uno::Reference< css::ucb::XContent >());
+ if (xContent.is())
+ {
+ css::uno::Reference< css::ucb::XContentIdentifier >
xId(xContent->getIdentifier(), css::uno::UNO_QUERY);
+ ::rtl::OUString aScheme;
+ if (xId.is())
+ aScheme = xId->getContentProviderScheme();
+
+ if (aScheme.equalsIgnoreAsciiCase(CONTENTSCHEME_FILE))
+ bReadOnly = sal_True;
+ else
+ {
+ ::ucbhelper::Content aContent(xContent,
css::uno::Reference< css::ucb::XCommandEnvironment >());
+
aContent.getPropertyValue(CONTENTPROP_ISREADONLY) >>= bReadOnly;
+ }
+ }
+ }
+ catch(const css::uno::RuntimeException& exRun)
+ { throw exRun; }
+ catch(const css::uno::Exception&)
+ {}
+
+ return bReadOnly;
}
// ----------------------------------------------------------------------------
css::uno::Any MediaDescriptor::getComponentDataEntry( const ::rtl::OUString&
rName ) const
{
- css::uno::Any aEntry;
- SequenceAsHashMap::const_iterator aPropertyIter = find(
PROP_COMPONENTDATA() );
- if( aPropertyIter != end() )
- return NamedValueCollection( aPropertyIter->second ).get( rName );
- return css::uno::Any();
+ css::uno::Any aEntry;
+ SequenceAsHashMap::const_iterator aPropertyIter = find(
PROP_COMPONENTDATA() );
+ if( aPropertyIter != end() )
+ return NamedValueCollection( aPropertyIter->second ).get( rName
);
+ return css::uno::Any();
}
void MediaDescriptor::setComponentDataEntry( const ::rtl::OUString& rName,
const css::uno::Any& rValue )
{
- if( rValue.hasValue() )
- {
- // get or create the 'ComponentData' property entry
- css::uno::Any& rCompDataAny = operator[]( PROP_COMPONENTDATA() );
- // insert the value (retain sequence type, create NamedValue elements
by default)
- bool bHasNamedValues = !rCompDataAny.hasValue() || rCompDataAny.has<
css::uno::Sequence< css::beans::NamedValue > >();
- bool bHasPropValues = rCompDataAny.has< css::uno::Sequence<
css::beans::PropertyValue > >();
- OSL_ENSURE( bHasNamedValues || bHasPropValues,
"MediaDescriptor::setComponentDataEntry - incompatible 'ComponentData' property
in media descriptor" );
- if( bHasNamedValues || bHasPropValues )
- {
- // insert or overwrite the passed value
- SequenceAsHashMap aCompDataMap( rCompDataAny );
- aCompDataMap[ rName ] = rValue;
- // write back the sequence (restore sequence with correct element
type)
- rCompDataAny = aCompDataMap.getAsConstAny( bHasPropValues );
- }
- }
- else
- {
- // if an empty Any is passed, clear the entry
- clearComponentDataEntry( rName );
- }
+ if( rValue.hasValue() )
+ {
+ // get or create the 'ComponentData' property entry
+ css::uno::Any& rCompDataAny = operator[]( PROP_COMPONENTDATA()
);
+ // insert the value (retain sequence type, create NamedValue
elements by default)
+ bool bHasNamedValues = !rCompDataAny.hasValue() ||
rCompDataAny.has< css::uno::Sequence< css::beans::NamedValue > >();
+ bool bHasPropValues = rCompDataAny.has< css::uno::Sequence<
css::beans::PropertyValue > >();
+ OSL_ENSURE( bHasNamedValues || bHasPropValues,
"MediaDescriptor::setComponentDataEntry - incompatible 'ComponentData' property
in media descriptor" );
+ if( bHasNamedValues || bHasPropValues )
+ {
+ // insert or overwrite the passed value
+ SequenceAsHashMap aCompDataMap( rCompDataAny );
+ aCompDataMap[ rName ] = rValue;
+ // write back the sequence (restore sequence with
correct element type)
+ rCompDataAny = aCompDataMap.getAsConstAny(
bHasPropValues );
+ }
+ }
+ else
+ {
+ // if an empty Any is passed, clear the entry
+ clearComponentDataEntry( rName );
+ }
}
void MediaDescriptor::clearComponentDataEntry( const ::rtl::OUString& rName )
{
- SequenceAsHashMap::iterator aPropertyIter = find( PROP_COMPONENTDATA() );
- if( aPropertyIter != end() )
- {
- css::uno::Any& rCompDataAny = aPropertyIter->second;
- bool bHasNamedValues = rCompDataAny.has< css::uno::Sequence<
css::beans::NamedValue > >();
- bool bHasPropValues = rCompDataAny.has< css::uno::Sequence<
css::beans::PropertyValue > >();
- OSL_ENSURE( bHasNamedValues || bHasPropValues,
"MediaDescriptor::clearComponentDataEntry - incompatible 'ComponentData'
property in media descriptor" );
- if( bHasNamedValues || bHasPropValues )
- {
- // remove the value with the passed name
- SequenceAsHashMap aCompDataMap( rCompDataAny );
- aCompDataMap.erase( rName );
- // write back the sequence, or remove it completely if it is empty
- if( aCompDataMap.empty() )
- erase( aPropertyIter );
- else
- rCompDataAny = aCompDataMap.getAsConstAny( bHasPropValues );
- }
- }
+ SequenceAsHashMap::iterator aPropertyIter = find( PROP_COMPONENTDATA()
);
+ if( aPropertyIter != end() )
+ {
+ css::uno::Any& rCompDataAny = aPropertyIter->second;
+ bool bHasNamedValues = rCompDataAny.has< css::uno::Sequence<
css::beans::NamedValue > >();
+ bool bHasPropValues = rCompDataAny.has< css::uno::Sequence<
css::beans::PropertyValue > >();
+ OSL_ENSURE( bHasNamedValues || bHasPropValues,
"MediaDescriptor::clearComponentDataEntry - incompatible 'ComponentData'
property in media descriptor" );
+ if( bHasNamedValues || bHasPropValues )
+ {
+ // remove the value with the passed name
+ SequenceAsHashMap aCompDataMap( rCompDataAny );
+ aCompDataMap.erase( rName );
+ // write back the sequence, or remove it completely if
it is empty
+ if( aCompDataMap.empty() )
+ erase( aPropertyIter );
+ else
+ rCompDataAny = aCompDataMap.getAsConstAny(
bHasPropValues );
+ }
+ }
}
/*-----------------------------------------------
- 10.03.2004 09:02
+ 10.03.2004 09:02
-----------------------------------------------*/
sal_Bool MediaDescriptor::addInputStream()
{
- return impl_addInputStream( sal_True );
+ return impl_addInputStream( sal_True );
}
/*-----------------------------------------------*/
sal_Bool MediaDescriptor::addInputStreamOwnLock()
{
- // Own lock file implementation
+ // Own lock file implementation
- sal_Bool bUseLock = sal_True; // the system file locking is used per
default
- try
- {
+ sal_Bool bUseLock = sal_True; // the system file locking is used per
default
+ try
+ {
css::uno::Reference< css::uno::XInterface > xCommonConfig =
::comphelper::ConfigurationHelper::openConfig(
::comphelper::getProcessServiceFactory(),
@@ -566,25 +566,25 @@ sal_Bool MediaDescriptor::addInputStreamOwnLock()
if ( !xCommonConfig.is() )
throw css::uno::RuntimeException();
- ::comphelper::ConfigurationHelper::readRelativeKey(
- xCommonConfig,
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Misc/" ) ),
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"UseDocumentSystemFileLocking" ) ) ) >>= bUseLock;
- }
- catch( const css::uno::Exception& )
- {
- }
+ ::comphelper::ConfigurationHelper::readRelativeKey(
+ xCommonConfig,
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"Misc/" ) ),
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"UseDocumentSystemFileLocking" ) ) ) >>= bUseLock;
+ }
+ catch( const css::uno::Exception& )
+ {
+ }
- return impl_addInputStream( bUseLock );
+ return impl_addInputStream( bUseLock );
}
/*-----------------------------------------------*/
sal_Bool MediaDescriptor::impl_addInputStream( sal_Bool bLockFile )
{
- // check for an already existing stream item first
- const_iterator pIt = find(MediaDescriptor::PROP_INPUTSTREAM());
- if (pIt != end())
- return sal_True;
+ // check for an already existing stream item first
+ const_iterator pIt = find(MediaDescriptor::PROP_INPUTSTREAM());
+ if (pIt != end())
+ return sal_True;
try
{
@@ -607,8 +607,8 @@ sal_Bool MediaDescriptor::impl_addInputStream( sal_Bool
bLockFile )
::rtl::OUString::createFromAscii("Found
no URL."),
css::uno::Reference<
css::uno::XInterface >());
- // Parse URL! Only the main part has to be used further. E.g. a
jumpmark can make trouble
- ::rtl::OUString sNormalizedURL = impl_normalizeURL( sURL );
+ // Parse URL! Only the main part has to be used further. E.g. a
jumpmark can make trouble
+ ::rtl::OUString sNormalizedURL = impl_normalizeURL( sURL );
return impl_openStreamWithURL( sNormalizedURL, bLockFile );
}
#if OSL_DEBUG_LEVEL>0
@@ -628,10 +628,10 @@ sal_Bool MediaDescriptor::impl_addInputStream( sal_Bool
bLockFile )
}
/*-----------------------------------------------
- 25.03.2004 12:38
+ 25.03.2004 12:38
-----------------------------------------------*/
sal_Bool MediaDescriptor::impl_openStreamWithPostData( const
css::uno::Reference< css::io::XInputStream >& _rxPostData )
- throw(::com::sun::star::uno::RuntimeException)
+ throw(::com::sun::star::uno::RuntimeException)
{
if ( !_rxPostData.is() )
throw css::lang::IllegalArgumentException(
@@ -641,74 +641,74 @@ sal_Bool MediaDescriptor::impl_openStreamWithPostData(
const css::uno::Reference
// PostData can't be used in read/write mode!
(*this)[MediaDescriptor::PROP_READONLY()] <<= sal_True;
- // prepare the environment
+ // prepare the environment
css::uno::Reference< css::task::XInteractionHandler > xInteraction =
getUnpackedValueOrDefault(
MediaDescriptor::PROP_INTERACTIONHANDLER(),
css::uno::Reference< css::task::XInteractionHandler >());
css::uno::Reference< css::ucb::XProgressHandler > xProgress;
- ::ucbhelper::CommandEnvironment* pCommandEnv = new
::ucbhelper::CommandEnvironment(xInteraction, xProgress);
+ ::ucbhelper::CommandEnvironment* pCommandEnv = new
::ucbhelper::CommandEnvironment(xInteraction, xProgress);
css::uno::Reference< css::ucb::XCommandEnvironment >
xCommandEnv(static_cast< css::ucb::XCommandEnvironment* >(pCommandEnv),
css::uno::UNO_QUERY);
- // media type
+ // media type
::rtl::OUString sMediaType =
getUnpackedValueOrDefault(MediaDescriptor::PROP_MEDIATYPE(), ::rtl::OUString());
- if ( sMediaType.isEmpty() )
- {
- sMediaType =
::rtl::OUString::createFromAscii("application/x-www-form-urlencoded");
- (*this)[MediaDescriptor::PROP_MEDIATYPE()] <<= sMediaType;
- }
+ if ( sMediaType.isEmpty() )
+ {
+ sMediaType =
::rtl::OUString::createFromAscii("application/x-www-form-urlencoded");
+ (*this)[MediaDescriptor::PROP_MEDIATYPE()] <<= sMediaType;
+ }
- // url
+ // url
::rtl::OUString sURL( getUnpackedValueOrDefault( PROP_URL(),
::rtl::OUString() ) );
- css::uno::Reference< css::io::XInputStream > xResultStream;
- try
- {
- // seek PostData stream to the beginning
- css::uno::Reference< css::io::XSeekable > xSeek( _rxPostData,
css::uno::UNO_QUERY );
- if ( xSeek.is() )
- xSeek->seek( 0 );
-
- // a content for the URL
- ::ucbhelper::Content aContent( sURL, xCommandEnv );
-
- // use post command
- css::ucb::PostCommandArgument2 aPostArgument;
- aPostArgument.Source = _rxPostData;
- css::uno::Reference< css::io::XActiveDataSink > xSink( new
ucbhelper::ActiveDataSink );
- aPostArgument.Sink = xSink;
- aPostArgument.MediaType = sMediaType;
- aPostArgument.Referer = getUnpackedValueOrDefault( PROP_REFERRER(),
::rtl::OUString() );
-
- ::rtl::OUString sCommandName( RTL_CONSTASCII_USTRINGPARAM( "post" ) );
- aContent.executeCommand( sCommandName, css::uno::makeAny(
aPostArgument ) );
-
- // get result
- xResultStream = xSink->getInputStream();
- }
- catch( const css::uno::Exception& )
- {
- }
-
- // success?
- if ( !xResultStream.is() )
- {
- OSL_ENSURE( false, "no valid reply to the HTTP-Post" );
- return sal_False;
- }
-
- (*this)[MediaDescriptor::PROP_INPUTSTREAM()] <<= xResultStream;
- return sal_True;
+ css::uno::Reference< css::io::XInputStream > xResultStream;
+ try
+ {
+ // seek PostData stream to the beginning
+ css::uno::Reference< css::io::XSeekable > xSeek( _rxPostData,
css::uno::UNO_QUERY );
+ if ( xSeek.is() )
+ xSeek->seek( 0 );
+
+ // a content for the URL
+ ::ucbhelper::Content aContent( sURL, xCommandEnv );
+
+ // use post command
+ css::ucb::PostCommandArgument2 aPostArgument;
+ aPostArgument.Source = _rxPostData;
+ css::uno::Reference< css::io::XActiveDataSink > xSink( new
ucbhelper::ActiveDataSink );
+ aPostArgument.Sink = xSink;
+ aPostArgument.MediaType = sMediaType;
+ aPostArgument.Referer = getUnpackedValueOrDefault(
PROP_REFERRER(), ::rtl::OUString() );
+
+ ::rtl::OUString sCommandName( RTL_CONSTASCII_USTRINGPARAM(
"post" ) );
+ aContent.executeCommand( sCommandName, css::uno::makeAny(
aPostArgument ) );
+
+ // get result
+ xResultStream = xSink->getInputStream();
+ }
+ catch( const css::uno::Exception& )
+ {
+ }
+
+ // success?
+ if ( !xResultStream.is() )
+ {
+ OSL_ENSURE( false, "no valid reply to the HTTP-Post" );
+ return sal_False;
+ }
+
+ (*this)[MediaDescriptor::PROP_INPUTSTREAM()] <<= xResultStream;
+ return sal_True;
}
/*-----------------------------------------------*/
/*-----------------------------------------------
- 25.03.2004 12:29
+ 25.03.2004 12:29
-----------------------------------------------*/
sal_Bool MediaDescriptor::impl_openStreamWithURL( const ::rtl::OUString& sURL,
sal_Bool bLockFile )
- throw(::com::sun::star::uno::RuntimeException)
+ throw(::com::sun::star::uno::RuntimeException)
{
- // prepare the environment
+ // prepare the environment
css::uno::Reference< css::task::XInteractionHandler > xOrgInteraction =
getUnpackedValueOrDefault(
MediaDescriptor::PROP_INTERACTIONHANDLER(),
css::uno::Reference< css::task::XInteractionHandler >());
@@ -716,95 +716,95 @@ sal_Bool MediaDescriptor::impl_openStreamWithURL( const
::rtl::OUString& sURL, s
MediaDescriptor::PROP_AUTHENTICATIONHANDLER(),
css::uno::Reference< css::task::XInteractionHandler >());
- StillReadWriteInteraction* pInteraction = new
StillReadWriteInteraction(xOrgInteraction, xAuthenticationInteraction);
+ StillReadWriteInteraction* pInteraction = new
StillReadWriteInteraction(xOrgInteraction, xAuthenticationInteraction);
css::uno::Reference< css::task::XInteractionHandler >
xInteraction(static_cast< css::task::XInteractionHandler* >(pInteraction),
css::uno::UNO_QUERY);
css::uno::Reference< css::ucb::XProgressHandler > xProgress;
- ::ucbhelper::CommandEnvironment* pCommandEnv = new
::ucbhelper::CommandEnvironment(xInteraction, xProgress);
+ ::ucbhelper::CommandEnvironment* pCommandEnv = new
::ucbhelper::CommandEnvironment(xInteraction, xProgress);
css::uno::Reference< css::ucb::XCommandEnvironment >
xCommandEnv(static_cast< css::ucb::XCommandEnvironment* >(pCommandEnv),
css::uno::UNO_QUERY);
- // try to create the content
+ // try to create the content
// no content -> no stream => return immediately with FALSE
- ::ucbhelper::Content aContent;
- css::uno::Reference< css::ucb::XContent > xContent;
- try
- {
+ ::ucbhelper::Content
aContent;
+ css::uno::Reference< css::ucb::XContent > xContent;
+ try
+ {
aContent = ::ucbhelper::Content(sURL, xCommandEnv);
- xContent = aContent.get();
- }
- catch(const css::uno::RuntimeException&)
- { throw; }
- catch(const css::ucb::ContentCreationException&)
- { return sal_False; } // TODO error handling
+ xContent = aContent.get();
+ }
+ catch(const css::uno::RuntimeException&)
+ { throw; }
+ catch(const css::ucb::ContentCreationException&)
+ { return sal_False; } // TODO error handling
catch(const css::uno::Exception&)
- { return sal_False; } // TODO error handling
+ { return sal_False; } // TODO error handling
- // try to open the file in read/write mode
- // (if its allowed to do so).
- // But handle errors in a "hidden mode". Because
- // we try it readonly later - if read/write isn't an option.
- css::uno::Reference< css::io::XStream > xStream ;
- css::uno::Reference< css::io::XInputStream > xInputStream;
+ // try to open the file in read/write mode
+ // (if its allowed to do so).
+ // But handle errors in a "hidden mode". Because
+ // we try it readonly later - if read/write isn't an option.
+ css::uno::Reference< css::io::XStream > xStream
;
+ css::uno::Reference< css::io::XInputStream > xInputStream;
- sal_Bool bReadOnly = sal_False;
- //bModeRequestedExplicitly means 'read/write mode requested explicitly'
+ sal_Bool bReadOnly = sal_False;
+ //bModeRequestedExplicitly means 'read/write mode requested explicitly'
sal_Bool bModeRequestedExplicitly = sal_False;
- // MediaDescriptor::PROP_READONLY is present only if the mediadescriptor
was used at least one time
- // that is, it exists if the file was changed from readonly mode to
read/write using the GUI interface
- const_iterator pIt = find(MediaDescriptor::PROP_READONLY());
- if (pIt != end())
+ // MediaDescriptor::PROP_READONLY is present only if the
mediadescriptor was used at least one time
+ // that is, it exists if the file was changed from readonly mode to
read/write using the GUI interface
+ const_iterator pIt = find(MediaDescriptor::PROP_READONLY());
+ if (pIt != end())
{
pIt->second >>= bReadOnly;
- // TODO: thinking a different way: we enable the switch to r/o even
though the file
- // was requested r/w explicitly (consider the case were we want to
open a file in r/w mode (e.g. switching from r/o mode to r/w mode
- // according to GUI request) instead of returning an error
+ // TODO: thinking a different way: we enable the switch to r/o
even though the file
+ // was requested r/w explicitly (consider the case were we want
to open a file in r/w mode (e.g. switching from r/o mode to r/w mode
+ // according to GUI request) instead of returning an error
bModeRequestedExplicitly = sal_True;
}
- if ( !bReadOnly && bLockFile )
- {
- try
- {
- // TODO: use "special" still interaction to suppress error messages
- xStream = aContent.openWriteableStream();
- if (xStream.is())
- xInputStream = xStream->getInputStream();
- }
- catch(const css::uno::RuntimeException&)
- { throw; }
- catch(const css::uno::Exception&)
- {
- // ignore exception, if reason was problem reasoned on
- // open it in WRITEABLE mode! Then we try it READONLY
- // later a second time.
- // All other errors must be handled as real error and
- // break this method.
- if (!pInteraction->wasWriteError() || bModeRequestedExplicitly)
- {
- //-> i126305
- // If the protocol is webdav, then we need to treat the
stream as readonly, even if the
- // operation was requested as read/write explicitly (the
WebDAV UCB implementation is monodirectional
- // read or write not both at the same time).
- rtl::OUString aScheme;
- css::uno::Reference< css::ucb::XContentIdentifier >
xContId(
- aContent.get().is() ? aContent.get()->getIdentifier()
: 0 );
- if ( xContId.is() )
- aScheme = xContId->getContentProviderScheme();
- if(!aScheme.equalsIgnoreAsciiCaseAscii( "http" ) &&
!aScheme.equalsIgnoreAsciiCaseAscii( "https" ))
- return sal_False;
- //<- i126305
- }
-
- xStream.clear();
- xInputStream.clear();
- }
- }
-
- // If opening of the stream in read/write mode wasn't allowed
- // or failed by an error - we must try it in readonly mode.
- if (!xInputStream.is())
- {
- rtl::OUString aScheme;
+ if ( !bReadOnly && bLockFile )
+ {
+ try
+ {
+ // TODO: use "special" still interaction to suppress
error messages
+ xStream = aContent.openWriteableStream();
+ if (xStream.is())
+ xInputStream = xStream->getInputStream();
+ }
+ catch(const css::uno::RuntimeException&)
+ { throw; }
+ catch(const css::uno::Exception&)
+ {
+ // ignore exception, if reason was problem
reasoned on
+ // open it in WRITEABLE mode! Then we try it
READONLY
+ // later a second time.
+ // All other errors must be handled as real
error and
+ // break this method.
+ if (!pInteraction->wasWriteError() ||
bModeRequestedExplicitly)
+ {
+ //-> i126305
+ // If the protocol is webdav, then we
need to treat the stream as readonly, even if the
+ // operation was requested as
read/write explicitly (the WebDAV UCB implementation is monodirectional
+ // read or write not both at the same
time).
+ rtl::OUString aScheme;
+ css::uno::Reference<
css::ucb::XContentIdentifier > xContId(
+ aContent.get().is() ?
aContent.get()->getIdentifier() : 0 );
+ if ( xContId.is() )
+ aScheme =
xContId->getContentProviderScheme();
+ if(!aScheme.equalsIgnoreAsciiCaseAscii(
"http" ) && !aScheme.equalsIgnoreAsciiCaseAscii( "https" ))
+ return sal_False;
+ //<- i126305
+ }
+
+ xStream.clear();
+ xInputStream.clear();
+ }
+ }
+
+ // If opening of the stream in read/write mode wasn't allowed
+ // or failed by an error - we must try it in readonly mode.
+ if (!xInputStream.is())
+ {
+ rtl::OUString aScheme;
try
{
@@ -817,89 +817,88 @@ sal_Bool MediaDescriptor::impl_openStreamWithURL( const
::rtl::OUString& sURL, s
// Only file system content provider is able to provide
XStream
// so for this content impossibility to create XStream
triggers
// switch to readonly mode in case of opening with
locking on
- if( bLockFile && aScheme.equalsIgnoreAsciiCaseAscii( "file" ) )
- bReadOnly = sal_True;
+ if( bLockFile && aScheme.equalsIgnoreAsciiCaseAscii(
"file" ) )
+ bReadOnly = sal_True;
else
- {
- sal_Bool bRequestReadOnly = bReadOnly;
+ {
+ sal_Bool bRequestReadOnly = bReadOnly;
aContent.getPropertyValue( ::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ) ) >>= bReadOnly;
- if ( bReadOnly && !bRequestReadOnly &&
bModeRequestedExplicitly )
- return sal_False; // the document is explicitly
requested with WRITEABLE mode
- }
+ if ( bReadOnly && !bRequestReadOnly &&
bModeRequestedExplicitly )
+ return sal_False; // the
document is explicitly requested with WRITEABLE mode
+ }
}
- catch(const css::uno::RuntimeException&)
- { throw; }
- catch(const css::uno::Exception&)
- { /* no error handling if IsReadOnly property does not exist for
UCP */ }
+ catch(const css::uno::RuntimeException&)
+ { throw; }
+ catch(const css::uno::Exception&)
+ { /* no error handling if IsReadOnly property does not
exist for UCP */ }
if ( bReadOnly )
- (*this)[MediaDescriptor::PROP_READONLY()] <<= bReadOnly;
-
- pInteraction->resetInterceptions();
- pInteraction->resetErrorStates();
- try
- {
- // all the contents except file-URLs should be opened as usual
- if ( bLockFile || !aScheme.equalsIgnoreAsciiCaseAscii( "file" ) )
- xInputStream = aContent.openStream();
- else
- xInputStream = aContent.openStreamNoLock();
- }
- catch(const css::uno::RuntimeException&)
- { throw; }
- catch(const css::uno::Exception&)
- { return sal_False; }
- }
-
- // add streams to the descriptor
- if (xContent.is())
- (*this)[MediaDescriptor::PROP_UCBCONTENT()] <<= xContent;
- if (xStream.is())
- (*this)[MediaDescriptor::PROP_STREAM()] <<= xStream;
- if (xInputStream.is())
- (*this)[MediaDescriptor::PROP_INPUTSTREAM()] <<= xInputStream;
-
- // At least we need an input stream. The r/w stream is optional ...
- return xInputStream.is();
+ (*this)[MediaDescriptor::PROP_READONLY()] <<= bReadOnly;
+
+ pInteraction->resetInterceptions();
+ pInteraction->resetErrorStates();
+ try
+ {
+ // all the contents except file-URLs should be opened
as usual
+ if ( bLockFile || !aScheme.equalsIgnoreAsciiCaseAscii(
"file" ) )
+ xInputStream = aContent.openStream();
+ else
+ xInputStream = aContent.openStreamNoLock();
+ }
+ catch(const css::uno::RuntimeException&)
+ { throw; }
+ catch(const css::uno::Exception&)
+ { return sal_False; }
+ }
+
+ // add streams to the descriptor
+ if (xContent.is())
+ (*this)[MediaDescriptor::PROP_UCBCONTENT()] <<= xContent;
+ if (xStream.is())
+ (*this)[MediaDescriptor::PROP_STREAM()] <<= xStream;
+ if (xInputStream.is())
+ (*this)[MediaDescriptor::PROP_INPUTSTREAM()] <<= xInputStream;
+
+ // At least we need an input stream. The r/w stream is optional ...
+ return xInputStream.is();
}
/*-----------------------------------------------
- 10.09.2004 10:51
+ 10.09.2004 10:51
-----------------------------------------------*/
::rtl::OUString MediaDescriptor::impl_normalizeURL(const ::rtl::OUString& sURL)
{
- /* Remove Jumpmarks (fragments) of an URL only here.
- They are not part of any URL and as a result may be
- no ucb content can be created then.
- On the other side arguments must exists ... because
- they are part of an URL.
-
- Do not use the URLTransformer service here. Because
- it parses the URL in another way. It's main part isn't enough
- and it's complete part contains the jumpmark (fragment) parameter ...
- */
- static ::rtl::OUString SERVICENAME_URIREFERENCEFACTORY =
::rtl::OUString::createFromAscii("com.sun.star.uri.UriReferenceFactory");
-
- try
- {
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR =
::comphelper::getProcessServiceFactory();
- css::uno::Reference< css::uri::XUriReferenceFactory >
xUriFactory(xSMGR->createInstance(SERVICENAME_URIREFERENCEFACTORY),
css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::uri::XUriReference > xUriRef =
xUriFactory->parse(sURL);
- if (xUriRef.is())
- {
- xUriRef->clearFragment();
- return xUriRef->getUriReference();
- }
- }
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- {}
-
- // If an error occurred ... return the original URL.
- // It's a try .-)
- return sURL;
+ /* Remove Jumpmarks (fragments) of an URL only here.
+ They are not part of any URL and as a result may be
+ no ucb content can be created then.
+ On the other side arguments must exists ... because
+ they are part of an URL.
+
+ Do not use the URLTransformer service here. Because
+ it parses the URL in another way. It's main part isn't enough
+ and it's complete part contains the jumpmark (fragment) parameter ...
+ */
+ static ::rtl::OUString SERVICENAME_URIREFERENCEFACTORY =
::rtl::OUString::createFromAscii("com.sun.star.uri.UriReferenceFactory");
+
+ try
+ {
+ css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR
= ::comphelper::getProcessServiceFactory();
+ css::uno::Reference< css::uri::XUriReferenceFactory >
xUriFactory(xSMGR->createInstance(SERVICENAME_URIREFERENCEFACTORY),
css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::uri::XUriReference >
xUriRef = xUriFactory->parse(sURL);
+ if (xUriRef.is())
+ {
+ xUriRef->clearFragment();
+ return xUriRef->getUriReference();
+ }
+ }
+ catch(const css::uno::RuntimeException& exRun)
+ { throw exRun; }
+ catch(const css::uno::Exception&)
+ {}
+
+ // If an error occurred ... return the original URL.
+ // It's a try .-)
+ return sURL;
}
} // namespace comphelper
-
diff --git a/main/comphelper/source/property/ChainablePropertySet.cxx
b/main/comphelper/source/property/ChainablePropertySet.cxx
index 4179364..9daa2e1 100644
--- a/main/comphelper/source/property/ChainablePropertySet.cxx
+++ b/main/comphelper/source/property/ChainablePropertySet.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -27,7 +27,7 @@
#include <comphelper/ChainablePropertySetInfo.hxx>
#include <vos/mutex.hxx>
-#include <memory> // STL auto_ptr
+#include <memory> // STL auto_ptr
using namespace ::rtl;
@@ -38,7 +38,7 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using ::vos::IMutex;
-ChainablePropertySet::ChainablePropertySet(
comphelper::ChainablePropertySetInfo* pInfo, vos::IMutex *pMutex )
+ChainablePropertySet::ChainablePropertySet(
comphelper::ChainablePropertySetInfo* pInfo, vos::IMutex *pMutex )
throw()
: mpInfo ( pInfo )
, mpMutex ( pMutex )
@@ -46,13 +46,13 @@ ChainablePropertySet::ChainablePropertySet(
comphelper::ChainablePropertySetInfo
{
}
-ChainablePropertySet::~ChainablePropertySet()
+ChainablePropertySet::~ChainablePropertySet()
throw()
{
}
// XPropertySet
-Reference< XPropertySetInfo > SAL_CALL
ChainablePropertySet::getPropertySetInfo( )
+Reference< XPropertySetInfo > SAL_CALL
ChainablePropertySet::getPropertySetInfo( )
throw(RuntimeException)
{
return mxInfo;
@@ -70,13 +70,13 @@ void ChainablePropertySet::unlockMutex()
mpMutex->release();
}
-void SAL_CALL ChainablePropertySet::setPropertyValue( const ::rtl::OUString&
rPropertyName, const Any& rValue )
+void SAL_CALL ChainablePropertySet::setPropertyValue( const ::rtl::OUString&
rPropertyName, const Any& rValue )
throw(UnknownPropertyException, PropertyVetoException,
IllegalArgumentException, WrappedTargetException, RuntimeException)
{
- // acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- std::auto_ptr< vos::OGuard > pMutexGuard;
- if (mpMutex)
- pMutexGuard.reset( new vos::OGuard(mpMutex) );
+ // acquire mutex in c-tor and releases it in the d-tor (exception
safe!).
+ std::auto_ptr< vos::OGuard > pMutexGuard;
+ if (mpMutex)
+ pMutexGuard.reset( new vos::OGuard(mpMutex) );
PropertyInfoHash::const_iterator aIter = mpInfo->maMap.find (
rPropertyName );
@@ -88,13 +88,13 @@ void SAL_CALL ChainablePropertySet::setPropertyValue( const
::rtl::OUString& rPr
_postSetValues();
}
-Any SAL_CALL ChainablePropertySet::getPropertyValue( const ::rtl::OUString&
rPropertyName )
+Any SAL_CALL ChainablePropertySet::getPropertyValue( const ::rtl::OUString&
rPropertyName )
throw(UnknownPropertyException, WrappedTargetException,
RuntimeException)
{
- // acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- std::auto_ptr< vos::OGuard > pMutexGuard;
- if (mpMutex)
- pMutexGuard.reset( new vos::OGuard(mpMutex) );
+ // acquire mutex in c-tor and releases it in the d-tor (exception
safe!).
+ std::auto_ptr< vos::OGuard > pMutexGuard;
+ if (mpMutex)
+ pMutexGuard.reset( new vos::OGuard(mpMutex) );
PropertyInfoHash::const_iterator aIter = mpInfo->maMap.find (
rPropertyName );
@@ -109,40 +109,40 @@ Any SAL_CALL ChainablePropertySet::getPropertyValue(
const ::rtl::OUString& rPro
return aAny;
}
-void SAL_CALL ChainablePropertySet::addPropertyChangeListener( const
::rtl::OUString&, const Reference< XPropertyChangeListener >& )
+void SAL_CALL ChainablePropertySet::addPropertyChangeListener( const
::rtl::OUString&, const Reference< XPropertyChangeListener >& )
throw(UnknownPropertyException, WrappedTargetException,
RuntimeException)
{
// todo
}
-void SAL_CALL ChainablePropertySet::removePropertyChangeListener( const
::rtl::OUString&, const Reference< XPropertyChangeListener >& )
+void SAL_CALL ChainablePropertySet::removePropertyChangeListener( const
::rtl::OUString&, const Reference< XPropertyChangeListener >& )
throw(UnknownPropertyException, WrappedTargetException,
RuntimeException)
{
// todo
}
-void SAL_CALL ChainablePropertySet::addVetoableChangeListener( const
::rtl::OUString&, const Reference< XVetoableChangeListener >& )
+void SAL_CALL ChainablePropertySet::addVetoableChangeListener( const
::rtl::OUString&, const Reference< XVetoableChangeListener >& )
throw(UnknownPropertyException, WrappedTargetException,
RuntimeException)
{
// todo
}
-void SAL_CALL ChainablePropertySet::removeVetoableChangeListener( const
::rtl::OUString&, const Reference< XVetoableChangeListener >& )
+void SAL_CALL ChainablePropertySet::removeVetoableChangeListener( const
::rtl::OUString&, const Reference< XVetoableChangeListener >& )
throw(UnknownPropertyException, WrappedTargetException,
RuntimeException)
{
// todo
}
// XMultiPropertySet
-void SAL_CALL ChainablePropertySet::setPropertyValues( const Sequence<
::rtl::OUString >& aPropertyNames, const Sequence< Any >& aValues )
+void SAL_CALL ChainablePropertySet::setPropertyValues( const Sequence<
::rtl::OUString >& aPropertyNames, const Sequence< Any >& aValues )
throw(PropertyVetoException, IllegalArgumentException,
WrappedTargetException, RuntimeException)
{
- // acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- std::auto_ptr< vos::OGuard > pMutexGuard;
- if (mpMutex)
- pMutexGuard.reset( new vos::OGuard(mpMutex) );
+ // acquire mutex in c-tor and releases it in the d-tor (exception
safe!).
+ std::auto_ptr< vos::OGuard > pMutexGuard;
+ if (mpMutex)
+ pMutexGuard.reset( new vos::OGuard(mpMutex) );
- const sal_Int32 nCount = aPropertyNames.getLength();
+ const sal_Int32 nCount = aPropertyNames.getLength();
if( nCount != aValues.getLength() )
throw IllegalArgumentException();
@@ -168,13 +168,13 @@ void SAL_CALL ChainablePropertySet::setPropertyValues(
const Sequence< ::rtl::OU
}
}
-Sequence< Any > SAL_CALL ChainablePropertySet::getPropertyValues( const
Sequence< ::rtl::OUString >& aPropertyNames )
+Sequence< Any > SAL_CALL ChainablePropertySet::getPropertyValues( const
Sequence< ::rtl::OUString >& aPropertyNames )
throw(RuntimeException)
{
- // acquire mutex in c-tor and releases it in the d-tor (exception safe!).
- std::auto_ptr< vos::OGuard > pMutexGuard;
- if (mpMutex)
- pMutexGuard.reset( new vos::OGuard(mpMutex) );
+ // acquire mutex in c-tor and releases it in the d-tor (exception
safe!).
+ std::auto_ptr< vos::OGuard > pMutexGuard;
+ if (mpMutex)
+ pMutexGuard.reset( new vos::OGuard(mpMutex) );
const sal_Int32 nCount = aPropertyNames.getLength();
@@ -202,29 +202,29 @@ Sequence< Any > SAL_CALL
ChainablePropertySet::getPropertyValues( const Sequence
return aValues;
}
-void SAL_CALL ChainablePropertySet::addPropertiesChangeListener( const
Sequence< ::rtl::OUString >&, const Reference< XPropertiesChangeListener >& )
+void SAL_CALL ChainablePropertySet::addPropertiesChangeListener( const
Sequence< ::rtl::OUString >&, const Reference< XPropertiesChangeListener >& )
throw(RuntimeException)
{
// todo
}
-void SAL_CALL ChainablePropertySet::removePropertiesChangeListener( const
Reference< XPropertiesChangeListener >& )
+void SAL_CALL ChainablePropertySet::removePropertiesChangeListener( const
Reference< XPropertiesChangeListener >& )
throw(RuntimeException)
{
// todo
}
-void SAL_CALL ChainablePropertySet::firePropertiesChangeEvent( const Sequence<
::rtl::OUString >&, const Reference< XPropertiesChangeListener >& )
+void SAL_CALL ChainablePropertySet::firePropertiesChangeEvent( const Sequence<
::rtl::OUString >&, const Reference< XPropertiesChangeListener >& )
throw(RuntimeException)
{
// todo
}
// XPropertyState
-PropertyState SAL_CALL ChainablePropertySet::getPropertyState( const
::rtl::OUString& PropertyName )
+PropertyState SAL_CALL ChainablePropertySet::getPropertyState( const
::rtl::OUString& PropertyName )
throw(UnknownPropertyException, RuntimeException)
{
- PropertyInfoHash::const_iterator aIter = mpInfo->maMap.find(
PropertyName );
+ PropertyInfoHash::const_iterator aIter = mpInfo->maMap.find(
PropertyName );
if( aIter == mpInfo->maMap.end())
throw UnknownPropertyException( PropertyName, static_cast<
XPropertySet* >( this ) );
@@ -237,7 +237,7 @@ PropertyState SAL_CALL
ChainablePropertySet::getPropertyState( const ::rtl::OUSt
return aState;
}
-Sequence< PropertyState > SAL_CALL ChainablePropertySet::getPropertyStates(
const Sequence< ::rtl::OUString >& rPropertyNames )
+Sequence< PropertyState > SAL_CALL ChainablePropertySet::getPropertyStates(
const Sequence< ::rtl::OUString >& rPropertyNames )
throw(UnknownPropertyException, RuntimeException)
{
const sal_Int32 nCount = rPropertyNames.getLength();
@@ -263,7 +263,7 @@ Sequence< PropertyState > SAL_CALL
ChainablePropertySet::getPropertyStates( cons
return aStates;
}
-void SAL_CALL ChainablePropertySet::setPropertyToDefault( const
::rtl::OUString& rPropertyName )
+void SAL_CALL ChainablePropertySet::setPropertyToDefault( const
::rtl::OUString& rPropertyName )
throw(UnknownPropertyException, RuntimeException)
{
PropertyInfoHash::const_iterator aIter = mpInfo->maMap.find (
rPropertyName );
@@ -273,7 +273,7 @@ void SAL_CALL ChainablePropertySet::setPropertyToDefault(
const ::rtl::OUString&
_setPropertyToDefault( *((*aIter).second) );
}
-Any SAL_CALL ChainablePropertySet::getPropertyDefault( const ::rtl::OUString&
rPropertyName )
+Any SAL_CALL ChainablePropertySet::getPropertyDefault( const ::rtl::OUString&
rPropertyName )
throw(UnknownPropertyException, WrappedTargetException,
RuntimeException)
{
PropertyInfoHash::const_iterator aIter = mpInfo->maMap.find (
rPropertyName );
@@ -289,7 +289,7 @@ void ChainablePropertySet::_preGetPropertyState ()
OSL_ENSURE( sal_False, "you have to implement this yourself!");
}
-void ChainablePropertySet::_getPropertyState( const comphelper::PropertyInfo&,
PropertyState& )
+void ChainablePropertySet::_getPropertyState( const comphelper::PropertyInfo&,
PropertyState& )
throw(UnknownPropertyException )
{
OSL_ENSURE( sal_False, "you have to implement this yourself!");
@@ -301,13 +301,13 @@ void ChainablePropertySet::_postGetPropertyState ()
OSL_ENSURE( sal_False, "you have to implement this yourself!");
}
-void ChainablePropertySet::_setPropertyToDefault( const
comphelper::PropertyInfo& )
+void ChainablePropertySet::_setPropertyToDefault( const
comphelper::PropertyInfo& )
throw(UnknownPropertyException )
{
OSL_ENSURE( sal_False, "you have to implement this yourself!");
}
-Any ChainablePropertySet::_getPropertyDefault( const comphelper::PropertyInfo&
)
+Any ChainablePropertySet::_getPropertyDefault( const comphelper::PropertyInfo&
)
throw(UnknownPropertyException, WrappedTargetException )
{
OSL_ENSURE( sal_False, "you have to implement this yourself!");
diff --git a/main/comphelper/source/streaming/memorystream.cxx
b/main/comphelper/source/streaming/memorystream.cxx
index d886c7e..99569d4 100644
--- a/main/comphelper/source/streaming/memorystream.cxx
+++ b/main/comphelper/source/streaming/memorystream.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -53,33 +53,33 @@ public:
virtual ~UNOMemoryStream();
// XStream
- virtual Reference< XInputStream > SAL_CALL getInputStream( ) throw
(RuntimeException);
- virtual Reference< XOutputStream > SAL_CALL getOutputStream( ) throw
(RuntimeException);
-
- // XInputStream
- virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >& aData,
sal_Int32 nBytesToRead ) throw (NotConnectedException,
BufferSizeExceededException, IOException, RuntimeException);
- virtual sal_Int32 SAL_CALL readSomeBytes( Sequence< sal_Int8 >& aData,
sal_Int32 nMaxBytesToRead ) throw (NotConnectedException,
BufferSizeExceededException, IOException, RuntimeException);
- virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw
(NotConnectedException, BufferSizeExceededException, IOException,
RuntimeException);
- virtual sal_Int32 SAL_CALL available() throw (NotConnectedException,
IOException, RuntimeException);
- virtual void SAL_CALL closeInput() throw (NotConnectedException,
IOException, RuntimeException);
-
- // XSeekable
- virtual void SAL_CALL seek( sal_Int64 location ) throw
(IllegalArgumentException, IOException, RuntimeException);
- virtual sal_Int64 SAL_CALL getPosition() throw (IOException,
RuntimeException);
- virtual sal_Int64 SAL_CALL getLength() throw (IOException,
RuntimeException);
-
- // XOutputStream
- virtual void SAL_CALL writeBytes( const Sequence< sal_Int8 >& aData )
throw (NotConnectedException, BufferSizeExceededException, IOException,
RuntimeException);
- virtual void SAL_CALL flush() throw (NotConnectedException,
BufferSizeExceededException, IOException, RuntimeException);
- virtual void SAL_CALL closeOutput() throw (NotConnectedException,
BufferSizeExceededException, IOException, RuntimeException);
-
- // XTruncate
- virtual void SAL_CALL truncate() throw (::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException);
-
- // XServiceInfo - static versions (used for component registration)
- static ::rtl::OUString SAL_CALL getImplementationName_static();
- static Sequence< ::rtl::OUString > SAL_CALL
getSupportedServiceNames_static();
- static Reference< XInterface > SAL_CALL Create( const Reference<
::com::sun::star::uno::XComponentContext >& );
+ virtual Reference< XInputStream > SAL_CALL getInputStream( ) throw
(RuntimeException);
+ virtual Reference< XOutputStream > SAL_CALL getOutputStream( ) throw
(RuntimeException);
+
+ // XInputStream
+ virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >& aData,
sal_Int32 nBytesToRead ) throw (NotConnectedException,
BufferSizeExceededException, IOException, RuntimeException);
+ virtual sal_Int32 SAL_CALL readSomeBytes( Sequence< sal_Int8 >& aData,
sal_Int32 nMaxBytesToRead ) throw (NotConnectedException,
BufferSizeExceededException, IOException, RuntimeException);
+ virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw
(NotConnectedException, BufferSizeExceededException, IOException,
RuntimeException);
+ virtual sal_Int32 SAL_CALL available() throw (NotConnectedException,
IOException, RuntimeException);
+ virtual void SAL_CALL closeInput() throw (NotConnectedException,
IOException, RuntimeException);
+
+ // XSeekable
+ virtual void SAL_CALL seek( sal_Int64 location ) throw
(IllegalArgumentException, IOException, RuntimeException);
+ virtual sal_Int64 SAL_CALL getPosition() throw (IOException,
RuntimeException);
+ virtual sal_Int64 SAL_CALL getLength() throw (IOException,
RuntimeException);
+
+ // XOutputStream
+ virtual void SAL_CALL writeBytes( const Sequence< sal_Int8 >& aData )
throw (NotConnectedException, BufferSizeExceededException, IOException,
RuntimeException);
+ virtual void SAL_CALL flush() throw (NotConnectedException,
BufferSizeExceededException, IOException, RuntimeException);
+ virtual void SAL_CALL closeOutput() throw (NotConnectedException,
BufferSizeExceededException, IOException, RuntimeException);
+
+ // XTruncate
+ virtual void SAL_CALL truncate() throw
(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo - static versions (used for component registration)
+ static ::rtl::OUString SAL_CALL getImplementationName_static();
+ static Sequence< ::rtl::OUString > SAL_CALL
getSupportedServiceNames_static();
+ static Reference< XInterface > SAL_CALL Create( const Reference<
::com::sun::star::uno::XComponentContext >& );
private:
std::vector< sal_Int8 > maData;
@@ -113,7 +113,7 @@ sal_Int32 SAL_CALL UNOMemoryStream::readBytes( Sequence<
sal_Int8 >& aData, sal_
throw IOException();
nBytesToRead = std::min( nBytesToRead, available() );
- aData.realloc( nBytesToRead );
+ aData.realloc( nBytesToRead );
if( nBytesToRead )
{
@@ -155,13 +155,13 @@ void SAL_CALL UNOMemoryStream::seek( sal_Int64 location )
throw (IllegalArgument
{
if( (location < 0) || (location > SAL_MAX_INT32) )
throw IllegalArgumentException(
OUString(RTL_CONSTASCII_USTRINGPARAM("this implementation does not support more
than 2GB!")), Reference< XInterface >(static_cast<OWeakObject*>(this)), 0 );
-
- // seek operation should be able to resize the stream
- if ( location > static_cast< sal_Int64 >( maData.size() ) )
- maData.resize( static_cast< sal_Int32 >( location ) );
- if ( location > static_cast< sal_Int64 >( maData.size() ) )
- maData.resize( static_cast< sal_Int32 >( location ) );
+ // seek operation should be able to resize the stream
+ if ( location > static_cast< sal_Int64 >( maData.size() ) )
+ maData.resize( static_cast< sal_Int32 >( location ) );
+
+ if ( location > static_cast< sal_Int64 >( maData.size() ) )
+ maData.resize( static_cast< sal_Int32 >( location ) );
mnCursor = static_cast< sal_Int32 >( location );
}
@@ -212,8 +212,8 @@ void SAL_CALL UNOMemoryStream::closeOutput() throw
(NotConnectedException, Buffe
//XTruncate
void SAL_CALL UNOMemoryStream::truncate() throw (IOException, RuntimeException)
{
- maData.resize( 0 );
- mnCursor = 0;
+ maData.resize( 0 );
+ mnCursor = 0;
}
::rtl::OUString SAL_CALL UNOMemoryStream::getImplementationName_static()
@@ -230,7 +230,7 @@ Sequence< ::rtl::OUString > SAL_CALL
UNOMemoryStream::getSupportedServiceNames_s
}
Reference< XInterface > SAL_CALL UNOMemoryStream::Create(
- const Reference< XComponentContext >& )
+ const Reference< XComponentContext >& )
{
return static_cast<OWeakObject*>(new UNOMemoryStream());
}
@@ -239,5 +239,5 @@ Reference< XInterface > SAL_CALL UNOMemoryStream::Create(
void createRegistryInfo_UNOMemoryStream()
{
- static ::comphelper::module::OAutoRegistration<
::comphelper::UNOMemoryStream > aAutoRegistration;
+ static ::comphelper::module::OAutoRegistration<
::comphelper::UNOMemoryStream > aAutoRegistration;
}
diff --git a/main/comphelper/source/streaming/otransactedfilestream.cxx
b/main/comphelper/source/streaming/otransactedfilestream.cxx
index 3bcefe3..89cd7ec 100644
--- a/main/comphelper/source/streaming/otransactedfilestream.cxx
+++ b/main/comphelper/source/streaming/otransactedfilestream.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -52,8 +52,8 @@ public:
throw uno::RuntimeException();
}
- virtual void SAL_CALL commit( ) throw (io::IOException,
lang::WrappedTargetException, uno::RuntimeException);
- virtual void SAL_CALL revert( ) throw (io::IOException,
lang::WrappedTargetException, uno::RuntimeException);
+ virtual void SAL_CALL commit( ) throw (io::IOException,
lang::WrappedTargetException, uno::RuntimeException);
+ virtual void SAL_CALL revert( ) throw (io::IOException,
lang::WrappedTargetException, uno::RuntimeException);
};
// ------------------------------------------------------------------------
@@ -348,8 +348,8 @@ uno::Reference< io::XInputStream > SAL_CALL
OTruncatedTransactedFileStream::getI
{
::osl::MutexGuard aGuard( m_aMutex );
- if ( m_pStreamData )
- m_pStreamData->m_bInOpen = sal_True;
+ if ( m_pStreamData )
+ m_pStreamData->m_bInOpen = sal_True;
return static_cast< io::XInputStream* >( this );
}
@@ -360,8 +360,8 @@ uno::Reference< io::XOutputStream > SAL_CALL
OTruncatedTransactedFileStream::get
{
::osl::MutexGuard aGuard( m_aMutex );
- if ( m_pStreamData )
- m_pStreamData->m_bOutOpen = sal_True;
+ if ( m_pStreamData )
+ m_pStreamData->m_bOutOpen = sal_True;
return static_cast< io::XOutputStream* >( this );
}
@@ -817,4 +817,3 @@ void SAL_CALL
OTruncatedTransactedFileStream::removeVetoableChangeListener( cons
} // namespace comphelper
-
diff --git a/main/comphelper/source/streaming/seqinputstreamserv.cxx
b/main/comphelper/source/streaming/seqinputstreamserv.cxx
index acfc450..6dbd0fd 100644
--- a/main/comphelper/source/streaming/seqinputstreamserv.cxx
+++ b/main/comphelper/source/streaming/seqinputstreamserv.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -44,50 +44,50 @@ using namespace ::com::sun::star;
namespace {
class SequenceInputStreamService:
- public ::cppu::WeakImplHelper3<
- lang::XServiceInfo,
- io::XSeekableInputStream,
- lang::XInitialization>
+ public ::cppu::WeakImplHelper3<
+ lang::XServiceInfo,
+ io::XSeekableInputStream,
+ lang::XInitialization>
{
public:
- explicit SequenceInputStreamService();
+ explicit SequenceInputStreamService();
- // ::com::sun::star::lang::XServiceInfo:
- virtual ::rtl::OUString SAL_CALL getImplementationName() throw (
uno::RuntimeException );
- virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString &
ServiceName ) throw ( uno::RuntimeException );
- virtual uno::Sequence< ::rtl::OUString > SAL_CALL
getSupportedServiceNames() throw ( uno::RuntimeException );
+ // ::com::sun::star::lang::XServiceInfo:
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw (
uno::RuntimeException );
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString &
ServiceName ) throw ( uno::RuntimeException );
+ virtual uno::Sequence< ::rtl::OUString > SAL_CALL
getSupportedServiceNames() throw ( uno::RuntimeException );
- // XServiceInfo - static versions (used for component registration)
- static ::rtl::OUString SAL_CALL getImplementationName_static();
- static uno::Sequence< ::rtl::OUString > SAL_CALL
getSupportedServiceNames_static();
- static uno::Reference< uno::XInterface > SAL_CALL Create( const
uno::Reference< uno::XComponentContext >& );
+ // XServiceInfo - static versions (used for component registration)
+ static ::rtl::OUString SAL_CALL getImplementationName_static();
+ static uno::Sequence< ::rtl::OUString > SAL_CALL
getSupportedServiceNames_static();
+ static uno::Reference< uno::XInterface > SAL_CALL Create( const
uno::Reference< uno::XComponentContext >& );
- // ::com::sun::star::io::XInputStream:
- virtual ::sal_Int32 SAL_CALL readBytes( uno::Sequence< ::sal_Int8 > &
aData, ::sal_Int32 nBytesToRead ) throw ( uno::RuntimeException,
io::NotConnectedException, io::BufferSizeExceededException, io::IOException );
- virtual ::sal_Int32 SAL_CALL readSomeBytes( uno::Sequence< ::sal_Int8 > &
aData, ::sal_Int32 nMaxBytesToRead ) throw ( uno::RuntimeException,
io::NotConnectedException, io::BufferSizeExceededException, io::IOException );
- virtual void SAL_CALL skipBytes( ::sal_Int32 nBytesToSkip ) throw (
uno::RuntimeException, io::NotConnectedException,
io::BufferSizeExceededException, io::IOException );
- virtual ::sal_Int32 SAL_CALL available() throw ( uno::RuntimeException,
io::NotConnectedException, io::IOException );
- virtual void SAL_CALL closeInput() throw ( uno::RuntimeException,
io::NotConnectedException, io::IOException );
+ // ::com::sun::star::io::XInputStream:
+ virtual ::sal_Int32 SAL_CALL readBytes( uno::Sequence< ::sal_Int8 > &
aData, ::sal_Int32 nBytesToRead ) throw ( uno::RuntimeException,
io::NotConnectedException, io::BufferSizeExceededException, io::IOException );
+ virtual ::sal_Int32 SAL_CALL readSomeBytes( uno::Sequence< ::sal_Int8 >
& aData, ::sal_Int32 nMaxBytesToRead ) throw ( uno::RuntimeException,
io::NotConnectedException, io::BufferSizeExceededException, io::IOException );
+ virtual void SAL_CALL skipBytes( ::sal_Int32 nBytesToSkip ) throw (
uno::RuntimeException, io::NotConnectedException,
io::BufferSizeExceededException, io::IOException );
+ virtual ::sal_Int32 SAL_CALL available() throw ( uno::RuntimeException,
io::NotConnectedException, io::IOException );
+ virtual void SAL_CALL closeInput() throw ( uno::RuntimeException,
io::NotConnectedException, io::IOException );
- // ::com::sun::star::io::XSeekable:
- virtual void SAL_CALL seek( ::sal_Int64 location ) throw (
uno::RuntimeException, lang::IllegalArgumentException, io::IOException );
- virtual ::sal_Int64 SAL_CALL getPosition() throw ( uno::RuntimeException,
io::IOException );
- virtual ::sal_Int64 SAL_CALL getLength() throw ( uno::RuntimeException,
io::IOException );
+ // ::com::sun::star::io::XSeekable:
+ virtual void SAL_CALL seek( ::sal_Int64 location ) throw (
uno::RuntimeException, lang::IllegalArgumentException, io::IOException );
+ virtual ::sal_Int64 SAL_CALL getPosition() throw (
uno::RuntimeException, io::IOException );
+ virtual ::sal_Int64 SAL_CALL getLength() throw ( uno::RuntimeException,
io::IOException );
- // ::com::sun::star::lang::XInitialization:
- virtual void SAL_CALL initialize( const uno::Sequence<
::com::sun::star::uno::Any > & aArguments ) throw ( uno::RuntimeException,
uno::Exception );
+ // ::com::sun::star::lang::XInitialization:
+ virtual void SAL_CALL initialize( const uno::Sequence<
::com::sun::star::uno::Any > & aArguments ) throw ( uno::RuntimeException,
uno::Exception );
private:
- SequenceInputStreamService( SequenceInputStreamService & ); // not defined
- void operator =( SequenceInputStreamService & ); // not defined
+ SequenceInputStreamService( SequenceInputStreamService & ); // not
defined
+ void operator =( SequenceInputStreamService & ); // not defined
- virtual ~SequenceInputStreamService() {}
+ virtual ~SequenceInputStreamService() {}
- ::osl::Mutex m_aMutex;
- sal_Bool m_bInitialized;
- uno::Reference< io::XInputStream > m_xInputStream;
- uno::Reference< io::XSeekable > m_xSeekable;
+ ::osl::Mutex m_aMutex;
+ sal_Bool m_bInitialized;
+ uno::Reference< io::XInputStream > m_xInputStream;
+ uno::Reference< io::XSeekable > m_xSeekable;
};
SequenceInputStreamService::SequenceInputStreamService()
@@ -97,143 +97,143 @@ SequenceInputStreamService::SequenceInputStreamService()
// com.sun.star.uno.XServiceInfo:
::rtl::OUString SAL_CALL SequenceInputStreamService::getImplementationName()
throw ( uno::RuntimeException )
{
- return getImplementationName_static();
+ return getImplementationName_static();
}
::rtl::OUString SAL_CALL
SequenceInputStreamService::getImplementationName_static()
{
- return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.comp.SequenceInputStreamService" ) );
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.comp.SequenceInputStreamService" ) );
}
::sal_Bool SAL_CALL SequenceInputStreamService::supportsService(
::rtl::OUString const & serviceName ) throw ( uno::RuntimeException )
{
- uno::Sequence< ::rtl::OUString > serviceNames = getSupportedServiceNames();
- for ( ::sal_Int32 i = 0; i < serviceNames.getLength(); ++i ) {
- if ( serviceNames[i] == serviceName )
- return sal_True;
- }
- return sal_False;
+ uno::Sequence< ::rtl::OUString > serviceNames =
getSupportedServiceNames();
+ for ( ::sal_Int32 i = 0; i < serviceNames.getLength(); ++i ) {
+ if ( serviceNames[i] == serviceName )
+ return sal_True;
+ }
+ return sal_False;
}
uno::Sequence< ::rtl::OUString > SAL_CALL
SequenceInputStreamService::getSupportedServiceNames() throw (
uno::RuntimeException )
{
- return getSupportedServiceNames_static();
+ return getSupportedServiceNames_static();
}
uno::Sequence< ::rtl::OUString > SAL_CALL
SequenceInputStreamService::getSupportedServiceNames_static()
{
- uno::Sequence< ::rtl::OUString > s( 1 );
- s[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.io.SequenceInputStream" ) );
- return s;
+ uno::Sequence< ::rtl::OUString > s( 1 );
+ s[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.io.SequenceInputStream" ) );
+ return s;
}
uno::Reference< uno::XInterface > SAL_CALL SequenceInputStreamService::Create(
- const uno::Reference< uno::XComponentContext >& )
+ const uno::Reference< uno::XComponentContext >& )
{
- return static_cast< ::cppu::OWeakObject * >( new
SequenceInputStreamService() );
+ return static_cast< ::cppu::OWeakObject * >( new
SequenceInputStreamService() );
}
// ::com::sun::star::io::XInputStream:
::sal_Int32 SAL_CALL SequenceInputStreamService::readBytes( uno::Sequence<
::sal_Int8 > & aData, ::sal_Int32 nBytesToRead ) throw ( uno::RuntimeException,
io::NotConnectedException, io::BufferSizeExceededException, io::IOException )
{
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( !m_xInputStream.is() )
- throw io::NotConnectedException();
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xInputStream.is() )
+ throw io::NotConnectedException();
- return m_xInputStream->readBytes( aData, nBytesToRead );
+ return m_xInputStream->readBytes( aData, nBytesToRead );
}
::sal_Int32 SAL_CALL SequenceInputStreamService::readSomeBytes( uno::Sequence<
::sal_Int8 > & aData, ::sal_Int32 nMaxBytesToRead ) throw (
uno::RuntimeException, io::NotConnectedException,
io::BufferSizeExceededException, io::IOException )
{
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( !m_xInputStream.is() )
- throw io::NotConnectedException();
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xInputStream.is() )
+ throw io::NotConnectedException();
- return m_xInputStream->readSomeBytes( aData, nMaxBytesToRead );
+ return m_xInputStream->readSomeBytes( aData, nMaxBytesToRead );
}
void SAL_CALL SequenceInputStreamService::skipBytes( ::sal_Int32 nBytesToSkip
) throw ( uno::RuntimeException, io::NotConnectedException,
io::BufferSizeExceededException, io::IOException )
{
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( !m_xInputStream.is() )
- throw io::NotConnectedException();
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xInputStream.is() )
+ throw io::NotConnectedException();
- return m_xInputStream->skipBytes( nBytesToSkip );
+ return m_xInputStream->skipBytes( nBytesToSkip );
}
::sal_Int32 SAL_CALL SequenceInputStreamService::available() throw (
uno::RuntimeException, io::NotConnectedException, io::IOException )
{
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( !m_xInputStream.is() )
- throw io::NotConnectedException();
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xInputStream.is() )
+ throw io::NotConnectedException();
- return m_xInputStream->available();
+ return m_xInputStream->available();
}
void SAL_CALL SequenceInputStreamService::closeInput() throw (
uno::RuntimeException, io::NotConnectedException, io::IOException )
{
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( !m_xInputStream.is() )
- throw io::NotConnectedException();
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xInputStream.is() )
+ throw io::NotConnectedException();
- m_xInputStream->closeInput();
- m_xInputStream = uno::Reference< io::XInputStream >();
- m_xSeekable = uno::Reference< io::XSeekable >();
+ m_xInputStream->closeInput();
+ m_xInputStream = uno::Reference< io::XInputStream >();
+ m_xSeekable = uno::Reference< io::XSeekable >();
}
// ::com::sun::star::io::XSeekable:
void SAL_CALL SequenceInputStreamService::seek( ::sal_Int64 location ) throw (
uno::RuntimeException, lang::IllegalArgumentException, io::IOException )
{
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( !m_xSeekable.is() )
- throw io::NotConnectedException();
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xSeekable.is() )
+ throw io::NotConnectedException();
- m_xSeekable->seek( location );
+ m_xSeekable->seek( location );
}
::sal_Int64 SAL_CALL SequenceInputStreamService::getPosition() throw (
uno::RuntimeException, io::IOException )
{
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( !m_xSeekable.is() )
- throw io::NotConnectedException();
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xSeekable.is() )
+ throw io::NotConnectedException();
- return m_xSeekable->getPosition();
+ return m_xSeekable->getPosition();
}
::sal_Int64 SAL_CALL SequenceInputStreamService::getLength() throw (
uno::RuntimeException, io::IOException )
{
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( !m_xSeekable.is() )
- throw io::NotConnectedException();
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xSeekable.is() )
+ throw io::NotConnectedException();
- return m_xSeekable->getLength();
+ return m_xSeekable->getLength();
}
// ::com::sun::star::lang::XInitialization:
void SAL_CALL SequenceInputStreamService::initialize( const uno::Sequence<
::com::sun::star::uno::Any > & aArguments ) throw ( uno::RuntimeException,
uno::Exception )
{
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( m_bInitialized )
- throw frame::DoubleInitializationException();
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( m_bInitialized )
+ throw frame::DoubleInitializationException();
if ( aArguments.getLength() != 1 )
throw lang::IllegalArgumentException(
::rtl::OUString::createFromAscii( "Wrong number of arguments!\n" ),
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject*
>(this) ),
1 );
- uno::Sequence< sal_Int8 > aSeq;
- if ( aArguments[0] >>= aSeq )
- {
- uno::Reference< io::XInputStream > xInputStream(
- static_cast< ::cppu::OWeakObject* >( new
::comphelper::SequenceInputStream( aSeq ) ),
- uno::UNO_QUERY_THROW );
- uno::Reference< io::XSeekable > xSeekable( xInputStream,
uno::UNO_QUERY_THROW );
- m_xInputStream = xInputStream;
- m_xSeekable = xSeekable;
- m_bInitialized = sal_True;
- }
- else
+ uno::Sequence< sal_Int8 > aSeq;
+ if ( aArguments[0] >>= aSeq )
+ {
+ uno::Reference< io::XInputStream > xInputStream(
+ static_cast<
::cppu::OWeakObject* >( new ::comphelper::SequenceInputStream( aSeq ) ),
+ uno::UNO_QUERY_THROW );
+ uno::Reference< io::XSeekable > xSeekable( xInputStream,
uno::UNO_QUERY_THROW );
+ m_xInputStream = xInputStream;
+ m_xSeekable = xSeekable;
+ m_bInitialized = sal_True;
+ }
+ else
throw lang::IllegalArgumentException(
::rtl::OUString::createFromAscii( "Unexpected type of argument!\n" ),
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject*
>(this) ),
1 );
@@ -243,5 +243,5 @@ void SAL_CALL SequenceInputStreamService::initialize( const
uno::Sequence< ::com
void createRegistryInfo_SequenceInputStream()
{
- static ::comphelper::module::OAutoRegistration< SequenceInputStreamService
> aAutoRegistration;
+ static ::comphelper::module::OAutoRegistration<
SequenceInputStreamService > aAutoRegistration;
}