[Libreoffice-commits] core.git: include/tools sw/source tools/source vcl/win
Caolán McNamara
caolanm at redhat.com
Mon Oct 14 03:55:14 PDT 2013
include/tools/string.hxx | 2
sw/source/core/crsr/crstrvl.cxx | 27 +++----
sw/source/core/doc/doc.cxx | 14 +--
sw/source/core/doc/docglbl.cxx | 6 -
sw/source/core/doc/doctxm.cxx | 20 ++---
sw/source/core/text/EnhancedPDFExportHelper.cxx | 4 -
sw/source/core/unocore/unochart.cxx | 20 ++---
sw/source/filter/html/htmlfld.cxx | 8 +-
sw/source/filter/html/htmlform.cxx | 5 -
sw/source/filter/ww8/docxattributeoutput.cxx | 6 -
sw/source/filter/ww8/wrtw8esh.cxx | 8 --
sw/source/filter/ww8/wrtw8nds.cxx | 25 +++---
sw/source/filter/ww8/wrtww8gr.cxx | 6 -
sw/source/filter/ww8/ww8atr.cxx | 79 ++++++++++------------
sw/source/filter/ww8/ww8par5.cxx | 11 +--
sw/source/ui/dbui/mmlayoutpage.cxx | 51 ++++++--------
sw/source/ui/docvw/SidebarTxtControl.cxx | 7 -
sw/source/ui/envelp/label1.cxx | 12 +--
sw/source/ui/envelp/labelexp.cxx | 4 -
sw/source/ui/index/cnttab.cxx | 4 -
sw/source/ui/shells/textsh1.cxx | 4 -
sw/source/ui/table/tautofmt.cxx | 6 -
sw/source/ui/uiview/view2.cxx | 26 +++----
tools/source/string/strascii.cxx | 86 ------------------------
vcl/win/source/window/salframe.cxx | 10 +-
25 files changed, 172 insertions(+), 279 deletions(-)
New commits:
commit 7e7a487e904143cbc282a2b90c4cb3918bfa151f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Oct 14 09:54:50 2013 +0100
Related: fdo#38838 remove UniString::AppendAscii
Change-Id: I0f929843d73eb445c8b1aa56d59cbbce844b9008
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index 3ab5532..74288fbf 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -196,8 +196,6 @@ public:
UniString& Append( sal_Unicode c );
inline UniString & Append(char c) // ...but allow "Append('a')"
{ return Append(static_cast< sal_Unicode >(c)); }
- UniString& AppendAscii( const sal_Char* pAsciiStr );
- UniString& AppendAscii( const sal_Char* pAsciiStr, xub_StrLen nLen );
UniString& operator +=( const UniString& rStr )
{ return Append( rStr ); }
UniString& operator +=( const OUString& rStr )
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 02372e0..b47597d 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1453,20 +1453,20 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.sStr = "Pos: (";
rCntntAtPos.sStr += OUString::number( aPos.nNode.GetIndex());
- rCntntAtPos.sStr += ':';
+ rCntntAtPos.sStr += ":";
rCntntAtPos.sStr += OUString::number( aPos.nContent.GetIndex());
- rCntntAtPos.sStr += ')';
- rCntntAtPos.sStr.AppendAscii(
- RTL_CONSTASCII_STRINGPARAM( "\nAbs.Vorl.: " )); // translation *might be* "paragraph template"
+ rCntntAtPos.sStr += ")";
+ rCntntAtPos.sStr += "\nAbs.Vorl.: "; // translation *might be* "paragraph template"
rCntntAtPos.sStr += pTxtNd->GetFmtColl()->GetName();
if( pTxtNd->GetCondFmtColl() )
- rCntntAtPos.sStr.AppendAscii(
- RTL_CONSTASCII_STRINGPARAM( "\nBed.Vorl.: " )) // translation *might be* "conditional template"
- += pTxtNd->GetCondFmtColl()->GetName();
+ {
+ // translation *might be* "conditional template"
+ rCntntAtPos.sStr += "\nBed.Vorl.: " + pTxtNd->GetCondFmtColl()->GetName();
+ }
if( aSet.Count() )
{
- String sAttrs;
+ OUString sAttrs;
SfxItemIter aIter( aSet );
const SfxPoolItem* pItem = aIter.FirstItem();
while( true )
@@ -1477,22 +1477,19 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
GetDoc()->GetAttrPool().GetPresentation( *pItem,
SFX_ITEM_PRESENTATION_COMPLETE,
SFX_MAPUNIT_CM, aStr );
- if( sAttrs.Len() )
- sAttrs.AppendAscii(
- RTL_CONSTASCII_STRINGPARAM( ", " ));
+ if (!sAttrs.isEmpty())
+ sAttrs += ", ";
sAttrs += aStr;
}
if( aIter.IsAtEnd() )
break;
pItem = aIter.NextItem();
}
- if( sAttrs.Len() )
+ if (!sAttrs.isEmpty())
{
if( rCntntAtPos.sStr.Len() )
rCntntAtPos.sStr += '\n';
- rCntntAtPos.sStr.AppendAscii(
- RTL_CONSTASCII_STRINGPARAM( "Attr: " ) )
- += sAttrs;
+ rCntntAtPos.sStr += "Attr: " + sAttrs;
}
}
bRet = sal_True;
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 904c006..1b8a4a6 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1241,22 +1241,22 @@ static void lcl_FormatPostIt(
pIDCO->SplitNode( *aPam.GetPoint(), false );
}
- String aStr( ViewShell::GetShellRes()->aPostItPage );
- aStr.AppendAscii(sTmp);
+ OUString aStr( ViewShell::GetShellRes()->aPostItPage );
+ aStr += sTmp;
aStr += OUString::number( nPageNo );
- aStr += ' ';
+ aStr += " ";
if( nLineNo )
{
aStr += ViewShell::GetShellRes()->aPostItLine;
- aStr.AppendAscii(sTmp);
+ aStr += sTmp;
aStr += OUString::number( nLineNo );
- aStr += ' ';
+ aStr += " ";
}
aStr += ViewShell::GetShellRes()->aPostItAuthor;
- aStr.AppendAscii(sTmp);
+ aStr += sTmp;
aStr += pField->GetPar1();
- aStr += ' ';
+ aStr += " ";
SvtSysLocale aSysLocale;
aStr += /*(LocaleDataWrapper&)*/aSysLocale.GetLocaleData().getDate( pField->GetDate() );
pIDCO->InsertString( aPam, aStr );
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 6effd06..b4a659f 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -287,9 +287,9 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, bool bOutline, c
xDocProps->setTemplateURL(rPath);
// Set the new doc's title to the text of the "split para".
// If the current doc has a title, insert it at the begin.
- String sTitle( xDocProps->getTitle() );
- if( sTitle.Len() )
- sTitle.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ));
+ OUString sTitle( xDocProps->getTitle() );
+ if (!sTitle.isEmpty())
+ sTitle += ": ";
sTitle += ((SwTxtNode*)pStartNd)->GetExpandTxt();
xDocProps->setTitle( sTitle );
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index fa87c20..587ee36 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -365,9 +365,9 @@ const SwTOXBaseSection* SwDoc::InsertTableOf( const SwPosition& rPos,
SwTxtNode* pHeadNd = GetNodes().MakeTxtNode( aIdx,
GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) );
- String sNm( pNewSection->GetTOXName() );
+ OUString sNm( pNewSection->GetTOXName() );
// ??Resource
- sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
+ sNm += "_Head";
SwSectionData headerData( TOX_HEADER_SECTION, sNm );
@@ -882,9 +882,9 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
GetTxtFmtColl( FORM_TITLE ) );
pHeadNd->InsertText( GetTitle(), SwIndex( pHeadNd ) );
- String sNm( GetTOXName() );
+ OUString sNm( GetTOXName() );
// ??Resource
- sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
+ sNm += "_Head";
SwSectionData headerData( TOX_HEADER_SECTION, sNm );
@@ -1581,7 +1581,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
for(sal_uInt16 nIndex = nArrayIdx; nIndex < nArrayIdx + nCount; nIndex++)
{
if(nIndex > nArrayIdx)
- rTxt.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ", " )); // comma separation
+ rTxt += ", "; // comma separation
// Initialize String with the Pattern from the form
const SwTOXSortTabBase& rBase = *aSortArr[nIndex];
sal_uInt16 nLvl = rBase.GetLevel();
@@ -1715,7 +1715,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
String aInsStr = OUString(cNumRepl);
for (size_t i = 1; i < nSize; ++i)
{
- aInsStr.AppendAscii( sPageDeli );
+ aInsStr += sPageDeli;
aInsStr += cNumRepl;
}
aInsStr += cEndPageNum;
@@ -2051,7 +2051,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
if(nCount >= 2 )
aNumStr += '-';
else if(nCount == 1 )
- aNumStr.AppendAscii( sPageDeli );
+ aNumStr += sPageDeli;
//#58127# If nCount == 0, then the only PageNumber is already in aNumStr!
if(nCount)
aNumStr += aType.GetNumStr( nBeg + nCount );
@@ -2059,7 +2059,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
// Create new String
nBeg = rNums[i];
- aNumStr.AppendAscii( sPageDeli );
+ aNumStr += sPageDeli;
//the change of the character style must apply after sPageDeli is appended
if (xCharStyleIdx && bMainEntryChanges)
{
@@ -2074,7 +2074,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
{ // Insert all Numbers
aNumStr += aType.GetNumStr( sal_uInt16(rNums[i]) );
if(i != (rNums.size()-1))
- aNumStr.AppendAscii( sPageDeli );
+ aNumStr += sPageDeli;
}
}
// Flush when ending and the following old values
@@ -2090,7 +2090,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
if(nCount >= 2)
aNumStr +='-';
else if(nCount == 1)
- aNumStr.AppendAscii( sPageDeli );
+ aNumStr += sPageDeli;
//#58127# If nCount == 0, then the only PageNumber is already in aNumStr!
if(nCount)
aNumStr += SvxNumberType( rDescs[i-1]->GetNumType() ).GetNumStr( nBeg+nCount );
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 845c7b0..1642a13 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -1627,8 +1627,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
pNumFormatter->GetOutputString( aDateDiff.GetDate(), nFormat, sDate, &pColor );
// The title should consist of the author and the date:
- String sTitle( pField->GetPar1() );
- sTitle.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ", " ) );
+ OUString sTitle( pField->GetPar1() );
+ sTitle += ", ";
sTitle += sDate;
aNote.Title = sTitle;
// Guess what the contents contains...
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 47131eb..8805a0e 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -1764,7 +1764,7 @@ OUString SAL_CALL SwChartDataProvider::convertRangeToXML( const OUString& rRange
if (bDisposed)
throw lang::DisposedException();
- String aRes;
+ OUString aRes;
String aRangeRepresentation( rRangeRepresentation );
// multiple ranges are delimeted by a ';' like in
@@ -1816,9 +1816,9 @@ OUString SAL_CALL SwChartDataProvider::convertRangeToXML( const OUString& rRange
aCellRange.aLowerRight.nRow = nRow;
aCellRange.aLowerRight.bIsEmpty = false;
}
- String aTmp( XMLRangeHelper::getXMLStringFromCellRange( aCellRange ) );
- if (aRes.Len()) // in case of multiple ranges add delimeter
- aRes.AppendAscii( " " );
+ OUString aTmp( XMLRangeHelper::getXMLStringFromCellRange( aCellRange ) );
+ if (!aRes.isEmpty()) // in case of multiple ranges add delimeter
+ aRes += " ";
aRes += aTmp;
}
@@ -1832,7 +1832,7 @@ OUString SAL_CALL SwChartDataProvider::convertRangeFromXML( const OUString& rXML
if (bDisposed)
throw lang::DisposedException();
- String aRes;
+ OUString aRes;
String aXMLRange( rXMLRange );
// multiple ranges are delimeted by a ' ' like in
@@ -1865,9 +1865,9 @@ OUString SAL_CALL SwChartDataProvider::convertRangeFromXML( const OUString& rXML
aCellRange.aLowerRight.nRow );
}
- if (aRes.Len()) // in case of multiple ranges add delimeter
- aRes.AppendAscii( ";" );
- aRes += String(aTmp);
+ if (!aRes.isEmpty()) // in case of multiple ranges add delimeter
+ aRes += ";";
+ aRes += aTmp;
}
return aRes;
@@ -2688,8 +2688,8 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
pStartBox = pTable->GetTblBox( pStartNd->GetIndex() );
const String aStartBox( pStartBox->GetName() );
//
- String aCellRange( aStartBox ); // note that cell range here takes the newly added rows/cols already into account
- aCellRange.AppendAscii( ":" );
+ OUString aCellRange( aStartBox ); // note that cell range here takes the newly added rows/cols already into account
+ aCellRange += ":";
aCellRange += aEndBox;
SwRangeDescriptor aDesc;
FillRangeDescriptor( aDesc, aCellRange );
diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx
index 8924c24..e2fd202 100644
--- a/sw/source/filter/html/htmlfld.cxx
+++ b/sw/source/filter/html/htmlfld.cxx
@@ -602,12 +602,12 @@ void SwHTMLParser::InsertCommentText( const sal_Char *pTag )
void SwHTMLParser::InsertComment( const String& rComment, const sal_Char *pTag )
{
- String aComment( rComment );
+ OUString aComment( rComment );
if( pTag )
{
- aComment.AppendAscii( "</" );
- aComment.AppendAscii( pTag );
- aComment.Append( '>' );
+ aComment += "</";
+ aComment += OUString::createFromAscii(pTag);
+ aComment += ">";
}
// MIB 24.06.97: Wenn ein PostIt nach einen Space eingefuegt
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index d039624..39a7c21 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -1671,9 +1671,8 @@ void SwHTMLParser::InsertInput()
if( !rServiceFactory.is() )
return;
- String sServiceName(
- OUString("com.sun.star.form.component.") );
- sServiceName.AppendAscii( pType );
+ OUString sServiceName("com.sun.star.form.component.");
+ sServiceName += OUString::createFromAscii(pType);
uno::Reference< XInterface > xInt =
rServiceFactory->createInstance( sServiceName );
if( !xInt.is() )
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 6436ae0..d4fbec0 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4749,10 +4749,8 @@ void DocxAttributeOutput::RefField( const SwField& rFld, const OUString& rRef )
sal_uInt16 nType = rFld.GetTyp( )->Which( );
if ( nType == RES_GETEXPFLD )
{
- String sCmd = FieldString( ww::eREF );
- sCmd.AppendAscii( "\"" );
- sCmd += rRef;
- sCmd.AppendAscii( "\" " );
+ OUString sCmd = FieldString( ww::eREF );
+ sCmd += "\"" + rRef + "\" ";
m_rExport.OutputField( &rFld, ww::eREF, sCmd );
}
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index cf056e9..6bd4112 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2983,8 +2983,6 @@ bool SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrObject *pOb
if (!WriteOCXStream( mxModel, xOleStg,xControlModel,aSize,sUName))
return false;
- String sName = sUName;
-
sal_uInt8 aSpecOLE[] =
{
0x03, 0x6a, 0xFF, 0xFF, 0xFF, 0xFF, // sprmCPicLocation
@@ -2996,10 +2994,8 @@ bool SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrObject *pOb
sal_uInt8 *pData = aSpecOLE+2;
Set_UInt32(pData,nObjId );
- String sFld(FieldString(ww::eCONTROL));
- sFld.AppendAscii("Forms.");
- sFld += sName;
- sFld.AppendAscii(".1 \\s ");
+ OUString sFld(FieldString(ww::eCONTROL));
+ sFld += "Forms." + sUName + ".1 \\s ";
rWW8Wrt.OutputField(0, ww::eCONTROL, sFld,
WRITEFIELD_START|WRITEFIELD_CMD_START|WRITEFIELD_CMD_END);
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 4b56a71..156a9bd 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -640,8 +640,8 @@ const SfxPoolItem& SwWW8AttrIter::GetItem(sal_uInt16 nWhich) const
void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen /*nPos*/, const SwFmtRuby& rRuby )
{
- String aStr( FieldString( ww::eEQ ) );
- aStr.AppendAscii( "\\* jc" );
+ OUString aStr( FieldString( ww::eEQ ) );
+ aStr += "\\* jc";
sal_Int32 nJC = 0;
sal_Char cDirective = 0;
switch ( rRuby.GetAdjustment() )
@@ -715,17 +715,16 @@ void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen /*nPos*/,
}
nHeight = (nHeight + 5)/10;
- aStr.AppendAscii( " \\* \"Font:" );
- aStr.Append( sFamilyName );
- aStr.AppendAscii( "\" \\* hps" );
+ aStr += " \\* \"Font:";
+ aStr += sFamilyName;
+ aStr += "\" \\* hps";
aStr += OUString::number( nHeight );
- aStr.AppendAscii( " \\o" );
+ aStr += " \\o";
if ( cDirective )
{
- aStr.AppendAscii( "\\a" );
- aStr.Append( cDirective );
+ aStr += "\\a" + OUString(cDirective);
}
- aStr.AppendAscii( "(\\s\\up " );
+ aStr += "(\\s\\up ";
if ( g_pBreakIt->GetBreakIter().is() )
@@ -740,15 +739,15 @@ void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen /*nPos*/,
GetWhichOfScript( RES_CHRATR_FONTSIZE, nRubyScript ) );
nHeight = (rHeightItem.GetHeight() + 10)/20-1;
aStr += OUString::number(nHeight);
- aStr += '(';
+ aStr += "(";
aStr += rRuby.GetText();
- aStr.AppendAscii( ")" );
+ aStr += ")";
// The parameter separator depends on the FIB.lid
if ( m_rWW8Export.pFib->getNumDecimalSep() == '.' )
- aStr.AppendAscii( "," );
+ aStr += ",";
else
- aStr.AppendAscii( ";" );
+ aStr += ";";
m_rWW8Export.OutputField( 0, ww::eEQ, aStr,
WRITEFIELD_START | WRITEFIELD_CMD_START );
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 5d703fe..f618cb6 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -406,8 +406,8 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
? rFrame.GetContent()->GetGrfNode() : 0;
if ( pGrfNd && pGrfNd->IsLinkedFile() )
{
- String sStr( FieldString(ww::eINCLUDEPICTURE) );
- sStr.AppendAscii(" \"");
+ OUString sStr( FieldString(ww::eINCLUDEPICTURE) );
+ sStr += " \"";
{
if ( pGrfNd )
{
@@ -416,7 +416,7 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
sStr += aFileURL;
}
}
- sStr.AppendAscii("\" \\d");
+ sStr += "\" \\d";
OutputField( 0, ww::eINCLUDEPICTURE, sStr,
WRITEFIELD_START | WRITEFIELD_CMD_START | WRITEFIELD_CMD_END );
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 85a0aa1..39a1981 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -872,13 +872,13 @@ bool MSWordExportBase::HasRefToObject( sal_uInt16 nTyp, const OUString* pName, s
OUString MSWordExportBase::GetBookmarkName( sal_uInt16 nTyp, const OUString* pName, sal_uInt16 nSeqNo )
{
- String sRet;
+ OUString sRet;
switch ( nTyp )
{
case REF_SETREFATTR:
if ( pName )
{
- sRet.AppendAscii( "Ref_" );
+ sRet += "Ref_";
sRet += *pName;
}
break;
@@ -891,11 +891,11 @@ OUString MSWordExportBase::GetBookmarkName( sal_uInt16 nTyp, const OUString* pNa
case REF_OUTLINE:
break; // ???
case REF_FOOTNOTE:
- sRet.AppendAscii( "_RefF" );
+ sRet += "_RefF";
sRet += OUString::number( nSeqNo );
break;
case REF_ENDNOTE:
- sRet.AppendAscii( "_RefE" );
+ sRet += "_RefE";
sRet += OUString::number( nSeqNo );
break;
}
@@ -1915,18 +1915,15 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType,
void WW8Export::StartCommentOutput(const OUString& rName)
{
- String sStr(FieldString(ww::eQUOTE));
- sStr.AppendAscii("[");
- sStr += rName;
- sStr.AppendAscii("] ");
+ OUString sStr(FieldString(ww::eQUOTE));
+ sStr += "[" + rName + "] ";
OutputField(0, ww::eQUOTE, sStr, WRITEFIELD_START | WRITEFIELD_CMD_START);
}
void WW8Export::EndCommentOutput(const OUString& rName)
{
- String sStr(OUString(" ["));
- sStr += rName;
- sStr.AppendAscii("] ");
+ OUString sStr(" [");
+ sStr += rName + "] ";
OutputField(0, ww::eQUOTE, sStr, WRITEFIELD_CMD_END | WRITEFIELD_END |
WRITEFIELD_CLOSE);
}
@@ -2037,7 +2034,7 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect )
static const sal_Char sEntryEnd[] = "\" ";
ww::eField eCode = ww::eTOC;
- String sStr;
+ OUString sStr;
switch (pTOX->GetType())
{
case TOX_INDEX:
@@ -2045,10 +2042,10 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect )
sStr = FieldString(eCode);
if (pTOX->GetTOXForm().IsCommaSeparated())
- sStr.AppendAscii("\\r ");
+ sStr += "\\r ";
if (nsSwTOIOptions::TOI_ALPHA_DELIMITTER & pTOX->GetOptions())
- sStr.AppendAscii("\\h \"A\" ");
+ sStr += "\\h \"A\" ";
{
String aFillTxt;
@@ -2064,9 +2061,9 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect )
else
aFillTxt.Erase();
}
- sStr.AppendAscii("\\e \"");
+ sStr += "\\e \"";
sStr += aFillTxt;
- sStr.AppendAscii(sEntryEnd);
+ sStr += sEntryEnd;
}
break;
@@ -2077,19 +2074,19 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect )
{
sStr = FieldString(eCode);
- sStr.AppendAscii("\\c \"");
+ sStr += "\\c \"";
sStr += pTOX->GetSequenceName();
- sStr.AppendAscii(sEntryEnd);
+ sStr += sEntryEnd;
String aTxt;
int nRet = ::lcl_CheckForm( pTOX->GetTOXForm(), 1, aTxt );
if (1 == nRet)
- sStr.AppendAscii("\\n ");
+ sStr += "\\n ";
else if( 3 == nRet || 4 == nRet )
{
- sStr.AppendAscii("\\p \"");
+ sStr += "\\p \"";
sStr += aTxt;
- sStr.AppendAscii(sEntryEnd);
+ sStr += sEntryEnd;
}
}
break;
@@ -2105,13 +2102,13 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect )
if( nsSwTOXElement::TOX_MARK & pTOX->GetCreateType() )
{
- sStr.AppendAscii( "\\f " );
+ sStr += "\\f ";
if( TOX_USER == pTOX->GetType() )
{
- sStr += '\"';
- sStr += (sal_Char)( 'A' + GetExport( ).GetId( *pTOX->GetTOXType() ) );
- sStr.AppendAscii( sEntryEnd );
+ sStr += "\"";
+ sStr += OUString((sal_Char)( 'A' + GetExport( ).GetId( *pTOX->GetTOXType() ) ));
+ sStr += sEntryEnd;
}
if( nsSwTOXElement::TOX_OUTLINELEVEL & pTOX->GetCreateType() )
@@ -2124,9 +2121,9 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect )
if (nTmpLvl > WW8ListManager::nMaxLevel)
nTmpLvl = WW8ListManager::nMaxLevel;
- sStr.AppendAscii( "\\o \"1-" );
+ sStr += "\\o \"1-";
sStr += OUString::number( nTmpLvl );
- sStr.AppendAscii(sEntryEnd);
+ sStr += sEntryEnd;
}
}
@@ -2179,9 +2176,9 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect )
if (nMaxMSAutoEvaluate > WW8ListManager::nMaxLevel)
nMaxMSAutoEvaluate = WW8ListManager::nMaxLevel;
- sStr.AppendAscii( "\\o \"1-" );
+ sStr += "\\o \"1-";
sStr += OUString::number( nMaxMSAutoEvaluate );
- sStr.AppendAscii(sEntryEnd);
+ sStr += sEntryEnd;
}
//collect up any other styles in the writer TOC which will
@@ -2267,34 +2264,34 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect )
{
if (WW8ListManager::nMaxLevel < nNoPgEnd)
nNoPgEnd = WW8ListManager::nMaxLevel;
- sStr.AppendAscii( "\\n " );
+ sStr += "\\n ";
sStr += OUString::number( nNoPgStt );
- sStr += '-';
+ sStr += "-";
sStr += OUString::number( nNoPgEnd );
- sStr += ' ';
+ sStr += " ";
}
if( bOnlyText )
{
- sStr.AppendAscii( "\\p \"" );
+ sStr += "\\p \"";
sStr += aFillTxt;
- sStr.AppendAscii(sEntryEnd);
+ sStr += sEntryEnd;
}
if( sTOption.Len() )
{
- sStr.AppendAscii( "\\t \"" );
+ sStr += "\\t \"";
sStr += sTOption;
- sStr.AppendAscii(sEntryEnd);
+ sStr += sEntryEnd;
}
if (lcl_IsHyperlinked(pTOX->GetTOXForm(), nTOXLvl))
- sStr.AppendAscii("\\h");
+ sStr += "\\h";
}
break;
}
}
- if( sStr.Len() )
+ if (!sStr.isEmpty())
{
GetExport( ).bInWriteTOX = true;
GetExport( ).OutputField( 0, eCode, sStr, WRITEFIELD_START | WRITEFIELD_CMD_START |
@@ -2493,10 +2490,8 @@ bool WW8AttributeOutput::PlaceholderField( const SwField* )
void WW8AttributeOutput::RefField( const SwField &rFld, const OUString &rRef)
{
- String sStr( FieldString( ww::eREF ) );
- sStr.AppendAscii( "\"" );
- sStr += rRef;
- sStr.AppendAscii( "\" " );
+ OUString sStr( FieldString( ww::eREF ) );
+ sStr += "\"" + rRef + "\" ";
m_rWW8Export.OutputField( &rFld, ww::eREF, sStr, WRITEFIELD_START |
WRITEFIELD_CMD_START | WRITEFIELD_CMD_END );
String sVar = lcl_GetExpandedField( rFld );
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index c738342..3c3ead8 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -1237,8 +1237,7 @@ OUString SwWW8ImplReader::GetMappedBookmark(const OUString &rOrigName)
// "ASK"
eF_ResT SwWW8ImplReader::Read_F_InputVar( WW8FieldDesc* pF, OUString& rStr )
{
- OUString sOrigName;
- String aQ;
+ OUString sOrigName, aQ;
String aDef;
WW8ReadFieldParams aReadParam( rStr );
for (;;)
@@ -1251,7 +1250,7 @@ eF_ResT SwWW8ImplReader::Read_F_InputVar( WW8FieldDesc* pF, OUString& rStr )
case -2:
if (sOrigName.isEmpty())
sOrigName = aReadParam.GetResult();
- else if( !aQ.Len() )
+ else if (aQ.isEmpty())
aQ = aReadParam.GetResult();
break;
case 'd':
@@ -1271,9 +1270,9 @@ eF_ResT SwWW8ImplReader::Read_F_InputVar( WW8FieldDesc* pF, OUString& rStr )
//available for aResult and aDef otherwise
if (aDef.Len())
{
- if (aQ.Len())
- aQ.AppendAscii(" - ");
- aQ.Append(aDef);
+ if (!aQ.isEmpty())
+ aQ += " - ";
+ aQ += aDef;
}
const long nNo = MapBookmarkVariables(pF, sOrigName, aResult);
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index e213d70..d10d63a 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -341,7 +341,7 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame(
if(aAssignment.getLength() > MM_PART_COUNTRY && !aAssignment[MM_PART_COUNTRY].isEmpty())
sCountryColumn = aAssignment[MM_PART_COUNTRY];
//
- String sHideParagraphsExpression;
+ OUString sHideParagraphsExpression;
SwAddressIterator aIter(aBlocks[0]);
while(aIter.HasMore())
{
@@ -363,13 +363,13 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame(
String sDB(sDBName);
sDB += sConvertedColumn;
- if(sHideParagraphsExpression.Len())
- sHideParagraphsExpression.AppendAscii(" AND ");
- sHideParagraphsExpression += '!';
- sHideParagraphsExpression += '[';
+ if (!sHideParagraphsExpression.isEmpty())
+ sHideParagraphsExpression += " AND ";
+ sHideParagraphsExpression += "!";
+ sHideParagraphsExpression += "[";
sHideParagraphsExpression += sDatabaseConditionPrefix;
sHideParagraphsExpression += sConvertedColumn;
- sHideParagraphsExpression += ']';
+ sHideParagraphsExpression += "]";
if( bSpecialReplacementForCountry && sCountryColumn == sConvertedColumn )
{
@@ -380,12 +380,12 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame(
sExpression = sDatabaseConditionPrefix;
sExpression.Insert('[', 0);
sExpression += sCountryColumn;
- sExpression.AppendAscii("]");
+ sExpression += "]";
- String sCondition(sExpression);
- sCondition.AppendAscii(" != \"");
- sCondition += String(rExcludeCountry);
- sCondition += '\"';
+ OUString sCondition(sExpression);
+ sCondition += " != \"";
+ sCondition += rExcludeCountry;
+ sCondition += "\"";
SwInsertFld_Data aData(TYP_CONDTXTFLD, 0, sCondition, sExpression, 0, &rShell );
aFldMgr.InsertFld( aData );
@@ -413,12 +413,12 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame(
SwInsertFld_Data aData(TYP_HIDDENPARAFLD, 0, sHideParagraphsExpression, aEmptyStr, 0, &rShell );
aFldMgr.InsertFld( aData );
}
- sHideParagraphsExpression.Erase();
+ sHideParagraphsExpression = "";
//now add a new paragraph
rShell.SplitNode();
}
}
- if(bHideEmptyParagraphs && sHideParagraphsExpression.Len())
+ if(bHideEmptyParagraphs && !sHideParagraphsExpression.isEmpty())
{
SwInsertFld_Data aData(TYP_HIDDENPARAFLD, 0, sHideParagraphsExpression, aEmptyStr, 0, &rShell );
aFldMgr.InsertFld( aData );
@@ -554,24 +554,24 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
if( nCurrent >= 0 && nCurrent < aEntries.getLength())
{
sGreeting = aEntries[nCurrent];
- String sCondition(sConditionBase);
+ OUString sCondition(sConditionBase);
String sHideParagraphsExpression;
switch(eGender)
{
case SwMailMergeConfigItem::FEMALE:
- sCondition.AppendAscii(" != \"");
- sCondition += String(rFemaleGenderValue);
- sCondition.AppendAscii("\" OR NOT ");
- sCondition += String(sNameColumnBase);
+ sCondition += " != \"";
+ sCondition += rFemaleGenderValue;
+ sCondition += "\" OR NOT ";
+ sCondition += sNameColumnBase;
sHideParagraphsExpression += '!';
sHideParagraphsExpression += sNameColumnBase;
break;
case SwMailMergeConfigItem::MALE:
- sCondition.AppendAscii(" == \"");
- sCondition += String(rFemaleGenderValue);
- sCondition.AppendAscii("\" OR NOT ");
- sCondition += String(sNameColumnBase);
+ sCondition += " == \"";
+ sCondition += rFemaleGenderValue;
+ sCondition += "\" OR NOT ";
+ sCondition += sNameColumnBase;
break;
case SwMailMergeConfigItem::NEUTRAL:
sCondition = sNameColumnBase;
@@ -580,11 +580,10 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
if(bHideEmptyParagraphs && sHideParagraphsExpression.Len())
{
- String sComplete( sCondition );
- sComplete.Insert('(', 0);
- sComplete.AppendAscii( ") OR (");
+ OUString sComplete( "(" + sCondition );
+ sComplete += ") OR (";
sComplete += sHideParagraphsExpression;
- sComplete += ')';
+ sComplete += ")";
SwInsertFld_Data aData(TYP_HIDDENPARAFLD, 0, sComplete, aEmptyStr, 0, &rShell );
aFldMgr.InsertFld( aData );
}
diff --git a/sw/source/ui/docvw/SidebarTxtControl.cxx b/sw/source/ui/docvw/SidebarTxtControl.cxx
index 1351f7b..4cdf95b 100644
--- a/sw/source/ui/docvw/SidebarTxtControl.cxx
+++ b/sw/source/ui/docvw/SidebarTxtControl.cxx
@@ -111,11 +111,10 @@ void SidebarTxtControl::RequestHelp(const HelpEvent &rEvt)
if ( nResId &&
mrDocView.GetWrtShell().GetContentAtPos( mrSidebarWin.GetAnchorPos(), aCntntAtPos ) )
{
- String sTxt;
- sTxt = SW_RESSTR( nResId );
- sTxt.AppendAscii( RTL_CONSTASCII_STRINGPARAM(": " ));
+ OUString sTxt(SW_RESSTR(nResId));
+ sTxt += ": ";
sTxt += aCntntAtPos.aFnd.pRedl->GetAuthorString();
- sTxt.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " - " ));
+ sTxt += " - ";
sTxt += GetAppLangDateTimeString( aCntntAtPos.aFnd.pRedl->GetTimeStamp() );
Help::ShowQuickHelp( this,PixelToLogic(Rectangle(rEvt.GetMousePosPixel(),Size(50,10))),sTxt);
}
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index 7027fce..c214c9f 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -425,16 +425,16 @@ void SwLabPage::DisplayFormat()
SETFLDVAL(aField, pRec->lHeight);
aField.Reformat();
- String aText = pRec->aType;
- aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": "));
+ OUString aText = pRec->aType;
+ aText += ": ";
aText += aWString;
- aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(" x "));
+ aText += " x ";
aText += aField.GetText();
- aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(" ("));
+ aText += " (";
aText += OUString::number( pRec->nCols );
- aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM(" x "));
+ aText += " x ";
aText += OUString::number( pRec->nRows );
- aText += ')';
+ aText += ")";
m_pFormatInfo->SetText(aText);
}
diff --git a/sw/source/ui/envelp/labelexp.cxx b/sw/source/ui/envelp/labelexp.cxx
index 716d950..e8b4b89 100644
--- a/sw/source/ui/envelp/labelexp.cxx
+++ b/sw/source/ui/envelp/labelexp.cxx
@@ -226,8 +226,8 @@ void SwLabDlg::UpdateFieldInformation(uno::Reference< frame::XModel > & xModel,
OUString uCntName( OUString::createFromAscii( SW_PROP_NAME_STR(UNO_NAME_CONTENT )));
for( const _SwLabItemMap* p = aArr; p->pName; ++p )
{
- String sCurFldName( sFldName );
- sCurFldName.AppendAscii( p->pName );
+ OUString sCurFldName( sFldName );
+ sCurFldName += OUString::createFromAscii(p->pName);
OUString uFldName( sCurFldName );
if( xFldMasters->hasByName( uFldName ))
{
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index d83c5a0..1db4506 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -3986,8 +3986,8 @@ SwAutoMarkDlg_Impl::SwAutoMarkDlg_Impl(Window* pParent, const String& rAutoMarkU
m_pEntriesBB->Show();
m_pOKPB->SetClickHdl(LINK(this, SwAutoMarkDlg_Impl, OkHdl));
- String sTitle = GetText();
- sTitle.AppendAscii( RTL_CONSTASCII_STRINGPARAM(": "));
+ OUString sTitle = GetText();
+ sTitle += ": ";
sTitle += sAutoMarkURL;
SetText(sTitle);
bool bError = false;
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 1ffbe4b..43d9be3 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -1383,8 +1383,8 @@ void SwTextShell::GetState( SfxItemSet &rSet )
String aLangText( aLanguageTag.getBcp47() );
// set word and locale to look up as status value
- String aStatusVal( aText );
- aStatusVal.AppendAscii( "#" );
+ OUString aStatusVal( aText );
+ aStatusVal += "#";
aStatusVal += aLangText;
rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index de31736..0120e01d1 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -346,10 +346,10 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, AddHdl)
IMPL_LINK_NOARG(SwAutoFormatDlg, RemoveHdl)
{
- String aMessage = aStrDelMsg ;
- aMessage.AppendAscii("\n\n");
+ OUString aMessage = aStrDelMsg ;
+ aMessage += "\n\n";
aMessage += m_pLbFormat->GetSelectEntry() ;
- aMessage += '\n';
+ aMessage += "\n";
MessBox* pBox = new MessBox( this, WinBits( WB_OK_CANCEL ),
aStrDelTitle, aMessage);
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index eedf54e..0e7acc6 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -1416,12 +1416,12 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
}
else
{
- String sStr;
+ OUString sStr;
if( rShell.IsCrsrInTbl() )
{
// table name + cell coordinate
sStr = rShell.GetTableFmt()->GetName();
- sStr += ':';
+ sStr += ":";
sStr += rShell.GetBoxNms();
}
else
@@ -1473,14 +1473,14 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
aSet.Get(RES_PARATR_NUMRULE)).GetValue();
if(rNumStyle.Len())
{
- if( sStr.Len() )
- sStr.AppendAscii(sStatusDelim);
+ if(!sStr.isEmpty())
+ sStr += sStatusDelim;
sStr += rNumStyle;
}
}
}
- if( sStr.Len() )
- sStr.AppendAscii(sStatusDelim);
+ if (!sStr.isEmpty())
+ sStr += sStatusDelim;
sStr += SW_RESSTR(STR_NUM_LEVEL);
sStr += OUString::number( nNumLevel + 1 );
@@ -1489,12 +1489,12 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
const int nOutlineLevel = rShell.GetCurrentParaOutlineLevel();
if( nOutlineLevel != 0 )
{
- if( sStr.Len() )
- sStr.AppendAscii(sStatusComma);
+ if (!sStr.isEmpty())
+ sStr += sStatusComma;
if( bOutlineNum )
{
sStr += SW_RESSTR(STR_OUTLINE_NUMBERING);
- sStr.AppendAscii(sStatusDelim);
+ sStr += sStatusDelim;
sStr += SW_RESSTR(STR_NUM_LEVEL);
}
else
@@ -1504,11 +1504,11 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
if( rShell.HasReadonlySel() )
{
- if( sStr.Len() )
- sStr = OUString(sStatusDelim) + sStr;
- sStr.Insert( SW_RESSTR(SW_STR_READONLY), 0 );
+ if (!sStr.isEmpty())
+ sStr = sStatusDelim + sStr;
+ sStr = SW_RESSTR(SW_STR_READONLY) + sStr;
}
- if( sStr.Len() )
+ if (!sStr.isEmpty())
rSet.Put( SfxStringItem( SID_TABLE_CELL, sStr ));
}
break;
diff --git a/tools/source/string/strascii.cxx b/tools/source/string/strascii.cxx
index 83cf85a..85cca27 100644
--- a/tools/source/string/strascii.cxx
+++ b/tools/source/string/strascii.cxx
@@ -32,21 +32,6 @@ static sal_Bool ImplDbgCheckAsciiStr( const sal_Char* pAsciiStr, sal_Int32 nLen
}
#endif
-static void ImplCopyAsciiStr( sal_Unicode* pDest, const sal_Char* pSrc,
- sal_Int32 nLen )
-{
- DBG_ASSERT( ImplDbgCheckAsciiStr( pSrc, nLen ),
- "UniString::CopyAsciiStr() - pAsciiStr include characters > 127" );
-
- while ( nLen )
- {
- *pDest = (unsigned char)*pSrc;
- ++pDest,
- ++pSrc,
- --nLen;
- }
-}
-
static sal_Int32 ImplStringCompareAscii( const sal_Unicode* pStr1, const sal_Char* pStr2,
xub_StrLen nCount )
{
@@ -63,77 +48,6 @@ static sal_Int32 ImplStringCompareAscii( const sal_Unicode* pStr1, const sal_Cha
return nRet;
}
-UniString& UniString::AppendAscii( const sal_Char* pAsciiStr )
-{
- DBG_CHKTHIS( UniString, DbgCheckUniString );
- DBG_ASSERT( pAsciiStr, "UniString::AppendAscii() - pAsciiStr is NULL" );
-
- // determine string length
- sal_Int32 nCopyLen = ImplStringLen( pAsciiStr );
-
- // detect overflow
- nCopyLen = ImplGetCopyLen( mpData->mnLen, nCopyLen );
-
- // If appended string is not empty
- if ( nCopyLen )
- {
- // Allocate new string
- UniStringData* pNewData = ImplAllocData( mpData->mnLen+nCopyLen );
-
- // copy string data
- memcpy( pNewData->maStr, mpData->maStr, mpData->mnLen*sizeof( sal_Unicode ) );
- ImplCopyAsciiStr( pNewData->maStr+mpData->mnLen, pAsciiStr, nCopyLen );
-
- // release old string
- STRING_RELEASE((STRING_TYPE *)mpData);
- mpData = pNewData;
- }
-
- return *this;
-}
-
-UniString& UniString::AppendAscii( const sal_Char* pAsciiStr, xub_StrLen nLen )
-{
- DBG_CHKTHIS( UniString, DbgCheckUniString );
- DBG_ASSERT( pAsciiStr, "UniString::AppendAscii() - 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::AppendAscii() : nLen is wrong" );
- }
- }
- }
-#endif
-
- // detect overflow
- sal_Int32 nCopyLen = ImplGetCopyLen( mpData->mnLen, nLen );
-
- // If appended string is not empty
- if ( nCopyLen )
- {
- // Allocate new string
- UniStringData* pNewData = ImplAllocData( mpData->mnLen+nCopyLen );
-
- // copy string data
- memcpy( pNewData->maStr, mpData->maStr, mpData->mnLen*sizeof( sal_Unicode ) );
- ImplCopyAsciiStr( pNewData->maStr+mpData->mnLen, pAsciiStr, nCopyLen );
-
- // release old string
- STRING_RELEASE((STRING_TYPE *)mpData);
- mpData = pNewData;
- }
-
- return *this;
-}
-
StringCompare UniString::CompareToAscii( const sal_Char* pAsciiStr,
xub_StrLen nLen ) const
{
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 95f88aa..963bce2 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -4675,14 +4675,14 @@ static int ImplMeasureItem( HWND hWnd, WPARAM wParam, LPARAM lParam )
HFONT hfntOld = (HFONT) SelectObject(hdc, (HFONT) CreateFontIndirect( &ncm.lfMenuFont ));
// menu text and accelerator
- String aStr(pSalMenuItem->mText);
+ OUString aStr(pSalMenuItem->mText);
if( pSalMenuItem->mAccelText.getLength() )
{
- aStr.AppendAscii(" ");
- aStr.Append( pSalMenuItem->mAccelText );
+ aStr += " ";
+ aStr += pSalMenuItem->mAccelText;
}
- GetTextExtentPoint32W( hdc, (LPWSTR) aStr.GetBuffer(),
- aStr.Len(), &strSize );
+ GetTextExtentPoint32W( hdc, (LPWSTR) aStr.getStr(),
+ aStr.getLength(), &strSize );
// image
Size bmpSize( 16, 16 );
More information about the Libreoffice-commits
mailing list