LibreOffice Module oox (master) 1
grabbagstack.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 */
10
12#include <com/sun/star/uno/Sequence.hxx>
14
15namespace oox
16{
17
18using namespace css::beans;
19using namespace css::uno;
20
21GrabBagStack::GrabBagStack(const OUString& aElementName)
22{
23 mCurrentElement.maElementName = aElementName;
24}
25
27{}
28
30{
31 return mStack.empty();
32}
33
35{
36 while(!mStack.empty())
37 pop();
38
39 PropertyValue aProperty;
40 aProperty.Name = mCurrentElement.maElementName;
42
43 return aProperty;
44}
45
46void GrabBagStack::appendElement(const OUString& aName, const Any& aAny)
47{
48 PropertyValue aValue;
49 aValue.Name = aName;
50 aValue.Value = aAny;
51 mCurrentElement.maPropertyList.push_back(aValue);
52}
53
54void GrabBagStack::push(const OUString& aKey)
55{
59}
60
62{
64 Sequence<PropertyValue> aSequence(comphelper::containerToSequence(mCurrentElement.maPropertyList));
65 mCurrentElement = mStack.top();
66 mStack.pop();
67 appendElement(aName, Any(aSequence));
68}
69
70void GrabBagStack::addInt32(const OUString& aElementName, sal_Int32 aIntValue)
71{
72 appendElement(aElementName, Any(aIntValue));
73}
74
75void GrabBagStack::addString(const OUString& aElementName, const OUString& aStringValue)
76{
77 appendElement(aElementName, Any(aStringValue));
78}
79
80} // namespace oox
81
82/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::beans::PropertyValue getRootProperty()
void addInt32(const OUString &aElementName, sal_Int32 aIntValue)
void push(const OUString &aKey)
GrabBagStack(const OUString &aElementName)
void appendElement(const OUString &aName, const css::uno::Any &aAny)
GrabBagStackElement mCurrentElement
bool isStackEmpty() const
std::stack< GrabBagStackElement > mStack
void addString(const OUString &aElementName, const OUString &aStringValue)
OUString aName
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
std::vector< css::beans::PropertyValue > maPropertyList