comment out get_text_char_pos and tune srvChangeCaption to use strdup

This commit is contained in:
Vincent Wei
2020-01-19 19:32:58 +08:00
parent 50fa5b53f8
commit 4b89ff7d19
2 changed files with 9 additions and 0 deletions
+7
View File
@@ -1199,6 +1199,7 @@ static int srvChangeCaption (int cli, int idx_znode, const char *caption)
nodes = GET_ZORDERNODE(zi);
if (caption && idx_znode > 0) {
#if 0 /* Since 4.2.0, use strdup to duplicate the caption */
PLOGFONT menufont ;
int fit_chars, pos_chars[MAX_CAPTION_LEN];
int caplen;
@@ -1215,6 +1216,12 @@ static int srvChangeCaption (int cli, int idx_znode, const char *caption)
strcpy ((nodes[idx_znode].caption + pos_chars[fit_chars-1]),
"...");
}
#else
if (nodes[idx_znode].caption)
free (nodes[idx_znode].caption)
nodes[idx_znode].caption = strdup (caption);
#endif
}
if (OnZNodeOperation)
+2
View File
@@ -1701,6 +1701,7 @@ static HWND dskSetActiveZOrderNode (int cli, int idx_znode)
return old_hwnd;
}
#if 0 /* Since 4.2.0, use strdup to duplicate the caption */
static void get_text_char_pos (PLOGFONT log_font, const char *text,
int len, int fit_bytes, int *fit_chars, int *pos_chars)
{
@@ -1738,6 +1739,7 @@ static void get_text_char_pos (PLOGFONT log_font, const char *text,
*fit_chars = char_count;
}
}
#endif
/*get the count of idle mask rect*/
int __mg_get_idle_slot (unsigned char* bitmap, int len_bmp)