From 24596b38bf602aeb99e2543c6a103b1a6ee39bf2 Mon Sep 17 00:00:00 2001 From: Rob Snelders Date: Fri, 11 Feb 2011 22:05:59 +0100 Subject: translated comments (4/54) --- connectivity/source/commontools/CommonTools.cxx | 10 ++-- connectivity/source/commontools/DateConversion.cxx | 11 ++-- .../source/commontools/TSkipDeletedSet.cxx | 2 +- connectivity/source/commontools/dbtools.cxx | 63 +++++++++++----------- 4 files changed, 41 insertions(+), 45 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx index 45741ec95232..ce1c6d1589f9 100644 --- a/connectivity/source/commontools/CommonTools.cxx +++ b/connectivity/source/commontools/CommonTools.cxx @@ -83,8 +83,8 @@ namespace connectivity else pWild += pos; else - break; // ACHTUNG laeuft unter bestimmten - // Umstaenden in den nachsten case rein!! + break; // WARNING in certain circumstances + // it will run into the next 'case'!! case CHAR_WILD: while ( *pWild == CHAR_WILD ) pWild++; @@ -310,8 +310,8 @@ sal_Bool isCharOk(sal_Unicode c,const ::rtl::OUString& _rSpecials) //------------------------------------------------------------------------------ sal_Bool isValidSQLName(const ::rtl::OUString& rName,const ::rtl::OUString& _rSpecials) { - // Ueberpruefung auf korrekte Namensgebung im SQL Sinne - // Dieses ist wichtig fuer Tabellennamen beispielsweise + // Test for correct naming (in SQL sense) + // This is important for table names for example const sal_Unicode* pStr = rName.getStr(); if (*pStr > 127 || isdigit(*pStr)) return sal_False; @@ -336,7 +336,7 @@ sal_Bool isValidSQLName(const ::rtl::OUString& rName,const ::rtl::OUString& _rSp return sal_True; } //------------------------------------------------------------------ -// Erzeugt einen neuen Namen falls noetig +// Creates a new name if necessary ::rtl::OUString convertName2SQLName(const ::rtl::OUString& rName,const ::rtl::OUString& _rSpecials) { if(isValidSQLName(rName,_rSpecials)) diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx index a26a296081c7..531df746045f 100644 --- a/connectivity/source/commontools/DateConversion.cxx +++ b/connectivity/source/commontools/DateConversion.cxx @@ -254,13 +254,13 @@ void DBTypeConversion::setValue(const Reference& xVariant, { if (rString.getLength()) { - // Muss der String formatiert werden? + // Does the String need to be formatted? sal_Int16 nTypeClass = nKeyType & ~NumberFormat::DEFINED; sal_Bool bTextFormat = nTypeClass == NumberFormat::TEXT; sal_Int32 nKeyToUse = bTextFormat ? 0 : nKey; sal_Int16 nRealUsedTypeClass = nTypeClass; - // bei einem Text-Format muessen wir dem Formatter etwas mehr Freiheiten einraeumen, sonst - // wirft convertStringToNumber eine NotNumericException + // for a Text-Format the formatter needs some more freedom, otherwise + // convertStringToNumber will throw a NotNumericException try { double fValue = xFormatter->convertStringToNumber(nKeyToUse, rString); @@ -268,10 +268,9 @@ void DBTypeConversion::setValue(const Reference& xVariant, if (nRealUsedKey != nKeyToUse) nRealUsedTypeClass = getNumberFormatType(xFormatter, nRealUsedKey) & ~NumberFormat::DEFINED; - // und noch eine Sonderbehandlung, diesmal fuer Prozent-Formate + // and again a special treatment, this time for percent formats if ((NumberFormat::NUMBER == nRealUsedTypeClass) && (NumberFormat::PERCENT == nTypeClass)) - { // die Formatierung soll eigentlich als Prozent erfolgen, aber der String stellt nur eine - // einfache Nummer dar -> anpassen + { // formatting should be "percent", but the String provides just a simple number -> adjust ::rtl::OUString sExpanded(rString); static ::rtl::OUString s_sPercentSymbol( RTL_CONSTASCII_USTRINGPARAM( "%" )); // need a method to add a sal_Unicode to a string, 'til then we use a static string diff --git a/connectivity/source/commontools/TSkipDeletedSet.cxx b/connectivity/source/commontools/TSkipDeletedSet.cxx index 4fd8d9cf1772..99d89b83109d 100644 --- a/connectivity/source/commontools/TSkipDeletedSet.cxx +++ b/connectivity/source/commontools/TSkipDeletedSet.cxx @@ -139,7 +139,7 @@ sal_Bool OSkipDeletedSet::skipDeleted(IResultSetHelper::Movement _eCursorPositio bDone = sal_False; } - while (bDataFound && !bDone) // solange iterieren bis man auf einem gueltigen Satz ist + while (bDataFound && !bDone) // Iterate until we are at the valid set { bDataFound = m_pHelper->move(eDelPosition, 1, _bRetrieveData); if (_eCursorPosition != IResultSetHelper::RELATIVE) diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index 4d18c60a4ad4..a0e8534cd60d 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -956,7 +956,7 @@ void qualifiedNameComponents(const Reference< XDatabaseMetaData >& _rxConnMetaDa } else { - // Katalogname am Ende + // Catalogue name at the end sal_Int32 nIndex = sName.lastIndexOf(sSeparator); if (-1 != nIndex) { @@ -1014,7 +1014,7 @@ try if ( !xOldProps.is() || !xNewProps.is() ) return; - // kopieren wir erst mal alle Props, die in Quelle und Ziel vorhanden sind und identische Beschreibungen haben + // First we copy all the Props, that are available in source and target and have the same description Reference< XPropertySetInfo> xOldInfo( xOldProps->getPropertySetInfo()); Reference< XPropertySetInfo> xNewInfo( xNewProps->getPropertySetInfo()); @@ -1048,13 +1048,13 @@ try && (!pOldProps[i].Name.equals(sPropLabelControl)) ) { - // binaere Suche + // binary search Property* pResult = ::std::lower_bound(pNewProps, pNewProps + nNewLen,pOldProps[i].Name, ::comphelper::PropertyStringLessFunctor()); if ( pResult && ( pResult != pNewProps + nNewLen && pResult->Name == pOldProps[i].Name ) && ( (pResult->Attributes & PropertyAttribute::READONLY) == 0 ) && ( pResult->Type.equals(pOldProps[i].Type)) ) - { // Attribute stimmen ueberein und Property ist nicht read-only + { // Attributes match and the property is not read-only try { xNewProps->setPropertyValue(pResult->Name, xOldProps->getPropertyValue(pResult->Name)); @@ -1073,8 +1073,7 @@ try } } - - // fuer formatierte Felder (entweder alt oder neu) haben wir ein paar Sonderbehandlungen + // for formatted fields (either old or new) we have some special treatments Reference< XServiceInfo > xSI( xOldProps, UNO_QUERY ); sal_Bool bOldIsFormatted = xSI.is() && xSI->supportsService( sFormattedServiceName ); xSI = Reference< XServiceInfo >( xNewProps, UNO_QUERY ); @@ -1084,13 +1083,12 @@ try return; // nothing to do if (bOldIsFormatted && bNewIsFormatted) - // nein, wenn beide formatierte Felder sind, dann machen wir keinerlei Konvertierungen - // Das geht zu weit ;) + // if both fields are formatted we do no conversions return; if (bOldIsFormatted) { - // aus dem eingestellten Format ein paar Properties rausziehen und zum neuen Set durchschleifen + // get some properties from the selected format and put them in the new Set Any aFormatKey( xOldProps->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FORMATKEY)) ); if (aFormatKey.hasValue()) { @@ -1104,8 +1102,7 @@ try { Any aVal( xFormat->getPropertyValue(sPropCurrencySymbol) ); if (aVal.hasValue() && hasProperty(sPropCurrencySymbol, xNewProps)) - // (wenn die Quelle das nicht gesetzt hat, dann auch nicht kopieren, um den - // Default-Wert nicht zu ueberschreiben + // If the source value hasn't been set then don't copy it, so we donĀ“t overwrite the default value xNewProps->setPropertyValue(sPropCurrencySymbol, aVal); } if (hasProperty(sPropDecimals, xFormat) && hasProperty(sPropDecimals, xNewProps)) @@ -1113,10 +1110,10 @@ try } } - // eine eventuelle-Min-Max-Konvertierung + // a potential Min-Max-Conversion Any aEffectiveMin( xOldProps->getPropertyValue(sPropEffectiveMin) ); if (aEffectiveMin.hasValue()) - { // im Gegensatz zu ValueMin kann EffectiveMin void sein + { // Unlike the ValueMin the EffectiveMin can be void if (hasProperty(sPropValueMin, xNewProps)) { OSL_ENSURE(aEffectiveMin.getValueType().getTypeClass() == TypeClass_DOUBLE, @@ -1135,59 +1132,59 @@ try } } - // dann koennen wir noch Default-Werte konvertieren und uebernehmen + // then we can still convert and copy the default values Any aEffectiveDefault( xOldProps->getPropertyValue(sPropEffectiveDefault) ); if (aEffectiveDefault.hasValue()) { sal_Bool bIsString = aEffectiveDefault.getValueType().getTypeClass() == TypeClass_STRING; OSL_ENSURE(bIsString || aEffectiveDefault.getValueType().getTypeClass() == TypeClass_DOUBLE, "TransferFormComponentProperties : invalid property type !"); - // die Effective-Properties sollten immer void oder string oder double sein .... + // The Effective-Properties should always be void or string or double .... if (hasProperty(sPropDefaultDate, xNewProps) && !bIsString) - { // (einen ::rtl::OUString in ein Datum zu konvertieren muss nicht immer klappen, denn das ganze kann ja an - // eine Textspalte gebunden gewesen sein, aber mit einem double koennen wir was anfangen) + { // (to convert a ::rtl::OUString into a date will not always succeed, because it might be bound to a text-column, + // but we can work with a double) Date aDate = DBTypeConversion::toDate(getDouble(aEffectiveDefault)); xNewProps->setPropertyValue(sPropDefaultDate, makeAny(aDate)); } if (hasProperty(sPropDefaultTime, xNewProps) && !bIsString) - { // voellig analog mit Zeit + { // Completely analogous to time Time aTime = DBTypeConversion::toTime(getDouble(aEffectiveDefault)); xNewProps->setPropertyValue(sPropDefaultTime, makeAny(aTime)); } if (hasProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE), xNewProps) && !bIsString) - { // hier koennen wir einfach das double durchreichen + { // Here we can simply pass the double xNewProps->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE), aEffectiveDefault); } if (hasProperty(sPropDefaultText, xNewProps) && bIsString) - { // und hier den ::rtl::OUString + { // and here the ::rtl::OUString xNewProps->setPropertyValue(sPropDefaultText, aEffectiveDefault); } - // nyi: die Uebersetzung zwischen doubles und ::rtl::OUString wuerde noch mehr Moeglichkeien eroeffnen + // nyi: The translation between doubles and ::rtl::OUString would offer more alternatives } } - // die andere Richtung : das neu Control soll formatiert sein + // The other direction: the new Control shall be formatted if (bNewIsFormatted) { - // zuerst die Formatierung - // einen Supplier koennen wir nicht setzen, also muss das neue Set schon einen mitbringen + // first the formatting + // we can't set a Supplier, so the new Set must bring one in Reference< XNumberFormatsSupplier> xSupplier; xNewProps->getPropertyValue(sPropFormatsSupplier) >>= xSupplier; if (xSupplier.is()) { Reference< XNumberFormats> xFormats(xSupplier->getNumberFormats()); - // Dezimal-Stellen + // Set number of decimals sal_Int16 nDecimals = 2; if (hasProperty(sPropDecimalAccuracy, xOldProps)) xOldProps->getPropertyValue(sPropDecimalAccuracy) >>= nDecimals; - // Grund-Format (je nach ClassId des alten Sets) + // base format (depending on the ClassId of the old Set) sal_Int32 nBaseKey = 0; if (hasProperty(sPropClassId, xOldProps)) { @@ -1213,21 +1210,21 @@ try } } - // damit koennen wir ein neues Format basteln ... + // With this we can generate a new format ... ::rtl::OUString sNewFormat = xFormats->generateFormat(nBaseKey, _rLocale, sal_False, sal_False, nDecimals, 0); - // kein Tausender-Trennzeichen, negative Zahlen nicht in Rot, keine fuehrenden Nullen + // No thousands separator, negative numbers are not in red, no leading zeros - // ... und zum FormatsSupplier hinzufuegen (wenn noetig) + // ... and add at FormatsSupplier (if needed) sal_Int32 nKey = xFormats->queryKey(sNewFormat, _rLocale, sal_False); if (nKey == (sal_Int32)-1) - { // noch nicht vorhanden in meinem Formatter ... + { // not added yet in my formatter ... nKey = xFormats->addNew(sNewFormat, _rLocale); } xNewProps->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_FORMATKEY), makeAny((sal_Int32)nKey)); } - // min-/max-Werte + // min-/max-Value Any aNewMin, aNewMax; if (hasProperty(sPropValueMin, xOldProps)) aNewMin = xOldProps->getPropertyValue(sPropValueMin); @@ -1236,7 +1233,7 @@ try xNewProps->setPropertyValue(sPropEffectiveMin, aNewMin); xNewProps->setPropertyValue(sPropEffectiveMax, aNewMax); - // Default-Wert + // Default-Value Any aNewDefault; if (hasProperty(sPropDefaultDate, xOldProps)) { @@ -1252,7 +1249,7 @@ try aNewDefault <<= DBTypeConversion::toDouble(*(Time*)aTime.getValue()); } - // double oder ::rtl::OUString werden direkt uebernommen + // double or ::rtl::OUString will be copied directly if (hasProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE), xOldProps)) aNewDefault = xOldProps->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE)); if (hasProperty(sPropDefaultText, xOldProps)) -- cgit