summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapper_Impl.cxx
diff options
context:
space:
mode:
authorJaume Pujantell <jaume.pujantell@collabora.com>2023-04-27 14:54:55 +0200
committerAshod Nakashian <ash@collabora.com>2023-05-03 12:42:31 +0200
commit5431b756d45bebe74beaba2026704552ee6891f0 (patch)
tree76f0d0bf4ec6947c9ed71ecf3207f37d0dab6fc5 /writerfilter/source/dmapper/DomainMapper_Impl.cxx
parent6f8d649b8c0ae0849e5c1f279c0f24700ec3f0d2 (diff)
tdf#154478 fix comments empy after ToC
TOC creation entered a malformed state where it interfered with the creation of other elements (e.g. annotations and textboxes). This change is also a fix to tdf#154481, so the patch from 94de79e7d3c98 can be removed. Change-Id: I423f9d048b8c5b89fd38229c4f3ad41213d5ab67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151103 Tested-by: Jenkins Reviewed-by: Ashod Nakashian <ash@collabora.com>
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapper_Impl.cxx')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx17
1 files changed, 7 insertions, 10 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 8407aaf7c58a..b3942b4654e9 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -5215,15 +5215,6 @@ void DomainMapper_Impl::PushTextBoxContent()
if (m_bIsInTextBox)
return;
- // tdf#154481: check for TOC creation with empty field stack,
- // and close TOC, unless pages will lost. FIXME.
- if (IsInTOC() && m_aFieldStack.size() == 0)
- {
- m_bStartTOC = false;
- SAL_WARN("writerfilter.dmapper",
- "broken TOC creation in textbox, but field stack is empty, so closing TOC!");
- }
-
try
{
uno::Reference<text::XTextFrame> xTBoxFrame(
@@ -6720,7 +6711,13 @@ uno::Reference<beans::XPropertySet> DomainMapper_Impl::createSectionForRange(
if (stepLeft)
xCursor->goLeft(1, true);
uno::Reference< text::XTextContent > xSection( m_xTextFactory->createInstance(sObjectType), uno::UNO_QUERY_THROW );
- xSection->attach( uno::Reference< text::XTextRange >( xCursor, uno::UNO_QUERY_THROW) );
+ try
+ {
+ xSection->attach( uno::Reference< text::XTextRange >( xCursor, uno::UNO_QUERY_THROW) );
+ }
+ catch(const uno::Exception&)
+ {
+ }
xRet.set(xSection, uno::UNO_QUERY );
}
catch(const uno::Exception&)