webengine/osswebengine/WebCore/rendering/RenderText.cpp
branchRCL_3
changeset 94 919f36ff910f
parent 93 79859ed3eea9
child 95 d96eed154187
equal deleted inserted replaced
93:79859ed3eea9 94:919f36ff910f
    71      , m_linesDirty(false)
    71      , m_linesDirty(false)
    72      , m_containsReversedText(false)
    72      , m_containsReversedText(false)
    73      , m_isAllASCII(charactersAreAllASCII(m_text.get()))
    73      , m_isAllASCII(charactersAreAllASCII(m_text.get()))
    74      
    74      
    75 #if PLATFORM(SYMBIAN)     
    75 #if PLATFORM(SYMBIAN)     
    76 
       
    77      , m_securityTimer(this, &RenderText::securityTimerFired)
    76      , m_securityTimer(this, &RenderText::securityTimerFired)
    78      
    77      , m_offset(0) 
    79 #endif
    78 #endif      
    80      
       
    81 {
    79 {
    82     ASSERT(m_text);
    80     ASSERT(m_text);
    83     setRenderText();
    81     setRenderText();
    84     m_text = m_text->replace('\\', backslashAsCurrencySymbol());
    82     m_text = m_text->replace('\\', backslashAsCurrencySymbol());
    85 }
    83 }
   863     return prev;
   861     return prev;
   864 }
   862 }
   865 
   863 
   866 void RenderText::setTextInternal(PassRefPtr<StringImpl> text, bool backspace)
   864 void RenderText::setTextInternal(PassRefPtr<StringImpl> text, bool backspace)
   867 {
   865 {
       
   866 #if PLATFORM(SYMBIAN)
       
   867     unsigned oldlength = m_text->length();
       
   868 #endif
   868     m_text = text;
   869     m_text = text;
   869     ASSERT(m_text);
   870     ASSERT(m_text);
   870 
   871 
   871     m_text = m_text->replace('\\', backslashAsCurrencySymbol());
   872     m_text = m_text->replace('\\', backslashAsCurrencySymbol());
   872 
   873 
   929             case TSDISC:
   930             case TSDISC:
   930                 if(backspace){
   931                 if(backspace){
   931                 	m_text = m_text->secure(bullet);
   932                 	m_text = m_text->secure(bullet);
   932                 }
   933                 }
   933                 else{
   934                 else{
   934                     m_text = m_text->secureShowOffset(bullet, m_offset);
   935                     
       
   936                     if(oldlength <= m_text->length())
       
   937                         {
       
   938                         m_offset =  m_text->length() - 1 ;
       
   939                         m_text = m_text->secureShowOffset(bullet, m_offset);
       
   940                         }
       
   941                     else
       
   942                         {
       
   943                         m_text = m_text->secure(bullet);
       
   944                         }
   935                 }
   945                 }
   936                 	
   946                 	
   937                 break;
   947                 break;
   938             case TSSQUARE:
   948             case TSSQUARE:
   939                 m_text = m_text->secureShowOffset(blackSquare, m_offset);
   949                 m_text = m_text->secureShowOffset(blackSquare, m_offset);
  1030 
  1040 
  1031     // FIXME: should not be needed!!!
  1041     // FIXME: should not be needed!!!
  1032     if (!s->m_len) {
  1042     if (!s->m_len) {
  1033         // We want the box to be destroyed.
  1043         // We want the box to be destroyed.
  1034         s->remove();
  1044         s->remove();
       
  1045         if (m_firstTextBox == s) 
       
  1046             m_firstTextBox = s->nextTextBox(); 
       
  1047         else 
       
  1048             s->prevTextBox()->setNextLineBox(s->nextTextBox()); 
       
  1049         if (m_lastTextBox == s) 
       
  1050             m_lastTextBox = s->prevTextBox(); 
       
  1051         else 
       
  1052             s->nextTextBox()->setPreviousLineBox(s->prevTextBox());
  1035         s->destroy(renderArena());
  1053         s->destroy(renderArena());
  1036         m_firstTextBox = m_lastTextBox = 0;
       
  1037         return;
  1054         return;
  1038     }
  1055     }
  1039 
  1056 
  1040     m_containsReversedText |= s->m_reversed;
  1057     m_containsReversedText |= s->m_reversed;
  1041 }
  1058 }
  1226 void RenderText::checkConsistency() const
  1243 void RenderText::checkConsistency() const
  1227 {
  1244 {
  1228 #ifdef CHECK_CONSISTENCY
  1245 #ifdef CHECK_CONSISTENCY
  1229     const InlineTextBox* prev = 0;
  1246     const InlineTextBox* prev = 0;
  1230     for (const InlineTextBox* child = m_firstTextBox; child != 0; child = child->nextTextBox()) {
  1247     for (const InlineTextBox* child = m_firstTextBox; child != 0; child = child->nextTextBox()) {
  1231         ASSERT(child->object() == this);
  1248         ASSERT(child->renderer() == this);
  1232         ASSERT(child->prevTextBox() == prev);
  1249         ASSERT(child->prevTextBox() == prev);
  1233         prev = child;
  1250         prev = child;
  1234     }
  1251     }
  1235     ASSERT(prev == m_lastTextBox);
  1252     ASSERT(prev == m_lastTextBox);
  1236 #endif
  1253 #endif