[Libreoffice-commits] core.git: 3 commits - sc/source

Eike Rathke erack at redhat.com
Mon Aug 26 05:54:37 PDT 2013


 sc/source/ui/dbgui/asciiopt.cxx |   72 ++++++++++++----------------------------
 sc/source/ui/inc/asciiopt.hxx   |   26 +++++++-------
 2 files changed, 35 insertions(+), 63 deletions(-)

New commits:
commit d4d5af7396f997d72487db3127eba7f8a4130a2b
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Aug 26 14:53:30 2013 +0200

    translated comments
    
    Change-Id: I29cbd65d57b1c6cc26039c0f5472ecb9e669e6a7

diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx
index 628f29b..0f514ce 100644
--- a/sc/source/ui/dbgui/asciiopt.cxx
+++ b/sc/source/ui/dbgui/asciiopt.cxx
@@ -168,7 +168,7 @@ bool ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const
          nInfoCount      == rCmp.nInfoCount )
     {
         OSL_ENSURE( !nInfoCount || (pColStart && pColFormat && rCmp.pColStart && rCmp.pColFormat),
-                     "0-Zeiger in ScAsciiOptions" );
+                     "NULL pointer in ScAsciiOptions::operator==() column info" );
         for (sal_uInt16 i=0; i<nInfoCount; i++)
             if ( pColStart[i] != rCmp.pColStart[i] ||
                  pColFormat[i] != rCmp.pColFormat[i] )
@@ -179,11 +179,8 @@ bool ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const
     return false;
 }
 
-//
-//  Der Options-String darf kein Semikolon mehr enthalten (wegen Pickliste)
-//  darum ab Version 336 Komma stattdessen
-//
-
+// The options string must not contain semicolons (because of the pick list),
+// use comma as separator.
 
 void ScAsciiOptions::ReadFromString( const String& rString )
 {
@@ -192,10 +189,7 @@ void ScAsciiOptions::ReadFromString( const String& rString )
     xub_StrLen nSub;
     xub_StrLen i;
 
-        //
-        //  Feld-Trenner
-        //
-
+    // Field separator.
     if ( nCount >= 1 )
     {
         bFixedLen = bMergeFieldSeps = false;
@@ -219,10 +213,7 @@ void ScAsciiOptions::ReadFromString( const String& rString )
         }
     }
 
-        //
-        //  Text-Trenner
-        //
-
+    // Text separator.
     if ( nCount >= 2 )
     {
         aToken = rString.GetToken(1,',');
@@ -230,30 +221,21 @@ void ScAsciiOptions::ReadFromString( const String& rString )
         cTextSep = (sal_Unicode) nVal;
     }
 
-        //
-        //  Zeichensatz
-        //
-
+    // Text encoding.
     if ( nCount >= 3 )
     {
         aToken = rString.GetToken(2,',');
         eCharSet = ScGlobal::GetCharsetValue( aToken );
     }
 
-        //
-        //  Startzeile
-        //
-
+    // Number of start row.
     if ( nCount >= 4 )
     {
         aToken = rString.GetToken(3,',');
         nStartRow = aToken.ToInt32();
     }
 
-        //
-        //  Spalten-Infos
-        //
-
+    // Column info.
     if ( nCount >= 5 )
     {
         delete[] pColStart;
@@ -311,10 +293,7 @@ String ScAsciiOptions::WriteToString() const
 {
     OUString aOutStr;
 
-        //
-        //  Feld-Trenner
-        //
-
+    // Field separator.
     if ( bFixedLen )
         aOutStr += pStrFix;
     else if ( !aFieldSeps.Len() )
@@ -335,27 +314,20 @@ String ScAsciiOptions::WriteToString() const
         }
     }
 
-    aOutStr += "," +
-               // Text-Trenner
-               OUString::number(cTextSep) + ",";
-
-        //
-        //  Zeichensatz
-        //
+    // Text delimiter.
+    aOutStr += "," + OUString::number(cTextSep) + ",";
 
+    // Text encoding.
     if ( bCharSetSystem )           // force "SYSTEM"
         aOutStr += ScGlobal::GetCharsetString( RTL_TEXTENCODING_DONTKNOW );
     else
         aOutStr += ScGlobal::GetCharsetString( eCharSet );
-    aOutStr += "," +
-               // Startzeile
-               OUString::number(nStartRow) + ",";
 
-        //
-        //  Spalten-Infos
-        //
+    // Number of start row.
+    aOutStr += "," + OUString::number(nStartRow) + ",";
 
-    OSL_ENSURE( !nInfoCount || (pColStart && pColFormat), "0-Zeiger in ScAsciiOptions" );
+    // Column info.
+    OSL_ENSURE( !nInfoCount || (pColStart && pColFormat), "NULL pointer in ScAsciiOptions column info" );
     for (sal_uInt16 nInfo=0; nInfo<nInfoCount; nInfo++)
     {
         if (nInfo)
commit 6dc98de97f6bc4325407b098bb153f359000c717
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Aug 26 14:43:11 2013 +0200

    typo in comment
    
    Change-Id: I4557da1d51f563be93ed33bf7a2d1804a73ed07f

diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx
index 045d428..628f29b 100644
--- a/sc/source/ui/dbgui/asciiopt.cxx
+++ b/sc/source/ui/dbgui/asciiopt.cxx
@@ -293,7 +293,7 @@ void ScAsciiOptions::ReadFromString( const String& rString )
         bQuotedFieldAsText = aToken.EqualsAscii("true") ? true : false;
     }
 
-    // Detect special nubmers.
+    // Detect special numbers.
     if (nCount >= 8)
     {
         aToken = rString.GetToken(7, ',');
commit 52810eb4552c4e327d47bca4955bf64acdb1c82e
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Aug 26 14:41:39 2013 +0200

    sal_Bool to bool
    
    Change-Id: I3ba3a2074495d01f7877f449ed9b8723161fdd2f

diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx
index 827a2f0..045d428 100644
--- a/sc/source/ui/dbgui/asciiopt.cxx
+++ b/sc/source/ui/dbgui/asciiopt.cxx
@@ -155,7 +155,7 @@ ScAsciiOptions& ScAsciiOptions::operator=( const ScAsciiOptions& rCpy )
 }
 
 
-sal_Bool ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const
+bool ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const
 {
     if ( bFixedLen       == rCmp.bFixedLen &&
          aFieldSeps      == rCmp.aFieldSeps &&
@@ -174,7 +174,7 @@ sal_Bool ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const
                  pColFormat[i] != rCmp.pColFormat[i] )
                 return false;
 
-        return sal_True;
+        return true;
     }
     return false;
 }
@@ -203,13 +203,13 @@ void ScAsciiOptions::ReadFromString( const String& rString )
 
         aToken = rString.GetToken(0,',');
         if ( aToken.EqualsAscii(pStrFix) )
-            bFixedLen = sal_True;
+            bFixedLen = true;
         nSub = comphelper::string::getTokenCount(aToken, '/');
         for ( i=0; i<nSub; i++ )
         {
             String aCode = aToken.GetToken( i, '/' );
             if ( aCode.EqualsAscii(pStrMrg) )
-                bMergeFieldSeps = sal_True;
+                bMergeFieldSeps = true;
             else
             {
                 sal_Int32 nVal = aCode.ToInt32();
@@ -300,7 +300,7 @@ void ScAsciiOptions::ReadFromString( const String& rString )
         bDetectSpecialNumber = aToken.EqualsAscii("true") ? true : false;
     }
     else
-        bDetectSpecialNumber = sal_True;    // default of versions that didn't add the parameter
+        bDetectSpecialNumber = true;    // default of versions that didn't add the parameter
 
     // 9th token is used for "Save as shown" in export options
     // 10th token is used for "Save cell formulas" in export options
diff --git a/sc/source/ui/inc/asciiopt.hxx b/sc/source/ui/inc/asciiopt.hxx
index 05e7bcd..3d779bf 100644
--- a/sc/source/ui/inc/asciiopt.hxx
+++ b/sc/source/ui/inc/asciiopt.hxx
@@ -39,15 +39,15 @@
 class ScAsciiOptions
 {
 private:
-    sal_Bool        bFixedLen;
+    bool        bFixedLen;
     String      aFieldSeps;
-    sal_Bool        bMergeFieldSeps;
+    bool        bMergeFieldSeps;
     bool        bQuotedFieldAsText;
     bool        bDetectSpecialNumber;
     sal_Unicode cTextSep;
     CharSet     eCharSet;
     LanguageType eLang;
-    sal_Bool        bCharSetSystem;
+    bool        bCharSetSystem;
     long        nStartRow;
     sal_uInt16      nInfoCount;
     sal_Int32* pColStart;  //! TODO replace with vector
@@ -62,7 +62,7 @@ public:
 
     ScAsciiOptions& operator=( const ScAsciiOptions& rCpy );
 
-    sal_Bool            operator==( const ScAsciiOptions& rCmp ) const;
+    bool            operator==( const ScAsciiOptions& rCmp ) const;
 
     void            ReadFromString( const String& rString );
     String          WriteToString() const;
@@ -70,24 +70,24 @@ public:
     void            InterpretColumnList( const String& rString );
 
     CharSet             GetCharSet() const      { return eCharSet; }
-    sal_Bool                GetCharSetSystem() const    { return bCharSetSystem; }
+    bool                GetCharSetSystem() const    { return bCharSetSystem; }
     const String&       GetFieldSeps() const    { return aFieldSeps; }
-    sal_Bool                IsMergeSeps() const     { return bMergeFieldSeps; }
+    bool                IsMergeSeps() const     { return bMergeFieldSeps; }
     bool                IsQuotedAsText() const  { return bQuotedFieldAsText; }
     bool                IsDetectSpecialNumber() const { return bDetectSpecialNumber; }
     sal_Unicode         GetTextSep() const      { return cTextSep; }
-    sal_Bool                IsFixedLen() const      { return bFixedLen; }
-    sal_uInt16              GetInfoCount() const    { return nInfoCount; }
-    const sal_Int32*   GetColStart() const     { return pColStart; }
-    const sal_uInt8*            GetColFormat() const    { return pColFormat; }
+    bool                IsFixedLen() const      { return bFixedLen; }
+    sal_uInt16          GetInfoCount() const    { return nInfoCount; }
+    const sal_Int32*    GetColStart() const     { return pColStart; }
+    const sal_uInt8*    GetColFormat() const    { return pColFormat; }
     long                GetStartRow() const     { return nStartRow; }
     LanguageType        GetLanguage() const     { return eLang; }
 
     void    SetCharSet( CharSet eNew )          { eCharSet = eNew; }
-    void    SetCharSetSystem( sal_Bool bSet )       { bCharSetSystem = bSet; }
-    void    SetFixedLen( sal_Bool bSet )            { bFixedLen = bSet; }
+    void    SetCharSetSystem( bool bSet )       { bCharSetSystem = bSet; }
+    void    SetFixedLen( bool bSet )            { bFixedLen = bSet; }
     void    SetFieldSeps( const String& rStr )  { aFieldSeps = rStr; }
-    void    SetMergeSeps( sal_Bool bSet )           { bMergeFieldSeps = bSet; }
+    void    SetMergeSeps( bool bSet )           { bMergeFieldSeps = bSet; }
     void    SetQuotedAsText(bool bSet)          { bQuotedFieldAsText = bSet; }
     void    SetDetectSpecialNumber(bool bSet)   { bDetectSpecialNumber = bSet; }
     void    SetTextSep( sal_Unicode c )         { cTextSep = c; }


More information about the Libreoffice-commits mailing list