[Libreoffice-commits] .: connectivity/source

Christina Rossmanith crossmanith at kemper.freedesktop.org
Mon Feb 21 07:15:06 PST 2011


 connectivity/source/drivers/file/quotedstring.cxx |   49 ++++++++++------------
 connectivity/source/drivers/flat/ETable.cxx       |   28 ++++++------
 connectivity/source/drivers/flat/Eservices.cxx    |    9 ----
 connectivity/source/drivers/hsqldb/Hservices.cxx  |    9 ----
 connectivity/source/drivers/jdbc/Array.cxx        |   24 +++++-----
 connectivity/source/drivers/jdbc/Blob.cxx         |   22 ++++-----
 6 files changed, 65 insertions(+), 76 deletions(-)

New commits:
commit b58d17ac1fb5c78275a5cdaec3fe505801a9b8a8
Author: Rob Snelders <programming at ertai.nl>
Date:   Mon Feb 21 16:14:21 2011 +0100

    translated comments (30-35/54)

diff --git a/connectivity/source/drivers/file/quotedstring.cxx b/connectivity/source/drivers/file/quotedstring.cxx
index 5847b94..5306acc 100644
--- a/connectivity/source/drivers/file/quotedstring.cxx
+++ b/connectivity/source/drivers/file/quotedstring.cxx
@@ -45,44 +45,44 @@ namespace connectivity
             return 0;
 
         xub_StrLen nTokCount = 1;
-        BOOL bStart = TRUE;		// Stehen wir auf dem ersten Zeichen im Token?
-        BOOL bInString = FALSE;	// Befinden wir uns INNERHALB eines (cStrDel delimited) String?
+        BOOL bStart = TRUE;		// Are we on the first character in the Token?
+        BOOL bInString = FALSE;	// Are we WITHIN a (cStrDel delimited) String?
 
-        // Suche bis Stringende nach dem ersten nicht uebereinstimmenden Zeichen
+        // Search for String-end after the first not matching character
         for( xub_StrLen i = 0; i < nLen; ++i )
         {
             const sal_Unicode cChar = m_sString.GetChar(i);
             if (bStart)
             {
                 bStart = FALSE;
-                // Erstes Zeichen ein String-Delimiter?
+                // First character a String-Delimiter?
                 if ( cChar == cStrDel )
                 {
-                    bInString = TRUE;	// dann sind wir jetzt INNERHALB des Strings!
-                    continue;			// dieses Zeichen ueberlesen!
+                    bInString = TRUE;	// then we are now WITHIN the string!
+                    continue;			// skip this character!
                 }
             }
 
             if (bInString) 
             {
-                // Wenn jetzt das String-Delimiter-Zeichen auftritt ...
+                // when now the String-Delimiter-character occurs ...
                 if ( cChar == cStrDel )
                 {
                     if ((i+1 < nLen) && (m_sString.GetChar(i+1) == cStrDel))
                     {
-                        // Verdoppeltes String-Delimiter-Zeichen:
-                        ++i;	// kein String-Ende, naechstes Zeichen ueberlesen.
+                        // double String-Delimter-character:
+                        ++i;	// no string-end, skip next character.
                     }
                     else
                     {
-                        // String-Ende
+                        // String-End
                         bInString = FALSE;
                     }
                 }
             } // if (bInString) 
             else 
             {
-                // Stimmt das Tokenzeichen ueberein, dann erhoehe TokCount
+                // does the Token-character match, then raise TokCount
                 if ( cChar == cTok )
                 {
                     ++nTokCount;
@@ -103,58 +103,57 @@ namespace connectivity
         const xub_StrLen nLen = m_sString.Len();
         if ( nLen )
         {
-            BOOL bInString = (nStartPos < nLen) && (m_sString.GetChar(nStartPos) == cStrDel);	// Befinden wir uns INNERHALB eines (cStrDel delimited) String?
+            BOOL bInString = (nStartPos < nLen) && (m_sString.GetChar(nStartPos) == cStrDel);	// are we WITHIN a (cStrDel delimited) String?
 
-            // Erstes Zeichen ein String-Delimiter?
+            // First character a String-Delimiter?
             if (bInString )
-                ++nStartPos;			// dieses Zeichen ueberlesen!
+                ++nStartPos;			// skip this character!
             if ( nStartPos >= nLen )
                 return;
 
             sal_Unicode* pData = _rStr.AllocBuffer( nLen - nStartPos + 1 );
             const sal_Unicode* pStart = pData;
-            // Suche bis Stringende nach dem ersten nicht uebereinstimmenden Zeichen
+            // Search until end of string for the first not matching character
             for( xub_StrLen i = nStartPos; i < nLen; ++i )
             {
                 const sal_Unicode cChar = m_sString.GetChar(i);
                 if (bInString)
                 {
-                    // Wenn jetzt das String-Delimiter-Zeichen auftritt ...
+                    // when now the String-Delimiter-character occurs ...
                     if ( cChar == cStrDel )
                     {
                         if ((i+1 < nLen) && (m_sString.GetChar(i+1) == cStrDel))
                         {
-                            // Verdoppeltes String-Delimiter-Zeichen:
-                            // kein String-Ende, naechstes Zeichen ueberlesen.
+                            // double String Delimiter-character
+                            // no end of string, skip next character.
                             ++i;
-                            *pData++ = m_sString.GetChar(i);	// Zeichen gehoert zum Resultat-String
+                            *pData++ = m_sString.GetChar(i);	// character belongs to Result-String
                         }
                         else
                         {
-                            // String-Ende
+                            //end of String
                             bInString = FALSE;
                             *pData = 0;
                         }
                     }
                     else
                     {
-                        *pData++ = cChar;	// Zeichen gehoert zum Resultat-String
+                        *pData++ = cChar;	// character belongs to Result-String
                     }
 
                 }
                 else
                 {
-                    // Stimmt das Tokenzeichen ueberein, dann erhoehe nTok
+                    // does the Token-sign match, then raise nTok
                     if ( cChar == cTok )
                     {
-                        // Vorzeitiger Abbruch der Schleife moeglich, denn
-                        // wir haben, was wir wollten.
+                        // premature break of loop possible, because we found what we were looking for
                         nStartPos = i+1;
                         break;
                     }
                     else
                     {
-                        *pData++ = cChar;	// Zeichen gehoert zum Resultat-String
+                        *pData++ = cChar;	// character belongs to Result-String
                     }
                 }
             } // for( xub_StrLen i = nStartPos; i < nLen; ++i )
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 20b8120..36e4e29 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -185,7 +185,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
                 for (xub_StrLen j = 0; j < aField2.Len(); j++)
                 {
                     const sal_Unicode c = aField2.GetChar(j);
-                    // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen?
+                    // just digits, decimal- and thousands-delimiter?
                     if ( ( !cDecimalDelimiter  || c != cDecimalDelimiter )  &&
                          ( !cThousandDelimiter || c != cThousandDelimiter ) &&
                         !aCharClass.isDigit(aField2,j)                      &&
@@ -208,12 +208,12 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
                     bNumeric = FALSE;
                 if (bNumeric && cThousandDelimiter)
                 {
-                    // Ist der Trenner richtig angegeben?
+                    // is the delimiter correctly given?
                     const String aValue = aField2.GetToken(0,cDecimalDelimiter);
                     for (sal_Int32 j = aValue.Len() - 4; j >= 0; j -= 4)
                     {
                         const sal_Unicode c = aValue.GetChar(static_cast<sal_uInt16>(j));
-                        // nur Ziffern und Dezimalpunkt und Tausender-Trennzeichen?
+                        // just digits, decimal- and thousands-delimiter?
                         if (c == cThousandDelimiter && j)
                             continue;
                         else
@@ -224,7 +224,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
                     }
                 }
 
-                // jetzt koennte es noch ein Datumsfeld sein
+                // now it still can be a Date-field
                 if (!bNumeric)
                 {
                     try
@@ -288,7 +288,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
                     break;
                 default:
                     eType = DataType::VARCHAR;
-                    nPrecision = 0;	// nyi: Daten koennen aber laenger sein!
+                    nPrecision = 0;	// nyi: Data can be longer!
                     nScale = 0;
                     {
                         static const ::rtl::OUString s_sVARCHAR(RTL_CONSTASCII_USTRINGPARAM("VARCHAR"));
@@ -381,7 +381,7 @@ void OFlatTable::construct()
         sal_Int32 nSize = m_pFileStream->Tell();
         m_pFileStream->Seek(STREAM_SEEK_TO_BEGIN);
 
-        // Buffersize abhaengig von der Filegroesse
+        // Buffersize is dependent on the file-size
         m_pFileStream->SetBufferSize(nSize > 1000000 ? 32768 :
                                     nSize > 100000	? 16384 :
                                     nSize > 10000	? 4096	: 1024);
@@ -543,7 +543,7 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
     OFlatConnection* pConnection = (OFlatConnection*)m_pConnection;
     const sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
     const sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter();
-    // Felder:
+    // Fields:
     xub_StrLen nStartPos = 0;
     String aStr;
     OSQLColumns::Vector::const_iterator aIter = _rCols.get().begin();
@@ -558,7 +558,7 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
             (_rRow->get())[i]->setNull();
         else
         {
-            // Laengen je nach Datentyp:
+            // lengths depending on data-type:
             sal_Int32	nLen,
                         nType = 0;
             if(bIsTable)
@@ -601,7 +601,7 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
                 }	break;
                 case DataType::DOUBLE:
                 case DataType::INTEGER:
-                case DataType::DECIMAL:				// #99178# OJ
+                case DataType::DECIMAL:
                 case DataType::NUMERIC:
                 {
                     
@@ -615,7 +615,7 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
                                    (!cDecimalDelimiter && nType == DataType::INTEGER),
                                    "FalscherTyp");
 
-                        // In Standard-Notation (DezimalPUNKT ohne Tausender-Komma) umwandeln:
+                        // convert to Standard-Notation (DecimalPOINT without thousands-comma):
                         for (xub_StrLen j = 0; j < aStr.Len(); ++j)
                         {
                             const sal_Unicode cChar = aStr.GetChar(j); 
@@ -623,10 +623,10 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
                                 *pData++ = '.';
                                 //aStrConverted.Append( '.' );
                             else if ( cChar == '.' ) // special case, if decimal seperator isn't '.' we have to put the string after it
-                                continue; // #99189# OJ
+                                continue;
                             else if (cThousandDelimiter && cChar == cThousandDelimiter)
                             {
-                                // weglassen
+                                // leave out
                             }
                             else
                                 *pData++ = cChar;
@@ -651,7 +651,7 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
 
                 default:
                 {
-                    // Wert als String in Variable der Row uebernehmen
+                    // Copy Value as String in Row-Variable
                     *(_rRow->get())[i] = ORowSetValue(aStr);
                 }
                 break;
@@ -671,7 +671,7 @@ sal_Bool OFlatTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "flat", "Ocke.Janssen at sun.com", "OFlatTable::seekRow" );
     OSL_ENSURE(m_pFileStream,"OFlatTable::seekRow: FileStream is NULL!");
     // ----------------------------------------------------------
-    // Positionierung vorbereiten:
+    // Prepare positioning:
     m_nFilePos = nCurPos;
 
     switch(eCursorPosition)
diff --git a/connectivity/source/drivers/flat/Eservices.cxx b/connectivity/source/drivers/flat/Eservices.cxx
index ab34c9d..add5879 100644
--- a/connectivity/source/drivers/flat/Eservices.cxx
+++ b/connectivity/source/drivers/flat/Eservices.cxx
@@ -50,11 +50,8 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
         );
 
 //***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
+// The prescribed C-Api must be met!
+// It consists of three functions, which must be exported by the Module.
 //---------------------------------------------------------------------------------------
 void REGISTER_PROVIDER(
         const OUString& aServiceImplName,
@@ -73,7 +70,6 @@ void REGISTER_PROVIDER(
         xNewKey->createKey(Services[i]);
 }
 
-
 //---------------------------------------------------------------------------------------
 struct ProviderRequest
 {
@@ -113,7 +109,6 @@ struct ProviderRequest
 };
 
 //---------------------------------------------------------------------------------------
-
 extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
 component_getImplementationEnvironment(
                 const sal_Char	**ppEnvTypeName,
diff --git a/connectivity/source/drivers/hsqldb/Hservices.cxx b/connectivity/source/drivers/hsqldb/Hservices.cxx
index 70017eb..04c6b3b 100644
--- a/connectivity/source/drivers/hsqldb/Hservices.cxx
+++ b/connectivity/source/drivers/hsqldb/Hservices.cxx
@@ -51,11 +51,8 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc)
         );
 
 //***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
+// The prescribed C-Api must be met!
+// It consists of three functions, which must be exported by the Module.
 //---------------------------------------------------------------------------------------
 void REGISTER_PROVIDER(
         const OUString& aServiceImplName,
@@ -74,7 +71,6 @@ void REGISTER_PROVIDER(
         xNewKey->createKey(Services[i]);
 }
 
-
 //---------------------------------------------------------------------------------------
 struct ProviderRequest
 {
@@ -114,7 +110,6 @@ struct ProviderRequest
 };
 
 //---------------------------------------------------------------------------------------
-
 extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
 component_getImplementationEnvironment(
                 const sal_Char	**ppEnvTypeName,
diff --git a/connectivity/source/drivers/jdbc/Array.cxx b/connectivity/source/drivers/jdbc/Array.cxx
index 76f6646..77b2492 100644
--- a/connectivity/source/drivers/jdbc/Array.cxx
+++ b/connectivity/source/drivers/jdbc/Array.cxx
@@ -44,7 +44,7 @@ java_sql_Array::~java_sql_Array()
 
 jclass java_sql_Array::getMyClass() const
 {
-    // die Klasse muss nur einmal geholt werden, daher statisch
+    // the class must be fetched once, therefore its static
     if( !theClass )
         theClass = findMyClass("java/sql/Array");
     
@@ -72,10 +72,10 @@ sal_Int32 SAL_CALL java_sql_Array::getBaseType(  ) throw(::com::sun::star::sdbc:
         static const char * cMethodName = "getArray";
         static jmethodID mID(NULL);
         obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
-        // Java-Call absetzen
+        // submit Java-Call
         (jobjectArray)t.pEnv->CallObjectMethod( object, mID, obj);
         ThrowSQLException(t.pEnv,*this);
-        // und aufraeumen
+        // and clean up
         t.pEnv->DeleteLocalRef(obj);
     } //t.pEnv
     return ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >();
@@ -88,12 +88,12 @@ sal_Int32 SAL_CALL java_sql_Array::getBaseType(  ) throw(::com::sun::star::sdbc:
         jobject obj = convertTypeMapToJavaMap(t.pEnv,typeMap);
         static const char * cSignature = "(IILjava/util/Map;)[Ljava/lang/Object;";
         static const char * cMethodName = "getArray";
-        // Java-Call absetzen
+        // submit Java-Call
         static jmethodID mID(NULL);
         obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
         (jobjectArray)t.pEnv->CallObjectMethod( object, mID, index,count,obj);
         ThrowSQLException(t.pEnv,*this);
-        // und aufraeumen
+        // and clean up
         t.pEnv->DeleteLocalRef(obj);
     }
     return ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >();
@@ -103,17 +103,17 @@ sal_Int32 SAL_CALL java_sql_Array::getBaseType(  ) throw(::com::sun::star::sdbc:
 {
     SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
     {
-        // Parameter konvertieren
+        // convert Parameter
         jobject obj = convertTypeMapToJavaMap(t.pEnv,typeMap);
-        // temporaere Variable initialisieren
+        // initialize temporary variable
         static const char * cSignature = "(Ljava/util/Map;)Ljava/sql/ResultSet;";
         static const char * cMethodName = "getResultSet";
-        // Java-Call absetzen
+        // submit Java-Call
         static jmethodID mID(NULL);
         obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
         t.pEnv->CallObjectMethod( object, mID, obj);
         ThrowSQLException(t.pEnv,*this);
-        // und aufraeumen
+        // and cleanup
         t.pEnv->DeleteLocalRef(obj);
     }
     return NULL;
@@ -123,9 +123,9 @@ sal_Int32 SAL_CALL java_sql_Array::getBaseType(  ) throw(::com::sun::star::sdbc:
 {
     SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
     {
-        // Parameter konvertieren
+        // convert parameter
         jobject obj = convertTypeMapToJavaMap(t.pEnv,typeMap);
-        // temporaere Variable initialisieren
+        // initialize temporary variable
         static const char * cSignature = "(Ljava/util/Map;)Ljava/sql/ResultSet;";
         static const char * cMethodName = "getResultSetAtIndex";
         // Java-Call absetzen
@@ -133,7 +133,7 @@ sal_Int32 SAL_CALL java_sql_Array::getBaseType(  ) throw(::com::sun::star::sdbc:
         obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
         t.pEnv->CallObjectMethod( object, mID, index,count,obj);
         ThrowSQLException(t.pEnv,*this);
-        // und aufraeumen
+        // and cleanup
         t.pEnv->DeleteLocalRef(obj);
     }
     return NULL;
diff --git a/connectivity/source/drivers/jdbc/Blob.cxx b/connectivity/source/drivers/jdbc/Blob.cxx
index d523786..a0d9fd7 100644
--- a/connectivity/source/drivers/jdbc/Blob.cxx
+++ b/connectivity/source/drivers/jdbc/Blob.cxx
@@ -53,7 +53,7 @@ java_sql_Blob::~java_sql_Blob()
 
 jclass java_sql_Blob::getMyClass() const
 {
-    // die Klasse muss nur einmal geholt werden, daher statisch
+    // the class must be fetched only once, therefore it's static
     if( !theClass )
         theClass = findMyClass("java/sql/Blob");
     return theClass;
@@ -65,10 +65,10 @@ sal_Int64 SAL_CALL java_sql_Blob::length(  ) throw(::com::sun::star::sdbc::SQLEx
     SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
     
     {
-        // temporaere Variable initialisieren
+        // initialize temporary variable
         static const char * cSignature = "()J";
         static const char * cMethodName = "length";
-        // Java-Call absetzen
+        // submit Java-Call
         static jmethodID mID(NULL);
         obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
         out = t.pEnv->CallLongMethod( object, mID );
@@ -82,10 +82,10 @@ sal_Int64 SAL_CALL java_sql_Blob::length(  ) throw(::com::sun::star::sdbc::SQLEx
     SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
     ::com::sun::star::uno::Sequence< sal_Int8 > aSeq;
     {
-        // temporaere Variable initialisieren
+        // initialize temporary variable
         static const char * cSignature = "(JI)[B";
         static const char * cMethodName = "getBytes";
-        // Java-Call absetzen
+        // submit Java-Call
         static jmethodID mID(NULL);
         obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
         jbyteArray out = (jbyteArray)t.pEnv->CallObjectMethod( object, mID,pos,count);
@@ -98,7 +98,7 @@ sal_Int64 SAL_CALL java_sql_Blob::length(  ) throw(::com::sun::star::sdbc::SQLEx
             t.pEnv->DeleteLocalRef(out);
         }
     } //t.pEnv
-    // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!!
+    // WARNING: the caller becomes the owner of the returned pointer
     return 	aSeq;
 }
 
@@ -107,7 +107,7 @@ sal_Int64 SAL_CALL java_sql_Blob::length(  ) throw(::com::sun::star::sdbc::SQLEx
     SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
     static jmethodID mID(NULL);
     jobject out = callObjectMethod(t.pEnv,"getBinaryStream","()Ljava/io/InputStream;", mID);
-    // ACHTUNG: der Aufrufer wird Eigentuemer des zurueckgelieferten Zeigers !!!
+    // WARNING: the caller becomes the owner of the returned pointer
     return out==0 ? 0 : new java_io_InputStream( t.pEnv, out );
 }
 
@@ -117,13 +117,13 @@ sal_Int64 SAL_CALL java_sql_Blob::position( const ::com::sun::star::uno::Sequenc
     SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!");
     
     {
-        // temporaere Variable initialisieren
+        // initialize temporary variable
         static const char * cSignature = "([BI)J";
         static const char * cMethodName = "position";
-        // Java-Call absetzen
+        // submit Java-Call
         static jmethodID mID(NULL);
         obtainMethodId(t.pEnv, cMethodName,cSignature, mID);
-        // Parameter konvertieren
+        // convert Parameter
         jbyteArray pByteArray = t.pEnv->NewByteArray(pattern.getLength());
         t.pEnv->SetByteArrayRegion(pByteArray,0,pattern.getLength(),(jbyte*)pattern.getConstArray());
         out = t.pEnv->CallLongMethod( object, mID, pByteArray,start );
@@ -140,7 +140,7 @@ sal_Int64 SAL_CALL java_sql_Blob::positionOfBlob( const ::com::sun::star::uno::R
     // the pattern parameter. Since the effort for proper implementation is rather high - we would need
     // to translated patter into a byte[] -, we defer this functionality for the moment (hey, it was
     // unusable, anyway)
-    // 2005-11-15 / #i57457# / frank.schoenheit at sun.com
+    // #i57457#
     return 0;
 }
 


More information about the Libreoffice-commits mailing list