summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-10-25 13:25:59 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-11-15 15:10:02 +0100
commit675be4ab575762bb8cbd5b4b195220ff97b73a67 (patch)
tree1e810fce31c105173cbec9fb20f9facc0289829c
parent7e47114d9ebcdb8851e1e196be71f48550ba6c6b (diff)
sw_redlinehide_3: adapt SwTextNode::IsNumbered() & callers
Answer depends on layout. Change-Id: Ibc7bddfa1b04630ddcfcfa429fbb507347073ce2
-rw-r--r--sw/inc/ndtxt.hxx2
-rw-r--r--sw/source/core/crsr/crsrsh.cxx2
-rw-r--r--sw/source/core/layout/wsfrm.cxx2
-rw-r--r--sw/source/core/text/txtfld.cxx4
-rw-r--r--sw/source/core/text/txtfrm.cxx6
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx4
-rw-r--r--sw/source/uibase/utlui/content.cxx2
7 files changed, 13 insertions, 9 deletions
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 05bdb53b2f1f..d00b280abeb3 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -528,7 +528,7 @@ public:
@retval true This node is numbered.
@retval false else
*/
- bool IsNumbered() const;
+ bool IsNumbered(SwRootFrame const* pLayout = nullptr) const;
/** Returns if this text node has a marked label.
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 3e818d8c0c14..cc5c17b40148 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -392,7 +392,7 @@ void SwCursorShell::UpdateMarkedListLevel()
if ( pTextNd )
{
- if ( !pTextNd->IsNumbered() )
+ if (!pTextNd->IsNumbered(GetLayout()))
{
m_pCurrentCursor->SetInFrontOfLabel_( false );
MarkListLevel( OUString(), 0 );
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index bed15e7c5ece..cfb9c0853934 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -4344,7 +4344,7 @@ static void UnHideRedlines(SwRootFrame & rLayout,
pFrame->Broadcast(SfxHint()); // notify SwAccessibleParagraph
}
// all nodes, not just merged ones! it may be in the same list as
- if (rTextNode.IsNumbered()) // a preceding merged one...
+ if (rTextNode.IsNumbered(nullptr)) // a preceding merged one...
{ // notify frames so they reformat numbering portions
rTextNode.NumRuleChgd();
}
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index e7fd1223fe95..52b6c57e6c10 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -479,7 +479,9 @@ SwNumberPortion *SwTextFormatter::NewNumberPortion( SwTextFormatInfo &rInf ) con
const SwNumRule* pNumRule = pTextNd->GetNumRule();
// Has a "valid" number?
- if( pTextNd->IsNumbered() && pTextNd->IsCountedInList())
+ // sw_redlinehide: check that pParaPropsNode is the correct one
+ assert(pTextNd->IsNumbered(m_pFrame->getRootFrame()) == pTextNd->IsNumbered(nullptr));
+ if (pTextNd->IsNumbered(m_pFrame->getRootFrame()) && pTextNd->IsCountedInList())
{
int nLevel = pTextNd->GetActualListLevel();
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index e6142abc24ee..e963d28759ce 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -3275,8 +3275,10 @@ void SwTextFrame::CalcAdditionalFirstLineOffset()
mnAdditionalFirstLineOffset = 0;
const SwTextNode* pTextNode( GetTextNodeForParaProps() );
- if ( pTextNode && pTextNode->IsNumbered() && pTextNode->IsCountedInList() &&
- pTextNode->GetNumRule() )
+ // sw_redlinehide: check that pParaPropsNode is the correct one
+ assert(pTextNode->IsNumbered(getRootFrame()) == pTextNode->IsNumbered(nullptr));
+ if (pTextNode && pTextNode->IsNumbered(getRootFrame()) &&
+ pTextNode->IsCountedInList() && pTextNode->GetNumRule())
{
int nListLevel = pTextNode->GetActualListLevel();
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index cf8ec5bbeccd..b571fb73e3cc 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2890,9 +2890,9 @@ void SwTextNode::NumRuleChgd()
}
// -> #i27615#
-bool SwTextNode::IsNumbered() const
+bool SwTextNode::IsNumbered(SwRootFrame const*const pLayout) const
{
- SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : nullptr;
+ SwNumRule* pRule = GetNum(pLayout) ? GetNum(pLayout)->GetNumRule() : nullptr;
return pRule && IsCountedInList();
}
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index d3ac0b3bc833..be0816cad53f 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1865,7 +1865,7 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer,
const SwNumRule* pOutlRule = pWrtShell->GetOutlineNumRule();
const SwTextNode* pTextNd =
pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineNode(nPos);
- if( pTextNd && pOutlRule && pTextNd->IsNumbered())
+ if (pTextNd && pOutlRule && pTextNd->IsNumbered(pWrtShell->GetLayout()))
{
SwNumberTree::tNumberVector aNumVector =
pTextNd->GetNumberVector(pWrtShell->GetLayout());