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

List:       koffice-devel
Subject:    Re: tabulators
From:       Tomasz Grobelny <grotk () poczta ! onet ! pl>
Date:       2002-11-19 16:28:19
[Download RAW message or body]

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
["patch" (text/x-diff)]

? 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  )

_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel

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

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