[Libreoffice-commits] core.git: sw/source

Pranav Kant pranavk at collabora.co.uk
Tue Mar 14 04:59:30 UTC 2017


 sw/source/core/doc/docredln.cxx   |   12 ++++++------
 sw/source/uibase/uno/unotxdoc.cxx |   12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 41c7ee5f0a3d0e128134665d709fd46e663fd373
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Fri Mar 10 19:16:38 2017 +0530

    sw: Simplify - no need to create a pointer here
    
    Change-Id: I5c7d1d47f347b3ce8de6e2e4995da8724a464941
    Reviewed-on: https://gerrit.libreoffice.org/35045
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>

diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index d6cf1c9..6ae2e29 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, SwRedlineTable::s
     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 66e26a1..de8057e 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3199,14 +3199,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());


More information about the Libreoffice-commits mailing list