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

List:       koffice-devel
Subject:    [PATCH] broken Table of Contents
From:       Raphael Langerhorst <raphael-langerhorst () gmx ! at>
Date:       2005-02-03 17:22:35
Message-ID: 200502031822.37034.raphael-langerhorst () gmx ! at
[Download RAW message or body]

Hi all,

maybe some of you noticed, the table of contents puts
the page numbers ON THE NEXT LINE, which looks
a bit ugly (not acceptable).

I've looked into it a bit... I assume the bug is in kotext
seemed too scary so I decided to tweak the table of
contents creation and added some safety distance
from the right border.

A short problem analysis: the tab (for the page numbers)
gets set on a certain position and is "right aligned", so
the text (page numbers) expand to the left. But the new
line character is STILL on the RIGHT side of the tabulator.

My patch is a workaround I guess. But this would need well
considered KoText modifications. If anyone wants to have
a go, then please. Assuming that KoText does get replaced
I patched the table of contents creation for now.

Let me know if I should commit, or if anyone decides to fix
KoText instead. (I won't commit until I get a positive answer)

No bug particularly relates to this, but #46980 is getting close
(still not fixed!!)

Here it goes:

Index: ../../../koffice/kword/contents.cc
===================================================================
RCS file: /home/kde/koffice/kword/contents.cc,v
retrieving revision 1.56
diff -u -p -r1.56 contents.cc
--- ../../../koffice/kword/contents.cc  23 Apr 2004 08:21:12 -0000      1.56
+++ ../../../koffice/kword/contents.cc  3 Feb 2005 17:09:40 -0000
@@ -239,7 +239,11 @@ KWStyle * KWInsertTOCCommand::findOrCrea
         {
             KoTabulatorList tabList;
             KoTabulator tab;
-            tab.ptPos = KoUnit::fromUserValue( floor( KoUnit::toMM( fs->frame( 0 \
)->width() )  ), KoUnit::unit("mm") ); +
+            //added 2 mm safety from border, otherwise the page number goes on the \
next line (assuming bug is in KoText) +            //### REMOVE SAFETY DISTANCE FOR \
KOFFICE 2.0 (assuming KoText gets replaced) - raphael +            tab.ptPos = \
KoUnit::fromUserValue( floor( KoUnit::toMM( fs->frame( 0 )->width() ) - 2 ), \
KoUnit::unit("mm") ); +
             tab.type = T_RIGHT;
             tab.filling = TF_DOTS;
             tab.ptWidth = 0.5;


_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://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