[Libreoffice-commits] core.git: include/tools sfx2/source sw/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sat Oct 12 08:03:47 UTC 2019


 include/tools/stream.hxx           |    3 ---
 sfx2/source/bastyp/frmhtmlw.cxx    |    2 +-
 sw/source/core/layout/dbg_lay.cxx  |    4 ++--
 sw/source/filter/html/htmlbas.cxx  |    2 +-
 sw/source/filter/html/htmlfldw.cxx |    4 ++--
 5 files changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 8ab3f399187922452e3f29ce5e1fb933bd3a22a9
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sat Oct 12 08:27:49 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Oct 12 10:02:35 2019 +0200

    All occurrences of WriteOStringBuffer(b) can easily be replaced...
    
    ...with WriteOString(b.makeStringAndClear())
    
    Change-Id: I46be4f80d6633b5c51a2c3d99f9faf0db5764d3f
    Reviewed-on: https://gerrit.libreoffice.org/80704
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index 195119d70d5a..b072970822f9 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -24,7 +24,6 @@
 #include <tools/ref.hxx>
 #include <vcl/errcode.hxx>
 #include <rtl/string.hxx>
-#include <rtl/strbuf.hxx>
 #include <o3tl/typed_flags_set.hxx>
 #include <memory>
 
@@ -248,8 +247,6 @@ public:
     SvStream&       WriteUnicode( sal_Unicode );
     SvStream&       WriteOString(const OString& rStr)
                         { WriteBytes(rStr.getStr(), rStr.getLength()); return *this; }
-    SvStream&       WriteOStringBuffer(const OStringBuffer& rStr)
-                        { WriteBytes(rStr.getStr(), rStr.getLength()); return *this; }
     SvStream&       WriteStream( SvStream& rStream );
     sal_uInt64      WriteStream( SvStream& rStream, sal_uInt64 nSize );
 
diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx
index 23bf6702b7cc..b36539f3a8c3 100644
--- a/sfx2/source/bastyp/frmhtmlw.cxx
+++ b/sfx2/source/bastyp/frmhtmlw.cxx
@@ -307,7 +307,7 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor(
                     .append('=').append(pStr);
             }
         }
-        rOut.WriteOStringBuffer( sOut );
+        rOut.WriteOString( sOut.makeStringAndClear() );
     }
     catch (const uno::Exception&)
     {
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index c4bb72bf294c..46dfae637ef2 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -787,10 +787,10 @@ void SwImplProtocol::Record_( const SwFrame* pFrame, PROT nFunction, DbgAction n
         aOut.append(lcl_CellInfo(pCellFrame));
     }
 
-    pStream->WriteOStringBuffer( aOut );
+    SAL_INFO("sw.layout.debug", aOut.getStr());
+    pStream->WriteOString( aOut.makeStringAndClear() );
     (*pStream) << endl;  // output
     pStream->Flush();   // to the disk, so we can read it immediately
-    SAL_INFO("sw.layout.debug", aOut.getStr());
     if( ++nLineCount >= nMaxLines )     // max number of lines reached?
     {
         SAL_WARN("sw.layout.debug", "max number of lines reached");
diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx
index 5b4e846c2ed2..aaa7dbbbaa89 100644
--- a/sw/source/filter/html/htmlbas.cxx
+++ b/sw/source/filter/html/htmlbas.cxx
@@ -285,7 +285,7 @@ void SwHTMLWriter::OutBasic()
                     .append(OOO_STRING_SVTOOLS_HTML_META_content_script_type)
                     .append("\" ").append(OOO_STRING_SVTOOLS_HTML_O_content)
                     .append("=\"text/x-");
-                Strm().WriteOStringBuffer( sOut );
+                Strm().WriteOString( sOut.makeStringAndClear() );
                 // Entities aren't welcome here
                 Strm().WriteOString( OUStringToOString(sLang, m_eDestEnc) )
                    .WriteCharPtr( "\">" );
diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx
index 776b8e6ccf40..0a581c6e06e9 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -514,7 +514,7 @@ Writer& OutHTML_SwFormatField( Writer& rWrt, const SfxPoolItem& rHt )
             sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_comment)
                 .append(' ').append(OUStringToOString(sComment,
                     static_cast<SwHTMLWriter&>(rWrt).m_eDestEnc)).append(" -->");
-            rWrt.Strm().WriteOStringBuffer( sOut );
+            rWrt.Strm().WriteOString( sOut.makeStringAndClear() );
         }
     }
     else if( SwFieldIds::Script == pFieldTyp->Which() )
@@ -567,7 +567,7 @@ Writer& OutHTML_SwFormatField( Writer& rWrt, const SfxPoolItem& rHt )
                 Color& rColor = SwViewOption::GetFieldShadingsColor();
                 sOut.append(GetCSS1_Color(rColor));
                 sOut.append("\">");
-                rWrt.Strm().WriteOStringBuffer(sOut);
+                rWrt.Strm().WriteOString(sOut.makeStringAndClear());
             }
 
             OutHTML_SwField( rWrt, pField, pTextField->GetTextNode(),


More information about the Libreoffice-commits mailing list