[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/qa writerfilter/source
Gabor Kelemen (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jun 24 10:05:48 UTC 2020
sw/qa/extras/ooxmlexport/data/tdf108505.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 12 ++++++++++++
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 13 +++++++++----
3 files changed, 21 insertions(+), 4 deletions(-)
New commits:
commit acfc23e9a4b24d5ca6d772cadcca77ab3c6d0196
Author: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
AuthorDate: Sun Mar 22 22:59:05 2020 +0100
Commit: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Wed Jun 24 12:05:17 2020 +0200
tdf#108505 DOCX: fix legacy dropdown fields direct font setting
if it is at the beginning of the paragraph.
See also commit 22ad4d69d771708f28a2d9e137cfd43ac846cf3a
(tdf#121045 DOCX import: fix checkbox size in table).
Change-Id: Ic4d4fc56cf031cc941c3f81930c6eba497090cba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91540
Tested-by: László Németh <nemeth at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
(cherry picked from commit face27179d882cfbec368e2bed5f65276a5ce963)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96697
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf108505.docx b/sw/qa/extras/ooxmlexport/data/tdf108505.docx
new file mode 100644
index 000000000000..50ebc3770895
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf108505.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 99e1d29c93d8..781dfa872081 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -1136,6 +1136,18 @@ DECLARE_OOXMLEXPORT_TEST(testLineWidthRounding, "tdf126363_LineWidthRounding.doc
assertXPath(pXml, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln", "w", "57150");
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf108505, "tdf108505.docx")
+{
+ uno::Reference<text::XTextRange> xParagraph = getParagraph(3);
+ uno::Reference<text::XTextRange> xText
+ = getRun(xParagraph, 1, "Wrong font when alone on the line");
+
+ // Without the fix in place this would have become Times New Roman
+ CPPUNIT_ASSERT_EQUAL(
+ OUString("Trebuchet MS"),
+ getProperty<OUString>(xText, "CharFontName"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index a059c623b4c9..861fcf678ab4 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4870,7 +4870,7 @@ void DomainMapper_Impl::CloseFieldCommand()
OUString const sFirstParam(vArguments.empty() ? OUString() : vArguments.front());
// apply font size to the form control
- if (!m_aTextAppendStack.empty() && m_pLastCharacterContext && m_pLastCharacterContext->isSet(PROP_CHAR_HEIGHT) )
+ if (!m_aTextAppendStack.empty() && m_pLastCharacterContext && ( m_pLastCharacterContext->isSet(PROP_CHAR_HEIGHT) || m_pLastCharacterContext->isSet(PROP_CHAR_FONT_NAME )))
{
uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend;
if (xTextAppend.is())
@@ -4880,9 +4880,14 @@ void DomainMapper_Impl::CloseFieldCommand()
{
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);
+ if (m_pLastCharacterContext->isSet(PROP_CHAR_HEIGHT))
+ {
+ 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);
+ }
+ if (m_pLastCharacterContext->isSet(PROP_CHAR_FONT_NAME))
+ xProp->setPropertyValue(getPropertyName(PROP_CHAR_FONT_NAME), m_pLastCharacterContext->getProperty(PROP_CHAR_FONT_NAME)->second);
}
}
}
More information about the Libreoffice-commits
mailing list