mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
fix non-windows build errors
This commit is contained in:
parent
6c829a235a
commit
2fff29ba86
|
@ -65,11 +65,6 @@ struct stylesheet
|
||||||
{
|
{
|
||||||
~stylesheet() {}
|
~stylesheet() {}
|
||||||
|
|
||||||
std::size_t index(const format &f)
|
|
||||||
{
|
|
||||||
return ::index(formats, f);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t index(const std::string &style_name)
|
std::size_t index(const std::string &style_name)
|
||||||
{
|
{
|
||||||
auto match = std::find_if(styles.begin(), styles.end(),
|
auto match = std::find_if(styles.begin(), styles.end(),
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||||
// @author: see AUTHORS file
|
// @author: see AUTHORS file
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
#include <xlnt/styles/color.hpp>
|
#include <xlnt/styles/color.hpp>
|
||||||
#include <xlnt/utils/exceptions.hpp>
|
#include <xlnt/utils/exceptions.hpp>
|
||||||
|
|
||||||
|
@ -163,7 +165,7 @@ std::string rgb_color::get_hex_string() const
|
||||||
|
|
||||||
std::array<std::uint8_t, 4> rgb_color::decode_hex_string(const std::string &hex_string)
|
std::array<std::uint8_t, 4> rgb_color::decode_hex_string(const std::string &hex_string)
|
||||||
{
|
{
|
||||||
auto x = strtoul(hex_string.c_str(), NULL, 16);
|
auto x = std::strtoul(hex_string.c_str(), NULL, 16);
|
||||||
|
|
||||||
auto a = static_cast<std::uint8_t>(x >> 24);
|
auto a = static_cast<std::uint8_t>(x >> 24);
|
||||||
auto r = static_cast<std::uint8_t>((x >> 16) & 0xff);
|
auto r = static_cast<std::uint8_t>((x >> 16) & 0xff);
|
||||||
|
|
|
@ -30,7 +30,7 @@ public:
|
||||||
|
|
||||||
if (_NSGetExecutablePath(path.data(), &size) == 0)
|
if (_NSGetExecutablePath(path.data(), &size) == 0)
|
||||||
{
|
{
|
||||||
return std::string(path.begin(), std::find(path.begin(), path.end(), '\0') - 9);
|
return xlnt::path(std::string(path.begin(), std::find(path.begin(), path.end(), '\0') - 9));
|
||||||
}
|
}
|
||||||
|
|
||||||
throw std::runtime_error("buffer too small, " + std::to_string(path.size()) + ", should be: " + std::to_string(size));
|
throw std::runtime_error("buffer too small, " + std::to_string(path.size()) + ", should be: " + std::to_string(size));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user