[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - sw/qa sw/source
Tibor Nagy (via logerrit)
logerrit at kemper.freedesktop.org
Thu Feb 18 10:04:24 UTC 2021
sw/qa/extras/ooxmlexport/data/tdf133702.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 9 +++++++++
sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 2 +-
sw/qa/extras/ooxmlexport/ooxmlexport6.cxx | 10 +++++-----
sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 4 ++--
sw/source/filter/ww8/docxattributeoutput.cxx | 13 +++++++++----
6 files changed, 26 insertions(+), 12 deletions(-)
New commits:
commit 083da8cfe23878c2ff3fde88106fa1a93a57041e
Author: Tibor Nagy <nagy.tibor2 at nisz.hu>
AuthorDate: Wed Jul 29 11:10:04 2020 +0200
Commit: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Thu Feb 18 11:03:43 2021 +0100
tdf#133702 DOCX export: fix frame anchor position
On saving a frame from Writer the anchor moves to the next
paragraph, moving the whole frame lower in the document.
Co-authored-by: Attila Szűcs (NISZ)
Change-Id: Ic47becb323282500871d825c12330b328f5059d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99673
Tested-by: Jenkins
Tested-by: László Németh <nemeth at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
(cherry picked from commit e5f0c4dd632d3c4a9eea36f65974d6004ac07983)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111049
Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf133702.docx b/sw/qa/extras/ooxmlexport/data/tdf133702.docx
new file mode 100644
index 000000000000..46e08a920ca3
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf133702.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 3f8c025e8aa8..ff1e2cb45038 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -275,6 +275,15 @@ DECLARE_OOXMLEXPORT_TEST(testImageSpaceSettings, "tdf135047_ImageSpaceSettings.f
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor", "distR", "90170");
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133702, "tdf133702.docx")
+{
+ xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
+ if (!pXmlDocument)
+ return;
+
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index e6645a0e819f..83aef189b416 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -1339,7 +1339,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf112287, "tdf112287.docx")
xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:framePr","vAnchor","margin");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr","vAnchor","margin");
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testZOrderInHeader, "tdf120760_ZOrderInHeader.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index d3099505aa12..6e7dad9fd2fa 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -48,8 +48,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133701, "tdf133701.docx")
if (!pXmlDocument)
return;
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "hSpace", "567");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "vSpace", "284");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "hSpace", "567");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "vSpace", "284");
}
DECLARE_OOXMLEXPORT_TEST(testDmlShapeTitle, "dml-shape-title.docx")
@@ -1000,7 +1000,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133457, "tdf133457.docx")
if (!pXmlDocument)
return;
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[4]/w:pPr/w:framePr", "vAnchor", "text");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[3]/w:pPr/w:framePr", "vAnchor", "text");
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133924, "tdf133924.docx")
@@ -1009,8 +1009,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133924, "tdf133924.docx")
if (!pXmlDocument)
return;
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "wrap", "around");
- assertXPath(pXmlDocument, "/w:document/w:body/w:p[3]/w:pPr/w:framePr", "wrap", "notBeside");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "wrap", "around");
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "wrap", "notBeside");
}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index df4ac56ec5b1..645091e56323 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -393,8 +393,8 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO78590, "FDO78590.docx")
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
// This is to ensure that the fld starts and ends inside a hyperlink...
- assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "w", "9851" );
- assertXPath ( pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:framePr", "h", "1669" );
+ assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "w", "9851" );
+ assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:framePr", "h", "1669" );
}
DECLARE_OOXMLEXPORT_TEST(testSdtCitationRun, "sdt-citation-run.docx")
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index f38dc1dde917..b73379497cb1 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -769,10 +769,7 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
lcl_deleteAndResetTheLists( m_pParagraphSdtPrTokenChildren, m_pParagraphSdtPrDataBindingAttrs, m_aParagraphSdtPrAlias );
}
- //sdtcontent is written so Set m_bParagraphHasDrawing to false
- m_rExport.SdrExporter().setParagraphHasDrawing( false );
- m_bRunTextIsOn = false;
- m_pSerializer->mergeTopMarks(Tag_StartParagraph_1);
+ m_pSerializer->mark(Tag_StartParagraph_2);
// Write framePr
for ( const auto & pFrame : aFramePrTextbox )
@@ -782,6 +779,14 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
m_rExport.SdrExporter().writeOnlyTextOfFrame(pFrame.get());
m_pCurrentFrame = nullptr;
}
+
+ m_pSerializer->mergeTopMarks(Tag_StartParagraph_2, sax_fastparser::MergeMarks::PREPEND);
+
+ //sdtcontent is written so Set m_bParagraphHasDrawing to false
+ m_rExport.SdrExporter().setParagraphHasDrawing(false);
+ m_bRunTextIsOn = false;
+ m_pSerializer->mergeTopMarks(Tag_StartParagraph_1);
+
aFramePrTextbox.clear();
// Check for end of cell, rows, tables here
FinishTableRowCell( pTextNodeInfoInner );
More information about the Libreoffice-commits
mailing list