summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapper_Impl.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2023-12-01 10:34:36 -0500
committerMiklos Vajna <vmiklos@collabora.com>2023-12-05 08:30:29 +0100
commit59a0be15b097dc4f2529837d128f52cc3fb497d9 (patch)
treec2b0e630287afc1cf3a94c18aea317fc06bc8c1b /writerfilter/source/dmapper/DomainMapper_Impl.cxx
parent2bde39767ff2aead9d4cfddc37f32103bfc52f63 (diff)
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 <jluth@mail.com> Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapper_Impl.cxx')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx11
1 files changed, 10 insertions, 1 deletions
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);
}