Merge branch 'master' of gitee.com:openharmony/inputmethod_imf into master

Signed-off-by: 赵凌岚 <zhaolinglan@huawei.com>
This commit is contained in:
赵凌岚 2023-01-29 07:47:58 +00:00 committed by Gitee
commit eeedc2f4c0
4 changed files with 8 additions and 8 deletions

View File

@ -161,8 +161,8 @@ const std::string JsUtils::ToMessage(int32_t code)
return "error is out of definition.";
}
bool JsUtils::TraverseCallback(
std::vector<std::shared_ptr<JSCallbackObject>> &vecCopy, size_t paramNum, ArgsProvider argsProvider)
bool JsUtils::TraverseCallback(const std::vector<std::shared_ptr<JSCallbackObject>> &vecCopy, size_t paramNum,
ArgsProvider argsProvider)
{
bool isResult = false;
bool isOnKeyEvent = false;

View File

@ -64,7 +64,7 @@ public:
static napi_value ToError(napi_env env, int32_t err);
static bool TraverseCallback(std::vector<std::shared_ptr<JSCallbackObject>> &vecCopy, size_t paramNum,
static bool TraverseCallback(const std::vector<std::shared_ptr<JSCallbackObject>> &vecCopy, size_t paramNum,
ArgsProvider argsProvider);
private:

View File

@ -167,7 +167,6 @@ void ImCommonEventManager::EventSubscriber::RemoveUser(const CommonEventData &da
void ImCommonEventManager::EventSubscriber::RemovePackage(const CommonEventData &data)
{
auto const &want = data.GetWant();
std::string action = want.GetAction();
auto element = want.GetElement();
std::string bundleName = element.GetBundleName();
int32_t userId = want.GetIntParam("userId", 0);

View File

@ -19,6 +19,7 @@
#include <sys/types.h>
#include <unistd.h>
#include <algorithm>
#include <cstdio>
#include <fstream>
#include <string>
@ -107,10 +108,10 @@ void ImeCfgManager::DeleteImeCfg(int32_t userId)
ImeCfg ImeCfgManager::GetImeCfg(int32_t userId)
{
std::lock_guard<std::recursive_mutex> lock(imeCfgLock_);
for (auto &cfg : imeConfigs_) {
if (cfg.userId == userId) {
return cfg;
}
auto it = std::find_if(
imeConfigs_.begin(), imeConfigs_.end(), [userId](const ImeCfg &cfg) { return cfg.userId == userId; });
if (it != imeConfigs_.end()) {
return *it;
}
return {};
}