Commit 4e8097c9 authored by Sergey Konovalov's avatar Sergey Konovalov

pivotButton; AddNoWrite defDir

parent 65254b57
...@@ -110,10 +110,15 @@ namespace OOX ...@@ -110,10 +110,15 @@ namespace OOX
OOX::CPath oName = pFile->DefaultFileName(); OOX::CPath oName = pFile->DefaultFileName();
if(false == pFile->m_sOutputFilename.empty()) if(false == pFile->m_sOutputFilename.empty())
oName.SetName(pFile->m_sOutputFilename, false); oName.SetName(pFile->m_sOutputFilename, false);
if(m_mNoWriteContainer.end() == m_mNoWriteContainer.find(pPair->first)) std::map<std::wstring, std::wstring>::const_iterator itFind = m_mNoWriteContainer.find(pPair->first);
if(m_mNoWriteContainer.end() == itFind)
{ {
OOX::CSystemUtility::CreateDirectories( oCurrent / oDefDir ); OOX::CSystemUtility::CreateDirectories( oCurrent / oDefDir );
pFile->write( oCurrent / oDefDir / oName, oDir / oDefDir, oContent ); pFile->write( oCurrent / oDefDir / oName, oDir / oDefDir, oContent );
}
else if(itFind->second.length() > 0)
{
oDefDir = itFind->second;
} }
if(true != pFile->m_bDoNotAddRels) if(true != pFile->m_bDoNotAddRels)
{ {
...@@ -189,7 +194,8 @@ namespace OOX ...@@ -189,7 +194,8 @@ namespace OOX
mNamepair [oName.m_strFilename] = 1; mNamepair [oName.m_strFilename] = 1;
else else
oName = oName + pNamePair->first; oName = oName + pNamePair->first;
if(m_mNoWriteContainer.end() == m_mNoWriteContainer.find(it->first)) std::map<std::wstring, std::wstring>::const_iterator itFind = m_mNoWriteContainer.find(it->first);
if(m_mNoWriteContainer.end() == itFind)
{ {
OOX::CSystemUtility::CreateDirectories( oCurrent / oDefDir ); OOX::CSystemUtility::CreateDirectories( oCurrent / oDefDir );
smart_ptr<OOX::IFileBuilder> pFileBuilder = pFile.smart_dynamic_cast<OOX::IFileBuilder>(); smart_ptr<OOX::IFileBuilder> pFileBuilder = pFile.smart_dynamic_cast<OOX::IFileBuilder>();
...@@ -202,6 +208,10 @@ namespace OOX ...@@ -202,6 +208,10 @@ namespace OOX
pFile->write( oCurrent / oDefDir / oName, oDir / oDefDir, oContent ); pFile->write( oCurrent / oDefDir / oName, oDir / oDefDir, oContent );
} }
} }
else if(itFind->second.length() > 0)
{
oDefDir = itFind->second;
}
oRels.Registration( it->first, pFile->type(), oDefDir / oName ); oRels.Registration( it->first, pFile->type(), oDefDir / oName );
} }
...@@ -390,18 +400,18 @@ namespace OOX ...@@ -390,18 +400,18 @@ namespace OOX
m_mContainer [rId.get()] = pFile; m_mContainer [rId.get()] = pFile;
} }
const RId IFileContainer::AddNoWrite(const smart_ptr<OOX::File>& pFile) const RId IFileContainer::AddNoWrite(const smart_ptr<OOX::File>& pFile, const std::wstring& oDefDir)
{ {
const RId rId = GetMaxRId().next(); const RId rId = GetMaxRId().next();
AddNoWrite( rId, pFile ); AddNoWrite( rId, pFile, oDefDir );
return rId; return rId;
} }
void IFileContainer::AddNoWrite (const OOX::RId& rId, const smart_ptr<OOX::File>& pFile) void IFileContainer::AddNoWrite (const OOX::RId& rId, const smart_ptr<OOX::File>& pFile, const std::wstring& oDefDir)
{ {
m_lMaxRid = (std::max)( m_lMaxRid, rId.getNumber() ); m_lMaxRid = (std::max)( m_lMaxRid, rId.getNumber() );
m_mContainer [rId.get()] = pFile; m_mContainer [rId.get()] = pFile;
m_mNoWriteContainer[rId.get()] = true; m_mNoWriteContainer[rId.get()] = oDefDir;
} }
smart_ptr<OOX::File> IFileContainer::Find(const FileType& oType) const smart_ptr<OOX::File> IFileContainer::Find(const FileType& oType) const
......
...@@ -67,7 +67,7 @@ namespace OOX ...@@ -67,7 +67,7 @@ namespace OOX
static std::map<std::wstring, size_t> m_mapEnumeratedGlobal; static std::map<std::wstring, size_t> m_mapEnumeratedGlobal;
protected: protected:
std::map<std::wstring, smart_ptr<OOX::File>> m_mContainer; std::map<std::wstring, smart_ptr<OOX::File>> m_mContainer;
std::map<std::wstring, bool> m_mNoWriteContainer; std::map<std::wstring, std::wstring> m_mNoWriteContainer;
size_t m_lMaxRid; size_t m_lMaxRid;
void Read (const OOX::CRels& oRels, const OOX::CPath& oRootPath, const CPath& oPath); void Read (const OOX::CRels& oRels, const OOX::CPath& oRootPath, const CPath& oPath);
...@@ -104,8 +104,8 @@ namespace OOX ...@@ -104,8 +104,8 @@ namespace OOX
const RId Add(smart_ptr<OOX::File>& pFile); const RId Add(smart_ptr<OOX::File>& pFile);
void Add(const OOX::RId& rId, smart_ptr<OOX::File>& pFile); void Add(const OOX::RId& rId, smart_ptr<OOX::File>& pFile);
const RId AddNoWrite(const smart_ptr<OOX::File>& pFile); const RId AddNoWrite(const smart_ptr<OOX::File>& pFile, const std::wstring& oDefDir);
void AddNoWrite(const OOX::RId& rId, const smart_ptr<OOX::File>& pFile); void AddNoWrite(const OOX::RId& rId, const smart_ptr<OOX::File>& pFile, const std::wstring& oDefDir);
template<typename T> template<typename T>
T& Find(); T& Find();
......
...@@ -198,6 +198,7 @@ namespace OOX ...@@ -198,6 +198,7 @@ namespace OOX
WritingStringNullableAttrBool(L"applyBorder", m_oApplyBorder); WritingStringNullableAttrBool(L"applyBorder", m_oApplyBorder);
WritingStringNullableAttrBool(L"applyAlignment", m_oApplyAlignment); WritingStringNullableAttrBool(L"applyAlignment", m_oApplyAlignment);
WritingStringNullableAttrBool(L"quotePrefix", m_oQuotePrefix); WritingStringNullableAttrBool(L"quotePrefix", m_oQuotePrefix);
WritingStringNullableAttrBool(L"pivotButton", m_oPivotButton);
if(m_oAligment.IsInit()) if(m_oAligment.IsInit())
{ {
writer.WriteString(_T(">")); writer.WriteString(_T(">"));
......
...@@ -863,6 +863,13 @@ namespace BinXlsxRW ...@@ -863,6 +863,13 @@ namespace BinXlsxRW
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte); m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(xfs.m_oQuotePrefix->ToBool()); m_oBcw.m_oStream.WriteBOOL(xfs.m_oQuotePrefix->ToBool());
} }
//PivotButton
if(false != xfs.m_oPivotButton.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerXfsTypes::PivotButton);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(xfs.m_oPivotButton->ToBool());
}
//XfId //XfId
if (false != xfs.m_oXfId.IsInit()) if (false != xfs.m_oXfId.IsInit())
{ {
......
...@@ -1233,6 +1233,11 @@ namespace BinXlsxRW { ...@@ -1233,6 +1233,11 @@ namespace BinXlsxRW {
pXfs->m_oQuotePrefix.Init(); pXfs->m_oQuotePrefix.Init();
pXfs->m_oQuotePrefix->SetValue(false != m_oBufferedStream.GetBool() ? SimpleTypes::onoffTrue : SimpleTypes::onoffFalse); pXfs->m_oQuotePrefix->SetValue(false != m_oBufferedStream.GetBool() ? SimpleTypes::onoffTrue : SimpleTypes::onoffFalse);
} }
else if(c_oSerXfsTypes::PivotButton == type)
{
pXfs->m_oPivotButton.Init();
pXfs->m_oPivotButton->SetValue(false != m_oBufferedStream.GetBool() ? SimpleTypes::onoffTrue : SimpleTypes::onoffFalse);
}
else if(c_oSerXfsTypes::Aligment == type) else if(c_oSerXfsTypes::Aligment == type)
{ {
pXfs->m_oAligment.Init(); pXfs->m_oAligment.Init();
...@@ -2208,7 +2213,7 @@ namespace BinXlsxRW { ...@@ -2208,7 +2213,7 @@ namespace BinXlsxRW {
if(m_mapPivotCacheDefinitions.end() != pair && NULL != oPivotCachesTemp.pTable) if(m_mapPivotCacheDefinitions.end() != pair && NULL != oPivotCachesTemp.pTable)
{ {
NSCommon::smart_ptr<OOX::File> pFileTable(oPivotCachesTemp.pTable); NSCommon::smart_ptr<OOX::File> pFileTable(oPivotCachesTemp.pTable);
oPivotCachesTemp.pTable->AddNoWrite(pair->second); oPivotCachesTemp.pTable->AddNoWrite(pair->second, L"../pivotCache");
m_pCurWorksheet->Add(pFileTable); m_pCurWorksheet->Add(pFileTable);
} }
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment