00001 #include "KoListStyleStack.h" 00002 #include <KoDom.h> 00003 #include <KoXmlNS.h> 00004 00005 KoListStyleStack::KoListStyleStack() 00006 : m_initialLevel( 0 ) 00007 { 00008 } 00009 00010 KoListStyleStack::~KoListStyleStack() 00011 { 00012 } 00013 00014 void KoListStyleStack::pop() 00015 { 00016 m_stack.pop(); 00017 } 00018 00019 void KoListStyleStack::push( const QDomElement& style ) 00020 { 00021 m_stack.push( style ); 00022 } 00023 00024 void KoListStyleStack::setInitialLevel( int initialLevel ) 00025 { 00026 Q_ASSERT( m_stack.isEmpty() ); 00027 m_initialLevel = initialLevel; 00028 } 00029 00030 QDomElement KoListStyleStack::currentListStyle() const 00031 { 00032 Q_ASSERT( !m_stack.isEmpty() ); 00033 return m_stack.top(); 00034 } 00035 00036 QDomElement KoListStyleStack::currentListStyleProperties() const 00037 { 00038 QDomElement style = currentListStyle(); 00039 return KoDom::namedItemNS( style, KoXmlNS::style, "list-level-properties" ); 00040 } 00041 00042 QDomElement KoListStyleStack::currentListStyleTextProperties() const 00043 { 00044 QDomElement style = currentListStyle(); 00045 return KoDom::namedItemNS( style, KoXmlNS::style, "text-properties" ); 00046 }