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:
class Impl;
::sw::UnoImplPtr<Impl> m_pImpl;
std::deque<UnoActionContext*> aActionArr;
std::deque<std::unique_ptr<UnoActionContext>> maActionArr;
const SfxItemPropertySet* pPropSet;
......
......@@ -545,25 +545,22 @@ void SwXTextDocument::lockControllers()
if(!IsValid())
throw DisposedException("", static_cast< XTextDocument* >(this));
UnoActionContext* pContext = new UnoActionContext(pDocShell->GetDoc());
aActionArr.push_front(pContext);
maActionArr.emplace_front(new UnoActionContext(pDocShell->GetDoc()));
}
void SwXTextDocument::unlockControllers()
{
SolarMutexGuard aGuard;
if(aActionArr.empty())
if(maActionArr.empty())
throw RuntimeException("Nothing to unlock");
UnoActionContext* pContext = aActionArr.front();
aActionArr.pop_front();
delete pContext;
maActionArr.pop_front();
}
sal_Bool SwXTextDocument::hasControllersLocked()
{
SolarMutexGuard aGuard;
return !aActionArr.empty();
return !maActionArr.empty();
}
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