From ff26b4137c6dc3d622336e725bd6f5630b301027 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Mon, 23 Aug 2004 22:35:21 +0000 Subject: Fixes and changes due to RTF converter not working properly. --- win32/droplet/replace.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'win32/droplet/replace.cpp') 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 -- cgit v1.2.3