diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-13 11:01:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-13 14:56:20 +0200 |
commit | 6e0ddf586eab00831b7c3755c0647d8fdfcec681 (patch) | |
tree | 04ec540a8089ab0478fbfece79d52609c39baf49 | |
parent | 20daf957baea858e57630207896152e740a2fd59 (diff) |
use more string_view in SwHTMLParser
Change-Id: If1dcb2e4207b15eb71bd79469f89526c76f05772
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150335
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/source/filter/html/htmlfld.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.hxx | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index 305f18a10b0f..0b33cc8c6d28 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -584,23 +584,23 @@ void SwHTMLParser::InsertFieldText() } } -void SwHTMLParser::InsertCommentText( const char *pTag ) +void SwHTMLParser::InsertCommentText( std::string_view pTag ) { bool bEmpty = m_aContents.isEmpty(); if( !bEmpty ) m_aContents += "\n"; m_aContents += aToken; - if( bEmpty && pTag ) + if( bEmpty && !pTag.empty() ) { m_aContents = OUString::Concat("HTML: <") + OUString::createFromAscii(pTag) + ">" + m_aContents; } } -void SwHTMLParser::InsertComment( const OUString& rComment, const char *pTag ) +void SwHTMLParser::InsertComment( const OUString& rComment, std::string_view pTag ) { OUString aComment( rComment ); - if( pTag ) + if( !pTag.empty() ) { aComment += "</" + OUString::createFromAscii(pTag) + diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index a605ba13f908..4f017327fe86 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -746,8 +746,8 @@ private: // insert bookmark void InsertBookmark( const OUString& rName ); - void InsertCommentText( const char *pTag ); - void InsertComment( const OUString& rName, const char *pTag = nullptr ); + void InsertCommentText( std::string_view pTag ); + void InsertComment( const OUString& rName, std::string_view pTag = {} ); // Has the current paragraph bookmarks? bool HasCurrentParaBookmarks( bool bIgnoreStack=false ) const; |