summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-09-29 18:53:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-29 20:14:29 +0200
commit74e2d6dca536fe670b125ee9ac1192f45166db6e (patch)
tree1e9043da725197af7827bc6065d9971d9dee29f5
parentab4c74241ddc1a09c82d5ef240a170b0dc38b31c (diff)
use more SwPosition::Assign
part of the process of hiding the internals of SwPosition Change-Id: I5744c861a9996f4d6d710acf73720aae2af6d9fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/edit/edglss.cxx25
1 files changed, 12 insertions, 13 deletions
diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index ee848a206d44..82a11ddbfe9c 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -104,16 +104,14 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
if( !pNd )
pNd = pContentNd;
- pCursor->GetPoint()->nNode = *pNd;
- if( pNd == pContentNd )
- pCursor->GetPoint()->nContent.Assign( pContentNd, 0 );
+ pCursor->GetPoint()->Assign(*pNd);
pCursor->SetMark();
// then until the end of the Node array
- pCursor->GetPoint()->nNode = pMyDoc->GetNodes().GetEndOfContent().GetIndex()-1;
+ pCursor->GetPoint()->Assign(pMyDoc->GetNodes().GetEndOfContent().GetIndex()-1);
pContentNd = pCursor->GetPointContentNode();
if( pContentNd )
- pCursor->GetPoint()->nContent.Assign( pContentNd, pContentNd->Len() );
+ pCursor->GetPoint()->SetContent( pContentNd->Len() );
OUString sBuf;
GetSelectedText( sBuf, ParaBreakType::ToOnlyCR );
@@ -133,10 +131,10 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
aCpyPam.SetMark();
// then until the end of the nodes array
- aCpyPam.GetPoint()->nNode = pMyDoc->GetNodes().GetEndOfContent().GetIndex()-1;
+ aCpyPam.GetPoint()->Assign(pMyDoc->GetNodes().GetEndOfContent().GetIndex()-1);
pContentNd = aCpyPam.GetPointContentNode();
- aCpyPam.GetPoint()->nContent.Assign(
- pContentNd, pContentNd ? pContentNd->Len() : 0);
+ if(pContentNd)
+ aCpyPam.GetPoint()->SetContent( pContentNd->Len() );
aStt = pGDoc->GetNodes().GetEndOfExtras();
pContentNd = pGDoc->GetNodes().GoNext( &aStt );
@@ -229,17 +227,18 @@ bool SwEditShell::CopySelToDoc( SwDoc& rInsDoc )
// but we want to copy the table and the start node before
// the first cell as well.
// tdf#133982 tables can be nested
+ const SwNode* pNode = &aPaM.Start()->GetNode();
while (SwTableNode const* pTableNode =
- aPaM.Start()->GetNode().StartOfSectionNode()->FindTableNode())
+ pNode->StartOfSectionNode()->FindTableNode())
{
- aPaM.Start()->nNode = *pTableNode;
+ pNode = pTableNode;
}
while (SwSectionNode const* pSectionNode =
- aPaM.Start()->GetNode().StartOfSectionNode()->FindSectionNode())
+ pNode->StartOfSectionNode()->FindSectionNode())
{
- aPaM.Start()->nNode = *pSectionNode;
+ pNode = pSectionNode;
}
- aPaM.Start()->nContent.Assign(nullptr, 0);
+ aPaM.Start()->Assign(*pNode);
}
bRet = GetDoc()->getIDocumentContentOperations().CopyRange( aPaM, aPos, SwCopyFlags::CheckPosInFly)
|| bRet;