Kaydet (Commit) 83b840e6 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SwXTextDocument

Change-Id: I095e0b35d62fa0c82e7e171b2923431e06175558
Reviewed-on: https://gerrit.libreoffice.org/60614
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 7e4e715e
...@@ -133,7 +133,7 @@ private: ...@@ -133,7 +133,7 @@ private:
class Impl; class Impl;
::sw::UnoImplPtr<Impl> m_pImpl; ::sw::UnoImplPtr<Impl> m_pImpl;
std::deque<UnoActionContext*> aActionArr; std::deque<std::unique_ptr<UnoActionContext>> maActionArr;
const SfxItemPropertySet* pPropSet; const SfxItemPropertySet* pPropSet;
......
...@@ -545,25 +545,22 @@ void SwXTextDocument::lockControllers() ...@@ -545,25 +545,22 @@ void SwXTextDocument::lockControllers()
if(!IsValid()) if(!IsValid())
throw DisposedException("", static_cast< XTextDocument* >(this)); throw DisposedException("", static_cast< XTextDocument* >(this));
UnoActionContext* pContext = new UnoActionContext(pDocShell->GetDoc()); maActionArr.emplace_front(new UnoActionContext(pDocShell->GetDoc()));
aActionArr.push_front(pContext);
} }
void SwXTextDocument::unlockControllers() void SwXTextDocument::unlockControllers()
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if(aActionArr.empty()) if(maActionArr.empty())
throw RuntimeException("Nothing to unlock"); throw RuntimeException("Nothing to unlock");
UnoActionContext* pContext = aActionArr.front(); maActionArr.pop_front();
aActionArr.pop_front();
delete pContext;
} }
sal_Bool SwXTextDocument::hasControllersLocked() sal_Bool SwXTextDocument::hasControllersLocked()
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
return !aActionArr.empty(); return !maActionArr.empty();
} }
Reference< frame::XController > SwXTextDocument::getCurrentController() Reference< frame::XController > SwXTextDocument::getCurrentController()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment