Commit 5307c962 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

SVGTarget#escapeString

parent 76abb917
Loading
Loading
Loading
Loading
+17 −12
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public:
        "<svg viewBox='0 0 %i %i' class='%s'>\n",
        width,
        height,
        class_name.c_str());
        escapeString(class_name).c_str());
    indent_ ++;
    appendLine("<style type='text/css'>\n");
    appendLine("<![CDATA[%s  ]]>\n", kStyleSheetDefault.c_str());
@@ -81,9 +81,9 @@ public:
        y,
        width,
        height,
        class_str.c_str(),
        series.c_str(),
        label.c_str());
        escapeString(class_str).c_str(),
        escapeString(series).c_str(),
        escapeString(label).c_str());
  }

  void drawLine(
@@ -98,7 +98,7 @@ public:
        y1,
        x2,
        y2,
        class_name.c_str());
        escapeString(class_name).c_str());
  }

  void drawText(
@@ -130,9 +130,9 @@ public:
        y,
        halign.c_str(),
        valign.c_str(),
        class_name.c_str(),
        escapeString(class_name).c_str(),
        transform,
        text.c_str());
        escapeString(text).c_str());
  }

  void drawPoint(
@@ -156,9 +156,9 @@ public:
        x,
        y,
        point_type == "none" ? 0 : point_size,
        class_str.c_str(),
        label.c_str(),
        series.c_str());
        escapeString(class_str).c_str(),
        escapeString(label).c_str(),
        escapeString(series).c_str());
  }

   void drawPath(
@@ -175,7 +175,7 @@ public:
    appendLine(
        "<path stroke-width='%f' class='%s' d='",
        line_width,
        class_str.c_str());
        escapeString(class_str).c_str());

    for (int i = 0; i < points.size(); ++i) {
      if (i == 0) {
@@ -191,7 +191,7 @@ public:
  }

  void beginGroup(const std::string& class_name) override {
    appendLine("<g class='%s'>\n", class_name.c_str());
    appendLine("<g class='%s'>\n", escapeString(class_name).c_str());
    indent_++;
  }

@@ -200,6 +200,11 @@ public:
    appendLine("</g>\n");
  }

  // FIXPAUL
  std::string escapeString(const std::string& src) {
    return src;
  }

protected:
  util::OutputStream* output_;
  int indent_;