X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fdocument.cpp;h=a4d6be6ebe07b320361ff67603e74b93efd243f9;hp=71f3ed4103a7b492545bc4c3460208b84a4d72ea;hb=11724d8d8161e2c02e9278aed0e765de3ca436b4;hpb=d69b8de94411bee43edc9e16f33bfa0d5d1d6b3b diff --git a/src/document.cpp b/src/document.cpp index 71f3ed4..a4d6be6 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -280,7 +280,7 @@ void Document::LoadSVG(const string & filename, const Rect & bounds) 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 = svg.attribute("width").as_float() * bounds.w; Real height = svg.attribute("width").as_float() * bounds.h; @@ -289,7 +289,7 @@ void Document::LoadSVG(const string & filename, const Rect & bounds) // 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(); @@ -300,7 +300,7 @@ void Document::LoadSVG(const string & filename, const Rect & bounds) } // 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(); @@ -318,7 +318,7 @@ void Document::LoadSVG(const string & filename, const Rect & bounds) } // 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();