diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-10-11 10:21:57 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-10-11 10:52:38 +0200 |
commit | 3d7e168a2a43c2414b0633379102ddb29437e75b (patch) | |
tree | 5ee0584a027632cefb8cda10c7efb0616bae23d2 /writerfilter | |
parent | VCLMultiLineEdit->VclMultiLineEdit to align with other new widget names (diff) | |
download | core-3d7e168a2a43c2414b0633379102ddb29437e75b.tar.gz core-3d7e168a2a43c2414b0633379102ddb29437e75b.zip |
n#783638 DOCX import of wp:inline's distT/B/L/R attributes
Change-Id: I181fcae021eed07608b06744b469628e4d78ccba
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 9042f808beb4..5709a1784014 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -339,6 +339,15 @@ public: { return bYSizeValid; } + + void applyMargins(uno::Reference< beans::XPropertySet > xGraphicObjectProperties) const + { + PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier(); + xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_LEFT_MARGIN ), uno::makeAny(nLeftMargin)); + xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_RIGHT_MARGIN ), uno::makeAny(nRightMargin)); + xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_TOP_MARGIN ), uno::makeAny(nTopMargin)); + xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_BOTTOM_MARGIN ), uno::makeAny(nBottomMargin)); + } }; @@ -969,10 +978,17 @@ void GraphicImport::lcl_attribute(Id nName, Value & val) } break; case NS_ooxml::LN_CT_Inline_distT: + m_pImpl->nTopMargin = ConversionHelper::convertTwipToMM100(nIntValue); + break; case NS_ooxml::LN_CT_Inline_distB: + m_pImpl->nBottomMargin = ConversionHelper::convertTwipToMM100(nIntValue); + break; case NS_ooxml::LN_CT_Inline_distL: + m_pImpl->nLeftMargin = ConversionHelper::convertTwipToMM100(nIntValue); + break; case NS_ooxml::LN_CT_Inline_distR: - //TODO: need to be handled + m_pImpl->nRightMargin = ConversionHelper::convertTwipToMM100(nIntValue); + break; break; case NS_ooxml::LN_CT_GraphicalObjectData_uri: val.getString(); @@ -1453,14 +1469,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b uno::makeAny(m_pImpl->bContour)); xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_CONTOUR_OUTSIDE ), uno::makeAny(m_pImpl->bContourOutside)); - xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_LEFT_MARGIN ), - uno::makeAny(m_pImpl->nLeftMargin)); - xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_RIGHT_MARGIN ), - uno::makeAny(m_pImpl->nRightMargin)); - xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_TOP_MARGIN ), - uno::makeAny(m_pImpl->nTopMargin)); - xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_BOTTOM_MARGIN ), - uno::makeAny(m_pImpl->nBottomMargin)); + m_pImpl->applyMargins(xGraphicObjectProperties); if( m_pImpl->eColorMode == drawing::ColorMode_STANDARD && m_pImpl->nContrast == -70 && @@ -1550,6 +1559,7 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b if( m_pImpl->getXSize() && m_pImpl->getYSize() ) xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_SIZE), uno::makeAny( awt::Size( m_pImpl->getXSize(), m_pImpl->getYSize() ))); + m_pImpl->applyMargins(xGraphicObjectProperties); try { if( !m_pImpl->sName.isEmpty() ) |