Merge branch 'master' of git://git.ucc.asn.au/ipdf/code
[ipdf/code.git] / src / document.cpp
index 6c281c1..a6c6fad 100644 (file)
@@ -282,7 +282,7 @@ void Document::LoadSVG(const string & filename, const Rect & bounds)
        input.close();
 
        // Combine all SVG tags into one thing because lazy
        input.close();
 
        // Combine all SVG tags into one thing because lazy
-       for (xml_node svg : doc_xml.children("svg"))
+       for (xml_node svg = doc_xml.child("svg"); svg; svg = svg.next_sibling("svg"))
        {
                Real width = Real(svg.attribute("width").as_float()) * bounds.w;
                Real height = Real(svg.attribute("width").as_float()) * bounds.h;
        {
                Real width = Real(svg.attribute("width").as_float()) * bounds.w;
                Real height = Real(svg.attribute("width").as_float()) * bounds.h;
@@ -291,7 +291,7 @@ void Document::LoadSVG(const string & filename, const Rect & bounds)
                // Rectangles
                Real coords[4];
                const char * attrib_names[] = {"x", "y", "width", "height"};
                // Rectangles
                Real coords[4];
                const char * attrib_names[] = {"x", "y", "width", "height"};
-               for (pugi::xml_node rect : svg.children("rect"))
+               for (pugi::xml_node rect = svg.child("rect"); rect; rect = rect.next_sibling("rect"))
                {
                        for (size_t i = 0; i < 4; ++i)
                                coords[i] = rect.attribute(attrib_names[i]).as_float();
                {
                        for (size_t i = 0; i < 4; ++i)
                                coords[i] = rect.attribute(attrib_names[i]).as_float();
@@ -302,7 +302,7 @@ void Document::LoadSVG(const string & filename, const Rect & bounds)
                }               
                
                // Circles
                }               
                
                // Circles
-               for (pugi::xml_node circle : svg.children("circle"))
+               for (pugi::xml_node circle = svg.child("circle"); circle; circle = circle.next_sibling("circle"))
                {
                        Real cx = circle.attribute("cx").as_float();
                        Real cy = circle.attribute("cy").as_float();
                {
                        Real cx = circle.attribute("cx").as_float();
                        Real cy = circle.attribute("cy").as_float();
@@ -320,7 +320,7 @@ void Document::LoadSVG(const string & filename, const Rect & bounds)
                }               
                
                // paths
                }               
                
                // paths
-               for (pugi::xml_node path : svg.children("path"))
+               for (pugi::xml_node path = svg.child("path"); path; path = path.next_sibling("path"))
                {
                        
                        string d = path.attribute("d").as_string();
                {
                        
                        string d = path.attribute("d").as_string();

UCC git Repository :: git.ucc.asn.au