summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-09-25 17:06:22 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-10-23 11:53:16 +0200
commit6be21256bdca3d1d1e32b0abec53ba9695ea5808 (patch)
tree2e2b5dfcf38430e7615922d9e5bbf9e249d0329e /sax
parentd55648b7e5cd499196389ed9ba5c7badbf3522e5 (diff)
FastSerializer: Have OString version of write() too.
And remove characters() member function. Change-Id: Ifcedbb6d969b7b057ff378d2fbce09c2dde5ac18
Diffstat (limited to 'sax')
-rw-r--r--sax/source/tools/fastserializer.cxx14
-rw-r--r--sax/source/tools/fastserializer.hxx8
-rw-r--r--sax/source/tools/fshelper.cxx16
3 files changed, 20 insertions, 18 deletions
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx
index a6b5afda6bd4..56b27af7e82d 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -99,9 +99,13 @@ namespace sax_fastparser {
return sBuf.makeStringAndClear();
}
- void FastSaxSerializer::write( const OUString& s )
+ void FastSaxSerializer::write( const OUString& sOutput )
+ {
+ write( OUStringToOString(sOutput, RTL_TEXTENCODING_UTF8) );
+ }
+
+ void FastSaxSerializer::write( const OString& sOutput )
{
- OString sOutput( OUStringToOString( s, RTL_TEXTENCODING_UTF8 ) );
writeBytes( Sequence< sal_Int8 >(
reinterpret_cast< const sal_Int8*>( sOutput.getStr() ),
sOutput.getLength() ) );
@@ -191,12 +195,6 @@ namespace sax_fastparser {
writeBytes(toUnoSequence(maSlashAndClosingBracket));
}
- void SAL_CALL FastSaxSerializer::characters( const OUString& aChars )
- throw (SAXException, RuntimeException)
- {
- write( aChars );
- }
-
void SAL_CALL FastSaxSerializer::setOutputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutputStream )
throw (::com::sun::star::uno::RuntimeException)
{
diff --git a/sax/source/tools/fastserializer.hxx b/sax/source/tools/fastserializer.hxx
index 45535f25b74f..d754b98fbdb1 100644
--- a/sax/source/tools/fastserializer.hxx
+++ b/sax/source/tools/fastserializer.hxx
@@ -100,10 +100,6 @@ public:
void SAL_CALL singleFastElement( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs )
throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- /// receives notification of character data.
- void SAL_CALL characters( const OUString& aChars )
- throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
-
void SAL_CALL setOutputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutputStream )
throw (::com::sun::star::uno::RuntimeException);
@@ -114,6 +110,9 @@ public:
void SAL_CALL writeId( ::sal_Int32 Element );
OString SAL_CALL getId( ::sal_Int32 Element );
+ void write( const OUString& s );
+ void write( const OString& s );
+
static OUString escapeXml( const OUString& s );
public:
@@ -216,7 +215,6 @@ private:
#endif
void writeFastAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs );
- void write( const OUString& s );
void writeOutput( const css::uno::Sequence< ::sal_Int8 >& aData )
throw (css::io::NotConnectedException, css::io::BufferSizeExceededException, css::io::IOException, css::uno::RuntimeException);
diff --git a/sax/source/tools/fshelper.cxx b/sax/source/tools/fshelper.cxx
index c49c0da04bc9..cb2c7f7af6ff 100644
--- a/sax/source/tools/fshelper.cxx
+++ b/sax/source/tools/fshelper.cxx
@@ -107,28 +107,34 @@ void FastSerializerHelper::singleElement(sal_Int32 elementTokenId, XFastAttribut
FastSerializerHelper* FastSerializerHelper::write(const char* value)
{
- return write(OUString::createFromAscii(value));
+ return write(OString(value));
}
FastSerializerHelper* FastSerializerHelper::write(const OUString& value)
{
- mpSerializer->characters(value);
+ mpSerializer->write(value);
+ return this;
+}
+
+FastSerializerHelper* FastSerializerHelper::write(const OString& value)
+{
+ mpSerializer->write(value);
return this;
}
FastSerializerHelper* FastSerializerHelper::write(sal_Int32 value)
{
- return write(OUString::number(value));
+ return write(OString::number(value));
}
FastSerializerHelper* FastSerializerHelper::write(sal_Int64 value)
{
- return write(OUString::number(value));
+ return write(OString::number(value));
}
FastSerializerHelper* FastSerializerHelper::write(double value)
{
- return write(OUString::number(value));
+ return write(OString::number(value));
}
FastSerializerHelper* FastSerializerHelper::writeEscaped(const char* value)