[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/koffice/1.5/koffice/kword
From:       David Faure <faure () kde ! org>
Date:       2006-03-31 20:53:21
Message-ID: 1143838401.806524.22633.nullmailer () svn ! kde ! org
[Download RAW message or body]

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<KWFrame> 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<KWFrame*> 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 ); \
}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic