Related: fdo#38838 remove UniString::AssignAscii

Change-Id: I263ef2594080ff7d47d5499c2b62e60e1689d2d6
This commit is contained in:
Caolán McNamara 2013-10-01 13:39:46 +01:00
parent 2655ef2d03
commit d05a9ae25e
19 changed files with 133 additions and 225 deletions

View File

@ -180,8 +180,7 @@ public:
UniString& Assign( sal_Unicode c );
inline UniString & Assign(char c) // ...but allow "Assign('a')"
{ return Assign(static_cast< sal_Unicode >(c)); }
UniString& AssignAscii( const sal_Char* pAsciiStr );
UniString& AssignAscii( const sal_Char* pAsciiStr, xub_StrLen nLen );
UniString& operator =( const UniString& rStr )
{ return Assign( rStr ); }
UniString& operator =( const OUString& rStr )

View File

@ -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;

View File

@ -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;

View File

@ -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();
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!" );

View File

@ -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;
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;

View File

@ -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() )

View File

@ -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;

View File

@ -138,9 +138,9 @@ public:
******************************************************************************/
struct SwHash
{
SwHash( const String& rStr );
SwHash( const OUString& rStr );
virtual ~SwHash();
String aStr;
OUString aStr;
SwHash *pNext;
};
@ -149,18 +149,18 @@ struct SwCalcExp : public SwHash
SwSbxValue nValue;
const SwFieldType* pFldType;
SwCalcExp( const String& rStr, const SwSbxValue& rVal,
SwCalcExp( const OUString& rStr, const SwSbxValue& rVal,
const SwFieldType* pFldType = 0 );
};
SwHash* Find( const String& rSrch, SwHash** ppTable,
SwHash* Find( const OUString& rSrch, SwHash** ppTable,
sal_uInt16 nTblSize, sal_uInt16* pPos = 0 );
void DeleteHashTable( SwHash** ppTable, sal_uInt16 nTblSize );
// if _CalcOp != 0, this is a valid operator
struct _CalcOp;
_CalcOp* FindOperator( const String& rSearch );
_CalcOp* FindOperator( const OUString& rSearch );
/******************************************************************************
* class SwCalc

View File

@ -91,7 +91,7 @@ struct _CalcOp
{
union{
const sal_Char* pName;
const String* pUName;
const OUString* pUName;
};
SwCalcOper eOp;
};
@ -157,16 +157,16 @@ static int SAL_CALL OperatorCompare( const void *pFirst, const void *pSecond)
if( CALC_NAME == ((_CalcOp*)pFirst)->eOp )
{
if( CALC_NAME == ((_CalcOp*)pSecond)->eOp )
nRet = ((_CalcOp*)pFirst)->pUName->CompareTo(
nRet = ((_CalcOp*)pFirst)->pUName->compareTo(
*((_CalcOp*)pSecond)->pUName );
else
nRet = ((_CalcOp*)pFirst)->pUName->CompareToAscii(
nRet = ((_CalcOp*)pFirst)->pUName->compareToAscii(
((_CalcOp*)pSecond)->pName );
}
else
{
if( CALC_NAME == ((_CalcOp*)pSecond)->eOp )
nRet = -1 * ((_CalcOp*)pSecond)->pUName->CompareToAscii(
nRet = -1 * ((_CalcOp*)pSecond)->pUName->compareToAscii(
((_CalcOp*)pFirst)->pName );
else
nRet = strcmp( ((_CalcOp*)pFirst)->pName,
@ -176,7 +176,7 @@ static int SAL_CALL OperatorCompare( const void *pFirst, const void *pSecond)
}
}// extern "C"
_CalcOp* FindOperator( const String& rSrch )
_CalcOp* FindOperator( const OUString& rSrch )
{
_CalcOp aSrch;
aSrch.pUName = &rSrch;
@ -189,13 +189,13 @@ _CalcOp* FindOperator( const String& rSrch )
OperatorCompare );
}
SwHash* Find( const String& rStr, SwHash** ppTable,
SwHash* Find( const OUString& rStr, SwHash** ppTable,
sal_uInt16 nTblSize, sal_uInt16* pPos )
{
sal_uLong ii = 0;
for( xub_StrLen n = 0; n < rStr.Len(); ++n )
for( sal_Int32 n = 0; n < rStr.getLength(); ++n )
{
ii = ii << 1 ^ rStr.GetChar( n );
ii = ii << 1 ^ rStr[n];
}
ii %= nTblSize;
@ -241,7 +241,7 @@ SwCalc::SwCalc( SwDoc& rD )
nListPor( 0 ),
eError( CALC_NOERR )
{
aErrExpr.aStr.AssignAscii( "~C_ERR~" );
aErrExpr.aStr = "~C_ERR~";
memset( VarTable, 0, sizeof(VarTable) );
LanguageType eLang = GetDocAppScriptLang( rDoc );
@ -333,7 +333,7 @@ SwCalc::SwCalc( SwDoc& rD )
for( n = 0; n < 25; ++n )
{
sTmpStr.AssignAscii( sNTypeTab[ n ] );
sTmpStr = OUString::createFromAscii(sNTypeTab[n]);
VarTable[ aHashValue[ n ] ] = new SwCalcExp( sTmpStr, nVal, 0 );
}
@ -358,7 +358,7 @@ SwCalc::SwCalc( SwDoc& rD )
(String)rUserOptions.GetToken( aAdrToken[ n ] ));
nVal.PutString( (String)rUserOptions.GetToken( aAdrToken[ 11 ] ));
sTmpStr.AssignAscii( sNTypeTab[ 25 ] );
sTmpStr = OUString::createFromAscii(sNTypeTab[25]);
VarTable[ aHashValue[ 25 ] ]->pNext = new SwCalcExp( sTmpStr, nVal, 0 );
} // SwCalc::SwCalc
@ -443,7 +443,7 @@ String SwCalc::GetStrResult( double nValue, sal_Bool )
SwCalcExp* SwCalc::VarInsert( const String &rStr )
{
String aStr = pCharClass->lowercase( rStr );
OUString aStr = pCharClass->lowercase( rStr );
return VarLook( aStr, 1 );
}
@ -452,7 +452,7 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, sal_uInt16 ins )
aErrExpr.nValue.SetVoidValue(false);
sal_uInt16 ii = 0;
String aStr = pCharClass->lowercase( rStr );
OUString aStr = pCharClass->lowercase( rStr );
SwHash* pFnd = Find( aStr, VarTable, TBLSZ, &ii );
@ -608,7 +608,7 @@ void SwCalc::VarChange( const String& rStr, double nValue )
void SwCalc::VarChange( const String& rStr, const SwSbxValue& rValue )
{
String aStr = pCharClass->lowercase( rStr );
OUString aStr = pCharClass->lowercase( rStr );
sal_uInt16 nPos = 0;
SwCalcExp* pFnd = (SwCalcExp*)Find( aStr, VarTable, TBLSZ, &nPos );
@ -1566,9 +1566,9 @@ sal_Bool SwCalc::IsValidVarName( const OUString& rStr, OUString* pValidName )
return bRet;
}
SwHash::SwHash( const String& rStr ) :
aStr( rStr ),
pNext( 0 )
SwHash::SwHash(const OUString& rStr)
: aStr(rStr)
, pNext(0)
{
}
@ -1584,11 +1584,11 @@ void DeleteHashTable( SwHash **ppHashTable, sal_uInt16 nCount )
delete [] ppHashTable;
}
SwCalcExp::SwCalcExp( const String& rStr, const SwSbxValue& rVal,
const SwFieldType* pType )
: SwHash( rStr ),
nValue( rVal ),
pFldType( pType )
SwCalcExp::SwCalcExp(const OUString& rStr, const SwSbxValue& rVal,
const SwFieldType* pType)
: SwHash(rStr)
, nValue(rVal)
, pFldType(pType)
{
}

View File

@ -1451,8 +1451,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
else
pTxtNd->SwCntntNode::GetAttr( aSet );
rCntntAtPos.sStr.AssignAscii(
RTL_CONSTASCII_STRINGPARAM( "Pos: (" ));
rCntntAtPos.sStr = "Pos: (";
rCntntAtPos.sStr += OUString::number( aPos.nNode.GetIndex());
rCntntAtPos.sStr += ':';
rCntntAtPos.sStr += OUString::number( aPos.nContent.GetIndex());

View File

@ -556,25 +556,25 @@ void SwDoc::InitDrawModel()
mpDrawModel->EnableUndo( GetIDocumentUndoRedo().DoesUndo() );
String sLayerNm;
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Hell" ));
OUString sLayerNm;
sLayerNm = "Hell";
mnHell = mpDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Heaven" ));
sLayerNm = "Heaven";
mnHeaven = mpDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Controls" ));
sLayerNm = "Controls";
mnControls = mpDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
// add invisible layers corresponding to the visible ones.
{
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHell" ));
sLayerNm = "InvisibleHell";
mnInvisibleHell = mpDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHeaven" ));
sLayerNm = "InvisibleHeaven";
mnInvisibleHeaven = mpDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleControls" ));
sLayerNm = "InvisibleControls";
mnInvisibleControls = mpDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
}
@ -625,14 +625,14 @@ void SwDoc::InitDrawModel()
/** method to notify drawing page view about the invisible layers */
void SwDoc::NotifyInvisibleLayers( SdrPageView& _rSdrPageView )
{
String sLayerNm;
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHell" ));
OUString sLayerNm;
sLayerNm = "InvisibleHell";
_rSdrPageView.SetLayerVisible( sLayerNm, sal_False );
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleHeaven" ));
sLayerNm = "InvisibleHeaven";
_rSdrPageView.SetLayerVisible( sLayerNm, sal_False );
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("InvisibleControls" ));
sLayerNm = "InvisibleControls";
_rSdrPageView.SetLayerVisible( sLayerNm, sal_False );
}

View File

@ -92,7 +92,7 @@ SwQueuedPaint *SwPaintQueue::pQueue = 0;
// saves some settings from the draw view
class SwDrawViewSave
{
String sLayerNm;
OUString sLayerNm;
SdrView* pDV;
sal_Bool bPrintControls;
public:
@ -586,7 +586,7 @@ SwDrawViewSave::SwDrawViewSave( SdrView* pSdrView )
{
if ( pDV )
{
sLayerNm.AssignAscii( RTL_CONSTASCII_STRINGPARAM("Controls" ) );
sLayerNm = "Controls";
bPrintControls = pDV->IsLayerPrintable( sLayerNm );
}
}
@ -612,8 +612,8 @@ void ViewShell::PrepareForPrint( const SwPrintData &rOptions )
if ( HasDrawView() )
{
SdrView *pDrawView = GetDrawView();
String sLayerNm;
sLayerNm.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Controls" ));
OUString sLayerNm;
sLayerNm = "Controls";
// OD 09.01.2003 #i6467# - consider, if view shell belongs to page preview
if ( !IsPreView() )
{

View File

@ -1461,8 +1461,8 @@ void SwHTMLParser::InsertInput()
if( !pFormImpl || !pFormImpl->GetFormComps().is() )
return;
String sImgSrc, aId, aClass, aStyle, sText;
String sName;
String sImgSrc, aId, aClass, aStyle, sName;
OUString sText;
SvxMacroTableDtor aMacroTbl;
std::vector<OUString> aUnoMacroTbl;
std::vector<OUString> aUnoMacroParamTbl;
@ -1705,7 +1705,7 @@ void SwHTMLParser::InsertInput()
}
}
aTmp <<= OUString(sText);
aTmp <<= sText;
Size aSz( 0, 0 ); // defaults
Size aTextSz( 0, 0 ); // Text-Size
@ -1780,18 +1780,18 @@ void SwHTMLParser::InsertInput()
break;
case HTML_IT_SUBMIT:
eButtonType = FormButtonType_SUBMIT;
if( !sText.Len() )
sText.AssignAscii( OOO_STRING_SVTOOLS_HTML_IT_submit );
if (sText.isEmpty())
sText = OOO_STRING_SVTOOLS_HTML_IT_submit;
break;
case HTML_IT_RESET:
eButtonType = FormButtonType_RESET;
if( !sText.Len() )
sText.AssignAscii( OOO_STRING_SVTOOLS_HTML_IT_reset );
if (sText.isEmpty())
sText = OOO_STRING_SVTOOLS_HTML_IT_reset;
break;
default:
;
}
aTmp <<= OUString(sText);
aTmp <<= sText;
xPropSet->setPropertyValue("Label",
aTmp );

View File

@ -336,18 +336,18 @@ void SwHTMLWriter::OutFootEndNotes()
SwTxtFtn *pTxtFtn = (*pFootEndNotes)[i];
pFmtFtn = &pTxtFtn->GetFtn();
String sFtnName, sClass;
OUString sFtnName, sClass;
if( pFmtFtn->IsEndNote() )
{
sClass.AssignAscii( OOO_STRING_SVTOOLS_HTML_sdendnote );
sFtnName.AssignAscii( OOO_STRING_SVTOOLS_HTML_sdendnote );
sFtnName.Append( OUString::number((sal_Int32)(++nEndNote)) );
sClass = OOO_STRING_SVTOOLS_HTML_sdendnote;
sFtnName = OOO_STRING_SVTOOLS_HTML_sdendnote;
sFtnName += OUString::number((sal_Int32)(++nEndNote));
}
else
{
sClass.AssignAscii( OOO_STRING_SVTOOLS_HTML_sdfootnote );
sFtnName.AssignAscii( OOO_STRING_SVTOOLS_HTML_sdfootnote );
sFtnName.Append( OUString::number((sal_Int32)(++nFootNote)));
sClass = OOO_STRING_SVTOOLS_HTML_sdfootnote;
sFtnName = OOO_STRING_SVTOOLS_HTML_sdfootnote;
sFtnName += OUString::number((sal_Int32)(++nFootNote));
}
if( bLFPossible )
@ -427,19 +427,19 @@ void SwHTMLWriter::OutFootEndNoteSym( const SwFmtFtn& rFmtFtn,
{
const SwEndNoteInfo *pInfo;
String sFtnName, sClass;
OUString sFtnName, sClass;
if( rFmtFtn.IsEndNote() )
{
sClass.AssignAscii( OOO_STRING_SVTOOLS_HTML_sdendnote_sym );
sFtnName.AssignAscii( OOO_STRING_SVTOOLS_HTML_sdendnote );
sFtnName.Append( OUString::number((sal_Int32)nEndNote) );
sClass = OOO_STRING_SVTOOLS_HTML_sdendnote_sym;
sFtnName = OOO_STRING_SVTOOLS_HTML_sdendnote;
sFtnName += OUString::number((sal_Int32)nEndNote);
pInfo = &pDoc->GetEndNoteInfo();
}
else
{
sClass.AssignAscii( OOO_STRING_SVTOOLS_HTML_sdfootnote_sym );
sFtnName.AssignAscii( OOO_STRING_SVTOOLS_HTML_sdfootnote );
sFtnName.Append( OUString::number((sal_Int32)nFootNote));
sClass = OOO_STRING_SVTOOLS_HTML_sdfootnote_sym;
sFtnName = OOO_STRING_SVTOOLS_HTML_sdfootnote;
sFtnName += OUString::number((sal_Int32)nFootNote);
pInfo = &pDoc->GetFtnInfo();
}
@ -449,13 +449,13 @@ void SwHTMLWriter::OutFootEndNoteSym( const SwFmtFtn& rFmtFtn,
switch( nScript )
{
case CSS1_OUTMODE_WESTERN:
sClass.AppendAscii( RTL_CONSTASCII_STRINGPARAM("-western") );
sClass += "-western";
break;
case CSS1_OUTMODE_CJK:
sClass.AppendAscii( RTL_CONSTASCII_STRINGPARAM("-cjk") );
sClass += "-cjk";
break;
case CSS1_OUTMODE_CTL:
sClass.AppendAscii( RTL_CONSTASCII_STRINGPARAM("-ctl") );
sClass += "-ctl";
break;
}
}

View File

@ -48,8 +48,6 @@
#include <breakit.hxx>
#include <i18nlangtag/mslangid.hxx>
#define ASSIGN_CONST_ASC(s) AssignAscii(s)
using namespace css;
namespace myImplHelpers
@ -314,14 +312,11 @@ namespace myImplHelpers
return pColl ? 0 : maHelper.MakeStyle(aName);
}
String FindBestMSSubstituteFont(const String &rFont)
OUString FindBestMSSubstituteFont(const OUString &rFont)
{
String sRet;
if ( IsStarSymbol(rFont) )
sRet.ASSIGN_CONST_ASC("Arial Unicode MS");
else
sRet = GetSubsFontName(rFont, SUBSFONT_ONLYONE | SUBSFONT_MS);
return sRet;
if (IsStarSymbol(rFont))
return OUString("Arial Unicode MS");
return GetSubsFontName(rFont, SUBSFONT_ONLYONE | SUBSFONT_MS);
}
//Utility to remove entries before a given starting position

View File

@ -3309,7 +3309,8 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, OUString& rStr
}
#endif
String sURL, sTarget, sMark;
String sURL, sMark;
OUString sTarget;
bool bDataImport = false;
//HYPERLINK "filename" [switches]
@ -3332,7 +3333,7 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, OUString& rStr
break;
case 'n':
sTarget.AssignAscii( "_blank" );
sTarget = "_blank";
bOptions = true;
break;

View File

@ -196,9 +196,8 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
uno::Reference< lang::XMultiServiceFactory > xFact(xModel, uno::UNO_QUERY);
String sIndexTypeName;
sIndexTypeName.AssignAscii( IndexServiceNames[
nTOXIndex <= TOX_AUTHORITIES ? nTOXIndex : TOX_USER] );
OUString sIndexTypeName(OUString::createFromAscii( IndexServiceNames[
nTOXIndex <= TOX_AUTHORITIES ? nTOXIndex : TOX_USER] ));
pxIndexSectionsArr[nTOXIndex]->xDocumentIndex = uno::Reference< text::XDocumentIndex > (xFact->createInstance(
sIndexTypeName), uno::UNO_QUERY);
uno::Reference< text::XTextContent > xContent(pxIndexSectionsArr[nTOXIndex]->xDocumentIndex, uno::UNO_QUERY);
@ -311,7 +310,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
{
for(sal_uInt16 nCurrLevel = nStartLevel; nCurrLevel <= nEndLevel; nCurrLevel++)
{
String sTokenType;
OUString sTokenType;
uno::Sequence< beans::PropertyValues> aSequPropVals(10);
long nTokenIndex = 0;
long nParamCount = 2;
@ -329,45 +328,36 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
switch(aToken.eTokenType)
{
case TOKEN_ENTRY_NO :
sTokenType.AssignAscii(RTL_CONSTASCII_STRINGPARAM(
"TokenEntryNumber"));
sTokenType = "TokenEntryNumber";
// numbering for content index
break;
case TOKEN_ENTRY_TEXT :
case TOKEN_ENTRY :
sTokenType.AssignAscii(RTL_CONSTASCII_STRINGPARAM(
"TokenEntryText"));
sTokenType = "TokenEntryText";
break;
case TOKEN_TAB_STOP :
nParamCount += 3;
sTokenType.AssignAscii(RTL_CONSTASCII_STRINGPARAM(
"TokenTabStop"));
sTokenType = "TokenTabStop";
break;
case TOKEN_TEXT :
sTokenType.AssignAscii(RTL_CONSTASCII_STRINGPARAM(
"TokenText"));
sTokenType = "TokenText";
nParamCount += 1;
break;
case TOKEN_PAGE_NUMS :
sTokenType.AssignAscii(RTL_CONSTASCII_STRINGPARAM(
"TokenPageNumber"));
sTokenType = "TokenPageNumber";
break;
case TOKEN_CHAPTER_INFO :
sTokenType.AssignAscii(RTL_CONSTASCII_STRINGPARAM(
"TokenChapterInfo"));
sTokenType = "TokenChapterInfo";
break;
case TOKEN_LINK_START :
sTokenType.AssignAscii(RTL_CONSTASCII_STRINGPARAM(
"TokenHyperlinkStart"));
sTokenType = "TokenHyperlinkStart";
break;
case TOKEN_LINK_END :
sTokenType.AssignAscii(RTL_CONSTASCII_STRINGPARAM(
"TokenHyperlinkEnd"));
sTokenType = "TokenHyperlinkEnd";
break;
case TOKEN_AUTHORITY :
{
sTokenType.AssignAscii(RTL_CONSTASCII_STRINGPARAM(
"TokenBibliographyDataField"));
sTokenType = "TokenBibliographyDataField";
}
break;
default:; //prevent warning
@ -375,7 +365,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
beans::PropertyValues aPropVals(nParamCount);
beans::PropertyValue* pPropValArr = aPropVals.getArray();
pPropValArr[0].Name = "TokenType";
pPropValArr[0].Value <<= OUString(sTokenType);
pPropValArr[0].Value <<= sTokenType;
pPropValArr[1].Name = "CharacterStyleName";
pPropValArr[1].Value <<= OUString(aToken.sCharStyleName);
if(TOKEN_TAB_STOP == aToken.eTokenType)

View File

@ -768,7 +768,6 @@ void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell)
m_pStartEdit->SetValue( rNumFmt.GetStart() );
// create pool formats for headlines
String sStr;
sal_uInt16 i;
for( i = 0; i < MAXLEVEL; ++i )
{
@ -776,7 +775,7 @@ void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell)
static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i), aEmptyStr ));
m_pLevelLB->InsertEntry( OUString::number(i + 1) );
}
sStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "1 - " ));
OUString sStr("1 - ");
sStr += OUString::number(MAXLEVEL);
m_pLevelLB->InsertEntry( sStr );

View File

@ -91,81 +91,6 @@ static sal_Int32 ImplStringCompareWithoutZeroAscii( const sal_Unicode* pStr1, co
return nRet;
}
UniString& UniString::AssignAscii( const sal_Char* pAsciiStr )
{
DBG_CHKTHIS( UniString, DbgCheckUniString );
DBG_ASSERT( pAsciiStr, "UniString::AssignAscii() - pAsciiStr is NULL" );
// Determine string length
xub_StrLen nLen = ImplStringLen( pAsciiStr );
if ( !nLen )
{
STRING_NEW((STRING_TYPE **)&mpData);
}
else
{
// Replace string in-place if new size is equal
if ( (nLen == mpData->mnLen) && (mpData->mnRefCount == 1) )
ImplCopyAsciiStr( mpData->maStr, pAsciiStr, nLen );
else
{
// release old string
STRING_RELEASE((STRING_TYPE *)mpData);
// copy new string
mpData = ImplAllocData( nLen );
ImplCopyAsciiStr( mpData->maStr, pAsciiStr, nLen );
}
}
return *this;
}
UniString& UniString::AssignAscii( const sal_Char* pAsciiStr, xub_StrLen nLen )
{
DBG_CHKTHIS( UniString, DbgCheckUniString );
DBG_ASSERT( pAsciiStr, "UniString::AssignAscii() - pAsciiStr is NULL" );
if ( nLen == STRING_LEN )
nLen = ImplStringLen( pAsciiStr );
#ifdef DBG_UTIL
if ( DbgIsAssert() )
{
for ( xub_StrLen i = 0; i < nLen; ++i )
{
if ( !pAsciiStr[i] )
{
OSL_FAIL( "UniString::AssignAscii() : nLen is wrong" );
}
}
}
#endif
if ( !nLen )
{
STRING_NEW((STRING_TYPE **)&mpData);
}
else
{
// Replace string in-place if new size is equal
if ( (nLen == mpData->mnLen) && (mpData->mnRefCount == 1) )
ImplCopyAsciiStr( mpData->maStr, pAsciiStr, nLen );
else
{
// release old string
STRING_RELEASE((STRING_TYPE *)mpData);
// copy new string
mpData = ImplAllocData( nLen );
ImplCopyAsciiStr( mpData->maStr, pAsciiStr, nLen );
}
}
return *this;
}
UniString& UniString::AppendAscii( const sal_Char* pAsciiStr )
{
DBG_CHKTHIS( UniString, DbgCheckUniString );