diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-03-10 19:16:38 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-03-23 20:29:45 +0530 |
commit | d5b15909bf65e456920e286bee1801c3916f19fc (patch) | |
tree | 20ced88c30c9d9ad91b8e97216e036c25a81865e /sw | |
parent | aaffd4536c359c67da201e507264bf78636e66ad (diff) |
sw: Simplify - no need to create a pointer here
Change-Id: I5c7d1d47f347b3ce8de6e2e4995da8724a464941
Reviewed-on: https://gerrit.libreoffice.org/35045
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
(cherry picked from commit 41c7ee5f0a3d0e128134665d709fd46e663fd373)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docredln.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index abadabe28084..28e981704df8 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -327,14 +327,14 @@ static void lcl_RedlineNotification(RedlineNotification nType, size_t nPos, SwRa SwView* pView = dynamic_cast<SwView*>(SfxViewShell::Current()); if (pView && pContentNd) { - std::unique_ptr<SwShellCursor> pCursor(new SwShellCursor(pView->GetWrtShell(), *pStartPos)); - pCursor->SetMark(); - pCursor->GetMark()->nNode = *pContentNd; - pCursor->GetMark()->nContent.Assign(pContentNd, pEndPos->nContent.GetIndex()); + SwShellCursor aCursor(pView->GetWrtShell(), *pStartPos); + aCursor.SetMark(); + aCursor.GetMark()->nNode = *pContentNd; + aCursor.GetMark()->nContent.Assign(pContentNd, pEndPos->nContent.GetIndex()); - pCursor->FillRects(); + aCursor.FillRects(); - SwRects* pRects(pCursor.get()); + SwRects* pRects(&aCursor); std::vector<OString> aRects; for(SwRect& rNextRect : *pRects) aRects.push_back(rNextRect.SVRect().toString()); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index add15faaf543..bd01697d2522 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3252,14 +3252,14 @@ OUString SwXTextDocument::getTrackedChanges() SwView* pView = dynamic_cast<SwView*>(SfxViewShell::Current()); if (pView && pContentNd) { - std::unique_ptr<SwShellCursor> pCursor(new SwShellCursor(pView->GetWrtShell(), *(rRedlineTable[i]->Start()) )); - pCursor->SetMark(); - pCursor->GetMark()->nNode = *pContentNd; - pCursor->GetMark()->nContent.Assign(pContentNd, rRedlineTable[i]->End()->nContent.GetIndex()); + SwShellCursor aCursor(pView->GetWrtShell(), *(rRedlineTable[i]->Start())); + aCursor.SetMark(); + aCursor.GetMark()->nNode = *pContentNd; + aCursor.GetMark()->nContent.Assign(pContentNd, rRedlineTable[i]->End()->nContent.GetIndex()); - pCursor->FillRects(); + aCursor.FillRects(); - SwRects* pRects(pCursor.get()); + SwRects* pRects(&aCursor); std::vector<OString> aRects; for(SwRect& rNextRect : *pRects) aRects.push_back(rNextRect.SVRect().toString()); |