[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:       2005-08-03 11:59:11
Message-ID: 1123070351.088734.18995.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 442628 by carewolf:

Backport of pre-line pre-wrap clean-up


 M  +1 -1      render_line.cpp  
 M  +7 -5      render_text.cpp  


--- branches/KDE/3.5/kdelibs/khtml/rendering/render_line.cpp #442627:442628
@@ -580,7 +580,7 @@
             shouldDraw = true;
             break;
         }
-        else if (curr->isText() && !curr->isBR() && (curr->style()->whiteSpace() == \
PRE || +        else if (curr->isText() && !curr->isBR() && \
                (curr->style()->preserveWS() ||
                  !curr->element() || !curr->element()->containsOnlyWhitespace())) {
             shouldDraw = true;
             break;
--- branches/KDE/3.5/kdelibs/khtml/rendering/render_text.cpp #442627:442628
@@ -1357,8 +1357,10 @@
                                     short& beginMaxW, short& endMaxW,
                                     short& minW, short& maxW, bool& \
stripFrontSpaces)  {
-    bool isPre = style()->whiteSpace() == PRE;
-    if (isPre)
+    bool preserveWS = style()->preserveWS();
+    bool preserveLF = style()->preserveLF();
+    bool autoWrap = style()->autoWrap();
+    if (preserveWS)
         stripFrontSpaces = false;
 
     int len = str->l;
@@ -1379,16 +1381,16 @@
     hasBreakableChar = m_hasBreakableChar;
     hasBreak = m_hasBreak;
 
-    if (stripFrontSpaces && (str->s[0].direction() == QChar::DirWS || (!isPre && \
str->s[0] == '\n'))) { +    if (stripFrontSpaces && (str->s[0].direction() == \
QChar::DirWS || (!preserveLF && str->s[0] == '\n'))) {  const Font *f = htmlFont( \
false );  QChar space[1]; space[0] = ' ';
         int spaceWidth = f->width(space, 1, 0);
         maxW -= spaceWidth;
     }
 
-    stripFrontSpaces = !isPre && m_hasEndWS;
+    stripFrontSpaces = !preserveWS && m_hasEndWS;
 
-    if (style()->whiteSpace() == NOWRAP)
+    if (!autoWrap)
         minW = maxW;
     else if (minW > maxW)
         minW = maxW;


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

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