The code already allows you to decide to overwrite an existing toc or not, so no replacement is forced.
Code:
QString msg = tr("An existing HTML Table of Contents file has been found.");
if (!ProceedToOverwrite(msg, tocResource->ShortPathName())) {
tocResource = NULL;
}
}