diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2011-11-25 13:43:52 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2011-11-29 13:27:43 +0100 |
commit | 86eccc72c502ed08938b4b2d2f4e0fdda17f82cb (patch) | |
tree | 11d35cfe793d4ef5218c71b9d3ee1614c609de3c /writerfilter | |
parent | simplify attribute retrieval syntax a bit (diff) | |
download | core-86eccc72c502ed08938b4b2d2f4e0fdda17f82cb.tar.gz core-86eccc72c502ed08938b4b2d2f4e0fdda17f82cb.zip |
clean up and format code
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 389b2b34672b..4833bba34aad 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1092,32 +1092,32 @@ void DomainMapper_Impl::appendOLE( const ::rtl::OUString& rStreamName, OLEHandle void DomainMapper_Impl::appendStarMath( const Value& val ) { - uno::Reference< embed::XEmbeddedObject > formula; - val.getAny() >>= formula; - if( formula.is() ) - { - if( oox::FormulaImportHelper* import = dynamic_cast< oox::FormulaImportHelper* >( GetTextDocument().get())) - import->addFormula( formula ); - static const rtl::OUString sEmbeddedService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextEmbeddedObject")); - try + uno::Reference< embed::XEmbeddedObject > formula; + val.getAny() >>= formula; + if( formula.is() ) { - uno::Reference< text::XTextContent > xOLE( m_xTextFactory->createInstance(sEmbeddedService), uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xOLEProperties(xOLE, uno::UNO_QUERY_THROW); - - xOLEProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_STREAM_NAME ), - val.getAny()); - // mimic the treatment of graphics here.. it seems anchoring as character - // gives a better ( visually ) result - xOLEProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_ANCHOR_TYPE ), uno::makeAny( text::TextContentAnchorType_AS_CHARACTER ) ); - appendTextContent( xOLE, uno::Sequence< beans::PropertyValue >() ); + if( oox::FormulaImportHelper* import = dynamic_cast< oox::FormulaImportHelper* >( GetTextDocument().get())) + import->addFormula( formula ); + static const rtl::OUString sEmbeddedService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextEmbeddedObject")); + try + { + uno::Reference< text::XTextContent > xStarMath( m_xTextFactory->createInstance(sEmbeddedService), uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xStarMathProperties(xStarMath, uno::UNO_QUERY_THROW); + xStarMathProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_STREAM_NAME ), + val.getAny()); + // mimic the treatment of graphics here.. it seems anchoring as character + // gives a better ( visually ) result + xStarMathProperties->setPropertyValue(PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_ANCHOR_TYPE ), + uno::makeAny( text::TextContentAnchorType_AS_CHARACTER ) ); + appendTextContent( xStarMath, uno::Sequence< beans::PropertyValue >() ); + } + catch( const uno::Exception& rEx ) + { + (void)rEx; + OSL_FAIL( "Exception in creation of StarMath object" ); + } } - catch( const uno::Exception& rEx ) - { - (void)rEx; - OSL_FAIL( "Exception in creation of OLE object" ); - } - } } uno::Reference< beans::XPropertySet > DomainMapper_Impl::appendTextSectionAfter( |