diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-14 09:54:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-14 11:54:59 +0100 |
commit | 7e7a487e904143cbc282a2b90c4cb3918bfa151f (patch) | |
tree | a3091c70d009ea75dd54c35540759aaec748fa91 /sw/source/filter | |
parent | be1ce88b8e5e06947e93146a052b0ba2c64dc479 (diff) |
Related: fdo#38838 remove UniString::AppendAscii
Change-Id: I0f929843d73eb445c8b1aa56d59cbbce844b9008
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/html/htmlfld.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/htmlform.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 25 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8gr.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 79 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 11 |
8 files changed, 67 insertions, 81 deletions
diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index 8924c24b804c..e2fd2026709d 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 d0396248fb96..39a7c21cca82 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 6436ae0f9484..d4fbec0bc504 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 cf056e983bb1..6bd4112e2a39 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 4b56a712abd6..156a9bd4a4a1 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 5d703fe9f83b..f618cb6054a6 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 85a0aa14de3e..39a198184f74 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 c73834210d07..3c3ead8b3483 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); |