summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-11-25 17:08:17 +0100
committerLuboš Luňák <l.lunak@suse.cz>2011-11-29 13:27:43 +0100
commit34a98b79da15793bb9c1454239ae9162c4db94c0 (patch)
tree7ba41b00de334ed88d1c877e0412e8dd47eacf62 /writerfilter
parent93be239c9512c27369e1134150610248e93d6157 (diff)
set properly initial size of starmath component when importing docx
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx10
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 ),