Kaydet (Commit) 4d472b9b authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide_3: adapt more SwEditShell Num

ReplaceNumRule(), SetNumRuleStart(), SetNodeNumStart()

Change-Id: I7e58d477b02e0e242ce3c12eca0071856533debf
üst cba61738
...@@ -651,7 +651,8 @@ bool SwEditShell::NumOrNoNum( ...@@ -651,7 +651,8 @@ bool SwEditShell::NumOrNoNum(
&& ( !bChkStart || IsSttPara() ) ) && ( !bChkStart || IsSttPara() ) )
{ {
StartAllAction(); StartAllAction();
bRet = GetDoc()->NumOrNoNum( GetCursor()->GetPoint()->nNode, !bNumOn ); SwPosition const pos(sw::GetParaPropsPos(*GetLayout(), *GetCursor()->GetPoint()));
bRet = GetDoc()->NumOrNoNum(pos.nNode, !bNumOn);
EndAllAction(); EndAllAction();
} }
return bRet; return bRet;
...@@ -805,7 +806,8 @@ void SwEditShell::ChgNumRuleFormats( const SwNumRule& rRule ) ...@@ -805,7 +806,8 @@ void SwEditShell::ChgNumRuleFormats( const SwNumRule& rRule )
void SwEditShell::ReplaceNumRule( const OUString& rOldRule, const OUString& rNewRule ) void SwEditShell::ReplaceNumRule( const OUString& rOldRule, const OUString& rNewRule )
{ {
StartAllAction(); StartAllAction();
GetDoc()->ReplaceNumRule( *GetCursor()->GetPoint(), rOldRule, rNewRule ); SwPosition const pos(sw::GetParaPropsPos(*GetLayout(), *GetCursor()->GetPoint()));
GetDoc()->ReplaceNumRule( pos, rOldRule, rNewRule );
EndAllAction(); EndAllAction();
} }
...@@ -819,11 +821,17 @@ void SwEditShell::SetNumRuleStart( bool bFlag, SwPaM* pPaM ) ...@@ -819,11 +821,17 @@ void SwEditShell::SetNumRuleStart( bool bFlag, SwPaM* pPaM )
SwPamRanges aRangeArr( *pCursor ); SwPamRanges aRangeArr( *pCursor );
SwPaM aPam( *pCursor->GetPoint() ); SwPaM aPam( *pCursor->GetPoint() );
for( size_t n = 0; n < aRangeArr.Count(); ++n ) for( size_t n = 0; n < aRangeArr.Count(); ++n )
GetDoc()->SetNumRuleStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), bFlag ); {
SwPosition const pos(sw::GetParaPropsPos(*GetLayout(), *aRangeArr.SetPam( n, aPam ).GetPoint()));
GetDoc()->SetNumRuleStart( pos, bFlag );
}
GetDoc()->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr ); GetDoc()->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr );
} }
else else
GetDoc()->SetNumRuleStart( *pCursor->GetPoint(), bFlag ); {
SwPosition const pos(sw::GetParaPropsPos(*GetLayout(), *GetCursor()->GetPoint()));
GetDoc()->SetNumRuleStart(pos, bFlag);
}
EndAllAction(); EndAllAction();
} }
...@@ -846,11 +854,17 @@ void SwEditShell::SetNodeNumStart( sal_uInt16 nStt ) ...@@ -846,11 +854,17 @@ void SwEditShell::SetNodeNumStart( sal_uInt16 nStt )
SwPamRanges aRangeArr( *pCursor ); SwPamRanges aRangeArr( *pCursor );
SwPaM aPam( *pCursor->GetPoint() ); SwPaM aPam( *pCursor->GetPoint() );
for( size_t n = 0; n < aRangeArr.Count(); ++n ) for( size_t n = 0; n < aRangeArr.Count(); ++n )
GetDoc()->SetNodeNumStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), nStt ); {
SwPosition const pos(sw::GetParaPropsPos(*GetLayout(), *aRangeArr.SetPam( n, aPam ).GetPoint()));
GetDoc()->SetNodeNumStart( pos, nStt );
}
GetDoc()->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr ); GetDoc()->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr );
} }
else else
GetDoc()->SetNodeNumStart( *pCursor->GetPoint(), nStt ); {
SwPosition const pos(sw::GetParaPropsPos(*GetLayout(), *pCursor->GetPoint()));
GetDoc()->SetNodeNumStart( pos, nStt );
}
EndAllAction(); EndAllAction();
} }
......
...@@ -102,6 +102,7 @@ std::unique_ptr<sw::MergedPara> CheckParaRedlineMerge(SwTextFrame & rFrame, SwTe ...@@ -102,6 +102,7 @@ std::unique_ptr<sw::MergedPara> CheckParaRedlineMerge(SwTextFrame & rFrame, SwTe
bool FrameContainsNode(SwContentFrame const& rFrame, sal_uLong nNodeIndex); bool FrameContainsNode(SwContentFrame const& rFrame, sal_uLong nNodeIndex);
bool IsParaPropsNode(SwRootFrame const& rLayout, SwTextNode const& rNode); bool IsParaPropsNode(SwRootFrame const& rLayout, SwTextNode const& rNode);
SwTextNode * GetParaPropsNode(SwRootFrame const& rLayout, SwNodeIndex const& rNode); SwTextNode * GetParaPropsNode(SwRootFrame const& rLayout, SwNodeIndex const& rNode);
SwPosition GetParaPropsPos(SwRootFrame const& rLayout, SwPosition const& rPos);
TextFrameIndex UpdateMergedParaForDelete(MergedPara & rMerged, TextFrameIndex UpdateMergedParaForDelete(MergedPara & rMerged,
bool isRealDelete, bool isRealDelete,
......
...@@ -338,6 +338,19 @@ namespace sw { ...@@ -338,6 +338,19 @@ namespace sw {
} }
} }
SwPosition
GetParaPropsPos(SwRootFrame const& rLayout, SwPosition const& rPos)
{
SwPosition pos(rPos);
SwTextNode const*const pNode(pos.nNode.GetNode().GetTextNode());
if (pNode)
{
pos.nNode = *sw::GetParaPropsNode(rLayout, *pNode);
pos.nContent.Assign(pos.nNode.GetNode().GetContentNode(), 0);
}
return pos;
}
} // namespace sw } // namespace sw
/// Switches width and height of the text frame /// Switches width and height of the text frame
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment