Skip to content

Commit

Permalink
Fixed bug regarding notepad titles and contents sometimes being incor…
Browse files Browse the repository at this point in the history
…rect
  • Loading branch information
nickgammon committed Jan 17, 2018
1 parent 5411e48 commit 86586c8
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions MUSHclient.cpp
Expand Up @@ -1855,8 +1855,8 @@ CTextDocument * pTextDoc = FindNotepad (strTitle);
return false;
} // end of having an existing notepad document

BOOL bOK = CreateTextWindow (strText, // contents
strTitle, // title
BOOL bOK = CreateTextWindow ((LPCTSTR) strText, // contents
(LPCTSTR) strTitle, // title
NULL, // document
0, // document number
App.m_strDefaultInputFont,
Expand Down
2 changes: 1 addition & 1 deletion TextDocument.cpp
Expand Up @@ -436,7 +436,7 @@ CMUSHclientDoc * pDoc = FindWorld ();
}

CreateTextWindow ("", // contents
strTitle, // title
(LPCTSTR) strTitle, // title
pDoc, // document
m_iUniqueDocumentNumber, // document number
m_strFontName,
Expand Down
2 changes: 1 addition & 1 deletion dialogs/cmdhist.cpp
Expand Up @@ -242,7 +242,7 @@ CString str;
str = m_msgList->GetAt (pos);

// edit current input window
CreateTextWindow (str, // command
CreateTextWindow ((LPCTSTR) str, // command
TFormat ("Notepad: %s", (LPCTSTR) m_pDoc->m_mush_name), // title
m_pDoc, // document
m_pDoc->m_iUniqueDocumentNumber, // document number
Expand Down
14 changes: 10 additions & 4 deletions doc.cpp
Expand Up @@ -5126,7 +5126,7 @@ CString strMessage;
dlg.m_strRecallLinePreamble);

if (!strMessage.IsEmpty ())
CreateTextWindow (strMessage,
CreateTextWindow ((LPCTSTR) strMessage,
TFormat ("Recall: %s",
(LPCTSTR) m_RecallFindInfo.m_strFindStringList.GetHead ()),
this,
Expand Down Expand Up @@ -6403,8 +6403,11 @@ void CMUSHclientDoc::SendTo (
break;

case eSendToNotepad:
CreateTextWindow (strSendText + ENDLINE, // contents
strDescription, // title
{
CString strContents = strSendText;
strContents += ENDLINE;
CreateTextWindow ((LPCTSTR) strContents, // contents
(LPCTSTR) strDescription, // title
this, // document
m_iUniqueDocumentNumber, // document number
m_input_font_name,
Expand All @@ -6423,6 +6426,7 @@ void CMUSHclientDoc::SendTo (
false,
eNotepadTrigger
);
}
break;

case eAppendToNotepad:
Expand Down Expand Up @@ -7435,7 +7439,9 @@ UINT dFormat = 0;
CloseClipboard();
CreateTextWindow (strMessage + ENDLINE, // contents
CString strContents = strMessage;
strContents += ENDLINE;
CreateTextWindow ((LPCTSTR) strContents, // contents
"Clipboard contents", // title
this, // document
m_iUniqueDocumentNumber, // document number
Expand Down
4 changes: 2 additions & 2 deletions mushview.cpp
Expand Up @@ -5441,7 +5441,7 @@ CString strSelection;


// edit current input window
CreateTextWindow (strSelection, // contents
CreateTextWindow ((LPCTSTR) strSelection, // contents
TFormat ("Notepad: %s", (LPCTSTR) pDoc->m_mush_name), // title
pDoc, // document
pDoc->m_iUniqueDocumentNumber, // document number
Expand Down Expand Up @@ -5494,7 +5494,7 @@ CString strMessage;
0, // all lines
pDoc->m_strRecallLinePreamble); // default preamble

CreateTextWindow (strMessage,
CreateTextWindow ((LPCTSTR) strMessage,
TFormat ("Recall: %s",
(LPCTSTR) strSelection),
pDoc,
Expand Down
4 changes: 2 additions & 2 deletions scripting/methods/methods_notepad.cpp
Expand Up @@ -118,8 +118,8 @@ CTextDocument * pTextDoc = FindNotepad (strTitle);
return false;
} // end of having an existing notepad document

BOOL bOK = CreateTextWindow (strText, // contents
strTitle, // title
BOOL bOK = CreateTextWindow ((LPCTSTR) strText, // contents
(LPCTSTR) strTitle, // title
this, // document
m_iUniqueDocumentNumber, // document number
m_input_font_name,
Expand Down
2 changes: 1 addition & 1 deletion sendvw.cpp
Expand Up @@ -2321,7 +2321,7 @@ CString strCurrent;
strCurrent = strCurrent.Mid (nStartChar, nEndChar - nStartChar);

// edit current input window
CreateTextWindow (strCurrent, // selection
CreateTextWindow ((LPCTSTR) strCurrent, // selection
TFormat ("Notepad: %s", (LPCTSTR) pDoc->m_mush_name), // title
pDoc, // document
pDoc->m_iUniqueDocumentNumber, // document number
Expand Down

0 comments on commit 86586c8

Please sign in to comment.