diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-28 15:56:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-02 07:44:26 +0100 |
commit | 0cf5d0fa5e1a7d5dafa7e899e065edb042764f44 (patch) | |
tree | 32eea22346cc65464a477882f39257f1931dec73 /dbaccess | |
parent | Stop Navigator content view flashing (diff) | |
download | core-0cf5d0fa5e1a7d5dafa7e899e065edb042764f44.tar.gz core-0cf5d0fa5e1a7d5dafa7e899e065edb042764f44.zip |
don't rely on parser ::characters callback only firing once
which is true for the old parser, but not always so for the FastParser.
So pre-emptively fix some stuff
Change-Id: I405834f1dfd28c98cae87b6de38d238f723edafd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89712
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/filter/xml/xmlTableFilterPattern.cxx | 10 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlTableFilterPattern.hxx | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/dbaccess/source/filter/xml/xmlTableFilterPattern.cxx b/dbaccess/source/filter/xml/xmlTableFilterPattern.cxx index 0e60eec92290..0c4b2892d2b7 100644 --- a/dbaccess/source/filter/xml/xmlTableFilterPattern.cxx +++ b/dbaccess/source/filter/xml/xmlTableFilterPattern.cxx @@ -42,10 +42,16 @@ OXMLTableFilterPattern::~OXMLTableFilterPattern() void OXMLTableFilterPattern::characters( const OUString& rChars ) { + maBuffer.append(rChars); +} + +void OXMLTableFilterPattern::endFastElement( sal_Int32 ) +{ + OUString sChars = maBuffer.makeStringAndClear(); if ( m_bNameFilter ) - m_rParent.pushTableFilterPattern(rChars); + m_rParent.pushTableFilterPattern(sChars); else - m_rParent.pushTableTypeFilter(rChars); + m_rParent.pushTableTypeFilter(sChars); } } // namespace dbaxml diff --git a/dbaccess/source/filter/xml/xmlTableFilterPattern.hxx b/dbaccess/source/filter/xml/xmlTableFilterPattern.hxx index 81f479898a77..2c6fbb2c76bc 100644 --- a/dbaccess/source/filter/xml/xmlTableFilterPattern.hxx +++ b/dbaccess/source/filter/xml/xmlTableFilterPattern.hxx @@ -19,6 +19,7 @@ #ifndef INCLUDED_DBACCESS_SOURCE_FILTER_XML_XMLTABLEFILTERPATTERN_HXX #define INCLUDED_DBACCESS_SOURCE_FILTER_XML_XMLTABLEFILTERPATTERN_HXX +#include <rtl/ustrbuf.hxx> #include <xmloff/xmlictxt.hxx> namespace dbaxml @@ -28,6 +29,7 @@ namespace dbaxml { OXMLTableFilterList& m_rParent; bool m_bNameFilter; + OUStringBuffer maBuffer; public: OXMLTableFilterPattern( SvXMLImport& rImport ,bool _bNameFilter @@ -37,6 +39,7 @@ namespace dbaxml virtual void SAL_CALL startFastElement( sal_Int32 /*nElement*/, const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override {} + virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override; virtual void SAL_CALL characters( const OUString& rChars ) override; }; } // namespace dbaxml |