Ignore:
Timestamp:
Jul 21, 2002, 10:38:39 PM (23 years ago)
Author:
darin
Message:

JavaScriptCore:

  • kjs/*: Roll KDE 3.0.2 changes in. Also switch to not using APPLE_CHANGES for some of the changes that we definitely want to contribute upstream.

WebCore:

  • khtml/*: Roll KDE 3.0.2 changes in. Also switch to not using APPLE_CHANGES for some of the changes that we definitely want to contribute upstream.
  • WebCore.pbproj/project.pbxproj: Add KWQStyle.mm, remove KWQStyle.h, moving contents into qstyle.h.
  • kwq/KWQApplication.mm: (QApplication::globalStrut): Remove _logNotYetImplemented().
  • kwq/KWQButton.mm: (QButton::QButton): Use plain release, not autorelease.
  • kwq/KWQComboBox.mm: (QComboBox::init): Use plain release, not autorelease.
  • kwq/KWQListBox.mm: (QListBox::QListBox): Use plain release, not autorelease.
  • kwq/KWQPainter.mm: (QPainter::drawArc): Use plain release, not autorelease.
  • kwq/KWQKHTMLPartBrowserExtension.mm: Remove import of KWQKHTMLPartImpl.h, now that it's always part of khtml_part.h.
  • kwq/KWQKHTMLPartImpl.cpp: Simplify.
  • kwq/KWQKHTMLPartImpl.h: Add wrapper to allow multiple inclusion. Don't include khtml_part.h any more, since that file now includes this one to minimize changes to KDE code that needs to get to functions in here.
  • kwq/KWQKHTMLPartImpl.mm: (KHTMLPart::onURL), (KHTMLPart::nodeActivated), (KHTMLPart::setStatusBarText): Moved here from khtml_part.cpp.
  • kwq/KWQLoaderImpl.mm: Include khtml_part.h instead of KWQKHTMLPartImpl.h.
  • kwq/KWQPushButton.mm: (buttonFontMetrics), (QPushButton::fontMetrics): Added. Used by the form code to size buttons.
  • kwq/KWQStyle.mm: Added. (QStyle::sizeFromContents): Added. Used by the form code to size buttons.
  • kwq/KWQStyle.h: Removed.
  • kwq/qt/qstyle.h: Moved contents of KWQStyle.h in here.
  • kwq/qt/qwidget.h: Include <qstyle.h> rather than KWQStyle.h.
  • kwq/WebCoreBridge.mm: (-[WebCoreBridge isFrameSet]): Call straight to impl.
  • kwq/kdeui/klineedit.h: Add KLineEdit::frameWidth().
  • kwq/qt/qnamespace.h: Remove GUIStyle, MacStyle, and WindowsStyle.
  • kwq/qt/qpaintdevice.h: Add QInternal, QInternal::Printer, and QPaintDevice::devType().
  • kwq/qt/qpainter.h: Add QPainter::device().
  • kwq/qt/qpushbutton.h: Add QPushButton::fontMetrics().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/string_object.cpp

    r1326 r1623  
    5858  replace               StringProtoFuncImp::Replace     DontEnum|Function       2
    5959  search                StringProtoFuncImp::Search      DontEnum|Function       1
    60   slice                 StringProtoFuncImp::Slice       DontEnum|Function       0
    61   split                 StringProtoFuncImp::Split       DontEnum|Function       1
     60  slice                 StringProtoFuncImp::Slice       DontEnum|Function       2
     61  split                 StringProtoFuncImp::Split       DontEnum|Function       2
    6262  substr                StringProtoFuncImp::Substr      DontEnum|Function       2
    6363  substring             StringProtoFuncImp::Substring   DontEnum|Function       2
     
    197197  case Search: {
    198198    u = s;
    199     RegExp* reg = 0;
     199    RegExp *reg, *tmpReg = 0;
     200    RegExpImp *imp = 0;
    200201    if (a0.isA(ObjectType) && a0.toObject(exec).inherits(&RegExpImp::info))
    201202    {
    202       RegExpImp* imp = static_cast<RegExpImp *>( a0.toObject(exec).imp() );
     203      imp = static_cast<RegExpImp *>( a0.toObject(exec).imp() );
    203204      reg = imp->regExp();
    204205    }
     
    209210       *  replaced with the result of the expression new RegExp(regexp).
    210211       */
    211       reg = new RegExp(a0.toString(exec), RegExp::None);
     212      reg = tmpReg = new RegExp(a0.toString(exec), RegExp::None);
    212213    }
    213214    RegExpObjectImp* regExpObj = static_cast<RegExpObjectImp*>(exec->interpreter()->builtinRegExp().imp());
    214     int **ovector = regExpObj->registerRegexp( reg, u );
     215    int **ovector = regExpObj->registerRegexp(reg, u);
    215216    UString mstr = reg->match(u, -1, &pos, ovector);
    216     regExpObj->setSubPatterns(reg->subPatterns());
    217     if (a0.isA(StringType))
    218       delete reg;
    219217    if (id == Search) {
    220218      result = Number(pos);
    221       break;
    222     }
    223     if (mstr.isNull())
    224       result = Null();
    225     else
    226       result = regExpObj->arrayOfMatches(exec,mstr);
     219    } else {
     220      // Exec
     221      if ((reg->flags() & RegExp::Global) == 0) {
     222        // case without 'g' flag is handled like RegExp.prototype.exec
     223        if (mstr.isNull())
     224          return Null(); // no match
     225        regExpObj->setSubPatterns(reg->subPatterns());
     226        result = regExpObj->arrayOfMatches(exec,mstr);
     227      } else {
     228        // return array of matches
     229        List list;
     230        int lastIndex = 0;
     231        while (pos >= 0) {
     232          list.append(String(mstr));
     233          lastIndex = pos;
     234          pos += mstr.isEmpty() ? 1 : mstr.size();
     235          delete [] *ovector;
     236          mstr = reg->match(u, pos, &pos, ovector);
     237        }
     238        if (imp)
     239          imp->put(exec, "lastIndex", Number(lastIndex), DontDelete|DontEnum);
     240        result = exec->interpreter()->builtinArray().construct(exec, list);
     241      }
     242    }
     243    delete tmpReg;
     244    break;
    227245  }
    228     break;
    229246  case Replace:
    230247    u = s;
     
    329346        break;
    330347      }
    331       int *ovector;
    332       int mpos;
    333348      pos = 0;
    334       while (1) {
     349      while (pos < u.size()) {
    335350        // TODO: back references
     351        int mpos;
     352        int *ovector = 0L;
    336353        UString mstr = reg.match(u, pos, &mpos, &ovector);
     354        delete [] ovector; ovector = 0L;
    337355        if (mpos < 0)
    338356          break;
     
    344362        }
    345363      }
    346       delete [] ovector;
    347364    } else if (a0.type() != UndefinedType) {
    348365      u2 = a0.toString(exec);
Note: See TracChangeset for help on using the changeset viewer.