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

List:       koffice
Subject:    Re: A bug fixed patch of KPresenter.
From:       Toshitaka Fujioka <tositaka () soft ! kusa ! ac ! jp>
Date:       2001-02-10 16:06:04
[Download RAW message or body]

Hello,

Werner Trobin wrote:

 > David Faure wrote:
 >
 >> On Thursday 25 January 2001 11:21, Toshitaka Fujioka wrote:
 >>
 >>> Hello.
 >>>
 >>> Was my patch strange where it was?
 >>> (koffice-kpresenter-bugfix-20010124.diff)
 >>>
 >>> A "No Pen" style of editing mode is a "Dot Line" style.
 >>> A "No Pen" style of presentation mode is a "No Pen" style.
 >>
 >> Yup, this makes sense.
 >>
 >> But I don't like the patch in itself.
 >> Adding a QPen to each KPObject seems overkill.
 >> Isn't there another way to do the same thing, without adding a QPen
 >> to each KPObject ? (I don't know that code too well).
 >
 >
 > I already added it to my TODO list (the KPresenter entries
 > seem to grow exponentially :} ) but I didn't find the time
 > yet as I'm preparing for an exam. Sorry, will fix it as soon
 > as I find the time.
 >
 > If anyone finds another solution, please go ahead.

I remade patch. (CVS of 09/02)

A screen shot.

Before a patch application:
   http://www.kde.gr.jp/~toshitaka/kpresenter1.jpg

After a patch application:
   http://www.kde.gr.jp/~toshitaka/kpresenter4.jpg

I attached a patch.
Please try to use. :-)

If this patch is wrong, please advise. ;-)




["koffice-kpresenter-bugfix-20010211.diff" (text/plain)]

diff -ur koffice.org/kpresenter/kpobject.cc koffice/kpresenter/kpobject.cc
--- koffice.org/kpresenter/kpobject.cc	Sun Feb 11 00:17:42 2001
+++ koffice/kpresenter/kpobject.cc	Sun Feb 11 00:27:58 2001
@@ -346,7 +346,7 @@
     _painter->save();
     Qt::RasterOp rop = _painter->rasterOp();
 
-    _painter->setRasterOp( Qt::NotROP );
+    _painter->setRasterOp( Qt::NotXorROP );
 
     if ( getType() == OT_TEXT && dynamic_cast<KPTextObject*>( this \
)->getDrawEditRect() )  {
@@ -371,9 +371,11 @@
             _painter->setWorldMatrix( m, true );
         }
 
-        _painter->setPen( QPen( Qt::black, 1, Qt::DotLine ) );
-        _painter->setBrush( Qt::NoBrush );
-        _painter->drawRect( 0, 0, ext.width(), ext.height() );
+        if ( NoPenJudgment == TRUE ) {
+            _painter->setPen( QPen( "grey", 1, Qt::DotLine ) );
+            _painter->setBrush( Qt::NoBrush );
+            _painter->drawRect( 0, 0, ext.width(), ext.height() );
+        }
 
         _painter->restore();
     }
diff -ur koffice.org/kpresenter/kpobject.h koffice/kpresenter/kpobject.h
--- koffice.org/kpresenter/kpobject.h	Sun Feb 11 00:17:42 2001
+++ koffice/kpresenter/kpobject.h	Sun Feb 11 00:24:16 2001
@@ -206,6 +206,8 @@
 
     DCOPObject *dcop;
 
+    bool NoPenJudgment;
+
 };
 
 #endif
diff -ur koffice.org/kpresenter/kptextobject.cc koffice/kpresenter/kptextobject.cc
--- koffice.org/kpresenter/kptextobject.cc	Sun Feb 11 00:17:42 2001
+++ koffice/kpresenter/kptextobject.cc	Sun Feb 11 00:21:59 2001
@@ -460,6 +460,11 @@
         else
             _painter->drawPixmap( penw, penw, *gradient->getGradient(), 0, 0, ow - 2 \
* penw, oh - 2 * penw );  
+        if ( pen.style() == Qt::NoPen )
+            NoPenJudgment = TRUE;
+        else
+            NoPenJudgment = FALSE;
+
         _painter->setPen( pen );
         _painter->setBrush( Qt::NoBrush );
         _painter->drawRect( penw, penw, ow - 2 * penw, oh - 2 * penw );



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

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