summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx5
-rw-r--r--sw/source/ui/uno/unotxvw.cxx20
2 files changed, 3 insertions, 22 deletions
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index ca29279c132b..22d683a0f29d 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -971,10 +971,7 @@ Reference< XIndexAccess >
if(!pResultCrsr)
throw RuntimeException();
Reference< XIndexAccess > xRet;
- if(nResult)
- xRet = new SwXTextRanges(pResultCrsr);
- else
- xRet = new SwXTextRanges();
+ xRet = new SwXTextRanges( (nResult) ? pResultCrsr : 0 );
delete pResultCrsr;
return xRet;
}
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 35a4c5a2f92c..6df8553be298 100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -108,24 +108,8 @@ SV_IMPL_PTRARR( SelectionChangeListenerArr, XSelectionChangeListenerPtr );
* --------------------------------------------------*/
SwPaM* lcl_createPamCopy(const SwPaM& rPam)
{
- SwPaM* pRet = new SwPaM(*rPam.GetPoint());
- if(rPam.HasMark())
- {
- pRet->SetMark();
- *pRet->GetMark() = *rPam.GetMark();
- }
- if(rPam.GetNext() != (const Ring*)&rPam)
- {
- SwPaM *_pStartCrsr = (SwPaM *)rPam.GetNext();
- do
- {
- //neuen PaM erzeugen
- SwPaM* pPaM = new SwPaM(*_pStartCrsr);
- //und in den Ring einfuegen
- pPaM->MoveTo(pRet);
-
- } while( (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != rPam.GetNext() );
- }
+ SwPaM *const pRet = new SwPaM(*rPam.GetPoint());
+ ::sw::DeepCopyPaM(rPam, *pRet);
return pRet;
}
/******************************************************************