writerfilter/source/dmapper/DomainMapper_Impl.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 61b5835fc81f1dec9c9e334a9f886f35997d1b56
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Wed Nov 30 08:13:01 2022 -0500
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Wed Nov 30 19:14:18 2022 +0100

    related tdf#152305 writerfilter: avoid comment-related exceptions
    
    a comment anchored in a table sees m_nTableDepth,
    but while in the comment it shouldn't affect
    the table itself.
    
    I did a search for m_nTableDepth and added !m_bIsInComments
    everywhere that looked reasonable.
    
    Change-Id: Iaaaf2f2b5a9f409146111b2e8546573c264e75ef
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143510
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 4c20cdc1bfb5..ffeb26da7a97 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2481,7 +2481,8 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap, con
                 css::uno::Reference<css::beans::XPropertySet> 
xParaProps(xTextRange, uno::UNO_QUERY);
 
                 // table style precedence and not hidden shapes anchored to 
hidden empty table paragraphs
-                if (xParaProps && (m_nTableDepth > 0 || 
!m_aAnchoredObjectAnchors.empty()) )
+                if (xParaProps && !m_bIsInComments
+                    && (m_nTableDepth > 0 || 
!m_aAnchoredObjectAnchors.empty()))
                 {
                     // table style has got bigger precedence than docDefault 
style
                     // collect these pending paragraph properties to process 
in endTable()
@@ -2596,7 +2597,7 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap, con
                 }
 
                 // fix table paragraph properties
-                if ( xTextRange.is() && xParaProps && m_nTableDepth > 0 )
+                if (xTextRange.is() && xParaProps && m_nTableDepth > 0 && 
!m_bIsInComments)
                 {
                     // tdf#128959 table paragraphs haven't got window and 
orphan controls
                     uno::Any aAny(static_cast<sal_Int8>(0));
@@ -2665,7 +2666,7 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap, con
 
     // don't overwrite m_bFirstParagraphInCell in table separator nodes
     // and in text boxes anchored to the first paragraph of table cells
-    if (m_nTableDepth > 0 && m_nTableDepth == m_nTableCellDepth && 
!IsInShape())
+    if (m_nTableDepth > 0 && m_nTableDepth == m_nTableCellDepth && 
!IsInShape() && !m_bIsInComments)
         m_bFirstParagraphInCell = false;
 
     m_bParaAutoBefore = false;

Reply via email to