[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - sw/qa writerfilter/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 11 15:06:57 UTC 2020
sw/qa/extras/ooxmlexport/data/tdf121045.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 21 +++++++++++++++++++++
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 19 +++++++++++++++++++
3 files changed, 40 insertions(+)
New commits:
commit 2b644016116337f106d988b459e530489b3a93e8
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Mon Feb 24 10:55:38 2020 +0100
Commit: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Thu Jun 11 17:06:26 2020 +0200
tdf#121045 DOCX import: fix checkbox size in table
in cell starting position.
Change-Id: Ib99726c03ff3f83177a015721e562ebc5bc516d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89338
Tested-by: Jenkins
Tested-by: László Németh <nemeth at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96133
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/tdf121045.docx b/sw/qa/extras/ooxmlexport/data/tdf121045.docx
new file mode 100644
index 000000000000..271aca1ec0a6
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf121045.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 09a179eb2bb0..7c64edb83f74 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -139,6 +139,27 @@ DECLARE_OOXMLEXPORT_TEST(testTdf130610, "tdf130610_bold_in_2_styles.ott")
}
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121045, "tdf121045.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:sz", "val", "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:pPr/w:rPr/w:szCs", "val", "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[1]/w:fldChar", "fldCharType", "begin");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:instrText", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[3]/w:fldChar", "fldCharType", "separate");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[5]/w:fldChar", "fldCharType", "end");
+ // form control keeps its direct formatted font size
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:rPr/w:sz", "val", "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[2]/w:rPr/w:szCs", "val", "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[3]/w:rPr/w:sz", "val", "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[3]/w:rPr/w:szCs", "val", "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[4]/w:rPr/w:sz", "val", "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[4]/w:rPr/w:szCs", "val", "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[5]/w:rPr/w:sz", "val", "20");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc[1]/w:p/w:r[5]/w:rPr/w:szCs", "val", "20");
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf120315, "tdf120315.docx")
{
// tdf#120315 cells of the second column weren't vertically merged
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 87322694cbd4..f2234f38b37f 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4622,6 +4622,25 @@ void DomainMapper_Impl::CloseFieldCommand()
OUString const sFirstParam(std::get<1>(field).empty()
? OUString() : std::get<1>(field).front());
+ // apply font size to the form control in tables
+ if ( m_nTableDepth > 0 && m_pLastCharacterContext.get() && m_pLastCharacterContext->isSet(PROP_CHAR_HEIGHT) )
+ {
+ uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend;
+ if (xTextAppend.is())
+ {
+ uno::Reference< text::XTextCursor > xCrsr = xTextAppend->getText()->createTextCursor();
+ uno::Reference< text::XText > xText = xTextAppend->getText();
+ if(xCrsr.is() && xText.is())
+ {
+ xCrsr->gotoEnd(false);
+ uno::Reference< beans::XPropertySet > xProp( xCrsr, uno::UNO_QUERY );
+ xProp->setPropertyValue(getPropertyName(PROP_CHAR_HEIGHT), m_pLastCharacterContext->getProperty(PROP_CHAR_HEIGHT)->second);
+ if ( m_pLastCharacterContext->isSet(PROP_CHAR_HEIGHT_COMPLEX) )
+ xProp->setPropertyValue(getPropertyName(PROP_CHAR_HEIGHT_COMPLEX), m_pLastCharacterContext->getProperty(PROP_CHAR_HEIGHT_COMPLEX)->second);
+ }
+ }
+ }
+
FieldConversionMap_t::const_iterator const aIt =
aFieldConversionMap.find(std::get<0>(field));
if (aIt != aFieldConversionMap.end()
More information about the Libreoffice-commits
mailing list