mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
fix warnings
This commit is contained in:
parent
dec6aaa49a
commit
e222e1b268
|
@ -168,7 +168,7 @@ public:
|
||||||
auto period = xlnt::timedelta(1, 2, 3, 4, 5);
|
auto period = xlnt::timedelta(1, 2, 3, 4, 5);
|
||||||
auto period_number = period.to_number();
|
auto period_number = period.to_number();
|
||||||
|
|
||||||
xlnt::number_format nf = xlnt::number_format::number_format("[mm]:ss");
|
xlnt::number_format nf("[mm]:ss");
|
||||||
auto formatted = nf.format(period_number, xlnt::calendar::windows_1900);
|
auto formatted = nf.format(period_number, xlnt::calendar::windows_1900);
|
||||||
|
|
||||||
TS_ASSERT_EQUALS(formatted, "1563:04");
|
TS_ASSERT_EQUALS(formatted, "1563:04");
|
||||||
|
@ -179,7 +179,7 @@ public:
|
||||||
auto time = xlnt::time(1, 2, 3, 400000);
|
auto time = xlnt::time(1, 2, 3, 400000);
|
||||||
auto time_number = time.to_number();
|
auto time_number = time.to_number();
|
||||||
|
|
||||||
xlnt::number_format nf = xlnt::number_format::number_format("ss.0");
|
xlnt::number_format nf("ss.0");
|
||||||
auto formatted = nf.format(time_number, xlnt::calendar::windows_1900);
|
auto formatted = nf.format(time_number, xlnt::calendar::windows_1900);
|
||||||
|
|
||||||
TS_ASSERT_EQUALS(formatted, "03.4");
|
TS_ASSERT_EQUALS(formatted, "03.4");
|
||||||
|
@ -190,7 +190,7 @@ public:
|
||||||
auto time = xlnt::time(1, 2, 3, 400000);
|
auto time = xlnt::time(1, 2, 3, 400000);
|
||||||
auto time_number = time.to_number();
|
auto time_number = time.to_number();
|
||||||
|
|
||||||
xlnt::number_format nf = xlnt::number_format::number_format("s.0");
|
xlnt::number_format nf("s.0");
|
||||||
auto formatted = nf.format(time_number, xlnt::calendar::windows_1900);
|
auto formatted = nf.format(time_number, xlnt::calendar::windows_1900);
|
||||||
|
|
||||||
TS_ASSERT_EQUALS(formatted, "3.4");
|
TS_ASSERT_EQUALS(formatted, "3.4");
|
||||||
|
@ -201,7 +201,7 @@ public:
|
||||||
auto period = xlnt::timedelta(1, 2, 3, 4, 5);
|
auto period = xlnt::timedelta(1, 2, 3, 4, 5);
|
||||||
auto period_number = period.to_number();
|
auto period_number = period.to_number();
|
||||||
|
|
||||||
xlnt::number_format nf = xlnt::number_format::number_format("[ss]");
|
xlnt::number_format nf("[ss]");
|
||||||
auto formatted = nf.format(period_number, xlnt::calendar::windows_1900);
|
auto formatted = nf.format(period_number, xlnt::calendar::windows_1900);
|
||||||
|
|
||||||
TS_ASSERT_EQUALS(formatted, "93784");
|
TS_ASSERT_EQUALS(formatted, "93784");
|
||||||
|
|
|
@ -94,8 +94,13 @@ public:
|
||||||
std::basic_string<TCHAR> working_directory(buffer);
|
std::basic_string<TCHAR> working_directory(buffer);
|
||||||
return windows_to_universal_path(std::string(working_directory.begin(), working_directory.end()));
|
return windows_to_universal_path(std::string(working_directory.begin(), working_directory.end()));
|
||||||
#else
|
#else
|
||||||
char buffer[2048];
|
char buffer[PATH_MAX];
|
||||||
getcwd(buffer, 2048);
|
|
||||||
|
if (getcwd(buffer, 2048) == nullptr)
|
||||||
|
{
|
||||||
|
throw std::runtime_error("getcwd failed");
|
||||||
|
}
|
||||||
|
|
||||||
return std::string(buffer);
|
return std::string(buffer);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user