sw/inc/doc.hxx | 2 +- sw/inc/ndtxt.hxx | 2 +- sw/source/core/crsr/crsrsh.cxx | 3 ++- sw/source/core/doc/docnum.cxx | 10 +++------- sw/source/core/edit/editsh.cxx | 1 + sw/source/core/edit/ednumber.cxx | 2 +- sw/source/core/txtnode/ndtxt.cxx | 7 ++++--- 7 files changed, 13 insertions(+), 14 deletions(-)
New commits: commit 80abcd57d239cc937885cba34da026e4c620c34c Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Tue Nov 6 12:40:14 2018 +0100 Commit: Michael Stahl <michael.st...@cib.de> CommitDate: Tue Nov 6 12:45:36 2018 +0100 IsFirstOfNumRule needs a layout so it can check the correct SwNodeNum Change-Id: Ifdb29f20463c21987019856bc1d06564da96b9f6 diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 020379e2d5a9..d76a5a61ba36 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1544,7 +1544,7 @@ public: */ static OUString GetPaMDescr(const SwPaM & rPaM); - static bool IsFirstOfNumRuleAtPos(const SwPosition & rPos, SwRootFrame const* pLayout); + static bool IsFirstOfNumRuleAtPos(const SwPosition & rPos, SwRootFrame const& rLayout); // access methods for XForms model(s) diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index d00b280abeb3..b483d7fc9e9d 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -772,7 +772,7 @@ public: void RemoveFromListRLHidden(); bool IsInList() const; - bool IsFirstOfNumRule() const; + bool IsFirstOfNumRule(SwRootFrame const& rLayout) const; sal_uInt16 GetScalingOfSelectedText( sal_Int32 nStt, sal_Int32 nEnd ) const; diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index e2ccaa575dd9..b707c2aa631a 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2577,18 +2577,14 @@ void SwDoc::MarkListLevel( const OUString& sListId, } bool SwDoc::IsFirstOfNumRuleAtPos(const SwPosition & rPos, - SwRootFrame const*const pLayout) + SwRootFrame const& rLayout) { bool bResult = false; - const SwTextNode* pTextNode = rPos.nNode.GetNode().GetTextNode(); + const SwTextNode *const pTextNode = sw::GetParaPropsNode(rLayout, rPos.nNode); if ( pTextNode != nullptr ) { - if (pLayout && !sw::IsParaPropsNode(*pLayout, *pTextNode)) - { - pTextNode = static_cast<SwTextFrame*>(pTextNode->getLayoutFrame(pLayout))->GetMergedPara()->pParaPropsNode; - } - bResult = pTextNode->IsFirstOfNumRule(); + bResult = pTextNode->IsFirstOfNumRule(rLayout); } return bResult; diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index 41a06f6d42ba..ee35d6e8be8e 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -336,7 +336,7 @@ void SwEditShell::NumUpDown( bool bDown ) bool SwEditShell::IsFirstOfNumRuleAtCursorPos() const { - return SwDoc::IsFirstOfNumRuleAtPos(*GetCursor()->GetPoint(), GetLayout()); + return SwDoc::IsFirstOfNumRuleAtPos(*GetCursor()->GetPoint(), *GetLayout()); } // -> #i23725#, #i90078# diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 5cd2a795b2eb..88399969cbbd 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -4355,12 +4355,13 @@ bool SwTextNode::IsInList() const return GetNum() != nullptr && GetNum()->GetParent() != nullptr; } -bool SwTextNode::IsFirstOfNumRule() const +bool SwTextNode::IsFirstOfNumRule(SwRootFrame const& rLayout) const { bool bResult = false; - if ( GetNum() && GetNum()->GetNumRule()) - bResult = GetNum()->IsFirst(); + SwNodeNum const*const pNum(GetNum(&rLayout)); + if (pNum && pNum->GetNumRule()) + bResult = pNum->IsFirst(); return bResult; } commit 43b4bf2704a4cd91737a7f34a8059c621997d91d Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Tue Nov 6 12:15:18 2018 +0100 Commit: Michael Stahl <michael.st...@cib.de> CommitDate: Tue Nov 6 12:18:39 2018 +0100 sw_redlinehide_3: adapt SwCursorShell::UpdateMarkedListLevel() Change-Id: I2cd143baafae09324ad0a439cfad3f916ddb13b3 diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index d170b3b4049d..4d8631364ab8 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -388,7 +388,8 @@ void SwCursorShell::MarkListLevel( const OUString& sListId, void SwCursorShell::UpdateMarkedListLevel() { - SwTextNode * pTextNd = GetCursor_()->GetNode().GetTextNode(); + SwTextNode const*const pTextNd = sw::GetParaPropsNode(*GetLayout(), + GetCursor_()->GetPoint()->nNode); if ( pTextNd ) { diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index fcc0377ad54d..f548e2baf064 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -780,6 +780,7 @@ void SwEditShell::SetNumberingRestart() SwTextNode* pTextNd( pNd->GetTextNode() ); SwNumRule* pNumRule( pTextNd->GetNumRule() ); + // sw_redlinehide: not sure what this should do, only called from mail-merge bool bIsNodeNum = ( pNumRule && pTextNd->GetNum() && ( pTextNd->HasNumber() || pTextNd->HasBullet() ) && _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits