summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-01 10:22:17 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-01 10:22:17 +0000
commit2562ad74d1945322e9fdf8af5fc0b1f17e854c9b (patch)
treebb70cde1c7842f2e1f46750491f0b127b6e18276 /desktop
parentdfdd01d12226cfbd9b9d2618bd9da71191bfc4b9 (diff)
stoi not a member of std under android toolchain
Change-Id: I73a4e7894e33dd95ca50ea25f5f95bf94a43531e
Diffstat (limited to 'desktop')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx8
-rw-r--r--desktop/source/lib/init.cxx2
2 files changed, 5 insertions, 5 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 4312089e0eb8..175947b8c7c2 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -863,13 +863,13 @@ void DesktopLOKTest::testSheetSelections()
{
char* pUsedMimeType = nullptr;
char* pCopiedContent = pDocument->pClass->getTextSelection(pDocument, nullptr, &pUsedMimeType);
- std::vector<int> aExpected = {5, 6, 7, 8, 9};
+ std::vector<long> aExpected = {5, 6, 7, 8, 9};
std::istringstream iss(pCopiedContent);
for (size_t i = 0; i < aExpected.size(); i++)
{
std::string token;
iss >> token;
- CPPUNIT_ASSERT_EQUAL(aExpected[i], std::stoi(token));
+ CPPUNIT_ASSERT_EQUAL(aExpected[i], strtol(token.c_str(), nullptr, 10));
}
free(pUsedMimeType);
@@ -909,13 +909,13 @@ void DesktopLOKTest::testSheetSelections()
{
char* pUsedMimeType = nullptr;
char* pCopiedContent = pDocument->pClass->getTextSelection(pDocument, nullptr, &pUsedMimeType);
- std::vector<int> aExpected = { 8 };
+ std::vector<long> aExpected = { 8 };
std::istringstream iss(pCopiedContent);
for (size_t i = 0; i < aExpected.size(); i++)
{
std::string token;
iss >> token;
- CPPUNIT_ASSERT_EQUAL(aExpected[i], std::stoi(token));
+ CPPUNIT_ASSERT_EQUAL(aExpected[i], strtol(token.c_str(), nullptr, 10));
}
free(pUsedMimeType);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d879798e85db..c11e16192a28 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -463,7 +463,7 @@ int lcl_getViewId(const std::string& payload)
}
if (numberPos < payload.length() && payload[numberPos] >= '0' && payload[numberPos] <= '9')
- return std::stoi(payload.substr(numberPos));
+ return strtol(payload.substr(numberPos).c_str(), nullptr, 10);
return 0;
}