From: Sam Moore Date: Fri, 8 Aug 2014 08:08:30 +0000 (+0800) Subject: Merge branch 'master' of git://git.ucc.asn.au/ipdf/code X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=commitdiff_plain;h=239870c67910883756cffe6c963c7f7fa44402b9;hp=694660b316623dc026d0525bbe8d82432425d4a0 Merge branch 'master' of git://git.ucc.asn.au/ipdf/code --- diff --git a/src/document.cpp b/src/document.cpp index 6c281c1..a6c6fad 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -282,7 +282,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 = 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"}; - 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(); @@ -302,7 +302,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(); @@ -320,7 +320,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(); diff --git a/src/document.h b/src/document.h index c1f026b..62f624c 100644 --- a/src/document.h +++ b/src/document.h @@ -14,7 +14,7 @@ namespace IPDF Document(const std::string & filename = "") : m_objects(), m_count(0) {Load(filename);} virtual ~Document() {} - void LoadSVG(const std::string & filename, const Rect & bounds = {0,0,1,1}); + void LoadSVG(const std::string & filename, const Rect & bounds = Rect(0,0,1,1)); void Load(const std::string & filename = ""); void Save(const std::string & filename); diff --git a/src/svg-tests/koch1.svg b/src/svg-tests/koch1.svg index 2305547..f1bd3e8 120000 --- a/src/svg-tests/koch1.svg +++ b/src/svg-tests/koch1.svg @@ -1 +1 @@ -/home/sam/ipdf/sam/figures/koch1.svg \ No newline at end of file +../../../sam/figures/koch1.svg \ No newline at end of file diff --git a/src/svg-tests/rabbit_simple.svg b/src/svg-tests/rabbit_simple.svg index 30fed1a..83b5f92 120000 --- a/src/svg-tests/rabbit_simple.svg +++ b/src/svg-tests/rabbit_simple.svg @@ -1 +1 @@ -/home/sam/ipdf/sam/figures/rabbit_simple.svg \ No newline at end of file +../../../sam/figures/rabbit_simple.svg \ No newline at end of file diff --git a/src/svg-tests/shape.svg b/src/svg-tests/shape.svg index 62d71a8..1ee4bea 120000 --- a/src/svg-tests/shape.svg +++ b/src/svg-tests/shape.svg @@ -1 +1 @@ -/home/sam/ipdf/sam/figures/shape.svg \ No newline at end of file +../../../sam/figures/shape.svg \ No newline at end of file diff --git a/src/tests/realops.cpp b/src/tests/realops.cpp index b9ce441..61d747c 100644 --- a/src/tests/realops.cpp +++ b/src/tests/realops.cpp @@ -1,3 +1,7 @@ +/** + * Test mathematical operations on the Real type and consistency with double + */ + #include "main.h" #include "real.h"