Index: abi/src/af/xap/xp/xap_Dialog.cpp =================================================================== RCS file: /cvsroot/abi/src/af/xap/xp/xap_Dialog.cpp,v retrieving revision 1.22 diff -u -r1.22 xap_Dialog.cpp --- abi/src/af/xap/xp/xap_Dialog.cpp 3 Mar 2003 03:25:03 -0000 1.22 +++ abi/src/af/xap/xp/xap_Dialog.cpp 31 Aug 2004 10:53:59 -0000 @@ -186,25 +186,25 @@ } -char * XAP_Dialog_Modeless::BuildWindowName( char * pWindowName, char* pDialogName, UT_sint32 width) +void XAP_Dialog_Modeless::BuildWindowName(char * pWindowName, char * pDialogName, UT_sint32 width) { -// This function returns contructs the window name of a modeless dialog by -// concatonating the active frame with the dialog name +// This function constructs and returns the window name of a modeless dialog by +// concatenating the active frame with the dialog name const UT_sint32 count = (UT_sint32) strlen(pDialogName); *pWindowName = (char) NULL; - pWindowName = strncat(pWindowName,pDialogName,count); + UT_UTF8String wn = UT_UTF8String(pDialogName); XAP_Frame* pFrame = getActiveFrame(); if (pFrame) { - const char* pFrameTitle = pFrame->getTitle(width-count-3); - pWindowName = strncat(pWindowName," - ",3); - pWindowName = strncat(pWindowName,pFrameTitle,width-count-3); + wn += " - "; + wn += pFrame->getTitle(width-count-3); } - return pWindowName; + strncpy(pWindowName, wn.utf8_str(), wn.byteLength()); + pWindowName[wn.byteLength()] = '\0'; } Index: abi/src/af/xap/xp/xap_Dialog.h =================================================================== RCS file: /cvsroot/abi/src/af/xap/xp/xap_Dialog.h,v retrieving revision 1.22 diff -u -r1.22 xap_Dialog.h --- abi/src/af/xap/xp/xap_Dialog.h 3 Mar 2003 03:25:03 -0000 1.22 +++ abi/src/af/xap/xp/xap_Dialog.h 31 Aug 2004 10:53:59 -0000 @@ -161,7 +161,7 @@ XAP_Frame * getActiveFrame() const; void modeless_cleanup(void); bool isRunning(void); - char * BuildWindowName( char* pWindowName, char* pDialogName, UT_sint32 width); + void BuildWindowName(char * pWindowName, char * pDialogName, UT_sint32 width); static XAP_Dialog_Type s_getPersistence(void) { return XAP_DLGT_APP_PERSISTENT; }; // ugly hack necessary for Win32