diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2025-02-05 11:47:42 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2025-02-05 18:24:54 +0100 |
commit | 796097c546c921b627f5e25f2a4f3d8bc0a6b37c (patch) | |
tree | 03f23b76d6fa578492b77a1ada674c6dcecb7563 /sax | |
parent | 0843e1df9be6451d3462d0c907de945df30bbf68 (diff) |
use more ByteSequence in sax
Change-Id: I514b022256acc60c20e430ef6e68815a47859ab6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181185
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/tools/CachedOutputStream.hxx | 10 | ||||
-rw-r--r-- | sax/source/tools/fastserializer.cxx | 10 | ||||
-rw-r--r-- | sax/source/tools/fastserializer.hxx | 5 |
3 files changed, 13 insertions, 12 deletions
diff --git a/sax/source/tools/CachedOutputStream.hxx b/sax/source/tools/CachedOutputStream.hxx index 873ed51fe06a..77e21b1d417f 100644 --- a/sax/source/tools/CachedOutputStream.hxx +++ b/sax/source/tools/CachedOutputStream.hxx @@ -21,11 +21,13 @@ namespace sax_fastparser { +typedef rtl::ByteSequence Int8Sequence; + class ForMergeBase { public: virtual ~ForMergeBase() {} - virtual void append( const css::uno::Sequence<sal_Int8>& rWhat ) = 0; + virtual void append( const Int8Sequence& rWhat ) = 0; }; class CachedOutputStream @@ -35,7 +37,7 @@ class CachedOutputStream /// ForMerge structure is used for sorting elements in Writer std::shared_ptr< ForMergeBase > mpForMerge; - const rtl::ByteSequence maCache; + const Int8Sequence maCache; /// Output stream, usually writing data into files. css::uno::Reference< css::io::XOutputStream > mxOutputStream; uno_Sequence *pSeq; @@ -89,7 +91,7 @@ public: if (mbWriteToOutStream) mxOutputStream->writeBytes( css::uno::Sequence<sal_Int8>(pStr, nLen) ); else - mpForMerge->append( css::uno::Sequence<sal_Int8>(pStr, nLen) ); + mpForMerge->append( Int8Sequence(pStr, nLen) ); return; } } @@ -106,7 +108,7 @@ public: if (mbWriteToOutStream) mxOutputStream->writeBytes( css::uno::toUnoSequence(maCache) ); else - mpForMerge->append( css::uno::toUnoSequence(maCache) ); + mpForMerge->append( maCache ); // and next time write to the beginning mnCacheWrittenSize = 0; } diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index ed1fbfafb4a0..47230fbc20b8 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -601,7 +601,7 @@ namespace sax_fastparser { maMarkStack.top()->m_DebugStartedElements.pop_front(); } #endif - Sequence<sal_Int8> aSeq( maMarkStack.top()->getData() ); + Int8Sequence aSeq( maMarkStack.top()->getData() ); maMarkStack.pop(); mbMarkStackEmpty = true; maCachedOutputStream.resetOutputToStream(); @@ -698,7 +698,7 @@ namespace sax_fastparser { maCachedOutputStream.writeBytes( reinterpret_cast<const sal_Int8*>(pStr), nLen ); } - FastSaxSerializer::Int8Sequence& FastSaxSerializer::ForMerge::getData() + Int8Sequence& FastSaxSerializer::ForMerge::getData() { merge( maData, maPostponed, true ); maPostponed.realloc( 0 ); @@ -730,7 +730,7 @@ namespace sax_fastparser { merge( maData, rWhat, false ); } - void FastSaxSerializer::ForMerge::append( const css::uno::Sequence<sal_Int8> &rWhat ) + void FastSaxSerializer::ForMerge::append( const Int8Sequence &rWhat ) { merge( maData, rWhat, true ); } @@ -783,7 +783,7 @@ namespace sax_fastparser { append( rWhat ); } - void FastSaxSerializer::ForSort::append( const css::uno::Sequence<sal_Int8> &rWhat ) + void FastSaxSerializer::ForSort::append( const Int8Sequence &rWhat ) { merge( maData[mnCurrentElement], rWhat, true ); } @@ -803,7 +803,7 @@ namespace sax_fastparser { } } - FastSaxSerializer::Int8Sequence& FastSaxSerializer::ForSort::getData() + Int8Sequence& FastSaxSerializer::ForSort::getData() { sort( ); return ForMerge::getData(); diff --git a/sax/source/tools/fastserializer.hxx b/sax/source/tools/fastserializer.hxx index 8d97caf305a4..3ed38d59b91c 100644 --- a/sax/source/tools/fastserializer.hxx +++ b/sax/source/tools/fastserializer.hxx @@ -45,7 +45,6 @@ typedef std::vector<TokenValue> TokenValueList; /// Receives notification of sax document events to write into an XOutputStream. class FastSaxSerializer { - typedef css::uno::Sequence< ::sal_Int8 > Int8Sequence; typedef css::uno::Sequence< ::sal_Int32 > Int32Sequence; public: @@ -189,7 +188,7 @@ private: #endif virtual void prepend( const Int8Sequence &rWhat ); - virtual void append( const css::uno::Sequence<sal_Int8> &rWhat ) override; + virtual void append( const Int8Sequence &rWhat ) override; void postpone( const Int8Sequence &rWhat ); protected: @@ -220,7 +219,7 @@ private: #endif virtual void prepend( const Int8Sequence &rWhat ) override; - virtual void append( const css::uno::Sequence<sal_Int8> &rWhat ) override; + virtual void append( const Int8Sequence &rWhat ) override; private: void sort(); }; |