diff options
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 16 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 3bc15298442f..75b6133e312c 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -261,7 +261,7 @@ DomainMapper_Impl::DomainMapper_Impl( m_bStartedTOC(false), m_bStartIndex(false), m_bStartBibliography(false), - m_bStartGenericField(false), + m_nStartGenericField(0), m_bTextInserted(false), m_sCurrentPermId(0), m_pLastSectionContext( ), @@ -1878,7 +1878,7 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, const Proper } else { - if (m_bStartTOC || m_bStartIndex || m_bStartBibliography || m_bStartGenericField) + if (m_bStartTOC || m_bStartIndex || m_bStartBibliography || m_nStartGenericField != 0) { if (IsInHeaderFooter() && !m_bStartTOCHeaderFooter) { @@ -1890,15 +1890,17 @@ void DomainMapper_Impl::appendTextPortion( const OUString& rString, const Proper uno::Reference< text::XTextCursor > xTOCTextCursor = xTextAppend->getEnd()->getText( )->createTextCursor( ); assert(xTOCTextCursor.is()); xTOCTextCursor->gotoEnd(false); - if (m_bStartGenericField) + if (m_nStartGenericField != 0) + { xTOCTextCursor->goLeft(1, false); + } xTextRange = xTextAppend->insertTextPortion(rString, aValues, xTOCTextCursor); SAL_WARN_IF(!xTextRange.is(), "writerfilter.dmapper", "insertTextPortion failed"); if (!xTextRange.is()) throw uno::Exception("insertTextPortion failed", nullptr); m_bTextInserted = true; xTOCTextCursor->gotoRange(xTextRange->getEnd(), true); - if (!m_bStartGenericField) + if (m_nStartGenericField == 0) { m_aTextAppendStack.push(TextAppendContext(xTextAppend, xTOCTextCursor)); } @@ -5390,7 +5392,7 @@ void DomainMapper_Impl::CloseFieldCommand() InsertFieldmark(m_aTextAppendStack, xFormField, pContext->GetStartRange(), pContext->GetFieldId()); xFormField->setFieldType(ODF_UNHANDLED); - m_bStartGenericField = true; + ++m_nStartGenericField; pContext->SetFormField( xFormField ); uno::Reference<container::XNameContainer> const xNameCont(xFormField->getParameters()); // note: setting the code to empty string is *required* in @@ -5806,9 +5808,9 @@ void DomainMapper_Impl::PopFieldContext() } } } - else if(m_bStartGenericField) + else if (m_nStartGenericField != 0) { - m_bStartGenericField = false; + --m_nStartGenericField; PopFieldmark(m_aTextAppendStack, xCrsr, pContext->GetFieldId()); if(m_bTextInserted) { diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 6340b2da34d0..2a512eb44f8e 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -472,7 +472,7 @@ private: bool m_bStartedTOC; bool m_bStartIndex; bool m_bStartBibliography; - bool m_bStartGenericField; + unsigned int m_nStartGenericField; bool m_bTextInserted; LineNumberSettings m_aLineNumberSettings; |