Summary: | Add missing String builder for SVGPathParser | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Dirk Schulze <krit> | ||||
Component: | SVG | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | zimmermann | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | OS X 10.5 | ||||||
Attachments: |
|
Description
Dirk Schulze
2010-08-07 14:59:25 PDT
Created attachment 63832 [details]
Patch
Comment on attachment 63832 [details]
Patch
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.
Committed r64949: <http://trac.webkit.org/changeset/64949> |