diff options
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/inc/comphelper/oslfile2streamwrap.hxx | 4 | ||||
-rw-r--r-- | comphelper/source/container/container.cxx | 31 | ||||
-rw-r--r-- | comphelper/source/container/enumhelper.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/eventattachermgr/eventattachermgr.cxx | 81 | ||||
-rw-r--r-- | comphelper/source/property/propagg.cxx | 13 |
5 files changed, 64 insertions, 69 deletions
diff --git a/comphelper/inc/comphelper/oslfile2streamwrap.hxx b/comphelper/inc/comphelper/oslfile2streamwrap.hxx index 754be72c963b..64ebca65d7df 100644 --- a/comphelper/inc/comphelper/oslfile2streamwrap.hxx +++ b/comphelper/inc/comphelper/oslfile2streamwrap.hxx @@ -42,7 +42,7 @@ namespace comphelper //================================================================== // FmUnoIOStream, -// stream zum schreiben un lesen von Daten, basieren auf File +// Stream to read and write from data read from a file //================================================================== class COMPHELPER_DLLPUBLIC OSLInputStreamWrapper : public ::cppu::WeakImplHelper1<stario::XInputStream> { @@ -63,7 +63,7 @@ public: //================================================================== // FmUnoOutStream, -// Datensenke fuer Files +// sync data for the files //================================================================== class OSLOutputStreamWrapper : public ::cppu::WeakImplHelper1<stario::XOutputStream> { diff --git a/comphelper/source/container/container.cxx b/comphelper/source/container/container.cxx index 7bf2f8f6b160..d3012c27941d 100644 --- a/comphelper/source/container/container.cxx +++ b/comphelper/source/container/container.cxx @@ -51,9 +51,9 @@ IndexAccessIterator::~IndexAccessIterator() {} ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> IndexAccessIterator::Next() { sal_Bool bCheckingStartingPoint = !m_xCurrentObject.is(); - // ist die aktuelle Node der Anfangspunkt ? + // Is the current node the starting point? sal_Bool bAlreadyCheckedCurrent = m_xCurrentObject.is(); - // habe ich die aktuelle Node schon mal mittels ShouldHandleElement testen ? + // Have I already tested the current node through ShouldHandleElement? if (!m_xCurrentObject.is()) m_xCurrentObject = m_xStartingPoint; @@ -62,7 +62,7 @@ IndexAccessIterator::~IndexAccessIterator() {} sal_Bool bFoundSomething = sal_False; while (!bFoundSomething && bHasMoreToSearch) { - // pre-order-traversierung + // Priming loop if (!bAlreadyCheckedCurrent && ShouldHandleElement(xSearchLoop)) { m_xCurrentObject = xSearchLoop; @@ -70,10 +70,10 @@ IndexAccessIterator::~IndexAccessIterator() {} } else { - // zuerst absteigen, wenn moeglich + // First, check to see if there's a match below ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess> xContainerAccess(xSearchLoop, ::com::sun::star::uno::UNO_QUERY); if (xContainerAccess.is() && xContainerAccess->getCount() && ShouldStepInto(xContainerAccess)) - { // zum ersten Child + { ::com::sun::star::uno::Any aElement(xContainerAccess->getByIndex(0)); xSearchLoop = *(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>*)aElement.getValue(); bCheckingStartingPoint = sal_False; @@ -81,10 +81,9 @@ IndexAccessIterator::~IndexAccessIterator() {} m_arrChildIndizies.push_back((sal_Int32)0); } else - { - // dann nach oben und nach rechts, wenn moeglich + { // otherwise, look above and to the right, if possible while (m_arrChildIndizies.size() > 0) - { // (mein Stack ist nich leer, also kann ich noch nach oben gehen) + { // If the list isn't empty and there's nothing above ::com::sun::star::uno::Reference< ::com::sun::star::container::XChild> xChild(xSearchLoop, ::com::sun::star::uno::UNO_QUERY); OSL_ENSURE(xChild.is(), "IndexAccessIterator::Next : a content has no approriate interface !"); @@ -92,36 +91,35 @@ IndexAccessIterator::~IndexAccessIterator() {} xContainerAccess = ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess>(xParent, ::com::sun::star::uno::UNO_QUERY); OSL_ENSURE(xContainerAccess.is(), "IndexAccessIterator::Next : a content has an invalid parent !"); - // den Index, den SearchLoop in diesem Parent hatte, von meinem 'Stack' + // Update the search loop index sal_Int32 nOldSearchChildIndex = m_arrChildIndizies[m_arrChildIndizies.size() - 1]; m_arrChildIndizies.pop_back(); if (nOldSearchChildIndex < xContainerAccess->getCount() - 1) - { // auf dieser Ebene geht es noch nach rechts + { // Move to the right in this row ++nOldSearchChildIndex; - // also das naechste Child + // and check the nex child ::com::sun::star::uno::Any aElement(xContainerAccess->getByIndex(nOldSearchChildIndex)); xSearchLoop = *(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>*) aElement.getValue(); bCheckingStartingPoint = sal_False; - // und dessen Position auf den 'Stack' + // and update is position in the list. m_arrChildIndizies.push_back((sal_Int32)nOldSearchChildIndex); break; } - // hierher komme ich, wenn es auf der aktuellen Ebene nicht nach rechts geht, dann mache ich eine darueber weiter + // Finally, if there's nothing more to do in this row (to the right), we'll move on to the next row. xSearchLoop = xParent; bCheckingStartingPoint = sal_False; } if (m_arrChildIndizies.empty() && !bCheckingStartingPoint) - { // das ist genau dann der Fall, wenn ich keinen rechten Nachbarn fuer irgendeinen der direkten Vorfahren des - // urspruenglichen xSearchLoop gefunden habe + { //This is the case if there is nothing to the right in the original search loop bHasMoreToSearch = sal_False; } } if (bHasMoreToSearch) - { // ich habe in xSearchLoop jetzt ein Interface eines 'Knotens' meines 'Baumes', den ich noch abtesten kann + { // If there is still a node in the tree which can be tested if (ShouldHandleElement(xSearchLoop)) { m_xCurrentObject = xSearchLoop; @@ -129,7 +127,6 @@ IndexAccessIterator::~IndexAccessIterator() {} } else if (bCheckingStartingPoint) - // ich bin noch am Anfang, konnte nicht absteigen, und habe an diesem Anfang nix gefunden -> nix mehr zu tun bHasMoreToSearch = sal_False; bAlreadyCheckedCurrent = sal_True; } diff --git a/comphelper/source/container/enumhelper.cxx b/comphelper/source/container/enumhelper.cxx index 3c6afd5fbbcb..371e01c3cfa1 100644 --- a/comphelper/source/container/enumhelper.cxx +++ b/comphelper/source/container/enumhelper.cxx @@ -97,7 +97,7 @@ staruno::Any SAL_CALL OEnumerationByName::nextElement( ) m_xAccess.clear(); } - if (!aRes.hasValue()) // es gibt kein Element mehr + if (!aRes.hasValue()) //There are no more elements throw starcontainer::NoSuchElementException(); return aRes; @@ -201,7 +201,7 @@ staruno::Any SAL_CALL OEnumerationByIndex::nextElement( ) } } - if (!aRes.hasValue()) // es gibt kein Element mehr + if (!aRes.hasValue()) throw starcontainer::NoSuchElementException(); return aRes; } diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx index 9c119a1f5d5c..70a8ad87a155 100644 --- a/comphelper/source/eventattachermgr/eventattachermgr.cxx +++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx @@ -98,9 +98,9 @@ class ImplEventAttacherManager friend class AttacherAllListener_Impl; ::std::deque< AttacherIndex_Impl > aIndex; Mutex aLock; - // Container fuer die ScriptListener + // Container for the ScriptListener OInterfaceContainerHelper aScriptListeners; - // EventAttacher-Instanz + // Instance of EventAttacher Reference< XEventAttacher2 > xAttacher; Reference< XMultiServiceFactory > mxSMgr; Reference< XIdlReflection > mxCoreReflection; @@ -112,7 +112,7 @@ public: const Reference< XMultiServiceFactory > rSMgr ); ~ImplEventAttacherManager(); - // Methoden von XEventAttacherManager + // Methods of 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) @@ -136,7 +136,7 @@ public: virtual void SAL_CALL removeScriptListener(const Reference< XScriptListener >& Listener) throw( IllegalArgumentException, RuntimeException ); - // Methoden von XPersistObject + // Methods of 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 ); @@ -157,8 +157,9 @@ private: //======================================================================== //======================================================================== -// Implementation eines EventAttacher-bezogenen AllListeners, der -// nur einzelne Events an einen allgemeinen AllListener weiterleitet + +// Implementation of an EventAttacher-subclass 'AllListeners', which +// only passes individual events of the general AllListeners. class AttacherAllListener_Impl : public WeakImplHelper1< XAllListener > { ImplEventAttacherManager* mpManager; @@ -173,11 +174,11 @@ public: AttacherAllListener_Impl( ImplEventAttacherManager* pManager_, const OUString &rScriptType_, const OUString & rScriptCode_ ); - // Methoden von XAllListener + // Methods of 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 + // Methods of XEventListener virtual void SAL_CALL disposing(const EventObject& Source) throw( RuntimeException ); }; @@ -198,7 +199,7 @@ AttacherAllListener_Impl::AttacherAllListener_Impl //======================================================================== -// Methoden von XAllListener +// Methods of XAllListener void SAL_CALL AttacherAllListener_Impl::firing(const AllEventObject& Event) throw( RuntimeException ) { @@ -211,7 +212,7 @@ void SAL_CALL AttacherAllListener_Impl::firing(const AllEventObject& Event) aScriptEvent.ScriptType = aScriptType; aScriptEvent.ScriptCode = aScriptCode; - // ueber alle Listener iterieren und Events senden + // Iterate over all listeners and pass events. OInterfaceIteratorHelper aIt( mpManager->aScriptListeners ); while( aIt.hasMoreElements() ) ((XScriptListener *)aIt.next())->firing( aScriptEvent ); @@ -264,7 +265,7 @@ void AttacherAllListener_Impl::convertToEventReturn( Any & rRet, const Type & rR } //======================================================================== -// Methoden von XAllListener +// Methods of XAllListener Any SAL_CALL AttacherAllListener_Impl::approveFiring( const AllEventObject& Event ) throw( InvocationTargetException, RuntimeException ) { @@ -278,7 +279,7 @@ Any SAL_CALL AttacherAllListener_Impl::approveFiring( const AllEventObject& Even aScriptEvent.ScriptCode = aScriptCode; Any aRet; - // ueber alle Listener iterieren und Events senden + // Iterate over all listeners and pass events. OInterfaceIteratorHelper aIt( mpManager->aScriptListeners ); while( aIt.hasMoreElements() ) { @@ -352,7 +353,7 @@ Any SAL_CALL AttacherAllListener_Impl::approveFiring( const AllEventObject& Even } //======================================================================== -// Methoden von XEventListener +// Methods of XEventListener void SAL_CALL AttacherAllListener_Impl::disposing(const EventObject& ) throw( RuntimeException ) { @@ -360,7 +361,7 @@ void SAL_CALL AttacherAllListener_Impl::disposing(const EventObject& ) } -// Create-Methode fuer EventAttacherManager +// Constructor method for EventAttacherManager Reference< XEventAttacherManager > createEventAttacherManager( const Reference< XMultiServiceFactory > & rSMgr ) throw( Exception ) { @@ -415,7 +416,7 @@ ImplEventAttacherManager::~ImplEventAttacherManager() Reference< XIdlReflection > ImplEventAttacherManager::getReflection() throw( Exception ) { Guard< Mutex > aGuard( aLock ); - // Haben wir den Service schon? Sonst anlegen + // Do we already have a service? If not, create one. if( !mxCoreReflection.is() ) { Reference< XInterface > xIFace( mxSMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.reflection.CoreReflection" )) ) ); @@ -474,7 +475,7 @@ public: } //----------------------------------------------------------------------------- -//*** Methoden von XEventAttacherManager *** +// Methods of XEventAttacherManager void SAL_CALL ImplEventAttacherManager::registerScriptEvent ( sal_Int32 nIndex, @@ -484,7 +485,7 @@ void SAL_CALL ImplEventAttacherManager::registerScriptEvent { Guard< Mutex > aGuard( aLock ); - // Index pruefen und Array anpassen + // Examine the index and apply the array ::std::deque<AttacherIndex_Impl>::iterator aIt = implCheckIndex( nIndex ); ::std::deque< AttachedObject_Impl > aList = (*aIt).aObjList; @@ -532,7 +533,7 @@ void SAL_CALL ImplEventAttacherManager::registerScriptEvents { Guard< Mutex > aGuard( aLock ); - // Index pruefen und Array anpassen + // Examine the index and apply the array ::std::deque<AttacherIndex_Impl>::iterator aIt = implCheckIndex( nIndex ); ::std::deque< AttachedObject_Impl > aList = (*aIt).aObjList; @@ -657,7 +658,7 @@ void SAL_CALL ImplEventAttacherManager::attach(sal_Int32 nIndex, const Reference if( static_cast< ::std::deque< AttacherIndex_Impl >::size_type>(nIndex) >= aIndex.size() ) { - // alte Dateien lesen + // read older files if( nVersion == 1 ) { insertEntry( nIndex ); @@ -769,7 +770,7 @@ void SAL_CALL ImplEventAttacherManager::removeScriptListener(const Reference< XS } -// Methoden von XPersistObject +// Methods of XPersistObject OUString SAL_CALL ImplEventAttacherManager::getServiceName(void) throw( RuntimeException ) { @@ -780,26 +781,26 @@ void SAL_CALL ImplEventAttacherManager::write(const Reference< XObjectOutputStre throw( IOException, RuntimeException ) { Guard< Mutex > aGuard( aLock ); - // Ohne XMarkableStream laeuft nichts + // Don't run without XMarkableStream Reference< XMarkableStream > xMarkStream( OutStream, UNO_QUERY ); if( !xMarkStream.is() ) return; - // Version schreiben + // Write out the version OutStream->writeShort( 2 ); - // Position fuer Laenge merken + // Position the position for length sal_Int32 nObjLenMark = xMarkStream->createMark(); OutStream->writeLong( 0L ); OutStream->writeLong( aIndex.size() ); - // Sequences schreiben + // Write out sequences ::std::deque<AttacherIndex_Impl>::iterator aIt = aIndex.begin(); ::std::deque<AttacherIndex_Impl>::iterator aEnd = aIndex.end(); while( aIt != aEnd ) { - // Laenge der Sequence und alle Descriptoren schreiben + // Write out the length of the sequence and all descriptions OutStream->writeLong( (*aIt).aEventList.size() ); ::std::deque< ScriptEventDescriptor >::iterator aEvtIt = (*aIt).aEventList.begin(); ::std::deque< ScriptEventDescriptor >::iterator aEvtEnd = (*aIt).aEventList.end(); @@ -817,7 +818,7 @@ void SAL_CALL ImplEventAttacherManager::write(const Reference< XObjectOutputStre ++aIt; } - // Die jetzt bekannte Laenge eintragen + // The length is now known sal_Int32 nObjLen = xMarkStream->offsetToMark( nObjLenMark ) -4; xMarkStream->jumpToMark( nObjLenMark ); OutStream->writeLong( nObjLen ); @@ -829,31 +830,31 @@ void SAL_CALL ImplEventAttacherManager::read(const Reference< XObjectInputStream throw( IOException, RuntimeException ) { Guard< Mutex > aGuard( aLock ); - // Ohne XMarkableStream laeuft nichts + // Don't run without XMarkableStream Reference< XMarkableStream > xMarkStream( InStream, UNO_QUERY ); if( !xMarkStream.is() ) return; - // Version lesen + // Read in the version nVersion = InStream->readShort(); - // Zunaechst kommen die Daten gemaess Version 1, - // muss auch bei hoeheren Versionen beibehalten werden + // Next is the time since version 1. + // Should this be deprecated in later versions? sal_Int32 nLen = InStream->readLong(); - // Position fuer Vergleichszwecke + // Position for comparative purposes sal_Int32 nObjLenMark = xMarkStream->createMark(); - // Anzahl der zu lesenden Sequences + // Number of read sequences sal_Int32 nItemCount = InStream->readLong(); for( sal_Int32 i = 0 ; i < nItemCount ; i++ ) { insertEntry( i ); - // Laenge der Sequence lesen + // Read the length of the sequence sal_Int32 nSeqLen = InStream->readLong(); - // Sequence anlegen und Descriptoren lesen + // Display the sequences and read the descriptions Sequence< ScriptEventDescriptor > aSEDSeq( nSeqLen ); ScriptEventDescriptor* pArray = aSEDSeq.getArray(); for( sal_Int32 j = 0 ; j < nSeqLen ; j++ ) @@ -868,21 +869,19 @@ void SAL_CALL ImplEventAttacherManager::read(const Reference< XObjectInputStream registerScriptEvents( i, aSEDSeq ); } - // Haben wir die angegebene Laenge gelesen? + // Have we read the specified length? 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. + // Only if the StreamVersion is > 1 and the date still follows, can + // this be true. Otherwise, something is completely gone. if( nRealLen > nLen || nVersion == 1 ) { OSL_FAIL( "ImplEventAttacherManager::read(): Fatal Error, wrong object length" ); } else - { - // TODO: Pruefen, ob Zwischen-Speicherung der Daten sinnvoll sein koennte - - // Vorerst einfach nur Skippen + { // TODO: Examine if caching the dates would be useful + // But for now, it's easier to skip it. sal_Int32 nSkipCount = nLen - nRealLen; InStream->skipBytes( nSkipCount ); } diff --git a/comphelper/source/property/propagg.cxx b/comphelper/source/property/propagg.cxx index be24a1d64ad2..e18658281635 100644 --- a/comphelper/source/property/propagg.cxx +++ b/comphelper/source/property/propagg.cxx @@ -146,12 +146,12 @@ OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper( m_aProperties.realloc( nMergedProps ); pMergedProps = m_aProperties.getArray(); // reset, needed again below - // sortieren der Properties nach Namen + // sort the properties by name ::std::sort( pMergedProps, pMergedProps+nMergedProps, PropertyCompareByName()); pMergedProps = m_aProperties.getArray(); - // Positionen in der Map abgleichen + // sync the map positions for ( nMPLoop = 0; nMPLoop < nMergedProps; ++nMPLoop, ++pMergedProps ) m_aPropertyAccessors[ pMergedProps->Handle ].nPos = nMPLoop; } @@ -292,7 +292,7 @@ sal_Int32 OPropertyArrayAggregationHelper::fillHandles( for( sal_Int32 i = 0; i < nReqLen; ++i ) { - // Logarithmus ermitteln + // determine the logarithm sal_uInt32 n = (sal_uInt32)(pEnd - pCur); sal_Int32 nLog = 0; while( n ) @@ -301,8 +301,7 @@ sal_Int32 OPropertyArrayAggregationHelper::fillHandles( n = n >> 1; } - // Anzahl der noch zu suchenden Properties * dem Log2 der verbleibenden - // zu dursuchenden Properties. + // Number of the searched properties * the Log2 of the reamining properties if( (nReqLen - i) * nLog >= pEnd - pCur ) { // linear search is better @@ -485,7 +484,7 @@ void OPropertySetAggregationHelper::disposing() if ( m_xAggregateSet.is() && m_bListening ) { - // als einziger Listener anmelden + // register as a single listener m_xAggregateMultiSet->removePropertiesChangeListener(this); m_xAggregateSet->removeVetoableChangeListener(::rtl::OUString(), this); m_bListening = sal_False; @@ -595,7 +594,7 @@ void OPropertySetAggregationHelper::startListening() if (!m_bListening && m_xAggregateSet.is()) { - // als einziger Listener anmelden + // register as a single listener ::com::sun::star::uno::Sequence< ::rtl::OUString > aPropertyNames; m_xAggregateMultiSet->addPropertiesChangeListener(aPropertyNames, this); m_xAggregateSet->addVetoableChangeListener(::rtl::OUString(), this); |