From kde-bugs-dist Fri Mar 31 20:53:32 2006 From: David Faure Date: Fri, 31 Mar 2006 20:53:32 +0000 To: kde-bugs-dist Subject: [Bug 124644] kword: problem displaying/editing openoffice-2.0.2 Message-Id: <20060331205332.21271.qmail () ktown ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-bugs-dist&m=114383842225050 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. http://bugs.kde.org/show_bug.cgi?id=124644 faure kde org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED ------- Additional Comments From faure kde org 2006-03-31 22:53 ------- SVN commit 525120 by dfaure: Fix painting of transparent frames when there is no frame below; happened due to .odt import with background-color="transparent". BUG: 124644 M +1 -0 KWFrame.h M +17 -9 KWFrameSet.cpp M +1 -2 KWTextFrameSet.cpp --- branches/koffice/1.5/koffice/kword/KWFrame.h #525119:525120 @ -210,6 +210,7 @ QBrush backgroundColor() const { return m_backgroundColor; } void setBackgroundColor( const QBrush &_color ); + bool isTransparent() const { return m_backgroundColor.style() != Qt::SolidPattern; } KoRect innerRect() const; --- branches/koffice/1.5/koffice/kword/KWFrameSet.cpp #525119:525120 @ -168,16 +168,19 @ //kdDebug(32001) << "KWFrameSet::createEmptyRegion " << name() << endl; for (QPtrListIterator frameIt = frameIterator(); frameIt.current(); ++frameIt ) { - QRect outerRect( viewMode->normalToView( frameIt.current()->outerRect(viewMode) ) ); - //kdDebug(32001) << "KWFrameSet::createEmptyRegion outerRect=" << outerRect << " crect=" << crect << endl; - outerRect &= crect; // This is important, to avoid calling subtract with a Y difference > 65536 - if ( !outerRect.isEmpty() ) + if ( !frameIt.current()->isTransparent() ) { - emptyRegion = emptyRegion.subtract( outerRect ); - //kdDebug(32001) << "KWFrameSet::createEmptyRegion emptyRegion now: " << endl; DEBUGREGION( emptyRegion ); + QRect outerRect( viewMode->normalToView( frameIt.current()->outerRect(viewMode) ) ); + //kdDebug(32001) << "KWFrameSet::createEmptyRegion outerRect=" << outerRect << " crect=" << crect << endl; + outerRect &= crect; // This is important, to avoid calling subtract with a Y difference > 65536 + if ( !outerRect.isEmpty() ) + { + emptyRegion = emptyRegion.subtract( outerRect ); + //kdDebug(32001) << "KWFrameSet::createEmptyRegion emptyRegion now: " << endl; DEBUGREGION( emptyRegion ); + } + if ( crect.bottom() + paperHeight < outerRect.top() ) + return; // Ok, we're far below the crect, abort. } - if ( crect.bottom() + paperHeight < outerRect.top() ) - return; // Ok, we're far below the crect, abort. } } @ -771,7 +774,7 @ if ( drawUnderlyingFrames && frame && frame->frameStack()) { QValueList below = frame->frameStack()->framesBelow(); - if(!below.isEmpty() ) + if ( !below.isEmpty() ) { // Double-buffering - not when printing QPainter* doubleBufPainter = painter; @ -837,6 +840,11 @ } return; // done! :) } + else + { + // nothing below? paint a bg color then + frameColorGroup.setBrush( QColorGroup::Base, m_doc->defaultBgColor( painter ) ); + } } if ( frame && (frame->paddingLeft() || frame->paddingTop() || frame->paddingRight() || frame->paddingBottom()) ) --- branches/koffice/1.5/koffice/kword/KWTextFrameSet.cpp #525119:525120 @ -567,8 +567,7 @ // In theory this code should be in kwFrameSet, but currently only text frames obey m_backgroundColor. if ( theFrame ) { - bool transparent = theFrame->backgroundColor().style() != Qt::SolidPattern; - drawUnderlyingFrames &= transparent; + drawUnderlyingFrames &= theFrame->isTransparent(); } KWFrameSet::drawFrame( theFrame, painter, fcrect, crect, translationOffset, settingsFrame, cg, onlyChanged, resetChanged, edit, viewMode, drawUnderlyingFrames ); }