summaryrefslogtreecommitdiff
path: root/filter/source/xsltfilter/XSLTFilter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'filter/source/xsltfilter/XSLTFilter.cxx')
-rw-r--r--filter/source/xsltfilter/XSLTFilter.cxx31
1 files changed, 16 insertions, 15 deletions
diff --git a/filter/source/xsltfilter/XSLTFilter.cxx b/filter/source/xsltfilter/XSLTFilter.cxx
index 3ceb2a002cc8..44f9ce4d8172 100644
--- a/filter/source/xsltfilter/XSLTFilter.cxx
+++ b/filter/source/xsltfilter/XSLTFilter.cxx
@@ -46,8 +46,10 @@
#include <com/sun/star/xml/sax/InputSource.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+#include <com/sun/star/xml/sax/XFastParser.hpp>
#include <com/sun/star/xml/sax/Writer.hpp>
#include <com/sun/star/xml/XImportFilter.hpp>
+#include <com/sun/star/xml/XImportFilter2.hpp>
#include <com/sun/star/xml/XExportFilter.hpp>
#include <com/sun/star/util/theMacroExpander.hpp>
@@ -64,8 +66,6 @@
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
#include <com/sun/star/xml/xslt/XSLTTransformer.hpp>
-#include <sax/ximportfilter2.hxx>
-#include <sax/xfastparser.hxx>
#include <utility>
#define TRANSFORMATION_TIMEOUT_SEC 60
@@ -118,8 +118,8 @@ namespace XSLT
* supporting service from an extension for a specific filter; the
* service must support com.sun.star.xml.xslt.XSLT2Transformer.
*/
- class XSLTFilter : public WeakImplHelper<XImportFilter, XExportFilter,
- ExtendedDocumentHandlerAdapter, XServiceInfo>, public XImportFilter2
+ class XSLTFilter : public WeakImplHelper<XImportFilter, XImportFilter2, XExportFilter,
+ ExtendedDocumentHandlerAdapter, XServiceInfo>
{
friend class XSLTFilterStreamListener;
private:
@@ -162,9 +162,9 @@ namespace XSLT
const Sequence<OUString>& msUserData) override;
// XImportFilter2
- virtual bool
- importer(const Sequence<PropertyValue>& aSourceData,
- XFastParser& xFastParser,
+ virtual sal_Bool SAL_CALL
+ importer(const Sequence<PropertyValue>& aSourceData, const css::uno::Reference<
+ XFastParser>& xFastParser,
const Sequence<OUString>& msUserData) override;
// XExportFilter
@@ -362,8 +362,8 @@ namespace XSLT
aInput.sPublicId = aURL;
aInput.aInputStream = pipein;
- XFastParser* pFastParser = dynamic_cast<XFastParser*>(
- xHandler.get() );
+ css::uno::Reference< css::xml::sax::XFastParser > xFastParser(
+ xHandler, css::uno::UNO_QUERY );
// transform
m_tcontrol->start();
@@ -394,8 +394,8 @@ namespace XSLT
result = m_cTransformed.wait(&timeout);
};
if (!m_bError) {
- if( pFastParser )
- pFastParser->parseStream( aInput );
+ if( xFastParser.is() )
+ xFastParser->parseStream( aInput );
else
{
// create SAX parser that will read the document file
@@ -422,9 +422,9 @@ namespace XSLT
}
}
- bool
+ sal_Bool
XSLTFilter::importer(const Sequence<PropertyValue>& aSourceData,
- XFastParser& rFastParser, const Sequence<
+ const css::uno::Reference<XFastParser>& xFastParser, const Sequence<
OUString>& msUserData)
{
if (msUserData.getLength() < 5)
@@ -461,9 +461,10 @@ namespace XSLT
Any(NamedValue("SourceBaseURL", Any(INetURLObject(aURL).getBase()))) };
m_tcontrol = impl_createTransformer(msUserData[1], args);
+ assert(xFastParser.is());
OSL_ASSERT(xInputStream.is());
OSL_ASSERT(m_tcontrol.is());
- if (xInputStream.is() && m_tcontrol.is())
+ if (xFastParser.is() && xInputStream.is() && m_tcontrol.is())
{
try
{
@@ -520,7 +521,7 @@ namespace XSLT
result = m_cTransformed.wait(&timeout);
};
if (!m_bError)
- rFastParser.parseStream( aInput );
+ xFastParser->parseStream( aInput );
m_tcontrol->terminate();
return !m_bError;
}