Kaydet (Commit) 0f8ed329 authored tarafından Philipp Weissenbacher's avatar Philipp Weissenbacher Kaydeden (comit) Caolán McNamara

fdo#39468 Translate German comments, clean some ws

Conflicts:
	forms/source/component/FormComponent.cxx
	forms/source/component/FormattedField.cxx

Change-Id: I76dacfff3aa6f5680a1e81c97281c4f744ec1ceb
Reviewed-on: https://gerrit.libreoffice.org/11622Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 0af1c09b
...@@ -154,7 +154,7 @@ void OControl::doSetDelegator() ...@@ -154,7 +154,7 @@ void OControl::doSetDelegator()
decrement( m_refCount ); decrement( m_refCount );
} }
// UNO Anbindung // UNO Binding
Any SAL_CALL OControl::queryAggregation( const Type& _rType ) throw(RuntimeException, std::exception) Any SAL_CALL OControl::queryAggregation( const Type& _rType ) throw(RuntimeException, std::exception)
{ {
// ask the base class // ask the base class
...@@ -758,13 +758,13 @@ void SAL_CALL OControlModel::write(const Reference<css::io::XObjectOutputStream> ...@@ -758,13 +758,13 @@ void SAL_CALL OControlModel::write(const Reference<css::io::XObjectOutputStream>
xMark->jumpToFurthest(); xMark->jumpToFurthest();
xMark->deleteMark(nMark); xMark->deleteMark(nMark);
// 2. wrting a version number // 2. writing a version number
_rxOutStream->writeShort(0x0003); _rxOutStream->writeShort(0x0003);
// 3. writing the general properties // 3. writing the general properties
::comphelper::operator<<( _rxOutStream, m_aName); ::comphelper::operator<<( _rxOutStream, m_aName);
_rxOutStream->writeShort(m_nTabIndex); _rxOutStream->writeShort(m_nTabIndex);
::comphelper::operator<<( _rxOutStream, m_aTag); // 3. version ::comphelper::operator<<( _rxOutStream, m_aTag); // 3rd version
// IMPORTANT NOTE! // IMPORTANT NOTE!
// don't write any new members here: this wouldn't be compatible with older versions, as OControlModel // don't write any new members here: this wouldn't be compatible with older versions, as OControlModel
......
...@@ -196,7 +196,7 @@ void OFormattedControl::keyPressed(const ::com::sun::star::awt::KeyEvent& e) thr ...@@ -196,7 +196,7 @@ void OFormattedControl::keyPressed(const ::com::sun::star::awt::KeyEvent& e) thr
{ {
if( e.KeyCode != KEY_RETURN || e.Modifiers != 0 ) if( e.KeyCode != KEY_RETURN || e.Modifiers != 0 )
return; return;
// Is the control on a form with a submit URL? // Is the control located in a form with a Submit URL?
Reference<com::sun::star::beans::XPropertySet> xSet(getModel(), UNO_QUERY); Reference<com::sun::star::beans::XPropertySet> xSet(getModel(), UNO_QUERY);
if( !xSet.is() ) if( !xSet.is() )
return; return;
...@@ -223,13 +223,13 @@ void OFormattedControl::keyPressed(const ::com::sun::star::awt::KeyEvent& e) thr ...@@ -223,13 +223,13 @@ void OFormattedControl::keyPressed(const ::com::sun::star::awt::KeyEvent& e) thr
if (hasProperty(PROPERTY_CLASSID, xFCSet) && if (hasProperty(PROPERTY_CLASSID, xFCSet) &&
getINT16(xFCSet->getPropertyValue(PROPERTY_CLASSID)) == FormComponentType::TEXTFIELD) getINT16(xFCSet->getPropertyValue(PROPERTY_CLASSID)) == FormComponentType::TEXTFIELD)
{ {
// Found another edit ==> no submit // Found another Edit -> Do not submit then
if (xFCSet != xSet) if (xFCSet != xSet)
return; return;
} }
} }
} }
// Still in the handler, trigger submit asynchronous // Because we're still in the Handler, execute submit asynchronously
if( m_nKeyEvent ) if( m_nKeyEvent )
Application::RemoveUserEvent( m_nKeyEvent ); Application::RemoveUserEvent( m_nKeyEvent );
m_nKeyEvent = Application::PostUserEvent( LINK(this, OFormattedControl, m_nKeyEvent = Application::PostUserEvent( LINK(this, OFormattedControl,
...@@ -363,10 +363,10 @@ void OFormattedModel::describeFixedProperties( Sequence< Property >& _rProps ) c ...@@ -363,10 +363,10 @@ void OFormattedModel::describeFixedProperties( Sequence< Property >& _rProps ) c
void OFormattedModel::describeAggregateProperties( Sequence< Property >& _rAggregateProps ) const void OFormattedModel::describeAggregateProperties( Sequence< Property >& _rAggregateProps ) const
{ {
OEditBaseModel::describeAggregateProperties( _rAggregateProps ); OEditBaseModel::describeAggregateProperties( _rAggregateProps );
// TreatAsNumeric not transient : we want to bind it to the UI (necessary, because EffectiveDefault // TreatAsNumeric is not transient: we want to attach it to the UI
// - could be text or numbers - for making sense) // This is necessary to make EffectiveDefault (which may be text or a number) meaningful
ModifyPropertyAttributes(_rAggregateProps, PROPERTY_TREATASNUMERIC, 0, PropertyAttribute::TRANSIENT); ModifyPropertyAttributes(_rAggregateProps, PROPERTY_TREATASNUMERIC, 0, PropertyAttribute::TRANSIENT);
// same for FormatKey // Same for FormatKey
// (though the paragraph above for the TreatAsNumeric does not hold anymore - we do not have an UI for this. // (though the paragraph above for the TreatAsNumeric does not hold anymore - we do not have an UI for this.
// But we have for the format key ...) // But we have for the format key ...)
ModifyPropertyAttributes(_rAggregateProps, PROPERTY_FORMATKEY, 0, PropertyAttribute::TRANSIENT); ModifyPropertyAttributes(_rAggregateProps, PROPERTY_FORMATKEY, 0, PropertyAttribute::TRANSIENT);
...@@ -492,7 +492,7 @@ Reference< XNumberFormatsSupplier > OFormattedModel::calcFormatsSupplier() const ...@@ -492,7 +492,7 @@ Reference< XNumberFormatsSupplier > OFormattedModel::calcFormatsSupplier() const
{ {
Reference<XNumberFormatsSupplier> xSupplier; Reference<XNumberFormatsSupplier> xSupplier;
DBG_ASSERT(m_xAggregateSet.is(), "OFormattedModel::calcFormatsSupplier : have no aggregate !"); DBG_ASSERT(m_xAggregateSet.is(), "OFormattedModel::calcFormatsSupplier : have no aggregate !");
// check if my aggregated model has a FormatSupplier // Does my aggregate model have a FormatSupplier?
if( m_xAggregateSet.is() ) if( m_xAggregateSet.is() )
m_xAggregateSet->getPropertyValue(PROPERTY_FORMATSSUPPLIER) >>= xSupplier; m_xAggregateSet->getPropertyValue(PROPERTY_FORMATSSUPPLIER) >>= xSupplier;
if (!xSupplier.is()) if (!xSupplier.is())
...@@ -501,7 +501,7 @@ Reference< XNumberFormatsSupplier > OFormattedModel::calcFormatsSupplier() const ...@@ -501,7 +501,7 @@ Reference< XNumberFormatsSupplier > OFormattedModel::calcFormatsSupplier() const
if (!xSupplier.is()) if (!xSupplier.is())
xSupplier = calcDefaultFormatsSupplier(); xSupplier = calcDefaultFormatsSupplier();
DBG_ASSERT(xSupplier.is(), "OFormattedModel::calcFormatsSupplier : no supplier !"); DBG_ASSERT(xSupplier.is(), "OFormattedModel::calcFormatsSupplier : no supplier !");
// now it should be there // We should have one by now
return xSupplier; return xSupplier;
} }
...@@ -509,9 +509,9 @@ Reference<XNumberFormatsSupplier> OFormattedModel::calcFormFormatsSupplier() co ...@@ -509,9 +509,9 @@ Reference<XNumberFormatsSupplier> OFormattedModel::calcFormFormatsSupplier() co
{ {
Reference<XChild> xMe; Reference<XChild> xMe;
query_interface(static_cast<XWeak*>(const_cast<OFormattedModel*>(this)), xMe); query_interface(static_cast<XWeak*>(const_cast<OFormattedModel*>(this)), xMe);
// now we are sure, in case of an aggregation, to get the right object // By this we make sure that we get the right object even when aggregating
DBG_ASSERT(xMe.is(), "OFormattedModel::calcFormFormatsSupplier : I should have a content interface !"); DBG_ASSERT(xMe.is(), "OFormattedModel::calcFormFormatsSupplier : I should have a content interface !");
// expand to the top, till we get to an initial form (starting with my own parent) // Iterate through until we reach a StartForm (starting with an own Parent)
Reference<XChild> xParent(xMe->getParent(), UNO_QUERY); Reference<XChild> xParent(xMe->getParent(), UNO_QUERY);
Reference<XForm> xNextParentForm(xParent, UNO_QUERY); Reference<XForm> xNextParentForm(xParent, UNO_QUERY);
while (!xNextParentForm.is() && xParent.is()) while (!xNextParentForm.is() && xParent.is())
...@@ -524,7 +524,7 @@ Reference<XNumberFormatsSupplier> OFormattedModel::calcFormFormatsSupplier() co ...@@ -524,7 +524,7 @@ Reference<XNumberFormatsSupplier> OFormattedModel::calcFormFormatsSupplier() co
OSL_FAIL("OFormattedModel::calcFormFormatsSupplier : have no ancestor which is a form !"); OSL_FAIL("OFormattedModel::calcFormFormatsSupplier : have no ancestor which is a form !");
return NULL; return NULL;
} }
// the FormatSupplier of my ancestor (if he owns one) // The FormatSupplier of my ancestor (if it has one)
Reference< XRowSet > xRowSet( xNextParentForm, UNO_QUERY ); Reference< XRowSet > xRowSet( xNextParentForm, UNO_QUERY );
Reference< XNumberFormatsSupplier > xSupplier; Reference< XNumberFormatsSupplier > xSupplier;
if (xRowSet.is()) if (xRowSet.is())
...@@ -540,7 +540,7 @@ Reference< XNumberFormatsSupplier > OFormattedModel::calcDefaultFormatsSupplier( ...@@ -540,7 +540,7 @@ Reference< XNumberFormatsSupplier > OFormattedModel::calcDefaultFormatsSupplier(
// XBoundComponent // XBoundComponent
void OFormattedModel::loaded(const EventObject& rEvent) throw ( ::com::sun::star::uno::RuntimeException, std::exception) void OFormattedModel::loaded(const EventObject& rEvent) throw ( ::com::sun::star::uno::RuntimeException, std::exception)
{ {
// HACK : our onConnectedDbColumn accesses our NumberFormatter which locks the solar mutex (as it doesn't have // HACK: our onConnectedDbColumn accesses our NumberFormatter which locks the solar mutex (as it doesn't have
// an own one). To prevent deadlocks with other threads which may request a property from us in an // an own one). To prevent deadlocks with other threads which may request a property from us in an
// UI-triggered action (e.g. an tooltip) we lock the solar mutex _here_ before our base class locks // UI-triggered action (e.g. an tooltip) we lock the solar mutex _here_ before our base class locks
// it's own muext (which is used for property requests) // it's own muext (which is used for property requests)
...@@ -566,7 +566,7 @@ void OFormattedModel::onConnectedDbColumn( const Reference< XInterface >& _rxFor ...@@ -566,7 +566,7 @@ void OFormattedModel::onConnectedDbColumn( const Reference< XInterface >& _rxFor
{ // all the following doesn't make any sense if we have no aggregate ... { // all the following doesn't make any sense if we have no aggregate ...
Any aSupplier = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATSSUPPLIER); Any aSupplier = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATSSUPPLIER);
DBG_ASSERT( aSupplier.hasValue(), "OFormattedModel::onConnectedDbColumn : invalid property value !" ); DBG_ASSERT( aSupplier.hasValue(), "OFormattedModel::onConnectedDbColumn : invalid property value !" );
// this should already be initiated and correctly set by the constructor or the read function // This should've been set to the correct value in the ctor or in the read
Any aFmtKey = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY); Any aFmtKey = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY);
if ( !(aFmtKey >>= nFormatKey ) ) if ( !(aFmtKey >>= nFormatKey ) )
{ // nobody gave us a format to use. So we examine the field we're bound to for a { // nobody gave us a format to use. So we examine the field we're bound to for a
...@@ -598,7 +598,7 @@ void OFormattedModel::onConnectedDbColumn( const Reference< XInterface >& _rxFor ...@@ -598,7 +598,7 @@ void OFormattedModel::onConnectedDbColumn( const Reference< XInterface >& _rxFor
aSupplier >>= m_xOriginalFormatter; aSupplier >>= m_xOriginalFormatter;
m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, makeAny(xSupplier)); m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, makeAny(xSupplier));
m_xAggregateSet->setPropertyValue(PROPERTY_FORMATKEY, aFmtKey); m_xAggregateSet->setPropertyValue(PROPERTY_FORMATKEY, aFmtKey);
// adapt the numeric-flag to my bound field // Adapt the NumericFalg to my bound field
if (xField.is()) if (xField.is())
{ {
m_bNumeric = false; m_bNumeric = false;
...@@ -640,7 +640,7 @@ void OFormattedModel::onDisconnectedDbColumn() ...@@ -640,7 +640,7 @@ void OFormattedModel::onDisconnectedDbColumn()
{ {
OEditBaseModel::onDisconnectedDbColumn(); OEditBaseModel::onDisconnectedDbColumn();
if (m_xOriginalFormatter.is()) if (m_xOriginalFormatter.is())
{ // the aggregated model has no format information { // Our aggregated model does not hold any Format information
m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, makeAny(m_xOriginalFormatter)); m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, makeAny(m_xOriginalFormatter));
m_xAggregateSet->setPropertyValue(PROPERTY_FORMATKEY, Any()); m_xAggregateSet->setPropertyValue(PROPERTY_FORMATKEY, Any());
setPropertyValue(PROPERTY_TREATASNUMERIC, makeAny(m_bOriginalNumeric)); setPropertyValue(PROPERTY_TREATASNUMERIC, makeAny(m_bOriginalNumeric));
...@@ -656,8 +656,9 @@ void OFormattedModel::write(const Reference<XObjectOutputStream>& _rxOutStream) ...@@ -656,8 +656,9 @@ void OFormattedModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
OEditBaseModel::write(_rxOutStream); OEditBaseModel::write(_rxOutStream);
_rxOutStream->writeShort(0x0003); _rxOutStream->writeShort(0x0003);
DBG_ASSERT(m_xAggregateSet.is(), "OFormattedModel::write : have no aggregate !"); DBG_ASSERT(m_xAggregateSet.is(), "OFormattedModel::write : have no aggregate !");
// take my format (possibly void) into a persistent format (the supplier together with the key // Bring my Format (may be void) to a persistent Format.
// would also be persistent, but saving the whole supplier would be overhead) // The Supplier together with the Key is already persistent, but that doesn't mean
// we have to save the Supplier (which would be quite some overhead)
Reference<XNumberFormatsSupplier> xSupplier; Reference<XNumberFormatsSupplier> xSupplier;
Any aFmtKey; Any aFmtKey;
bool bVoidKey = true; bool bVoidKey = true;
...@@ -670,12 +671,12 @@ void OFormattedModel::write(const Reference<XObjectOutputStream>& _rxOutStream) ...@@ -670,12 +671,12 @@ void OFormattedModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
} }
aFmtKey = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY); aFmtKey = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY);
bVoidKey = (!xSupplier.is() || !aFmtKey.hasValue()) || (isLoaded() && m_xOriginalFormatter.is()); bVoidKey = (!xSupplier.is() || !aFmtKey.hasValue()) || (isLoaded() && m_xOriginalFormatter.is());
// (no formatter and/or key) or (loaded and fakes formatter) // (no Format and/or Key) OR (loaded and faked Formatter)
} }
_rxOutStream->writeBoolean(!bVoidKey); _rxOutStream->writeBoolean(!bVoidKey);
if (!bVoidKey) if (!bVoidKey)
{ {
// build persistent data with the FormatKey and the formatter // Create persistent values from the FormatKey and the Formatter
Any aKey = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY); Any aKey = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY);
sal_Int32 nKey = aKey.hasValue() ? getINT32(aKey) : 0; sal_Int32 nKey = aKey.hasValue() ? getINT32(aKey) : 0;
Reference<XNumberFormats> xFormats = xSupplier->getNumberFormats(); Reference<XNumberFormats> xFormats = xSupplier->getNumberFormats();
...@@ -702,8 +703,8 @@ void OFormattedModel::write(const Reference<XObjectOutputStream>& _rxOutStream) ...@@ -702,8 +703,8 @@ void OFormattedModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
// version 2 : write the properties common to all OEditBaseModels // version 2 : write the properties common to all OEditBaseModels
writeCommonEditProperties(_rxOutStream); writeCommonEditProperties(_rxOutStream);
// version 3 : write the effective value property of the aggregate // version 3 : write the effective value property of the aggregate
// Due to a bug within the UnoControlFormattedFieldModel implementation (our default aggregate) this props value isn't correctly read // Due to a bug within the UnoControlFormattedFieldModel implementation (our default aggregate)
// and this can't be corrected without being incompatible. // this props value isn't correctly read and this can't be corrected without being incompatible.
// so we have our own handling. // so we have our own handling.
// and to be a little bit more compatible we make the following section skippable // and to be a little bit more compatible we make the following section skippable
{ {
......
...@@ -31,19 +31,15 @@ ...@@ -31,19 +31,15 @@
namespace frm namespace frm
{ {
// OFormsCollection // OFormsCollection
// Implementiert den UNO-Container fuer Formulare // Implements the UNO Container for Forms and contains all assigend Forms.
// enthaelt alle zugeordneten Forms // It can either represent the Context for Forms or be passed a Context.
// dieses Container kann selbst den Context fuer Formulare darstellen
// oder aussen einen Context uebergeben bekommen
typedef ::cppu::OComponentHelper FormsCollectionComponentBase; typedef ::cppu::OComponentHelper FormsCollectionComponentBase;
typedef ::cppu::ImplHelper2< ::com::sun::star::form::XForms typedef ::cppu::ImplHelper2< ::com::sun::star::form::XForms
,::com::sun::star::lang::XServiceInfo > OFormsCollection_BASE; ,::com::sun::star::lang::XServiceInfo > OFormsCollection_BASE;
// else MSVC kills itself on some statements // else MSVC kills itself on some statements
class OFormsCollection class OFormsCollection
:public FormsCollectionComponentBase :public FormsCollectionComponentBase
,public OInterfaceContainer ,public OInterfaceContainer
......
...@@ -69,7 +69,7 @@ class OGridControlModel :public OControlModel ...@@ -69,7 +69,7 @@ class OGridControlModel :public OControlModel
m_aRowSetChangeListeners; m_aRowSetChangeListeners;
// [properties] // [properties]
::com::sun::star::uno::Any m_aRowHeight; // Zeilenhoehe ::com::sun::star::uno::Any m_aRowHeight; // Row height
::com::sun::star::uno::Any m_aTabStop; ::com::sun::star::uno::Any m_aTabStop;
::com::sun::star::uno::Any m_aBackgroundColor; ::com::sun::star::uno::Any m_aBackgroundColor;
::com::sun::star::uno::Any m_aCursorColor; // transient ::com::sun::star::uno::Any m_aCursorColor; // transient
...@@ -100,7 +100,7 @@ protected: ...@@ -100,7 +100,7 @@ protected:
public: public:
DECLARE_DEFAULT_LEAF_XTOR( OGridControlModel ); DECLARE_DEFAULT_LEAF_XTOR( OGridControlModel );
// UNO Anbindung // UNO Binding
DECLARE_UNO3_AGG_DEFAULTS(OGridControlModel, OControlModel) DECLARE_UNO3_AGG_DEFAULTS(OGridControlModel, OControlModel)
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
......
...@@ -116,7 +116,6 @@ void SAL_CALL OGroupBoxModel::read(const Reference< XObjectInputStream>& _rxInSt ...@@ -116,7 +116,6 @@ void SAL_CALL OGroupBoxModel::read(const Reference< XObjectInputStream>& _rxInSt
// Version // Version
sal_uInt16 nVersion = _rxInStream->readShort(); sal_uInt16 nVersion = _rxInStream->readShort();
DBG_ASSERT(nVersion > 0, "OGroupBoxModel::read : version 0 ? this should never have been written !"); DBG_ASSERT(nVersion > 0, "OGroupBoxModel::read : version 0 ? this should never have been written !");
// ups, ist das Englisch richtig ? ;)
if (nVersion == 2) if (nVersion == 2)
readHelpTextCompatibly(_rxInStream); readHelpTextCompatibly(_rxInStream);
......
...@@ -53,7 +53,7 @@ protected: ...@@ -53,7 +53,7 @@ protected:
}; };
// OGroupBoxControl (nur aus Kompatibilitaet zur 5.0) // OGroupBoxControl (only for compatibility for 5.0)
class OGroupBoxControl : public OControl class OGroupBoxControl : public OControl
{ {
......
...@@ -117,7 +117,7 @@ public: ...@@ -117,7 +117,7 @@ public:
bool operator() (const OGroupComp& lhs, const OGroupComp& rhs) const bool operator() (const OGroupComp& lhs, const OGroupComp& rhs) const
{ {
bool bResult; bool bResult;
// TabIndex von 0 wird hinten einsortiert // TabIndex of 0 will be added at the end
if (lhs.m_nTabIndex == rhs.GetTabIndex()) if (lhs.m_nTabIndex == rhs.GetTabIndex())
bResult = lhs.m_nPos < rhs.GetPos(); bResult = lhs.m_nPos < rhs.GetPos();
else if (lhs.m_nTabIndex && rhs.GetTabIndex()) else if (lhs.m_nTabIndex && rhs.GetTabIndex())
...@@ -164,20 +164,19 @@ void OGroup::RemoveComponent( const Reference<XPropertySet>& rxElement ) ...@@ -164,20 +164,19 @@ void OGroup::RemoveComponent( const Reference<XPropertySet>& rxElement )
m_aCompArray.erase( m_aCompArray.begin() + nGroupCompPos ); m_aCompArray.erase( m_aCompArray.begin() + nGroupCompPos );
/* /*
Durch das Entfernen der GroupComp ist die Einfuegeposition * By removing the GroupComp the insertion position has become invalid.
ungueltig geworden. Sie braucht hier aber nicht angepasst werden, * We do not to change it here, however, because its passed on continously
da sie fortlaufend vergeben wird und damit immer * and ascending distinctively.
aufsteigend eindeutig ist.
*/ */
} }
else else
{ {
OSL_FAIL( "OGroup::RemoveComponent: Component nicht in Gruppe" ); OSL_FAIL( "OGroup::RemoveComponent: Component not in Group" );
} }
} }
else else
{ {
OSL_FAIL( "OGroup::RemoveComponent: Component nicht in Gruppe" ); OSL_FAIL( "OGroup::RemoveComponent: Component not in Group" );
} }
} }
...@@ -243,7 +242,7 @@ void OGroupManager::removeFromGroupMap(const OUString& _sGroupName,const Referen ...@@ -243,7 +242,7 @@ void OGroupManager::removeFromGroupMap(const OUString& _sGroupName,const Referen
// group exists // group exists
aFind->second.RemoveComponent( _xSet ); aFind->second.RemoveComponent( _xSet );
// Wenn Anzahl der Gruppenelemente == 1 ist, Gruppe deaktivieren // If the count of Group elements == 1 -> deactivate Group
sal_Int32 nCount = aFind->second.Count(); sal_Int32 nCount = aFind->second.Count();
if ( nCount == 1 || nCount == 0 ) if ( nCount == 1 || nCount == 0 )
{ {
...@@ -263,7 +262,7 @@ void OGroupManager::removeFromGroupMap(const OUString& _sGroupName,const Referen ...@@ -263,7 +262,7 @@ void OGroupManager::removeFromGroupMap(const OUString& _sGroupName,const Referen
} }
// Bei Component als PropertyChangeListener abmelden // Deregister as PropertyChangeListener at Component
_xSet->removePropertyChangeListener( PROPERTY_NAME, this ); _xSet->removePropertyChangeListener( PROPERTY_NAME, this );
if (hasProperty(PROPERTY_GROUP_NAME, _xSet)) if (hasProperty(PROPERTY_GROUP_NAME, _xSet))
_xSet->removePropertyChangeListener( PROPERTY_GROUP_NAME, this ); _xSet->removePropertyChangeListener( PROPERTY_GROUP_NAME, this );
...@@ -297,7 +296,7 @@ void SAL_CALL OGroupManager::propertyChange(const PropertyChangeEvent& evt) thro ...@@ -297,7 +296,7 @@ void SAL_CALL OGroupManager::propertyChange(const PropertyChangeEvent& evt) thro
removeFromGroupMap(sGroupName,xSet); removeFromGroupMap(sGroupName,xSet);
// Component neu einordnen // Re-insert Component
InsertElement( xSet ); InsertElement( xSet );
} }
...@@ -359,15 +358,15 @@ void OGroupManager::getGroupByName(const OUString& _rName, Sequence< Reference<X ...@@ -359,15 +358,15 @@ void OGroupManager::getGroupByName(const OUString& _rName, Sequence< Reference<X
void OGroupManager::InsertElement( const Reference<XPropertySet>& xSet ) void OGroupManager::InsertElement( const Reference<XPropertySet>& xSet )
{ {
// Nur ControlModels // Only ControlModels
Reference<XControlModel> xControl(xSet, UNO_QUERY); Reference<XControlModel> xControl(xSet, UNO_QUERY);
if (!xControl.is() ) if (!xControl.is() )
return; return;
// Component in CompGroup aufnehmen // Add Component to CompGroup
m_pCompGroup->InsertComponent( xSet ); m_pCompGroup->InsertComponent( xSet );
// Component in Gruppe aufnehmen // Add Component to Group
OUString sGroupName( GetGroupName( xSet ) ); OUString sGroupName( GetGroupName( xSet ) );
OGroupArr::iterator aFind = m_aGroupArr.find(sGroupName); OGroupArr::iterator aFind = m_aGroupArr.find(sGroupName);
...@@ -403,24 +402,24 @@ void OGroupManager::InsertElement( const Reference<XPropertySet>& xSet ) ...@@ -403,24 +402,24 @@ void OGroupManager::InsertElement( const Reference<XPropertySet>& xSet )
m_aActiveGroupMap.push_back( aFind ); m_aActiveGroupMap.push_back( aFind );
} }
// Bei Component als PropertyChangeListener anmelden // Register as PropertyChangeListener at Component
xSet->addPropertyChangeListener( PROPERTY_NAME, this ); xSet->addPropertyChangeListener( PROPERTY_NAME, this );
if (hasProperty(PROPERTY_GROUP_NAME, xSet)) if (hasProperty(PROPERTY_GROUP_NAME, xSet))
xSet->addPropertyChangeListener( PROPERTY_GROUP_NAME, this ); xSet->addPropertyChangeListener( PROPERTY_GROUP_NAME, this );
// Tabindex muss nicht jeder unterstuetzen // Not everyone needs to support Tabindex
if (hasProperty(PROPERTY_TABINDEX, xSet)) if (hasProperty(PROPERTY_TABINDEX, xSet))
xSet->addPropertyChangeListener( PROPERTY_TABINDEX, this ); xSet->addPropertyChangeListener( PROPERTY_TABINDEX, this );
} }
void OGroupManager::RemoveElement( const Reference<XPropertySet>& xSet ) void OGroupManager::RemoveElement( const Reference<XPropertySet>& xSet )
{ {
// Nur ControlModels // Only ControlModels
Reference<XControlModel> xControl(xSet, UNO_QUERY); Reference<XControlModel> xControl(xSet, UNO_QUERY);
if (!xControl.is() ) if (!xControl.is() )
return; return;
// Component aus Gruppe entfernen // Remove Component from Group
OUString sGroupName( GetGroupName( xSet ) ); OUString sGroupName( GetGroupName( xSet ) );
removeFromGroupMap(sGroupName,xSet); removeFromGroupMap(sGroupName,xSet);
......
...@@ -36,22 +36,19 @@ ...@@ -36,22 +36,19 @@
using namespace comphelper; using namespace comphelper;
/* /*
* Der GroupManager horcht an der starform, ob FormComponents eingefuegt oder entfernt * The GroupManager listens at the StarForm for FormComponent insertion and removal as well as
* werden. Zusaetzlich horcht er bei den FormComponents an den Properties * its properties "Name" and "TabIndex" and updates its Group using this information.
* "Name" und "TabIndex". Mit diesen Infos aktualisiert er seine Gruppen.
* *
* Der GroupManager verwaltet eine Gruppe, in der alle Controls nach TabIndex * The GroupManager manages a Group in which all Controls are sorted by TabIndex.
* geordnet sind, und ein Array von Gruppen, in dem jede FormComponent noch * It also manages an array of Groups, in which each FormComponent is assigned a
* einmal einer Gruppe dem Namen nach zugeordnet wird. * Group according to its name.
* Die einzelnen Gruppen werden ueber eine Map aktiviert, wenn sie mehr als * Each Group is activated using a Map, if they contain more than one element.
* ein Element besitzen.
* *
* Die Gruppen verwalten intern die FormComponents in zwei Arrays. In dem * The Groups manage the FormComponents internally using two arrays.
* GroupCompArray werden die Components nach TabIndex und Einfuegepostion * In the GroupCompArray the Components are sorted by TabIndex and insertion position.
* sortiert. Da auf dieses Array ueber die FormComponent zugegriffen * Because this array is accessed via the FormComponent, we also have the GroupCompAccessArray
* wird, gibt es noch das GroupCompAccessArray, in dem die FormComponents * in which the FormComponents are sorted by their storage address.
* nach ihrer Speicheradresse sortiert sind. Jedes Element des * Every element of the GroupCompArray has a pointer to the GroupCompArray.
* GroupCompAccessArrays ist mit einem Element des GroupCompArrays verpointert.
*/ */
namespace frm namespace frm
{ {
...@@ -144,7 +141,7 @@ class OGroup ...@@ -144,7 +141,7 @@ class OGroup
OGroupCompAccArr m_aCompAccArray; OGroupCompAccArr m_aCompAccArray;
OUString m_aGroupName; OUString m_aGroupName;
sal_uInt16 m_nInsertPos; // Die Einfugeposition der GroupComps wird von der Gruppe bestimmt. sal_uInt16 m_nInsertPos; // The insertion position of the GroupComps is determind by the Group
friend class OGroupLess; friend class OGroupLess;
...@@ -170,10 +167,9 @@ typedef std::vector<OGroupArr::iterator> OActiveGroups; ...@@ -170,10 +167,9 @@ typedef std::vector<OGroupArr::iterator> OActiveGroups;
class OGroupManager : public ::cppu::WeakImplHelper2< ::com::sun::star::beans::XPropertyChangeListener, ::com::sun::star::container::XContainerListener> class OGroupManager : public ::cppu::WeakImplHelper2< ::com::sun::star::beans::XPropertyChangeListener, ::com::sun::star::container::XContainerListener>
{ {
OGroup* m_pCompGroup; // Alle Components nach TabIndices sortiert OGroup* m_pCompGroup; // Sort all Components by TabIndices
OGroupArr m_aGroupArr; // Alle Components nach Gruppen sortiert OGroupArr m_aGroupArr; // Sort all Components by group
OActiveGroups m_aActiveGroupMap; // In dieser Map werden die Indices aller Gruppen gehalten, OActiveGroups m_aActiveGroupMap; // This map contains all indices of all groups with more than 1 element
// die mehr als 1 Element haben
::com::sun::star::uno::Reference< ::com::sun::star::container::XContainer > ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainer >
m_xContainer; m_xContainer;
......
...@@ -146,7 +146,7 @@ void SAL_CALL OHiddenModel::write(const Reference<XObjectOutputStream>& _rxOutSt ...@@ -146,7 +146,7 @@ void SAL_CALL OHiddenModel::write(const Reference<XObjectOutputStream>& _rxOutSt
// Version // Version
_rxOutStream->writeShort(0x0002); _rxOutStream->writeShort(0x0002);
// Wert // Value
_rxOutStream << m_sHiddenValue; _rxOutStream << m_sHiddenValue;
OControlModel::write(_rxOutStream); OControlModel::write(_rxOutStream);
......
...@@ -173,7 +173,7 @@ OImageButtonControl::OImageButtonControl(const Reference<XComponentContext>& _rx ...@@ -173,7 +173,7 @@ OImageButtonControl::OImageButtonControl(const Reference<XComponentContext>& _rx
{ {
increment(m_refCount); increment(m_refCount);
{ {
// als MouseListener anmelden // Register as MouseListener
Reference< awt::XWindow > xComp; Reference< awt::XWindow > xComp;
query_aggregation( m_xAggregate, xComp); query_aggregation( m_xAggregate, xComp);
if (xComp.is()) if (xComp.is())
...@@ -182,7 +182,7 @@ OImageButtonControl::OImageButtonControl(const Reference<XComponentContext>& _rx ...@@ -182,7 +182,7 @@ OImageButtonControl::OImageButtonControl(const Reference<XComponentContext>& _rx
decrement(m_refCount); decrement(m_refCount);
} }
// UNO Anbindung // UNO Binding
Any SAL_CALL OImageButtonControl::queryAggregation(const Type& _rType) throw (RuntimeException, std::exception) Any SAL_CALL OImageButtonControl::queryAggregation(const Type& _rType) throw (RuntimeException, std::exception)
{ {
Any aReturn = OClickableImageBaseControl::queryAggregation(_rType); Any aReturn = OClickableImageBaseControl::queryAggregation(_rType);
...@@ -208,8 +208,8 @@ void OImageButtonControl::mousePressed(const awt::MouseEvent& e) throw ( ::com:: ...@@ -208,8 +208,8 @@ void OImageButtonControl::mousePressed(const awt::MouseEvent& e) throw ( ::com::
} }
else else
{ {
// Sonst nicht. Dann darf man aber auf keinen Fal die Listener // Or else don't; we must not notify the listeners in that case.
// benachrichtigen, auch dann nicht, wenn er spaeter hinzukommt. // Even not if its added later on.
aGuard.clear(); aGuard.clear();
actionPerformed_Impl( false, e ); actionPerformed_Impl( false, e );
} }
......
...@@ -56,7 +56,7 @@ class OImageButtonControl : public OClickableImageBaseControl, ...@@ -56,7 +56,7 @@ class OImageButtonControl : public OClickableImageBaseControl,
public OImageButtonControl_BASE public OImageButtonControl_BASE
{ {
protected: protected:
// UNO Anbindung // UNO Binding
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes() SAL_OVERRIDE; virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes() SAL_OVERRIDE;
public: public:
...@@ -66,7 +66,7 @@ public: ...@@ -66,7 +66,7 @@ public:
IMPLEMENTATION_NAME(OImageButtonControl); IMPLEMENTATION_NAME(OImageButtonControl);
virtual StringSequence SAL_CALL getSupportedServiceNames() throw(std::exception) SAL_OVERRIDE; virtual StringSequence SAL_CALL getSupportedServiceNames() throw(std::exception) SAL_OVERRIDE;
// UNO Anbindung // UNO Binding
DECLARE_UNO3_AGG_DEFAULTS(OImageButtonControl, OClickableImageBaseControl) DECLARE_UNO3_AGG_DEFAULTS(OImageButtonControl, OClickableImageBaseControl)
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment