summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/doc.hxx2
-rw-r--r--sw/source/core/doc/docnum.cxx11
-rw-r--r--sw/source/core/edit/ednumber.cxx4
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 1bf04dac8015..667fea4e994f 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -171,7 +171,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;
@@ -334,6 +335,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() )
@@ -369,6 +374,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();