From koffice Sat Feb 10 16:06:04 2001 From: Toshitaka Fujioka Date: Sat, 10 Feb 2001 16:06:04 +0000 To: koffice Subject: Re: A bug fixed patch of KPresenter. X-MARC-Message: https://marc.info/?l=koffice&m=98184195031469 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------040708040708000604060005" This is a multi-part message in MIME format. --------------040708040708000604060005 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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. ;-) --------------040708040708000604060005 Content-Type: text/plain; name="koffice-kpresenter-bugfix-20010211.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="koffice-kpresenter-bugfix-20010211.diff" 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( 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 ); --------------040708040708000604060005--