mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Merge remote-tracking branch 'origin/hotfix/v7.3.3' into develop
This commit is contained in:
@ -1145,21 +1145,26 @@ bool ECMACryptFile::WriteAdditional(const std::wstring &file_name, const std::ws
|
||||
{
|
||||
try
|
||||
{
|
||||
CFCPP::CompoundFile *pStorage = new CFCPP::CompoundFile(file_name, CFCPP::Update);
|
||||
CFCPP::CompoundFile *pStorage = new CFCPP::CompoundFile(file_name, CFCPP::Update, (CFCPP::SectorRecycle | CFCPP::NoValidationException | CFCPP::EraseFreeSectors));
|
||||
if (!pStorage)return false;
|
||||
|
||||
std::shared_ptr<CFCPP::CFStream> pAddit = pStorage->RootStorage()->GetStream(addit_name);
|
||||
|
||||
if (!pAddit)
|
||||
if (pAddit)
|
||||
{
|
||||
pAddit = pStorage->RootStorage()->AddStream(addit_name);
|
||||
pStorage->RootStorage()->Delete(addit_name);
|
||||
}
|
||||
pAddit = pStorage->RootStorage()->AddStream(addit_name);
|
||||
|
||||
pAddit->Write(addit_info.c_str(), 0, addit_info.size());
|
||||
|
||||
pStorage->Save(file_name);
|
||||
pStorage->Commit();
|
||||
//todooo_2 flush
|
||||
pStorage->Save(file_name + L"~");
|
||||
pStorage->Close();
|
||||
delete pStorage;
|
||||
//todooo_1 rename
|
||||
//NSFile::CFileBinary::Rename(file_name + L"~", file_name);
|
||||
NSFile::CFileBinary::Copy(file_name + L"~", file_name);
|
||||
NSFile::CFileBinary::Remove(file_name + L"~");
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user