summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-12-12 09:18:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-12-13 09:26:04 +0100
commit134898e42ac6c455d5df0c2de3842d1bd7309f5f (patch)
tree7c0c1ea898d492b6f757bd9652eba37a7b4e9c57
parent0c8a30ba47c6ed64c45063a060356e61e82a789f (diff)
tdf#113183 DOCX import: fix not independent text box alignments
The alternative would be to clear them in writerfilter::dmapper::DomainMapper::getPositionOffset(), but that runs before writerfilter::dmapper::PositionHandler::lcl_sprm(), so it would be too early. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport11.cxx (cherry picked from commit 312cecf11c1ab8acef6ce08ccb90d5322836b08f) Change-Id: I287b9a4025c4b1844ae467c48815b5d7ffe3f98e Reviewed-on: https://gerrit.libreoffice.org/46322 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf113183.docxbin0 -> 17163 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport11.cxx10
-rw-r--r--writerfilter/source/dmapper/GraphicHelpers.cxx4
3 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf113183.docx b/sw/qa/extras/ooxmlexport/data/tdf113183.docx
new file mode 100644
index 000000000000..197f483ba011
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf113183.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 116b3f05bb2b..6aca7e81b2cd 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -99,6 +99,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf67207_MERGEFIELD, "mailmerge.docx")
CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.text.fieldmaster.DataBase.Name"), sValue);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf113183, "tdf113183.docx")
+{
+ // This was 2096, the horizontal positioning of the star shape affected the
+ // positioning of the triangle one, so the triangle was outside the page
+ // frame.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0),
+ getProperty<sal_Int32>(getShapeByName("triangle"),
+ "HoriOrientPosition"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx
index 62579dbaa864..8108445d24fb 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.cxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx
@@ -133,9 +133,11 @@ void PositionHandler::lcl_sprm(Sprm& rSprm)
{
case NS_ooxml::LN_CT_PosH_posOffset:
m_nPosition = oox::drawingml::convertEmuToHmm(m_rPositionOffsets.first.toInt32());
+ m_rPositionOffsets.first.clear();
break;
case NS_ooxml::LN_CT_PosV_posOffset:
m_nPosition = oox::drawingml::convertEmuToHmm(m_rPositionOffsets.second.toInt32());
+ m_rPositionOffsets.second.clear();
break;
case NS_ooxml::LN_CT_PosH_align:
{
@@ -150,6 +152,7 @@ void PositionHandler::lcl_sprm(Sprm& rSprm)
m_nOrient = text::HoriOrientation::INSIDE;
else if (rAlign == "outside")
m_nOrient = text::HoriOrientation::OUTSIDE;
+ rAlign.clear();
break;
}
case NS_ooxml::LN_CT_PosV_align:
@@ -165,6 +168,7 @@ void PositionHandler::lcl_sprm(Sprm& rSprm)
m_nOrient = text::VertOrientation::NONE;
else if (rAlign == "outside")
m_nOrient = text::VertOrientation::NONE;
+ rAlign.clear();
break;
}
}