diff options
Diffstat (limited to 'WebCore/svg/SVGPaint.cpp')
-rw-r--r-- | WebCore/svg/SVGPaint.cpp | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/WebCore/svg/SVGPaint.cpp b/WebCore/svg/SVGPaint.cpp index 3b39b91..a2100aa 100644 --- a/WebCore/svg/SVGPaint.cpp +++ b/WebCore/svg/SVGPaint.cpp @@ -1,26 +1,29 @@ /* - Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> - 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ + * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> + * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> + * Copyright (C) Research In Motion Limited 2010. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ #include "config.h" + #if ENABLE(SVG) #include "SVGPaint.h" +#include "SVGURIReference.h" namespace WebCore { @@ -66,14 +69,14 @@ SVGPaint::~SVGPaint() SVGPaint* SVGPaint::defaultFill() { - static SVGPaint* _defaultFill = new SVGPaint(Color::black); - return _defaultFill; + static SVGPaint* staticDefaultFill = create(Color::black).releaseRef(); + return staticDefaultFill; } SVGPaint* SVGPaint::defaultStroke() { - static SVGPaint* _defaultStroke = new SVGPaint(SVG_PAINTTYPE_NONE); - return _defaultStroke; + static SVGPaint* staticDefaultStroke = create(SVG_PAINTTYPE_NONE).releaseRef(); + return staticDefaultStroke; } String SVGPaint::uri() const @@ -108,8 +111,14 @@ String SVGPaint::cssText() const return SVGColor::cssText(); } +bool SVGPaint::matchesTargetURI(const String& referenceId) +{ + if (m_paintType != SVG_PAINTTYPE_URI && m_paintType != SVG_PAINTTYPE_URI_RGBCOLOR) + return false; + + return referenceId == SVGURIReference::getTarget(m_uri); } -// vim:ts=4:noet -#endif // ENABLE(SVG) +} +#endif // ENABLE(SVG) |