diff options
author | Philipp Weissenbacher <p.weissenbacher@gmail.com> | 2012-03-06 02:04:46 +0100 |
---|---|---|
committer | Philipp Weissenbacher <p.weissenbacher@gmail.com> | 2012-03-06 02:06:12 +0100 |
commit | b9046068b187f52c2b64be694b9f6cf7e8602246 (patch) | |
tree | 020aee868c345a15a6c93ff375139097450012da /forms | |
parent | 77a517a467b3aa944e31b170162518f70da3793d (diff) |
Translate German comments, fix some whitespace and bad translations
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/Button.cxx | 16 | ||||
-rw-r--r-- | forms/source/component/Button.hxx | 4 | ||||
-rw-r--r-- | forms/source/component/CheckBox.cxx | 4 | ||||
-rw-r--r-- | forms/source/component/Columns.cxx | 20 | ||||
-rw-r--r-- | forms/source/component/Columns.hxx | 6 | ||||
-rw-r--r-- | forms/source/component/ComboBox.cxx | 26 | ||||
-rw-r--r-- | forms/source/component/ComboBox.hxx | 4 | ||||
-rw-r--r-- | forms/source/component/Edit.cxx | 18 | ||||
-rw-r--r-- | forms/source/component/EditBase.cxx | 12 | ||||
-rw-r--r-- | forms/source/component/EditBase.hxx | 2 | ||||
-rw-r--r-- | forms/source/component/EventThread.cxx | 39 | ||||
-rw-r--r-- | forms/source/component/EventThread.hxx | 26 |
12 files changed, 86 insertions, 91 deletions
diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx index 0ae1f87ff53c..b3ceefaf2493 100644 --- a/forms/source/component/Button.cxx +++ b/forms/source/component/Button.cxx @@ -382,13 +382,13 @@ OButtonControl::OButtonControl(const Reference<XMultiServiceFactory>& _rxFactory { increment(m_refCount); { - // als ActionListener anmelden + // Register as ActionListener Reference<XButton> xButton; query_aggregation( m_xAggregate, xButton); if (xButton.is()) xButton->addActionListener(this); } - // Refcount bei 1 fuer Listener + // For Listener: refcount at one decrement(m_refCount); } @@ -399,7 +399,7 @@ OButtonControl::~OButtonControl() Application::RemoveUserEvent(m_nClickEvent); } -// UNO Anbindung +// UNO binding //------------------------------------------------------------------------------ Any SAL_CALL OButtonControl::queryAggregation(const Type& _rType) throw (RuntimeException) { @@ -437,7 +437,7 @@ void SAL_CALL OButtonControl::disposing( const EventObject& _rSource ) throw( Ru //------------------------------------------------------------------------------ void OButtonControl::actionPerformed(const ActionEvent& /*rEvent*/) throw ( ::com::sun::star::uno::RuntimeException) { - // Asynchron fuer starutil::URL-Button + // Asynchronous for starutil::URL-Button sal_uLong n = Application::PostUserEvent( LINK(this, OButtonControl,OnClick) ); { ::osl::MutexGuard aGuard( m_aMutex ); @@ -459,8 +459,8 @@ IMPL_LINK_NOARG(OButtonControl, OnClick) } else { - // Sonst nicht. Dann darf man aber auf keinen Fal die Listener - // benachrichtigen, auch dann nicht, wenn er spaeter hinzukommt. + // Else, don't. We then must not notify the Listeners in any case, + // not even if added later on. aGuard.clear(); // recognize the button type @@ -485,7 +485,7 @@ IMPL_LINK_NOARG(OButtonControl, OnClick) #ifdef DBG_UTIL catch( const RuntimeException& ) { - // silent this + // silence this } #endif catch( const Exception& ) @@ -685,7 +685,7 @@ sal_Int16 OButtonControl::getModelUrlFeatureId( ) const xModelProps->getPropertyValue( PROPERTY_BUTTONTYPE ) >>= eButtonType; } - // are we an URL button? + // are we a URL button? if ( eButtonType == FormButtonType_URL ) { // is it a feature URL? diff --git a/forms/source/component/Button.hxx b/forms/source/component/Button.hxx index 1c6b168a877c..0fe5505f37f3 100644 --- a/forms/source/component/Button.hxx +++ b/forms/source/component/Button.hxx @@ -135,7 +135,7 @@ private: protected: - // UNO Anbindung + // UNO binding virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes(); public: @@ -146,7 +146,7 @@ public: IMPLEMENTATION_NAME(OButtonControl); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); - // UNO Anbindung + // UNO binding DECLARE_UNO3_AGG_DEFAULTS(OButtonControl, OClickableImageBaseControl); virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); diff --git a/forms/source/component/CheckBox.cxx b/forms/source/component/CheckBox.cxx index 3a622e2f4fe3..15042a757862 100644 --- a/forms/source/component/CheckBox.cxx +++ b/forms/source/component/CheckBox.cxx @@ -205,7 +205,7 @@ void SAL_CALL OCheckBoxModel::read(const Reference<stario::XObjectInputStream>& setReferenceValue( sReferenceValue ); setDefaultChecked( static_cast< ToggleState >( nDefaultChecked ) ); - // Nach dem Lesen die Defaultwerte anzeigen + // After reading in, display the default values if ( !getControlSource().isEmpty() ) // (not if we don't have a control source - the "State" property acts like it is persistent, then resetNoBroadcast(); @@ -217,7 +217,7 @@ Any OCheckBoxModel::translateDbColumnToControlValue() Any aValue; ////////////////////////////////////////////////////////////////// - // Wert an ControlModel setzen + // Set value in ControlModel sal_Bool bValue = m_xColumn->getBoolean(); if ( m_xColumn->wasNull() ) { diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx index d65eac43f700..7f8b95877eae 100644 --- a/forms/source/component/Columns.cxx +++ b/forms/source/component/Columns.cxx @@ -217,8 +217,8 @@ OGridColumn::OGridColumn( const comphelper::ComponentContext& _rContext, const : { DBG_CTOR(OGridColumn,NULL); - // Anlegen des UnoControlModels - if ( !m_aModelName.isEmpty() ) // is there a to-be-aggregated model? + // Create the UnoControlModel + if ( !m_aModelName.isEmpty() ) // is there a to-be-aggregated model? { increment( m_refCount ); @@ -232,7 +232,7 @@ OGridColumn::OGridColumn( const comphelper::ComponentContext& _rContext, const : m_xAggregate->setDelegator( static_cast< ::cppu::OWeakObject* >( this ) ); } - // Refcount wieder bei NULL + // Set refcount back to zero decrement( m_refCount ); } } @@ -275,7 +275,7 @@ OGridColumn::~OGridColumn() dispose(); } - // freigeben der Agg + // Free the aggregate if (m_xAggregate.is()) { InterfaceRef xIface; @@ -483,11 +483,11 @@ Reference< XCloneable > SAL_CALL OGridColumn::createClone( ) throw (RuntimeExce return pNewColumn; } -//XPersistObject +// XPersistObject //------------------------------------------------------------------------------ void SAL_CALL OGridColumn::write(const Reference<XObjectOutputStream>& _rxOutStream) { - // 1. Schreiben des UnoControls + // 1. Write the UnoControl Reference<XMarkableStream> xMark(_rxOutStream, UNO_QUERY); sal_Int32 nMark = xMark->createMark(); @@ -498,14 +498,14 @@ void SAL_CALL OGridColumn::write(const Reference<XObjectOutputStream>& _rxOutStr if (query_aggregation(m_xAggregate, xPersist)) xPersist->write(_rxOutStream); - // feststellen der Laenge + // Calculate the length nLen = xMark->offsetToMark(nMark) - 4; xMark->jumpToMark(nMark); _rxOutStream->writeLong(nLen); xMark->jumpToFurthest(); xMark->deleteMark(nMark); - // 2. Schreiben einer VersionsNummer + // 2. Write a version number _rxOutStream->writeShort(0x0002); sal_uInt16 nAnyMask = 0; @@ -535,7 +535,7 @@ void SAL_CALL OGridColumn::write(const Reference<XObjectOutputStream>& _rxOutStr //------------------------------------------------------------------------------ void SAL_CALL OGridColumn::read(const Reference<XObjectInputStream>& _rxInStream) { - // 1. Lesen des UnoControls + // 1. Read the UnoControl sal_Int32 nLen = _rxInStream->readLong(); if (nLen) { @@ -550,7 +550,7 @@ void SAL_CALL OGridColumn::read(const Reference<XObjectInputStream>& _rxInStream xMark->deleteMark(nMark); } - // 2. Lesen des Versionsnummer + // 2. Write a version number sal_uInt16 nVersion = _rxInStream->readShort(); (void)nVersion; sal_uInt16 nAnyMask = _rxInStream->readShort(); diff --git a/forms/source/component/Columns.hxx b/forms/source/component/Columns.hxx index 4068a7b88590..1a6f1ad745bd 100644 --- a/forms/source/component/Columns.hxx +++ b/forms/source/component/Columns.hxx @@ -75,7 +75,7 @@ protected: ::rtl::OUString m_aModelName; // [properties] - ::rtl::OUString m_aLabel; // Name der Spalte + ::rtl::OUString m_aLabel; // Column name // [properties] public: @@ -83,7 +83,7 @@ public: OGridColumn(const OGridColumn* _pOriginal ); virtual ~OGridColumn(); - // UNO Anbindung + // UNO binding DECLARE_UNO3_AGG_DEFAULTS(OGridControlModel, OGridColumn_BASE); virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException); @@ -198,7 +198,7 @@ OGridColumn* ClassName::createCloneColumn() const \ #define TYPE_TEXTFIELD 8 #define TYPE_TIMEFIELD 9 -// liste aller bekannten columns +// List of all known columns const StringSequence& getColumnTypes(); sal_Int32 getColumnTypeByModelName(const ::rtl::OUString& aModelName); diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index e16a4521d30e..0ba7df850e1f 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -236,7 +236,7 @@ void OComboBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const DBG_ASSERT(_rValue.getValueType().getTypeClass() == TypeClass_STRING, "OComboBoxModel::setFastPropertyValue_NoBroadcast : invalid type !" ); _rValue >>= m_aListSource; - // die ListSource hat sich geaendert -> neu laden + // The ListSource has changed -> reload if (ListSourceType_VALUELIST != m_eListSourceType) { if ( m_xCursor.is() && !hasField() && !hasExternalListSource() ) @@ -411,7 +411,7 @@ void SAL_CALL OComboBoxModel::read(const Reference<stario::XObjectInputStream>& return; } - // Maskierung fuer any + // Masking for any sal_uInt16 nAnyMask; _rxInStream >> nAnyMask; @@ -453,8 +453,8 @@ void SAL_CALL OComboBoxModel::read(const Reference<stario::XObjectInputStream>& if (nVersion > 0x0003) // nVersion == 4 _rxInStream >> m_aDefaultText; - // Stringliste muss geleert werden, wenn eine Listenquelle gesetzt ist - // dieses kann der Fall sein wenn im alive modus gespeichert wird + // StringList must be emptied if a ListSource is set. + // This can be the case if we save in alive mode. if ( !m_aListSource.isEmpty() && !hasExternalListSource() ) @@ -468,7 +468,7 @@ void SAL_CALL OComboBoxModel::read(const Reference<stario::XObjectInputStream>& if (nVersion > 0x0005) readCommonProperties(_rxInStream); - // Nach dem Lesen die Defaultwerte anzeigen + // After reading in, display the default values if ( !getControlSource().isEmpty() ) { // (not if we don't have a control source - the "State" property acts like it is persistent, then @@ -485,7 +485,7 @@ void OComboBoxModel::loadData( bool _bForce ) if ( hasExternalListSource() ) return; - // Connection holen + // Get Connection Reference<XRowSet> xForm(m_xCursor, UNO_QUERY); if (!xForm.is()) return; @@ -625,7 +625,7 @@ void OComboBoxModel::loadData( bool _bForce ) case ListSourceType_TABLE: case ListSourceType_QUERY: { - // die XDatabaseVAriant der ersten Spalte + // The XDatabaseVariant of the first column Reference<XColumnsSupplier> xSupplyCols(xListCursor, UNO_QUERY); DBG_ASSERT(xSupplyCols.is(), "OComboBoxModel::loadData : cursor supports the row set service but is no column supplier?!"); Reference<XIndexAccess> xColumns; @@ -642,10 +642,10 @@ void OComboBoxModel::loadData( bool _bForce ) ::dbtools::FormattedColumnValue aValueFormatter( getContext(), xForm, xDataField ); - // Listen fuellen + // Fill Lists sal_Int16 i = 0; - // per definitionem the list cursor is positioned _before_ the first row at the moment - while (xListCursor->next() && (i++<SHRT_MAX)) // max anzahl eintraege + // At the moment by definition the list cursor is positioned _before_ the first row + while (xListCursor->next() && (i++<SHRT_MAX)) // Set max. count { aStringList.push_back( aValueFormatter.getFormattedValue() ); } @@ -681,13 +681,13 @@ void OComboBoxModel::loadData( bool _bForce ) return; } - // String-Sequence fuer ListBox erzeugen + // Create StringSequence for ListBox StringSequence aStringSeq(aStringList.size()); ::rtl::OUString* pStringAry = aStringSeq.getArray(); for (sal_Int32 i = 0; i<aStringSeq.getLength(); ++i) pStringAry[i] = aStringList[i]; - // String-Sequence an ListBox setzen + // Set String-Sequence at ListBox setFastPropertyValue( PROPERTY_ID_STRINGITEMLIST, makeAny( aStringSeq ) ); } @@ -699,7 +699,7 @@ void OComboBoxModel::onConnectedDbColumn( const Reference< XInterface >& _rxForm m_pValueFormatter.reset( new ::dbtools::FormattedColumnValue( getContext(), Reference< XRowSet >( _rxForm, UNO_QUERY ), xField ) ); getPropertyValue( PROPERTY_STRINGITEMLIST ) >>= m_aDesignModeStringItems; - // Daten nur laden, wenn eine Listenquelle angegeben wurde + // Only load data if a ListSource was supplied if ( !m_aListSource.isEmpty() && m_xCursor.is() && !hasExternalListSource() ) loadData( false ); } diff --git a/forms/source/component/ComboBox.hxx b/forms/source/component/ComboBox.hxx index 76cffbf4e3cb..78941877e3c4 100644 --- a/forms/source/component/ComboBox.hxx +++ b/forms/source/component/ComboBox.hxx @@ -73,8 +73,8 @@ class OComboBoxModel ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter> m_xFormatter; - ::com::sun::star::form::ListSourceType m_eListSourceType; // type der list source - sal_Bool m_bEmptyIsNull; // LeerString wird als NULL interpretiert + ::com::sun::star::form::ListSourceType m_eListSourceType; // ListSource's type + sal_Bool m_bEmptyIsNull; // Empty string is interpreted as NULL ::std::auto_ptr< ::dbtools::FormattedColumnValue > m_pValueFormatter; diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx index 8199fbb469cb..43fda3ebec65 100644 --- a/forms/source/component/Edit.cxx +++ b/forms/source/component/Edit.cxx @@ -206,12 +206,12 @@ void OEditControl::keyPressed(const ::com::sun::star::awt::KeyEvent& e) throw ( if( e.KeyCode != KEY_RETURN || e.Modifiers != 0 ) return; - // Steht das Control in einem Formular mit einer Submit-URL? + // Is the Control in a form with a submit URL? Reference<XPropertySet> xSet(getModel(), UNO_QUERY); if( !xSet.is() ) return; - // nicht fuer multiline edits + // Not for multiline edits Any aTmp( xSet->getPropertyValue(PROPERTY_MULTILINE)); if ((aTmp.getValueType().equals(::getBooleanCppuType())) && getBOOL(aTmp)) return; @@ -244,14 +244,14 @@ void OEditControl::keyPressed(const ::com::sun::star::awt::KeyEvent& e) throw ( if (hasProperty(PROPERTY_CLASSID, xFCSet) && getINT16(xFCSet->getPropertyValue(PROPERTY_CLASSID)) == FormComponentType::TEXTFIELD) { - // Noch ein weiteres Edit gefunden ==> dann nicht submitten + // Found another Edit -> then do not submit! if (xFCSet != xSet) return; } } } - // Da wir noch im Haender stehen, submit asynchron ausloesen + // Because we're still in the header, trigger submit asynchronously if( m_nKeyEvent ) Application::RemoveUserEvent( m_nKeyEvent ); m_nKeyEvent = Application::PostUserEvent( LINK(this, OEditControl,OnKeyPressed) ); @@ -556,9 +556,9 @@ void OEditModel::write(const Reference<XObjectOutputStream>& _rxOutStream) throw { Any aCurrentText; sal_Int16 nOldTextLen = 0; - // bin ich gerade loaded und habe dazu zeitweilig die MaxTextLen umgesetzt ? + // Am I loaded at the moment and did I switch MaxTextLen temporarily? if ( m_bMaxTextLenModified ) - { // -> fuer die Dauer des Speicherns meinem aggregierten Model die alte TextLen einreden + { // -> for the duration of saving, make my aggregated model believe the old TextLen // before doing this we have to save the current text value of the aggregate, as this may be affected by resetting the text len aCurrentText = m_xAggregateSet->getPropertyValue(PROPERTY_TEXT); @@ -570,7 +570,7 @@ void OEditModel::write(const Reference<XObjectOutputStream>& _rxOutStream) throw OEditBaseModel::write(_rxOutStream); if ( m_bMaxTextLenModified ) - { // wieder zuruecksetzen + { // Reset again m_xAggregateSet->setPropertyValue(PROPERTY_MAXTEXTLEN, makeAny(nOldTextLen)); // and reset the text // First we set it to an empty string : Without this the second setPropertyValue would not do anything as it thinks @@ -655,7 +655,7 @@ void OEditModel::onDisconnectedDbColumn() if ( hasField() && m_bMaxTextLenModified ) { Any aVal; - aVal <<= (sal_Int16)0; // nur wenn es 0 war, habe ich es in onConnectedDbColumn umgesetzt + aVal <<= (sal_Int16)0; // Only if it was 0, I switched it in onConnectedDbColumn m_xAggregateSet->setPropertyValue(PROPERTY_MAXTEXTLEN, aVal); m_bMaxTextLenModified = sal_False; } @@ -664,7 +664,7 @@ void OEditModel::onDisconnectedDbColumn() //------------------------------------------------------------------------------ sal_Bool OEditModel::approveDbColumnType( sal_Int32 _nColumnType ) { - // if we act as rich text curently, we do not allow binding to a database column + // if we act as rich text currently, we do not allow binding to a database column if ( implActsAsRichText() ) return sal_False; diff --git a/forms/source/component/EditBase.cxx b/forms/source/component/EditBase.cxx index 4b61b5560c94..c716541f145a 100644 --- a/forms/source/component/EditBase.cxx +++ b/forms/source/component/EditBase.cxx @@ -105,14 +105,14 @@ void OEditBaseModel::write(const Reference<XObjectOutputStream>& _rxOutStream) t _rxOutStream->writeShort(0); // obsolete _rxOutStream << m_aDefaultText; - // Maskierung fuer any + // Masking for any sal_uInt16 nAnyMask = 0; if (m_aDefault.getValueType().getTypeClass() == TypeClass_LONG) nAnyMask |= DEFAULT_LONG; else if (m_aDefault.getValueType().getTypeClass() == TypeClass_DOUBLE) nAnyMask |= DEFAULT_DOUBLE; - if (m_bFilterProposal) // da boolean, kein Wert speichern + if (m_bFilterProposal) // Don't save a value, because it's boolean nAnyMask |= FILTERPROPOSAL; _rxOutStream->writeBoolean(m_bEmptyIsNull); @@ -151,7 +151,7 @@ void OEditBaseModel::read(const Reference<XObjectInputStream>& _rxInStream) thro OBoundControlModel::read(_rxInStream); ::osl::MutexGuard aGuard(m_aMutex); - // Version eigene Versionsnummer + // Version's own version number sal_uInt16 nVersion = _rxInStream->readShort(); m_nLastReadVersion = nVersion; @@ -189,7 +189,7 @@ void OEditBaseModel::read(const Reference<XObjectInputStream>& _rxInStream) thro if (bHandleCommonProps) readCommonEditProperties(_rxInStream); - // Nach dem Lesen die Defaultwerte anzeigen + // After reading, display default values if ( !getControlSource().isEmpty() ) // (not if we don't have a control source - the "State" property acts like it is persistent, then) resetNoBroadcast(); @@ -316,7 +316,7 @@ void OEditBaseModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_BOOLEAN, "invalid type" ); m_bFilterProposal = getBOOL(rValue); break; - // Aenderung der defaultwerte fuehrt zu reset + // Changing the default values causes a reset case PROPERTY_ID_DEFAULT_TEXT: DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_STRING, "invalid type" ); rValue >>= m_aDefaultText; @@ -333,7 +333,7 @@ void OEditBaseModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const } } -//XPropertyState +// XPropertyState //------------------------------------------------------------------------------ Any OEditBaseModel::getPropertyDefaultByHandle( sal_Int32 nHandle ) const { diff --git a/forms/source/component/EditBase.hxx b/forms/source/component/EditBase.hxx index 447f06f9047f..3aa5fd4b37b6 100644 --- a/forms/source/component/EditBase.hxx +++ b/forms/source/component/EditBase.hxx @@ -66,7 +66,7 @@ class OEditBaseModel : public OBoundControlModel sal_Int16 m_nLastReadVersion; protected: -// [properties] fuer all Editierfelder +// [properties] for all EditingFields ::com::sun::star::uno::Any m_aDefault; ::rtl::OUString m_aDefaultText; // default value sal_Bool m_bEmptyIsNull : 1; // empty string will be interepreted as NULL when committing diff --git a/forms/source/component/EventThread.cxx b/forms/source/component/EventThread.cxx index e937a332c441..04752f9e0ec5 100644 --- a/forms/source/component/EventThread.cxx +++ b/forms/source/component/EventThread.cxx @@ -46,13 +46,13 @@ OComponentEventThread::OComponentEventThread( ::cppu::OComponentHelper* pCompImp increment(m_refCount); - // Eine Referenz des Controls halten + // Hold a reference of the Control { InterfaceRef xIFace(static_cast<XWeak*>(pCompImpl)); query_interface(xIFace, m_xComp); } - // und uns an dem Control anmelden + // and add us at the Control { Reference<XEventListener> xEvtLstnr = static_cast<XEventListener*>(this); m_xComp->addEventListener( xEvtLstnr ); @@ -66,7 +66,7 @@ OComponentEventThread::~OComponentEventThread() DBG_DTOR( OComponentEventThread, NULL ); DBG_ASSERT( m_aEvents.empty(), - "OComponentEventThread::~OComponentEventThread: Kein dispose gerufen?" ); + "OComponentEventThread::~OComponentEventThread: Didn't call dispose?" ); impl_clearEventQueue(); } @@ -102,19 +102,19 @@ void OComponentEventThread::disposing( const EventObject& evt ) throw ( ::com::s { ::osl::MutexGuard aGuard( m_aMutex ); - // Event-Listener abmelden + // Remove EventListener Reference<XEventListener> xEvtLstnr = static_cast<XEventListener*>(this); m_xComp->removeEventListener( xEvtLstnr ); - // Event-Queue loeschen + // Clear EventQueue impl_clearEventQueue(); - // Das Control loslassen und pCompImpl auf 0 setzen, damit der - // Thread weiss, dass er sich beenden soll. + // Free the Control and set pCompImpl to 0, + // so that the thread knows, that it should terminate. m_xComp = 0; m_pCompImpl = 0; - // Den Thread aufwecken und beenden. + // Wake up the thread and terminate m_aCond.set(); terminate(); } @@ -132,7 +132,7 @@ void OComponentEventThread::addEvent( const EventObject* _pEvt, { ::osl::MutexGuard aGuard( m_aMutex ); - // Daten in die Queue stellen + // Put data into the queue m_aEvents.push_back( cloneEvent( _pEvt ) ); Reference<XWeak> xWeakControl(rControl, UNO_QUERY); @@ -141,7 +141,7 @@ void OComponentEventThread::addEvent( const EventObject* _pEvt, m_aFlags.push_back( bFlag ); - // Thread aufwecken + // Wake up thread m_aCond.set(); } @@ -174,8 +174,7 @@ void OComponentEventThread::run() { implStarted( ); - // uns selbst festhalten, damit wir nicht geloescht werden, - // wenn zwischendrinne mal ein dispose gerufen wird. + // Hold on to ourselves, so that we're not deleted if a dispose is called at some point in time InterfaceRef xThis(static_cast<XWeak*>(this)); do @@ -184,8 +183,7 @@ void OComponentEventThread::run() while( m_aEvents.size() > 0 ) { - // Das Control holen und festhalten, damit es waehrend des - // actionPerformed nicht geloescht werden kann. + // Get the Control and hold on to it so that it cannot be deleted during actionPerformed Reference<XComponent> xComp = m_xComp; ::cppu::OComponentHelper *pCompImpl = m_pCompImpl; @@ -203,8 +201,8 @@ void OComponentEventThread::run() { MutexRelease aReleaseOnce(m_aMutex); - // Weil ein queryHardRef eine Exception schmeissen kann sollte - // es nicht bei gelocktem Mutex aufgerufen werden. + // Because a queryHardRef can throw an Exception, it shoudln't be called when + // the mutex is locked. Reference<XControl> xControl; if ( xControlAdapter.is() ) query_interface(xControlAdapter->queryAdapted(), xControl); @@ -216,17 +214,16 @@ void OComponentEventThread::run() delete pEvt; }; - // Nach einem dispose kennen wir das Control nicht mehr. Dann darf - // auch nicht gewartet werden. + // After a Dispose, we do not know the Control anymore. + // Thus, we must not wait either. if( !m_xComp.is() ) return; - // Warte-Bedingung zuruecksetzen + // Reset waiting condition m_aCond.reset(); { MutexRelease aReleaseOnce(m_aMutex); - // und warten ... falls nicht zwischenzeitlich doch noch ein - // Event eingetroffen ist. + // And wait ... if, in the meantime, an Event came in after all m_aCond.wait(); } } diff --git a/forms/source/component/EventThread.hxx b/forms/source/component/EventThread.hxx index 195a354fbd7a..440d845ebe90 100644 --- a/forms/source/component/EventThread.hxx +++ b/forms/source/component/EventThread.hxx @@ -61,13 +61,13 @@ class OComponentEventThread DECLARE_STL_VECTOR(sal_Bool, ThreadBools); ::osl::Mutex m_aMutex; - ::osl::Condition m_aCond; // Queue gefuellt? - ThreadEvents m_aEvents; // Event-Queue - ThreadObjects m_aControls; // Control fuer Submit - ThreadBools m_aFlags; // Flags fuer Submit/Reset + ::osl::Condition m_aCond; // Queue filled? + ThreadEvents m_aEvents; // EventQueue + ThreadObjects m_aControls; // Control for Submit + ThreadBools m_aFlags; // Flags for Submit/Reset - ::cppu::OComponentHelper* m_pCompImpl; // Implementierung des Controls - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> m_xComp; // ::com::sun::star::lang::XComponent des Controls + ::cppu::OComponentHelper* m_pCompImpl; // Implementation of the Control + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> m_xComp; // ::com::sun::star::lang::XComponent of the Control protected: @@ -77,16 +77,14 @@ protected: virtual void SAL_CALL kill(); virtual void SAL_CALL onTerminated(); - // Die folgende Methode wird gerufen um das Event unter Beruecksichtigung - // seines Typs zu duplizieren. + // The following method is called to duplicate the Event while respecting it's type. virtual ::com::sun::star::lang::EventObject* cloneEvent(const ::com::sun::star::lang::EventObject* _pEvt) const = 0; - // Ein Event bearbeiten. Der Mutex ist dabei nicht gelockt, pCompImpl - // bleibt aber in jedem Fall gueltig. Bei pEvt kann es sich auch um - // einen abgeleiteten Typ handeln, naemlich den, den cloneEvent - // zurueckgibt. rControl ist nur gesetzt, wenn beim addEvent ein - // Control uebergeben wurde. Da das Control nur als WeakRef gehalten - // wird kann es auch zwischenzeitlich verschwinden. + // Edit an Event: + // The mutex is not locked, but pCompImpl stays valid in any case. + // pEvt can be a derrived type, namely the one that cloneEvent returns. + // rControl is only set, if a Control has been passed in addEvent. + // Because the Control is only held as a WeakRef, it can disappear in the meantime. virtual void processEvent( ::cppu::OComponentHelper* _pCompImpl, const ::com::sun::star::lang::EventObject* _pEvt, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl>& _rControl, |