[Libreoffice-commits] core.git: sw/qa

Miklos Vajna vmiklos at collabora.co.uk
Wed Apr 9 02:46:19 PDT 2014


 sw/qa/extras/inc/swmodeltestbase.hxx |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 8329afc2ba53f7d675b7d45f1aba615e136d6e53
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Apr 9 11:21:39 2014 +0200

    SwModelTestBase: use rtl::ByteSequence
    
    Change-Id: I39dde5fa13f6d393ebac05138e1deadd98689199

diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index d5d02d0..907f3c9 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -26,6 +26,7 @@
 #include <unotools/ucbstreamhelper.hxx>
 #include <rtl/strbuf.hxx>
 #include <rtl/ustrbuf.hxx>
+#include <rtl/byteseq.hxx>
 #include <comphelper/processfactory.hxx>
 #include <unotools/tempfile.hxx>
 #include <unotools/mediadescriptor.hxx>
@@ -575,16 +576,11 @@ protected:
         pStream->Seek(STREAM_SEEK_TO_END);
         sal_Size nSize = pStream->Tell();
         pStream->Seek(0);
-        OStringBuffer aDocument(nSize);
-        char ch;
-        for (sal_Size i = 0; i < nSize; ++i)
-        {
-            pStream->ReadChar( ch );
-            aDocument.append(ch);
-        }
+        rtl::ByteSequence aBuffer(nSize + 1);
+        pStream->Read(aBuffer.getArray(), nSize);
 
         // Parse the XML.
-        return xmlParseMemory((const char*)aDocument.getStr(), aDocument.getLength());
+        return xmlParseMemory(reinterpret_cast<const char*>(aBuffer.getArray()), aBuffer.getLength());
     }
 
     /**


More information about the Libreoffice-commits mailing list