aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2009-10-27 00:02:12 +0000
committernyamatongwe <devnull@localhost>2009-10-27 00:02:12 +0000
commit6085a182d195a0a7d73548f321ce1ba9da005a4d (patch)
treedc8c45f5e8f7af866d4d0f628a9cd1cbb3b24446
parent080c819196de3573433269fa6452cdb57c713cf8 (diff)
downloadscintilla-mirror-6085a182d195a0a7d73548f321ce1ba9da005a4d.tar.gz
Added StringResult method to return strings in the standard way.
-rw-r--r--src/Editor.cxx9
-rw-r--r--src/Editor.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index d8bfced13..ce3d467f4 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -6387,6 +6387,15 @@ sptr_t Editor::StyleGetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lPar
return 0;
}
+sptr_t Editor::StringResult(sptr_t lParam, const char *val) {
+ const int n = strlen(val);
+ if (lParam != 0) {
+ char *ptr = reinterpret_cast<char *>(lParam);
+ strcpy(ptr, val);
+ }
+ return n; // Not including NUL
+}
+
sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
//Platform::DebugPrintf("S start wnd proc %d %d %d\n",iMessage, wParam, lParam);
diff --git a/src/Editor.h b/src/Editor.h
index fb29b3df7..e83dbdcb3 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -484,6 +484,8 @@ protected: // ScintillaBase subclass needs access to much of Editor
static const char *StringFromEOLMode(int eolMode);
+ static sptr_t StringResult(sptr_t lParam, const char *val);
+
public:
// Public so the COM thunks can access it.
bool IsUnicodeMode() const;