summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-09-08 16:49:09 +0300
committerJustin Luth <justin_luth@sil.org>2020-09-10 07:40:04 +0200
commitd865ae748ae3b1d054051b89938eaef30680e06c (patch)
tree5ce070973ba8b503c00e1dd34d49f4799b7ca42b /writerfilter
parent2dc30bd6ee88a2e3a1b4607c144f151e7329f3b9 (diff)
tdf#135943 writerfilter: ignore compat LayoutInCell for txbx
... until such a time when the underlying problem of textbox position not syncing with the moved frame is fixed. Bug 77794 moved the frame to the correct position, but the text only followed when going to the frame property, looking at the values, and pressing OK. So, it seems like the layout is re-positioning the frame, but that frame change is not being synchronized back to the paired up textbox. Since I couldn't figure out how to resolve that, I'm just temporarily avoiding the problem that my 7.1 change for tdf#77794 has exposed. That means that the textbox/frame is in the wrong position (same as in previous LO versions), but at least the text is inside of the frame. Change-Id: I7dc712c613b164317bc4adf19ac231488d610c95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102258 Tested-by: Justin Luth <justin_luth@sil.org> Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index dde3e1adb3b7..9853bb48bb1e 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -206,6 +206,7 @@ public:
sal_Int16 nVertRelation;
text::WrapTextMode nWrap;
bool bLayoutInCell;
+ bool bCompatForcedLayoutInCell;
bool bAllowOverlap = true;
bool bOpaque;
bool bBehindDoc;
@@ -273,6 +274,7 @@ public:
,nVertRelation( text::RelOrientation::FRAME )
,nWrap(text::WrapTextMode_NONE)
,bLayoutInCell(true)
+ ,bCompatForcedLayoutInCell(false)
,bOpaque( !rDMapper.IsInHeaderFooter() )
,bBehindDoc(false)
,bContour(false)
@@ -626,8 +628,10 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
break;
case NS_ooxml::LN_CT_Anchor_layoutInCell: // 90991; - ignored
// Starting in MSO 2013, anchors are ALWAYS considered to be laid out in table cell.
- m_pImpl->bLayoutInCell = nIntValue != 0 ||
- (m_pImpl->rDomainMapper.GetSettingsTable()->GetWordCompatibilityMode() > 14 && m_pImpl->rDomainMapper.IsInTable());
+ m_pImpl->bCompatForcedLayoutInCell = !nIntValue
+ && m_pImpl->rDomainMapper.GetSettingsTable()->GetWordCompatibilityMode() > 14
+ && m_pImpl->rDomainMapper.IsInTable();
+ m_pImpl->bLayoutInCell = m_pImpl->bCompatForcedLayoutInCell || nIntValue;
break;
case NS_ooxml::LN_CT_Anchor_hidden: // 90992; - ignored
break;
@@ -855,6 +859,15 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
// Avoid setting AnchorType for TextBoxes till SwTextBoxHelper::syncProperty() doesn't handle transition.
bool bTextBox = false;
xShapeProps->getPropertyValue("TextBox") >>= bTextBox;
+
+ // The positioning change caused by LayoutInCell doesn't sync well
+ // in the text / frame duo. So the compatibility fix only correctly
+ // positions the frame and not the text currently.
+ // tdf#135943: Instead of half-fixing and making a complete mess,
+ // just avoid until layout's repositioning is sync'd to the text frame.
+ if (m_pImpl->bLayoutInCell && bTextBox)
+ m_pImpl->bLayoutInCell = !m_pImpl->bCompatForcedLayoutInCell;
+
if (m_pImpl->nVertRelation == text::RelOrientation::TEXT_LINE && !bTextBox)
eAnchorType = text::TextContentAnchorType_AT_CHARACTER;