summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-05-10 15:49:46 +0200
committerMichael Stahl <mstahl@redhat.com>2012-05-14 19:49:14 +0200
commitd61282d4a91b441a5859be1ae8ba2abad2aab36e (patch)
tree7b299aa0b6f5171aa2cdf5209ebf8e1221f8c793
parent00187240445d3f29a9f9bfa5a10017ac793f9771 (diff)
Convert SV_DECL_PTRARR(ActionContextArr) to std::deque
Change-Id: I722fda99e8c13785c37fe20a89c1e7b6620b884d
-rw-r--r--sw/inc/unotxdoc.hxx3
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx10
2 files changed, 6 insertions, 7 deletions
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 5aef8c46e7c5..9d94f18323ee 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -133,8 +133,7 @@ class SwPrintData;
class SwRenderData;
class ViewShell;
-typedef UnoActionContext* UnoActionContextPtr;
-SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4)
+typedef std::deque<UnoActionContext*> ActionContextArr;
/******************************************************************************
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 1404d2d701f6..43c167211eeb 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -478,7 +478,7 @@ void SwXTextDocument::lockControllers(void) throw( RuntimeException )
if(IsValid())
{
UnoActionContext* pContext = new UnoActionContext(pDocShell->GetDoc());
- aActionArr.Insert(pContext, 0);
+ aActionArr.push_front(pContext);
}
else
throw RuntimeException();
@@ -487,10 +487,10 @@ void SwXTextDocument::lockControllers(void) throw( RuntimeException )
void SwXTextDocument::unlockControllers(void) throw( RuntimeException )
{
SolarMutexGuard aGuard;
- if(aActionArr.Count())
+ if(!aActionArr.empty())
{
- UnoActionContext* pContext = aActionArr.GetObject(0);
- aActionArr.Remove(0);
+ UnoActionContext* pContext = aActionArr.front();
+ aActionArr.pop_front();
delete pContext;
}
else
@@ -500,7 +500,7 @@ void SwXTextDocument::unlockControllers(void) throw( RuntimeException )
sal_Bool SwXTextDocument::hasControllersLocked(void) throw( RuntimeException )
{
SolarMutexGuard aGuard;
- return aActionArr.Count() > 0;
+ return !aActionArr.empty();
}
Reference< frame::XController > SwXTextDocument::getCurrentController(void) throw( RuntimeException )