diff options
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/text/XMLTextMarkImportContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 35 |
2 files changed, 7 insertions, 30 deletions
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx index 4e42899e709c..4a71194df23c 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.cxx +++ b/xmloff/source/text/XMLTextMarkImportContext.cxx @@ -436,7 +436,7 @@ void XMLTextMarkImportContext::endFastElement(sal_Int32 nElement) } case TypeFieldmarkEnd: { - if (!m_rHelper.hasCurrentFieldSeparator()) + if (m_rHelper.hasCurrentFieldCtx() && !m_rHelper.hasCurrentFieldSeparator()) { // backward compat for old files without separator InsertFieldmark(GetImport(), m_rHelper, true); } diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 288ccf45dc9b..87fd2b91283a 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -2127,49 +2127,26 @@ XMLTextImportHelper::popFieldCtx() void XMLTextImportHelper::addFieldParam( const OUString& name, const OUString& value ) { assert(!m_xImpl->m_FieldStack.empty()); - if (!m_xImpl->m_FieldStack.empty()) { - Impl::field_stack_item_t & FieldStackItem(m_xImpl->m_FieldStack.top()); - std::get<1>(FieldStackItem).emplace_back( name, value ); - } + Impl::field_stack_item_t & FieldStackItem(m_xImpl->m_FieldStack.top()); + std::get<1>(FieldStackItem).emplace_back( name, value ); } ::std::pair<OUString, OUString> XMLTextImportHelper::getCurrentFieldType() const { assert(!m_xImpl->m_FieldStack.empty()); - if (!m_xImpl->m_FieldStack.empty()) - { - return std::get<0>(m_xImpl->m_FieldStack.top()); - } - else - { - return {}; - } + return std::get<0>(m_xImpl->m_FieldStack.top()); } uno::Reference<text::XTextRange> XMLTextImportHelper::getCurrentFieldStart() const { assert(!m_xImpl->m_FieldStack.empty()); - if (!m_xImpl->m_FieldStack.empty()) - { - return std::get<3>(m_xImpl->m_FieldStack.top()); - } - else - { - return {}; - } + return std::get<3>(m_xImpl->m_FieldStack.top()); } bool XMLTextImportHelper::hasCurrentFieldSeparator() const { assert(!m_xImpl->m_FieldStack.empty()); - if (!m_xImpl->m_FieldStack.empty()) - { - return std::get<2>(m_xImpl->m_FieldStack.top()).is(); - } - else - { - return {}; - } + return std::get<2>(m_xImpl->m_FieldStack.top()).is(); } bool XMLTextImportHelper::hasCurrentFieldCtx() const @@ -2180,7 +2157,7 @@ bool XMLTextImportHelper::hasCurrentFieldCtx() const void XMLTextImportHelper::setCurrentFieldParamsTo(css::uno::Reference< css::text::XFormField> const &xFormField) { assert(!m_xImpl->m_FieldStack.empty()); - if (!m_xImpl->m_FieldStack.empty() && xFormField.is()) + if (xFormField.is()) { FieldParamImporter(&std::get<1>(m_xImpl->m_FieldStack.top()), xFormField->getParameters()).Import(); |