summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoListStyleStack.cpp
blob: 45631b07b5ed6573a2ea6094b78f21e8238d7f9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "KoListStyleStack.h"
#include <KoDom.h>
#include <KoXmlNS.h>

KoListStyleStack::KoListStyleStack()
    : m_initialLevel( 0 )
{
}

KoListStyleStack::~KoListStyleStack()
{
}

void KoListStyleStack::pop()
{
    m_stack.pop();
}

void KoListStyleStack::push( const QDomElement& style )
{
    m_stack.push( style );
}

void KoListStyleStack::setInitialLevel( int initialLevel )
{
    Q_ASSERT( m_stack.isEmpty() );
    m_initialLevel = initialLevel;
}

QDomElement KoListStyleStack::currentListStyle() const
{
    Q_ASSERT( !m_stack.isEmpty() );
    return m_stack.top();
}

QDomElement KoListStyleStack::currentListStyleProperties() const
{
    QDomElement style = currentListStyle();
    return KoDom::namedItemNS( style, KoXmlNS::style, "list-level-properties" );
}

QDomElement KoListStyleStack::currentListStyleTextProperties() const
{
    QDomElement style = currentListStyle();
    return KoDom::namedItemNS( style, KoXmlNS::style, "text-properties" );
}