summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-10-07 08:58:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-10-07 08:58:57 +0100
commit5d2210d5f3fecbd922fdccf0fa9d4b057880b409 (patch)
treed2761cd46249c3f7f55b10ba9d238b4ddaabd8eb /include
parent82e87b0d7c568db8fa240fb9a842a6611f73f2d7 (diff)
might as well go back to a std::stack now
after... commit 8daf6707ef203b26a744140f74d7cd231a25f0dd Author: Michael Stahl <mstahl@redhat.com> Date: Thu Oct 6 23:37:51 2016 +0200 xmloff: fix crash in ~XMLParaContext on fdo72541-1.fodt Change-Id: I57f10e60a2f76dde048a594d8391bb5b246dfc63
Diffstat (limited to 'include')
-rw-r--r--include/o3tl/stack.hxx78
-rw-r--r--include/xmloff/xmlimp.hxx6
2 files changed, 3 insertions, 81 deletions
diff --git a/include/o3tl/stack.hxx b/include/o3tl/stack.hxx
deleted file mode 100644
index 1fa793481294..000000000000
--- a/include/o3tl/stack.hxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- */
-
-#ifndef INCLUDED_O3TL_STACK_HXX
-#define INCLUDED_O3TL_STACK_HXX
-
-#include <stack>
-
-namespace o3tl
-{
-
-/**
- *
- * Same as std::stack (it just wraps it) except at destruction time the
- * container elements are destroyed in order starting from the top of the stack
- * which is the order one would rather assume a stack uses, but doesn't have to
- *
- * https://connect.microsoft.com/VisualStudio/feedback/details/765649/std-vector-does-not-destruct-in-reverse-order-of-construction
- *
- **/
-
-template<class T> class stack final
-{
-private:
- typedef std::stack<T> stack_t;
-
- stack_t mStack;
-public:
-
- T& top()
- {
- return mStack.top();
- }
-
- const T& top() const
- {
- return mStack.top();
- }
-
- void push(const T& val)
- {
- mStack.push(val);
- }
-
- void push(T&& val)
- {
- mStack.push(val);
- }
-
- void pop()
- {
- mStack.pop();
- }
-
- bool empty() const
- {
- return mStack.empty();
- }
-
- ~stack()
- {
- while (!mStack.empty())
- mStack.pop();
- }
-};
-
-}
-
-#endif /* INCLUDED_O3TL_STACK_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index 0aedd5b2a6f7..07168bcf0b54 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -23,7 +23,7 @@
#include <sal/config.h>
#include <set>
-#include <o3tl/stack.hxx>
+#include <stack>
#include <xmloff/dllapi.h>
#include <sal/types.h>
@@ -86,8 +86,8 @@ class XMLErrors;
class StyleMap;
enum class SvXMLErrorFlags;
-typedef o3tl::stack<SvXMLImportContextRef> SvXMLImportContexts_Impl;
-typedef o3tl::stack<css::uno::Reference<css::xml::sax::XFastContextHandler>>
+typedef std::stack<SvXMLImportContextRef> SvXMLImportContexts_Impl;
+typedef std::stack<css::uno::Reference<css::xml::sax::XFastContextHandler>>
FastSvXMLImportContexts_Impl;
namespace xmloff {