Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svg_parser: remove unused properties & method, restrict var scope #2418

Merged
merged 1 commit into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 2 additions & 10 deletions synfig-core/src/modules/mod_svg/svg_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ synfig::open_svg(std::string _filepath, String &errors, String &warnings)
}

Canvas::Handle
Svg_parser::load_svg_canvas(std::string _filepath, String &errors, String &warnings)
Svg_parser::load_svg_canvas(const std::string& filepath, String &errors, String &warnings)
{
ChangeLocale locale(LC_NUMERIC, "C");

filepath = _filepath;
#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
try{
#endif //LIBXMLCPP_EXCEPTIONS_ENABLED
//load parser
xmlpp::DomParser parser;
parser.set_substitute_entities();
parser.parse_file(filepath);
//set_id(filepath);
Expand All @@ -132,7 +132,6 @@ Svg_parser::Svg_parser(const Gamma &gamma):
nodeRoot(NULL),
width(0),
height(0),
uid(0),
kux(60),
set_canvas(false), //we must run parser_canvas method
ox(0),
Expand Down Expand Up @@ -211,7 +210,6 @@ Svg_parser::parser_svg(const xmlpp::Node* node)

width = getDimension(nodeElement->get_attribute_value("width"), inkscape_version < 0.92f && approximate_not_zero(inkscape_version));
height = getDimension(nodeElement->get_attribute_value("height"), inkscape_version < 0.92f && approximate_not_zero(inkscape_version));
docname=nodeElement->get_attribute_value("docname","");
}
}

Expand Down Expand Up @@ -2529,12 +2527,6 @@ tokenize(const String& str,const String& delimiters){
}
return tokens;
}
String
Svg_parser::new_guid(){
uid++;
return GUID::hasher(uid).get_string();
}


#define COLOR_NAME(color, r, g, b) {color, {r, g, b}},

Expand Down
6 changes: 1 addition & 5 deletions synfig-core/src/modules/mod_svg/svg_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,11 @@ class Svg_parser

private:
Gamma gamma;
String filepath;
String id_name;
xmlpp::DomParser parser;
xmlpp::Document document;
xmlpp::Element* nodeRoot;//output
double width;
double height;
Glib::ustring docname;
int uid;
int kux;
bool set_canvas;
double ox,oy;
Expand All @@ -179,7 +175,7 @@ class Svg_parser

public:
explicit Svg_parser(const Gamma &gamma = Gamma());
Canvas::Handle load_svg_canvas(std::string _filepath,String &errors, String &warnings);
Canvas::Handle load_svg_canvas(const std::string& filepath,String &errors, String &warnings);
//String get_id();
//void set_id(String source);

Expand Down