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))
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);
}
{
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);
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
{
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.
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
}
/**
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);
*/
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
}
/**
{
TCHAR ch = str[index];
// breakType==1 means break also on punctuation
-#ifdef _UNICODE
if ((ch & 0xff00) == 0)
{
// TCHAR nextCh = str[index + 1];
//
return true;
}
-#else
- // breakType==0 means whitespace only
- if (breakType==0)
- return false;
- return _tcschr(BreakChars, ch) != nullptr;
-#endif
}