Source Code (Use browser search to find items of interest.)

Class Index

kword'KWParagLayout (./koffice/kword/paraglayout.h:47)

class KWParagLayout
{
public:
    enum Flow {LEFT, RIGHT, CENTER, BLOCK};
    enum CounterType {CT_NONE = 0, CT_NUM = 1, CT_ALPHAB_L = 2, CT_ALPHAB_U = 3,
		      CT_ROM_NUM_L = 4, CT_ROM_NUM_U = 5, CT_BULLET = 6,
		      CT_CUSTOM = 7 };
    enum NumType {NT_LIST = 0, NT_CHAPTER = 1};

    enum BorderStyle {SOLID = 0, DASH = 1, DOT = 2, DASH_DOT = 3, DASH_DOT_DOT = 4};
    struct Border
    {
	Border()
	    : color( Qt::black ), style( SOLID ), ptWidth( 1 ) {
	}
	QColor color;
	BorderStyle style;
	unsigned int ptWidth;
	bool operator==( const Border _brd ) const {
	    return ( style == _brd.style && color == _brd.color && ptWidth == _brd.ptWidth );
	}
	bool operator!=( const Border _brd ) const {
	    return ( style != _brd.style || color != _brd.color || ptWidth != _brd.ptWidth );
	}
    };

    struct Counter
    {
	unsigned int counterDepth;
	QChar counterBullet;
	QString counterLeftText;
	QString counterRightText;
	CounterType counterType;
	QString startCounter;
	NumType numberingType;
	QString bulletFont;
	QString customCounterDef;
    };

    KWParagLayout( KWordDocument *_doc, bool _add = true,
		   QString _name = "Standard" );
    ~KWParagLayout();

    KWParagLayout& operator=( const KWParagLayout &_layout );

    void setFormat( const KWFormat &_format );
    void setFirstLineLeftIndent( KWUnit _i ) { firstLineLeftIndent = _i; }
    void setLeftIndent( KWUnit _i ) { leftIndent = _i; }
    void setParagFootOffset( KWUnit _i ) { paragFootOffset = _i; }
    void setParagHeadOffset( KWUnit _i ) { paragHeadOffset = _i; }
    void setLineSpacing( KWUnit _i ) { lineSpacing = _i; }
    void setName( const QString& _n ) { name = _n; }
    void setFlow( Flow _f ) { flow = _f; }
    void setCounterLeftText( const QString& _t )
    { counter.counterLeftText = _t; }
    void setCounterRightText( const QString& _t )
    { counter.counterRightText = _t; }
    void setCounterType( CounterType _t ) { counter.counterType = _t; }
    void setCounterBullet( QChar _b ) { counter.counterBullet = _b; }
    void setCounterDepth( unsigned int _d ) { counter.counterDepth = _d; }
    void setFollowingParagLayout( const QString& _paragname );

    void setLeftBorder( Border _brd ) { left = _brd; }
    void setRightBorder( Border _brd ) { right = _brd; }
    void setTopBorder( Border _brd ) { top = _brd; }
    void setBottomBorder( Border _brd ) { bottom = _brd; }

    void setStartCounter( const QString& _s ) { counter.startCounter = _s; }
    QString getStartCounter() const { return counter.startCounter; }

    void setNumberingType( NumType _t ) { counter.numberingType = _t; }
    NumType getNumberingType() const { return counter.numberingType; }

    void setBulletFont( const QString& _f ) { counter.bulletFont = _f; }
    QString getBulletFont() const { return counter.bulletFont; }

    void setCustomCounterDef( const QString& d_ ) { counter.customCounterDef = d_; }
    QString getCustomCounterDef() { return counter.customCounterDef; }

    KWFormat& getFormat() { return format; }
    QString getName() const { return name; }
    KWUnit getFirstLineLeftIndent() const { return firstLineLeftIndent; }
    KWUnit getLeftIndent() const { return leftIndent; }
    KWUnit getParagFootOffset() const { return paragFootOffset; }
    KWUnit getParagHeadOffset() const { return paragHeadOffset; }
    KWUnit getLineSpacing() const { return lineSpacing; }
    Flow getFlow() const { return flow; }
    Border getLeftBorder() const { return left; }
    Border getRightBorder() const { return right; }
    Border getTopBorder() const { return top; }
    Border getBottomBorder() const { return bottom; }
    CounterType getCounterType() const { return counter.counterType; }
    QChar getCounterBullet() const { return counter.counterBullet; }
    int getCounterDepth() const { return counter.counterDepth; }
    QString getCounterLeftText() const { return counter.counterLeftText; }
    QString getCounterRightText() const { return counter.counterRightText.data(); }

    QString getFollowingParagLayout() { return followingParagLayout; }

    void save( ostream &out );
    void load( KOMLParser&, vector<KOMLAttrib>& );

    Counter getCounter() const { return counter; }
    void setCounter( Counter _counter ) { counter = _counter; }

    const QList<KoTabulator> *getTabList() const { return &tabList; }
    void setTabList( const QList<KoTabulator> *tabList );

    bool getNextTab( unsigned int _ptPos, unsigned int _lBorder, unsigned int _rBorder,
		     unsigned int &_tabPos, KoTabulators &_tabType );
    bool hasSpecialTabs() const { return specialTabs; }

protected:
    KWFormat format;

    Flow flow;
    KWUnit paragFootOffset;
    KWUnit paragHeadOffset;
    KWUnit firstLineLeftIndent;
    KWUnit leftIndent;
    KWUnit lineSpacing;
    Border left, right, top, bottom;

    Counter counter;
    QString followingParagLayout;
    QString name;
    KWordDocument *document;
    QList<KoTabulator> tabList;
    bool specialTabs;

};

kword'KWParagLayout::KWParagLayout() (./koffice/kword/paraglayout.cc:40)

KWParagLayout::KWParagLayout( KWordDocument *_doc, bool _add, QString _name )
    : format( _doc ), paragFootOffset(), paragHeadOffset(), firstLineLeftIndent(), leftIndent(), lineSpacing()
{
    flow = LEFT;
    counter.counterType = CT_NONE;
    counter.counterDepth = 0;
    counter.counterBullet = QChar( '·' );
    counter.counterLeftText = "";
    counter.counterRightText = "";
    followingParagLayout = "Standard";
    name = _name;
    counter.startCounter = "0";
    counter.numberingType = NT_LIST;
    counter.bulletFont = "symbol";
    counter.customCounterDef = "";

    left.color = Qt::white;
    left.style = SOLID;
    left.ptWidth = 0;
    right.color = Qt::white;
    right.style = SOLID;
    right.ptWidth = 0;
    top.color = Qt::white;
    top.style = SOLID;
    top.ptWidth = 0;
    bottom.color = Qt::white;
    bottom.style = SOLID;
    bottom.ptWidth = 0;

    format.setDefaults( _doc );

    document = _doc;
    if ( _add )
	document->paragLayoutList.append( this );

    tabList.setAutoDelete( false );
    specialTabs = false;
}

/*================================================================*/

kword'KWParagLayout::~KWParagLayout() (./koffice/kword/paraglayout.cc:80)

KWParagLayout::~KWParagLayout()
{
    document->paragLayoutList.setAutoDelete( true );
    document->paragLayoutList.removeRef( this );
    document->paragLayoutList.setAutoDelete( false );
}

/*================================================================*/

kword'KWParagLayout::setFollowingParagLayout() (./koffice/kword/paraglayout.cc:126)

void KWParagLayout::setFollowingParagLayout( const QString& _name )
{
    followingParagLayout = _name;
}

/*================================================================*/

kword'KWParagLayout::setFormat() (./koffice/kword/paraglayout.cc:132)

void KWParagLayout::setFormat( const KWFormat &_f )
{
    format = _f;
}

/*================================================================*/

kword'KWParagLayout::save() (./koffice/kword/paraglayout.cc:138)

void KWParagLayout::save( ostream &out )
{
    out << indent << "<NAME value=\"" << correctQString( name ).latin1() << "\"/>" << endl;
    out << indent << "<FOLLOWING name=\"" << correctQString( followingParagLayout ).latin1() << "\"/>" << endl;
    out << indent << "<FLOW value=\"" << static_cast<int>( flow ) << "\"/>" << endl;
    out << indent << "<OHEAD " << paragHeadOffset << "/>" << endl;
    out << indent << "<OFOOT " << paragFootOffset << "/>" << endl;
    out << indent << "<IFIRST " << firstLineLeftIndent << "/>" << endl;
    out << indent << "<ILEFT " << leftIndent << "/>" << endl;
    out << indent << "<LINESPACE " << lineSpacing << "/>" << endl;
    out << indent << "<COUNTER type=\"" << static_cast<int>( counter.counterType ) << "\" depth=\"" << counter.counterDepth
	<< "\" bullet=\"" << static_cast<unsigned short>( counter.counterBullet.unicode() ) << "\" start=\""
	<< correctQString( counter.startCounter ).latin1() << "\" numberingtype=\""
	<< static_cast<int>( counter.numberingType ) << "\" lefttext=\""
	<< correctQString( counter.counterLeftText ).latin1() << "\" righttext=\""
	<< correctQString( counter.counterRightText ).latin1() << "\" bulletfont=\""
	<< correctQString( counter.bulletFont ).latin1() << "\" customdef=\""
	<< correctQString( counter.customCounterDef ).latin1() << "\" />" << endl;
    out << indent << "<LEFTBORDER red=\"" << left.color.red() << "\" green=\"" << left.color.green() << "\" blue=\""
	<< left.color.blue() << "\" style=\"" << static_cast<int>( left.style ) << "\" width=\"" << left.ptWidth << "\"/>" << endl;
    out << indent << "<RIGHTBORDER red=\"" << right.color.red() << "\" green=\"" << right.color.green() << "\" blue=\""
	<< right.color.blue() << "\" style=\"" << static_cast<int>( right.style ) << "\" width=\"" << right.ptWidth << "\"/>" << endl;
    out << indent << "<TOPBORDER red=\"" << top.color.red() << "\" green=\"" << top.color.green() << "\" blue=\""
	<< top.color.blue() << "\" style=\"" << static_cast<int>( top.style ) << "\" width=\"" << top.ptWidth << "\"/>" << endl;
    out << indent << "<BOTTOMBORDER red=\"" << bottom.color.red() << "\" green=\"" << bottom.color.green() << "\" blue=\""
	<< bottom.color.blue() << "\" style=\"" << static_cast<int>( bottom.style )
	<< "\" width=\"" << bottom.ptWidth << "\"/>" << endl;
    out << otag << "<FORMAT>" << endl;
    format.save( out );
    out << etag << "</FORMAT> " << endl;

    for ( unsigned int i = 0; i < tabList.count(); i++ )
	out << indent << "<TABULATOR mmpos=\"" << tabList.at( i )->mmPos << "\" ptpos=\"" << tabList.at( i )->ptPos
	    << "\" inchpos=\"" << tabList.at( i )->inchPos << "\" type=\""
	    << static_cast<int>( tabList.at( i )->type ) << "\"/>" << endl;
}

/*================================================================*/

kword'KWParagLayout::load() (./koffice/kword/paraglayout.cc:176)

void KWParagLayout::load( KOMLParser& parser, vector<KOMLAttrib>& lst )
{
    string tag;
    string _name;
    unsigned int pt;
    float mm, inch;

    while ( parser.open( 0L, tag ) ) {
	KOMLParser::parseTag( tag.c_str(), _name, lst );

	// name
	if ( _name == "NAME" ) {
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "value" )
		    name = correctQString( ( *it ).m_strValue.c_str() );
	    }
	} else if ( _name == "FOLLOWING" ) {
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "name" )
		    followingParagLayout = correctQString( ( *it ).m_strValue.c_str() );
	    }
	} else if ( _name == "TABULATOR" ) {
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    KoTabulator *tab = new KoTabulator;
	    bool noinch = true;
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "mmpos" )
		    tab->mmPos = atof( ( *it ).m_strValue.c_str() );
		if ( ( *it ).m_strName == "ptpos" )
		    tab->ptPos = atoi( ( *it ).m_strValue.c_str() );
		if ( ( *it ).m_strName == "inchpos" ) {
		    noinch = false;
		    tab->inchPos = atof( ( *it ).m_strValue.c_str() );
		}
		if ( ( *it ).m_strName == "type" )
		    tab->type = static_cast<KoTabulators>( atoi( ( *it ).m_strValue.c_str() ) );
	    }
	    if ( noinch ) tab->inchPos = MM_TO_INCH( tab->mmPos );
	    tabList.append( tab );
	} else if ( _name == "FLOW" ) {
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "value" )
		    flow = static_cast<Flow>( atoi( ( *it ).m_strValue.c_str() ) );
	    }
	} else if ( _name == "OHEAD" ) {
	    pt = 0;
	    mm = inch = 0.0;
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "pt" )
		    pt = atoi( ( *it ).m_strValue.c_str() );
		if ( ( *it ).m_strName == "mm" )
		    mm = atof( ( *it ).m_strValue.c_str() );
		if ( ( *it ).m_strName == "inch" )
		    inch = atof( ( *it ).m_strValue.c_str() );
	    }
	    paragHeadOffset.setPT_MM_INCH( pt, mm, inch );
	} else if ( _name == "OFOOT" ) {
	    pt = 0;
	    mm = inch = 0.0;
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "pt" )
		    pt = atoi( ( *it ).m_strValue.c_str() );
		if ( ( *it ).m_strName == "mm" )
		    mm = atof( ( *it ).m_strValue.c_str() );
		if ( ( *it ).m_strName == "inch" )
		    inch = atof( ( *it ).m_strValue.c_str() );
	    }
	    paragFootOffset.setPT_MM_INCH( pt, mm, inch );
	} else if ( _name == "IFIRST" ) {
	    pt = 0;
	    mm = inch = 0.0;
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "pt" )
		    pt = atoi( ( *it ).m_strValue.c_str() );
		if ( ( *it ).m_strName == "mm" )
		    mm = atof( ( *it ).m_strValue.c_str() );
		if ( ( *it ).m_strName == "inch" )
		    inch = atof( ( *it ).m_strValue.c_str() );
	    }
	    firstLineLeftIndent.setPT_MM_INCH( pt, mm, inch );
	} else if ( _name == "ILEFT" ) {
	    pt = 0;
	    mm = inch = 0.0;
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "pt" )
		    pt = atoi( ( *it ).m_strValue.c_str() );
		if ( ( *it ).m_strName == "mm" )
		    mm = atof( ( *it ).m_strValue.c_str() );
		if ( ( *it ).m_strName == "inch" )
		    inch = atof( ( *it ).m_strValue.c_str() );
	    }
	    leftIndent.setPT_MM_INCH( pt, mm, inch );
	} else if ( _name == "LINESPACE" ) {
	    pt = 0;
	    mm = inch = 0.0;
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "pt" )
		    pt = atoi( ( *it ).m_strValue.c_str() );
		if ( ( *it ).m_strName == "mm" )
		    mm = atof( ( *it ).m_strValue.c_str() );
		if ( ( *it ).m_strName == "inch" )
		    inch = atof( ( *it ).m_strValue.c_str() );
	    }
	    lineSpacing.setPT_MM_INCH( pt, mm, inch );
	} else if ( _name == "OFFSETS" ) {
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "head" )
		    paragHeadOffset.setMM( atof( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "foot" )
		    paragFootOffset.setMM( atof( ( *it ).m_strValue.c_str() ) );
	    }
	} else if ( _name == "INDENTS" ) {
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "first" )
		    firstLineLeftIndent.setMM( atof( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "left" )
		    leftIndent.setMM( atof( ( *it ).m_strValue.c_str() ) );
	    }
	} else if ( _name == "LINESPACING" ) {
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "value" )
		    lineSpacing.setPT( atoi( ( *it ).m_strValue.c_str() ) );
	    }
	} else if ( _name == "COUNTER" ) {
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "type" )
		    counter.counterType = static_cast<CounterType>( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "depth" )
		    counter.counterDepth = atoi( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "bullet" )
		    counter.counterBullet = QChar( static_cast<unsigned short>( atoi( ( *it ).m_strValue.c_str() ) ) );
		else if ( ( *it ).m_strName == "lefttext" )
		    counter.counterLeftText = correctQString( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "righttext" )
		    counter.counterRightText = correctQString( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "start" )
		    counter.startCounter = correctQString( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "numberingtype" )
		    counter.numberingType = static_cast<NumType>( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "bulletfont" )
		    counter.bulletFont = correctQString( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "customdef" )
		    counter.customCounterDef = correctQString( ( *it ).m_strValue.c_str() );
	    }
	} else if ( _name == "LEFTBORDER" ) {
	    unsigned int r = 0, g = 0, b = 0;
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "red" ) {
		    r = atoi( ( *it ).m_strValue.c_str() );
		    left.color.setRgb( r, g, b );
		} else if ( ( *it ).m_strName == "green" ) {
		    g = atoi( ( *it ).m_strValue.c_str() );
		    left.color.setRgb( r, g, b );
		} else if ( ( *it ).m_strName == "blue" ) {
		    b = atoi( ( *it ).m_strValue.c_str() );
		    left.color.setRgb( r, g, b );
		} else if ( ( *it ).m_strName == "style" )
		    left.style = static_cast<BorderStyle>( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "width" )
		    left.ptWidth = atoi( ( *it ).m_strValue.c_str() );
	    }
	} else if ( _name == "RIGHTBORDER" ) {
	    unsigned int r = 0, g = 0, b = 0;
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "red" ) {
		    r = atoi( ( *it ).m_strValue.c_str() );
		    right.color.setRgb( r, g, b );
		} else if ( ( *it ).m_strName == "green" ) {
		    g = atoi( ( *it ).m_strValue.c_str() );
		    right.color.setRgb( r, g, b );
		} else if ( ( *it ).m_strName == "blue" ) {
		    b = atoi( ( *it ).m_strValue.c_str() );
		    right.color.setRgb( r, g, b );
		} else if ( ( *it ).m_strName == "style" )
		    right.style = static_cast<BorderStyle>( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "width" )
		    right.ptWidth = atoi( ( *it ).m_strValue.c_str() );
	    }
	} else if ( _name == "BOTTOMBORDER" ) {
	    unsigned int r = 0, g = 0, b = 0;
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "red" ) {
		    r = atoi( ( *it ).m_strValue.c_str() );
		    bottom.color.setRgb( r, g, b );
		} else if ( ( *it ).m_strName == "green" ) {
		    g = atoi( ( *it ).m_strValue.c_str() );
		    bottom.color.setRgb( r, g, b );
		} else if ( ( *it ).m_strName == "blue" ) {
		    b = atoi( ( *it ).m_strValue.c_str() );
		    bottom.color.setRgb( r, g, b );
		} else if ( ( *it ).m_strName == "style" )
		    bottom.style = static_cast<BorderStyle>( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "width" )
		    bottom.ptWidth = atoi( ( *it ).m_strValue.c_str() );
	    }
	} else if ( _name == "TOPBORDER" ) {
	    unsigned int r = 0, g = 0, b = 0;
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "red" ) {
		    r = atoi( ( *it ).m_strValue.c_str() );
		    top.color.setRgb( r, g, b );
		} else if ( ( *it ).m_strName == "green" ) {
		    g = atoi( ( *it ).m_strValue.c_str() );
		    top.color.setRgb( r, g, b );
		} else if ( ( *it ).m_strName == "blue" ) {
		    b = atoi( ( *it ).m_strValue.c_str() );
		    top.color.setRgb( r, g, b );
		} else if ( ( *it ).m_strName == "style" )
		    top.style = static_cast<BorderStyle>( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "width" )
		    top.ptWidth = atoi( ( *it ).m_strValue.c_str() );
	    }
	} else if ( _name == "FORMAT" ) {
	    KOMLParser::parseTag( tag.c_str(), _name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
	    }
	    format.load( parser, lst, document );
	} else
	    cerr << "Unknown tag '" << tag << "' in PARAGRAPHLAYOUT" << endl;

	if ( !parser.close( tag ) ) {
	    cerr << "ERR: Closing Child" << endl;
	    return;
	}
    }
}

/*================================================================*/

kword'KWParagLayout::setTabList() (./koffice/kword/paraglayout.cc:438)

void KWParagLayout::setTabList( const QList<KoTabulator> *_tabList )
{
    tabList.setAutoDelete( true );
    tabList.clear();
    tabList.setAutoDelete( false );
    specialTabs = false;

    QListIterator<KoTabulator> it(*_tabList);
    for ( it.toFirst(); it.current(); ++it ) {
	KoTabulator *t = new KoTabulator;
	t->type = it.current()->type;
	t->mmPos = it.current()->mmPos;
	t->ptPos = it.current()->ptPos;
	t->inchPos = it.current()->inchPos;
	tabList.append( t );
	if ( t->type != T_LEFT ) specialTabs = true;
    }
}

/*================================================================*/

kword'KWParagLayout::getNextTab() (./koffice/kword/paraglayout.cc:458)

bool KWParagLayout::getNextTab( unsigned int _ptPos, unsigned int _lBorder, unsigned int _rBorder,
				unsigned int &_tabPos, KoTabulators &_tabType )
{
    _tabPos = 0;
    _tabType = T_LEFT;

    if ( tabList.isEmpty() ) return false;

    int _mostLeft = -1, _best = -1;
    unsigned int ptPos = 0;

    for ( unsigned int i = 0; i < tabList.count(); i++ ) {
	ptPos = tabList.at( i )->ptPos + _lBorder;
	if ( ptPos > _ptPos && ptPos < _rBorder && ( _best == -1 ||
						     ptPos < static_cast<unsigned int>( tabList.at( _best )->ptPos ) ) )
	    _best = i;
	if ( ptPos <= _ptPos && ptPos > _lBorder && ( _mostLeft == -1 ||
						      ptPos < static_cast<unsigned int>( tabList.at( _mostLeft )->ptPos ) ) )
	    _mostLeft = i;
    }

    if ( _best != -1 ) {
	_tabPos = tabList.at( _best )->ptPos + _lBorder;
	_tabType = tabList.at( _best )->type;
	return true;
    }

    if ( _mostLeft != -1 ) {
	_tabPos = tabList.at( _mostLeft )->ptPos + _lBorder;
	_tabType = tabList.at( _mostLeft )->type;
	return true;
    }

    return false;
}