summaryrefslogtreecommitdiff
path: root/win32/droplet/replace.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'win32/droplet/replace.cpp')
-rw-r--r--win32/droplet/replace.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/win32/droplet/replace.cpp b/win32/droplet/replace.cpp
index 8a7b51b..624695d 100644
--- a/win32/droplet/replace.cpp
+++ b/win32/droplet/replace.cpp
@@ -131,7 +131,7 @@ int Replace::matchStatus(r_stream* stream, r_replace* repl)
ASSERT_PTR(replace);
replace->m_dlg.onReplaced();
- return replace->m_dlg.isCancelled() ? 1 : 0;
+ return replace->m_dlg.isCancelled() ? 0 : 1;
}
@@ -174,8 +174,14 @@ HRESULT Replace::replaceFolder(LPCTSTR folder)
if(FAILED(r))
RETURN(r);
+
+ // Check and see if we've been cancelled
+ if(m_dlg.isCancelled())
+ RETURN(ret);
+
if(r == S_OK)
ret = r;
+
}
while(FindNextFile(hFindFile, &findData));
}
@@ -421,6 +427,13 @@ HRESULT Replace::replaceBuffer(byte* data, size_t size, HANDLE out)
// Increment last batch
data += (batchSize - ctx.stream.availIn);
size -= (batchSize - ctx.stream.availIn);
+
+ // Check and see if we've been cancelled
+ if(m_dlg.isCancelled())
+ {
+ dirty = false;
+ RETURN(S_FALSE);
+ }
}
// Clears and prepares for next file