summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-08 10:06:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-08 14:05:58 +0100
commit832e5aadbff006ec24959162c29756fe2b1982be (patch)
tree9c258056fec29b0defaf012f8cb0945efed2b2e0 /sw/source/filter
parentc811c0706f0ecf3400e8fcc510ca283dd593237f (diff)
Related: fdo#38838 remove UniString::SearchAndReplaceAll
Change-Id: I093c95b8700b628375d69293022f7d4b8da2af9c
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/ascii/ascatr.cxx6
-rw-r--r--sw/source/filter/html/wrthtml.cxx13
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx17
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx2
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx12
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx5
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx10
7 files changed, 29 insertions, 36 deletions
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index 87a4000c8a28..17f798352263 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -165,9 +165,9 @@ static Writer& OutASC_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
}
}
- String aStr( rNd.GetTxt() );
+ OUString aStr( rNd.GetTxt() );
if( rWrt.bASCII_ParaAsBlanc )
- aStr.SearchAndReplaceAll( 0x0A, ' ' );
+ aStr = aStr.replace(0x0A, ' ');
const bool bExportSoftHyphens = RTL_TEXTENCODING_UCS2 == rWrt.GetAsciiOptions().GetCharSet() ||
RTL_TEXTENCODING_UTF8 == rWrt.GetAsciiOptions().GetCharSet();
@@ -180,7 +180,7 @@ static Writer& OutASC_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
if( !aAttrIter.OutAttr( nStrPos ))
{
- String aOutStr( aStr.Copy( nStrPos, nNextAttr - nStrPos ) );
+ String aOutStr( aStr.copy( nStrPos, nNextAttr - nStrPos ) );
if ( !bExportSoftHyphens )
aOutStr = comphelper::string::remove(aOutStr, CHAR_SOFTHYPHEN);
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index cf13747803a9..a2f8a6851b0f 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -1059,9 +1059,8 @@ void SwHTMLWriter::OutBookmarks()
while( nPos < aOutlineMarkPoss.size() && aOutlineMarkPoss[nPos] == nNode )
{
- String sMark( aOutlineMarks[nPos] );
- sMark.SearchAndReplaceAll( '?', '_' ); // '?' causes problems in IE/Netscape 5
- OutAnchor( sMark );
+ OUString sMark( aOutlineMarks[nPos] );
+ OutAnchor( sMark.replace('?', '_') ); // '?' causes problems in IE/Netscape 5
aOutlineMarkPoss.erase( aOutlineMarkPoss.begin()+nPos );
aOutlineMarks.erase( aOutlineMarks.begin() + nPos );
}
@@ -1072,13 +1071,11 @@ void SwHTMLWriter::OutImplicitMark( const String& rMark,
{
if( rMark.Len() && !aImplicitMarks.empty() )
{
- String sMark( rMark );
- sMark.Append( cMarkSeparator );
- sMark.AppendAscii( pMarkType );
+ OUString sMark( rMark );
+ sMark + OUString(cMarkSeparator) + OUString::createFromAscii(pMarkType);
if( 0 != aImplicitMarks.erase( sMark ) )
{
- sMark.SearchAndReplaceAll( '?', '_' ); // '?' causes problems in IE/Netscape 5
- OutAnchor( sMark );
+ OutAnchor(sMark.replace('?', '_')); // '?' causes problems in IE/Netscape 5
}
}
}
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 1940fa2de26f..1bcedd3f8cce 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -890,9 +890,9 @@ void DocxAttributeOutput::StartField_Impl( FieldInfos& rInfos, bool bWriteRun )
}
}
-void DocxAttributeOutput::DoWriteCmd( String& rCmd )
+void DocxAttributeOutput::DoWriteCmd( const OUString& rCmd )
{
- OUString sCmd = OUString(rCmd).trim();
+ OUString sCmd = rCmd.trim();
if (sCmd.startsWith("SEQ"))
{
OUString sSeqName = msfilter::util::findQuotedText(sCmd, "SEQ ", '\\').trim();
@@ -900,7 +900,7 @@ void DocxAttributeOutput::DoWriteCmd( String& rCmd )
}
// Write the Field command
m_pSerializer->startElementNS( XML_w, XML_instrText, FSEND );
- m_pSerializer->writeEscaped( OUString( rCmd ) );
+ m_pSerializer->writeEscaped( rCmd );
m_pSerializer->endElementNS( XML_w, XML_instrText );
}
@@ -912,15 +912,15 @@ void DocxAttributeOutput::CmdField_Impl( FieldInfos& rInfos )
for ( xub_StrLen i = 0; i < nNbToken; i++ )
{
- String sToken = rInfos.sCmd.GetToken( i, '\t' );
+ OUString sToken = rInfos.sCmd.GetToken( i, '\t' );
if ( rInfos.eType == ww::eCREATEDATE
|| rInfos.eType == ww::eSAVEDATE
|| rInfos.eType == ww::ePRINTDATE
|| rInfos.eType == ww::eDATE
|| rInfos.eType == ww::eTIME )
{
- sToken.SearchAndReplaceAll( String( "NNNN" ), String( "dddd" ) );
- sToken.SearchAndReplaceAll( String( "NN" ), String( "ddd" ) );
+ sToken = sToken.replaceAll("NNNN", "dddd");
+ sToken = sToken.replaceAll("NN", "ddd");
}
// Write the Field command
DoWriteCmd( sToken );
@@ -963,10 +963,9 @@ void DocxAttributeOutput::EndField_Impl( FieldInfos& rInfos )
// Write the Field latest value
m_pSerializer->startElementNS( XML_w, XML_r, FSEND );
- String sExpand( rInfos.pField->ExpandField( true ) );
+ OUString sExpand( rInfos.pField->ExpandField( true ) );
// newlines embedded in fields are 0x0B in MSO and 0x0A for us
- sExpand.SearchAndReplaceAll( 0x0A, 0x0B );
- RunText( sExpand );
+ RunText(sExpand.replace(0x0A, 0x0B));
m_pSerializer->endElementNS( XML_w, XML_r );
}
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 54d3c79558dd..16f17b7d5610 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -631,7 +631,7 @@ private:
void WriteCommentRanges();
void StartField_Impl( FieldInfos& rInfos, bool bWriteRun = sal_False );
- void DoWriteCmd( String& rCmd );
+ void DoWriteCmd( const OUString& rCmd );
void CmdField_Impl( FieldInfos& rInfos );
void EndField_Impl( FieldInfos& rInfos );
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 5fce527fcf49..a7d97a1ec497 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1397,16 +1397,16 @@ because word doesn't have the feature
String SwWW8AttrIter::GetSnippet(const String &rStr, xub_StrLen nAktPos,
xub_StrLen nLen) const
{
- String aSnippet(rStr, nAktPos, nLen);
if (!nLen)
- return aSnippet;
+ return OUString();
+ OUString aSnippet(rStr.Copy(nAktPos, nLen));
// 0x0a ( Hard Line Break ) -> 0x0b
// 0xad ( soft hyphen ) -> 0x1f
// 0x2011 ( hard hyphen ) -> 0x1e
- aSnippet.SearchAndReplaceAll(0x0A, 0x0B);
- aSnippet.SearchAndReplaceAll(CHAR_HARDHYPHEN, 0x1e);
- aSnippet.SearchAndReplaceAll(CHAR_SOFTHYPHEN, 0x1f);
+ aSnippet = aSnippet.replace(0x0A, 0x0B);
+ aSnippet = aSnippet.replace(CHAR_HARDHYPHEN, 0x1e);
+ aSnippet = aSnippet.replace(CHAR_SOFTHYPHEN, 0x1f);
m_rExport.m_aCurrentCharPropStarts.push( nAktPos );
const SfxPoolItem &rItem = GetItem(RES_CHRATR_CASEMAP);
@@ -1444,7 +1444,7 @@ String SwWW8AttrIter::GetSnippet(const String &rStr, xub_StrLen nAktPos,
rStr, nAktPos, g_pBreakIt->GetLocale(nLanguage),
i18n::WordType::ANYWORD_IGNOREWHITESPACES ) )
{
- aSnippet.SetChar(0, rStr.GetChar(nAktPos));
+ aSnippet = OUString(rStr.GetChar(nAktPos)) + aSnippet.copy(1);
}
}
m_rExport.m_aCurrentCharPropStarts.pop();
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 969b2b37388a..cf954bff5a3d 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -2087,9 +2087,8 @@ bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp,
rWrt.WriteOutliner(*rAtn.mpRichText, nTTyp);
else
{
- String sTxt(rAtn.msSimpleText);
- sTxt.SearchAndReplaceAll(0x0A, 0x0B);
- rWrt.WriteStringAsPara( sTxt );
+ OUString sTxt(rAtn.msSimpleText);
+ rWrt.WriteStringAsPara(sTxt.replace(0x0A, 0x0B));
}
}
break;
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index dc3117a2dc0d..2d2c48ace377 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1734,12 +1734,10 @@ static void InsertSpecialChar( WW8Export& rWrt, sal_uInt8 c,
static String lcl_GetExpandedField(const SwField &rFld)
{
- String sRet(rFld.ExpandField(true));
+ OUString sRet(rFld.ExpandField(true));
//replace LF 0x0A with VT 0x0B
- sRet.SearchAndReplaceAll(0x0A, 0x0B);
-
- return sRet;
+ return sRet.replace(0x0A, 0x0B);
}
WW8_WrPlcFld* WW8Export::CurrentFieldPlc() const
@@ -2405,10 +2403,10 @@ OUString FieldString(ww::eField eIndex)
void WW8AttributeOutput::HiddenField( const SwField& rFld )
{
- String sExpand(rFld.GetPar2());
+ OUString sExpand(rFld.GetPar2());
//replace LF 0x0A with VT 0x0B
- sExpand.SearchAndReplaceAll(0x0A, 0x0B);
+ sExpand = sExpand.replace(0x0A, 0x0B);
m_rWW8Export.pChpPlc->AppendFkpEntry(m_rWW8Export.Strm().Tell());
if (m_rWW8Export.IsUnicode())
{