summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2020-02-04 11:51:24 +0100
committerFridrich Štrba <fridrich.strba@bluewin.ch>2020-02-04 11:51:24 +0100
commiteb46ee4ca53fd37406ee71cb04edd260a9134622 (patch)
tree554dac81310d93a5516d4f71552ddadaa707ac65
parent4923f95bde2c07f33b645a298238cb79f615a016 (diff)
boost::property_tree::ptree::count does not recurse into children
Change-Id: I6892218152d14036b468826fc91f763787554ee3
-rw-r--r--src/lib/CDRParser.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/CDRParser.cpp b/src/lib/CDRParser.cpp
index bd3d1bb..eb8ab61 100644
--- a/src/lib/CDRParser.cpp
+++ b/src/lib/CDRParser.cpp
@@ -3416,16 +3416,20 @@ void libcdr::CDRParser::_readX6StyleString(librevenge::RVNGInputStream *input, u
CDR_DEBUG_MSG(("CDRParser::_readX6StyleString - styleString = \"%s\"\n", styleString.cstr()));
boost::property_tree::ptree pt;
+#ifndef DEBUG
try
+#endif
{
std::stringstream ss;
ss << styleString.cstr();
boost::property_tree::read_json(ss, pt);
}
+#ifndef DEBUG
catch (...)
{
return;
}
+#endif
if (pt.count("character"))
{
@@ -3440,7 +3444,7 @@ void libcdr::CDRParser::_readX6StyleString(librevenge::RVNGInputStream *input, u
if (!!fontSize)
style.m_fontSize = (double)fontSize.get() / 254000.0;
- if (pt.count("character.outline"))
+ if (!!pt.get_child_optional("character.outline"))
{
style.m_lineStyle.lineType = 0;
boost::optional<unsigned> lineWidth = pt.get_optional<unsigned>("character.outline.width");
@@ -3454,7 +3458,7 @@ void libcdr::CDRParser::_readX6StyleString(librevenge::RVNGInputStream *input, u
}
}
- if (pt.count("character.fill"))
+ if (!!pt.get_child_optional("character.fill"))
{
boost::optional<unsigned short> type = pt.get_optional<unsigned short>("character.fill.type");
if (!!type)