MCPcopy Create free account
hub / github.com/TortoiseGit/TortoiseGit / StringForControl

Method StringForControl

src/Utils/MiscUI/SciEdit.cpp:443–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

441}
442
443CStringA CSciEdit::StringForControl(const CString& text)
444{
445 CStringA sTextA;
446#ifdef UNICODE
447 int codepage = static_cast<int>(SendMessage(SCI_GETCODEPAGE));
448 int reslen = WideCharToMultiByte(codepage, 0, text, text.GetLength(), 0, 0, 0, 0);
449 WideCharToMultiByte(codepage, 0, text, text.GetLength(), sTextA.GetBuffer(reslen), reslen, 0, 0);
450 sTextA.ReleaseBuffer(reslen);
451#else
452 sTextA = text;
453#endif
454 ATLTRACE("string length %d\n", sTextA.GetLength());
455 return sTextA;
456}
457
458void CSciEdit::SetText(const CString& sText)
459{

Callers 3

SetupLexerMethod · 0.80
AddLogStringMethod · 0.80
AddLogStringMethod · 0.80

Calls 1

GetLengthMethod · 0.45

Tested by

no test coverage detected