summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-07-27 21:03:26 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-07-30 11:44:03 +0200
commit4682675b735bc8c0b693b422f0cf43743956f834 (patch)
tree8484a072a9926b33774ef805d1045da85406b063 /writerfilter
parent195e496f6ce92e9e5baa4b58015281a5c91fbf1a (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. (cherry picked from commit 383f39493c0ca3e11c296fa37e7d9cf679065f74) Change-Id: I94d82c12f30d069426db1bab70c456cadf1c91ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99661 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
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 3f3ce4585b9f..a52151a60c0e 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2297,11 +2297,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& )
{