summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-08-23 14:06:45 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-08-24 08:47:29 +0200
commit44bdf23e3fa29f1b37faa6460bdf61e4b4627fe8 (patch)
tree24545212a59cc15dc7df363511760159ce5d741a /writerfilter
parent7f18b80a3bd2b3c126ac852c7ecd5ceb376f389d (diff)
fix math export/import in docx/rtf
For some reason older gcc versions don't manage to dynamic_cast to the necessary cast. I'm not quite sure why, forcing sal/osl/unx/module.cxx to always use RTLD_GLOBAL does not seem to help. Most probably compiler bug. Changing the cast to two simpler ones helps. Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/Library_writerfilter.mk1
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx9
2 files changed, 8 insertions, 2 deletions
diff --git a/writerfilter/Library_writerfilter.mk b/writerfilter/Library_writerfilter.mk
index 5a34f94ae12c..f157ae176198 100644
--- a/writerfilter/Library_writerfilter.mk
+++ b/writerfilter/Library_writerfilter.mk
@@ -66,6 +66,7 @@ $(eval $(call gb_Library_use_libraries,writerfilter,\
msfilter \
oox \
sal \
+ sfx \
sot \
svt \
tl \
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 6efa44c4e671..f062a264392c 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -42,6 +42,7 @@
#include <comphelper/embeddedobjectcontainer.hxx>
#include <tools/globname.hxx>
#include <comphelper/classids.hxx>
+#include <sfx2/sfxbasemodel.hxx>
#include "OOXMLFastContextHandler.hxx"
#include "OOXMLFactory.hxx"
#include "Handler.hxx"
@@ -2452,8 +2453,12 @@ void OOXMLFastContextHandlerMath::process()
rtl::OUString aName;
uno::Reference< embed::XEmbeddedObject > ref = container.CreateEmbeddedObject( name.GetByteSequence(), aName );
uno::Reference< uno::XInterface > component( ref->getComponent(), uno::UNO_QUERY );
- if( oox::FormulaImportBase* import = dynamic_cast< oox::FormulaImportBase* >( component.get()))
- import->readFormulaOoxml( buffer );
+// gcc4.4 (and 4.3 and possibly older) have a problem with dynamic_cast directly to the target class,
+// so help it with an intermediate cast. I'm not sure what exactly the problem is, seems to be unrelated
+// to RTLD_GLOBAL, so most probably a gcc bug.
+ oox::FormulaImportBase* import = dynamic_cast< oox::FormulaImportBase* >( dynamic_cast< SfxBaseModel* >(component.get()));
+ assert( import != NULL );
+ import->readFormulaOoxml( buffer );
if (isForwardEvents())
{
OOXMLPropertySet * pProps = new OOXMLPropertySetImpl();