diff options
author | Attila Bakos <bakos.attilakaroly@nisz.hu> | 2020-05-14 12:38:28 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-01-12 20:38:09 +0100 |
commit | bda711f33d9ec67a3b3507cf256fdf5d85b9ae23 (patch) | |
tree | 592656bef986a4d6004571d0758d071a557fb85d | |
parent | e541841852ded9ad1b8323c31cba9df37fab93a4 (diff) |
tdf#133035 DOCX export: fix position of unnamed OLE
Position export depended on OLE object names, instead of the
type of anchoring.
Follow-up of commit 2150fdc7d0f63288ac56c33cb898589512057642
(tdf#131539 DOCX export: fix position of OLE objects).
Co-authored-by: Tibor Nagy (NISZ)
Change-Id: Ib98a19cb012047f37a5830c81541ef00c55589dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94190
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit 45fe51bca2ab534cfe1139b734d839728225d6d9)
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf133035.docx | bin | 0 -> 16259 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf133035.docx b/sw/qa/extras/ooxmlexport/data/tdf133035.docx Binary files differnew file mode 100644 index 000000000000..c28c119dbccc --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133035.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 387924997f78..08ac6fb4ed86 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -189,6 +189,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf78352, "tdf78352.docx") CPPUNIT_ASSERT_LESS(150, nWidth); } +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(Tdf133035, "tdf133035.docx") +{ + auto pxml = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pxml); + OUString aXmlVal = getXPath(pxml, "/w:document/w:body/w:p[1]/w:r[1]/w:object/v:shape", "style"); + CPPUNIT_ASSERT(aXmlVal.indexOf("margin-left:186.6pt") > -1); +} + DECLARE_OOXMLEXPORT_TEST(testTdf120315, "tdf120315.docx") { // tdf#120315 cells of the second column weren't vertically merged diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index f5d1587f1fca..ef65e060583b 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -5521,7 +5521,7 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S //This string will store the relative position for aPos OString aAnch; - if (!rFlyFrameFormat->GetName().isEmpty()) + if (rFlyFrameFormat && rFlyFrameFormat->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR) { //Get the horizontal alignment of the OLE via the frame format, to aHAlign OString aHAlign = convertToOOXMLHoriOrient(rFlyFrameFormat->GetHoriOrient().GetHoriOrient(), |