forked from teamnwah/openmw-tes3coop
be explicit about what we are trying to catch instead of catching everything and fixed up formatting
use Allman style brackets not K&R style, additional formatting for fallback.cpp which needed some love revert allman formatting changes
This commit is contained in:
parent
7c758a6293
commit
c6805314c2
2 changed files with 12 additions and 4 deletions
|
@ -21,15 +21,16 @@ namespace Fallback
|
|||
}
|
||||
return it->second;
|
||||
}
|
||||
|
||||
float Map::getFallbackFloat(const std::string& fall) const
|
||||
{
|
||||
std::string fallback=getFallbackString(fall);
|
||||
if(fallback.empty())
|
||||
return 0;
|
||||
else {
|
||||
return boost::lexical_cast<float>(fallback);
|
||||
}
|
||||
else
|
||||
return boost::lexical_cast<float>(fallback);
|
||||
}
|
||||
|
||||
int Map::getFallbackInt(const std::string& fall) const
|
||||
{
|
||||
std::string fallback=getFallbackString(fall);
|
||||
|
@ -47,6 +48,7 @@ namespace Fallback
|
|||
else
|
||||
return stob(fallback);
|
||||
}
|
||||
|
||||
osg::Vec4f Map::getFallbackColour(const std::string& fall) const
|
||||
{
|
||||
std::string sum=getFallbackString(fall);
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include <stdexcept>
|
||||
|
||||
#include "numericeditbox.hpp"
|
||||
|
||||
namespace Gui
|
||||
|
@ -36,7 +38,11 @@ namespace Gui
|
|||
setCaption(MyGUI::utility::toString(mValue));
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
catch (std::invalid_argument)
|
||||
{
|
||||
setCaption(MyGUI::utility::toString(mValue));
|
||||
}
|
||||
catch (std::out_of_range)
|
||||
{
|
||||
setCaption(MyGUI::utility::toString(mValue));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue