OSDN Git Service

Remove #ifdef _UNICODE
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Mon, 8 Jul 2019 22:55:37 +0000 (07:55 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Mon, 8 Jul 2019 22:55:37 +0000 (07:55 +0900)
Src/DirView.cpp
Src/JumpList.cpp
Src/MainFrm.cpp
Src/paths.cpp
Src/stringdiffs.cpp

index 4426f42..932fa8e 100644 (file)
@@ -385,11 +385,7 @@ void CDirView::OnInitialUpdate()
        GetDocument()->SetDirView(this);
        m_pColItems.reset(new DirViewColItems(GetDocument()->m_nDirs));
 
-#ifdef _UNICODE
        m_pList->SendMessage(CCM_SETUNICODEFORMAT, TRUE, 0);
-#else
-       m_pList->SendMessage(CCM_SETUNICODEFORMAT, FALSE, 0);
-#endif
 
        // Load user-selected font
        if (GetOptionsMgr()->GetBool(OPT_FONT_DIRCMP + OPT_FONT_USECUSTOM))
@@ -3859,11 +3855,7 @@ void CDirView::OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult)
        HGLOBAL hMem = GlobalReAlloc(file.Detach(), (filesForDroping.length() + 1) * sizeof(TCHAR), 0);
        if (hMem != nullptr) 
        {
-#ifdef _UNICODE
                DropData->CacheGlobalData(CF_UNICODETEXT, hMem);
-#else
-               DropData->CacheGlobalData(CF_TEXT, hMem);
-#endif
                DROPEFFECT de = DropData->DoDragDrop(DROPEFFECT_COPY | DROPEFFECT_MOVE, nullptr);
        }
 
index 7aa87a4..3785390 100644 (file)
@@ -78,11 +78,7 @@ bool AddToRecentDocs(const String& app_path, const String& params, const String&
 {
        SHARDAPPIDINFOLINK saiil;
        saiil.pszAppID = g_appid.c_str();
-#ifdef _UNICODE
        saiil.psl = CreateShellLink(app_path, params, title, desc, icon_index);
-#else
-       saiil.psl = (IShellLink *)CreateShellLink(ucr::toUTF16(app_path), ucr::toUTF16(params), ucr::toUTF16(title), ucr::toUTF16(desc), icon_index);
-#endif
        if (saiil.psl == nullptr)
                return false;
        SHAddToRecentDocs(SHARD_APPIDINFOLINK, &saiil);
index b9ec8d5..70bd142 100644 (file)
@@ -280,11 +280,8 @@ CMainFrame::~CMainFrame()
        strdiff::Close();
 }
 
-#ifdef _UNICODE
 const TCHAR CMainFrame::szClassName[] = _T("WinMergeWindowClassW");
-#else
-const TCHAR CMainFrame::szClassName[] = _T("WinMergeWindowClassA");
-#endif
+
 /**
  * @brief Change MainFrame window class name
  *        see http://support.microsoft.com/kb/403825/ja
@@ -683,31 +680,6 @@ bool CMainFrame::ShowMergeDoc(CDirDoc * pDirDoc,
                {
                        FileLocationGuessEncodings(fileloc[pane], iGuessEncodingType);
                }
-
-               // TODO (Perry, 2005-12-04)
-               // Should we do any unification if unicodings are different?
-
-
-#ifndef _UNICODE
-               // In ANSI (8-bit) build, character loss can occur in merging
-               // if the two buffers use different encodings
-               if (pane > 0 && fileloc[pane - 1].encoding.m_codepage != fileloc[pane].encoding.m_codepage)
-               {
-                       CString msg;
-                       msg.Format(theApp.LoadString(IDS_SUGGEST_IGNORECODEPAGE).c_str(), fileloc[pane - 1].encoding.m_codepage,fileloc[pane].encoding.m_codepage);
-                       int msgflags = MB_YESNO | MB_ICONQUESTION | MB_DONT_ASK_AGAIN;
-                       // Two files with different codepages
-                       // Warn and propose to use the default codepage for both
-                       int userChoice = AfxMessageBox(msg, msgflags);
-                       if (userChoice == IDYES)
-                       {
-                               fileloc[pane - 1].encoding.SetCodepage(ucr::getDefaultCodepage());
-                               fileloc[pane - 1].encoding.m_bom = false;
-                               fileloc[pane].encoding.SetCodepage(ucr::getDefaultCodepage());
-                               fileloc[pane].encoding.m_bom = false;
-                       }
-               }
-#endif
        }
 
        // Note that OpenDocs() takes care of closing compare window when needed.
index f218251..d25ee31 100644 (file)
@@ -34,12 +34,7 @@ static bool GetDirName(const String& sDir, String& sName);
 static bool IsSlash(const String& pszStart, size_t nPos)
 {
        return pszStart[nPos]=='/' || 
-#ifdef _UNICODE
               pszStart[nPos]=='\\';
-#else
-               // Avoid 0x5C (ASCII backslash) byte occurring as trail byte in MBCS
-              (pszStart[nPos]=='\\' && !_ismbstrail((unsigned char *)pszStart.c_str(), (unsigned char *)pszStart.c_str() + nPos));
-#endif
 }
 
 /** 
@@ -484,11 +479,7 @@ String ExpandShortcut(const String &inFile)
                if (SUCCEEDED(hres))
                {
                        WCHAR wsz[MAX_PATH_FULL];
-#ifdef _UNICODE
                        _tcscpy_safe(wsz, inFile.c_str());
-#else
-                       ::MultiByteToWideChar(CP_ACP, 0, inFile.c_str(), -1, wsz, MAX_PATH_FULL);
-#endif
 
                        // Load shortcut
                        hres = ppf->Load(wsz, STGM_READ);
@@ -658,13 +649,7 @@ String EnsurePathExist(const String & sPath)
  */
 bool IsSlashOrColon(const TCHAR *pszChar, const TCHAR *begin)
 {
-#ifdef _UNICODE
                return (*pszChar == '/' || *pszChar == ':' || *pszChar == '\\');
-#else
-               // Avoid 0x5C (ASCII backslash) byte occurring as trail byte in MBCS
-               return (*pszChar == '/' || *pszChar == ':' 
-                       || (*pszChar == '\\' && !_ismbstrail((unsigned char *)begin, (unsigned char *)pszChar)));
-#endif
 }
 
 /**
index f1ede1b..c2c122b 100644 (file)
@@ -677,7 +677,6 @@ isWordBreak(int breakType, const TCHAR *str, int index)
 {
        TCHAR ch = str[index];
        // breakType==1 means break also on punctuation
-#ifdef _UNICODE
        if ((ch & 0xff00) == 0)
        {
 //             TCHAR nextCh = str[index + 1];
@@ -705,12 +704,6 @@ isWordBreak(int breakType, const TCHAR *str, int index)
 //             
                return true;
        }
-#else
-       // breakType==0 means whitespace only
-       if (breakType==0)
-               return false;
-       return _tcschr(BreakChars, ch) != nullptr;
-#endif
 }