diff --git a/Externals/winwebdiff b/Externals/winwebdiff index a5c6478a5b5..ba7267eb68d 160000 --- a/Externals/winwebdiff +++ b/Externals/winwebdiff @@ -1 +1 @@ -Subproject commit a5c6478a5b5947d76cd8194545b5f1dac425f28e +Subproject commit ba7267eb68df30d1acba34d64b80ad7d4827b67a diff --git a/Src/MergeFrameCommon.cpp b/Src/MergeFrameCommon.cpp index 700d6e0f5ce..7d1f5790036 100644 --- a/Src/MergeFrameCommon.cpp +++ b/Src/MergeFrameCommon.cpp @@ -88,7 +88,7 @@ void CMergeFrameCommon::RemoveBarBorder() */ void CMergeFrameCommon::SetLastCompareResult(int nResult) { - HICON hReplace = (nResult == 0) ? m_hIdentical : m_hDifferent; + HICON hReplace = (nResult == 0) ? m_hIdentical : ((nResult < 0) ? nullptr : m_hDifferent); if (m_hCurrent != hReplace) { diff --git a/Src/WebPageDiffFrm.cpp b/Src/WebPageDiffFrm.cpp index 12314d955cd..c2653bad79e 100644 --- a/Src/WebPageDiffFrm.cpp +++ b/Src/WebPageDiffFrm.cpp @@ -323,6 +323,9 @@ void CWebPageDiffFrame::OnWebDiffEvent(const WebDiffEvent& event) { switch (event.type) { + case WebDiffEvent::NavigationStarting: + UpdateLastCompareResult(); + break; case WebDiffEvent::SourceChanged: case WebDiffEvent::TabChanged: { @@ -877,7 +880,7 @@ int CWebPageDiffFrame::UpdateLastCompareResult() int result = -1; if (m_bCompareCompleted) { - result = m_pWebDiffWindow->GetDiffCount() > 0 ? 1 : 0; + result = (m_pWebDiffWindow->GetCompareState() == IWebDiffWindow::COMPARED) ? (m_pWebDiffWindow->GetDiffCount() > 0 ? 1 : 0) : -1; SetLastCompareResult(result); } return result; diff --git a/Src/WinWebDiffLib.h b/Src/WinWebDiffLib.h index 7cc74316652..d82da73dc05 100644 --- a/Src/WinWebDiffLib.h +++ b/Src/WinWebDiffLib.h @@ -6,7 +6,7 @@ struct WebDiffEvent { - enum EVENT_TYPE { ZoomFactorChanged, NewWindowRequested, WindowCloseRequested, NavigationStarting, FrameNavigationStarting, HistoryChanged, SourceChanged, DocumentTitleChanged, NavigationCompleted, FrameNavigationCompleted, WebMessageReceived, FrameWebMessageReceived, TabChanged, HSCROLL, VSCROLL }; + enum EVENT_TYPE { ZoomFactorChanged, NewWindowRequested, WindowCloseRequested, NavigationStarting, FrameNavigationStarting, HistoryChanged, SourceChanged, DocumentTitleChanged, NavigationCompleted, FrameNavigationCompleted, WebMessageReceived, FrameWebMessageReceived, TabChanged, HSCROLL, VSCROLL, CompareStateChanged }; EVENT_TYPE type; int pane; }; @@ -62,6 +62,12 @@ struct IWebDiffWindow EVENT_CLICK = ( 1 << 1 ), EVENT_INPUT = ( 1 << 2 ), }; + enum CompareState + { + NOT_COMPARED, + COMPARING, + COMPARED, + }; struct DiffOptions { enum DiffAlgorithm { @@ -183,6 +189,7 @@ struct IWebDiffWindow virtual void SetSyncEventFlags(unsigned flags) = 0; virtual bool GetSyncEventFlag(EventType event) const = 0; virtual void SetSyncEventFlag(EventType event, bool flag) = 0; + virtual CompareState GetCompareState() const = 0; }; extern "C"