[Libreoffice-commits] .: Branch 'distro/suse/suse-3.6' - writerfilter/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Oct 11 03:05:02 PDT 2012
writerfilter/source/dmapper/GraphicImport.cxx | 28 +++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
New commits:
commit 3852f56ebc7f7ed26bcaf60474448ca4097c53d6
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Thu Oct 11 10:21:57 2012 +0200
n#783638 DOCX import of wp:inline's distT/B/L/R attributes
Change-Id: I181fcae021eed07608b06744b469628e4d78ccba
(cherry picked from commit 847c5c1339bf0cfd9f3e3c92e8d81ef32bee6c21)
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 18f65a4..90d8636 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -342,6 +342,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));
+ }
};
@@ -959,10 +968,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();
@@ -1413,14 +1429,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 &&
@@ -1510,6 +1519,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() )
More information about the Libreoffice-commits
mailing list