diff --git a/Common/cfcpp/cfcpp.pri b/Common/cfcpp/cfcpp.pri deleted file mode 100644 index d19edd56d1..0000000000 --- a/Common/cfcpp/cfcpp.pri +++ /dev/null @@ -1,35 +0,0 @@ -SOURCES += \ - $$PWD/RBTree/rbtree.cpp \ - $$PWD/cfitem.cpp \ - $$PWD/cfstorage.cpp \ - $$PWD/cfstream.cpp \ - $$PWD/compoundfile.cpp \ - $$PWD/directoryentry.cpp \ - $$PWD/header.cpp \ - $$PWD/sector.cpp \ - $$PWD/sectorcollection.cpp \ - $$PWD/stream.cpp \ - $$PWD/streamrw.cpp \ - $$PWD/streamview.cpp - -HEADERS += \ - $$PWD/RBTree/irbnode.h \ - $$PWD/RBTree/rbtree.h \ - $$PWD/RBTree/rbtreeexception.h \ - $$PWD/cfexception.h \ - $$PWD/cfitem.h \ - $$PWD/cfstorage.h \ - $$PWD/cfstream.h \ - $$PWD/compoundfile.h \ - $$PWD/directoryentry.h \ - $$PWD/event.h \ - $$PWD/guid.h \ - $$PWD/header.h \ - $$PWD/idirectoryentry.h \ - $$PWD/sector.h \ - $$PWD/sectorcollection.h \ - $$PWD/slist.h \ - $$PWD/stream.h \ - $$PWD/streamrw.h \ - $$PWD/streamview.h \ - $$PWD/svector.h diff --git a/Common/cfcpp/cfcpp.pro b/Common/cfcpp/cfcpp.pro new file mode 100644 index 0000000000..3e03e0f5e9 --- /dev/null +++ b/Common/cfcpp/cfcpp.pro @@ -0,0 +1,49 @@ +QT -= core gui + +TARGET = CompaundLib +TEMPLATE = lib +CONFIG += staticlib + +CORE_ROOT_DIR = $$PWD/../.. +PWD_ROOT_DIR = $$PWD + +CONFIG += core_x2t + +include(../base.pri) + +SOURCES += \ + RBTree/rbtree.cpp \ + cfitem.cpp \ + cfstorage.cpp \ + cfstream.cpp \ + compoundfile.cpp \ + directoryentry.cpp \ + header.cpp \ + sector.cpp \ + sectorcollection.cpp \ + stream.cpp \ + streamrw.cpp \ + streamview.cpp + +HEADERS += \ + RBTree/irbnode.h \ + RBTree/rbtree.h \ + RBTree/rbtreeexception.h \ + cfexception.h \ + cfitem.h \ + cfstorage.h \ + cfstream.h \ + compoundfile.h \ + compoundfile_impl.h \ + directoryentry.h \ + event.h \ + guid.h \ + header.h \ + idirectoryentry.h \ + sector.h \ + sectorcollection.h \ + slist.h \ + stream.h \ + streamrw.h \ + streamview.h \ + svector.h diff --git a/Common/cfcpp/cfitem.cpp b/Common/cfcpp/cfitem.cpp index 3decf3f709..c92d70f97d 100644 --- a/Common/cfcpp/cfitem.cpp +++ b/Common/cfcpp/cfitem.cpp @@ -31,7 +31,7 @@ */ #include "cfitem.h" #include "idirectoryentry.h" -#include "compoundfile.h" +#include "compoundfile_impl.h" #include diff --git a/Common/cfcpp/cfitem.h b/Common/cfcpp/cfitem.h index 53cb550d64..b4afd32b44 100644 --- a/Common/cfcpp/cfitem.h +++ b/Common/cfcpp/cfitem.h @@ -34,7 +34,7 @@ #include "cfexception.h" // Used by heirs #include #include - +#include "../../DesktopEditor/common/Types.h" namespace CFCPP { @@ -45,7 +45,7 @@ struct DataTime char data[8] = {0,0,0,0,0,0,0,0}; }; -class CompoundFile; +class CompoundFile_impl; class IDirectoryEntry; class CFItem : public std::enable_shared_from_this @@ -73,18 +73,18 @@ public: void setDirEntry(const std::weak_ptr &newDirEntry); std::shared_ptr getDirEntry() const; - friend class CompoundFile; + friend class CompoundFile_impl; protected: std::weak_ptr dirEntry; - CompoundFile* compoundFile = nullptr; + CompoundFile_impl* compoundFile = nullptr; protected: CFItem() {}; - CFItem(CompoundFile* compoundFile) : + CFItem(CompoundFile_impl* compoundFile) : compoundFile(compoundFile) {} - inline CompoundFile* getCompoundFile() + inline CompoundFile_impl* getCompoundFile() {return compoundFile;} void CheckDisposed() const; }; diff --git a/Common/cfcpp/cfstorage.cpp b/Common/cfcpp/cfstorage.cpp index f0e45306ba..152cd86054 100644 --- a/Common/cfcpp/cfstorage.cpp +++ b/Common/cfcpp/cfstorage.cpp @@ -31,7 +31,7 @@ */ #include "cfstorage.h" #include "cfexception.h" -#include "compoundfile.h" +#include "compoundfile_impl.h" #include "directoryentry.h" #include "RBTree/rbtreeexception.h" #include "RBTree/irbnode.h" @@ -40,7 +40,7 @@ using namespace CFCPP; using RedBlackTree::RBTree; -CFStorage::CFStorage(CompoundFile *compFile, const std::weak_ptr &dirEntry) : +CFStorage::CFStorage(CompoundFile_impl *compFile, const std::weak_ptr &dirEntry) : CFItem(compFile) { setDirEntry(dirEntry); @@ -54,7 +54,7 @@ std::shared_ptr CFStorage::getChildren() if (children == nullptr) { - children = CompoundFile::CreateNewTree(); + children = CompoundFile_impl::CreateNewTree(); } } return children; diff --git a/Common/cfcpp/cfstorage.h b/Common/cfcpp/cfstorage.h index eba23eda42..ac24e77458 100644 --- a/Common/cfcpp/cfstorage.h +++ b/Common/cfcpp/cfstorage.h @@ -38,11 +38,11 @@ namespace CFCPP { +class CompoundFile_impl; class CFStorage : public CFItem { public: - CFStorage(CompoundFile* compFile, const std::weak_ptr &dirEntry); - + CFStorage(CompoundFile_impl* compFile, const std::weak_ptr &dirEntry); std::shared_ptr getChildren(); std::shared_ptr AddStream(const std::wstring& streamName); diff --git a/Common/cfcpp/cfstream.cpp b/Common/cfcpp/cfstream.cpp index fb99e06ab4..6fa553c910 100644 --- a/Common/cfcpp/cfstream.cpp +++ b/Common/cfcpp/cfstream.cpp @@ -32,11 +32,11 @@ #include "cfstream.h" #include "cfexception.h" #include "idirectoryentry.h" -#include "compoundfile.h" +#include "compoundfile_impl.h" using namespace CFCPP; -CFStream::CFStream(CompoundFile* compFile, std::weak_ptr dirEntry) : +CFStream::CFStream(CompoundFile_impl* compFile, std::weak_ptr dirEntry) : CFItem(compFile) { if (dirEntry.expired() || dirEntry.lock()->getSid() < 0) diff --git a/Common/cfcpp/cfstream.h b/Common/cfcpp/cfstream.h index 047d4e430d..200b25a4b1 100644 --- a/Common/cfcpp/cfstream.h +++ b/Common/cfcpp/cfstream.h @@ -41,7 +41,7 @@ namespace CFCPP class CFStream : public CFItem { public: - CFStream(CompoundFile* compFile, std::weak_ptr dirEntry); + CFStream(CompoundFile_impl* compFile, std::weak_ptr dirEntry); void Append(const std::vector& data); void Write(const std::vector& data, std::streamsize position); diff --git a/Common/cfcpp/compoundfile.cpp b/Common/cfcpp/compoundfile.cpp index 39596677bb..f24e2d84fa 100644 --- a/Common/cfcpp/compoundfile.cpp +++ b/Common/cfcpp/compoundfile.cpp @@ -29,9 +29,7 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -#include "compoundfile.h" -#include "cfstorage.h" -#include "header.h" +#include "compoundfile_impl.h" #include "directoryentry.h" #include "cfexception.h" #include "streamview.h" @@ -42,14 +40,79 @@ #include "sector.h" - +//-------------------------------------------------------------------------------- using namespace CFCPP; -CompoundFile::CompoundFile() : - CompoundFile(CFSVersion::Ver_3, CFSConfiguration::Default) +CompoundFile::CompoundFile() : _impl(new CFCPP::CompoundFile_impl()) +{ +} +CompoundFile::CompoundFile(const std::wstring &fileName, CFSUpdateMode updateMode, CFSConfiguration configParameters) : + _impl(new CFCPP::CompoundFile_impl(fileName, updateMode, configParameters)) +{ +} +CompoundFile::CompoundFile(CFSVersion cfsVersion, CFSConfiguration configFlags) : + _impl(new CFCPP::CompoundFile_impl(cfsVersion, configFlags)) +{ +} +CompoundFile::CompoundFile(const std::wstring &fileName) : + _impl(new CFCPP::CompoundFile_impl(fileName)) +{ +} +CompoundFile::CompoundFile(Stream stream) : + _impl(new CFCPP::CompoundFile_impl(stream)) +{ +} +std::shared_ptr CompoundFile::RootStorage() +{ + return _impl->RootStorage(); +} +void CompoundFile::Save(std::wstring wFileName) +{ + _impl->Save(wFileName); +} +void CompoundFile::Save(Stream stream) +{ + _impl->Save(stream); +} +void CompoundFile::Commit(bool releaseMemory) +{ + _impl->Commit(releaseMemory); +} +bool CompoundFile::HasSourceStream() const +{ + return _impl->HasSourceStream(); +} +bool CompoundFile::ValidationExceptionEnabled() const +{ + return _impl->ValidationExceptionEnabled(); +} +bool CompoundFile::IsClosed()const +{ + return _impl->IsClosed(); +} +void CompoundFile::Close() +{ + _impl->Close(); +} +std::vector CompoundFile::GetDataBySID(int sid) +{ + return _impl->GetDataBySID(sid); +} +GUID CompoundFile::getGuidBySID(int sid) +{ + return _impl->getGuidBySID(sid); +} +GUID CompoundFile::getGuidForStream(int sid) +{ + return _impl->getGuidForStream(sid); +} +//-------------------------------------------------------------------------------- + +CompoundFile_impl::CompoundFile_impl() : + CompoundFile_impl(CFSVersion::Ver_3, CFSConfiguration::Default) {} -CompoundFile::CompoundFile(const std::wstring &fileName, CFSUpdateMode updateMode, CFSConfiguration configParameters) +CompoundFile_impl::CompoundFile_impl(const std::wstring &fileName, CFSUpdateMode updateMode, CFSConfiguration configParameters) { configuration = configParameters; isValidationExceptionEnabled = !(configParameters & CFSConfiguration::NoValidationException); @@ -63,7 +126,7 @@ CompoundFile::CompoundFile(const std::wstring &fileName, CFSUpdateMode updateMod FAT_SECTOR_ENTRIES_COUNT = (GetSectorSize() / 4); } -CompoundFile::CompoundFile(CFSVersion cfsVersion, CFSConfiguration configFlags) : header(new Header(cfsVersion)) +CompoundFile_impl::CompoundFile_impl(CFSVersion cfsVersion, CFSConfiguration configFlags) : header(new Header(cfsVersion)) { configuration = configFlags; @@ -72,7 +135,7 @@ CompoundFile::CompoundFile(CFSVersion cfsVersion, CFSConfiguration configFlags) if (cfsVersion == CFSVersion::Ver_4) { - Ver3SizeLimitReached action = std::bind(&CompoundFile::OnSizeLimitReached, this); + Ver3SizeLimitReached action = std::bind(&CompoundFile_impl::OnSizeLimitReached, this); sectors.OnVer3SizeLimitReached += action; } @@ -86,7 +149,7 @@ CompoundFile::CompoundFile(CFSVersion cfsVersion, CFSConfiguration configFlags) rootStorage.reset(new CFStorage(this, rootDir)); } -CompoundFile::CompoundFile(const std::wstring &fileName) +CompoundFile_impl::CompoundFile_impl(const std::wstring &fileName) { sectorRecycle = false; updateMode = CFSUpdateMode::ReadOnly; @@ -98,7 +161,7 @@ CompoundFile::CompoundFile(const std::wstring &fileName) FAT_SECTOR_ENTRIES_COUNT = (GetSectorSize() / 4); } -CompoundFile::CompoundFile(Stream stream) +CompoundFile_impl::CompoundFile_impl(Stream stream) { LoadStream(stream); @@ -106,7 +169,7 @@ CompoundFile::CompoundFile(Stream stream) FAT_SECTOR_ENTRIES_COUNT = (GetSectorSize() / 4); } -void CompoundFile::OnSizeLimitReached() +void CompoundFile_impl::OnSizeLimitReached() { std::shared_ptr rangeLockSector(new Sector(GetSectorSize(), sourceStream)); sectors.Add(rangeLockSector); @@ -118,7 +181,7 @@ void CompoundFile::OnSizeLimitReached() } -void CompoundFile::Commit(bool releaseMemory) +void CompoundFile_impl::Commit(bool releaseMemory) { if (isDisposed) throw CFDisposedException("Compound File closed: cannot commit data"); @@ -177,27 +240,27 @@ void CompoundFile::Commit(bool releaseMemory) sourceStream->flush(); } -bool CompoundFile::HasSourceStream() const +bool CompoundFile_impl::HasSourceStream() const { return sourceStream != nullptr; } -bool CompoundFile::ValidationExceptionEnabled() const +bool CompoundFile_impl::ValidationExceptionEnabled() const { return isValidationExceptionEnabled; } -void CompoundFile::Close() +void CompoundFile_impl::Close() { Close(true); } -std::shared_ptr CompoundFile::CreateNewTree() +std::shared_ptr CompoundFile_impl::CreateNewTree() { return std::shared_ptr(new RedBlackTree::RBTree); } -std::shared_ptr CompoundFile::GetChildrenTree(int sid) +std::shared_ptr CompoundFile_impl::GetChildrenTree(int sid) { std::shared_ptr bst(new RedBlackTree::RBTree()); @@ -206,12 +269,12 @@ std::shared_ptr CompoundFile::GetChildrenTree(int sid) return bst; } -bool CompoundFile::IsClosed() const +bool CompoundFile_impl::IsClosed() const { return isDisposed; } -void CompoundFile::Load(Stream stream) +void CompoundFile_impl::Load(Stream stream) { try { @@ -250,7 +313,7 @@ void CompoundFile::Load(Stream stream) } } -void CompoundFile::Save(std::wstring wFileName) +void CompoundFile_impl::Save(std::wstring wFileName) { if (isDisposed) throw CFException("Compound File closed: cannot save data"); @@ -281,7 +344,7 @@ void CompoundFile::Save(std::wstring wFileName) } -void CompoundFile::Save(Stream stream) +void CompoundFile_impl::Save(Stream stream) { if (isDisposed) throw CFDisposedException("Compound File closed: cannot save data"); @@ -322,7 +385,7 @@ void CompoundFile::Save(Stream stream) } } -SVector CompoundFile::GetFatSectorChain() +SVector CompoundFile_impl::GetFatSectorChain() { int N_HEADER_FAT_ENTRY = 109; @@ -410,7 +473,7 @@ SVector CompoundFile::GetFatSectorChain() return result; } -SVector CompoundFile::GetDifatSectorChain() +SVector CompoundFile_impl::GetDifatSectorChain() { int validationCount = 0; @@ -470,7 +533,7 @@ SVector CompoundFile::GetDifatSectorChain() return result; } -SVector CompoundFile::GetNormalSectorChain(int sectorID) +SVector CompoundFile_impl::GetNormalSectorChain(int sectorID) { SVector result; @@ -515,7 +578,7 @@ SVector CompoundFile::GetNormalSectorChain(int sectorID) return result; } -SVector CompoundFile::GetMiniSectorChain(int sectorID) +SVector CompoundFile_impl::GetMiniSectorChain(int sectorID) { SVector result; @@ -561,7 +624,7 @@ SVector CompoundFile::GetMiniSectorChain(int sectorID) return result; } -SVector CompoundFile::GetSectorChain(int sectorID, SectorType chainType) +SVector CompoundFile_impl::GetSectorChain(int sectorID, SectorType chainType) { switch (chainType) { @@ -582,7 +645,7 @@ SVector CompoundFile::GetSectorChain(int sectorID, SectorType chainType) } } -void CompoundFile::EnsureUniqueSectorIndex(int nextSectorID, std::unordered_set& processedSectors) +void CompoundFile_impl::EnsureUniqueSectorIndex(int nextSectorID, std::unordered_set& processedSectors) { if (processedSectors.find(nextSectorID) != processedSectors.end() && this->isValidationExceptionEnabled) { @@ -592,7 +655,7 @@ void CompoundFile::EnsureUniqueSectorIndex(int nextSectorID, std::unordered_set< processedSectors.insert(nextSectorID); } -void CompoundFile::CommitDirectory() +void CompoundFile_impl::CommitDirectory() { const int DIRECTORY_SIZE = 128; @@ -644,25 +707,25 @@ void CompoundFile::CommitDirectory() } } -void CompoundFile::Close(bool closeStream) +void CompoundFile_impl::Close(bool closeStream) { this->closeStream = closeStream; Dispose(closeStream); } -std::shared_ptr CompoundFile::RootEntry() +std::shared_ptr CompoundFile_impl::RootEntry() { if (directoryEntries.empty()) return {}; return directoryEntries[0]; } -std::shared_ptr CompoundFile::RootStorage() +std::shared_ptr CompoundFile_impl::RootStorage() { return rootStorage; } -SVector CompoundFile::FindDirectoryEntries(std::wstring entryName) +SVector CompoundFile_impl::FindDirectoryEntries(std::wstring entryName) { SVector result; @@ -675,7 +738,7 @@ SVector CompoundFile::FindDirectoryEntries(std::wstring entryNa return result; } -std::shared_ptr CompoundFile::DoLoadChildrenTrusted(std::shared_ptr de) +std::shared_ptr CompoundFile_impl::DoLoadChildrenTrusted(std::shared_ptr de) { std::shared_ptr bst; @@ -687,7 +750,7 @@ std::shared_ptr CompoundFile::DoLoadChildrenTrusted(std::s return bst; } -void CompoundFile::DoLoadChildren(std::shared_ptr bst, std::shared_ptr de) +void CompoundFile_impl::DoLoadChildren(std::shared_ptr bst, std::shared_ptr de) { if (de->getChild() != DirectoryEntry::NOSTREAM) { @@ -699,14 +762,14 @@ void CompoundFile::DoLoadChildren(std::shared_ptr bst, std } } -void CompoundFile::NullifyChildNodes(std::shared_ptr de) +void CompoundFile_impl::NullifyChildNodes(std::shared_ptr de) { de->setParent({}); de->setLeft({}); de->setRight({}); } -void CompoundFile::LoadSiblings(std::shared_ptr bst, std::shared_ptr de) +void CompoundFile_impl::LoadSiblings(std::shared_ptr bst, std::shared_ptr de) { levelSIDs.clear(); @@ -722,7 +785,7 @@ void CompoundFile::LoadSiblings(std::shared_ptr bst, std:: } } -void CompoundFile::DoLoadSiblings(std::shared_ptr bst, std::shared_ptr de) +void CompoundFile_impl::DoLoadSiblings(std::shared_ptr bst, std::shared_ptr de) { if (ValidateSibling(de->getLeftSibling())) { @@ -740,7 +803,7 @@ void CompoundFile::DoLoadSiblings(std::shared_ptr bst, std bst->Insert(de); } -bool CompoundFile::ValidateSibling(int sid) +bool CompoundFile_impl::ValidateSibling(int sid) { if (sid != DirectoryEntry::NOSTREAM) { @@ -785,7 +848,7 @@ bool CompoundFile::ValidateSibling(int sid) return false; } -void CompoundFile::LoadDirectories() +void CompoundFile_impl::LoadDirectories() { SVector directoryChain = GetSectorChain(header->firstDirectorySectorID, SectorType::Normal); @@ -808,12 +871,12 @@ void CompoundFile::LoadDirectories() } } -void CompoundFile::FreeMiniChain(SVector §orChain, bool zeroSector) +void CompoundFile_impl::FreeMiniChain(SVector §orChain, bool zeroSector) { FreeMiniChain(sectorChain,0, zeroSector); } -void CompoundFile::FreeMiniChain(SVector §orChain, int nth_sector_to_remove, bool zeroSector) +void CompoundFile_impl::FreeMiniChain(SVector §orChain, int nth_sector_to_remove, bool zeroSector) { std::vector ZEROED_MINI_SECTOR(Sector::MINISECTOR_SIZE, 0); @@ -869,7 +932,7 @@ void CompoundFile::FreeMiniChain(SVector §orChain, int nth_sector_to } } -void CompoundFile::FreeChain(SVector §orChain, int nth_sector_to_remove, bool zeroSector) +void CompoundFile_impl::FreeChain(SVector §orChain, int nth_sector_to_remove, bool zeroSector) { SVector FAT = GetSectorChain(-1, SectorType::FAT); @@ -901,12 +964,12 @@ void CompoundFile::FreeChain(SVector §orChain, int nth_sector_to_rem } } -void CompoundFile::FreeChain(SVector §orChain, bool zeroSector) +void CompoundFile_impl::FreeChain(SVector §orChain, bool zeroSector) { FreeChain(sectorChain, 0, zeroSector); } -void CompoundFile::AllocateSectorChain(SVector §orChain) +void CompoundFile_impl::AllocateSectorChain(SVector §orChain) { for (auto& sector : *sectorChain) { @@ -920,7 +983,7 @@ void CompoundFile::AllocateSectorChain(SVector §orChain) AllocateFATSectorChain(sectorChain); } -void CompoundFile::AllocateFATSectorChain(SVector §orChain) +void CompoundFile_impl::AllocateFATSectorChain(SVector §orChain) { SVector fatSectors = GetSectorChain(-1, SectorType::FAT); @@ -952,7 +1015,7 @@ void CompoundFile::AllocateFATSectorChain(SVector §orChain) AllocateDIFATSectorChain(fatStream.BaseSectorChain()); } -void CompoundFile::AllocateDIFATSectorChain(SVector &FATsectorChain) +void CompoundFile_impl::AllocateDIFATSectorChain(SVector &FATsectorChain) { header->fatSectorsNumber = FATsectorChain.size(); @@ -1084,7 +1147,7 @@ void CompoundFile::AllocateDIFATSectorChain(SVector &FATsectorChain) header->fatSectorsNumber = fatSv.BaseSectorChain().size(); } -void CompoundFile::AllocateMiniSectorChain(SVector §orChain) +void CompoundFile_impl::AllocateMiniSectorChain(SVector §orChain) { SVector miniFAT = GetSectorChain(header->firstMiniFATSectorID, SectorType::Normal); @@ -1146,7 +1209,7 @@ void CompoundFile::AllocateMiniSectorChain(SVector §orChain) } } -void CompoundFile::PersistMiniStreamToStream(const SVector &miniSectorChain) +void CompoundFile_impl::PersistMiniStreamToStream(const SVector &miniSectorChain) { SVector miniStream = GetSectorChain(RootEntry()->getStartSetc(), SectorType::Normal); @@ -1169,12 +1232,12 @@ void CompoundFile::PersistMiniStreamToStream(const SVector &miniSectorCh } } -int CompoundFile::LowSaturation(int x) +int CompoundFile_impl::LowSaturation(int x) { return x > 0 ? x : 0; } -void CompoundFile::SetSectorChain(SVector sectorChain) +void CompoundFile_impl::SetSectorChain(SVector sectorChain) { if (sectorChain != nullptr && sectorChain.size() == 0) return; @@ -1191,17 +1254,17 @@ void CompoundFile::SetSectorChain(SVector sectorChain) } } -CFSVersion CompoundFile::getVersion() const +CFSVersion CompoundFile_impl::getVersion() const { return (CFSVersion)header->majorVersion; } -SVector &CompoundFile::GetDirectories() +SVector &CompoundFile_impl::GetDirectories() { return directoryEntries; } -void CompoundFile::ResetDirectoryEntry(int sid) +void CompoundFile_impl::ResetDirectoryEntry(int sid) { directoryEntries[sid]->SetEntryName(L""); directoryEntries[sid]->setLeft({}); @@ -1217,7 +1280,7 @@ void CompoundFile::ResetDirectoryEntry(int sid) directoryEntries[sid]->setModifyDate(0); } -void CompoundFile::InvalidateDirectoryEntry(int sid) +void CompoundFile_impl::InvalidateDirectoryEntry(int sid) { if (sid >= (int)directoryEntries.size()) throw CFException("Invalid SID of the directory entry to remove"); @@ -1225,7 +1288,7 @@ void CompoundFile::InvalidateDirectoryEntry(int sid) ResetDirectoryEntry(sid); } -void CompoundFile::FreeAssociatedData(int sid) +void CompoundFile_impl::FreeAssociatedData(int sid) { if (directoryEntries[sid]->getSize() > 0) { @@ -1244,7 +1307,7 @@ void CompoundFile::FreeAssociatedData(int sid) } } -void CompoundFile::FreeData(CFStream *stream) +void CompoundFile_impl::FreeData(CFStream *stream) { if (stream == nullptr || stream->size() == 0) return; @@ -1266,22 +1329,22 @@ void CompoundFile::FreeData(CFStream *stream) stream->dirEntry.lock()->setSize(0); } -void CompoundFile::WriteData(std::shared_ptr cfItem, std::streamsize position, const std::vector &buffer) +void CompoundFile_impl::WriteData(std::shared_ptr cfItem, std::streamsize position, const std::vector &buffer) { WriteData(cfItem, buffer, position, 0, buffer.size()); } -void CompoundFile::WriteData(std::shared_ptr cfItem, const std::vector &buffer) +void CompoundFile_impl::WriteData(std::shared_ptr cfItem, const std::vector &buffer) { WriteData(cfItem, 0, buffer); } -void CompoundFile::AppendData(std::shared_ptr cfItem, const std::vector &buffer) +void CompoundFile_impl::AppendData(std::shared_ptr cfItem, const std::vector &buffer) { WriteData(cfItem, cfItem->size(), buffer); } -void CompoundFile::SetStreamLength(std::shared_ptr cfItem, std::streamsize length) +void CompoundFile_impl::SetStreamLength(std::shared_ptr cfItem, std::streamsize length) { if (cfItem->size() == length) return; @@ -1433,7 +1496,7 @@ void CompoundFile::SetStreamLength(std::shared_ptr cfItem, std::streamsi std::array buf; buf.fill(0); - std::streamsize toRead = std::min(length, cfItem->size()); + ULONG64 toRead = (ULONG64)(std::min)((ULONG64)length, cfItem->size()); while (toRead > count) { @@ -1462,7 +1525,7 @@ void CompoundFile::SetStreamLength(std::shared_ptr cfItem, std::streamsi } } -SList CompoundFile::FindFreeSectors(SectorType sType) +SList CompoundFile_impl::FindFreeSectors(SectorType sType) { SList freeList; SList zeroQueue; @@ -1532,7 +1595,7 @@ SList CompoundFile::FindFreeSectors(SectorType sType) return freeList; } -std::vector CompoundFile::GetData(const CFStream *cFStream) +std::vector CompoundFile_impl::GetData(const CFStream *cFStream) { if (isDisposed) throw CFDisposedException("Compound File closed: cannot access data"); @@ -1568,7 +1631,7 @@ std::vector CompoundFile::GetData(const CFStream *cFStream) return result; } -int CompoundFile::ReadData(CFStream *cFStream, std::streamsize position, std::vector &buffer, int count) +int CompoundFile_impl::ReadData(CFStream *cFStream, std::streamsize position, std::vector &buffer, int count) { if (count > (int)buffer.size()) throw std::invalid_argument("count parameter exceeds buffer size"); @@ -1596,7 +1659,7 @@ int CompoundFile::ReadData(CFStream *cFStream, std::streamsize position, std::ve return result; } -int CompoundFile::ReadData(CFStream *cFStream, std::streamsize position, std::vector &buffer, int offset, int count) +int CompoundFile_impl::ReadData(CFStream *cFStream, std::streamsize position, std::vector &buffer, int offset, int count) { auto de = cFStream->dirEntry.lock(); @@ -1621,7 +1684,7 @@ int CompoundFile::ReadData(CFStream *cFStream, std::streamsize position, std::ve return result; } -std::vector CompoundFile::GetDataBySID(int sid) +std::vector CompoundFile_impl::GetDataBySID(int sid) { if (isDisposed) throw CFDisposedException("Compound File closed: cannot access data"); @@ -1654,7 +1717,7 @@ std::vector CompoundFile::GetDataBySID(int sid) return result; } -GUID CompoundFile::getGuidBySID(int sid) +GUID CompoundFile_impl::getGuidBySID(int sid) { if (isDisposed) throw CFDisposedException("Compound File closed: cannot access data"); @@ -1664,7 +1727,7 @@ GUID CompoundFile::getGuidBySID(int sid) return de->getStorageCLSID(); } -GUID CompoundFile::getGuidForStream(int sid) +GUID CompoundFile_impl::getGuidForStream(int sid) { if (isDisposed) throw CFDisposedException("Compound File closed: cannot access data"); @@ -1684,7 +1747,7 @@ GUID CompoundFile::getGuidForStream(int sid) return guid; } -void CompoundFile::WriteData(std::shared_ptr cfItem, const char* data, std::streamsize position, int count) +void CompoundFile_impl::WriteData(std::shared_ptr cfItem, const char* data, std::streamsize position, int count) { if (data == nullptr) throw CFInvalidOperation("Parameter [data] cannot be null"); @@ -1721,17 +1784,17 @@ void CompoundFile::WriteData(std::shared_ptr cfItem, const char* data, s } } -void CompoundFile::WriteData(std::shared_ptr cfItem, const std::vector &buffer, std::streamsize position, int offset, int count) +void CompoundFile_impl::WriteData(std::shared_ptr cfItem, const std::vector &buffer, std::streamsize position, int offset, int count) { WriteData(cfItem, reinterpret_cast(buffer.data() + offset), position, count); } -int CompoundFile::GetSectorSize() +int CompoundFile_impl::GetSectorSize() { return 2 << (header->sectorShift - 1); } -void CompoundFile::Dispose(bool disposing) +void CompoundFile_impl::Dispose(bool disposing) { try { @@ -1762,7 +1825,7 @@ void CompoundFile::Dispose(bool disposing) } } -void CompoundFile::CheckForLockSector() +void CompoundFile_impl::CheckForLockSector() { if (transactionLockAdded && !isTransactionLockAllocated) { @@ -1776,7 +1839,7 @@ void CompoundFile::CheckForLockSector() } } -void CompoundFile::LoadFile(std::wstring fileName) +void CompoundFile_impl::LoadFile(std::wstring fileName) { SetFileName(fileName); Stream fs; @@ -1796,7 +1859,7 @@ void CompoundFile::LoadFile(std::wstring fileName) } } -void CompoundFile::SetFileName(std::wstring fileName) +void CompoundFile_impl::SetFileName(std::wstring fileName) { BYTE* pUtf8 = NULL; LONG lLen = 0; @@ -1805,7 +1868,7 @@ void CompoundFile::SetFileName(std::wstring fileName) delete [] pUtf8; } -void CompoundFile::LoadStream(Stream stream) +void CompoundFile_impl::LoadStream(Stream stream) { if (stream.get() == nullptr) throw CFException("Stream parameter cannot be null"); diff --git a/Common/cfcpp/compoundfile.h b/Common/cfcpp/compoundfile.h index 4f7237940b..17d44f0f80 100644 --- a/Common/cfcpp/compoundfile.h +++ b/Common/cfcpp/compoundfile.h @@ -31,18 +31,10 @@ */ #pragma once -#include "sectorcollection.h" #include "cfstorage.h" -#include "slist.h" -#include -#include "RBTree/rbtree.h" -#include "idirectoryentry.h" -#include -#include "header.h" namespace CFCPP { -class DirectoryEntry; enum CFSConfiguration { @@ -59,6 +51,7 @@ enum CFSUpdateMode Update }; +class CompoundFile_impl; class CompoundFile { public: @@ -68,14 +61,13 @@ public: CompoundFile(Stream stream); CompoundFile(); + ~CompoundFile(); - // Main methods std::shared_ptr RootStorage(); void Save(std::wstring wFileName); void Save(Stream stream); - void Commit(bool releaseMemory = false); bool HasSourceStream() const; bool ValidationExceptionEnabled() const; @@ -86,103 +78,7 @@ public: GUID getGuidBySID(int sid); GUID getGuidForStream(int sid); - // internal methods - static std::shared_ptr CreateNewTree(); - std::shared_ptr GetChildrenTree(int sid); - SVector &GetDirectories(); - void ResetDirectoryEntry(int sid); - void InvalidateDirectoryEntry(int sid); - void FreeAssociatedData(int sid); - void FreeData(CFStream* stream); - void WriteData(std::shared_ptr cfItem, const char* data, std::streamsize position, int count); - void WriteData(std::shared_ptr cfItem, const std::vector& buffer, std::streamsize position, int offset, int count); - void WriteData(std::shared_ptr cfItem, std::streamsize position, const std::vector& buffer); - void WriteData(std::shared_ptr cfItem, const std::vector& buffer); - void AppendData(std::shared_ptr cfItem, const std::vector& buffer); - void SetStreamLength(std::shared_ptr cfItem, std::streamsize length); - SList FindFreeSectors(SectorType sType); - std::vector GetData(const CFStream *cFStream); - int ReadData(CFStream* cFStream, std::streamsize position, std::vector& buffer, int count); - int ReadData(CFStream* cFStream, std::streamsize position, std::vector& buffer, int offset, int count); - -protected: - int GetSectorSize(); - void Dispose(bool disposing); - private: - void CheckForLockSector(); - void OnSizeLimitReached(); - void LoadFile(std::wstring fileName); - void SetFileName(std::wstring fileName); - void LoadStream(Stream stream); - void Load(Stream stream); - - SVector GetFatSectorChain(); - SVector GetDifatSectorChain(); - SVector GetNormalSectorChain(int sectorID); - SVector GetMiniSectorChain(int sectorID); - SVector GetSectorChain(int sectorID, SectorType chainType); - void EnsureUniqueSectorIndex(int nextsectorID, std::unordered_set &processedSectors); - void CommitDirectory(); - void Close(bool closeStream); - - std::shared_ptr RootEntry(); - SVector FindDirectoryEntries(std::wstring entryName); - - std::shared_ptr DoLoadChildrenTrusted(std::shared_ptr de); - void DoLoadChildren(std::shared_ptr bst, std::shared_ptr de); - void NullifyChildNodes(std::shared_ptr de); - void LoadSiblings(std::shared_ptr bst, std::shared_ptr de); - void DoLoadSiblings(std::shared_ptr bst, std::shared_ptr de); - bool ValidateSibling(int sid); - void LoadDirectories(); - - void FreeMiniChain(SVector& sectorChain, bool zeroSector); - void FreeMiniChain(SVector& sectorChain, int nth_sector_to_remove, bool zeroSector); - void FreeChain(SVector& sectorChain, int nth_sector_to_remove, bool zeroSector); - void FreeChain(SVector& sectorChain, bool zeroSector); - - void AllocateSectorChain(SVector& sectorChain); - void AllocateFATSectorChain(SVector& sectorChain); - void AllocateDIFATSectorChain(SVector& FATsectorChain); - void AllocateMiniSectorChain(SVector& sectorChain); - void PersistMiniStreamToStream(const SVector& miniSectorChain); - static int LowSaturation(int x); - void SetSectorChain(SVector sectorChain); - - CFSVersion getVersion() const; - -public: - CFSConfiguration configuration = Default; - std::unique_ptr
header; - Stream sourceStream; - -private: - const int HEADER_DIFAT_ENTRIES_COUNT = 109; - int DIFAT_SECTOR_FAT_ENTRIES_COUNT = 127; - int FAT_SECTOR_ENTRIES_COUNT = 128; - const int SIZE_OF_SID = 4; - bool sectorRecycle = false; - bool eraseFreeSectors = false; - static constexpr int FLUSHING_QUEUE_SIZE = 6000; - static constexpr int FLUSHING_BUFFER_MAX_SIZE = 1024 * 1024 * 16; - - - SectorCollection sectors; - std::fstream stream; - std::string fileName; - std::shared_ptr rootStorage; - - bool closeStream = true; - bool transactionLockAdded = false; - int lockSectorId = -1; - bool isTransactionLockAllocated = false; - bool isValidationExceptionEnabled = true; - bool isDisposed = false; - - CFSUpdateMode updateMode; - SVector directoryEntries; - std::list levelSIDs; - std::mutex lockObject; + std::shared_ptr _impl; }; } diff --git a/Common/cfcpp/compoundfile_impl.h b/Common/cfcpp/compoundfile_impl.h new file mode 100644 index 0000000000..a71d6e020d --- /dev/null +++ b/Common/cfcpp/compoundfile_impl.h @@ -0,0 +1,173 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2019 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ +#pragma once + +#include "compoundfile.h" +#include "sectorcollection.h" +#include "cfstorage.h" +#include "slist.h" +#include +#include "RBTree/rbtree.h" +#include "idirectoryentry.h" +#include +#include "header.h" + +namespace CFCPP +{ +class DirectoryEntry; + +class CompoundFile_impl +{ +public: + CompoundFile_impl(const std::wstring &fileName, CFSUpdateMode updateMode, CFSConfiguration configParameters = Default); + CompoundFile_impl(CFSVersion cfsVersion, CFSConfiguration configFlags); + CompoundFile_impl(const std::wstring &fileName); + CompoundFile_impl(Stream stream); + CompoundFile_impl(); + + // Main methods + std::shared_ptr RootStorage(); + + void Save(std::wstring wFileName); + void Save(Stream stream); + + + void Commit(bool releaseMemory = false); + bool HasSourceStream() const; + bool ValidationExceptionEnabled() const; + bool IsClosed()const; + void Close(); + + std::vector GetDataBySID(int sid); + GUID getGuidBySID(int sid); + GUID getGuidForStream(int sid); + + // internal methods + static std::shared_ptr CreateNewTree(); + std::shared_ptr GetChildrenTree(int sid); + SVector &GetDirectories(); + void ResetDirectoryEntry(int sid); + void InvalidateDirectoryEntry(int sid); + void FreeAssociatedData(int sid); + void FreeData(CFStream* stream); + void WriteData(std::shared_ptr cfItem, const char* data, std::streamsize position, int count); + void WriteData(std::shared_ptr cfItem, const std::vector& buffer, std::streamsize position, int offset, int count); + void WriteData(std::shared_ptr cfItem, std::streamsize position, const std::vector& buffer); + void WriteData(std::shared_ptr cfItem, const std::vector& buffer); + void AppendData(std::shared_ptr cfItem, const std::vector& buffer); + void SetStreamLength(std::shared_ptr cfItem, std::streamsize length); + SList FindFreeSectors(SectorType sType); + std::vector GetData(const CFStream *cFStream); + int ReadData(CFStream* cFStream, std::streamsize position, std::vector& buffer, int count); + int ReadData(CFStream* cFStream, std::streamsize position, std::vector& buffer, int offset, int count); + +protected: + int GetSectorSize(); + void Dispose(bool disposing); + +private: + void CheckForLockSector(); + void OnSizeLimitReached(); + void LoadFile(std::wstring fileName); + void SetFileName(std::wstring fileName); + void LoadStream(Stream stream); + void Load(Stream stream); + + SVector GetFatSectorChain(); + SVector GetDifatSectorChain(); + SVector GetNormalSectorChain(int sectorID); + SVector GetMiniSectorChain(int sectorID); + SVector GetSectorChain(int sectorID, SectorType chainType); + void EnsureUniqueSectorIndex(int nextsectorID, std::unordered_set &processedSectors); + void CommitDirectory(); + void Close(bool closeStream); + + std::shared_ptr RootEntry(); + SVector FindDirectoryEntries(std::wstring entryName); + + std::shared_ptr DoLoadChildrenTrusted(std::shared_ptr de); + void DoLoadChildren(std::shared_ptr bst, std::shared_ptr de); + void NullifyChildNodes(std::shared_ptr de); + void LoadSiblings(std::shared_ptr bst, std::shared_ptr de); + void DoLoadSiblings(std::shared_ptr bst, std::shared_ptr de); + bool ValidateSibling(int sid); + void LoadDirectories(); + + void FreeMiniChain(SVector& sectorChain, bool zeroSector); + void FreeMiniChain(SVector& sectorChain, int nth_sector_to_remove, bool zeroSector); + void FreeChain(SVector& sectorChain, int nth_sector_to_remove, bool zeroSector); + void FreeChain(SVector& sectorChain, bool zeroSector); + + void AllocateSectorChain(SVector& sectorChain); + void AllocateFATSectorChain(SVector& sectorChain); + void AllocateDIFATSectorChain(SVector& FATsectorChain); + void AllocateMiniSectorChain(SVector& sectorChain); + void PersistMiniStreamToStream(const SVector& miniSectorChain); + static int LowSaturation(int x); + void SetSectorChain(SVector sectorChain); + + CFSVersion getVersion() const; + +public: + CFSConfiguration configuration = Default; + std::unique_ptr
header; + Stream sourceStream; + +private: + const int HEADER_DIFAT_ENTRIES_COUNT = 109; + int DIFAT_SECTOR_FAT_ENTRIES_COUNT = 127; + int FAT_SECTOR_ENTRIES_COUNT = 128; + const int SIZE_OF_SID = 4; + bool sectorRecycle = false; + bool eraseFreeSectors = false; + static constexpr int FLUSHING_QUEUE_SIZE = 6000; + static constexpr int FLUSHING_BUFFER_MAX_SIZE = 1024 * 1024 * 16; + + + SectorCollection sectors; + std::fstream stream; + std::string fileName; + std::shared_ptr rootStorage; + + bool closeStream = true; + bool transactionLockAdded = false; + int lockSectorId = -1; + bool isTransactionLockAllocated = false; + bool isValidationExceptionEnabled = true; + bool isDisposed = false; + + CFSUpdateMode updateMode; + SVector directoryEntries; + std::list levelSIDs; + std::mutex lockObject; +}; +} diff --git a/Common/cfcpp/stream.h b/Common/cfcpp/stream.h index aac0561e27..b308be4f20 100644 --- a/Common/cfcpp/stream.h +++ b/Common/cfcpp/stream.h @@ -40,59 +40,58 @@ namespace CFCPP { -class IStream -{ -public: - virtual std::streamsize tell() = 0; - virtual std::streamsize seek(std::streamsize offset, std::ios_base::seekdir mode = std::ios::beg) = 0; - virtual std::streamsize read(char* buffer, std::streamsize len) = 0; - virtual void write (const char* buffer, std::streamsize len) = 0; - virtual void flush() = 0; - virtual void close() = 0; -}; + class IStream + { + public: + virtual std::streamsize tell() = 0; + virtual std::streamsize seek(std::streamsize offset, std::ios_base::seekdir mode = std::ios::beg) = 0; + virtual std::streamsize read(char* buffer, std::streamsize len) = 0; + virtual void write (const char* buffer, std::streamsize len) = 0; + virtual void flush() = 0; + virtual void close() = 0; + }; -using Stream = std::shared_ptr; + using Stream = std::shared_ptr; -class FStreamWrapper : public IStream, public std::fstream -{ -public: - FStreamWrapper(std::string filename, std::ios_base::openmode openmode) : - std::fstream(filename, openmode) {} + class FStreamWrapper : public IStream, public std::fstream + { + public: + FStreamWrapper(std::string filename, std::ios_base::openmode openmode) : + std::fstream(filename, openmode) {} - inline std::streamsize tell() override { - return std::fstream::tellg(); - } - inline std::streamsize seek(std::streamsize offset, std::ios_base::seekdir mode = std::ios::beg) override { - std::fstream::seekp(offset, mode); - std::fstream::seekg(offset, mode); - return tell(); - } - inline std::streamsize read(char* buffer, std::streamsize len) override { - std::fstream::read(buffer, len); - return tell(); - } - inline void write (const char* buffer, std::streamsize len) override { - std::fstream::write(buffer, len); - } - inline void flush() override { - std::fstream::flush(); - } - inline void close() override { - std::fstream::close(); - } -}; + inline std::streamsize tell() override { + return std::fstream::tellg(); + } + inline std::streamsize seek(std::streamsize offset, std::ios_base::seekdir mode = std::ios::beg) override { + std::fstream::seekp(offset, mode); + std::fstream::seekg(offset, mode); + return tell(); + } + inline std::streamsize read(char* buffer, std::streamsize len) override { + std::fstream::read(buffer, len); + return tell(); + } + inline void write (const char* buffer, std::streamsize len) override { + std::fstream::write(buffer, len); + } + inline void flush() override { + std::fstream::flush(); + } + inline void close() override { + std::fstream::close(); + } + }; + std::string CorrectUnixPath(const std::string original); -std::string CorrectUnixPath(const std::string original); + Stream OpenFileStream(std::wstring filename, bool bRewrite = false, bool trunc = false); + Stream OpenFileStream(std::string filename, bool bRewrite = false, bool trunc = false); -Stream OpenFileStream(std::wstring filename, bool bRewrite = false, bool trunc = false); -Stream OpenFileStream(std::string filename, bool bRewrite = false, bool trunc = false); + bool IsOpen(const Stream& st); + std::streamsize Length(const Stream& st); + int FileLenght(std::wstring filename); -bool IsOpen(const Stream& st); -std::streamsize Length(const Stream& st); -int FileLenght(std::wstring filename); - -ULONG64 FileFNVHash(std::wstring filename, int len = -1, int offset = 0); + ULONG64 FileFNVHash(std::wstring filename, int len = -1, int offset = 0); } diff --git a/OfficeCryptReader/source/ECMACryptFile.cpp b/OfficeCryptReader/source/ECMACryptFile.cpp index 82db43dfe9..035034a126 100644 --- a/OfficeCryptReader/source/ECMACryptFile.cpp +++ b/OfficeCryptReader/source/ECMACryptFile.cpp @@ -42,6 +42,7 @@ #include "../../ASCOfficeDocFile/DocDocxConverter/MemoryStream.h" #include "simple_xml_writer.h" +#include "../../Common/cfcpp/compoundfile.h" //CRYPT::_ecmaCryptData cryptDataGlobal; for Test diff --git a/X2tConverter/build/Qt/X2tConverter.pri b/X2tConverter/build/Qt/X2tConverter.pri index b76a715ebe..783e021154 100755 --- a/X2tConverter/build/Qt/X2tConverter.pri +++ b/X2tConverter/build/Qt/X2tConverter.pri @@ -94,6 +94,8 @@ LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPPTXFormatLib LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lDocxFormatLib #xlsbformat LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lXlsbFormatLib +#cf +LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lCompaundLib #Crypto++ LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lCryptoPPLib diff --git a/X2tConverter/build/Qt/X2tSLN.pri b/X2tConverter/build/Qt/X2tSLN.pri index 5e4b558cc0..ac58c0d2e7 100644 --- a/X2tConverter/build/Qt/X2tSLN.pri +++ b/X2tConverter/build/Qt/X2tSLN.pri @@ -18,11 +18,7 @@ SUBDIRS = \ OdfFileReaderLib \ OdfFileWriterLib \ XlsFormatLib \ - kernel \ - HtmlFile2 \ - EpubFile \ - XpsFile \ - doctrenderer \ + CompaundLib \ X2tConverter XlsbFormatLib.file = ../../../Common/DocxFormat/DocxFormatLib/XlsbFormatLib.pro @@ -37,11 +33,7 @@ OdfFileReaderLib.file = ../../../ASCOfficeOdfFile/linux/OdfFileReaderLib.pro OdfFileWriterLib.file = ../../../ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro XlsFormatLib.file = ../../../ASCOfficeXlsFile2/source/linux/XlsFormatLib.pro VbaFormatLib.file = ../../../ASCOfficeXlsFile2/source/linux/VbaFormatLib.pro -HtmlFile2.file = ../../../HtmlFile2/HtmlFile2.pro -EpubFile.file = ../../../EpubFile/CEpubFile.pro -XpsFile.file = ../../../XpsFile/XpsFile.pro -kernel.file = ../../../Common/kernel.pro -doctrenderer.file = ../../../DesktopEditor/doctrenderer/doctrenderer.pro +CompaundLib.file = ../../../Common/cfcpp/cfcpp.pro X2tConverter.depends = \ XlsbFormatLib \ @@ -56,11 +48,7 @@ X2tConverter.depends = \ OdfFileWriterLib \ VbaFormatLib \ XlsFormatLib \ - kernel.pro \ - HtmlFile2 \ - EpubFile \ - XpsFile \ - doctrenderer + CompaundLib # build the project sequentially as listed in SUBDIRS ! CONFIG += ordered