diff options
Diffstat (limited to 'plugins/SpellChecker/src/RichEdit.cpp')
-rw-r--r-- | plugins/SpellChecker/src/RichEdit.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/plugins/SpellChecker/src/RichEdit.cpp b/plugins/SpellChecker/src/RichEdit.cpp index cd15c18b04..53ed48ca30 100644 --- a/plugins/SpellChecker/src/RichEdit.cpp +++ b/plugins/SpellChecker/src/RichEdit.cpp @@ -4,8 +4,7 @@ const GUID CDECL name \
= { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
-DEFINE_GUIDXXX(IID_ITextDocument,0x8CC497C0,0xA1DF,0x11CE,0x80,0x98,
- 0x00,0xAA,0x00,0x47,0xBE,0x5D);
+DEFINE_GUIDXXX(IID_ITextDocument,0x8CC497C0,0xA1DF,0x11CE,0x80,0x98,0x00,0xAA,0x00,0x47,0xBE,0x5D);
RichEdit::RichEdit(HWND hwnd)
: hwnd(NULL), ole(NULL), textDocument(NULL), stopped(0), undoEnabled(TRUE)
@@ -46,7 +45,7 @@ void RichEdit::SetHWND(HWND hwnd) if (hwnd == NULL)
return;
- SendMessage(EM_GETOLEINTERFACE, 0, (LPARAM) &ole);
+ SendMessage(EM_GETOLEINTERFACE, 0, (LPARAM)&ole);
if (ole == NULL)
return;
@@ -90,17 +89,16 @@ void RichEdit::Stop() SuspendUndo();
-// HideCaret(hwnd);
SendMessage(WM_SETREDRAW, FALSE, 0);
- SendMessage(EM_GETSCROLLPOS, 0, (LPARAM) &old_scroll_pos);
- SendMessage(EM_EXGETSEL, 0, (LPARAM) &old_sel);
+ SendMessage(EM_GETSCROLLPOS, 0, (LPARAM)&old_scroll_pos);
+ SendMessage(EM_EXGETSEL, 0, (LPARAM)&old_sel);
GetCaretPos(&caretPos);
old_mask = SendMessage(EM_GETEVENTMASK, 0, 0);
SendMessage(EM_SETEVENTMASK, 0, old_mask & ~ENM_CHANGE);
- inverse = (old_sel.cpMin >= LOWORD(SendMessage(EM_CHARFROMPOS, 0, (LPARAM) &caretPos)));
+ inverse = (old_sel.cpMin >= LOWORD(SendMessage(EM_CHARFROMPOS, 0, (LPARAM)&caretPos)));
}
void RichEdit::Start()
@@ -123,8 +121,8 @@ void RichEdit::Start() }
SendMessage(EM_SETEVENTMASK, 0, old_mask);
- SendMessage(EM_EXSETSEL, 0, (LPARAM) &old_sel);
- SendMessage(EM_SETSCROLLPOS, 0, (LPARAM) &old_scroll_pos);
+ SendMessage(EM_EXSETSEL, 0, (LPARAM)&old_sel);
+ SendMessage(EM_SETSCROLLPOS, 0, (LPARAM)&old_scroll_pos);
SendMessage(WM_SETREDRAW, TRUE, 0);
InvalidateRect(hwnd, NULL, FALSE);
@@ -140,7 +138,7 @@ BOOL RichEdit::IsStopped() int RichEdit::GetCharFromPos(const POINT &pt)
{
- return LOWORD(SendMessage(EM_CHARFROMPOS, 0, (LPARAM) &pt));
+ return LOWORD(SendMessage(EM_CHARFROMPOS, 0, (LPARAM)&pt));
}
int RichEdit::GetLineCount() const
@@ -151,7 +149,7 @@ int RichEdit::GetLineCount() const void RichEdit::GetLine(int line, TCHAR *text, size_t text_len) const
{
*((WORD*)text) = WORD(text_len - 1);
- unsigned size = (unsigned) SendMessage(EM_GETLINE, (WPARAM) line, (LPARAM) text);
+ unsigned size = (unsigned) SendMessage(EM_GETLINE, (WPARAM) line, (LPARAM)text);
// Sometimes it likes to return size = lineLen+1, adding an \n at the end, so we remove it here
// to make both implementations return same size
int lineLen = GetLineLength(line);
@@ -177,7 +175,7 @@ int RichEdit::GetLineFromChar(int charPos) const CHARRANGE RichEdit::GetSel() const
{
CHARRANGE sel;
- SendMessage(EM_EXGETSEL, 0, (LPARAM) &sel);
+ SendMessage(EM_EXGETSEL, 0, (LPARAM)&sel);
return sel;
}
@@ -189,7 +187,7 @@ void RichEdit::SetSel(int start, int end) void RichEdit::SetSel(const CHARRANGE &sel)
{
- SendMessage(EM_EXSETSEL, 0, (LPARAM) &sel);
+ SendMessage(EM_EXSETSEL, 0, (LPARAM)&sel);
}
int RichEdit::GetTextLength() const
@@ -247,7 +245,7 @@ void RichEdit::ReplaceSel(const TCHAR *new_text) ResumeUndo();
- SendMessage(EM_REPLACESEL, undoEnabled, (LPARAM) new_text);
+ SendMessage(EM_REPLACESEL, undoEnabled, (LPARAM)new_text);
SuspendUndo();
@@ -258,7 +256,7 @@ void RichEdit::ReplaceSel(const TCHAR *new_text) }
else
{
- SendMessage(EM_REPLACESEL, undoEnabled, (LPARAM) new_text);
+ SendMessage(EM_REPLACESEL, undoEnabled, (LPARAM)new_text);
}
}
|