diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-09-23 07:19:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-25 19:24:23 +0200 |
commit | 98de5b40c8a3fd4e57477b6d994e3b1472207f71 (patch) | |
tree | 567fdbbaecbddbfc19f28a08da5d1f6d5207748c /sw/source/filter | |
parent | 0552a91acde9dce28c0d92c552d21fbadfcb9184 (diff) |
Related: fdo#38838 remove UniString::EqualsIgnoreCaseAscii
Change-Id: Ib5c3a2daa4a48bc286b14fa2cebb3306ea0012bc
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/html/htmlcss1.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfld.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/htmlsect.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 23 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.hxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww1/w1filter.cxx | 59 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8glsy.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8glsy.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par4.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 61 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.hxx | 6 |
14 files changed, 104 insertions, 106 deletions
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index ebef8fface75..0254957df955 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -1778,7 +1778,8 @@ void SwHTMLParser::InsertLink() } else { - String sRel, sHRef, sType; + OUString sRel; + String sHRef, sType; const HTMLOptions& rOptions2 = GetOptions(); for (size_t i = rOptions2.size(); i; ) @@ -1798,7 +1799,7 @@ void SwHTMLParser::InsertLink() } } - if( sHRef.Len() && sRel.EqualsIgnoreCaseAscii( "STYLESHEET" ) && + if( sHRef.Len() && sRel.equalsIgnoreAsciiCase( "STYLESHEET" ) && ( !sType.Len() || sType.GetToken(0,';').EqualsAscii(sCSS_mimetype) ) ) { diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index 554dda044ab8..8924c24b804c 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -191,12 +191,12 @@ static HTMLOptionEnum aHTMLFileNameFldFmtTable[] = }; -sal_uInt16 SwHTMLParser::GetNumType( const String& rStr, sal_uInt16 nDfltType ) +sal_uInt16 SwHTMLParser::GetNumType( const OUString& rStr, sal_uInt16 nDfltType ) { sal_uInt16 nType = nDfltType; const HTMLOptionEnum *pOptEnums = aHTMLPageNumFldFmtTable; while( pOptEnums->pName ) - if( !rStr.EqualsIgnoreCaseAscii( pOptEnums->pName ) ) + if( !rStr.equalsIgnoreAsciiCaseAscii( pOptEnums->pName ) ) pOptEnums++; else break; @@ -352,10 +352,10 @@ void SwHTMLParser::NewField() SvNumberFormatter *pFormatter = pDoc->GetNumberFormatter(); if( pFmtOption ) { - const String& rFmt = pFmtOption->GetString(); + const OUString& rFmt = pFmtOption->GetString(); for( sal_uInt16 k = 0; pFmtTbl[k].pName; k++ ) { - if( rFmt.EqualsIgnoreCaseAscii( pFmtTbl[k].pName ) ) + if( rFmt.equalsIgnoreAsciiCaseAscii( pFmtTbl[k].pName ) ) { nNumFmt = pFormatter->GetFormatIndex( pFmtTbl[k].eFmt, LANGUAGE_SYSTEM); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index f30669adc309..fe22a33499ba 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -92,18 +92,18 @@ HTMLOptionEnum aHTMLImgVAlignTable[] = { 0, 0 } }; -ImageMap *SwHTMLParser::FindImageMap( const String& rName ) const +ImageMap *SwHTMLParser::FindImageMap( const OUString& rName ) const { ImageMap *pMap = 0; - OSL_ENSURE( rName.GetChar(0) != '#', "FindImageName: Name beginnt mit #!" ); + OSL_ENSURE( rName[0] != '#', "FindImageName: Name beginnt mit #!" ); if( pImageMaps ) { for( sal_uInt16 i=0; i<pImageMaps->size(); i++ ) { ImageMap *pIMap = &(*pImageMaps)[i]; - if( rName.EqualsIgnoreCaseAscii( pIMap->GetName() ) ) + if( rName.equalsIgnoreAsciiCase( pIMap->GetName() ) ) { pMap = pIMap; break; diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 3a6eae63bbeb..bb4cce1d7a42 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -102,10 +102,10 @@ void SwHTMLParser::NewDivision( int nToken ) break; case HTML_O_TYPE: { - const String& rType = rOption.GetString(); - if( rType.EqualsIgnoreCaseAscii( "HEADER" ) ) + const OUString& rType = rOption.GetString(); + if( rType.equalsIgnoreAsciiCase( "HEADER" ) ) bHeader = sal_True; - else if( rType.EqualsIgnoreCaseAscii( "FOOTER" ) ) + else if( rType.equalsIgnoreAsciiCase( "FOOTER" ) ) bFooter = sal_True; } } diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index b27eedaa3f4a..8a1e91e17a3f 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -5097,15 +5097,15 @@ void SwHTMLParser::InsertLineBreak() { case HTML_O_CLEAR: { - const String &aClear = rOption.GetString(); - if( aClear.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_AL_all ) ) + const OUString &rClear = rOption.GetString(); + if( rClear.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_AL_all ) ) { bClearLeft = sal_True; bClearRight = sal_True; } - else if( aClear.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_AL_left ) ) + else if( rClear.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_AL_left ) ) bClearLeft = sal_True; - else if( aClear.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_AL_right ) ) + else if( rClear.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_AL_right ) ) bClearRight = sal_True; } break; @@ -5386,8 +5386,7 @@ void SwHTMLParser::InsertHorzRule() void SwHTMLParser::ParseMoreMetaOptions() { - String aName; - OUString aContent; + OUString aName, aContent; sal_Bool bHTTPEquiv = sal_False; const HTMLOptions& rHTMLOptions = GetOptions(); @@ -5414,22 +5413,22 @@ void SwHTMLParser::ParseMoreMetaOptions() // nicht geaendert wurde. Deshalb genuegt es, auf Generator und // auf refresh abzufragen, um noch nicht verarbeitete Token zu finden, // denn das sind die einzigen, die die Dok-Info nicht modifizieren. - if( aName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_generator ) || - aName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_refresh ) || - aName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_content_type ) || - aName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_content_script_type ) ) + if( aName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_META_generator ) || + aName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_META_refresh ) || + aName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_META_content_type ) || + aName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_META_content_script_type ) ) return; aContent = comphelper::string::remove(aContent, '\r'); aContent = comphelper::string::remove(aContent, '\n'); - if( aName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_sdendnote ) ) + if( aName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_META_sdendnote ) ) { FillEndNoteInfo( aContent ); return; } - if( aName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_sdfootnote ) ) + if( aName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_META_sdfootnote ) ) { FillFootNoteInfo( aContent ); return; diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index f2f1147803b9..f345fa6a216b 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -650,7 +650,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient // <SDFIELD> public: - static sal_uInt16 GetNumType( const String& rStr, sal_uInt16 eDfltType ); + static sal_uInt16 GetNumType( const OUString& rStr, sal_uInt16 eDfltType ); private: void NewField(); void EndField(); @@ -662,7 +662,7 @@ private: // Einfuegen von Grafiken, Plugins und Applets // Image-Maps suchen und mit Grafik-Nodes verbinden - ImageMap *FindImageMap( const String& rURL ) const; + ImageMap *FindImageMap( const OUString& rURL ) const; void ConnectImageMaps(); // Verankerung eines Fly-Frames bestimmen und entsprechende Attribute diff --git a/sw/source/filter/ww1/w1filter.cxx b/sw/source/filter/ww1/w1filter.cxx index 9e5d56dcb32c..00d32aa3e3a3 100644 --- a/sw/source/filter/ww1/w1filter.cxx +++ b/sw/source/filter/ww1/w1filter.cxx @@ -316,12 +316,12 @@ void Ww1Bookmarks::Out(Ww1Shell& rOut, Ww1Manager& rMan, sal_uInt16) return; } - const String & rName = GetName(); - if( rName.EqualsAscii( "_Toc", 0, 4 ) ) // "_Toc*" ist ueberfluessig + const OUString & rName = GetName(); + if( rName.startsWith( "_Toc" ) ) // "_Toc*" ist ueberfluessig return; if( rOut.IsFlagSet( SwFltControlStack::HYPO ) - && rName.EqualsIgnoreCaseAscii( "FORMULAR" ) ) + && rName.equalsIgnoreAsciiCase( "FORMULAR" ) ) rOut.SetProtect(); // Fuer UEbersetzung Bookmark -> Variable setzen @@ -910,15 +910,16 @@ oncemore: } if( pDot ) { - String sExt; + OUStringBuffer sBuf; while( *pDot != '\0' && *pDot != ' ') - sExt += *pDot++; - - if( sExt.EqualsIgnoreCaseAscii( ".tiff" ) - || sExt.EqualsIgnoreCaseAscii( ".bmp" ) - || sExt.EqualsIgnoreCaseAscii( ".gif" ) - || sExt.EqualsIgnoreCaseAscii( ".pcx" ) - || sExt.EqualsIgnoreCaseAscii( ".pic" )) + sBuf.append(*pDot++); + OUString sExt = sBuf.makeStringAndClear(); + + if( sExt.equalsIgnoreAsciiCase( ".tiff" ) + || sExt.equalsIgnoreAsciiCase( ".bmp" ) + || sExt.equalsIgnoreAsciiCase( ".gif" ) + || sExt.equalsIgnoreAsciiCase( ".pcx" ) + || sExt.equalsIgnoreAsciiCase( ".pic" )) rOut.AddGraphic( sName ); else bKnown = false; @@ -1313,7 +1314,7 @@ SvxFontItem Ww1Fonts::GetFont(sal_uInt16 nFCode) { // erzeugen eine fonts im sw-sinne aus den word-strukturen FontFamily eFamily = FAMILY_DONTKNOW; - String aName; + OUString aName; FontPitch ePitch = PITCH_DONTKNOW; rtl_TextEncoding eCharSet = RTL_TEXTENCODING_DONTKNOW; switch (nFCode) @@ -1323,18 +1324,18 @@ SvxFontItem Ww1Fonts::GetFont(sal_uInt16 nFCode) // "Symbol", and "Helv" case 0: eFamily = FAMILY_ROMAN; - aName.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Tms Rmn" )); + aName = "Tms Rmn"; ePitch = PITCH_VARIABLE; eCharSet = RTL_TEXTENCODING_MS_1252; break; case 1: - aName.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Symbol" )); + aName = "Symbol"; ePitch = PITCH_VARIABLE; eCharSet = RTL_TEXTENCODING_SYMBOL; break; case 2: eFamily = FAMILY_SWISS; - aName.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Helv" )); + aName = "Helv"; ePitch = PITCH_VARIABLE; eCharSet = RTL_TEXTENCODING_MS_1252; break; @@ -1354,10 +1355,10 @@ SvxFontItem Ww1Fonts::GetFont(sal_uInt16 nFCode) ePitch = ePitchA[pF->prgGet()]; // CharSet ........................................... eCharSet = RTL_TEXTENCODING_MS_1252; - if (aName.EqualsIgnoreCaseAscii("Symbol") - || aName.EqualsIgnoreCaseAscii("Symbol Set") - || aName.EqualsIgnoreCaseAscii("Wingdings") - || aName.EqualsIgnoreCaseAscii("ITC Zapf Dingbats") ) + if (aName.equalsIgnoreAsciiCase("Symbol") + || aName.equalsIgnoreAsciiCase("Symbol Set") + || aName.equalsIgnoreAsciiCase("Wingdings") + || aName.equalsIgnoreAsciiCase("ITC Zapf Dingbats") ) eCharSet = RTL_TEXTENCODING_SYMBOL; // FontFamily ........................................ sal_uInt16 b = pF->ffGet(); @@ -1373,7 +1374,7 @@ SvxFontItem Ww1Fonts::GetFont(sal_uInt16 nFCode) { OSL_ENSURE(false, "WW1Fonts::GetFont: Nicht existenter Font !"); eFamily = FAMILY_SWISS; - aName.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Helv" )); + aName = "Helv"; ePitch = PITCH_VARIABLE; eCharSet = RTL_TEXTENCODING_MS_1252; } @@ -1382,10 +1383,10 @@ SvxFontItem Ww1Fonts::GetFont(sal_uInt16 nFCode) } // Extrawurst Hypo if ( SwFltGetFlag( nFieldFlags, SwFltControlStack::HYPO ) - && ( aName.EqualsIgnoreCaseAscii("Helv") - || aName.EqualsIgnoreCaseAscii("Helvetica") ) ) + && ( aName.equalsIgnoreAsciiCase("Helv") + || aName.equalsIgnoreAsciiCase("Helvetica") ) ) { - aName.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Helvetica Neue" )); + aName = "Helvetica Neue"; if (eFamily==FAMILY_DONTKNOW) eFamily = FAMILY_SWISS; } @@ -1397,21 +1398,21 @@ SvxFontItem Ww1Fonts::GetFont(sal_uInt16 nFCode) // Nach TH sollen diese durch feste Werte ersetzt werden, // also nicht ueber System::GetStandardFont, damit keine // Namenslisten auftauchen ( Dieses koennte den User verwirren ) - if( aName.EqualsIgnoreCaseAscii("Helv")) + if( aName.equalsIgnoreAsciiCase("Helv")) { - aName.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Helvetica" )); + aName = "Helvetica"; if (eFamily==FAMILY_DONTKNOW) eFamily = FAMILY_SWISS; } - else if (aName.EqualsIgnoreCaseAscii("Tms Rmn")) + else if (aName.equalsIgnoreAsciiCase("Tms Rmn")) { - aName.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Times New Roman" )); + aName = "Times New Roman"; if (eFamily==FAMILY_DONTKNOW) eFamily = FAMILY_ROMAN; } - else if (aName.EqualsIgnoreCaseAscii("System Monospaced") ) + else if (aName.equalsIgnoreAsciiCase("System Monospaced") ) { - aName.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Courier" )); + aName = "Courier"; ePitch = PITCH_FIXED; } } diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx index 07210dc1829b..f5d523e128ac 100644 --- a/sw/source/filter/ww8/ww8glsy.cxx +++ b/sw/source/filter/ww8/ww8glsy.cxx @@ -79,7 +79,7 @@ bool WW8Glossary::HasBareGraphicEnd(SwDoc *pDoc,SwNodeIndex &rIdx) } bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, - bool bSaveRelFile, const std::vector<String>& rStrings, + bool bSaveRelFile, const std::vector<OUString>& rStrings, const std::vector<ww::bytes>& rExtra) { // this code will be called after reading all text into the @@ -147,7 +147,7 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, if(n != 0xFFFF) { rBlocks.ClearDoc(); - const String &rLNm = rStrings[nGlosEntry]; + const OUString &rLNm = rStrings[nGlosEntry]; String sShortcut = rLNm; @@ -195,7 +195,7 @@ bool WW8Glossary::Load( SwTextBlocks &rBlocks, bool bSaveRelFile ) if (pGlossary && pGlossary->IsGlossaryFib() && rBlocks.StartPutMuchBlockEntries()) { //read the names of the autotext entries - std::vector<String> aStrings; + std::vector<OUString> aStrings; std::vector<ww::bytes> aData; rtl_TextEncoding eStructCharSet = diff --git a/sw/source/filter/ww8/ww8glsy.hxx b/sw/source/filter/ww8/ww8glsy.hxx index f6b7cbe37466..1764ce4cd63b 100644 --- a/sw/source/filter/ww8/ww8glsy.hxx +++ b/sw/source/filter/ww8/ww8glsy.hxx @@ -70,7 +70,7 @@ private: sal_uInt16 nStrings; bool MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, bool bSaveRelFile, - const ::std::vector<String>& rStrings, + const ::std::vector<OUString>& rStrings, const ::std::vector<ww::bytes>& rExtra); bool HasBareGraphicEnd(SwDoc *pD,SwNodeIndex &rIdx); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 108bbccfe57e..53254a438e30 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4222,7 +4222,7 @@ void SwWW8ImplReader::StoreMacroCmds() void SwWW8ImplReader::ReadDocVars() { - std::vector<String> aDocVarStrings; + std::vector<OUString> aDocVarStrings; std::vector<ww::bytes> aDocVarStringIds; std::vector<String> aDocValueStrings; WW8ReadSTTBF(!bVer67, *pTableStream, pWwFib->fcStwUser, @@ -4243,11 +4243,11 @@ void SwWW8ImplReader::ReadDocVars() for(size_t i=0; i<aDocVarStrings.size(); i++) { uno::Any aDefaultValue; - OUString name(aDocVarStrings[i]); + const OUString &rName = aDocVarStrings[i]; uno::Any aValue; aValue <<= OUString(aDocValueStrings[i]); try { - xUserDefinedProps->addProperty( name, + xUserDefinedProps->addProperty( rName, beans::PropertyAttribute::REMOVABLE, aValue ); } catch (const uno::Exception &) { @@ -4528,8 +4528,8 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) pWwFib->lcbSttbfRMark, rDoc ); } - // M.M. Initialize our String/ID map for Linked Sections - std::vector<String> aLinkStrings; + // Initialize our String/ID map for Linked Sections + std::vector<OUString> aLinkStrings; std::vector<ww::bytes> aStringIds; WW8ReadSTTBF(!bVer67, *pTableStream, pWwFib->fcSttbFnm, @@ -5543,7 +5543,7 @@ int SwWW8ImplReader::GetAnnotationIndex(sal_uInt32 nTag) if (!mpAtnIndexes.get() && pWwFib->lcbSttbfAtnbkmk) { mpAtnIndexes.reset(new std::map<sal_uInt32, int>()); - std::vector<String> aStrings; + std::vector<OUString> aStrings; std::vector<ww::bytes> aEntries; WW8ReadSTTBF(!bVer67, *pTableStream, pWwFib->fcSttbfAtnbkmk, pWwFib->lcbSttbfAtnbkmk, sizeof(struct WW8_ATNBE), eStructCharSet, aStrings, &aEntries); for (size_t i = 0; i < aStrings.size() && i < aEntries.size(); ++i) diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index 7aa31b67d17d..f92e3e6ca308 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -449,7 +449,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, void SwWW8ImplReader::ReadRevMarkAuthorStrTabl( SvStream& rStrm, sal_Int32 nTblPos, sal_Int32 nTblSiz, SwDoc& rDocOut ) { - ::std::vector<String> aAuthorNames; + ::std::vector<OUString> aAuthorNames; WW8ReadSTTBF( !bVer67, rStrm, nTblPos, nTblSiz, bVer67 ? 2 : 0, eStructCharSet, aAuthorNames ); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index e736f99b8cb9..885066683274 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -314,10 +314,10 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*) } //"_Toc*" and "_Hlt*" are unnecessary - const String* pName = pB->GetName(); + const OUString* pName = pB->GetName(); #if !defined(WW_NATIVE_TOC) - if( !pName || pName->EqualsIgnoreCaseAscii( "_Toc", 0, 4 ) - || pName->EqualsIgnoreCaseAscii( "_Hlt", 0, 4 ) ) + if( !pName || pName->startsWithIgnoreAsciiCase( "_Toc" ) + || pName->startsWithIgnoreAsciiCase( "_Hlt" ) ) return 0; #endif @@ -504,37 +504,34 @@ String FindPara( const String& rStr, sal_Unicode cToken, sal_Unicode cToken2 ) } -static SvxExtNumType GetNumTypeFromName(const String& rStr, +static SvxExtNumType GetNumTypeFromName(const OUString& rStr, bool bAllowPageDesc = false) { SvxExtNumType eTyp = bAllowPageDesc ? SVX_NUM_PAGEDESC : SVX_NUM_ARABIC; - if( rStr.EqualsIgnoreCaseAscii( "Arabi", 0, 5 ) ) // Arabisch, Arabic + if( rStr.startsWithIgnoreAsciiCase( "Arabi" ) ) // Arabisch, Arabic eTyp = SVX_NUM_ARABIC; - else if( rStr.EqualsAscii( "misch", 2, 5 ) ) // r"omisch + else if( rStr.startsWith( "misch" ) ) // r"omisch eTyp = SVX_NUM_ROMAN_LOWER; - else if( rStr.EqualsAscii( "MISCH", 2, 5 ) ) // R"OMISCH + else if( rStr.startsWith( "MISCH" ) ) // R"OMISCH eTyp = SVX_NUM_ROMAN_UPPER; - else if( rStr.EqualsIgnoreCaseAscii( "alphabeti", 0, 9 ) )// alphabetisch, alphabetic - eTyp = ( rStr.GetChar( 0 ) == 'A' ) + else if( rStr.startsWithIgnoreAsciiCase( "alphabeti" ) )// alphabetisch, alphabetic + eTyp = ( rStr[0] == 'A' ) ? SVX_NUM_CHARS_UPPER_LETTER_N : SVX_NUM_CHARS_LOWER_LETTER_N; - else if( rStr.EqualsIgnoreCaseAscii( "roman", 0, 5 ) ) // us - eTyp = ( rStr.GetChar( 0 ) == 'R' ) + else if( rStr.startsWithIgnoreAsciiCase( "roman" ) ) // us + eTyp = ( rStr[0] == 'R' ) ? SVX_NUM_ROMAN_UPPER : SVX_NUM_ROMAN_LOWER; return eTyp; } -static SvxExtNumType GetNumberPara(OUString& rStr, bool bAllowPageDesc = false) +static SvxExtNumType GetNumberPara(const OUString& rStr, bool bAllowPageDesc = false) { OUString s( FindPara( rStr, '*', '*' ) ); // Ziffernart SvxExtNumType aType = GetNumTypeFromName( s, bAllowPageDesc ); return aType; } - - - bool SwWW8ImplReader::ForceFieldLanguage(SwField &rFld, sal_uInt16 nLang) { bool bRet(false); @@ -2254,10 +2251,10 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, OUString& rStr ) //helper function //For MS MacroButton field, the symbol in plain text is always "(" (0x28), //which should be mapped according to the macro type -bool ConvertMacroSymbol( const String& rName, String& rReference ) +bool ConvertMacroSymbol( const String& rName, OUString& rReference ) { bool bConverted = false; - if( rReference.EqualsAscii( "(" ) ) + if( rReference == "(" ) { bConverted = true; sal_Unicode cSymbol = sal_Unicode(); // silence false warning @@ -2272,7 +2269,7 @@ bool ConvertMacroSymbol( const String& rName, String& rReference ) bConverted = false; if( bConverted ) - rReference = cSymbol; + rReference = OUString(cSymbol); } return bConverted; } @@ -2282,7 +2279,7 @@ bool ConvertMacroSymbol( const String& rName, String& rReference ) eF_ResT SwWW8ImplReader::Read_F_Macro( WW8FieldDesc*, OUString& rStr) { OUString aName; - String aVText; + OUString aVText; bool bNewVText = true; bool bBracket = false; WW8ReadFieldParams aReadParam( rStr ); @@ -2299,20 +2296,20 @@ eF_ResT SwWW8ImplReader::Read_F_Macro( WW8FieldDesc*, OUString& rStr) case -2: if( aName.isEmpty() ) aName = aReadParam.GetResult(); - else if( !aVText.Len() || bBracket ) + else if( aVText.isEmpty() || bBracket ) { nOffset = aReadParam.GetTokenSttPtr() + 1; if( bBracket ) - aVText += ' '; + aVText += " "; aVText += aReadParam.GetResult(); if (bNewVText) { - bBracket = aVText.EqualsIgnoreCaseAscii(OUString('['), 0, 1) + bBracket = (aVText[0] == '[') ? true : false; bNewVText = false; } - else if( aVText.GetChar( aVText.Len()-1 ) == ']' ) + else if( aVText[aVText.getLength()-1] == ']' ) bBracket = false; } break; @@ -2726,20 +2723,20 @@ void SwWW8ImplReader::Read_SubF_Ruby( WW8ReadFieldParams& rReadParam) { case -2: { - String sTemp = rReadParam.GetResult(); - if( sTemp.EqualsIgnoreCaseAscii( "jc", 0, 2 ) ) + OUString sTemp = rReadParam.GetResult(); + if( sTemp.startsWithIgnoreAsciiCase( "jc" ) ) { - sTemp.Erase(0,2); - nJustificationCode = static_cast<sal_uInt16>(sTemp.ToInt32()); + sTemp = sTemp.copy(2); + nJustificationCode = static_cast<sal_uInt16>(sTemp.toInt32()); } - else if( sTemp.EqualsIgnoreCaseAscii( "hps", 0, 3 ) ) + else if( sTemp.startsWithIgnoreAsciiCase( "hps" ) ) { - sTemp.Erase(0,3); - nFontSize= static_cast<sal_uInt32>(sTemp.ToInt32()); + sTemp = sTemp.copy(3); + nFontSize= static_cast<sal_uInt32>(sTemp.toInt32()); } - else if( sTemp.EqualsIgnoreCaseAscii( "Font:", 0, 5 ) ) + else if( sTemp.startsWithIgnoreAsciiCase( "Font:" ) ) { - sTemp.Erase(0,5); + sTemp = sTemp.copy(5); sFontName = sTemp; } } diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 279608586bc0..19e38bce35a9 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -3787,7 +3787,7 @@ bool WW8PLCFx_FLD::GetPara(long nIdx, WW8FieldDesc& rF) /* to be optimized like this: */ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen, - sal_uInt16 nExtraLen, rtl_TextEncoding eCS, std::vector<String> &rArray, + sal_uInt16 nExtraLen, rtl_TextEncoding eCS, std::vector<OUString> &rArray, std::vector<ww::bytes>* pExtraArray, ::std::vector<String>* pValueArray) { if (nLen==0) // Handle Empty STTBF @@ -3879,7 +3879,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen rArray.push_back(OStringToOUString(aTmp, eCS)); } else - rArray.push_back(aEmptyStr); + rArray.push_back(OUString()); // Skip the extra data (for bVer67 versions this must come from // external knowledge) @@ -4112,7 +4112,7 @@ String WW8PLCFx_Book::GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex) } while (i < pBook[0]->GetIMax()); } - return bFound ? aBookNames[i] : aEmptyStr; + return bFound ? aBookNames[i] : OUString(); } OUString WW8PLCFx_Book::GetUniqueBookmarkName(const OUString &rSuggestedName) @@ -4156,9 +4156,9 @@ bool WW8PLCFx_Book::MapName(OUString& rName) return bFound; } -const String* WW8PLCFx_Book::GetName() const +const OUString* WW8PLCFx_Book::GetName() const { - const String *pRet = 0; + const OUString *pRet = 0; if (!nIsEnd && (pBook[0]->GetIdx() < nIMax)) pRet = &(aBookNames[pBook[0]->GetIdx()]); return pRet; diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index c643e4434d32..eccc4831e250 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -152,7 +152,7 @@ class WW8PLCFx_PCD; attention: the *extra data* of each string are SKIPPED and ignored */ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen, - sal_uInt16 nExtraLen, rtl_TextEncoding eCS, ::std::vector<String> &rArray, + sal_uInt16 nExtraLen, rtl_TextEncoding eCS, ::std::vector<OUString> &rArray, ::std::vector<ww::bytes>* pExtraArray = 0, ::std::vector<String>* pValueArray = 0); struct WW8FieldDesc @@ -713,7 +713,7 @@ class WW8PLCFx_Book : public WW8PLCFx { private: WW8PLCFspecial* pBook[2]; // Start and End Position - ::std::vector<String> aBookNames; // Name + ::std::vector<OUString> aBookNames; // Name eBookStatus* pStatus; long nIMax; // Number of Booknotes sal_uInt16 nIsEnd; @@ -735,7 +735,7 @@ public: virtual WW8_FC Where(); virtual long GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ); virtual void advance(); - const String* GetName() const; + const OUString* GetName() const; WW8_CP GetStartPos() const { return ( nIsEnd ) ? WW8_CP_MAX : pBook[0]->Where(); } long GetLen() const; |