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

List:       kde-commits
Subject:    branches/KDE/3.5/kdelibs/khtml/rendering
From:       Allan Sandfeld Jensen <kde () carewolf ! com>
Date:       2007-01-07 16:23:16
Message-ID: 1168186996.769109.25153.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 620868 by carewolf:

Fix a detail missed in last commit, and clean up the code.
CCBUG: 121867


 M  +31 -44    bidi.cpp  


--- branches/KDE/3.5/kdelibs/khtml/rendering/bidi.cpp #620867:620868
@@ -1901,24 +1901,27 @@
 #ifdef APPLE_CHANGES    // KDE applies wordspacing differently
                 bool applyWordSpacing = false;
 #endif
-                if ( (preserveLF && c == '\n') || (autoWrap && (isBreakable( str, \
                pos, strlen ) || isSoftBreakable)) ) {
-                    if (ignoringSpaces) {
-                        if (!currentCharacterIsSpace) {
-                            // Stop ignoring spaces and begin at this
-                            // new point.
-                            ignoringSpaces = false;
-                            lastSpace = pos; // e.g., "Foo    goo", don't add in any \
                of the ignored spaces.
-                            BidiIterator startMid ( 0, o, pos );
-                            addMidpoint(startMid);
-                        }
-                        else {
-                            // Just keep ignoring these spaces.
-                            pos++;
-                            len--;
-                            continue;
-                        }
+                if (ignoringSpaces) {
+                    // We need to stop ignoring spaces, if we encounter a non-space \
or +                    // a run that doesn't collapse spaces
+                    if (!currentCharacterIsSpace || preserveWS) {
+                        // Stop ignoring spaces and begin at this
+                        // new point.
+                        ignoringSpaces = false;
+                        lastSpace = pos; // e.g., "Foo    goo", don't add in any of \
the ignored spaces. +                        BidiIterator startMid ( 0, o, pos );
+                        addMidpoint(startMid);
                     }
+                    else {
+                        // Just keep ignoring these spaces.
+                        pos++;
+                        len--;
+                        continue;
+                    }
+                }
 
+                if ( (preserveLF && c == '\n') || (autoWrap && (isBreakable( str, \
pos, strlen ) || isSoftBreakable)) ) { +
                     tmpW += t->width(lastSpace, pos - lastSpace, f);
                     if (!appliedStartWidth) {
                         tmpW += inlineWidth(o, true, false);
@@ -1982,37 +1985,21 @@
                     if (applyWordSpacing)
                         w += wordSpacing;
 #endif
-                    if (!ignoringSpaces && !preserveWS) {
-                        // If we encounter a newline, or if we encounter a
-                        // second space, we need to go ahead and break up this
-                        // run and enter a mode where we start collapsing spaces.
-                        if (currentCharacterIsSpace && previousCharacterIsSpace) {
-                            ignoringSpaces = true;
+                }
 
-                            // We just entered a mode where we are ignoring
-                            // spaces. Create a midpoint to terminate the run
-                            // before the second space.
-                            addMidpoint(ignoreStart);
-                            lastSpace = pos;
-                        }
+                if (!ignoringSpaces && !preserveWS) {
+                    // If we encounter a second space, we need to go ahead and break \
up this run +                    // and enter a mode where we start collapsing \
spaces. +                    if (currentCharacterIsSpace && previousCharacterIsSpace) \
{ +                        ignoringSpaces = true;
+
+                        // We just entered a mode where we are ignoring
+                        // spaces. Create a midpoint to terminate the run
+                        // before the second space.
+                        addMidpoint(ignoreStart);
+                        lastSpace = pos;
                     }
                 }
-                else if (ignoringSpaces) {
-                    if (!currentCharacterIsSpace || preserveWS) {
-                        // Stop ignoring spaces and begin at this
-                        // new point.
-                        ignoringSpaces = false;
-                        lastSpace = pos; // e.g., "Foo    goo", don't add in any of \
                the ignored spaces.
-                        BidiIterator startMid ( 0, o, pos );
-                        addMidpoint(startMid);
-                    }
-                    else {
-                        // Just keep ignoring these spaces.
-                        pos++;
-                        len--;
-                        continue;
-                    }
-                }
 
                 if (currentCharacterIsSpace && !previousCharacterIsSpace) {
                     ignoreStart.obj = o;


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

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