Fix koffice FTBFS

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1247909 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 04766b207a
commit 2cdbd87e39

@ -284,7 +284,7 @@ void KDGanttSplitterHandle::paintEvent( TQPaintEvent * )
bitBlt( this, 0, 0, &buffer ); bitBlt( this, 0, 0, &buffer );
} }
class TQSplitterLayoutStruct class KDGanttSplitterLayoutStruct
{ {
public: public:
KDGanttMinimizeSplitter::ResizeMode mode; KDGanttMinimizeSplitter::ResizeMode mode;
@ -298,7 +298,7 @@ class TQSplitterData
public: public:
TQSplitterData() : opaque( FALSE ), firstShow( TRUE ) {} TQSplitterData() : opaque( FALSE ), firstShow( TRUE ) {}
TQPtrList<TQSplitterLayoutStruct> list; TQPtrList<KDGanttSplitterLayoutStruct> list;
bool opaque; bool opaque;
bool firstShow; bool firstShow;
}; };
@ -438,7 +438,7 @@ void KDGanttMinimizeSplitter::setOrientation( Qt::Orientation o )
else else
tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Expanding ) ); tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Expanding ) );
TQSplitterLayoutStruct *s = data->list.first(); KDGanttSplitterLayoutStruct *s = data->list.first();
while ( s ) { while ( s ) {
if ( s->isSplitter ) if ( s->isSplitter )
((KDGanttSplitterHandle*)s->wid)->setOrientation( o ); ((KDGanttSplitterHandle*)s->wid)->setOrientation( o );
@ -466,12 +466,12 @@ void KDGanttMinimizeSplitter::resizeEvent( TQResizeEvent * )
needed. (If \a first is TRUE, then recalcId is very probably needed. (If \a first is TRUE, then recalcId is very probably
needed.) needed.)
*/ */
TQSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( TQWidget *w, bool first ) KDGanttSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( TQWidget *w, bool first )
{ {
TQSplitterLayoutStruct *s; KDGanttSplitterLayoutStruct *s;
KDGanttSplitterHandle *newHandle = 0; KDGanttSplitterHandle *newHandle = 0;
if ( data->list.count() > 0 ) { if ( data->list.count() > 0 ) {
s = new TQSplitterLayoutStruct; s = new KDGanttSplitterLayoutStruct;
s->mode = KeepSize; s->mode = KeepSize;
TQString tmp = "qt_splithandle_"; TQString tmp = "qt_splithandle_";
tmp += w->name(); tmp += w->name();
@ -485,7 +485,7 @@ TQSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( TQWidget *w, bool fi
else else
data->list.append( s ); data->list.append( s );
} }
s = new TQSplitterLayoutStruct; s = new KDGanttSplitterLayoutStruct;
s->mode = Stretch; s->mode = Stretch;
s->wid = w; s->wid = w;
if ( !testWState( WState_Resized ) && w->tqsizeHint().isValid() ) if ( !testWState( WState_Resized ) && w->tqsizeHint().isValid() )
@ -516,7 +516,7 @@ void KDGanttMinimizeSplitter::childEvent( TQChildEvent *c )
if ( ((TQWidget*)c->child())->testWFlags( WType_TopLevel ) ) if ( ((TQWidget*)c->child())->testWFlags( WType_TopLevel ) )
return; return;
TQSplitterLayoutStruct *s = data->list.first(); KDGanttSplitterLayoutStruct *s = data->list.first();
while ( s ) { while ( s ) {
if ( s->wid == c->child() ) if ( s->wid == c->child() )
return; return;
@ -526,10 +526,10 @@ void KDGanttMinimizeSplitter::childEvent( TQChildEvent *c )
recalc( isVisible() ); recalc( isVisible() );
} else if ( c->type() == TQEvent::ChildRemoved ) { } else if ( c->type() == TQEvent::ChildRemoved ) {
TQSplitterLayoutStruct *p = 0; KDGanttSplitterLayoutStruct *p = 0;
if ( data->list.count() > 1 ) if ( data->list.count() > 1 )
p = data->list.at(1); //remove handle _after_ first widget. p = data->list.at(1); //remove handle _after_ first widget.
TQSplitterLayoutStruct *s = data->list.first(); KDGanttSplitterLayoutStruct *s = data->list.first();
while ( s ) { while ( s ) {
if ( s->wid == c->child() ) { if ( s->wid == c->child() ) {
data->list.removeRef( s ); data->list.removeRef( s );
@ -615,7 +615,7 @@ void KDGanttMinimizeSplitter::drawSplitter( TQPainter *p,
*/ */
int KDGanttMinimizeSplitter::idAfter( TQWidget* w ) const int KDGanttMinimizeSplitter::idAfter( TQWidget* w ) const
{ {
TQSplitterLayoutStruct *s = data->list.first(); KDGanttSplitterLayoutStruct *s = data->list.first();
bool seen_w = FALSE; bool seen_w = FALSE;
while ( s ) { while ( s ) {
if ( s->isSplitter && seen_w ) if ( s->isSplitter && seen_w )
@ -644,7 +644,7 @@ void KDGanttMinimizeSplitter::moveSplitter( TQCOORD p, int id )
{ {
p = adjustPos( p, id ); p = adjustPos( p, id );
TQSplitterLayoutStruct *s = data->list.at(id); KDGanttSplitterLayoutStruct *s = data->list.at(id);
int oldP = orient ==Qt::Horizontal ? s->wid->x() : s->wid->y(); int oldP = orient ==Qt::Horizontal ? s->wid->x() : s->wid->y();
bool upLeft; bool upLeft;
if ( TQApplication::reverseLayout() && orient ==Qt::Horizontal ) { if ( TQApplication::reverseLayout() && orient ==Qt::Horizontal ) {
@ -680,7 +680,7 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft )
{ {
if( id < 0 ) if( id < 0 )
return; return;
TQSplitterLayoutStruct *s = data->list.at(id); KDGanttSplitterLayoutStruct *s = data->list.at(id);
if ( !s ) if ( !s )
return; return;
TQWidget *w = s->wid; TQWidget *w = s->wid;
@ -729,7 +729,7 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft )
*/ */
void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft )
{ {
TQSplitterLayoutStruct *s = id < int(data->list.count()) ? KDGanttSplitterLayoutStruct *s = id < int(data->list.count()) ?
data->list.at(id) : 0; data->list.at(id) : 0;
if ( !s ) if ( !s )
return; return;
@ -781,7 +781,7 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft )
void KDGanttMinimizeSplitter::expandPos( int id, int* min, int* max ) void KDGanttMinimizeSplitter::expandPos( int id, int* min, int* max )
{ {
TQSplitterLayoutStruct *s = data->list.at(id-1); KDGanttSplitterLayoutStruct *s = data->list.at(id-1);
TQWidget* w = s->wid; TQWidget* w = s->wid;
*min = pick( w->mapToParent( TQPoint(0,0) ) ); *min = pick( w->mapToParent( TQPoint(0,0) ) );
@ -789,7 +789,7 @@ void KDGanttMinimizeSplitter::expandPos( int id, int* min, int* max )
pick( size() ); pick( size() );
} }
else { else {
TQSplitterLayoutStruct *s = data->list.at(id+1); KDGanttSplitterLayoutStruct *s = data->list.at(id+1);
TQWidget* w = s->wid; TQWidget* w = s->wid;
*max = pick( w->mapToParent( TQPoint( w->width(), w->height() ) ) ) -8; *max = pick( w->mapToParent( TQPoint( w->width(), w->height() ) ) ) -8;
} }
@ -813,7 +813,7 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max )
return; return;
int i; int i;
for ( i = 0; i < id; i++ ) { for ( i = 0; i < id; i++ ) {
TQSplitterLayoutStruct *s = data->list.at(i); KDGanttSplitterLayoutStruct *s = data->list.at(i);
if ( s->wid->isHidden() ) { if ( s->wid->isHidden() ) {
//ignore //ignore
} else if ( s->isSplitter ) { } else if ( s->isSplitter ) {
@ -825,7 +825,7 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max )
} }
} }
for ( i = id; i < n; i++ ) { for ( i = id; i < n; i++ ) {
TQSplitterLayoutStruct *s = data->list.at(i); KDGanttSplitterLayoutStruct *s = data->list.at(i);
if ( s->wid->isHidden() ) { if ( s->wid->isHidden() ) {
//ignore //ignore
} else if ( s->isSplitter ) { } else if ( s->isSplitter ) {
@ -877,7 +877,7 @@ void KDGanttMinimizeSplitter::doResize()
TQMemArray<TQLayoutStruct> a( n ); TQMemArray<TQLayoutStruct> a( n );
for ( i = 0; i< n; i++ ) { for ( i = 0; i< n; i++ ) {
a[i].init(); a[i].init();
TQSplitterLayoutStruct *s = data->list.at(i); KDGanttSplitterLayoutStruct *s = data->list.at(i);
if ( s->wid->isHidden() ) { if ( s->wid->isHidden() ) {
a[i].stretch = 0; a[i].stretch = 0;
a[i].tqsizeHint = a[i].tqminimumSize = 0; a[i].tqsizeHint = a[i].tqminimumSize = 0;
@ -908,7 +908,7 @@ void KDGanttMinimizeSplitter::doResize()
kdganttGeomCalc( a, 0, n, pick( r.topLeft() ), pick( r.size() ), 0 ); kdganttGeomCalc( a, 0, n, pick( r.topLeft() ), pick( r.size() ), 0 );
for ( i = 0; i< n; i++ ) { for ( i = 0; i< n; i++ ) {
TQSplitterLayoutStruct *s = data->list.at(i); KDGanttSplitterLayoutStruct *s = data->list.at(i);
setG( s->wid, a[i].pos, a[i].size ); setG( s->wid, a[i].pos, a[i].size );
} }
@ -930,9 +930,9 @@ void KDGanttMinimizeSplitter::recalc( bool update )
The splitter before any other visible widget is visible. The splitter before any other visible widget is visible.
*/ */
for ( int i = 0; i< n; i++ ) { for ( int i = 0; i< n; i++ ) {
TQSplitterLayoutStruct *s = data->list.at(i); KDGanttSplitterLayoutStruct *s = data->list.at(i);
if ( !s->isSplitter ) { if ( !s->isSplitter ) {
TQSplitterLayoutStruct *p = (i > 0) ? data->list.at( i-1 ) : 0; KDGanttSplitterLayoutStruct *p = (i > 0) ? data->list.at( i-1 ) : 0;
if ( p && p->isSplitter ) if ( p && p->isSplitter )
if ( first || s->wid->isHidden() ) if ( first || s->wid->isHidden() )
p->wid->hide(); //may trigger new recalc p->wid->hide(); //may trigger new recalc
@ -945,7 +945,7 @@ void KDGanttMinimizeSplitter::recalc( bool update )
bool empty=TRUE; bool empty=TRUE;
for ( int j = 0; j< n; j++ ) { for ( int j = 0; j< n; j++ ) {
TQSplitterLayoutStruct *s = data->list.at(j); KDGanttSplitterLayoutStruct *s = data->list.at(j);
if ( !s->wid->isHidden() ) { if ( !s->wid->isHidden() ) {
empty = FALSE; empty = FALSE;
if ( s->isSplitter ) { if ( s->isSplitter ) {
@ -996,7 +996,7 @@ void KDGanttMinimizeSplitter::recalc( bool update )
void KDGanttMinimizeSplitter::setResizeMode( TQWidget *w, ResizeMode mode ) void KDGanttMinimizeSplitter::setResizeMode( TQWidget *w, ResizeMode mode )
{ {
processChildEvents(); processChildEvents();
TQSplitterLayoutStruct *s = data->list.first(); KDGanttSplitterLayoutStruct *s = data->list.first();
while ( s ) { while ( s ) {
if ( s->wid == w ) { if ( s->wid == w ) {
s->mode = mode; s->mode = mode;
@ -1043,11 +1043,11 @@ void KDGanttMinimizeSplitter::moveToFirst( TQWidget *w )
{ {
processChildEvents(); processChildEvents();
bool found = FALSE; bool found = FALSE;
TQSplitterLayoutStruct *s = data->list.first(); KDGanttSplitterLayoutStruct *s = data->list.first();
while ( s ) { while ( s ) {
if ( s->wid == w ) { if ( s->wid == w ) {
found = TRUE; found = TRUE;
TQSplitterLayoutStruct *p = data->list.prev(); KDGanttSplitterLayoutStruct *p = data->list.prev();
if ( p ) { // not already at first place if ( p ) { // not already at first place
data->list.take(); //take p data->list.take(); //take p
data->list.take(); // take s data->list.take(); // take s
@ -1072,12 +1072,12 @@ void KDGanttMinimizeSplitter::moveToLast( TQWidget *w )
{ {
processChildEvents(); processChildEvents();
bool found = FALSE; bool found = FALSE;
TQSplitterLayoutStruct *s = data->list.first(); KDGanttSplitterLayoutStruct *s = data->list.first();
while ( s ) { while ( s ) {
if ( s->wid == w ) { if ( s->wid == w ) {
found = TRUE; found = TRUE;
data->list.take(); // take s data->list.take(); // take s
TQSplitterLayoutStruct *p = data->list.current(); KDGanttSplitterLayoutStruct *p = data->list.current();
if ( p ) { // the splitter handle after s if ( p ) { // the splitter handle after s
data->list.take(); //take p data->list.take(); //take p
data->list.append( p ); data->list.append( p );
@ -1097,7 +1097,7 @@ void KDGanttMinimizeSplitter::recalcId()
{ {
int n = data->list.count(); int n = data->list.count();
for ( int i = 0; i < n; i++ ) { for ( int i = 0; i < n; i++ ) {
TQSplitterLayoutStruct *s = data->list.at(i); KDGanttSplitterLayoutStruct *s = data->list.at(i);
if ( s->isSplitter ) if ( s->isSplitter )
((KDGanttSplitterHandle*)s->wid)->setId(i); ((KDGanttSplitterHandle*)s->wid)->setId(i);
} }
@ -1168,7 +1168,7 @@ TQSize KDGanttMinimizeSplitter::tqminimumSizeHint() const
void KDGanttMinimizeSplitter::storeSizes() void KDGanttMinimizeSplitter::storeSizes()
{ {
TQSplitterLayoutStruct *s = data->list.first(); KDGanttSplitterLayoutStruct *s = data->list.first();
while ( s ) { while ( s ) {
if ( !s->isSplitter ) if ( !s->isSplitter )
s->sizer = pick( s->wid->size() ); s->sizer = pick( s->wid->size() );
@ -1253,7 +1253,7 @@ TQValueList<int> KDGanttMinimizeSplitter::sizes() const
that->polish(); that->polish();
} }
TQValueList<int> list; TQValueList<int> list;
TQSplitterLayoutStruct *s = data->list.first(); KDGanttSplitterLayoutStruct *s = data->list.first();
while ( s ) { while ( s ) {
if ( !s->isSplitter ) if ( !s->isSplitter )
list.append( s->sizer ); list.append( s->sizer );
@ -1281,7 +1281,7 @@ void KDGanttMinimizeSplitter::setSizes( TQValueList<int> list )
{ {
processChildEvents(); processChildEvents();
TQValueList<int>::Iterator it = list.begin(); TQValueList<int>::Iterator it = list.begin();
TQSplitterLayoutStruct *s = data->list.first(); KDGanttSplitterLayoutStruct *s = data->list.first();
while ( s && it != list.end() ) { while ( s && it != list.end() ) {
if ( !s->isSplitter ) { if ( !s->isSplitter ) {
s->sizer = *it; s->sizer = *it;
@ -1311,7 +1311,7 @@ void KDGanttMinimizeSplitter::processChildEvents()
void KDGanttMinimizeSplitter::styleChange( TQStyle& old ) void KDGanttMinimizeSplitter::styleChange( TQStyle& old )
{ {
int sw = tqstyle().tqpixelMetric(TQStyle::PM_SplitterWidth, this); int sw = tqstyle().tqpixelMetric(TQStyle::PM_SplitterWidth, this);
TQSplitterLayoutStruct *s = data->list.first(); KDGanttSplitterLayoutStruct *s = data->list.first();
while ( s ) { while ( s ) {
if ( s->isSplitter ) if ( s->isSplitter )
s->sizer = sw; s->sizer = sw;

@ -42,7 +42,7 @@
#ifndef TQT_NO_SPLITTER #ifndef TQT_NO_SPLITTER
class TQSplitterData; class TQSplitterData;
class TQSplitterLayoutStruct; class KDGanttSplitterLayoutStruct;
class KDGanttMinimizeSplitter : public TQFrame class KDGanttMinimizeSplitter : public TQFrame
{ {
@ -103,7 +103,7 @@ private:
void doResize(); void doResize();
void storeSizes(); void storeSizes();
void processChildEvents(); void processChildEvents();
TQSplitterLayoutStruct *addWidget( TQWidget*, bool first = FALSE ); KDGanttSplitterLayoutStruct *addWidget( TQWidget*, bool first = FALSE );
void recalcId(); void recalcId();
void moveBefore( int pos, int id, bool upLeft ); void moveBefore( int pos, int id, bool upLeft );
void moveAfter( int pos, int id, bool upLeft ); void moveAfter( int pos, int id, bool upLeft );

Loading…
Cancel
Save