mirror of
https://github.com/Artikash/Example-Extension.git
synced 2024-11-23 09:35:37 +08:00
rename
This commit is contained in:
parent
4494691117
commit
ea46617ce9
@ -17,12 +17,12 @@ extern "C" __declspec(dllexport) wchar_t* OnNewSentence(wchar_t* sentence, const
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
std::wstring sentenceStr(sentence);
|
std::wstring sentenceCopy(sentence);
|
||||||
int origLength = sentenceStr.size();
|
int oldSize = sentenceCopy.size();
|
||||||
if (ProcessSentence(sentenceStr, SentenceInfo{ sentenceInfo }))
|
if (ProcessSentence(sentenceCopy, SentenceInfo{ sentenceInfo }))
|
||||||
{
|
{
|
||||||
if (sentenceStr.size() > origLength) sentence = (wchar_t*)HeapReAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, sentence, (sentenceStr.size() + 1) * sizeof(wchar_t));
|
if (sentenceCopy.size() > oldSize) sentence = (wchar_t*)HeapReAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, sentence, (sentenceCopy.size() + 1) * sizeof(wchar_t));
|
||||||
wcscpy_s(sentence, sentenceStr.size() + 1, sentenceStr.c_str());
|
wcscpy_s(sentence, sentenceCopy.size() + 1, sentenceCopy.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SKIP)
|
catch (SKIP)
|
||||||
|
Loading…
Reference in New Issue
Block a user