Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Nov 19, 2023
1 parent de0401e commit c48e17e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Externals/winwebdiff
2 changes: 1 addition & 1 deletion Src/MergeFrameCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 4 additions & 1 deletion Src/WebPageDiffFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@ void CWebPageDiffFrame::OnWebDiffEvent(const WebDiffEvent& event)
{
switch (event.type)
{
case WebDiffEvent::NavigationStarting:
UpdateLastCompareResult();
break;
case WebDiffEvent::SourceChanged:
case WebDiffEvent::TabChanged:
{
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 8 additions & 1 deletion Src/WinWebDiffLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down Expand Up @@ -62,6 +62,12 @@ struct IWebDiffWindow
EVENT_CLICK = ( 1 << 1 ),
EVENT_INPUT = ( 1 << 2 ),
};
enum CompareState
{
NOT_COMPARED,
COMPARING,
COMPARED,
};
struct DiffOptions
{
enum DiffAlgorithm {
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit c48e17e

Please sign in to comment.