Kaydet (Commit) 9ccef311 authored tarafından Matúš Kukan's avatar Matúš Kukan

Do not throw if there is no "images" child in json file tree.

Change-Id: I0b47ed00fecad84859ba3f1751407696878203fb
üst 86cac77f
...@@ -71,7 +71,7 @@ static void lcl_EmbedExternals(const OUString& rSourceURL, uno::Reference<embed: ...@@ -71,7 +71,7 @@ static void lcl_EmbedExternals(const OUString& rSourceURL, uno::Reference<embed:
// Parse json, read externals' URI and modify this relative URI's so they remain valid in the new context. // Parse json, read externals' URI and modify this relative URI's so they remain valid in the new context.
std::vector<std::string> vExternals; std::vector<std::string> vExternals;
ptree aTree; ptree aTree, aEmptyTree;
try try
{ {
json_parser::read_json( sUrl, aTree ); json_parser::read_json( sUrl, aTree );
...@@ -85,7 +85,7 @@ static void lcl_EmbedExternals(const OUString& rSourceURL, uno::Reference<embed: ...@@ -85,7 +85,7 @@ static void lcl_EmbedExternals(const OUString& rSourceURL, uno::Reference<embed:
aTree.put("buffers." + rVal.first + ".path.",sBufferUri.substr(sBufferUri.find_last_of('/')+1)); aTree.put("buffers." + rVal.first + ".path.",sBufferUri.substr(sBufferUri.find_last_of('/')+1));
} }
// Images for textures // Images for textures
BOOST_FOREACH(ptree::value_type &rVal,aTree.get_child("images")) BOOST_FOREACH(ptree::value_type &rVal,aTree.get_child("images", aEmptyTree))
{ {
const std::string sImageUri(rVal.second.get<std::string>("path")); const std::string sImageUri(rVal.second.get<std::string>("path"));
vExternals.push_back(sImageUri); vExternals.push_back(sImageUri);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment