diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-28 17:52:40 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-02-18 15:54:54 +0000 |
commit | 2f4fce056bc6025c924466aaf7635e2b385cecbb (patch) | |
tree | 115a4a4acfa7f6cae357653a23d3be990600bd32 /writerfilter | |
parent | 953d064e31f172dad8a2f72da629158ab1097d9c (diff) |
tdf#97371 DOCX import: fix text covered by shape
Regression from commit 358666e4204364ce915ee95372dc6f2fca545253
(tdf#90153 DOCX import: fix default sw TextFrame roundtrip, 2015-09-28),
the problem was that at the moment SwTextBoxHelper::syncProperty()
doesn't handle an AnchorType at-para -> at-char transition, so the
importer shouldn't do that for TextBoxes till sw core gets extended to
support the scenario.
(cherry picked from commit 8f1a1092d47947847e1d888b0284e8364c663d1f)
Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Change-Id: I8308bfd306672bc68984fbf019767c174130e18d
Reviewed-on: https://gerrit.libreoffice.org/22483
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index a9d3225662ff..735687d7d3ee 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -805,8 +805,13 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) // This needs to be AT_PARAGRAPH by default and not AT_CHARACTER, otherwise shape will move when the user inserts a new paragraph. text::TextContentAnchorType eAnchorType = text::TextContentAnchorType_AT_PARAGRAPH; - if (m_pImpl->nVertRelation == text::RelOrientation::TEXT_LINE) + + // Avoid setting AnchorType for TextBoxes till SwTextBoxHelper::syncProperty() doesn't handle transition. + bool bTextBox = false; + xShapeProps->getPropertyValue("TextBox") >>= bTextBox; + if (m_pImpl->nVertRelation == text::RelOrientation::TEXT_LINE && !bTextBox) eAnchorType = text::TextContentAnchorType_AT_CHARACTER; + xShapeProps->setPropertyValue("AnchorType", uno::makeAny(eAnchorType)); //only the position orientation is handled in applyPosition() |