LCOV - code coverage report
Current view: top level - oox/source/helper - grabbagstack.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 49 0.0 %
Date: 2014-04-14 Functions: 0 11 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : 
      11             : #include "oox/helper/grabbagstack.hxx"
      12             : #include <com/sun/star/uno/Sequence.hxx>
      13             : 
      14             : namespace oox
      15             : {
      16             : 
      17             : using namespace css::beans;
      18             : using namespace css::uno;
      19             : 
      20           0 : GrabBagStack::GrabBagStack(const OUString& aName)
      21             : {
      22           0 :     mCurrentElement.maName = aName;
      23           0 : }
      24             : 
      25           0 : GrabBagStack::~GrabBagStack()
      26           0 : {}
      27             : 
      28           0 : OUString GrabBagStack::getCurrentName()
      29             : {
      30           0 :     return mCurrentElement.maName;
      31             : }
      32             : 
      33           0 : bool GrabBagStack::isStackEmpty()
      34             : {
      35           0 :     return mStack.empty();
      36             : }
      37             : 
      38           0 : PropertyValue GrabBagStack::getRootProperty()
      39             : {
      40           0 :     while(!mStack.empty())
      41           0 :         pop();
      42             : 
      43           0 :     PropertyValue aProperty;
      44           0 :     aProperty.Name = mCurrentElement.maName;
      45             : 
      46           0 :     Sequence<PropertyValue> aSequence(mCurrentElement.maPropertyList.size());
      47           0 :     PropertyValue* pSequence = aSequence.getArray();
      48           0 :     std::vector<PropertyValue>::iterator i;
      49           0 :     for (i = mCurrentElement.maPropertyList.begin(); i != mCurrentElement.maPropertyList.end(); ++i)
      50           0 :         *pSequence++ = *i;
      51             : 
      52           0 :     aProperty.Value = makeAny(aSequence);
      53             : 
      54           0 :     return aProperty;
      55             : }
      56             : 
      57           0 : void GrabBagStack::appendElement(const OUString& aName, Any aAny)
      58             : {
      59           0 :     PropertyValue aValue;
      60           0 :     aValue.Name = aName;
      61           0 :     aValue.Value = aAny;
      62           0 :     mCurrentElement.maPropertyList.push_back(aValue);
      63           0 : }
      64             : 
      65           0 : void GrabBagStack::push(const OUString& aKey)
      66             : {
      67           0 :     mStack.push(mCurrentElement);
      68           0 :     mCurrentElement.maName = aKey;
      69           0 :     mCurrentElement.maPropertyList.clear();
      70           0 : }
      71             : 
      72           0 : void GrabBagStack::pop()
      73             : {
      74           0 :     OUString aName = mCurrentElement.maName;
      75           0 :     Sequence<PropertyValue> aSequence(mCurrentElement.maPropertyList.size());
      76           0 :     PropertyValue* pSequence = aSequence.getArray();
      77           0 :     std::vector<PropertyValue>::iterator i;
      78           0 :     for (i = mCurrentElement.maPropertyList.begin(); i != mCurrentElement.maPropertyList.end(); ++i)
      79           0 :         *pSequence++ = *i;
      80             : 
      81           0 :     mCurrentElement = mStack.top();
      82           0 :     mStack.pop();
      83           0 :     appendElement(aName, makeAny(aSequence));
      84           0 : }
      85             : 
      86           0 : void GrabBagStack::addInt32(const OUString& aElementName, sal_Int32 aIntValue)
      87             : {
      88           0 :     appendElement(aElementName, makeAny(aIntValue));
      89           0 : }
      90             : 
      91           0 : void GrabBagStack::addString(const OUString& aElementName, const OUString& aStringValue)
      92             : {
      93           0 :     appendElement(aElementName, makeAny(aStringValue));
      94           0 : }
      95             : 
      96             : } // namespace oox
      97             : 
      98             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10