From 59a0be15b097dc4f2529837d128f52cc3fb497d9 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Fri, 1 Dec 2023 10:34:36 -0500 Subject: tdf#108505 writerfilter: fix legacy dropdown fields direct bold setting Any character property should be passed on, but do that in a follow-up commit, so that at least the bold case will remain intact if the broader fix gets reverted for any reason. make CppunitTest_sw_rtfexport6 \ CPPUNIT_TEST_NAME=testTdf108505_fieldCharFormat Change-Id: Id77980b704db2ff118e89c29eb9d4db82e117cdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160221 Reviewed-by: Justin Luth Tested-by: Jenkins Reviewed-by: Miklos Vajna --- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'writerfilter/source/dmapper/DomainMapper_Impl.cxx') diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 263673254788..18560a89eb84 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -7170,7 +7170,10 @@ 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) || m_pLastCharacterContext->isSet(PROP_CHAR_FONT_NAME ))) + if (!m_aTextAppendStack.empty() && m_pLastCharacterContext + && (m_pLastCharacterContext->isSet(PROP_CHAR_HEIGHT) + || m_pLastCharacterContext->isSet(PROP_CHAR_FONT_NAME) + || m_pLastCharacterContext->isSet(PROP_CHAR_WEIGHT))) { uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend; if (xTextAppend.is()) @@ -7186,6 +7189,12 @@ void DomainMapper_Impl::CloseFieldCommand() 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_WEIGHT)) + { + xProp->setPropertyValue(getPropertyName(PROP_CHAR_WEIGHT), m_pLastCharacterContext->getProperty(PROP_CHAR_WEIGHT)->second); + if (m_pLastCharacterContext->isSet(PROP_CHAR_WEIGHT_COMPLEX)) + xProp->setPropertyValue(getPropertyName(PROP_CHAR_WEIGHT_COMPLEX), m_pLastCharacterContext->getProperty(PROP_CHAR_WEIGHT_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); } -- cgit v1.2.3