From 2562ad74d1945322e9fdf8af5fc0b1f17e854c9b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 1 Feb 2017 10:22:17 +0000 Subject: stoi not a member of std under android toolchain Change-Id: I73a4e7894e33dd95ca50ea25f5f95bf94a43531e --- desktop/qa/desktop_lib/test_desktop_lib.cxx | 8 ++++---- desktop/source/lib/init.cxx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'desktop') 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 aExpected = {5, 6, 7, 8, 9}; + std::vector 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 aExpected = { 8 }; + std::vector 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; } -- cgit