{
CMergeDoc *pDoc = GetDocument();
int nGroup = pDoc->GetActiveMergeView()->m_nThisGroup;
- int pane;
- IF_IS_TRUE_ALL(m_nSubLineCount[pane] == pDoc->GetView(nGroup, pane)->GetSubLineCount(), pane, pDoc->m_nBuffers)
+ int pane = 0;
+ if (std::all_of(m_nSubLineCount, m_nSubLineCount + pDoc->m_nBuffers,
+ [&](int nSubLineCount) { return nSubLineCount == pDoc->GetView(nGroup, pane++)->GetSubLineCount(); }))
{
int nTopCoord = static_cast<int>(Y_OFFSET +
(static_cast<double>(nTopLine * m_lineInPix)));
m_diffWrapper.GetOptions(&diffOptions);
bool bForceUTF8 = diffOptions.bIgnoreCase;
- IF_IS_TRUE_ALL (
- m_ptBuf[0]->getCodepage() == m_ptBuf[nBuffer]->getCodepage() && m_ptBuf[nBuffer]->getUnicoding() == ucr::NONE,
- nBuffer, m_nBuffers) {}
- else
+ if (std::any_of(m_ptBuf, m_ptBuf + m_nBuffers,
+ [&](auto& ptBuf) { return m_ptBuf[0]->getCodepage() != ptBuf->getCodepage() || ptBuf->getUnicoding() != ucr::NONE; }))
bForceUTF8 = true;
// Clear diff list
m_diffWrapper.SetPaths(PathContext(m_tempFiles[0].GetPath(), m_tempFiles[1].GetPath(), m_tempFiles[2].GetPath()), true);
m_diffWrapper.SetCompareFiles(m_filePaths);
m_diffWrapper.SetCodepage(bForceUTF8 ? ucr::CP_UTF_8 : (m_ptBuf[0]->m_encoding.m_unicoding ? CP_UTF8 : m_ptBuf[0]->m_encoding.m_codepage));
- m_diffWrapper.SetCodepage(m_ptBuf[0]->m_encoding.m_unicoding ?
- CP_UTF8 : m_ptBuf[0]->m_encoding.m_codepage);
DIFFSTATUS status;
Computelinediff(pView, rc, bReversed);
- IF_IS_TRUE_ALL ((rc[nBuffer].top == -1), nBuffer, m_nBuffers)
+ if (std::all_of(rc, rc + m_nBuffers, [](auto& rc) { return rc.top == -1; }))
{
String caption = _("Line difference");
String msg = _("No difference");
#include <ctime>
#include <tchar.h>
-#define IF_IS_TRUE_ALL(expression, index, count) \
- for (index = 0; index < count; index++) { if ((expression)) ; else break; } \
- if (index == count)
-
-
/**
* @name User-defined Windows-messages
*/