[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - sw/qa sw/source
Tibor Nagy (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jul 26 19:57:48 UTC 2020
sw/qa/extras/ooxmlexport/data/tdf133701.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport6.cxx | 10 ++++++++++
sw/source/filter/ww8/docxattributeoutput.cxx | 9 ++++++++-
3 files changed, 18 insertions(+), 1 deletion(-)
New commits:
commit 6de6809522804ea2f4fa3f249de726d8d7d120a6
Author: Tibor Nagy <nagy.tibor2 at nisz.hu>
AuthorDate: Tue Jun 9 13:38:35 2020 +0200
Commit: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Sun Jul 26 21:57:16 2020 +0200
tdf#133701 DOXC export: fix frame distance from text
Vertical and horizontal minimum distances of frame
and the text wrapping around the frame were not exported.
Note: different left/right, top/bottom values aren't
supported by OOXML hSpace, vSpace, so calculate
average values to keep the page layout.
Co-authored-by: Attila Bakos (NISZ)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96110
Tested-by: László Németh <nemeth at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
(cherry picked from commit a2113f5f46921c38a0c4929bb564183009a838e9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96698
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
(cherry picked from commit ebe228dc28773816beaa78837a8441513270cb67)
Change-Id: Ieef999003bcc6b9bba0a932ee4dd2b5461380c17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99402
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/tdf133701.docx b/sw/qa/extras/ooxmlexport/data/tdf133701.docx
new file mode 100644
index 000000000000..dfef409c268c
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf133701.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index 01904b93b365..9b96cd04893b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -42,6 +42,16 @@ protected:
}
};
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133701, "tdf133701.docx")
+{
+ xmlDocPtr pXmlDocument = parseExport("word/document.xml");
+ 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");
+}
+
DECLARE_OOXMLEXPORT_TEST(testDmlShapeTitle, "dml-shape-title.docx")
{
CPPUNIT_ASSERT_EQUAL(OUString("Title"), getProperty<OUString>(getShape(1), "Title"));
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index d5ebe12bad2f..9b63aefddc15 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -563,7 +563,6 @@ static void lcl_deleteAndResetTheLists( rtl::Reference<sax_fastparser::FastAttri
void DocxAttributeOutput::PopulateFrameProperties(const SwFrameFormat* pFrameFormat, const Size& rSize)
{
-
sax_fastparser::FastAttributeList* attrList = FastSerializerHelper::createAttrList();
awt::Point aPos(pFrameFormat->GetHoriOrient().GetPos(), pFrameFormat->GetVertOrient().GetPos());
@@ -574,6 +573,14 @@ void DocxAttributeOutput::PopulateFrameProperties(const SwFrameFormat* pFrameFor
attrList->add( FSNS( XML_w, XML_x), OString::number(aPos.X));
attrList->add( FSNS( XML_w, XML_y), OString::number(aPos.Y));
+ sal_Int16 nLeft = pFrameFormat->GetLRSpace().GetLeft();
+ sal_Int16 nRight = pFrameFormat->GetLRSpace().GetRight();
+ sal_Int16 nUpper = pFrameFormat->GetULSpace().GetUpper();
+ sal_Int16 nLower = pFrameFormat->GetULSpace().GetLower();
+
+ attrList->add(FSNS(XML_w, XML_hSpace), OString::number((nLeft + nRight) / 2));
+ attrList->add(FSNS(XML_w, XML_vSpace), OString::number((nUpper + nLower) / 2));
+
OString relativeFromH = convertToOOXMLHoriOrientRel( pFrameFormat->GetHoriOrient().GetRelationOrient() );
OString relativeFromV = convertToOOXMLVertOrientRel( pFrameFormat->GetVertOrient().GetRelationOrient() );
More information about the Libreoffice-commits
mailing list