Skip to content

Commit 86586c8

Browse files
committed
Fixed bug regarding notepad titles and contents sometimes being incorrect
1 parent 5411e48 commit 86586c8

File tree

7 files changed

+19
-13
lines changed

7 files changed

+19
-13
lines changed

MUSHclient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,8 +1855,8 @@ CTextDocument * pTextDoc = FindNotepad (strTitle);
18551855
return false;
18561856
} // end of having an existing notepad document
18571857

1858-
BOOL bOK = CreateTextWindow (strText, // contents
1859-
strTitle, // title
1858+
BOOL bOK = CreateTextWindow ((LPCTSTR) strText, // contents
1859+
(LPCTSTR) strTitle, // title
18601860
NULL, // document
18611861
0, // document number
18621862
App.m_strDefaultInputFont,

TextDocument.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ CMUSHclientDoc * pDoc = FindWorld ();
436436
}
437437

438438
CreateTextWindow ("", // contents
439-
strTitle, // title
439+
(LPCTSTR) strTitle, // title
440440
pDoc, // document
441441
m_iUniqueDocumentNumber, // document number
442442
m_strFontName,

dialogs/cmdhist.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ CString str;
242242
str = m_msgList->GetAt (pos);
243243

244244
// edit current input window
245-
CreateTextWindow (str, // command
245+
CreateTextWindow ((LPCTSTR) str, // command
246246
TFormat ("Notepad: %s", (LPCTSTR) m_pDoc->m_mush_name), // title
247247
m_pDoc, // document
248248
m_pDoc->m_iUniqueDocumentNumber, // document number

doc.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5126,7 +5126,7 @@ CString strMessage;
51265126
dlg.m_strRecallLinePreamble);
51275127

51285128
if (!strMessage.IsEmpty ())
5129-
CreateTextWindow (strMessage,
5129+
CreateTextWindow ((LPCTSTR) strMessage,
51305130
TFormat ("Recall: %s",
51315131
(LPCTSTR) m_RecallFindInfo.m_strFindStringList.GetHead ()),
51325132
this,
@@ -6403,8 +6403,11 @@ void CMUSHclientDoc::SendTo (
64036403
break;
64046404

64056405
case eSendToNotepad:
6406-
CreateTextWindow (strSendText + ENDLINE, // contents
6407-
strDescription, // title
6406+
{
6407+
CString strContents = strSendText;
6408+
strContents += ENDLINE;
6409+
CreateTextWindow ((LPCTSTR) strContents, // contents
6410+
(LPCTSTR) strDescription, // title
64086411
this, // document
64096412
m_iUniqueDocumentNumber, // document number
64106413
m_input_font_name,
@@ -6423,6 +6426,7 @@ void CMUSHclientDoc::SendTo (
64236426
false,
64246427
eNotepadTrigger
64256428
);
6429+
}
64266430
break;
64276431

64286432
case eAppendToNotepad:
@@ -7435,7 +7439,9 @@ UINT dFormat = 0;
74357439
74367440
CloseClipboard();
74377441
7438-
CreateTextWindow (strMessage + ENDLINE, // contents
7442+
CString strContents = strMessage;
7443+
strContents += ENDLINE;
7444+
CreateTextWindow ((LPCTSTR) strContents, // contents
74397445
"Clipboard contents", // title
74407446
this, // document
74417447
m_iUniqueDocumentNumber, // document number

mushview.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5441,7 +5441,7 @@ CString strSelection;
54415441

54425442

54435443
// edit current input window
5444-
CreateTextWindow (strSelection, // contents
5444+
CreateTextWindow ((LPCTSTR) strSelection, // contents
54455445
TFormat ("Notepad: %s", (LPCTSTR) pDoc->m_mush_name), // title
54465446
pDoc, // document
54475447
pDoc->m_iUniqueDocumentNumber, // document number
@@ -5494,7 +5494,7 @@ CString strMessage;
54945494
0, // all lines
54955495
pDoc->m_strRecallLinePreamble); // default preamble
54965496

5497-
CreateTextWindow (strMessage,
5497+
CreateTextWindow ((LPCTSTR) strMessage,
54985498
TFormat ("Recall: %s",
54995499
(LPCTSTR) strSelection),
55005500
pDoc,

scripting/methods/methods_notepad.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ CTextDocument * pTextDoc = FindNotepad (strTitle);
118118
return false;
119119
} // end of having an existing notepad document
120120

121-
BOOL bOK = CreateTextWindow (strText, // contents
122-
strTitle, // title
121+
BOOL bOK = CreateTextWindow ((LPCTSTR) strText, // contents
122+
(LPCTSTR) strTitle, // title
123123
this, // document
124124
m_iUniqueDocumentNumber, // document number
125125
m_input_font_name,

sendvw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2321,7 +2321,7 @@ CString strCurrent;
23212321
strCurrent = strCurrent.Mid (nStartChar, nEndChar - nStartChar);
23222322

23232323
// edit current input window
2324-
CreateTextWindow (strCurrent, // selection
2324+
CreateTextWindow ((LPCTSTR) strCurrent, // selection
23252325
TFormat ("Notepad: %s", (LPCTSTR) pDoc->m_mush_name), // title
23262326
pDoc, // document
23272327
pDoc->m_iUniqueDocumentNumber, // document number

0 commit comments

Comments
 (0)