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()
decrement( m_refCount );
}
// UNO Anbindung
// UNO Binding
Any SAL_CALL OControl::queryAggregation( const Type& _rType ) throw(RuntimeException, std::exception)
{
// ask the base class
......@@ -758,13 +758,13 @@ void SAL_CALL OControlModel::write(const Reference<css::io::XObjectOutputStream>
xMark->jumpToFurthest();
xMark->deleteMark(nMark);
// 2. wrting a version number
// 2. writing a version number
_rxOutStream->writeShort(0x0003);
// 3. writing the general properties
::comphelper::operator<<( _rxOutStream, m_aName);
_rxOutStream->writeShort(m_nTabIndex);
::comphelper::operator<<( _rxOutStream, m_aTag); // 3. version
::comphelper::operator<<( _rxOutStream, m_aTag); // 3rd version
// IMPORTANT NOTE!
// 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
{
if( e.KeyCode != KEY_RETURN || e.Modifiers != 0 )
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);
if( !xSet.is() )
return;
......@@ -223,13 +223,13 @@ void OFormattedControl::keyPressed(const ::com::sun::star::awt::KeyEvent& e) thr
if (hasProperty(PROPERTY_CLASSID, xFCSet) &&
getINT16(xFCSet->getPropertyValue(PROPERTY_CLASSID)) == FormComponentType::TEXTFIELD)
{
// Found another edit ==> no submit
// Found another Edit -> Do not submit then
if (xFCSet != xSet)
return;
}
}
}
// Still in the handler, trigger submit asynchronous
// Because we're still in the Handler, execute submit asynchronously
if( m_nKeyEvent )
Application::RemoveUserEvent( m_nKeyEvent );
m_nKeyEvent = Application::PostUserEvent( LINK(this, OFormattedControl,
......@@ -363,10 +363,10 @@ void OFormattedModel::describeFixedProperties( Sequence< Property >& _rProps ) c
void OFormattedModel::describeAggregateProperties( Sequence< Property >& _rAggregateProps ) const
{
OEditBaseModel::describeAggregateProperties( _rAggregateProps );
// TreatAsNumeric not transient : we want to bind it to the UI (necessary, because EffectiveDefault
// - could be text or numbers - for making sense)
// TreatAsNumeric is not transient: we want to attach it to the UI
// This is necessary to make EffectiveDefault (which may be text or a number) meaningful
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.
// But we have for the format key ...)
ModifyPropertyAttributes(_rAggregateProps, PROPERTY_FORMATKEY, 0, PropertyAttribute::TRANSIENT);
......@@ -492,7 +492,7 @@ Reference< XNumberFormatsSupplier > OFormattedModel::calcFormatsSupplier() const
{
Reference<XNumberFormatsSupplier> xSupplier;
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() )
m_xAggregateSet->getPropertyValue(PROPERTY_FORMATSSUPPLIER) >>= xSupplier;
if (!xSupplier.is())
......@@ -501,7 +501,7 @@ Reference< XNumberFormatsSupplier > OFormattedModel::calcFormatsSupplier() const
if (!xSupplier.is())
xSupplier = calcDefaultFormatsSupplier();
DBG_ASSERT(xSupplier.is(), "OFormattedModel::calcFormatsSupplier : no supplier !");
// now it should be there
// We should have one by now
return xSupplier;
}
......@@ -509,9 +509,9 @@ Reference<XNumberFormatsSupplier> OFormattedModel::calcFormFormatsSupplier() co
{
Reference<XChild> 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 !");
// 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<XForm> xNextParentForm(xParent, UNO_QUERY);
while (!xNextParentForm.is() && xParent.is())
......@@ -524,7 +524,7 @@ Reference<XNumberFormatsSupplier> OFormattedModel::calcFormFormatsSupplier() co
OSL_FAIL("OFormattedModel::calcFormFormatsSupplier : have no ancestor which is a form !");
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< XNumberFormatsSupplier > xSupplier;
if (xRowSet.is())
......@@ -540,7 +540,7 @@ Reference< XNumberFormatsSupplier > OFormattedModel::calcDefaultFormatsSupplier(
// XBoundComponent
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
// 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)
......@@ -566,7 +566,7 @@ void OFormattedModel::onConnectedDbColumn( const Reference< XInterface >& _rxFor
{ // all the following doesn't make any sense if we have no aggregate ...
Any aSupplier = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATSSUPPLIER);
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);
if ( !(aFmtKey >>= nFormatKey ) )
{ // 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
aSupplier >>= m_xOriginalFormatter;
m_xAggregateSet->setPropertyValue(PROPERTY_FORMATSSUPPLIER, makeAny(xSupplier));
m_xAggregateSet->setPropertyValue(PROPERTY_FORMATKEY, aFmtKey);
// adapt the numeric-flag to my bound field
// Adapt the NumericFalg to my bound field
if (xField.is())
{
m_bNumeric = false;
......@@ -640,7 +640,7 @@ void OFormattedModel::onDisconnectedDbColumn()
{
OEditBaseModel::onDisconnectedDbColumn();
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_FORMATKEY, Any());
setPropertyValue(PROPERTY_TREATASNUMERIC, makeAny(m_bOriginalNumeric));
......@@ -656,8 +656,9 @@ void OFormattedModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
OEditBaseModel::write(_rxOutStream);
_rxOutStream->writeShort(0x0003);
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
// would also be persistent, but saving the whole supplier would be overhead)
// Bring my Format (may be void) to a persistent Format.
// 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;
Any aFmtKey;
bool bVoidKey = true;
......@@ -670,12 +671,12 @@ void OFormattedModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
}
aFmtKey = m_xAggregateSet->getPropertyValue(PROPERTY_FORMATKEY);
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);
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);
sal_Int32 nKey = aKey.hasValue() ? getINT32(aKey) : 0;
Reference<XNumberFormats> xFormats = xSupplier->getNumberFormats();
......@@ -702,8 +703,8 @@ void OFormattedModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
// version 2 : write the properties common to all OEditBaseModels
writeCommonEditProperties(_rxOutStream);
// 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
// and this can't be corrected without being incompatible.
// Due to a bug within the UnoControlFormattedFieldModel implementation (our default aggregate)
// this props value isn't correctly read and this can't be corrected without being incompatible.
// so we have our own handling.
// and to be a little bit more compatible we make the following section skippable
{
......
......@@ -31,19 +31,15 @@
namespace frm
{
// OFormsCollection
// Implementiert den UNO-Container fuer Formulare
// enthaelt alle zugeordneten Forms
// dieses Container kann selbst den Context fuer Formulare darstellen
// oder aussen einen Context uebergeben bekommen
// Implements the UNO Container for Forms and contains all assigend Forms.
// It can either represent the Context for Forms or be passed a Context.
typedef ::cppu::OComponentHelper FormsCollectionComponentBase;
typedef ::cppu::ImplHelper2< ::com::sun::star::form::XForms
,::com::sun::star::lang::XServiceInfo > OFormsCollection_BASE;
// else MSVC kills itself on some statements
// else MSVC kills itself on some statements
class OFormsCollection
:public FormsCollectionComponentBase
,public OInterfaceContainer
......
......@@ -69,7 +69,7 @@ class OGridControlModel :public OControlModel
m_aRowSetChangeListeners;
// [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_aBackgroundColor;
::com::sun::star::uno::Any m_aCursorColor; // transient
......@@ -100,7 +100,7 @@ protected:
public:
DECLARE_DEFAULT_LEAF_XTOR( OGridControlModel );
// UNO Anbindung
// UNO Binding
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;
......
......@@ -116,7 +116,6 @@ void SAL_CALL OGroupBoxModel::read(const Reference< XObjectInputStream>& _rxInSt
// Version
sal_uInt16 nVersion = _rxInStream->readShort();
DBG_ASSERT(nVersion > 0, "OGroupBoxModel::read : version 0 ? this should never have been written !");
// ups, ist das Englisch richtig ? ;)
if (nVersion == 2)
readHelpTextCompatibly(_rxInStream);
......
......@@ -53,7 +53,7 @@ protected:
};
// OGroupBoxControl (nur aus Kompatibilitaet zur 5.0)
// OGroupBoxControl (only for compatibility for 5.0)
class OGroupBoxControl : public OControl
{
......
......@@ -117,7 +117,7 @@ public:
bool operator() (const OGroupComp& lhs, const OGroupComp& rhs) const
{
bool bResult;
// TabIndex von 0 wird hinten einsortiert
// TabIndex of 0 will be added at the end
if (lhs.m_nTabIndex == rhs.GetTabIndex())
bResult = lhs.m_nPos < rhs.GetPos();
else if (lhs.m_nTabIndex && rhs.GetTabIndex())
......@@ -164,20 +164,19 @@ void OGroup::RemoveComponent( const Reference<XPropertySet>& rxElement )
m_aCompArray.erase( m_aCompArray.begin() + nGroupCompPos );
/*
Durch das Entfernen der GroupComp ist die Einfuegeposition
ungueltig geworden. Sie braucht hier aber nicht angepasst werden,
da sie fortlaufend vergeben wird und damit immer
aufsteigend eindeutig ist.
* By removing the GroupComp the insertion position has become invalid.
* We do not to change it here, however, because its passed on continously
* and ascending distinctively.
*/
}
else
{
OSL_FAIL( "OGroup::RemoveComponent: Component nicht in Gruppe" );
OSL_FAIL( "OGroup::RemoveComponent: Component not in Group" );
}
}
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
// group exists
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();
if ( nCount == 1 || nCount == 0 )
{
......@@ -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 );
if (hasProperty(PROPERTY_GROUP_NAME, _xSet))
_xSet->removePropertyChangeListener( PROPERTY_GROUP_NAME, this );
......@@ -297,7 +296,7 @@ void SAL_CALL OGroupManager::propertyChange(const PropertyChangeEvent& evt) thro
removeFromGroupMap(sGroupName,xSet);
// Component neu einordnen
// Re-insert Component
InsertElement( xSet );
}
......@@ -359,15 +358,15 @@ void OGroupManager::getGroupByName(const OUString& _rName, Sequence< Reference<X
void OGroupManager::InsertElement( const Reference<XPropertySet>& xSet )
{
// Nur ControlModels
// Only ControlModels
Reference<XControlModel> xControl(xSet, UNO_QUERY);
if (!xControl.is() )
return;
// Component in CompGroup aufnehmen
// Add Component to CompGroup
m_pCompGroup->InsertComponent( xSet );
// Component in Gruppe aufnehmen
// Add Component to Group
OUString sGroupName( GetGroupName( xSet ) );
OGroupArr::iterator aFind = m_aGroupArr.find(sGroupName);
......@@ -403,24 +402,24 @@ void OGroupManager::InsertElement( const Reference<XPropertySet>& xSet )
m_aActiveGroupMap.push_back( aFind );
}
// Bei Component als PropertyChangeListener anmelden
// Register as PropertyChangeListener at Component
xSet->addPropertyChangeListener( PROPERTY_NAME, this );
if (hasProperty(PROPERTY_GROUP_NAME, xSet))
xSet->addPropertyChangeListener( PROPERTY_GROUP_NAME, this );
// Tabindex muss nicht jeder unterstuetzen
// Not everyone needs to support Tabindex
if (hasProperty(PROPERTY_TABINDEX, xSet))
xSet->addPropertyChangeListener( PROPERTY_TABINDEX, this );
}
void OGroupManager::RemoveElement( const Reference<XPropertySet>& xSet )
{
// Nur ControlModels
// Only ControlModels
Reference<XControlModel> xControl(xSet, UNO_QUERY);
if (!xControl.is() )
return;
// Component aus Gruppe entfernen
// Remove Component from Group
OUString sGroupName( GetGroupName( xSet ) );
removeFromGroupMap(sGroupName,xSet);
......
......@@ -36,22 +36,19 @@
using namespace comphelper;
/*
* Der GroupManager horcht an der starform, ob FormComponents eingefuegt oder entfernt
* werden. Zusaetzlich horcht er bei den FormComponents an den Properties
* "Name" und "TabIndex". Mit diesen Infos aktualisiert er seine Gruppen.
* The GroupManager listens at the StarForm for FormComponent insertion and removal as well as
* its properties "Name" and "TabIndex" and updates its Group using this information.
*
* Der GroupManager verwaltet eine Gruppe, in der alle Controls nach TabIndex
* geordnet sind, und ein Array von Gruppen, in dem jede FormComponent noch
* einmal einer Gruppe dem Namen nach zugeordnet wird.
* Die einzelnen Gruppen werden ueber eine Map aktiviert, wenn sie mehr als
* ein Element besitzen.
* The GroupManager manages a Group in which all Controls are sorted by TabIndex.
* It also manages an array of Groups, in which each FormComponent is assigned a
* Group according to its name.
* Each Group is activated using a Map, if they contain more than one element.
*
* Die Gruppen verwalten intern die FormComponents in zwei Arrays. In dem
* GroupCompArray werden die Components nach TabIndex und Einfuegepostion
* sortiert. Da auf dieses Array ueber die FormComponent zugegriffen
* wird, gibt es noch das GroupCompAccessArray, in dem die FormComponents
* nach ihrer Speicheradresse sortiert sind. Jedes Element des
* GroupCompAccessArrays ist mit einem Element des GroupCompArrays verpointert.
* The Groups manage the FormComponents internally using two arrays.
* In the GroupCompArray the Components are sorted by TabIndex and insertion position.
* Because this array is accessed via the FormComponent, we also have the GroupCompAccessArray
* in which the FormComponents are sorted by their storage address.
* Every element of the GroupCompArray has a pointer to the GroupCompArray.
*/
namespace frm
{
......@@ -144,7 +141,7 @@ class OGroup
OGroupCompAccArr m_aCompAccArray;
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;
......@@ -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>
{
OGroup* m_pCompGroup; // Alle Components nach TabIndices sortiert
OGroupArr m_aGroupArr; // Alle Components nach Gruppen sortiert
OActiveGroups m_aActiveGroupMap; // In dieser Map werden die Indices aller Gruppen gehalten,
// die mehr als 1 Element haben
OGroup* m_pCompGroup; // Sort all Components by TabIndices
OGroupArr m_aGroupArr; // Sort all Components by group
OActiveGroups m_aActiveGroupMap; // This map contains all indices of all groups with more than 1 element
::com::sun::star::uno::Reference< ::com::sun::star::container::XContainer >
m_xContainer;
......
......@@ -146,7 +146,7 @@ void SAL_CALL OHiddenModel::write(const Reference<XObjectOutputStream>& _rxOutSt
// Version
_rxOutStream->writeShort(0x0002);
// Wert
// Value
_rxOutStream << m_sHiddenValue;
OControlModel::write(_rxOutStream);
......
......@@ -173,7 +173,7 @@ OImageButtonControl::OImageButtonControl(const Reference<XComponentContext>& _rx
{
increment(m_refCount);
{
// als MouseListener anmelden
// Register as MouseListener
Reference< awt::XWindow > xComp;
query_aggregation( m_xAggregate, xComp);
if (xComp.is())
......@@ -182,7 +182,7 @@ OImageButtonControl::OImageButtonControl(const Reference<XComponentContext>& _rx
decrement(m_refCount);
}
// UNO Anbindung
// UNO Binding
Any SAL_CALL OImageButtonControl::queryAggregation(const Type& _rType) throw (RuntimeException, std::exception)
{
Any aReturn = OClickableImageBaseControl::queryAggregation(_rType);
......@@ -208,8 +208,8 @@ void OImageButtonControl::mousePressed(const awt::MouseEvent& e) throw ( ::com::
}
else
{
// Sonst nicht. Dann darf man aber auf keinen Fal die Listener
// benachrichtigen, auch dann nicht, wenn er spaeter hinzukommt.
// Or else don't; we must not notify the listeners in that case.
// Even not if its added later on.
aGuard.clear();
actionPerformed_Impl( false, e );
}
......
......@@ -56,7 +56,7 @@ class OImageButtonControl : public OClickableImageBaseControl,
public OImageButtonControl_BASE
{
protected:
// UNO Anbindung
// UNO Binding
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes() SAL_OVERRIDE;
public:
......@@ -66,7 +66,7 @@ public:
IMPLEMENTATION_NAME(OImageButtonControl);
virtual StringSequence SAL_CALL getSupportedServiceNames() throw(std::exception) SAL_OVERRIDE;
// UNO Anbindung
// UNO Binding
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;
......
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