summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-07-27 21:03:26 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-07-27 21:52:53 +0200
commit383f39493c0ca3e11c296fa37e7d9cf679065f74 (patch)
tree3d7fd82cfa29b64b44b3e3dc0d74e07bb1bf6473 /writerfilter
parentd12f2e9025250a7e310078ff736f8c6756cf894d (diff)
tdf#134610 sw: fix incorrect position of math object from DOCX
Regression from commit a2f85c062aafb3fd9dfb1c6c6e87e1e73e7545a3 (tdf#130362 sw: fix anchoring of inline math objects, 2020-02-04), the problem was that the SwFlyFrameAttrMgr ctor wanted to set the anchor type to at-char, and then later DocumentContentOperationsManager::InsertEmbObject() wanted to undo that for math objects, but this did not play nicely with objects imported from DOCX. So don't set and clear the anchor type, rather set it conditionally in the first place. This allows setting the anchor type in writerfilter/ before insertion, and then all of 1) docx import (depends) 2) insert of Math objects (as-char) 3) insert of images (at-char) are working. Change-Id: I94d82c12f30d069426db1bab70c456cadf1c91ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99559 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 16f9e279a7fb..d3eaa4cb093d 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2319,11 +2319,11 @@ void DomainMapper_Impl::appendStarMath( const Value& val )
uno::makeAny( sal_Int32(size.Width())));
xStarMathProperties->setPropertyValue(getPropertyName( PROP_HEIGHT ),
uno::makeAny( sal_Int32(size.Height())));
+ xStarMathProperties->setPropertyValue(getPropertyName(PROP_ANCHOR_TYPE),
+ uno::makeAny(text::TextContentAnchorType_AS_CHARACTER));
// mimic the treatment of graphics here... it seems anchoring as character
// gives a better ( visually ) result
appendTextContent(xStarMath, uno::Sequence<beans::PropertyValue>());
- xStarMathProperties->setPropertyValue(getPropertyName(PROP_ANCHOR_TYPE),
- uno::makeAny(text::TextContentAnchorType_AS_CHARACTER));
}
catch( const uno::Exception& )
{