gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gzz/view LinebrokenCellContentView.java


From: Benja Fallenstein
Subject: [Gzz-commits] gzz/gzz/view LinebrokenCellContentView.java
Date: Fri, 10 Jan 2003 14:27:39 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Benja Fallenstein <address@hidden>      03/01/10 14:27:39

Modified files:
        gzz/view       : LinebrokenCellContentView.java 

Log message:
        Fix Asko's fix ;) (see mail on gzz-dev)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/LinebrokenCellContentView.java.diff?tr1=1.21&tr2=1.22&r1=text&r2=text

Patches:
Index: gzz/gzz/view/LinebrokenCellContentView.java
diff -u gzz/gzz/view/LinebrokenCellContentView.java:1.21 
gzz/gzz/view/LinebrokenCellContentView.java:1.22
--- gzz/gzz/view/LinebrokenCellContentView.java:1.21    Fri Jan 10 06:26:47 2003
+++ gzz/gzz/view/LinebrokenCellContentView.java Fri Jan 10 14:27:39 2003
@@ -40,7 +40,7 @@
  *  Doesn't scroll, currently.
  */
 public class LinebrokenCellContentView extends CellView {
-public static final String rcsid = "$Id: LinebrokenCellContentView.java,v 1.21 
2003/01/10 11:26:47 humppake Exp $";
+public static final String rcsid = "$Id: LinebrokenCellContentView.java,v 1.22 
2003/01/10 19:27:39 benja Exp $";
     public static boolean dbg = false;
     private static void p(String s) { if(dbg) pa(s); }
     private static void pa(String s) { System.err.println(s); }
@@ -75,31 +75,7 @@
 
     public void getSize(Cell c, float scale, ViewContext context,
                        float[] out) {
-       String s;
-       if(c != null)
-           s = Containment.getContainedText(c);
-       else
-           s = widthString;
-
-       /**
-        * Width of LinebrokenCellContentView is the
-        * width of its longest line.
-        */
-       float w = style.getWidth(s, scale);
-        int linebreak = s.indexOf('\n');
-       if (linebreak != -1) {
-           w = style.getWidth(s.substring(0, linebreak), scale);
-           int anotherLinebreak = s.indexOf('\n', linebreak+1);
-           while (anotherLinebreak != -1) {
-               float anotherWidth = style.getWidth(s.substring(linebreak+1, 
anotherLinebreak), scale);
-               if (w < anotherWidth) w = anotherWidth;
-               linebreak = anotherLinebreak;
-               anotherLinebreak = s.indexOf('\n', linebreak+1);
-           } 
-           float anotherWidth = style.getWidth(s.substring(linebreak+1, 
s.length()), scale);
-           if (w < anotherWidth) w = anotherWidth;
-       }
-
+       float w = style.getWidth(widthString, scale);
        float h;
        if(c != null)
            h = getHeight(c, w, scale);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]