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

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

SVN commit 525121 by dfaure:

Forwardport fix for 124644 (although I suspect that we'll redo the painting for qt4 \
anyway) Remove wrong Q_ASSERT.


 M  +2 -0      KWCommand.cpp  
 M  +1 -0      KWFrame.h  
 M  +17 -9     KWFrameSet.cpp  
 M  +1 -2      KWTextFrameSet.cpp  


--- trunk/koffice/kword/KWCommand.cpp #525120:525121
@@ -321,11 +321,13 @@
     KWTextFrameSet * textFs = textdoc->textFrameSet();
 
     textFs->renumberFootNotes();
+#if 0
     if ( m_idx == 0 ) {
         Q_ASSERT( m_oldParagLayout );
         if ( m_oldParagLayout )
             firstParag->setParagLayout( *m_oldParagLayout );
     }
+#endif
     return c;
 }
 
--- trunk/koffice/kword/KWFrame.h #525120:525121
@@ -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;
 
--- trunk/koffice/kword/KWFrameSet.cpp #525120:525121
@@ -173,16 +173,19 @@
     //kDebug(32001) << "KWFrameSet::createEmptyRegion " << name() << endl;
     for (Q3PtrListIterator<KWFrame> frameIt = frameIterator(); frameIt.current(); \
++frameIt )  {
-        QRect outerRect( viewMode->normalToView( \
                frameIt.current()->outerRect(viewMode) ) );
-        //kDebug(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 );
-            //kDebug(32001) << "KWFrameSet::createEmptyRegion emptyRegion now: " << \
endl; DEBUGREGION( emptyRegion ); +            QRect outerRect( \
viewMode->normalToView( frameIt.current()->outerRect(viewMode) ) ); +            \
//kDebug(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 );
+                //kDebug(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.
     }
 }
 
@@ -776,7 +779,7 @@
 
     if ( drawUnderlyingFrames && frame && frame->frameStack()) {
         Q3ValueList<KWFrame*> below = frame->frameStack()->framesBelow();
-        if(!below.isEmpty() )
+        if ( !below.isEmpty() )
         {
             // Double-buffering - not when printing
             QPainter* doubleBufPainter = painter;
@@ -842,6 +845,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()) )
--- trunk/koffice/kword/KWTextFrameSet.cpp #525120:525121
@@ -580,8 +580,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