diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-19 11:55:29 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-19 17:07:02 +0100 |
commit | cc8f8ae55f681755f5da3bf64e4c30bb713f0383 (patch) | |
tree | e5df935b163030d74a21329457033f2255d25841 /writerfilter | |
parent | a5d7813de1d2e9c3234c5c0c32987c137bdf3ca1 (diff) |
DOCX drawingML shape import: wp:anchor's behindDoc attribute
Also, adapt anchoring to what we have in VML import as well: when the
paragraph moves, the shape should stay at the same place. (This is a bit
odd, as ideally Word does not support at-paragraph anchoring, but this
change results in the behavior what Word does at the end.)
Change-Id: I3b849b2898d303e48920e6056c472f08fbb43af1
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index da957ce0e4d8..7c3de0075137 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -997,10 +997,14 @@ void GraphicImport::lcl_attribute(Id nName, Value & val) // If we are here, this is a drawingML shape. For those, only dmapper (and not oox) knows the anchoring infos (just like for Writer pictures). // But they aren't Writer pictures, either (which are already handled above). uno::Reference< beans::XPropertySet > xShapeProps(m_xShape, uno::UNO_QUERY_THROW); - xShapeProps->setPropertyValue("AnchorType", uno::makeAny(text::TextContentAnchorType_AT_CHARACTER)); + // This needs to be AT_PARAGRAPH and not AT_CHARACTER, otherwise shape will move when the user inserts a new paragraph. + xShapeProps->setPropertyValue("AnchorType", uno::makeAny(text::TextContentAnchorType_AT_PARAGRAPH)); m_xShape->setPosition(awt::Point(m_pImpl->nLeftPosition, m_pImpl->nTopPosition)); m_pImpl->applyMargins(xShapeProps); + bool bOpaque = m_pImpl->bOpaque && !m_pImpl->rDomainMapper.IsInHeaderFooter(); + if (!bOpaque) + xShapeProps->setPropertyValue("Opaque", uno::makeAny(bOpaque)); xShapeProps->setPropertyValue("Surround", uno::makeAny(m_pImpl->nWrap)); } } |