summaryrefslogtreecommitdiffstats
path: root/cppu/source/uno/EnvStack.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cppu/source/uno/EnvStack.cxx')
-rw-r--r--cppu/source/uno/EnvStack.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/cppu/source/uno/EnvStack.cxx b/cppu/source/uno/EnvStack.cxx
index 2356948c51c5..34fea77f46bd 100644
--- a/cppu/source/uno/EnvStack.cxx
+++ b/cppu/source/uno/EnvStack.cxx
@@ -25,6 +25,7 @@
#include <osl/thread.h>
#include <osl/thread.hxx>
+#include <o3tl/string_view.hxx>
#include <mutex>
#include <unordered_map>
@@ -140,29 +141,29 @@ extern "C" void SAL_CALL uno_getCurrentEnvironment(uno_Environment ** ppEnv, rtl
}
}
-static OUString s_getPrefix(OUString const & str1, OUString const & str2)
+static OUString s_getPrefix(std::u16string_view str1, std::u16string_view str2)
{
sal_Int32 nIndex1 = 0;
sal_Int32 nIndex2 = 0;
sal_Int32 sim = 0;
- OUString token1;
- OUString token2;
+ std::u16string_view token1;
+ std::u16string_view token2;
do
{
- token1 = str1.getToken(0, ':', nIndex1);
- token2 = str2.getToken(0, ':', nIndex2);
+ token1 = o3tl::getToken(str1, 0, ':', nIndex1);
+ token2 = o3tl::getToken(str2, 0, ':', nIndex2);
if (token1 == token2)
- sim += token1.getLength() + 1;
+ sim += token1.size() + 1;
}
while(nIndex1 == nIndex2 && nIndex1 >= 0 && token1 == token2);
OUString result;
if (sim)
- result = str1.copy(0, sim - 1);
+ result = str1.substr(0, sim - 1);
return result;
}
@@ -171,7 +172,7 @@ static int s_getNextEnv(uno_Environment ** ppEnv, uno_Environment * pCurrEnv, un
{
int res = 0;
- OUString nextPurpose;
+ std::u16string_view nextPurpose;
OUString currPurpose;
if (pCurrEnv)
@@ -185,7 +186,7 @@ static int s_getNextEnv(uno_Environment ** ppEnv, uno_Environment * pCurrEnv, un
if (currPurpose.getLength() > intermPurpose.getLength())
{
sal_Int32 idx = currPurpose.lastIndexOf(':');
- nextPurpose = currPurpose.copy(0, idx);
+ nextPurpose = currPurpose.subView(0, idx);
res = -1;
}
@@ -196,14 +197,14 @@ static int s_getNextEnv(uno_Environment ** ppEnv, uno_Environment * pCurrEnv, un
nextPurpose = targetPurpose;
else
- nextPurpose = targetPurpose.copy(0, idx);
+ nextPurpose = targetPurpose.subView(0, idx);
res = 1;
}
- if (!nextPurpose.isEmpty())
+ if (!nextPurpose.empty())
{
- OUString next_envDcp = UNO_LB_UNO + nextPurpose;
+ OUString next_envDcp = OUString::Concat(UNO_LB_UNO) + nextPurpose;
uno_getEnvironment(ppEnv, next_envDcp.pData, nullptr);
}
else