Skip to content

Commit ed1aa5d

Browse files
committed
Another attempt to fix notepad windows - removed static buffers
1 parent 86586c8 commit ed1aa5d

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

Utilities.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2602,7 +2602,7 @@ return (first[0] << 8) + first[1];
26022602
// i18n (Internationalization) stuff
26032603

26042604
// translate message (eg. "File cannot be opened") into locale-specific language
2605-
const char * TranslateGeneric (const char * sText, const char * sSection)
2605+
CString TranslateGeneric (const char * sText, const char * sSection)
26062606
{
26072607
static bool bInTranslateGeneric = false; // stop stack overflow if we are re-called
26082608

@@ -2656,7 +2656,7 @@ const char * TranslateGeneric (const char * sText, const char * sSection)
26562656
/* valid flags in a format specification */
26572657
#define FORMATFLAGS "-+ #0"
26582658

2659-
const char * TFormat (const char * sFormat, ...)
2659+
CString TFormat (const char * sFormat, ...)
26602660
{
26612661

26622662
static bool bInTFormat = false; // stop stack overflow if we are re-called

dialogs/cmdhist.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ CString str;
243243

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

doc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5127,7 +5127,7 @@ CString strMessage;
51275127

51285128
if (!strMessage.IsEmpty ())
51295129
CreateTextWindow ((LPCTSTR) strMessage,
5130-
TFormat ("Recall: %s",
5130+
(LPCTSTR) TFormat ("Recall: %s",
51315131
(LPCTSTR) m_RecallFindInfo.m_strFindStringList.GetHead ()),
51325132
this,
51335133
m_iUniqueDocumentNumber,
@@ -5795,7 +5795,7 @@ CTextDocument * pTextDoc = NULL;
57955795
} // end of having an existing notepad document
57965796
else
57975797
CreateTextWindow ("", // contents
5798-
TFormat ("Notepad: %s", (LPCTSTR) m_mush_name), // title
5798+
(LPCTSTR) TFormat ("Notepad: %s", (LPCTSTR) m_mush_name), // title
57995799
this, // document
58005800
m_iUniqueDocumentNumber, // document number
58015801
m_input_font_name,

mushview.cpp

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

54435443
// edit current input window
54445444
CreateTextWindow ((LPCTSTR) strSelection, // contents
5445-
TFormat ("Notepad: %s", (LPCTSTR) pDoc->m_mush_name), // title
5445+
(LPCTSTR) TFormat ("Notepad: %s", (LPCTSTR) pDoc->m_mush_name), // title
54465446
pDoc, // document
54475447
pDoc->m_iUniqueDocumentNumber, // document number
54485448
pDoc->m_input_font_name,
@@ -5495,7 +5495,7 @@ CString strMessage;
54955495
pDoc->m_strRecallLinePreamble); // default preamble
54965496

54975497
CreateTextWindow ((LPCTSTR) strMessage,
5498-
TFormat ("Recall: %s",
5498+
(LPCTSTR) TFormat ("Recall: %s",
54995499
(LPCTSTR) strSelection),
55005500
pDoc,
55015501
pDoc->m_iUniqueDocumentNumber,

sendvw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2322,7 +2322,7 @@ CString strCurrent;
23222322

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

stdafx.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,10 +814,10 @@ extern "C" const unsigned char _pcre_utf8_table4[];
814814
int UMessageBox (const char * sText, UINT nType = MB_OK, const char * = "MUSHclient");
815815
// translate lpszText and then call UMessageBox
816816
int TMessageBox (const char * sText, UINT nType = MB_OK);
817-
// translate text - result is statically allocated - do not attempt to modify or store it
818-
const char * TranslateGeneric (const char * sText, const char * sSection);
819-
// translate formatted text - result is statically allocated - do not attempt to modify or store it
820-
const char * TFormat (const char * sFormat, ...);
817+
// translate text
818+
CString TranslateGeneric (const char * sText, const char * sSection);
819+
// translate formatted text
820+
CString TFormat (const char * sFormat, ...);
821821
// translate a static string
822822
#define Translate(string) TranslateGeneric (string, "messages")
823823
// translate a date/time string

0 commit comments

Comments
 (0)