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

Class Index

kword'KWTextFrameSet (./koffice/kword/kword_frame.h:255)

class KWTextFrameSet : public KWFrameSet
{
public:
    KWTextFrameSet( KWordDocument *_doc )
        : KWFrameSet( _doc )
    {; }
    ~KWTextFrameSet();

    virtual FrameType getFrameType()
    { return FT_TEXT; }

    virtual void update();

    /**
     * If another parag becomes the first one it uses this function
     * to tell the document about it.
     */
    void setFirstParag( KWParag *_parag );
    KWParag* getFirstParag();

    /**
     * WARNING: This methode is _NOT_ efficient! It iterates through all parags!
     */
    KWParag *getLastParag();

    virtual bool isPTYInFrame( unsigned int _frame, unsigned int _ypos );

    void deleteParag( KWParag *_parag );
    void joinParag( KWParag *_parag1, KWParag *_parag2 );
    void insertParag( KWParag *_parag, InsertPos _pos );
    void splitParag( KWParag *_parag, unsigned int _pos );

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

    bool getAutoCreateNewFrame() { return autoCreateNewFrame; }
    void setAutoCreateNewFrame( bool _auto ) { autoCreateNewFrame = _auto; }

    void updateCounters();
    void updateAllStyles();

    // this function is optimized for framesets in tables and doesn't work for other purposes
    void assign( KWTextFrameSet *fs );

protected:
    virtual void init();

    // pointer to the first parag of the list of parags
    KWParag *parags;
    bool autoCreateNewFrame;

};

/******************************************************************/
/* Class: KWPictureFrameSet                                       */
/******************************************************************/


kword'KWTextFrameSet::init() (./koffice/kword/kword_frame.cc:608)

void KWTextFrameSet::init()
{
    parags = 0L;

    autoCreateNewFrame = true;

    parags = new KWParag( this, doc, 0L, 0L, doc->getDefaultParagLayout() );
    KWFormat *format = new KWFormat( doc );
    format->setDefaults( doc );

    updateCounters();
}

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

kword'KWTextFrameSet::assign() (./koffice/kword/kword_frame.cc:622)

void KWTextFrameSet::assign( KWTextFrameSet *fs )
{
    if ( parags )
	delete parags;

    //parags = fs->getFirstParag();

    parags = new KWParag( *fs->getFirstParag() );
    parags->setFrameSet( this );
    parags->setPrev( 0L );
    parags->setDocument( doc );

    KWParag *p1 = fs->getFirstParag()->getNext(), *p2 = parags, *tmp;
    while ( p1 ) {
	tmp = p2;
	p2 = new KWParag( *p1 );
	//*p2 = *p1;
	tmp->setNext( p2 );
	p2->setPrev( tmp );
	p2->setFrameSet( this );
	p2->setDocument( doc );
	tmp = p2;

	p1 = p1->getNext();
    }

    p2->setNext( 0L );

    getFrame( 0 )->setBackgroundColor( fs->getFrame( 0 )->getBackgroundColor() );
    getFrame( 0 )->setLeftBorder( fs->getFrame( 0 )->getLeftBorder2() );
    getFrame( 0 )->setRightBorder( fs->getFrame( 0 )->getRightBorder2() );
    getFrame( 0 )->setTopBorder( fs->getFrame( 0 )->getTopBorder2() );
    getFrame( 0 )->setBottomBorder( fs->getFrame( 0 )->getBottomBorder2() );
    getFrame( 0 )->setBLeft( fs->getFrame( 0 )->getBLeft() );
    getFrame( 0 )->setBRight( fs->getFrame( 0 )->getBRight() );
    getFrame( 0 )->setBTop( fs->getFrame( 0 )->getBTop() );
    getFrame( 0 )->setBBottom( fs->getFrame( 0 )->getBBottom() );
}

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

kword'KWTextFrameSet::~KWTextFrameSet() (./koffice/kword/kword_frame.cc:662)

KWTextFrameSet::~KWTextFrameSet()
{
    KWParag *p = getLastParag();

    while ( p != parags )
    {
	p = p->getPrev();
	delete p->getNext();
	p->setNext( 0L );
    }

    delete parags;
    parags = 0L;
}

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

kword'KWTextFrameSet::update() (./koffice/kword/kword_frame.cc:678)

void KWTextFrameSet::update()
{
    typedef QList<KWFrame> FrameList;
    QList<FrameList> frameList;
    frameList.setAutoDelete( true );

    QRect pageRect;
    for ( unsigned int i = 0; i < static_cast<unsigned int>( doc->getPages() + 1 ); i++ ) {
	pageRect = QRect( 0, i * doc->getPTPaperHeight(), doc->getPTPaperWidth(), doc->getPTPaperHeight() );

	FrameList *l = new FrameList();
	l->setAutoDelete( false );
	for ( unsigned int j = 0; j < frames.count(); j++ ) {
	    if ( frames.at( j )->intersects( pageRect ) ) {
		frames.at( j )->setPageNum( i );
		l->append( frames.at( j ) );
	    }
	}

	if ( !l->isEmpty() ) {
	    FrameList *ll = new FrameList();
	    ll->setAutoDelete( false );
	    ll->append( l->first() );
	    unsigned int k = 0, m = 0;
	    for ( k = 1; k < l->count(); k++ ) {
		bool inserted = false;
		for ( m = 0; m < ll->count(); m++ ) {
		    if ( l->at( k )->y() < ll->at( m )->y() ) {
			inserted = true;
			ll->insert( m, l->at( k ) );
			break;
		    }
		}
		if ( !inserted ) ll->append( l->at( k ) );
	    }
	    FrameList *l2 = new FrameList();
	    l2->setAutoDelete( false );
	    l2->append( ll->first() );
	    for ( k = 1; k < ll->count(); k++ ) {
		bool inserted = false;
		for ( m = 0; m < l2->count(); m++ ) {
		    if ( ll->at( k )->x() < l2->at( m )->x() ) {
			inserted = true;
			l2->insert( m, ll->at( k ) );
			break;
		    }
		}
		if ( !inserted ) l2->append( ll->at( k ) );
	    }

	    delete ll;
	    delete l;
	    l = l2;
	}

	frameList.append( l );
    }

    frames.setAutoDelete( false );
    frames.clear();

    int rm = 0;
    for ( unsigned int n = 0; n < frameList.count(); n++ ) {
	for ( unsigned int o = 0; o < frameList.at( n )->count(); o++ ) {
	    frames.append( frameList.at( n )->at( o ) );
	    frames.at( frames.count() - 1 )->setMostRight( false );
	    if ( frames.count() > 1 ) {
		if ( frames.at( frames.count() - 2 )->right() > frames.at( frames.count() - 1 )->right() ) {
		    frames.at( frames.count() - 2 )->setMostRight( true );
		    rm++;
		}
	    }
	}
    }

    frames.setAutoDelete( true );
}

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

kword'KWTextFrameSet::setFirstParag() (./koffice/kword/kword_frame.cc:757)

void KWTextFrameSet::setFirstParag( KWParag *_parag )
{
    parags = _parag;
}

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

kword'KWTextFrameSet::getFirstParag() (./koffice/kword/kword_frame.cc:763)

KWParag* KWTextFrameSet::getFirstParag()
{
    return parags;
}

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

kword'KWTextFrameSet::isPTYInFrame() (./koffice/kword/kword_frame.cc:769)

bool KWTextFrameSet::isPTYInFrame( unsigned int _frame, unsigned int _ypos )
{
    KWFrame *frame = getFrame( _frame );
    return ( static_cast<int>( _ypos ) >= static_cast<int>( frame->top() + frame->getBTop().pt() ) &&
	     static_cast<int>( _ypos ) <= static_cast<int>( frame->bottom() - frame->getBBottom().pt() ) );
}

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

kword'KWTextFrameSet::deleteParag() (./koffice/kword/kword_frame.cc:777)

void KWTextFrameSet::deleteParag( KWParag *_parag )
{
    if ( _parag->getInfo() == KWParag::PI_FOOTNOTE )
	return;

    KWParag *p, *p2;

    if ( !getFirstParag()->getPrev() && !getFirstParag()->getNext() )
	return;

    if ( !_parag->getPrev() ) {
	p = _parag->getNext();
	p->setPrev( 0L );
	setFirstParag( p );
	delete _parag;
    } else {
	p = _parag->getNext();
	p2 = _parag->getPrev();
	if ( p ) p->setPrev( p2 );
	p2->setNext( p );
	delete _parag;
    }

    updateCounters();
}

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

kword'KWTextFrameSet::joinParag() (./koffice/kword/kword_frame.cc:804)

void KWTextFrameSet::joinParag( KWParag *_parag1, KWParag *_parag2 )
{
    if ( !_parag1 || !_parag2 ) return;

    if ( _parag2->getNext() ) _parag2->getNext()->setPrev( _parag1 );
    _parag1->setNext( _parag2->getNext() );

    _parag1->appendText( _parag2->getText(), _parag2->getTextLen() );

    delete _parag2;

    updateCounters();
}

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

kword'KWTextFrameSet::insertParag() (./koffice/kword/kword_frame.cc:819)

void KWTextFrameSet::insertParag( KWParag *_parag, InsertPos _pos )
{
    KWParag *_new = 0L, *_prev = 0L, *_next = 0L;

    if ( _parag ) {
	_prev = _parag->getPrev();
	_next = _parag->getNext();
    }

    switch ( _pos ) {
    case I_AFTER: {
	_new = new KWParag( this, doc, _parag, _next,
			    doc->findParagLayout( _parag->getParagLayout()->getFollowingParagLayout() ) );
	if ( _new->getParagLayout()->getName() == _parag->getParagLayout()->getName() )
	    _new->setParagLayout( _parag->getParagLayout() );
	if ( _next ) _next->setPrev( _new );
    } break;
    case I_BEFORE: {
	_new = new KWParag( this, doc, _prev, _parag, _parag->getParagLayout() );
	if ( _parag ) _parag->setPrev( _new );
	if ( !_prev ) setFirstParag( _new );
    } break;
    }

    updateCounters();
}

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

kword'KWTextFrameSet::splitParag() (./koffice/kword/kword_frame.cc:847)

void KWTextFrameSet::splitParag( KWParag *_parag, unsigned int _pos )
{
    KWParag *_new = 0, *_next = 0;

    unsigned int len = _parag->getTextLen() - _pos;
    KWChar* _string = _parag->getKWString()->split( _pos );
    if ( _parag )
	_next = _parag->getNext();

    _new = new KWParag( this, doc, _parag, _next, _parag->getParagLayout() );
    if ( _next ) {
 	_next->setPrev( _new );
	_new->setNext( _next );
    } else {
	_new->setNext( 0 );
    }

    _new->appendText( _string, len );

    updateCounters();
}

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

kword'KWTextFrameSet::save() (./koffice/kword/kword_frame.cc:870)

void KWTextFrameSet::save( ostream &out )
{
    QString grp = "";
    if ( grpMgr ) {
	grp = "\" grpMgr=\"";
	grp += correctQString( grpMgr->getName() );

	unsigned int _row = 0, _col = 0;
	grpMgr->getFrameSet( this, _row, _col );
	KWGroupManager::Cell *cell = grpMgr->getCell( _row, _col );
	QString tmp = "";
	tmp.sprintf( "\" row=\"%d\" col=\"%d\" rows=\"%d\" cols=\"%d", _row, _col, cell->rows, cell->cols  );
	grp += tmp.copy();
    }

    out << otag << "<FRAMESET frameType=\"" << static_cast<int>( getFrameType() )
	<< "\" autoCreateNewFrame=\"" << autoCreateNewFrame << "\" frameInfo=\""
	<< static_cast<int>( frameInfo ) << correctQString( grp ).latin1() << "\" removeable=\""
	<< static_cast<int>( removeableHeader )
	<< "\" visible=\"" << static_cast<int>( visible ) << "\" name=\"" << correctQString( name ).latin1()
	<< "\">" << endl;

    KWFrameSet::save( out );

    KWParag *parag = getFirstParag();
    while ( parag ) {
	out << otag << "<PARAGRAPH>" << endl;
	parag->save( out );
	parag = parag->getNext();
	out << etag << "</PARAGRAPH>" << endl;
    }

    out << etag << "</FRAMESET>" << endl;
}

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

kword'KWTextFrameSet::load() (./koffice/kword/kword_frame.cc:906)

void KWTextFrameSet::load( KOMLParser& parser, vector<KOMLAttrib>& lst )
{
    init();

    string tag;
    string name;

    KWParag *last = 0L;

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

	// paragraph
	if ( name == "PARAGRAPH" ) {
	    KOMLParser::parseTag( tag.c_str(), name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
	    }

	    if ( !last ) {
		delete parags;
		parags = new KWParag( this, doc, 0L, 0L, doc->getDefaultParagLayout() );
		if ( doc->getNumFrameSets() == 0 ) {
		    KWFormat *format = new KWFormat( doc );
		    format->setDefaults( doc );
		    parags->setFormat( 0, 1, *format );
		}
		parags->load( parser, lst );
		last = parags;
	    } else {
		last = new KWParag( this, doc, last, 0L, doc->getDefaultParagLayout() );
		last->load( parser, lst );
	    }
	} else if ( name == "FRAME" ) {
	    KWFrame rect;
	    KWParagLayout::Border l, r, t, b;
	    float lmm = 0, linch = 0, rmm = 0, rinch = 0, tmm = 0, tinch = 0, bmm = 0, binch = 0, ramm = 0, rainch = -1;
	    unsigned int lpt = 0, rpt = 0, tpt = 0, bpt = 0, rapt = 0;

	    l.color = Qt::white;
	    l.style = KWParagLayout::SOLID;
	    l.ptWidth = 1;
	    r.color = Qt::white;
	    r.style = KWParagLayout::SOLID;
	    r.ptWidth = 1;
	    t.color = Qt::white;
	    t.style = KWParagLayout::SOLID;
	    t.ptWidth = 1;
	    b.color = Qt::white;
	    b.style = KWParagLayout::SOLID;
	    b.ptWidth = 1;
	    QColor c( Qt::white );

	    KOMLParser::parseTag( tag.c_str(), name, lst );
	    vector<KOMLAttrib>::const_iterator it = lst.begin();
	    for( ; it != lst.end(); it++ ) {
		if ( ( *it ).m_strName == "left" )
		    rect.setLeft( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "top" )
		    rect.setTop( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "right" )
		    rect.setRight( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "bottom" )
		    rect.setBottom( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "runaround" )
		    rect.setRunAround( static_cast<RunAround>( atoi( ( *it ).m_strValue.c_str() ) ) );
		else if ( ( *it ).m_strName == "runaroundGap" )
		    rect.setRunAroundGap( KWUnit( atof( ( *it ).m_strValue.c_str() ) ) );
		else if ( ( *it ).m_strName == "runaGapPT" )
		    rapt = atoi( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "runaGapMM" )
		    ramm = atof( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "runaGapINCH" )
		    rainch = atof( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "lWidth" )
		    l.ptWidth = atoi( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "rWidth" )
		    r.ptWidth = atoi( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "tWidth" )
		    t.ptWidth = atoi( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "bWidth" )
		    b.ptWidth = atoi( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "lRed" )
		    l.color.setRgb( atoi( ( *it ).m_strValue.c_str() ), l.color.green(), l.color.blue() );
		else if ( ( *it ).m_strName == "rRed" )
		    r.color.setRgb( atoi( ( *it ).m_strValue.c_str() ), r.color.green(), r.color.blue() );
		else if ( ( *it ).m_strName == "tRed" )
		    t.color.setRgb( atoi( ( *it ).m_strValue.c_str() ), t.color.green(), t.color.blue() );
		else if ( ( *it ).m_strName == "bRed" )
		    b.color.setRgb( atoi( ( *it ).m_strValue.c_str() ), b.color.green(), b.color.blue() );
		else if ( ( *it ).m_strName == "lGreen" )
		    l.color.setRgb( l.color.red(), atoi( ( *it ).m_strValue.c_str() ), l.color.blue() );
		else if ( ( *it ).m_strName == "rGreen" )
		    r.color.setRgb( r.color.red(), atoi( ( *it ).m_strValue.c_str() ), r.color.blue() );
		else if ( ( *it ).m_strName == "tGreen" )
		    t.color.setRgb( t.color.red(), atoi( ( *it ).m_strValue.c_str() ), t.color.blue() );
		else if ( ( *it ).m_strName == "bGreen" )
		    b.color.setRgb( b.color.red(), atoi( ( *it ).m_strValue.c_str() ), b.color.blue() );
		else if ( ( *it ).m_strName == "lBlue" )
		    l.color.setRgb( l.color.red(), l.color.green(), atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "rBlue" )
		    r.color.setRgb( r.color.red(), r.color.green(), atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "tBlue" )
		    t.color.setRgb( t.color.red(), t.color.green(), atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "bBlue" )
		    b.color.setRgb( b.color.red(), b.color.green(), atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "lStyle" )
		    l.style = static_cast<KWParagLayout::BorderStyle>( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "rStyle" )
		    r.style = static_cast<KWParagLayout::BorderStyle>( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "tStyle" )
		    t.style = static_cast<KWParagLayout::BorderStyle>( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "bStyle" )
		    b.style = static_cast<KWParagLayout::BorderStyle>( atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "bkRed" )
		    c.setRgb( atoi( ( *it ).m_strValue.c_str() ), c.green(), c.blue() );
		else if ( ( *it ).m_strName == "bkGreen" )
		    c.setRgb( c.red(), atoi( ( *it ).m_strValue.c_str() ), c.blue() );
		else if ( ( *it ).m_strName == "bkBlue" )
		    c.setRgb( c.red(), c.green(), atoi( ( *it ).m_strValue.c_str() ) );
		else if ( ( *it ).m_strName == "bleftpt" )
		    lpt = atoi( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "brightpt" )
		    rpt = atoi( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "btoppt" )
		    tpt = atoi( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "bbottompt" )
		    bpt = atoi( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "bleftmm" )
		    lmm = atof( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "brightmm" )
		    rmm = atof( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "btopmm" )
		    tmm = atof( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "bbottommm" )
		    bmm = atof( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "bleftinch" )
		    linch = atof( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "brightinch" )
		    rinch = atof( ( *it ).m_strValue.c_str() );
		else if ( ( *it ).m_strName == "btopinch" )
		    tinch = atof( ( *it ).m_strValue.c_str() );
		else if ((*it).m_strName == "bbottominch")
		    binch = atof( ( *it ).m_strValue.c_str() );
	    }
	    KWFrame *_frame = new KWFrame( rect.x(), rect.y(), rect.width(), rect.height(), rect.getRunAround(),
					   rainch == -1 ? rect.getRunAroundGap() : KWUnit( rapt, ramm, rainch ) );
	    _frame->setLeftBorder( l );
	    _frame->setRightBorder( r );
	    _frame->setTopBorder( t );
	    _frame->setBottomBorder( b );
	    _frame->setBackgroundColor( QBrush( c ) );
	    _frame->setBLeft( KWUnit( lpt, lmm, linch ) );
	    _frame->setBRight( KWUnit( rpt, rmm, rinch ) );
	    _frame->setBTop( KWUnit( tpt, tmm, tinch ) );
	    _frame->setBBottom( KWUnit( bpt, bmm, binch ) );
	    frames.append( _frame );
	} else
	    cerr << "Unknown tag '" << tag << "' in FRAMESET" << endl;

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

    updateCounters();
}

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

kword'KWTextFrameSet::updateCounters() (./koffice/kword/kword_frame.cc:1076)

void KWTextFrameSet::updateCounters()
{
    KWParag *p = getFirstParag();

    int counterData[ 16 ], listData[ 16 ];
    unsigned int i = 0;
    for ( i = 0; i < 16; i++ ) {
	counterData[ i ] = -2;
	listData[ i ] = -2;
    }
    KWParagLayout::CounterType ct = KWParagLayout::CT_NONE;

    while ( p ) {
	if ( p->getParagLayout()->getCounterType() != KWParagLayout::CT_NONE ) {
	    if ( p->getParagLayout()->getNumberingType() == KWParagLayout::NT_CHAPTER ) {
		counterData[ p->getParagLayout()->getCounterDepth() ]++;
		for ( i = 0; i < 16; i++ ) {
		    if ( counterData[ i ] < 0 ) {
			// Reggie: I (Jost) changed this. I think startCounter should be the same
			// value, not depending on the numbering type. That caused problems.
			counterData[ i ] = atoi( p->getParagLayout()->getStartCounter() );
			/* switch ( p->getParagLayout()->getCounterType() ) {
			case KWParagLayout::CT_NUM: case KWParagLayout::CT_ROM_NUM_L: 
			case KWParagLayout::CT_ROM_NUM_U:
			    counterData[ i ] = atoi( p->getParagLayout()->getStartCounter() );
			    break;
			case KWParagLayout::CT_ALPHAB_L:
			    counterData[ i ] = atoi( p->getParagLayout()->getStartCounter() ); // TEST p->getParagLayout()->getStartCounter()[ 0 ].unicode();
			    break;
			case KWParagLayout::CT_ALPHAB_U:
			    counterData[ i ] = atoi( p->getParagLayout()->getStartCounter() ); // TEST p->getParagLayout()->getStartCounter()[ 0 ].unicode();
			    break;
			default: break;
			}*/
		    }
		    p->getCounterData()[ i ] = counterData[ i ];
		}
		p->makeCounterText();
		for ( i = p->getParagLayout()->getCounterDepth() + 1; i < 16; i++ )
		    counterData[ i ] = -2;
		if ( listData[ 0 ] != -2 ) {
		    for ( i = 0; i < 16; i++ )
			listData[ i ] = -2;
		}
	    } else {
		if ( ct != p->getParagLayout()->getCounterType() ) {
		    for ( i = 0; i < 16; i++ )
			listData[ i ] = -2;
		}
		ct = p->getParagLayout()->getCounterType();
		if ( p->getParagLayout()->getCounterType() != KWParagLayout::CT_BULLET ) {
		    listData[ p->getParagLayout()->getCounterDepth() ]++;
		} else if ( listData[ 0 ] != -2 ) {
		    for ( i = 0; i < 16; i++ )
			listData[ i ] = -2;
		}
		for ( i = 0; i < 16; i++ ) {
		    if ( listData[ i ] < 0 ) {
			switch ( p->getParagLayout()->getCounterType() ) {
			case KWParagLayout::CT_NUM: case KWParagLayout::CT_ROM_NUM_L:
			case KWParagLayout::CT_ROM_NUM_U:
			    listData[ i ] = atoi( p->getParagLayout()->getStartCounter() );
			    break;
			case KWParagLayout::CT_ALPHAB_L:
			    listData[ i ] = p->getParagLayout()->getStartCounter()[ 0 ].unicode();
			    break;
			case KWParagLayout::CT_ALPHAB_U:
			    listData[ i ] = p->getParagLayout()->getStartCounter()[ 0 ].unicode();
			    break;
			default: break;
			}
		    }
		    p->getCounterData()[ i ] = listData[ i ];
		}
		p->makeCounterText();
		for ( i = p->getParagLayout()->getCounterDepth() + 1; i < 16; i++ )
		    listData[ i ] = -2;
	    }
	} else if ( listData[ 0 ] != -2 ) {
	    for ( i = 0; i < 16; i++ )
		listData[ i ] = -2;
	}
	p = p->getNext();
    }
}

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

kword'KWTextFrameSet::updateAllStyles() (./koffice/kword/kword_frame.cc:1163)

void KWTextFrameSet::updateAllStyles()
{
    KWParag *p = getFirstParag();

    while ( p ) {
	if ( doc->isStyleChanged( p->getParagLayout()->getName() ) )
	    p->applyStyle( p->getParagLayout()->getName() );
	p = p->getNext();
    }

    updateCounters();
}

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

kword'KWTextFrameSet::getLastParag() (./koffice/kword/kword_frame.cc:1177)

KWParag *KWTextFrameSet::getLastParag()
{
    KWParag *p = getFirstParag();
    KWParag *last = p;

    while ( p ) {
	last = p;
	p = p->getNext();
    }

    return last;
}

/******************************************************************/
/* Class: KWPictureFrameSet					  */
/******************************************************************/

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