summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-01 13:39:46 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-01 14:19:25 +0100
commitd05a9ae25e4a397834330d868b68d92ca919e33b (patch)
tree3a9702d4c56ef0bd995f97dc3cfb382953d1f6d3 /sc
parent2655ef2d03b786b683723e92f3c76838fa012ab6 (diff)
Related: fdo#38838 remove UniString::AssignAscii
Change-Id: I263ef2594080ff7d47d5499c2b62e60e1689d2d6
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/excform.cxx6
-rw-r--r--sc/source/filter/excel/excform8.cxx4
-rw-r--r--sc/source/filter/excel/namebuff.cxx8
-rw-r--r--sc/source/filter/inc/namebuff.hxx24
-rw-r--r--sc/source/ui/docshell/impex.cxx24
-rw-r--r--sc/source/ui/miscdlgs/crnrdlg.cxx20
6 files changed, 43 insertions, 43 deletions
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx
index 0c34957e59e1..238a88176f58 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -231,7 +231,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
sal_uInt16 nUINT16;
sal_Int16 nINT16;
double fDouble;
- String aString;
+ OUString aString;
sal_Bool bError = false;
sal_Bool bArrayFormula = false;
TokenId nMerk0;
@@ -693,7 +693,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s
case 0x58:
case 0x78:
case 0x38: // Command-Equivalent Function [333 ]
- aString.AssignAscii( "COMM_EQU_FUNC" );
+ aString = "COMM_EQU_FUNC";
aIn >> nByte;
aString += OUString::number( nByte );
aIn >> nByte;
@@ -1779,7 +1779,7 @@ void ExcelToSc::ReadExtensionArray( unsigned int n, XclImpStream& aIn )
sal_uInt8 nByte;
sal_uInt16 nUINT16;
double fDouble;
- String aString;
+ OUString aString;
ScMatrix* pMatrix;
aIn >> nByte >> nUINT16;
diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx
index 043b3f4ca501..aa5a98f7d42c 100644
--- a/sc/source/filter/excel/excform8.cxx
+++ b/sc/source/filter/excel/excform8.cxx
@@ -143,7 +143,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
sal_uInt8 nOp, nLen, nByte;
sal_uInt16 nUINT16;
double fDouble;
- String aString;
+ OUString aString;
sal_Bool bError = false;
sal_Bool bArrayFormula = false;
TokenId nMerk0;
@@ -634,7 +634,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
case 0x58:
case 0x78:
case 0x38: // Command-Equivalent Function [333 ]
- aString.AssignAscii( "COMM_EQU_FUNC" );
+ aString = "COMM_EQU_FUNC";
aIn >> nByte;
aString += OUString::number( nByte );
aIn >> nByte;
diff --git a/sc/source/filter/excel/namebuff.cxx b/sc/source/filter/excel/namebuff.cxx
index 4c75d64216d9..b3592972704a 100644
--- a/sc/source/filter/excel/namebuff.cxx
+++ b/sc/source/filter/excel/namebuff.cxx
@@ -31,10 +31,10 @@
#include <string.h>
-sal_uInt32 StringHashEntry::MakeHashCode( const String& r )
+sal_uInt32 StringHashEntry::MakeHashCode( const OUString& r )
{
- sal_uInt32 n = 0;
- const sal_Unicode* pAkt = r.GetBuffer();
+ sal_uInt32 n = 0;
+ const sal_Unicode* pAkt = r.getStr();
sal_Unicode cAkt = *pAkt;
while( cAkt )
@@ -60,7 +60,7 @@ NameBuffer::~NameBuffer()
//void NameBuffer::operator <<( const SpString &rNewString )
-void NameBuffer::operator <<( const String &rNewString )
+void NameBuffer::operator <<( const OUString &rNewString )
{
OSL_ENSURE( maHashes.size() + nBase < 0xFFFF,
"*NameBuffer::GetLastIndex(): Ich hab' die Nase voll!" );
diff --git a/sc/source/filter/inc/namebuff.hxx b/sc/source/filter/inc/namebuff.hxx
index 97aebc1ba086..edea04091d2f 100644
--- a/sc/source/filter/inc/namebuff.hxx
+++ b/sc/source/filter/inc/namebuff.hxx
@@ -20,7 +20,7 @@
#ifndef SC_NAMEBUFF_HXX
#define SC_NAMEBUFF_HXX
-#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
#include "compiler.hxx"
#include "root.hxx"
#include "xiroot.hxx"
@@ -41,15 +41,15 @@ class StringHashEntry
{
private:
friend class NameBuffer;
- String aString;
- sal_uInt32 nHash;
+ OUString aString;
+ sal_uInt32 nHash;
- static sal_uInt32 MakeHashCode( const String& );
+ static sal_uInt32 MakeHashCode( const OUString& );
public:
- inline StringHashEntry( const String& );
+ inline StringHashEntry( const OUString& );
inline StringHashEntry( void );
inline void operator =( const sal_Char* );
- inline void operator =( const String& );
+ inline void operator =( const OUString& );
inline void operator =( const StringHashEntry& );
inline sal_Bool operator ==( const StringHashEntry& ) const;
};
@@ -60,7 +60,7 @@ inline StringHashEntry::StringHashEntry( void )
}
-inline StringHashEntry::StringHashEntry( const String& r ) : aString( r )
+inline StringHashEntry::StringHashEntry( const OUString& r ) : aString( r )
{
nHash = MakeHashCode( r );
}
@@ -68,12 +68,12 @@ inline StringHashEntry::StringHashEntry( const String& r ) : aString( r )
inline void StringHashEntry::operator =( const sal_Char* p )
{
- aString.AssignAscii( p );
+ aString = OUString(p, strlen(p), RTL_TEXTENCODING_ASCII_US);
nHash = MakeHashCode( aString );
}
-inline void StringHashEntry::operator =( const String& r )
+inline void StringHashEntry::operator =( const OUString& r )
{
aString = r;
nHash = MakeHashCode( r );
@@ -106,10 +106,10 @@ public:
inline NameBuffer( RootData*, sal_uInt16 nNewBase );
virtual ~NameBuffer();
- inline const String* Get( sal_uInt16 nIndex ) const;
+ inline const OUString* Get( sal_uInt16 nIndex ) const;
inline sal_uInt16 GetLastIndex() const;
inline void SetBase( sal_uInt16 nNewBase = 0 );
- void operator <<( const String& rNewString );
+ void operator <<( const OUString& rNewString );
};
inline NameBuffer::NameBuffer( RootData* p ) : ExcRoot( p )
@@ -124,7 +124,7 @@ inline NameBuffer::NameBuffer( RootData* p, sal_uInt16 nNewBase ) : ExcRoot( p )
}
-inline const String* NameBuffer::Get ( sal_uInt16 n ) const
+inline const OUString* NameBuffer::Get ( sal_uInt16 n ) const
{
if( n < nBase || n >= maHashes.size() )
return NULL;
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index d46a1dfbf16d..5557f9b576c6 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1961,7 +1961,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
{
for (nCol = nStartCol; nCol <= nEndCol; nCol++)
{
- String aBufStr;
+ OUString aBufStr;
double nVal;
bool bForm = false;
SCROW r = nRow - nStartRow + 1;
@@ -1986,11 +1986,11 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
rtl_math_StringFormat_Automatic,
rtl_math_DecimalPlaces_Max, '.', true );
- aBufStr.AssignAscii(RTL_CONSTASCII_STRINGPARAM( "C;X" ));
+ aBufStr = "C;X";
aBufStr += OUString::number( c );
- aBufStr.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ";Y" ));
+ aBufStr += ";Y";
aBufStr += OUString::number( r );
- aBufStr.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ";K" ));
+ aBufStr += ";K";
aBufStr += aValStr;
lcl_WriteSimpleString( rStrm, aBufStr );
goto checkformula;
@@ -2001,11 +2001,11 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
aCellStr = pDoc->GetString(nCol, nRow, aRange.aStart.Tab());
aCellStr.SearchAndReplaceAll( OUString('\n'), OUString(SYLK_LF) );
- aBufStr.AssignAscii(RTL_CONSTASCII_STRINGPARAM( "C;X" ));
+ aBufStr = "C;X";
aBufStr += OUString::number( c );
- aBufStr.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ";Y" ));
+ aBufStr += ";Y";
aBufStr += OUString::number( r );
- aBufStr.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ";K" ));
+ aBufStr += ";K";
lcl_WriteSimpleString( rStrm, aBufStr );
lcl_WriteString( rStrm, aCellStr, '"', ';' );
@@ -2047,9 +2047,9 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
pFCell->GetMatColsRows( nC, nR );
nC += c - 1;
nR += r - 1;
- aPrefix.AssignAscii( RTL_CONSTASCII_STRINGPARAM( ";R" ) );
+ aPrefix = ";R";
aPrefix += OUString::number( nR );
- aPrefix.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ";C" ) );
+ aPrefix += ";C";
aPrefix += OUString::number( nC );
aPrefix.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ";M" ) );
}
@@ -2058,15 +2058,15 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
{ // diff expression with 'I' M$-extension
ScAddress aPos;
pFCell->GetMatrixOrigin( aPos );
- aPrefix.AssignAscii( RTL_CONSTASCII_STRINGPARAM( ";I;R" ) );
+ aPrefix = ";I;R";
aPrefix += OUString::number( aPos.Row() - nStartRow + 1 );
- aPrefix.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ";C" ) );
+ aPrefix += ";C";
aPrefix += OUString::number( aPos.Col() - nStartCol + 1 );
}
break;
default:
// formula Expression
- aPrefix.AssignAscii( RTL_CONSTASCII_STRINGPARAM( ";E" ) );
+ aPrefix = ";E";
}
lcl_WriteSimpleString( rStrm, aPrefix );
if ( aCellStr.Len() )
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index e0173851e0f2..f0f2cc4b0419 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -493,7 +493,7 @@ void ScColRowNameRangesDlg::UpdateNames()
SCROW nRow2;
SCTAB nTab2;
String rString;
- String strShow;
+ OUString strShow;
const ScAddress::Details aDetails(pDoc->GetAddressConvention());
String aString;
@@ -518,23 +518,23 @@ void ScColRowNameRangesDlg::UpdateNames()
SCCOL q=nCol1+3;
if(q>nCol2) q=nCol2;
//@008 Baue String zusammen
- strShow.AssignAscii(RTL_CONSTASCII_STRINGPARAM(" ["));
+ strShow = " [";
if(pDoc!=NULL)
{
rString = pDoc->GetString(nCol1, nRow1, nTab1);
- strShow +=rString;
+ strShow += rString;
for(SCCOL i=nCol1+1;i<=q;i++)
{
- strShow.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
+ strShow += ", ";
rString = pDoc->GetString(i, nRow1, nTab1);
strShow += rString;
}
}
if(q<nCol2) // Zu lang? Ergaenzen um ",..."
{
- strShow.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", ..."));
+ strShow += ", ...";
}
- strShow += ']';
+ strShow += "]";
//@008 String einfuegen in Listbox
String aInsStr = aString;
@@ -564,23 +564,23 @@ void ScColRowNameRangesDlg::UpdateNames()
nCol2, nRow2, nTab2 );
SCROW q=nRow1+3;
if(q>nRow2) q=nRow2;
- strShow.AssignAscii(RTL_CONSTASCII_STRINGPARAM(" ["));
+ strShow = " [";
if(pDoc!=NULL)
{
rString = pDoc->GetString(nCol1, nRow1, nTab1);
strShow += rString;
for(SCROW i=nRow1+1;i<=q;i++)
{
- strShow.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
+ strShow += ", ";
rString = pDoc->GetString(nCol1, i, nTab1);
strShow += rString;
}
}
if(q<nRow2)
{
- strShow.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", ..."));
+ strShow += ", ...";
}
- strShow += ']';
+ strShow += "]";
String aInsStr = aString;
aInsStr += strShow;