diff options
author | Noel Grandin <noel@peralex.com> | 2013-10-15 15:33:07 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-10-18 09:59:14 +0200 |
commit | 111c843ce392b58a1dd0c675dd4ef214535d817c (patch) | |
tree | 9dfec13df606b0fae47f3fa84897a7d50d9eaa26 /sw | |
parent | 76ef39f0377f6105f658b9867c8a496e565b2a3a (diff) |
convert sw/source/filter/html/*.cxx from String to OUString
Change-Id: I2ec64f459dca9389d709ba0cdf20a5c1ef34ad18
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/html/htmldraw.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfld.cxx | 28 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfly.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/html/htmlform.cxx | 57 | ||||
-rw-r--r-- | sw/source/filter/html/htmlforw.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmlftn.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 46 | ||||
-rw-r--r-- | sw/source/filter/html/htmlnum.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmlplug.cxx | 26 | ||||
-rw-r--r-- | sw/source/filter/html/htmlsect.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmltab.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 48 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 23 |
13 files changed, 130 insertions, 134 deletions
diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldraw.cxx index 31f7df847f43..d4efcd17f068 100644 --- a/sw/source/filter/html/htmldraw.cxx +++ b/sw/source/filter/html/htmldraw.cxx @@ -263,7 +263,7 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable ) OSL_ENSURE( !pMarquee, "Marquee in Marquee???" ); aContents = ""; - String aId, aStyle, aClass; + OUString aId, aStyle, aClass; long nWidth=0, nHeight=0; sal_Bool bPrcWidth = sal_False, bDirection = sal_False, bBGColor = sal_False; @@ -379,7 +379,7 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable ) pPg->InsertObject( pMarquee ); - if( aId.Len() ) + if( !aId.isEmpty() ) InsertBookmark( aId ); // (Nur) Alternate leueft per Default von links nach rechts diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index fd486e56f28c..3d63aeb8fa40 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -213,7 +213,7 @@ void SwHTMLParser::NewField() sal_Bool bKnownType = sal_False, bFixed = sal_False, bHasNumFmt = sal_False, bHasNumValue = sal_False; sal_uInt16 nType = 0; - String aValue, aNumFmt, aNumValue, aName; + OUString aValue, aNumFmt, aNumValue, aName; const HTMLOption *pSubOption=0, *pFmtOption=0; const HTMLOptions& rHTMLOptions = GetOptions(); @@ -265,7 +265,7 @@ void SwHTMLParser::NewField() RES_AUTHORFLD == (RES_FIELDS)nType) ) { SvtUserOptions aOpt; - const String& rUser = aOpt.GetFullName(); + const OUString& rUser = aOpt.GetFullName(); SwDocShell *pDocShell(pDoc->GetDocShell()); OSL_ENSURE(pDocShell, "no SwDocShell"); if (pDocShell) { @@ -274,10 +274,10 @@ void SwHTMLParser::NewField() uno::Reference<document::XDocumentProperties> xDocProps( xDPS->getDocumentProperties()); OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties"); - const String& rChanged = xDocProps->getModifiedBy(); - const String& rCreated = xDocProps->getAuthor(); - if( !rUser.Len() || - (rChanged.Len() ? rUser != rChanged : rUser != rCreated) ) + const OUString& rChanged = xDocProps->getModifiedBy(); + const OUString& rCreated = xDocProps->getAuthor(); + if( rUser.isEmpty() || + (!rChanged.isEmpty() ? rUser != rChanged : rUser != rCreated) ) bFixed = sal_True; } } @@ -336,17 +336,17 @@ void SwHTMLParser::NewField() { nSub = DATEFLD; pFmtTbl = aHTMLDateFldFmtTable; - if( aValue.Len() ) - nDate = (sal_uLong)aValue.ToInt32(); + if( !aValue.isEmpty() ) + nDate = (sal_uLong)aValue.toInt32(); } else { nSub = TIMEFLD; pFmtTbl = aHTMLTimeFldFmtTable; - if( aValue.Len() ) - nTime = (sal_uLong)aValue.ToInt32(); + if( !aValue.isEmpty() ) + nTime = (sal_uLong)aValue.toInt32(); } - if( aValue.Len() ) + if( !aValue.isEmpty() ) nSub |= FIXEDFLD; SvNumberFormatter *pFormatter = pDoc->GetNumberFormatter(); @@ -419,8 +419,8 @@ void SwHTMLParser::NewField() short nOff = 0; - if( (SvxExtNumType)nFmt!=SVX_NUM_CHAR_SPECIAL && aValue.Len() ) - nOff = (short)aValue.ToInt32(); + if( (SvxExtNumType)nFmt!=SVX_NUM_CHAR_SPECIAL && !aValue.isEmpty() ) + nOff = (short)aValue.toInt32(); else if( (SwPageNumSubType)nSub == PG_NEXT ) nOff = 1; else if( (SwPageNumSubType)nSub == PG_PREV ) @@ -466,7 +466,7 @@ void SwHTMLParser::NewField() else bHasNumValue = sal_False; - if( nSub >= DI_INFO1 && nSub <= DI_INFO4 && aName.Len() == 0 ) + if( nSub >= DI_INFO1 && nSub <= DI_INFO4 && aName.isEmpty() ) { // backward compatibility for OOo 2: // map to names stored in AddMetaUserDefined diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index f0de56120838..44ce5192c611 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -1675,10 +1675,10 @@ void SwHTMLWriter::AddLinkTarget( const OUString& rURL ) if( !bFound || nPos < 2 ) // mindetsens "#a|..." return; - String aURL( rURL.copy( 1 ) ); + OUString aURL( rURL.copy( 1 ) ); // nPos-1+1/3 (-1 wg. Erase) - OUString sCmp(comphelper::string::remove(aURL.Copy(bEncoded ? nPos+2 : nPos), + OUString sCmp(comphelper::string::remove(aURL.copy(bEncoded ? nPos+2 : nPos), ' ')); if( sCmp.isEmpty() ) return; @@ -1694,8 +1694,7 @@ void SwHTMLWriter::AddLinkTarget( const OUString& rURL ) // Einfach nur in einem sortierten Array merken if( bEncoded ) { - aURL.Erase( nPos, 2 ); - aURL.SetChar( nPos-1, cMarkSeparator ); + aURL = aURL.replaceAt( nPos - 1, 3, OUString(cMarkSeparator) ); } aImplicitMarks.insert( aURL ); } @@ -1703,7 +1702,7 @@ void SwHTMLWriter::AddLinkTarget( const OUString& rURL ) { // Hier brauchen wir Position und Name. Deshalb sortieren wir // ein sal_uInt16 und ein String-Array selbst - String aOutline( aURL.Copy( 0, nPos-1 ) ); + OUString aOutline( aURL.copy( 0, nPos-1 ) ); SwPosition aPos( *pCurPam->GetPoint() ); if( pDoc->GotoOutline( aPos, aOutline ) ) { @@ -1717,8 +1716,7 @@ void SwHTMLWriter::AddLinkTarget( const OUString& rURL ) aOutlineMarkPoss.insert( aOutlineMarkPoss.begin()+nIns, nIdx ); if( bEncoded ) { - aURL.Erase( nPos, 2 ); - aURL.SetChar( nPos-1, cMarkSeparator ); + aURL = aURL.replaceAt( nPos - 1, 3, OUString(cMarkSeparator) ); } aOutlineMarks.insert( aOutlineMarks.begin()+nIns, aURL ); } diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 39a7c21cca82..bb83f2f25c3d 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -1298,8 +1298,8 @@ void SwHTMLParser::NewForm( sal_Bool bAppend ) if( !pFormImpl ) pFormImpl = new SwHTMLForm_Impl( pDoc->GetDocShell() ); - String aAction( sBaseURL ); - String sName, sTarget; + OUString aAction( sBaseURL ); + OUString sName, sTarget; sal_uInt16 nEncType = FormSubmitEncoding_URL; sal_uInt16 nMethod = FormSubmitMethod_GET; SvxMacroTableDtor aMacroTbl; @@ -1358,11 +1358,11 @@ void SwHTMLParser::NewForm( sal_Bool bAppend ) if( bSetEvent ) { - String sEvent( rOption.GetString() ); - if( sEvent.Len() ) + OUString sEvent( rOption.GetString() ); + if( !sEvent.isEmpty() ) { sEvent = convertLineEnd(sEvent, GetSystemLineEnd()); - String aScriptType2; + OUString aScriptType2; if( EXTENDED_STYPE==eScriptType2 ) aScriptType2 = rDfltScriptType; aMacroTbl.Insert( nEvent, SvxMacro( sEvent, aScriptType2, eScriptType2 ) ); @@ -1392,7 +1392,7 @@ void SwHTMLParser::NewForm( sal_Bool bAppend ) aTmp <<= OUString(sName); xFormPropSet->setPropertyValue("Name", aTmp ); - if( aAction.Len() ) + if( !aAction.isEmpty() ) { aAction = URIHelper::SmartRel2Abs(INetURLObject(sBaseURL), aAction, Link(), false); } @@ -1416,11 +1416,10 @@ void SwHTMLParser::NewForm( sal_Bool bAppend ) xFormPropSet->setPropertyValue( OUString("SubmitEncoding"), aTmp ); - if( sTarget.Len() ) + if( !sTarget.isEmpty() ) { - aTmp <<= OUString(sTarget); - xFormPropSet->setPropertyValue( - OUString("TargetFrame"), aTmp ); + aTmp <<= sTarget; + xFormPropSet->setPropertyValue( OUString("TargetFrame"), aTmp ); } const uno::Reference< container::XIndexContainer > & rForms = @@ -1461,7 +1460,7 @@ void SwHTMLParser::InsertInput() if( !pFormImpl || !pFormImpl->GetFormComps().is() ) return; - String sImgSrc, aId, aClass, aStyle, sName; + OUString sImgSrc, aId, aClass, aStyle, sName; OUString sText; SvxMacroTableDtor aMacroTbl; std::vector<OUString> aUnoMacroTbl; @@ -1479,7 +1478,7 @@ void SwHTMLParser::InsertInput() sal_Int16 eHoriOri = text::HoriOrientation::NONE; SvKeyValueIterator *pHeaderAttrs = pFormImpl->GetHeaderAttrs(); ScriptType eDfltScriptType = GetScriptType( pHeaderAttrs ); - const String& rDfltScriptType = GetScriptTypeString( pHeaderAttrs ); + const OUString& rDfltScriptType = GetScriptTypeString( pHeaderAttrs ); sal_uInt16 nKeepCRLFToken = HTML_O_VALUE; const HTMLOptions& rHTMLOptions = GetOptions( &nKeepCRLFToken ); @@ -1589,11 +1588,11 @@ void SwHTMLParser::InsertInput() if( bSetEvent ) { - String sEvent( rOption.GetString() ); - if( sEvent.Len() ) + OUString sEvent( rOption.GetString() ); + if( !sEvent.isEmpty() ) { sEvent = convertLineEnd(sEvent, GetSystemLineEnd()); - String aScriptType2; + OUString aScriptType2; if( EXTENDED_STYPE==eScriptType2 ) aScriptType2 = rDfltScriptType; aMacroTbl.Insert( nEvent, SvxMacro( sEvent, aScriptType2, eScriptType2 ) ); @@ -1604,7 +1603,7 @@ void SwHTMLParser::InsertInput() if( HTML_IT_IMAGE==eType ) { // Image-Controls ohne Image-URL werden ignoriert (wie bei MS) - if( !sImgSrc.Len() ) + if( sImgSrc.isEmpty() ) return; } else @@ -1862,7 +1861,7 @@ void SwHTMLParser::InsertInput() if( HasStyleOptions( aStyle, aId, aClass ) ) { ParseStyleOptions( aStyle, aId, aClass, aCSS1ItemSet, aCSS1PropInfo ); - if( aId.Len() ) + if( !aId.isEmpty() ) InsertBookmark( aId ); } @@ -1958,8 +1957,8 @@ void SwHTMLParser::NewTextArea() return; } - String aId, aClass, aStyle; - String sName; + OUString aId, aClass, aStyle; + OUString sName; sal_Int32 nTabIndex = TABINDEX_MAX + 1; SvxMacroTableDtor aMacroTbl; std::vector<OUString> aUnoMacroTbl; @@ -1969,7 +1968,7 @@ void SwHTMLParser::NewTextArea() sal_Bool bDisabled = sal_False; SvKeyValueIterator *pHeaderAttrs = pFormImpl->GetHeaderAttrs(); ScriptType eDfltScriptType = GetScriptType( pHeaderAttrs ); - const String& rDfltScriptType = GetScriptTypeString( pHeaderAttrs ); + const OUString& rDfltScriptType = GetScriptTypeString( pHeaderAttrs ); const HTMLOptions& rHTMLOptions = GetOptions(); for (size_t i = rHTMLOptions.size(); i; ) @@ -2054,8 +2053,8 @@ void SwHTMLParser::NewTextArea() if( bSetEvent ) { - String sEvent( rOption.GetString() ); - if( sEvent.Len() ) + OUString sEvent( rOption.GetString() ); + if( !sEvent.isEmpty() ) { sEvent = convertLineEnd(sEvent, GetSystemLineEnd()); if( EXTENDED_STYPE==eScriptType2 ) @@ -2133,7 +2132,7 @@ void SwHTMLParser::NewTextArea() if( HasStyleOptions( aStyle, aId, aClass ) ) { ParseStyleOptions( aStyle, aId, aClass, aCSS1ItemSet, aCSS1PropInfo ); - if( aId.Len() ) + if( !aId.isEmpty() ) InsertBookmark( aId ); } @@ -2246,8 +2245,8 @@ void SwHTMLParser::NewSelect() if( !pFormImpl || !pFormImpl->GetFormComps().is() ) return; - String aId, aClass, aStyle; - String sName; + OUString aId, aClass, aStyle; + OUString sName; sal_Int32 nTabIndex = TABINDEX_MAX + 1; SvxMacroTableDtor aMacroTbl; std::vector<OUString> aUnoMacroTbl; @@ -2257,7 +2256,7 @@ void SwHTMLParser::NewSelect() nSelectEntryCnt = 1; SvKeyValueIterator *pHeaderAttrs = pFormImpl->GetHeaderAttrs(); ScriptType eDfltScriptType = GetScriptType( pHeaderAttrs ); - const String& rDfltScriptType = GetScriptTypeString( pHeaderAttrs ); + const OUString& rDfltScriptType = GetScriptTypeString( pHeaderAttrs ); const HTMLOptions& rHTMLOptions = GetOptions(); for (size_t i = rHTMLOptions.size(); i; ) @@ -2332,8 +2331,8 @@ void SwHTMLParser::NewSelect() if( bSetEvent ) { - String sEvent( rOption.GetString() ); - if( sEvent.Len() ) + OUString sEvent( rOption.GetString() ); + if( !sEvent.isEmpty() ) { sEvent = convertLineEnd(sEvent, GetSystemLineEnd()); if( EXTENDED_STYPE==eScriptType2 ) @@ -2412,7 +2411,7 @@ void SwHTMLParser::NewSelect() if( HasStyleOptions( aStyle, aId, aClass ) ) { ParseStyleOptions( aStyle, aId, aClass, aCSS1ItemSet, aCSS1PropInfo ); - if( aId.Len() ) + if( !aId.isEmpty() ) InsertBookmark( aId ); } diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 5cf0ee3610c1..126aede7e12a 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -493,7 +493,7 @@ void SwHTMLWriter::OutForm( sal_Bool bOn, { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_action).append("=\""); Strm() << sOut.makeStringAndClear().getStr(); - String aURL( *(OUString*)aTmp.getValue() ); + OUString aURL( *(OUString*)aTmp.getValue() ); aURL = URIHelper::simpleNormalizedMakeRelative( GetBaseURL(), aURL); HTMLOutFuncs::Out_String( Strm(), aURL, eDestEnc, &aNonConvertableCharacters ); sOut.append('\"'); diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx index 4083f436d46f..a9828dc5c656 100644 --- a/sw/source/filter/html/htmlftn.cxx +++ b/sw/source/filter/html/htmlftn.cxx @@ -411,7 +411,7 @@ OUString SwHTMLWriter::GetFootEndNoteSym( const SwFmtFtn& rFmtFtn ) pInfo = rFmtFtn.IsEndNote() ? &pDoc->GetEndNoteInfo() : &pDoc->GetFtnInfo(); - String sRet; + OUString sRet; if( pInfo ) sRet = pInfo->GetPrefix(); sRet += rFmtFtn.GetViewNumStr( *pDoc ); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 47723b5ca361..9de0987c5ec0 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -309,7 +309,7 @@ void SwHTMLParser::GetDefaultScriptType( ScriptType& rType, void SwHTMLParser::InsertImage() { // und jetzt auswerten - String sAltNm, aId, aClass, aStyle, aMap, sHTMLGrfName; + OUString sAltNm, aId, aClass, aStyle, aMap, sHTMLGrfName; OUString sGrfNm; sal_Int16 eVertOri = text::VertOrientation::TOP; sal_Int16 eHoriOri = text::HoriOrientation::NONE; @@ -411,11 +411,11 @@ void SwHTMLParser::InsertImage() goto IMAGE_SETEVENT; IMAGE_SETEVENT: { - String sTmp( rOption.GetString() ); - if( sTmp.Len() ) + OUString sTmp( rOption.GetString() ); + if( !sTmp.isEmpty() ) { sTmp = convertLineEnd(sTmp, GetSystemLineEnd()); - String sScriptType; + OUString sScriptType; if( EXTENDED_STYPE == eScriptType2 ) sScriptType = sDfltScriptType; aMacroItem.SetMacro( nEvent, @@ -482,7 +482,7 @@ IMAGE_SETEVENT: if( aAttrTab.pINetFmt ) { - const String& rURL = + const OUString& rURL = ((const SwFmtINetFmt&)aAttrTab.pINetFmt->GetItem()).GetValue(); pCSS1Parser->SetATagStyles(); @@ -627,16 +627,16 @@ IMAGE_SETEVENT: // Image-Map setzen aMap = comphelper::string::stripEnd(aMap, ' '); - if( aMap.Len() ) + if( !aMap.isEmpty() ) { // Da wir nur lokale Image-Maps kennen nehmen wireinfach alles // hinter dem # als Namen - xub_StrLen nPos = aMap.Search( '#' ); - String aName; - if ( STRING_NOTFOUND==nPos ) + sal_Int32 nPos = aMap.indexOf( '#' ); + OUString aName; + if ( -1 == nPos ) aName = aMap ; else - aName = aMap.Copy(nPos+1); + aName = aMap.copy(nPos+1); ImageMap *pImgMap = FindImageMap( aName ); if( pImgMap ) @@ -700,7 +700,7 @@ IMAGE_SETEVENT: SwGrfNode *pGrfNd = pDoc->GetNodes()[ pFlyFmt->GetCntnt().GetCntntIdx() ->GetIndex()+1 ]->GetGrfNode(); - if( sHTMLGrfName.Len() ) + if( !sHTMLGrfName.isEmpty() ) { pFlyFmt->SetName( sHTMLGrfName ); @@ -712,7 +712,7 @@ IMAGE_SETEVENT: } } - if( sAltNm.Len() ) + if( !sAltNm.isEmpty() ) pGrfNd->SetTitle( sAltNm ); if( bSetTwipSize ) @@ -785,7 +785,7 @@ IMAGE_SETEVENT: // Ggf. Frames anlegen und Auto-gebundenen Rahmen registrieren RegisterFlyFrm( pFlyFmt ); - if( aId.Len() ) + if( !aId.isEmpty() ) InsertBookmark( aId ); } @@ -1031,7 +1031,7 @@ void SwHTMLParser::NewAnchor() } SvxMacroTableDtor aMacroTbl; - String sHRef, aName, sTarget; + OUString sHRef, aName, sTarget; OUString aId, aStyle, aClass, aLang, aDir; sal_Bool bHasHRef = sal_False, bFixed = sal_False; @@ -1097,11 +1097,11 @@ void SwHTMLParser::NewAnchor() goto ANCHOR_SETEVENT; ANCHOR_SETEVENT: { - String sTmp( rOption.GetString() ); - if( sTmp.Len() ) + OUString sTmp( rOption.GetString() ); + if( !sTmp.isEmpty() ) { sTmp = convertLineEnd(sTmp, GetSystemLineEnd()); - String sScriptType; + OUString sScriptType; if( EXTENDED_STYPE == eScriptType2 ) sScriptType = sDfltScriptType; aMacroTbl.Insert( nEvent, SvxMacro( sTmp, sScriptType, eScriptType2 )); @@ -1114,7 +1114,7 @@ ANCHOR_SETEVENT: // Sprungziele, die unseren ipmliziten Zielen entsprechen, schmeissen // wir hier ganz rigoros raus. - if( aName.Len() ) + if( !aName.isEmpty() ) { OUString sDecoded( INetURLObject::decode( aName, INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS, @@ -1134,7 +1134,7 @@ ANCHOR_SETEVENT: sCmp == "outline" || sCmp == "text" ) { - aName.Erase(); + aName = ""; } } } @@ -1147,7 +1147,7 @@ ANCHOR_SETEVENT: OUString aFtnName; OUString aStrippedClass( aClass ); SwCSS1Parser::GetScriptFromClass( aStrippedClass, sal_False ); - if( aStrippedClass.getLength() >=9 && bHasHRef && sHRef.Len() > 1 && + if( aStrippedClass.getLength() >=9 && bHasHRef && sHRef.getLength() > 1 && ('s' == aStrippedClass[0] || 'S' == aStrippedClass[0]) && ('d' == aStrippedClass[1] || 'D' == aStrippedClass[1]) ) { @@ -1160,7 +1160,7 @@ ANCHOR_SETEVENT: bFtnEnSymbol = sal_True; if( bEnAnchor || bFtnAnchor || bFtnEnSymbol ) { - aFtnName = sHRef.Copy( 1 ); + aFtnName = sHRef.copy( 1 ); aClass = aStrippedClass = aName = aEmptyStr; bHasHRef = sal_False; } @@ -1181,7 +1181,7 @@ ANCHOR_SETEVENT: if( bHasHRef ) { - if( sHRef.Len() ) + if( !sHRef.isEmpty() ) { sHRef = URIHelper::SmartRel2Abs( INetURLObject(sBaseURL), sHRef, Link(), false ); } @@ -1202,7 +1202,7 @@ ANCHOR_SETEVENT: // das Default-Attribut setzen InsertAttr( &aAttrTab.pINetFmt, aINetFmt, pCntxt ); } - else if( aName.Len() ) + else if( !aName.isEmpty() ) { InsertBookmark( aName ); } diff --git a/sw/source/filter/html/htmlnum.cxx b/sw/source/filter/html/htmlnum.cxx index e4d6f6e44bfd..491abb8b1ad3 100644 --- a/sw/source/filter/html/htmlnum.cxx +++ b/sw/source/filter/html/htmlnum.cxx @@ -507,7 +507,7 @@ void SwHTMLParser::NewNumBulListItem( int nToken ) _HTMLAttrContext *pCntxt = new _HTMLAttrContext( static_cast< sal_uInt16 >(nToken) ); - String aNumRuleName; + OUString aNumRuleName; if( GetNumInfo().GetNumRule() ) { aNumRuleName = GetNumInfo().GetNumRule()->GetName(); @@ -639,7 +639,7 @@ void SwHTMLParser::SetNodeNum( sal_uInt8 nLevel, bool bCountedInList ) OSL_ENSURE( pTxtNode, "Kein Text-Node an PaM-Position" ); OSL_ENSURE( GetNumInfo().GetNumRule(), "Kein Numerierungs-Regel" ); - const String& rName = GetNumInfo().GetNumRule()->GetName(); + const OUString& rName = GetNumInfo().GetNumRule()->GetName(); ((SwCntntNode *)pTxtNode)->SetAttr( SwNumRuleItem(rName) ); pTxtNode->SetAttrListLevel( nLevel ); diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index dac331cced69..57f1a1901ca4 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -295,7 +295,7 @@ void SwHTMLParser::SetSpace( const Size& rPixSpace, void SwHTMLParser::InsertEmbed() { - String aURL, aType, aName, aAlt, aId, aStyle, aClass; + OUString aURL, aType, aName, aAlt, aId, aStyle, aClass; Size aSize( USHRT_MAX, USHRT_MAX ); Size aSpace( USHRT_MAX, USHRT_MAX ); sal_Bool bPrcWidth = sal_False, bPrcHeight = sal_False, bHidden = sal_False; @@ -325,14 +325,14 @@ void SwHTMLParser::InsertEmbed() aName = rOption.GetString(); break; case HTML_O_SRC: - if( !aURL.Len() ) + if( aURL.isEmpty() ) aURL = rOption.GetString(); break; case HTML_O_ALT: aAlt = rOption.GetString(); break; case HTML_O_TYPE: - if( !aType.Len() ) + if( aType.isEmpty() ) aType = rOption.GetString(); break; case HTML_O_ALIGN: @@ -401,14 +401,14 @@ void SwHTMLParser::InsertEmbed() // die URL aufbereiten INetURLObject aURLObj; - bool bHasURL = aURL.Len() && + bool bHasURL = !aURL.isEmpty() && aURLObj.SetURL( URIHelper::SmartRel2Abs( INetURLObject(sBaseURL), aURL, URIHelper::GetMaybeFileHdl()) ); // do not insert plugin if it has neither URL nor type - bool bHasType = aType.Len() != 0; + bool bHasType = !aType.isEmpty(); if( !bHasURL && !bHasType ) return; @@ -466,7 +466,7 @@ void SwHTMLParser::InsertEmbed() pDoc->Insert( *pPam, ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), &aFrmSet, NULL, NULL ); // Namen am FrmFmt setzen - if( aName.Len() ) + if( !aName.isEmpty() ) pFlyFmt->SetName( aName ); // den alternativen Text setzen @@ -490,7 +490,7 @@ void SwHTMLParser::InsertEmbed() void SwHTMLParser::NewObject() { OUString aClassID; - String aName, aStandBy, aId, aStyle, aClass; + OUString aName, aStandBy, aId, aStyle, aClass; Size aSize( USHRT_MAX, USHRT_MAX ); Size aSpace( 0, 0 ); sal_Int16 eVertOri = text::VertOrientation::TOP; @@ -660,7 +660,7 @@ void SwHTMLParser::EndObject() #if HAVE_FEATURE_JAVA void SwHTMLParser::InsertApplet() { - String aCodeBase, aCode, aName, aAlt, aId, aStyle, aClass; + OUString aCodeBase, aCode, aName, aAlt, aId, aStyle, aClass; Size aSize( USHRT_MAX, USHRT_MAX ); Size aSpace( 0, 0 ); sal_Bool bPrcWidth = sal_False, bPrcHeight = sal_False, bMayScript = sal_False; @@ -726,14 +726,14 @@ void SwHTMLParser::InsertApplet() rOption.GetString() ); } - if( !aCode.Len() ) + if( aCode.isEmpty() ) { delete pAppletImpl; pAppletImpl = 0; return; } - if ( aCodeBase.Len() ) + if ( !aCodeBase.isEmpty() ) aCodeBase = INetURLObject::GetAbsURL( sBaseURL, aCodeBase ); pAppletImpl->CreateApplet( aCode, aName, bMayScript, aCodeBase, sBaseURL );//, aAlt ); pAppletImpl->SetAltText( aAlt ); @@ -794,7 +794,7 @@ void SwHTMLParser::InsertParam() if( !pAppletImpl ) return; - String aName, aValue; + OUString aName, aValue; const HTMLOptions& rHTMLOptions = GetOptions(); for (size_t i = rHTMLOptions.size(); i; ) @@ -811,7 +811,7 @@ void SwHTMLParser::InsertParam() } } - if( !aName.Len() ) + if( aName.isEmpty() ) return; pAppletImpl->AppendParam( aName, aValue ); @@ -822,7 +822,7 @@ void SwHTMLParser::InsertParam() void SwHTMLParser::InsertFloatingFrame() { - String aAlt, aId, aStyle, aClass; + OUString aAlt, aId, aStyle, aClass; Size aSize( USHRT_MAX, USHRT_MAX ); Size aSpace( 0, 0 ); sal_Bool bPrcWidth = sal_False, bPrcHeight = sal_False; diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 77c764ddeff0..0cde1f113971 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -642,7 +642,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) // Insert fly frame. If the are columns, the fly frame's name is not // the sections name but a generated one. - String aFlyName( aEmptyStr ); + OUString aFlyName( aEmptyStr ); if( nCols < 2 ) { aFlyName = aId; @@ -688,7 +688,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) SetAttr( sal_True, sal_True, pPostIts ); // Make section name unique. - String aName( pDoc->GetUniqueSectionName( !aId.isEmpty() ? &aId : 0 ) ); + OUString aName( pDoc->GetUniqueSectionName( !aId.isEmpty() ? &aId : 0 ) ); SwSectionData aSection( CONTENT_SECTION, aName ); SfxItemSet aFrmItemSet( pDoc->GetAttrPool(), diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index b15a8132fa40..dc7293a0deb4 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -3120,7 +3120,7 @@ void _SectionSaveStruct::Restore( SwHTMLParser& rParser ) class _CellSaveStruct : public _SectionSaveStruct { OUString aStyle, aId, aClass, aLang, aDir; - String aBGImage; + OUString aBGImage; Color aBGColor; boost::shared_ptr<SvxBoxItem> m_pBoxItem; @@ -3193,7 +3193,7 @@ _CellSaveStruct::_CellSaveStruct( SwHTMLParser& rParser, HTMLTable *pCurTable, bNoWrap( sal_False ), bNoBreak( sal_False ) { - String aNumFmt, aValue; + OUString aNumFmt, aValue; if( bReadOpt ) { @@ -4249,7 +4249,7 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, sal_Bool bReadOptions, SvxAdjust eAdjust = eGrpAdjust; sal_Int16 eVertOri = eGrpVertOri; Color aBGColor; - String aBGImage, aStyle, aId, aClass; + OUString aBGImage, aStyle, aId, aClass; sal_Bool bBGColor = sal_False; pSaveStruct = new _RowSaveStruct; @@ -4294,7 +4294,7 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, sal_Bool bReadOptions, } } - if( aId.Len() ) + if( !aId.isEmpty() ) InsertBookmark( aId ); SvxBrushItem *pBrushItem = diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index b750e438b809..ce50d4395ca5 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -1450,9 +1450,9 @@ void SwHTMLParser::NextToken( int nToken ) xub_StrLen nPos = pPam->GetPoint()->nContent.GetIndex(); if( nPos ) { - const String& rText = + const OUString& rText = pPam->GetPoint()->nNode.GetNode().GetTxtNode()->GetTxt(); - sal_Unicode cLast = rText.GetChar(--nPos); + sal_Unicode cLast = rText[--nPos]; if( ' ' == cLast || '\x0a' == cLast) aToken = aToken.copy(1); } @@ -1905,7 +1905,7 @@ void SwHTMLParser::NextToken( int nToken ) SfxItemSet aItemSet( pDoc->GetAttrPool(), pCSS1Parser->GetWhichMap() ); SvxCSS1PropertyInfo aPropInfo; - String aDummy; + OUString aDummy; ParseStyleOptions( aDummy, aDummy, aDummy, aItemSet, aPropInfo, 0, &rDir ); @@ -1947,7 +1947,7 @@ void SwHTMLParser::NextToken( int nToken ) if( ' ' == aToken[ 3 ] && ' ' == aToken[ aToken.getLength()-3 ] ) { - String aComment( aToken.copy( 3, aToken.getLength()-5 ) ); + OUString aComment( aToken.copy( 3, aToken.getLength()-5 ) ); InsertComment(comphelper::string::strip(aComment, ' ')); } else @@ -2021,16 +2021,16 @@ void SwHTMLParser::NextToken( int nToken ) if( bInsertUnknown ) { - String aComment(OUString("HTML: <")); + OUString aComment("HTML: <"); if( (HTML_TOKEN_ONOFF & nToken) != 0 && (1 & nToken) != 0 ) - aComment += '/'; + aComment += "/"; aComment += sSaveToken; if( !aToken.isEmpty() ) { UnescapeToken(); - (aComment += ' ') += aToken; + (aComment += " ") += aToken; } - aComment += '>'; + aComment += ">"; InsertComment( aComment ); } @@ -2175,7 +2175,7 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu OSL_ENSURE( pTxtNd, "No text node" ); if( pTxtNd ) { - const String& rText = pTxtNd->GetTxt(); + const OUString& rText = pTxtNd->GetTxt(); sal_uInt16 nScriptTxt = g_pBreakIt->GetBreakIter()->getScriptType( rText, pAttr->GetSttCnt() ); @@ -2821,7 +2821,7 @@ void SwHTMLParser::_SetAttr( sal_Bool bChkEnd, sal_Bool bBeforeTable, { case RES_FLTR_BOOKMARK: // insert bookmark { - const String sName( ((SfxStringItem*)pAttr->pItem)->GetValue() ); + const OUString sName( ((SfxStringItem*)pAttr->pItem)->GetValue() ); IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findMark( sName ); if( ppBkmk != pMarkAccess->getMarksEnd() && @@ -3064,7 +3064,7 @@ void SwHTMLParser::EndAttr( _HTMLAttr* pAttr, _HTMLAttr **ppDepAttr, const SwTxtNode *pTxtNd = pAttr->GetSttPara().GetNode() .GetTxtNode(); OSL_ENSURE( pTxtNd, "No text node" ); - const String& rText = pTxtNd->GetTxt(); + const OUString& rText = pTxtNd->GetTxt(); sal_uInt16 nScriptTxt = g_pBreakIt->GetBreakIter()->getScriptType( rText, pAttr->GetSttCnt() ); xub_StrLen nScriptEnd = (xub_StrLen)g_pBreakIt->GetBreakIter() @@ -3751,7 +3751,7 @@ void SwHTMLParser::NewFontAttr( int nToken ) OSL_ENSURE( !nSize == !nFontHeight, "HTML-Font-Size != Font-Height" ); - String aFontName, aStyleName; + OUString aFontName, aStyleName; FontFamily eFamily = FAMILY_DONTKNOW; // Family und Pitch, FontPitch ePitch = PITCH_DONTKNOW; // falls nicht gefunden rtl_TextEncoding eEnc = osl_getThreadTextEncoding(); @@ -3772,9 +3772,9 @@ void SwHTMLParser::NewFontAttr( int nToken ) sal_Int32 nStrPos = 0; while( nStrPos!= -1 ) { - String aFName = aFace.getToken( 0, ',', nStrPos ); + OUString aFName = aFace.getToken( 0, ',', nStrPos ); aFName = comphelper::string::strip(aFName, ' '); - if( aFName.Len() ) + if( !aFName.isEmpty() ) { if( !bFound && pFList ) { @@ -3790,8 +3790,8 @@ void SwHTMLParser::NewFontAttr( int nToken ) } } } - if( aFontName.Len() ) - aFontName += ';'; + if( !aFontName.isEmpty() ) + aFontName += ";"; aFontName += aFName; } } @@ -3818,7 +3818,7 @@ void SwHTMLParser::NewFontAttr( int nToken ) } if( bColor ) aItemSet.Put( SvxColorItem(aColor, RES_CHRATR_COLOR) ); - if( aFontName.Len() ) + if( !aFontName.isEmpty() ) { SvxFontItem aFont( eFamily, aFontName, aStyleName, ePitch, eEnc, RES_CHRATR_FONT ); aItemSet.Put( aFont ); @@ -3847,7 +3847,7 @@ void SwHTMLParser::NewFontAttr( int nToken ) } if( bColor ) InsertAttr( &aAttrTab.pFontColor, SvxColorItem(aColor, RES_CHRATR_COLOR), pCntxt ); - if( aFontName.Len() ) + if( !aFontName.isEmpty() ) { SvxFontItem aFont( eFamily, aFontName, aStyleName, ePitch, eEnc, RES_CHRATR_FONT ); InsertAttr( &aAttrTab.pFont, aFont, pCntxt ); @@ -4840,7 +4840,7 @@ void SwHTMLParser::NewCharFmt( int nToken ) void SwHTMLParser::InsertSpacer() { // und es ggf. durch die Optionen veraendern - String aId; + OUString aId; sal_Int16 eVertOri = text::VertOrientation::TOP; sal_Int16 eHoriOri = text::HoriOrientation::NONE; Size aSize( 0, 0); @@ -5052,7 +5052,7 @@ SwTwips SwHTMLParser::GetCurrentBrowseWidth() void SwHTMLParser::InsertIDOption() { - String aId; + OUString aId; const HTMLOptions& rHTMLOptions = GetOptions(); for (size_t i = rHTMLOptions.size(); i; ) { @@ -5064,7 +5064,7 @@ void SwHTMLParser::InsertIDOption() } } - if( aId.Len() ) + if( !aId.isEmpty() ) InsertBookmark( aId ); } @@ -5089,7 +5089,7 @@ void SwHTMLParser::InsertLineBreak() // 6.) Wenn von keinem Rahmen der Umlauf geaendert wird, wird ein // harter Zeilenumbruch eingefuegt - String aId, aStyle, aClass; // die ID der Bookmark + OUString aId, aStyle, aClass; // die ID der Bookmark sal_Bool bClearLeft = sal_False, bClearRight = sal_False; sal_Bool bCleared = sal_False; // wurde ein CLEAR ausgefuehrt? @@ -5238,7 +5238,7 @@ void SwHTMLParser::InsertHorzRule() sal_Bool bColor = sal_False; Color aColor; - String aId; + OUString aId; // dann holen wir mal die Optionen const HTMLOptions& rHTMLOptions = GetOptions(); @@ -5375,7 +5375,7 @@ void SwHTMLParser::InsertHorzRule() } // Bookmarks koennen nicht in Hyperlinks eingefueht werden - if( aId.Len() ) + if( !aId.isEmpty() ) InsertBookmark( aId ); // den aktuellen Kontext vom Stack holen diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index b1abdafd25de..d9e3b8e08368 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -521,8 +521,8 @@ static void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt, OStringBuffer sOut; sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_division); - const String& rName = rSection.GetSectionName(); - if( rName.Len() && !bContinued ) + const OUString& rName = rSection.GetSectionName(); + if( !rName.isEmpty() && !bContinued ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_id). append(RTL_CONSTASCII_STRINGPARAM("=\"")); @@ -541,23 +541,22 @@ static void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt, append(RTL_CONSTASCII_STRINGPARAM("=\"")); rHTMLWrt.Strm() << sOut.makeStringAndClear().getStr(); - const String& aFName = rSection.GetLinkFileName(); - String aURL( aFName.GetToken(0,sfx2::cTokenSeparator) ); - String aFilter( aFName.GetToken(1,sfx2::cTokenSeparator) ); - OUString aSection( aFName.GetToken(2,sfx2::cTokenSeparator) ); + const OUString& aFName = rSection.GetLinkFileName(); + OUString aURL( aFName.getToken(0,sfx2::cTokenSeparator) ); + OUString aFilter( aFName.getToken(1,sfx2::cTokenSeparator) ); + OUString aSection( aFName.getToken(2,sfx2::cTokenSeparator) ); - String aEncURL( URIHelper::simpleNormalizedMakeRelative(rHTMLWrt.GetBaseURL(), aURL ) ); + OUString aEncURL( URIHelper::simpleNormalizedMakeRelative(rHTMLWrt.GetBaseURL(), aURL ) ); sal_Unicode cDelim = 255U; - bool bURLContainsDelim = - (STRING_NOTFOUND != aEncURL.Search( cDelim ) ); + bool bURLContainsDelim = (-1 != aEncURL.indexOf( cDelim ) ); HTMLOutFuncs::Out_String( rHTMLWrt.Strm(), aEncURL, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); const sal_Char *pDelim = "ÿ"; - if( aFilter.Len() || !aSection.isEmpty() || bURLContainsDelim ) + if( !aFilter.isEmpty() || !aSection.isEmpty() || bURLContainsDelim ) rHTMLWrt.Strm() << pDelim; - if( aFilter.Len() ) + if( !aFilter.isEmpty() ) HTMLOutFuncs::Out_String( rHTMLWrt.Strm(), aFilter, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); if( !aSection.isEmpty() || bURLContainsDelim ) @@ -605,7 +604,7 @@ static void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt, rHTMLWrt.Strm() << '>'; rHTMLWrt.bLFPossible = sal_True; - if( rName.Len() && !bContinued ) + if( !rName.isEmpty() && !bContinued ) rHTMLWrt.OutImplicitMark( rName, "region" ); rHTMLWrt.IncIndentLevel(); |