From koffice-devel Tue Nov 19 16:28:19 2002 From: Tomasz Grobelny Date: Tue, 19 Nov 2002 16:28:19 +0000 To: koffice-devel Subject: Re: tabulators X-MARC-Message: https://marc.info/?l=koffice-devel&m=103773399211245 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_jam29xBG6lQXisM" --Boundary-00=_jam29xBG6lQXisM Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Content-Disposition: inline On pon 18. listopada 2002 17:59, David Faure wrote: > On Monday 18 November 2002 17:23, Tomasz Grobelny wrote: > > On sob 16. listopada 2002 19:46, Tomasz Grobelny wrote: > > > > Always using the tab stop, even when they are still tabulators > > > > available, is in my opinion not good. Or how do you do the classical > > > > headers/footers in three parts (left/center/right)? > > > > > > If tabStopValue is used only after last tabulator everything is okay > > > (it is not the way MS Word behaves). > > > > Any comments? > > Yes: please test. > [...] Doesn't work. But please look at this patch. Tomek --Boundary-00=_jam29xBG6lQXisM Content-Type: text/x-diff; charset="iso-8859-2"; name="patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch" ? patch Index: kotextparag.cc =================================================================== RCS file: /home/kde/koffice/lib/kotext/kotextparag.cc,v retrieving revision 1.100.2.1 diff -u -3 -p -r1.100.2.1 kotextparag.cc --- kotextparag.cc 2002/10/18 16:59:09 1.100.2.1 +++ kotextparag.cc 2002/11/19 16:28:26 @@ -842,8 +842,6 @@ int KoTextParag::nextTab( int chnum, int else ++i; } - // No more tabs - return tArray[0]; } // No tab list, use tab-stop-width. qrichtext.cpp has the code :) return KoTextParag::nextTabDefault( chnum, x ); Index: qrichtext.cpp =================================================================== RCS file: /home/kde/koffice/lib/kotext/qrichtext.cpp,v retrieving revision 1.85.2.2 diff -u -3 -p -r1.85.2.2 qrichtext.cpp --- qrichtext.cpp 2002/10/20 14:20:33 1.85.2.2 +++ qrichtext.cpp 2002/11/19 16:28:27 @@ -4548,22 +4548,10 @@ int KoTextParag::nextTabDefault( int, in ta = doc->tabArray(); tabStopWidth = doc->tabStopWidth(); } - if ( ta ) { - int i = 0; - while ( ta[ i ] ) { - if ( ta[ i ] >= x ) - return tArray[ i ]; - ++i; - } - return tArray[ 0 ]; - } else { - int d; - if ( tabStopWidth != 0 ) - d = x / tabStopWidth; - else - return x; - return tabStopWidth * ( d + 1 ); - } + if ( tabStopWidth != 0 ) + return tabStopWidth*(x/tabStopWidth+1); + else + return x; } void KoTextParag::setPainter( QPainter *p, bool adjust ) --Boundary-00=_jam29xBG6lQXisM-- _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org http://mail.kde.org/mailman/listinfo/koffice-devel