[Libreoffice-commits] .: basic/inc basic/source

Takeshi Abe tabe at kemper.freedesktop.org
Mon Jan 30 09:29:39 PST 2012


 basic/inc/basic/sbstar.hxx    |    4 ++--
 basic/source/classes/sb.cxx   |    8 ++++----
 basic/source/comp/scanner.cxx |    6 +++---
 basic/source/comp/token.cxx   |    4 ++--
 basic/source/inc/scanner.hxx  |    5 ++---
 basic/source/inc/token.hxx    |    2 +-
 6 files changed, 14 insertions(+), 15 deletions(-)

New commits:
commit 6073c31fe8c500066bb033cdb646e9d1cca9b94a
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Tue Jan 31 02:18:11 2012 +0900

    Replaced String by rtl::OUString in SbiScanner

diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx
index dc6622e..7cf87ea 100644
--- a/basic/inc/basic/sbstar.hxx
+++ b/basic/inc/basic/sbstar.hxx
@@ -82,7 +82,7 @@ class BASIC_DLLPUBLIC StarBASIC : public SbxObject
     BASIC_DLLPRIVATE void implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic );
 
 protected:
-    sal_Bool            CError( SbError, const String&, xub_StrLen, xub_StrLen, xub_StrLen );
+    sal_Bool            CError( SbError, const ::rtl::OUString&, xub_StrLen, xub_StrLen, xub_StrLen );
 private:
     BASIC_DLLPRIVATE sal_Bool           RTError( SbError, xub_StrLen, xub_StrLen, xub_StrLen );
     BASIC_DLLPRIVATE sal_Bool           RTError( SbError, const String& rMsg, xub_StrLen, xub_StrLen, xub_StrLen );
@@ -154,7 +154,7 @@ public:
                                   sal_uInt16 nCol1, sal_uInt16 nCol2 );
 
     // Specific to error handler
-    static void     MakeErrorText( SbError, const String& aMsg );
+    static void     MakeErrorText( SbError, const ::rtl::OUString& aMsg );
     static const    String& GetErrorText();
     static SbError  GetErrorCode();
     static sal_Bool     IsCompilerError();
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index a0b3bb8..816c7d3 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1575,7 +1575,7 @@ struct BasicStringList_Impl : private Resource
 };
 //----------------------------------------------------------------
 
-void StarBASIC::MakeErrorText( SbError nId, const String& aMsg )
+void StarBASIC::MakeErrorText( SbError nId, const ::rtl::OUString& aMsg )
 {
     SolarMutexGuard aSolarGuard;
     sal_uInt16 nOldID = GetVBErrorCode( nId );
@@ -1612,7 +1612,7 @@ void StarBASIC::MakeErrorText( SbError nId, const String& aMsg )
 }
 
 sal_Bool StarBASIC::CError
-    ( SbError code, const String& rMsg, sal_uInt16 l, sal_uInt16 c1, sal_uInt16 c2 )
+    ( SbError code, const ::rtl::OUString& rMsg, sal_uInt16 l, sal_uInt16 c1, sal_uInt16 c2 )
 {
     SolarMutexGuard aSolarGuard;
 
@@ -1634,8 +1634,8 @@ sal_Bool StarBASIC::CError
     MakeErrorText( code, rMsg );
 
     // Implementation of the code for the string transport to SFX-Error
-    if( rMsg.Len() )
-        code = (sal_uIntPtr)*new StringErrorInfo( code, String(rMsg) );
+    if( !rMsg.isEmpty() )
+        code = (sal_uIntPtr)*new StringErrorInfo( code, rMsg );
 
     SetErrorData( code, l, c1, c2 );
     GetSbData()->bCompiler = sal_True;
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index 5768ed4..872bdd7 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -369,7 +369,7 @@ bool SbiScanner::NextSym()
         aSym = p; bNumber = true;
 
         if( comma > 1 || exp > 1 )
-        {   aError = '.';
+        {   aError = ::rtl::OUString('.');
             GenError( SbERR_BAD_CHAR_IN_NUMBER );   }
 
         // #57844 use localized function
@@ -437,7 +437,7 @@ bool SbiScanner::NextSym()
                 *p++ = ch;
             else
             {
-                aError = ch;
+                aError = ::rtl::OUString(ch);
                 GenError( SbERR_BAD_CHAR_IN_NUMBER );
             }
         }
@@ -474,7 +474,7 @@ bool SbiScanner::NextSym()
             {
                 pLine++; nCol++;
                 if( *pLine != cSep || cSep == ']' ) break;
-            } else aError = cSep, GenError( SbERR_EXPECTED );
+            } else aError = ::rtl::OUString(cSep), GenError( SbERR_EXPECTED );
         }
         // If VBA Interop then doen't eat the [] chars
         if ( cSep == ']' && bVBASupportOn )
diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index d18953d..63c9867 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -244,11 +244,11 @@ void SbiTokenizer::Push( SbiToken t )
 
 void SbiTokenizer::Error( SbError code, const char* pMsg )
 {
-    aError = String::CreateFromAscii( pMsg );
+    aError = ::rtl::OUString::createFromAscii( pMsg );
     Error( code );
 }
 
-void SbiTokenizer::Error( SbError code, String aMsg )
+void SbiTokenizer::Error( SbError code, const ::rtl::OUString &aMsg )
 {
     aError = aMsg;
     Error( code );
diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx
index 69c3d87..926706c 100644
--- a/basic/source/inc/scanner.hxx
+++ b/basic/source/inc/scanner.hxx
@@ -29,12 +29,11 @@
 #ifndef _SCANNER_HXX
 #define _SCANNER_HXX
 
-#include <tools/string.hxx>
 #include <basic/sberrors.hxx>
 
 // The scanner is stand-alone, i. e. it can be used from everywhere.
 // A BASIC-instance is necessary for error messages. Without BASIC
-// the errors are only counted. Also the BASICC is necessary when an
+// the errors are only counted. Also the BASIC is necessary when an
 // advanced SBX-variable shall be used for data type recognition etc.
 
 class StarBASIC;
@@ -51,7 +50,7 @@ class SbiScanner
     bool readLine();
 protected:
     ::rtl::OUString aSym;
-    String aError;
+    ::rtl::OUString aError;
     SbxDataType eScanType;
     StarBASIC* pBasic;                  // instance for error callbacks
     double nVal;                        // numeric value
diff --git a/basic/source/inc/token.hxx b/basic/source/inc/token.hxx
index d5bb4a2..31de0f6 100644
--- a/basic/source/inc/token.hxx
+++ b/basic/source/inc/token.hxx
@@ -164,7 +164,7 @@ public:
     void Error( SbError c ) { GenError( c ); }
     void Error( SbError, SbiToken );
     void Error( SbError, const char* );
-    void Error( SbError, String );
+    void Error( SbError, const ::rtl::OUString &);
 
     void Keywords( sal_Bool b ) { bKeywords = b; }
 


More information about the Libreoffice-commits mailing list