summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-08-05 15:23:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-08-06 09:10:23 +0200
commite1340083a8a22df3d834ba252e7947a50afc439e (patch)
treeaae72b35a95b791bd6385a691aae4821f970f56a
parent59b8813606f084d62dbd3debed7f6b468d916459 (diff)
make GetFirstAndLastNode take a SwNode, not an SwNodeIndex
as part of the process of hiding the internals of SwPosition Change-Id: Ic26ed0fef1d7394ed2673b5949718fe8099b3d8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137873 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/crsr/pam.cxx2
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx2
-rw-r--r--sw/source/core/doc/docfmt.cxx2
-rw-r--r--sw/source/core/doc/docnum.cxx4
-rw-r--r--sw/source/core/inc/txtfrm.hxx2
-rw-r--r--sw/source/core/text/txtfrm.cxx4
6 files changed, 8 insertions, 8 deletions
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 3fd8e5ffa072..75e631dea971 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -983,7 +983,7 @@ SwContentNode* GetNode( SwPaM & rPam, bool& rbFirst, SwMoveFnCollection const &
{
if (i_pLayout && aPos.GetNode().IsTextNode())
{
- auto const fal(sw::GetFirstAndLastNode(*pLayout, aPos.nNode));
+ auto const fal(sw::GetFirstAndLastNode(*pLayout, aPos.GetNode()));
aPos.nNode = bSrchForward ? *fal.second : *fal.first;
}
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 409f053ddc99..37e21b5506c6 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -1625,7 +1625,7 @@ namespace //local functions originally from docfmt.cxx
SwContentNode * pFirstNode(pNode);
if (pLayout && pLayout->HasMergedParas())
{
- pFirstNode = sw::GetFirstAndLastNode(*pLayout, pStt->nNode).first;
+ pFirstNode = sw::GetFirstAndLastNode(*pLayout, pStt->GetNode()).first;
}
SwRegHistory aRegH( pFirstNode, *pFirstNode, pHistory );
bRet = pFirstNode->SetAttr( aNew ) || bRet;
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 4462f2b373f5..163fc16e1039 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1692,7 +1692,7 @@ void SwDoc::MoveLeftMargin(const SwPaM& rPam, bool bRight, bool bModulus,
SwRegHistory aRegH( pTNd, *pTNd, pHistory );
pTNd->SetAttr( aLS );
- aIdx = *sw::GetFirstAndLastNode(*pLayout, aIdx).second;
+ aIdx = *sw::GetFirstAndLastNode(*pLayout, aIdx.GetNode()).second;
}
++aIdx;
}
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 422fea98bce9..68e3a4727817 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -1830,7 +1830,7 @@ bool SwDoc::MoveParagraph(SwPaM& rPam, SwNodeOffset nOffset, bool const bIsOutlM
if (pLayout)
{
std::pair<SwTextNode *, SwTextNode *> nodes(
- sw::GetFirstAndLastNode(*pLayout, rPam.Start()->nNode));
+ sw::GetFirstAndLastNode(*pLayout, rPam.Start()->GetNode()));
if (nodes.first && nodes.first != &rPam.Start()->GetNode())
{
assert(nodes.second);
@@ -1849,7 +1849,7 @@ bool SwDoc::MoveParagraph(SwPaM& rPam, SwNodeOffset nOffset, bool const bIsOutlM
assert(nodes.first->GetIndex() < rPam.Start()->GetNodeIndex());
rPam.Start()->Assign(*nodes.first);
}
- nodes = sw::GetFirstAndLastNode(*pLayout, rPam.End()->nNode);
+ nodes = sw::GetFirstAndLastNode(*pLayout, rPam.End()->GetNode());
if (nodes.second && nodes.second != &rPam.End()->GetNode())
{
assert(nodes.first);
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index dde60392c8df..9109e949bd80 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -112,7 +112,7 @@ bool IsParaPropsNode(SwRootFrame const& rLayout, SwTextNode const& rNode);
SwTextNode * GetParaPropsNode(SwRootFrame const& rLayout, SwNode const& rNode);
SwPosition GetParaPropsPos(SwRootFrame const& rLayout, SwPosition const& rPos);
std::pair<SwTextNode *, SwTextNode *>
-GetFirstAndLastNode(SwRootFrame const& rLayout, SwNodeIndex const& rPos);
+GetFirstAndLastNode(SwRootFrame const& rLayout, SwNode const& rPos);
SwTextNode const& GetAttrMerged(SfxItemSet & rFormatSet,
SwTextNode const& rNode, SwRootFrame const* pLayout);
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 23e226f87d1c..7a81ea514757 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -351,9 +351,9 @@ namespace sw {
}
std::pair<SwTextNode *, SwTextNode *>
- GetFirstAndLastNode(SwRootFrame const& rLayout, SwNodeIndex const& rPos)
+ GetFirstAndLastNode(SwRootFrame const& rLayout, SwNode const& rPos)
{
- SwTextNode *const pTextNode(rPos.GetNode().GetTextNode());
+ SwTextNode *const pTextNode(const_cast<SwTextNode*>(rPos.GetTextNode()));
if (pTextNode && rLayout.HasMergedParas())
{
if (SwTextFrame const*const pFrame = static_cast<SwTextFrame*>(pTextNode->getLayoutFrame(&rLayout)))