diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2011-11-25 17:08:17 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2011-11-29 13:27:43 +0100 |
commit | 34a98b79da15793bb9c1454239ae9162c4db94c0 (patch) | |
tree | 7ba41b00de334ed88d1c877e0412e8dd47eacf62 /writerfilter | |
parent | 93be239c9512c27369e1134150610248e93d6157 (diff) |
set properly initial size of starmath component when importing docx
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 58928646e575..41749643f0a4 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -75,6 +75,7 @@ #include <rtl/ustrbuf.hxx> #include <rtl/string.h> #include "FieldTypes.hxx" +#include <oox/mathml/import.hxx> #include <tools/string.hxx> #ifdef DEBUG_DOMAINMAPPER @@ -1102,6 +1103,15 @@ void DomainMapper_Impl::appendStarMath( const Value& val ) xStarMathProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_STREAM_NAME ), val.getAny()); + + uno::Reference< uno::XInterface > xInterface( formula->getComponent(), uno::UNO_QUERY ); + Size size( 1000, 1000 ); + if( oox::FormulaImportBase* formulaimport = dynamic_cast< oox::FormulaImportBase* >( xInterface.get())) + size = formulaimport->getFormulaSize(); + xStarMathProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_WIDTH ), + uno::makeAny( int(size.Width()))); + xStarMathProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_HEIGHT ), + uno::makeAny( int(size.Height()))); // mimic the treatment of graphics here.. it seems anchoring as character // gives a better ( visually ) result xStarMathProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_ANCHOR_TYPE ), |