From e53728a54ff21d6a47d30bc304c125b3cb9b87a9 Mon Sep 17 00:00:00 2001 From: mataes2007 Date: Fri, 13 May 2011 19:44:59 +0000 Subject: added copy Title in action Copy to Clipboard version bump git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@79 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- popup/src/popup_wnd2.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'popup/src') diff --git a/popup/src/popup_wnd2.cpp b/popup/src/popup_wnd2.cpp index 8dab680..93e13ba 100644 --- a/popup/src/popup_wnd2.cpp +++ b/popup/src/popup_wnd2.cpp @@ -1388,12 +1388,13 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara #define CF_TCHAR CF_TEXT #endif HGLOBAL clipbuffer; - static TCHAR * buffer, *text; - char* sztext = NULL; - text = this->m_lpwzText; - if (!text) + static TCHAR * buffer, *text = (TCHAR*)mir_alloc((_tcslen(this->m_lpwzText) + _tcslen(this->m_lpwzTitle)+2)*sizeof(TCHAR)); + char* sztext = (char*)mir_alloc((lstrlenA(this->m_lpzText) + lstrlenA(this->m_lpzTitle)+2)*sizeof(char)); + if ((this->m_lpwzText) || (this->m_lpwzTitle)) + mir_sntprintf(text, _tcslen(this->m_lpwzText) + _tcslen(this->m_lpwzTitle)+1, _T("%s\n%s"), this->m_lpwzTitle, this->m_lpwzText); + else if ((this->m_lpzText) || (this->m_lpzTitle)) { - sztext = this->m_lpzText; + mir_snprintf(sztext, lstrlenA(this->m_lpzText) + lstrlenA(this->m_lpzTitle)+1, "%s\n%s", this->m_lpzTitle, this->m_lpzText); text = mir_a2t(sztext); } OpenClipboard(m_hwnd); -- cgit v1.2.3