sw/source/filter/html/htmlfld.cxx |    8 ++++----
 sw/source/filter/html/swhtml.hxx  |    4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 6e0ddf586eab00831b7c3755c0647d8fdfcec681
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Apr 13 11:01:00 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Apr 13 14:56:20 2023 +0200

    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.gran...@collabora.co.uk>

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;

Reply via email to