[Webkit-unassigned] [Bug 43682] Add missing String builder for SVGPathParser

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Aug 8 04:46:35 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=43682


Nikolas Zimmermann <zimmermann at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #63832|review?                     |review+
               Flag|                            |




--- Comment #2 from Nikolas Zimmermann <zimmermann at kde.org>  2010-08-08 04:46:35 PST ---
(From update of attachment 63832)
WebCore/svg/SVGPathParserFactory.cpp:80
 +      s_parser->setCurrentSource(source);
For consistency, add a newline before this statement and remove the one before return s_parser :-)

WebCore/svg/SVGPathParserFactory.cpp:181
 +      ASSERT(stream);
Ok you misunderstood the suggestion I gave.

The passed in OwnPtr should not be initialized, this is the task of this function.
The function should be used like this:

OwnPtr<SVGPathByteStream> stream; // stream pointer is null here!
if (!factory->buildSVGPathByteStreamFromString(d, stream, NormalizedParsing))
    return false;
// stream pointer is now set.

That means, the ASSERT(stream) should go away. The function should be used like this:

bool SVGPathParserFactory::buildSVGPathByteStreamFromString(const String& d, OwnPtr<SVGPathByteStream>& result, PathParsingMode parsingMode)
{
    if (d.isEmpty())
        return false;

    OwnPtr<SVGPathByteStream> stream = SVGPathByteStream::create();
    SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(stream.get());

    OwnPtr<SVGPathStringSource> source = SVGPathStringSource::create(d);
    SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
    bool ok = parser->parsePathDataFromSource(parsingMode);
    parser->cleanup();
    result = stream.release(); // this is the important step
    return ok;
}

r=me, with those fixes.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list