2008-03-27 Maciej Stachowiak <mjs@apple.com>
[WebKit.git] / WebCore / svg / SVGGlyphMap.h
index 97f2e181a395591ca92063156c00d2aaa6a805f0..2f49a678e9cb8d0e88f59d78309165dea3af1cd7 100644 (file)
@@ -31,7 +31,10 @@ namespace WebCore {
     typedef HashMap<UChar, RefPtr<GlyphMapNode> > GlyphMapLayer;
 
     struct GlyphMapNode : public RefCounted<GlyphMapNode> {
+    private:
         GlyphMapNode() { }
+    public:
+        PassRefPtr<GlyphMapNode> create() { return adoptRef(new GlyphMapNode); }
 
         Vector<SVGGlyphIdentifier> glyphs;
 
@@ -39,6 +42,7 @@ namespace WebCore {
     };
 
     class SVGGlyphMap {
+
     public:
         SVGGlyphMap() : m_currentPriority(0) { }
 
@@ -52,7 +56,7 @@ namespace WebCore {
                 UChar curChar = string[i];
                 node = currentLayer->get(curChar);
                 if (!node) {
-                    node = new GlyphMapNode;
+                    node = GlyphMapNode::create();
                     currentLayer->set(curChar, node);
                 }
                 currentLayer = &node->children;