From bd414d669defa1332e7fcbc9e87a0e02e7c5b185 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 25 Oct 2018 11:31:30 +0200 Subject: sw_redlinehide_3: adapt SwEditShell::OutlineUpDown() Change-Id: I1d1f4604c580fe4dd764cfb908cd18657ea54255 --- sw/inc/doc.hxx | 2 +- sw/source/core/doc/docnum.cxx | 11 ++++++++++- sw/source/core/edit/ednumber.cxx | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 6f11d6bc8bff..4d5d6e5b6015 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1002,7 +1002,7 @@ public: void PropagateOutlineRule(); // Outline - promote / demote. - bool OutlineUpDown( const SwPaM& rPam, short nOffset ); + bool OutlineUpDown(const SwPaM& rPam, short nOffset, SwRootFrame const* pLayout = nullptr); /// Outline - move up / move down. bool MoveOutlinePara( const SwPaM& rPam, SwOutlineNodes::difference_type nOffset); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 635dee7a9d0d..e1cf7ee67c98 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -173,7 +173,8 @@ void SwDoc::PropagateOutlineRule() } // Increase/Decrease -bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset ) +bool SwDoc::OutlineUpDown(const SwPaM& rPam, short nOffset, + SwRootFrame const*const pLayout) { if( GetNodes().GetOutLineNds().empty() || !nOffset ) return false; @@ -336,6 +337,10 @@ bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset ) for (auto i = nSttPos; i < nEndPos; ++i) { SwTextNode* pTextNd = rOutlNds[ i ]->GetTextNode(); + if (pLayout && !sw::IsParaPropsNode(*pLayout, *pTextNd)) + { + continue; + } SwTextFormatColl* pColl = pTextNd->GetTextColl(); if( pColl->IsAssignedToListLevelOfOutlineStyle() ) @@ -371,6 +376,10 @@ bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset ) for (auto i = nSttPos; i < nEndPos; ++i) { SwTextNode* pTextNd = rOutlNds[ i ]->GetTextNode(); + if (pLayout && !sw::IsParaPropsNode(*pLayout, *pTextNd)) + { + continue; + } SwTextFormatColl* pColl = pTextNd->GetTextColl(); if( pColl->IsAssignedToListLevelOfOutlineStyle() ) diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index 8f49775846c0..7734fd03c563 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -527,7 +527,7 @@ bool SwEditShell::OutlineUpDown( short nOffset ) bool bRet = true; SwPaM* pCursor = GetCursor(); if( !pCursor->IsMultiSelection() ) - bRet = GetDoc()->OutlineUpDown( *pCursor, nOffset ); + bRet = GetDoc()->OutlineUpDown(*pCursor, nOffset, GetLayout()); else { GetDoc()->GetIDocumentUndoRedo().StartUndo( SwUndoId::START, nullptr ); @@ -535,7 +535,7 @@ bool SwEditShell::OutlineUpDown( short nOffset ) SwPaM aPam( *pCursor->GetPoint() ); for( size_t n = 0; n < aRangeArr.Count(); ++n ) bRet = bRet && GetDoc()->OutlineUpDown( - aRangeArr.SetPam( n, aPam ), nOffset ); + aRangeArr.SetPam(n, aPam), nOffset, GetLayout()); GetDoc()->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr ); } GetDoc()->getIDocumentState().SetModified(); -- cgit v1.2.3