sw/source/writerfilter/dmapper/PropertyMap.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 628abdfd0d6ada139d29b5b9ce41bd2e2eaebecc
Author:     Justin Luth <[email protected]>
AuthorDate: Mon Jan 5 14:12:08 2026 -0500
Commit:     Justin Luth <[email protected]>
CommitDate: Tue Jan 6 13:29:22 2026 +0100

    writerfilter: no m_xPreStartingRange if not gotoPreviousParagraph
    
    Based on a code read, it doesn't make any sense to pretend
    we have a useful value in m_xPreStartingRange
    if this could not move backwards.
    
    Better not to have a value at all
    than to confuse someone who now expects to find content
    before m_xStartingRange.
    
    Introduced in 25.8 with commit a2a88f0073bdd5119745679daa61469e87002579
        tdf#165717, tdf#165718 additional hack to apply continuous section 
breaks
        Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182830
    
    Change-Id: Ib092cfd755a09b733c7433417c2b7d7eaaef7aa9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196582
    Reviewed-by: Justin Luth <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/writerfilter/dmapper/PropertyMap.cxx 
b/sw/source/writerfilter/dmapper/PropertyMap.cxx
index 9125c36c69ce..7c33e28d39e5 100644
--- a/sw/source/writerfilter/dmapper/PropertyMap.cxx
+++ b/sw/source/writerfilter/dmapper/PropertyMap.cxx
@@ -2226,8 +2226,8 @@ void SectionPropertyMap::SetStart( const uno::Reference< 
text::XTextRange >& xRa
             
m_xStartingRange->getText()->createTextCursorByRange(m_xStartingRange), 
uno::UNO_QUERY_THROW);
         // CAUTION: gotoPreviousParagraph skips over tables,
         // so this range does not necessarily indicate the end of the previous 
section
-        xPCursor->gotoPreviousParagraph(false);
-        m_xPreStartingRange = xPCursor;
+        if (xPCursor->gotoPreviousParagraph(false))
+            m_xPreStartingRange = xPCursor;
     }
     catch (const uno::Exception&)
     {

Reply via email to