OSDN Git Service

StdAfx.*: Move GetClipTcharTextFormat() function from StdAfx.* to CCrystalTextView...
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sun, 2 Jul 2017 15:26:34 +0000 (00:26 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sun, 2 Jul 2017 15:26:34 +0000 (00:26 +0900)
Externals/crystaledit/editlib/ccrystaleditview.cpp
Externals/crystaledit/editlib/ccrystaltextview.h
Src/Common/ClipBoard.cpp
Src/Common/ClipBoard.h
Src/StdAfx.cpp
Src/StdAfx.h

index 9edfc87..393826b 100644 (file)
@@ -1178,7 +1178,7 @@ OnUpdateEditSwitchOvrmode (CCmdUI * pCmdUI)
 DROPEFFECT CEditDropTargetImpl::
 OnDragEnter (CWnd * pWnd, COleDataObject * pDataObject, DWORD dwKeyState, CPoint point)
 {
-  UINT fmt = GetClipTcharTextFormat();
+  UINT fmt = CCrystalTextView::GetClipTcharTextFormat();
   if (!pDataObject->IsDataAvailable (fmt))
     {
       if (m_pAlternateDropTarget)
@@ -1229,7 +1229,7 @@ OnDragOver (CWnd * pWnd, COleDataObject * pDataObject, DWORD dwKeyState, CPoint
   //  if ((pDataObject->IsDataAvailable( CF_TEXT ) ) ||       // If Text Available
   //          ( pDataObject -> IsDataAvailable( xxx ) ) ||    // Or xxx Available
   //          ( pDataObject -> IsDataAvailable( yyy ) ) )     // Or yyy Available
-  UINT fmt = GetClipTcharTextFormat();      // CF_TEXT or CF_UNICODETEXT
+  UINT fmt = CCrystalTextView::GetClipTcharTextFormat();      // CF_TEXT or CF_UNICODETEXT
   if (pDataObject->IsDataAvailable (fmt))   // If Text Available
 
     {
@@ -1283,7 +1283,7 @@ OnDrop (CWnd * pWnd, COleDataObject * pDataObject, DROPEFFECT dropEffect, CPoint
   //  if( ( pDataObject -> IsDataAvailable( CF_TEXT ) ) ||    // If Text Available
   //          ( pDataObject -> IsDataAvailable( xxx ) ) ||    // Or xxx Available
   //          ( pDataObject -> IsDataAvailable( yyy ) ) )     // Or yyy Available
-  UINT fmt = GetClipTcharTextFormat();      // CF_TEXT or CF_UNICODETEXT
+  UINT fmt = CCrystalTextView::GetClipTcharTextFormat();      // CF_TEXT or CF_UNICODETEXT
   if (pDataObject->IsDataAvailable (fmt))   // If Text Available
 
     {
index cac3236..37c3fa7 100644 (file)
@@ -216,6 +216,8 @@ public :
     SyntaxColors * GetSyntaxColors() { return m_pColors; }
     void SetColorContext(SyntaxColors * pColors) { m_pColors = pColors; }
 
+    static int GetClipTcharTextFormat() { return sizeof(TCHAR) == 1 ? CF_TEXT : CF_UNICODETEXT; }
+
 protected :
     CPoint WordToRight (CPoint pt);
     CPoint WordToLeft (CPoint pt);
index 95b51ca..54b52f7 100644 (file)
@@ -6,8 +6,6 @@
 
 #include "ClipBoard.h"
 
-inline UINT GetClipTcharTextFormat() { return (sizeof(TCHAR) == 1 ? CF_TEXT : CF_UNICODETEXT); }
-
 /**
  * @brief Copies string to clipboard.
  * @param [in] text Text to copy to clipboard.
index c74c2b5..b49ea3e 100644 (file)
@@ -8,6 +8,8 @@
 #include <windows.h>
 #include "UnicodeString.h"
 
+inline UINT GetClipTcharTextFormat() { return (sizeof(TCHAR) == 1 ? CF_TEXT : CF_UNICODETEXT); }
+
 bool PutToClipboard(const String & text, HWND currentWindowHandle);
 bool GetFromClipboard(String & text, HWND currentWindowHandle);
 
index 5affad9..9b9defa 100644 (file)
@@ -43,15 +43,3 @@ int NTAPI LangMessageBox(UINT nIDPrompt, UINT nType, UINT nIDHelp)
                nIDHelp = nIDPrompt;
        return AfxMessageBox(string.c_str(), nType, nIDHelp);
 }
-
-
-// Get appropriate clipboard format for TCHAR text
-int GetClipTcharTextFormat()
-{
-#ifdef _UNICODE
-       return CF_UNICODETEXT;
-#else
-       return CF_TEXT;
-#endif // _UNICODE
-}
-
index b90b159..07237ce 100644 (file)
@@ -70,9 +70,6 @@ void NTAPI LangTranslateDialog(HWND);
        /** @brief Lang aware version of AfxMessageBox() */
 int NTAPI LangMessageBox(UINT, UINT nType = MB_OK, UINT nIDHelp = (UINT)-1);
 
-       /** @brief Get appropriate clipboard format for TCHAR text, ie, CF_TEXT or CF_UNICODETEXT */
-int GetClipTcharTextFormat();
-
        /** @brief include for the custom dialog boxes, with do not ask/display again */
 #include "MessageBoxDialog.h"