summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-06-01 13:41:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-06-01 15:07:18 +0200
commite899a75fc6dd600ea9992c851a42734b334122b6 (patch)
tree1a54173803fc304f8af8802654ec147c6e6ad38d /sd
parent020d72fb85dac7a52eacb29731b8f2d536a2892d (diff)
Revert "Convert XFastParser into a normal C++ interface"
This reverts commit 5e68d6cfade45f40b1ad46025a81afe4cb8dd337. Reason for revert: Seems like outside users have been using this API Change-Id: I8814cf1eb4f000eeb4cbbb5db9c282d001465993 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152441 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/CustomAnimationPreset.cxx9
-rw-r--r--sd/source/core/drawdoc4.cxx9
-rw-r--r--sd/source/filter/xml/sdxmlwrp.cxx12
3 files changed, 14 insertions, 16 deletions
diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx
index 65aa70b8fe96..242af4bd3a00 100644
--- a/sd/source/core/CustomAnimationPreset.cxx
+++ b/sd/source/core/CustomAnimationPreset.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/xml/sax/InputSource.hpp>
+#include <com/sun/star/xml/sax/XFastParser.hpp>
#include <com/sun/star/presentation/EffectPresetClass.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <unotools/streamwrap.hxx>
@@ -33,7 +34,6 @@
#include <comphelper/random.hxx>
#include <comphelper/lok.hxx>
#include <unotools/syslocaleoptions.hxx>
-#include <sax/xfastparser.hxx>
#include <tools/stream.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <o3tl/string_view.hxx>
@@ -225,12 +225,11 @@ Reference< XAnimationNode > implImportEffects( const Reference< XMultiServiceFac
aParserInput.aInputStream = xInputStream;
// get filter
- Reference< XInterface > xInterface( xServiceFactory->createInstance("com.sun.star.comp.Xmloff.AnimationsImport" ) );
- XFastParser* pFilter = dynamic_cast<XFastParser*>(xInterface.get());
+ Reference< xml::sax::XFastParser > xFilter( xServiceFactory->createInstance("com.sun.star.comp.Xmloff.AnimationsImport" ), UNO_QUERY_THROW );
- pFilter->parseStream( aParserInput );
+ xFilter->parseStream( aParserInput );
- Reference< XAnimationNodeSupplier > xAnimationNodeSupplier( xInterface, UNO_QUERY_THROW );
+ Reference< XAnimationNodeSupplier > xAnimationNodeSupplier( xFilter, UNO_QUERY_THROW );
xRootNode = xAnimationNodeSupplier->getAnimationNode();
}
catch (const Exception&)
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index db64ba8e88b6..91c4dc600703 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -25,7 +25,7 @@
#include <com/sun/star/form/XReset.hpp>
#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/xml/sax/InputSource.hpp>
+#include <com/sun/star/xml/sax/XFastParser.hpp>
#include <i18nlangtag/languagetag.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <sfx2/dispatch.hxx>
@@ -40,7 +40,6 @@
#include <rtl/bootstrap.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/streamwrap.hxx>
-#include <sax/xfastparser.hxx>
#include <tools/stream.hxx>
#include <tools/UnitConversion.hxx>
@@ -647,9 +646,9 @@ void SdDrawDocument::CreateDefaultCellStyles()
css::xml::sax::InputSource aParserInput;
aParserInput.sPublicId = aURL;
aParserInput.aInputStream = xInputStream;
- XFastParser* pFastParser = dynamic_cast<XFastParser*>(xImporter.get());
- if (pFastParser)
- pFastParser->parseStream(aParserInput);
+ Reference<css::xml::sax::XFastParser> xFastParser(xImporter, UNO_QUERY);
+ if (xFastParser)
+ xFastParser->parseStream(aParserInput);
// Set default fonts, if they were not defined in the xml.
vcl::Font aLatinFont, aCJKFont, aCTLFont;
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index ad36030f5e1c..43c3d0d7766d 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -28,7 +28,6 @@
#include <comphelper/propertysequence.hxx>
#include <o3tl/string_view.hxx>
#include <editeng/outlobj.hxx>
-#include <sax/xfastparser.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/sfxsids.hrc>
@@ -46,6 +45,7 @@
#include <svx/xmleohlp.hxx>
#include <com/sun/star/xml/sax/Parser.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <com/sun/star/xml/sax/XFastParser.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/document/XExporter.hpp>
@@ -198,11 +198,11 @@ ErrCode ReadThroughComponent(
SAL_WARN_IF(!xFilter.is(), "sd.filter", "Can't instantiate filter component: " << aFilterName);
if( !xFilter.is() )
return SD_XML_READERROR;
- XFastParser* pFastParser = dynamic_cast<XFastParser*>(xFilter.get());
+ Reference< xml::sax::XFastParser > xFastParser(xFilter, UNO_QUERY);
Reference< xml::sax::XDocumentHandler > xDocumentHandler;
- if (!pFastParser)
+ if (!xFastParser)
xDocumentHandler.set(xFilter, UNO_QUERY);
- if (!pFastParser && !xDocumentHandler)
+ if (!xFastParser && !xDocumentHandler)
{
SAL_WARN("sd", "service does not implement XFastParser or XDocumentHandler");
assert(false);
@@ -218,8 +218,8 @@ ErrCode ReadThroughComponent(
SAL_INFO( "sd.filter", "parsing stream" );
try
{
- if (pFastParser)
- pFastParser->parseStream( aParserInput );
+ if (xFastParser)
+ xFastParser->parseStream( aParserInput );
else
{
Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(rxContext);