diff options
Diffstat (limited to 'editeng/source/editeng/eehtml.cxx')
-rw-r--r-- | editeng/source/editeng/eehtml.cxx | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx index a3de37005ffc..b3ed28395506 100644 --- a/editeng/source/editeng/eehtml.cxx +++ b/editeng/source/editeng/eehtml.cxx @@ -31,12 +31,13 @@ #include <tools/tenccvt.hxx> #include <editeng/editeng.hxx> +#include <utility> #define STYLE_PRE 101 -EditHTMLParser::EditHTMLParser( SvStream& rIn, const OUString& rBaseURL, SvKeyValueIterator* pHTTPHeaderAttrs ) +EditHTMLParser::EditHTMLParser( SvStream& rIn, OUString _aBaseURL, SvKeyValueIterator* pHTTPHeaderAttrs ) : HTMLParser( rIn, true ), - aBaseURL( rBaseURL ), + aBaseURL(std::move( _aBaseURL )), mpEditEngine(nullptr), bInPara(false), bWasInPara(false), @@ -179,26 +180,19 @@ void EditHTMLParser::NextToken( HtmlTokenId nToken ) if ( !bInPara ) StartPara( false ); - OUString aText = aToken; + OUString aText = aToken.toString(); if ( aText.startsWith(" ") && ThrowAwayBlank() && !IsReadPRE() ) aText = aText.copy( 1 ); - if ( pCurAnchor ) + if ( moCurAnchor ) { - pCurAnchor->aText += aText; + moCurAnchor->aText += aText; } else { // Only written until HTML with 319? if ( IsReadPRE() ) - { - sal_Int32 nTabPos = aText.indexOf( '\t'); - while ( nTabPos != -1 ) - { - aText = aText.replaceAt( nTabPos, 1, u" " ); - nTabPos = aText.indexOf( '\t', nTabPos+8 ); - } - } + aText = aText.replaceAll(u"\t", u" "); ImpInsertText( aText ); } } @@ -745,7 +739,7 @@ bool EditHTMLParser::HasTextInCurrentPara() void EditHTMLParser::AnchorStart() { // ignore anchor in anchor - if ( pCurAnchor ) + if ( moCurAnchor ) return; const HTMLOptions& aOptions = GetOptions(); @@ -768,20 +762,20 @@ void EditHTMLParser::AnchorStart() aRootURL.GetNewAbsURL( aRef, &aTargetURL ); aURL = aTargetURL.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ); } - pCurAnchor.reset( new AnchorInfo ); - pCurAnchor->aHRef = aURL; + moCurAnchor.emplace(); + moCurAnchor->aHRef = aURL; } void EditHTMLParser::AnchorEnd() { - if ( !pCurAnchor ) + if ( !moCurAnchor ) return; // Insert as URL-Field... - SvxFieldItem aFld( SvxURLField( pCurAnchor->aHRef, pCurAnchor->aText, SvxURLFormat::Repr ), EE_FEATURE_FIELD ); + SvxFieldItem aFld( SvxURLField( moCurAnchor->aHRef, moCurAnchor->aText, SvxURLFormat::Repr ), EE_FEATURE_FIELD ); aCurSel = mpEditEngine->InsertField(aCurSel, aFld); bFieldsInserted = true; - pCurAnchor.reset(); + moCurAnchor.reset(); if (mpEditEngine->IsHtmlImportHandlerSet()) { |