mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-11 02:16:02 +08:00
Compare commits
7 Commits
core-windo
...
core/devel
| Author | SHA1 | Date | |
|---|---|---|---|
| a17a04298a | |||
| f7ba686f0c | |||
| c41385e1ae | |||
| f582a9b690 | |||
| b36c2dbaf9 | |||
| 10b9e9e5e8 | |||
| 1beb5440f9 |
@ -3801,19 +3801,228 @@ public:
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
CFldSimple* pFldSimple = static_cast<CFldSimple*>(poResult);
|
||||
if ( c_oSer_HyperlinkType::Link == type )
|
||||
if ( c_oSer_FldSimpleType::Instr == type )
|
||||
pFldSimple->sInstr = m_oBufferedStream.GetString3(length);
|
||||
else if ( c_oSer_HyperlinkType::Content == type )
|
||||
else if ( c_oSer_FldSimpleType::Content == type )
|
||||
{
|
||||
XmlUtils::CStringWriter* pPrevWriter = m_pCurWriter;
|
||||
m_pCurWriter = &pFldSimple->writer;
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadParagraphContent, this, NULL);
|
||||
m_pCurWriter = pPrevWriter;
|
||||
}
|
||||
else if ( c_oSer_FldSimpleType::FFData == type )
|
||||
{
|
||||
OOX::Logic::CFFData oFFData;
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadFFData, this, &oFFData);
|
||||
pFldSimple->writer.WriteString(oFFData.toXML());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadFFData(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
OOX::Logic::CFFData* pFFData = static_cast<OOX::Logic::CFFData*>(poResult);
|
||||
if ( c_oSerFFData::CalcOnExit == type )
|
||||
{
|
||||
pFFData->m_oCalcOnExit.Init();
|
||||
pFFData->m_oCalcOnExit->m_oVal.FromBool(m_oBufferedStream.GetBool());
|
||||
}
|
||||
else if ( c_oSerFFData::CheckBox == type )
|
||||
{
|
||||
pFFData->m_oCheckBox.Init();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadFFCheckBox, this, pFFData->m_oCheckBox.GetPointer());
|
||||
}
|
||||
else if ( c_oSerFFData::DDList == type )
|
||||
{
|
||||
pFFData->m_oDDList.Init();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadDDList, this, pFFData->m_oDDList.GetPointer());
|
||||
}
|
||||
else if ( c_oSerFFData::Enabled == type )
|
||||
{
|
||||
pFFData->m_oEnabled.Init();
|
||||
pFFData->m_oEnabled->m_oVal.FromBool(m_oBufferedStream.GetBool());
|
||||
}
|
||||
else if ( c_oSerFFData::EntryMacro == type )
|
||||
{
|
||||
std::wstring sVal = m_oBufferedStream.GetString3(length);
|
||||
pFFData->m_oEntryMacro.Init();
|
||||
pFFData->m_oEntryMacro->m_oVal.Init();
|
||||
pFFData->m_oEntryMacro->m_oVal->SetValue(sVal);
|
||||
}
|
||||
else if ( c_oSerFFData::ExitMacro == type )
|
||||
{
|
||||
std::wstring sVal = m_oBufferedStream.GetString3(length);
|
||||
pFFData->m_oExitMacro.Init();
|
||||
pFFData->m_oExitMacro->m_oVal.Init();
|
||||
pFFData->m_oExitMacro->m_oVal->SetValue(sVal);
|
||||
}
|
||||
else if ( c_oSerFFData::HelpText == type )
|
||||
{
|
||||
pFFData->m_oHelpText.Init();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadFFHelpText, this, pFFData->m_oHelpText.GetPointer());
|
||||
}
|
||||
else if ( c_oSerFFData::Label == type )
|
||||
{
|
||||
pFFData->m_oLabel.Init();
|
||||
pFFData->m_oLabel->m_oVal.Init();
|
||||
pFFData->m_oLabel->m_oVal->SetValue(m_oBufferedStream.GetLong());
|
||||
}
|
||||
else if ( c_oSerFFData::Name == type )
|
||||
{
|
||||
std::wstring sVal = m_oBufferedStream.GetString3(length);
|
||||
pFFData->m_oName.Init();
|
||||
pFFData->m_oName->m_oVal.Init();
|
||||
pFFData->m_oName->m_oVal->SetValue(sVal);
|
||||
}
|
||||
else if ( c_oSerFFData::StatusText == type )
|
||||
{
|
||||
pFFData->m_oStatusText.Init();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadFFStatusText, this, pFFData->m_oStatusText.GetPointer());
|
||||
}
|
||||
else if ( c_oSerFFData::TabIndex == type )
|
||||
{
|
||||
pFFData->m_oTabIndex.Init();
|
||||
pFFData->m_oTabIndex->m_oVal.Init();
|
||||
pFFData->m_oTabIndex->m_oVal->SetValue(m_oBufferedStream.GetLong());
|
||||
}
|
||||
else if ( c_oSerFFData::TextInput == type )
|
||||
{
|
||||
pFFData->m_oTextInput.Init();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadTextInput, this, pFFData->m_oTextInput.GetPointer());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadFFCheckBox(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
OOX::Logic::CFFCheckBox* pFFCheckBox = static_cast<OOX::Logic::CFFCheckBox*>(poResult);
|
||||
if ( c_oSerFFData::CBChecked == type )
|
||||
{
|
||||
pFFCheckBox->m_oChecked.Init();
|
||||
pFFCheckBox->m_oChecked->m_oVal.FromBool(m_oBufferedStream.GetBool());
|
||||
}
|
||||
else if ( c_oSerFFData::CBDefault == type )
|
||||
{
|
||||
pFFCheckBox->m_oDefault.Init();
|
||||
pFFCheckBox->m_oDefault->m_oVal.FromBool(m_oBufferedStream.GetBool());
|
||||
}
|
||||
else if ( c_oSerFFData::CBSize == type )
|
||||
{
|
||||
pFFCheckBox->m_oSize.Init();
|
||||
pFFCheckBox->m_oSize->m_oVal.Init();
|
||||
pFFCheckBox->m_oSize->m_oVal->FromHps(m_oBufferedStream.GetULong());
|
||||
}
|
||||
else if ( c_oSerFFData::CBSizeAuto == type )
|
||||
{
|
||||
pFFCheckBox->m_oSizeAuto.Init();
|
||||
pFFCheckBox->m_oSizeAuto->m_oVal.FromBool(m_oBufferedStream.GetBool());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadDDList(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
OOX::Logic::CFFDDList* pDDList = static_cast<OOX::Logic::CFFDDList*>(poResult);
|
||||
if ( c_oSerFFData::DLDefault == type )
|
||||
{
|
||||
pDDList->m_oDefault.Init();
|
||||
pDDList->m_oDefault->m_oVal.Init();
|
||||
pDDList->m_oDefault->m_oVal->SetValue(m_oBufferedStream.GetLong());
|
||||
}
|
||||
else if ( c_oSerFFData::DLResult == type )
|
||||
{
|
||||
pDDList->m_oResult.Init();
|
||||
pDDList->m_oResult->m_oVal.Init();
|
||||
pDDList->m_oResult->m_oVal->SetValue(m_oBufferedStream.GetLong());
|
||||
}
|
||||
else if ( c_oSerFFData::DLListEntry == type )
|
||||
{
|
||||
ComplexTypes::Word::String* pVal = new ComplexTypes::Word::String();
|
||||
pVal->m_sVal.Init();
|
||||
pVal->m_sVal->append(m_oBufferedStream.GetString3(length));
|
||||
pDDList->m_arrListEntry.push_back(pVal);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadFFHelpText(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
ComplexTypes::Word::CFFHelpText* pHelpText = static_cast<ComplexTypes::Word::CFFHelpText*>(poResult);
|
||||
if ( c_oSerFFData::HTType == type )
|
||||
{
|
||||
pHelpText->m_oType.Init();
|
||||
pHelpText->m_oType->SetValue((SimpleTypes::EInfoTextType)m_oBufferedStream.GetUChar());
|
||||
}
|
||||
else if ( c_oSerFFData::HTVal == type )
|
||||
{
|
||||
std::wstring sVal = m_oBufferedStream.GetString3(length);
|
||||
pHelpText->m_oVal.Init();
|
||||
pHelpText->m_oVal->SetValue(sVal);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadFFStatusText(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
ComplexTypes::Word::CFFStatusText* pStatusText = static_cast<ComplexTypes::Word::CFFStatusText*>(poResult);
|
||||
if ( c_oSerFFData::HTType == type )
|
||||
{
|
||||
pStatusText->m_oType.Init();
|
||||
pStatusText->m_oType->SetValue((SimpleTypes::EInfoTextType)m_oBufferedStream.GetUChar());
|
||||
}
|
||||
else if ( c_oSerFFData::HTVal == type )
|
||||
{
|
||||
std::wstring sVal = m_oBufferedStream.GetString3(length);
|
||||
pStatusText->m_oVal.Init();
|
||||
pStatusText->m_oVal->SetValue(sVal);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadTextInput(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
OOX::Logic::CFFTextInput* pTextInput = static_cast<OOX::Logic::CFFTextInput*>(poResult);
|
||||
if ( c_oSerFFData::TIDefault == type )
|
||||
{
|
||||
pTextInput->m_oDefault.Init();
|
||||
pTextInput->m_oDefault->m_sVal.Init();
|
||||
pTextInput->m_oDefault->m_sVal->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if ( c_oSerFFData::TIFormat == type )
|
||||
{
|
||||
pTextInput->m_oFormat.Init();
|
||||
pTextInput->m_oFormat->m_sVal.Init();
|
||||
pTextInput->m_oFormat->m_sVal->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if ( c_oSerFFData::TIMaxLength == type )
|
||||
{
|
||||
pTextInput->m_oMaxLength.Init();
|
||||
pTextInput->m_oMaxLength->m_oVal.Init();
|
||||
pTextInput->m_oMaxLength->m_oVal->SetValue(m_oBufferedStream.GetLong());
|
||||
}
|
||||
else if ( c_oSerFFData::TIType == type )
|
||||
{
|
||||
pTextInput->m_oType.Init();
|
||||
pTextInput->m_oType->m_oVal.Init();
|
||||
pTextInput->m_oType->m_oVal->SetValue((SimpleTypes::EFFTextType)m_oBufferedStream.GetUChar());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
|
||||
int ReadHyperlink(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
|
||||
@ -912,7 +912,8 @@ extern int g_nCurFormatVersion;
|
||||
namespace c_oSer_FldSimpleType{ enum c_oSer_FldSimpleType
|
||||
{
|
||||
Content = 0,
|
||||
Instr = 1
|
||||
Instr = 1,
|
||||
FFData = 2
|
||||
};}
|
||||
namespace c_oSer_ColorThemeType{ enum c_oSer_ColorThemeType
|
||||
{
|
||||
@ -1044,6 +1045,34 @@ extern int g_nCurFormatVersion;
|
||||
Temporary = 34,
|
||||
MultiLine = 35
|
||||
};}
|
||||
namespace c_oSerFFData{enum c_oSerFFData
|
||||
{
|
||||
CalcOnExit = 0,
|
||||
CheckBox = 1,
|
||||
DDList = 2,
|
||||
Enabled = 3,
|
||||
EntryMacro = 4,
|
||||
ExitMacro = 5,
|
||||
HelpText = 6,
|
||||
Label = 7,
|
||||
Name = 8,
|
||||
StatusText = 9,
|
||||
TabIndex = 10,
|
||||
TextInput = 11,
|
||||
CBChecked = 12,
|
||||
CBDefault = 13,
|
||||
CBSize = 14,
|
||||
CBSizeAuto = 15,
|
||||
DLDefault = 16,
|
||||
DLResult = 17,
|
||||
DLListEntry = 18,
|
||||
HTType = 19,
|
||||
HTVal = 20,
|
||||
TIDefault = 21,
|
||||
TIFormat = 22,
|
||||
TIMaxLength = 23,
|
||||
TIType = 24,
|
||||
};}
|
||||
}
|
||||
|
||||
#endif // #ifndef DOCX_BIN_READER_WRITER_DEFINES
|
||||
|
||||
@ -3321,11 +3321,208 @@ namespace BinDocxRW
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_FldSimpleType::Instr);
|
||||
m_oBcw.m_oStream.WriteStringW3(*pFldSimple->m_sInstr);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
//FFData
|
||||
if(pFldSimple->m_oFFData.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_FldSimpleType::FFData);
|
||||
WriteFFData(pFldSimple->m_oFFData.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
//Content
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_FldSimpleType::Content);
|
||||
WriteParagraphContent(pFldSimple->m_arrItems);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
void WriteFFData(const OOX::Logic::CFFData& oFFData)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oFFData.m_oCalcOnExit.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::CalcOnExit);
|
||||
m_oBcw.m_oStream.WriteBOOL(oFFData.m_oCalcOnExit->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oFFData.m_oCheckBox.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::CheckBox);
|
||||
WriteFFCheckBox(oFFData.m_oCheckBox.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oFFData.m_oDDList.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::DDList);
|
||||
WriteDDList(oFFData.m_oDDList.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oFFData.m_oEnabled.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::Enabled);
|
||||
m_oBcw.m_oStream.WriteBOOL(oFFData.m_oEnabled->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oFFData.m_oEntryMacro.IsInit() && oFFData.m_oEntryMacro->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::EntryMacro);
|
||||
m_oBcw.m_oStream.WriteStringW3(oFFData.m_oEntryMacro->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oFFData.m_oExitMacro.IsInit() && oFFData.m_oExitMacro->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::ExitMacro);
|
||||
m_oBcw.m_oStream.WriteStringW3(oFFData.m_oExitMacro->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oFFData.m_oHelpText.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::HelpText);
|
||||
WriteFFHelpText(oFFData.m_oHelpText.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oFFData.m_oLabel.IsInit() && oFFData.m_oLabel->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::Label);
|
||||
m_oBcw.m_oStream.WriteLONG(oFFData.m_oLabel->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oFFData.m_oName.IsInit() && oFFData.m_oName->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::Name);
|
||||
m_oBcw.m_oStream.WriteStringW3(oFFData.m_oName->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oFFData.m_oStatusText.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::StatusText);
|
||||
WriteFFStatusText(oFFData.m_oStatusText.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oFFData.m_oTabIndex.IsInit() && oFFData.m_oTabIndex->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::TabIndex);
|
||||
m_oBcw.m_oStream.WriteLONG(oFFData.m_oTabIndex->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oFFData.m_oTextInput.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::TextInput);
|
||||
WriteTextInput(oFFData.m_oTextInput.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteFFCheckBox(const OOX::Logic::CFFCheckBox& oCheckBox)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oCheckBox.m_oChecked.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::CBChecked);
|
||||
m_oBcw.m_oStream.WriteBOOL(oCheckBox.m_oChecked->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oCheckBox.m_oDefault.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::CBDefault);
|
||||
m_oBcw.m_oStream.WriteBOOL(oCheckBox.m_oDefault->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oCheckBox.m_oSize.IsInit() && oCheckBox.m_oSize->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::CBSize);
|
||||
m_oBcw.m_oStream.WriteULONG(oCheckBox.m_oSize->m_oVal->ToHps());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oCheckBox.m_oSizeAuto.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::CBSizeAuto);
|
||||
m_oBcw.m_oStream.WriteBOOL(oCheckBox.m_oSizeAuto->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteDDList(const OOX::Logic::CFFDDList& oDDList)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oDDList.m_oDefault.IsInit() && oDDList.m_oDefault->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::DLDefault);
|
||||
m_oBcw.m_oStream.WriteLONG(oDDList.m_oDefault->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oDDList.m_oResult.IsInit() && oDDList.m_oResult->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::DLResult);
|
||||
m_oBcw.m_oStream.WriteLONG(oDDList.m_oResult->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
for(int i = 0 ; i < oDDList.m_arrListEntry.size(); ++i)
|
||||
{
|
||||
ComplexTypes::Word::String* pVal = oDDList.m_arrListEntry[i];
|
||||
if(pVal->m_sVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::DLListEntry);
|
||||
m_oBcw.m_oStream.WriteStringW3(pVal->m_sVal.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
void WriteFFHelpText(const ComplexTypes::Word::CFFHelpText& oHelpText)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oHelpText.m_oType.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::HTType);
|
||||
m_oBcw.m_oStream.WriteBYTE(oHelpText.m_oType->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oHelpText.m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::HTVal);
|
||||
m_oBcw.m_oStream.WriteStringW3(oHelpText.m_oVal->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteFFStatusText(const ComplexTypes::Word::CFFStatusText& oStatusText)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oStatusText.m_oType.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::HTType);
|
||||
m_oBcw.m_oStream.WriteBYTE(oStatusText.m_oType->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oStatusText.m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::HTVal);
|
||||
m_oBcw.m_oStream.WriteStringW3(oStatusText.m_oVal->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteTextInput(const OOX::Logic::CFFTextInput& oTextInput)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oTextInput.m_oDefault.IsInit() && oTextInput.m_oDefault->m_sVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::TIDefault);
|
||||
m_oBcw.m_oStream.WriteStringW3(oTextInput.m_oDefault->m_sVal.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oTextInput.m_oFormat.IsInit() && oTextInput.m_oFormat->m_sVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::TIFormat);
|
||||
m_oBcw.m_oStream.WriteStringW3(oTextInput.m_oFormat->m_sVal.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oTextInput.m_oMaxLength.IsInit() && oTextInput.m_oMaxLength->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::TIMaxLength);
|
||||
m_oBcw.m_oStream.WriteLONG(oTextInput.m_oMaxLength->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oTextInput.m_oType.IsInit() && oTextInput.m_oType->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerFFData::TIType);
|
||||
m_oBcw.m_oStream.WriteBYTE(oTextInput.m_oType->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
|
||||
void WriteHyperlink(OOX::Logic::CHyperlink* pHyperlink)
|
||||
{
|
||||
|
||||
@ -132,7 +132,7 @@ void pptx_conversion_context::process_layouts()
|
||||
type == odf_types::presentation_class::header ||
|
||||
type == odf_types::presentation_class::page_number)
|
||||
{
|
||||
if (frame->idx_in_owner <0)
|
||||
if (frame->idx_in_owner < 0)
|
||||
frame->idx_in_owner = last_idx_placeHolder++;
|
||||
|
||||
frame->pptx_convert_placeHolder(*this);
|
||||
|
||||
@ -58,6 +58,7 @@ const wchar_t * anim_par::name = L"par";
|
||||
|
||||
void anim_par::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void anim_par::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
@ -98,6 +99,7 @@ const wchar_t * anim_seq::name = L"seq";
|
||||
|
||||
void anim_seq::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void anim_seq::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
@ -211,11 +213,11 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
case smil_transition_type::checkerBoardWipe:
|
||||
type = L"checker";
|
||||
if (attlist_.smil_subtype_.get()==L"across") dir = L"horz";
|
||||
if (attlist_.smil_subtype_.get()==L"down") dir = L"vert";
|
||||
if (attlist_.smil_subtype_.get()==L"down") dir = L"vert";
|
||||
break;
|
||||
case smil_transition_type::blindsWipe:
|
||||
type = L"blinds";
|
||||
if (attlist_.smil_subtype_.get()==L"vertical") dir = L"vert";
|
||||
if (attlist_.smil_subtype_.get()==L"vertical") dir = L"vert";
|
||||
if (attlist_.smil_subtype_.get()==L"horizontal") dir = L"horz";
|
||||
break;
|
||||
case smil_transition_type::diagonalWipe:
|
||||
@ -223,9 +225,9 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
type = L"strips";
|
||||
if (attlist_.smil_subtype_)
|
||||
{
|
||||
if (attlist_.smil_subtype_.get() == L"horizontalLeft") dir = L"rd";
|
||||
if (attlist_.smil_subtype_.get() == L"horizontalLeft") dir = L"rd";
|
||||
else if (attlist_.smil_subtype_.get() == L"horizontalRight") dir = L"lu";
|
||||
else if (attlist_.smil_subtype_.get() == L"verticalRight") dir = L"ld";
|
||||
else if (attlist_.smil_subtype_.get() == L"verticalRight") dir = L"ld";
|
||||
else dir = L"ru";
|
||||
}
|
||||
break;
|
||||
@ -235,11 +237,11 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
case smil_transition_type::randomBarWipe:
|
||||
type = L"randomBar";
|
||||
if (attlist_.smil_subtype_.get() == L"vertical") dir = L"vert";
|
||||
if (attlist_.smil_subtype_.get() == L"horizontal")dir = L"horz";
|
||||
if (attlist_.smil_subtype_.get() == L"horizontal") dir = L"horz";
|
||||
break;
|
||||
case smil_transition_type::pushWipe:
|
||||
type = L"push";
|
||||
if (attlist_.smil_subtype_.get()==L"combVertical") {type = L"comb"; dir = L"vert";};
|
||||
if (attlist_.smil_subtype_.get()==L"combVertical") {type = L"comb"; dir = L"vert";};
|
||||
if (attlist_.smil_subtype_.get()==L"combHorizontal") {type = L"comb"; dir = L"horz";};
|
||||
break;
|
||||
case smil_transition_type::slideWipe:
|
||||
@ -250,7 +252,7 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
break;
|
||||
case smil_transition_type::barnDoorWipe:
|
||||
type = L"split";
|
||||
if (attlist_.smil_subtype_.get()==L"vertical") param = L"vert";
|
||||
if (attlist_.smil_subtype_.get()==L"vertical") param = L"vert";
|
||||
if (attlist_.smil_subtype_.get()==L"horizontal") param = L"horz";
|
||||
break;
|
||||
case smil_transition_type::barWipe:
|
||||
@ -298,15 +300,15 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
if (attlist_.smil_subtype_.get()==L"fromTop") dir = L"d";
|
||||
if (attlist_.smil_subtype_.get()==L"fromLeft") dir = L"r";
|
||||
if (attlist_.smil_subtype_.get()==L"fromRight") dir = L"l";
|
||||
if (attlist_.smil_subtype_.get()==L"fromBottom") dir = L"u";
|
||||
if (attlist_.smil_subtype_.get()==L"fromBottom") dir = L"u";
|
||||
|
||||
if (attlist_.smil_subtype_.get()==L"topRight") dir = L"ld";
|
||||
if (attlist_.smil_subtype_.get()==L"bottomLeft") dir = L"lu";
|
||||
if (attlist_.smil_subtype_.get()==L"bottomLeft") dir = L"lu";
|
||||
if (attlist_.smil_subtype_.get()==L"bottomRight") dir = L"ru";
|
||||
if (attlist_.smil_subtype_.get()==L"topLeft") dir = L"rd";
|
||||
|
||||
if (attlist_.smil_subtype_.get()==L"fromTopLeft") dir = L"rd";
|
||||
if (attlist_.smil_subtype_.get()==L"fromBottomLeft") dir = L"ru";
|
||||
if (attlist_.smil_subtype_.get()==L"fromBottomLeft")dir = L"ru";
|
||||
if (attlist_.smil_subtype_.get()==L"fromTopRight") dir = L"ld";
|
||||
if (attlist_.smil_subtype_.get()==L"fromBottomRight")dir = L"lu";
|
||||
|
||||
|
||||
@ -41,47 +41,47 @@ std::wostream & operator << (std::wostream & _Wostream, const smil_transition_ty
|
||||
{
|
||||
switch(_Val.get_type())
|
||||
{
|
||||
case smil_transition_type::barWipe : _Wostream << L"barwipe" ; break;
|
||||
case smil_transition_type::boxWipe : _Wostream << L"boxwipe" ; break;
|
||||
case smil_transition_type::fourBoxWipe : _Wostream << L"fourboxwipe" ; break;
|
||||
case smil_transition_type::barnDoorWipe : _Wostream << L"barndoorwipe" ; break;
|
||||
case smil_transition_type::diagonalWipe : _Wostream << L"diagonalwipe" ; break;
|
||||
case smil_transition_type::bowTieWipe : _Wostream << L"bowtiewipe" ; break;
|
||||
case smil_transition_type::miscDiagonalWipe : _Wostream << L"miscdiagonalwipe"; break;
|
||||
case smil_transition_type::veeWipe : _Wostream << L"veewipe" ; break;
|
||||
case smil_transition_type::barnVeeWipe : _Wostream << L"barnveewipe" ; break;
|
||||
case smil_transition_type::zigZagWipe : _Wostream << L"zigzagwipe" ; break;
|
||||
case smil_transition_type::barnZigZagWipe : _Wostream << L"barnzigzagwipe" ; break;
|
||||
case smil_transition_type::irisWipe : _Wostream << L"iriswipe" ; break;
|
||||
case smil_transition_type::triangleWipe : _Wostream << L"trianglewipe" ; break;
|
||||
case smil_transition_type::arrowHeadWipe : _Wostream << L"arrowheadwipe" ; break;
|
||||
case smil_transition_type::pentagonWipe : _Wostream << L"pentagonwipe" ; break;
|
||||
case smil_transition_type::hexagonWipe : _Wostream << L"hexagonwipe" ; break;
|
||||
case smil_transition_type::ellipseWipe : _Wostream << L"ellipsewipe" ; break;
|
||||
case smil_transition_type::eyeWipe : _Wostream << L"eyewipe" ; break;
|
||||
case smil_transition_type::roundRectWipe : _Wostream << L"roundrectwipe" ; break;
|
||||
case smil_transition_type::starWipe : _Wostream << L"starwipe" ; break;
|
||||
case smil_transition_type::miscShapeWipe : _Wostream << L"miscshapewipe" ; break;
|
||||
case smil_transition_type::clockWipe : _Wostream << L"clockwipe" ; break;
|
||||
case smil_transition_type::pinWheelWipe : _Wostream << L"pinwheelwipe" ; break;
|
||||
case smil_transition_type::singleSweepWipe : _Wostream << L"singlesweepwipe" ; break;
|
||||
case smil_transition_type::fanWipe : _Wostream << L"fanwipe" ; break;
|
||||
case smil_transition_type::doubleFanWipe : _Wostream << L"doublefanwipe" ; break;
|
||||
case smil_transition_type::doubleSweepWipe : _Wostream << L"doublesweepwipe" ; break;
|
||||
case smil_transition_type::saloonDoorWipe : _Wostream << L"saloondoorwipe" ; break;
|
||||
case smil_transition_type::windshieldWipe : _Wostream << L"windshieldwipe" ; break;
|
||||
case smil_transition_type::snakeWipe : _Wostream << L"snakewipe" ; break;
|
||||
case smil_transition_type::spiralWipe : _Wostream << L"spiralwipe" ; break;
|
||||
case smil_transition_type::parallelSnakesWipe: _Wostream << L"parallelsnakeswipe"; break;
|
||||
case smil_transition_type::boxSnakesWipe : _Wostream << L"boxsnakeswipe" ; break;
|
||||
case smil_transition_type::waterfallWipe : _Wostream << L"waterfallwipe" ; break;
|
||||
case smil_transition_type::pushWipe : _Wostream << L"pushwipe" ; break;
|
||||
case smil_transition_type::slideWipe : _Wostream << L"slidewipe" ; break;
|
||||
case smil_transition_type::barWipe : _Wostream << L"barWipe" ; break;
|
||||
case smil_transition_type::boxWipe : _Wostream << L"boxWipe" ; break;
|
||||
case smil_transition_type::fourBoxWipe : _Wostream << L"fourBoxWipe" ; break;
|
||||
case smil_transition_type::barnDoorWipe : _Wostream << L"barnDoorWipe" ; break;
|
||||
case smil_transition_type::diagonalWipe : _Wostream << L"diagonalWipe" ; break;
|
||||
case smil_transition_type::bowTieWipe : _Wostream << L"bowTieWipe" ; break;
|
||||
case smil_transition_type::miscDiagonalWipe : _Wostream << L"miscDiagonalWipe"; break;
|
||||
case smil_transition_type::veeWipe : _Wostream << L"veeWipe" ; break;
|
||||
case smil_transition_type::barnVeeWipe : _Wostream << L"barnVeeWipe" ; break;
|
||||
case smil_transition_type::zigZagWipe : _Wostream << L"zigZagWipe" ; break;
|
||||
case smil_transition_type::barnZigZagWipe : _Wostream << L"barnZigZagWipe" ; break;
|
||||
case smil_transition_type::irisWipe : _Wostream << L"irisWipe" ; break;
|
||||
case smil_transition_type::triangleWipe : _Wostream << L"triangleWipe" ; break;
|
||||
case smil_transition_type::arrowHeadWipe : _Wostream << L"arrowHeadWipe" ; break;
|
||||
case smil_transition_type::pentagonWipe : _Wostream << L"pentagonWipe" ; break;
|
||||
case smil_transition_type::hexagonWipe : _Wostream << L"hexagonWipe" ; break;
|
||||
case smil_transition_type::ellipseWipe : _Wostream << L"ellipseWipe" ; break;
|
||||
case smil_transition_type::eyeWipe : _Wostream << L"eyeWipe" ; break;
|
||||
case smil_transition_type::roundRectWipe : _Wostream << L"roundRectWipe" ; break;
|
||||
case smil_transition_type::starWipe : _Wostream << L"starWipe" ; break;
|
||||
case smil_transition_type::miscShapeWipe : _Wostream << L"miscShapeWipe" ; break;
|
||||
case smil_transition_type::clockWipe : _Wostream << L"clockWipe" ; break;
|
||||
case smil_transition_type::pinWheelWipe : _Wostream << L"pinWheelWipe" ; break;
|
||||
case smil_transition_type::singleSweepWipe : _Wostream << L"singleSweepWipe" ; break;
|
||||
case smil_transition_type::fanWipe : _Wostream << L"fanWipe" ; break;
|
||||
case smil_transition_type::doubleFanWipe : _Wostream << L"doubleFanWipe" ; break;
|
||||
case smil_transition_type::doubleSweepWipe : _Wostream << L"doubleSweepWipe" ; break;
|
||||
case smil_transition_type::saloonDoorWipe : _Wostream << L"saloonDoorWipe" ; break;
|
||||
case smil_transition_type::windshieldWipe : _Wostream << L"windshieldWipe" ; break;
|
||||
case smil_transition_type::snakeWipe : _Wostream << L"snakeWipe" ; break;
|
||||
case smil_transition_type::spiralWipe : _Wostream << L"spiralWipe" ; break;
|
||||
case smil_transition_type::parallelSnakesWipe: _Wostream << L"parallelSnakesWipe"; break;
|
||||
case smil_transition_type::boxSnakesWipe : _Wostream << L"boxSnakesWipe" ; break;
|
||||
case smil_transition_type::waterfallWipe : _Wostream << L"waterfallWipe" ; break;
|
||||
case smil_transition_type::pushWipe : _Wostream << L"pushWipe" ; break;
|
||||
case smil_transition_type::slideWipe : _Wostream << L"slideWipe" ; break;
|
||||
case smil_transition_type::fade : _Wostream << L"fade" ; break;
|
||||
case smil_transition_type::checkerBoardWipe : _Wostream << L"checkerboardwipe"; break;
|
||||
case smil_transition_type::blindsWipe : _Wostream << L"blindswipe" ; break;
|
||||
case smil_transition_type::checkerBoardWipe : _Wostream << L"checkerboardWipe"; break;
|
||||
case smil_transition_type::blindsWipe : _Wostream << L"blindsWipe" ; break;
|
||||
case smil_transition_type::dissolve : _Wostream << L"dissolve" ; break;
|
||||
case smil_transition_type::randomBarWipe : _Wostream << L"randombarwipe" ; break;
|
||||
case smil_transition_type::randomBarWipe : _Wostream << L"randomBarWipe" ; break;
|
||||
}
|
||||
return _Wostream;
|
||||
}
|
||||
@ -91,47 +91,47 @@ smil_transition_type smil_transition_type::parse(const std::wstring & Str)
|
||||
std::wstring tmp = Str;
|
||||
boost::algorithm::to_lower(tmp);
|
||||
|
||||
if(tmp == L"barwipe") return smil_transition_type( barWipe );
|
||||
else if(tmp == L"boxwipe") return smil_transition_type( boxWipe );
|
||||
else if(tmp == L"fourboxwipe") return smil_transition_type( fourBoxWipe );
|
||||
else if(tmp == L"barndoorwipe") return smil_transition_type( barnDoorWipe );
|
||||
else if(tmp == L"diagonalwipe") return smil_transition_type( diagonalWipe );
|
||||
else if(tmp == L"bowtiewipe") return smil_transition_type( bowTieWipe );
|
||||
else if(tmp == L"miscdiagonalwipe") return smil_transition_type( miscDiagonalWipe );
|
||||
else if(tmp == L"veewipe") return smil_transition_type( veeWipe );
|
||||
else if(tmp == L"barnveewipe") return smil_transition_type( barnVeeWipe );
|
||||
else if(tmp == L"zigzagwipe") return smil_transition_type( zigZagWipe );
|
||||
else if(tmp == L"barnzigzagwipe") return smil_transition_type( barnZigZagWipe );
|
||||
else if(tmp == L"iriswipe") return smil_transition_type( irisWipe);
|
||||
else if(tmp == L"trianglewipe") return smil_transition_type( triangleWipe);
|
||||
else if(tmp == L"arrowheadwipe") return smil_transition_type( arrowHeadWipe );
|
||||
else if(tmp == L"pentagonwipe") return smil_transition_type( pentagonWipe );
|
||||
else if(tmp == L"hexagonwipe") return smil_transition_type( hexagonWipe );
|
||||
else if(tmp == L"ellipsewipe") return smil_transition_type( ellipseWipe );
|
||||
else if(tmp == L"eyewipe") return smil_transition_type( eyeWipe );
|
||||
else if(tmp == L"roundrectwipe") return smil_transition_type( roundRectWipe );
|
||||
else if(tmp == L"starwipe") return smil_transition_type( starWipe );
|
||||
else if(tmp == L"miscshapewipe") return smil_transition_type( miscShapeWipe );
|
||||
else if(tmp == L"clockwipe") return smil_transition_type( clockWipe );
|
||||
else if(tmp == L"pinwheelwipe") return smil_transition_type( pinWheelWipe );
|
||||
else if(tmp == L"singlesweepwipe") return smil_transition_type( singleSweepWipe);
|
||||
else if(tmp == L"fanwipe") return smil_transition_type( fanWipe );
|
||||
else if(tmp == L"doublefanwipe") return smil_transition_type( doubleFanWipe );
|
||||
else if(tmp == L"doublesweepwipe") return smil_transition_type( doubleSweepWipe );
|
||||
else if(tmp == L"saloondoorwipe") return smil_transition_type( saloonDoorWipe );
|
||||
else if(tmp == L"windshieldwipe") return smil_transition_type( windshieldWipe );
|
||||
else if(tmp == L"snakewipe") return smil_transition_type( snakeWipe );
|
||||
else if(tmp == L"spiralwipe") return smil_transition_type( spiralWipe );
|
||||
else if(tmp == L"parallelsnakeswipe")return smil_transition_type( parallelSnakesWipe );
|
||||
else if(tmp == L"boxsnakeswipe") return smil_transition_type( boxSnakesWipe );
|
||||
else if(tmp == L"waterfallwipe") return smil_transition_type( waterfallWipe );
|
||||
else if(tmp == L"pushwipe") return smil_transition_type( pushWipe );
|
||||
else if(tmp == L"slidewipe") return smil_transition_type( slideWipe );
|
||||
if(tmp == L"barWipe") return smil_transition_type( barWipe );
|
||||
else if(tmp == L"boxWipe") return smil_transition_type( boxWipe );
|
||||
else if(tmp == L"fourboxWipe") return smil_transition_type( fourBoxWipe );
|
||||
else if(tmp == L"barndoorWipe") return smil_transition_type( barnDoorWipe );
|
||||
else if(tmp == L"diagonalWipe") return smil_transition_type( diagonalWipe );
|
||||
else if(tmp == L"bowtieWipe") return smil_transition_type( bowTieWipe );
|
||||
else if(tmp == L"miscdiagonalWipe") return smil_transition_type( miscDiagonalWipe );
|
||||
else if(tmp == L"veeWipe") return smil_transition_type( veeWipe );
|
||||
else if(tmp == L"barnveeWipe") return smil_transition_type( barnVeeWipe );
|
||||
else if(tmp == L"zigzagWipe") return smil_transition_type( zigZagWipe );
|
||||
else if(tmp == L"barnzigzagWipe") return smil_transition_type( barnZigZagWipe );
|
||||
else if(tmp == L"irisWipe") return smil_transition_type( irisWipe);
|
||||
else if(tmp == L"triangleWipe") return smil_transition_type( triangleWipe);
|
||||
else if(tmp == L"arrowheadWipe") return smil_transition_type( arrowHeadWipe );
|
||||
else if(tmp == L"pentagonWipe") return smil_transition_type( pentagonWipe );
|
||||
else if(tmp == L"hexagonWipe") return smil_transition_type( hexagonWipe );
|
||||
else if(tmp == L"ellipseWipe") return smil_transition_type( ellipseWipe );
|
||||
else if(tmp == L"eyeWipe") return smil_transition_type( eyeWipe );
|
||||
else if(tmp == L"roundrectWipe") return smil_transition_type( roundRectWipe );
|
||||
else if(tmp == L"starWipe") return smil_transition_type( starWipe );
|
||||
else if(tmp == L"miscshapeWipe") return smil_transition_type( miscShapeWipe );
|
||||
else if(tmp == L"clockWipe") return smil_transition_type( clockWipe );
|
||||
else if(tmp == L"pinwheelWipe") return smil_transition_type( pinWheelWipe );
|
||||
else if(tmp == L"singlesweepWipe") return smil_transition_type( singleSweepWipe);
|
||||
else if(tmp == L"fanWipe") return smil_transition_type( fanWipe );
|
||||
else if(tmp == L"doublefanWipe") return smil_transition_type( doubleFanWipe );
|
||||
else if(tmp == L"doublesweepWipe") return smil_transition_type( doubleSweepWipe );
|
||||
else if(tmp == L"saloondoorWipe") return smil_transition_type( saloonDoorWipe );
|
||||
else if(tmp == L"windshieldWipe") return smil_transition_type( windshieldWipe );
|
||||
else if(tmp == L"snakeWipe") return smil_transition_type( snakeWipe );
|
||||
else if(tmp == L"spiralWipe") return smil_transition_type( spiralWipe );
|
||||
else if(tmp == L"parallelsnakesWipe")return smil_transition_type( parallelSnakesWipe );
|
||||
else if(tmp == L"boxsnakesWipe") return smil_transition_type( boxSnakesWipe );
|
||||
else if(tmp == L"waterfallWipe") return smil_transition_type( waterfallWipe );
|
||||
else if(tmp == L"pushWipe") return smil_transition_type( pushWipe );
|
||||
else if(tmp == L"slideWipe") return smil_transition_type( slideWipe );
|
||||
else if(tmp == L"fade") return smil_transition_type( fade );
|
||||
else if(tmp == L"checkerboardwipe") return smil_transition_type( checkerBoardWipe);
|
||||
else if(tmp == L"blindswipe") return smil_transition_type( blindsWipe);
|
||||
else if(tmp == L"checkerboardWipe") return smil_transition_type( checkerBoardWipe);
|
||||
else if(tmp == L"blindsWipe") return smil_transition_type( blindsWipe);
|
||||
else if(tmp == L"dissolve") return smil_transition_type( dissolve);
|
||||
else if(tmp == L"randombarwipe") return smil_transition_type( randomBarWipe);
|
||||
else if(tmp == L"randombarWipe") return smil_transition_type( randomBarWipe);
|
||||
else
|
||||
{
|
||||
return smil_transition_type( barWipe );
|
||||
|
||||
@ -342,11 +342,14 @@ namespace odf_writer
|
||||
CP_XML_ATTR(L"xmlns:tableooo", L"http://openoffice.org/2009/table" );
|
||||
CP_XML_ATTR(L"xmlns:drawooo", L"http://openoffice.org/2010/draw" );
|
||||
CP_XML_ATTR(L"xmlns:chartooo", L"http://openoffice.org/2010/chart" );
|
||||
CP_XML_ATTR(L"xmlns:smil", L"urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0");
|
||||
CP_XML_ATTR(L"xmlns:anim", L"urn:oasis:names:tc:opendocument:xmlns:animation:1.0" );
|
||||
CP_XML_ATTR(L"xmlns:calcext", L"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" );
|
||||
CP_XML_ATTR(L"xmlns:field", L"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" );
|
||||
CP_XML_ATTR(L"xmlns:formx", L"urn:openoffice:names:experimental:ooxml-odf_writer-interop:xmlns:form:1.0" );
|
||||
CP_XML_ATTR(L"xmlns:loext", L"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" );
|
||||
CP_XML_ATTR(L"xmlns:css3t", L"http://www.w3.org/TR/css3-text/" );
|
||||
|
||||
CP_XML_ATTR(L"office:version", L"1.2");
|
||||
|
||||
//CP_XML_NODE(L"office:scripts");
|
||||
@ -402,6 +405,8 @@ namespace odf_writer
|
||||
CP_XML_ATTR(L"xmlns:of", L"urn:oasis:names:tc:opendocument:xmlns:of:1.2" );
|
||||
CP_XML_ATTR(L"xmlns:xhtml", L"http://www.w3.org/1999/xhtml" );
|
||||
CP_XML_ATTR(L"xmlns:grddl", L"http://www.w3.org/2003/g/data-view#" );
|
||||
CP_XML_ATTR(L"xmlns:smil", L"urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0");
|
||||
CP_XML_ATTR(L"xmlns:anim", L"urn:oasis:names:tc:opendocument:xmlns:animation:1.0" );
|
||||
CP_XML_ATTR(L"xmlns:officeooo", L"http://openoffice.org/2009/office" );
|
||||
CP_XML_ATTR(L"xmlns:textooo", L"http://openoffice.org/2013/office" );
|
||||
CP_XML_ATTR(L"xmlns:tableooo", L"http://openoffice.org/2009/table" );
|
||||
|
||||
@ -191,7 +191,7 @@ void odp_page_state::set_transition_type(int val)
|
||||
{
|
||||
anim_transitionFilter *trans = dynamic_cast<anim_transitionFilter*>(page_transaction.get());
|
||||
if (trans)
|
||||
trans->attlist_.smil_type_ = odf_types::smil_transition_type(odf_types::smil_transition_type::dissolve);
|
||||
trans->attlist_.smil_type_ = odf_types::smil_transition_type((odf_types::smil_transition_type::type)val);
|
||||
}
|
||||
void odp_page_state::set_transition_subtype(std::wstring val)
|
||||
{
|
||||
|
||||
@ -253,116 +253,88 @@ void DocxConverter::convert(OOX::WritingElement *oox_unknown)
|
||||
{
|
||||
case OOX::et_w_ptab:
|
||||
{
|
||||
OOX::Logic::CPTab* pT= dynamic_cast<OOX::Logic::CPTab*>(oox_unknown);
|
||||
convert(pT);
|
||||
convert(dynamic_cast<OOX::Logic::CPTab*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_sdt:
|
||||
{
|
||||
OOX::Logic::CSdt* pP= dynamic_cast<OOX::Logic::CSdt*>(oox_unknown);
|
||||
convert(pP);
|
||||
convert(dynamic_cast<OOX::Logic::CSdt*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_fldSimple:
|
||||
{
|
||||
OOX::Logic::CFldSimple* pFldS= dynamic_cast<OOX::Logic::CFldSimple*>(oox_unknown);
|
||||
convert(pFldS);
|
||||
convert(dynamic_cast<OOX::Logic::CFldSimple*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_r:
|
||||
{
|
||||
OOX::Logic::CRun* pRun= dynamic_cast<OOX::Logic::CRun*>(oox_unknown);
|
||||
convert(pRun);
|
||||
convert(dynamic_cast<OOX::Logic::CRun*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_p:
|
||||
{
|
||||
OOX::Logic::CParagraph* pP= dynamic_cast<OOX::Logic::CParagraph*>(oox_unknown);
|
||||
convert(pP);
|
||||
convert(dynamic_cast<OOX::Logic::CParagraph*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_ins:
|
||||
{
|
||||
OOX::Logic::CIns* pIns= dynamic_cast<OOX::Logic::CIns*>(oox_unknown);
|
||||
convert(pIns);
|
||||
convert(dynamic_cast<OOX::Logic::CIns*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_del:
|
||||
{
|
||||
OOX::Logic::CDel* pDel= dynamic_cast<OOX::Logic::CDel*>(oox_unknown);
|
||||
convert(pDel);
|
||||
convert(dynamic_cast<OOX::Logic::CDel*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_smartTag:
|
||||
{
|
||||
OOX::Logic::CSmartTag* pTag= dynamic_cast<OOX::Logic::CSmartTag*>(oox_unknown);
|
||||
convert(pTag);
|
||||
convert(dynamic_cast<OOX::Logic::CSmartTag*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_pPr:
|
||||
{
|
||||
OOX::Logic::CParagraphProperty* pPProp= dynamic_cast<OOX::Logic::CParagraphProperty*>(oox_unknown);
|
||||
convert(pPProp);
|
||||
convert(dynamic_cast<OOX::Logic::CParagraphProperty*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_hyperlink:
|
||||
{
|
||||
OOX::Logic::CHyperlink* pH= dynamic_cast<OOX::Logic::CHyperlink*>(oox_unknown);
|
||||
convert(pH);
|
||||
convert(dynamic_cast<OOX::Logic::CHyperlink*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_rPr:
|
||||
{
|
||||
OOX::Logic::CRunProperty* pRProp= dynamic_cast<OOX::Logic::CRunProperty*>(oox_unknown);
|
||||
convert(pRProp);
|
||||
convert(dynamic_cast<OOX::Logic::CRunProperty*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_mc_alternateContent:
|
||||
{
|
||||
OOX::Logic::CAlternateContent* pAltCont= dynamic_cast<OOX::Logic::CAlternateContent*>(oox_unknown);
|
||||
convert(pAltCont);
|
||||
convert(dynamic_cast<OOX::Logic::CAlternateContent*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_drawing:
|
||||
{
|
||||
OOX::Logic::CDrawing* pDrawing= dynamic_cast<OOX::Logic::CDrawing*>(oox_unknown);
|
||||
convert(pDrawing);
|
||||
convert(dynamic_cast<OOX::Logic::CDrawing*>(oox_unknown));
|
||||
}break;
|
||||
//case OOX::et_c_chart:
|
||||
//{
|
||||
// PPTX::Logic::ChartRec* pChart = dynamic_cast<PPTX::Logic::ChartRec*>(oox_unknown);
|
||||
// convert(pChart);
|
||||
//}break;
|
||||
//case OOX::et_w_Shape:
|
||||
//{
|
||||
// OOX::Logic::CShape* pShape = dynamic_cast<OOX::Logic::CShape*>(oox_unknown);
|
||||
// convert(pShape);
|
||||
//}break;
|
||||
case OOX::et_w_pict:
|
||||
{
|
||||
OOX::Logic::CPicture* pPic = dynamic_cast<OOX::Logic::CPicture*>(oox_unknown);
|
||||
convert(pPic);
|
||||
convert(dynamic_cast<OOX::Logic::CPicture*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_object:
|
||||
{
|
||||
OOX::Logic::CObject* pObj = dynamic_cast<OOX::Logic::CObject*>(oox_unknown);
|
||||
convert(pObj);
|
||||
convert(dynamic_cast<OOX::Logic::CObject*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_pic_pic:
|
||||
case OOX::et_pic:
|
||||
case OOX::et_p_pic:
|
||||
{
|
||||
PPTX::Logic::Pic* pPic = dynamic_cast<PPTX::Logic::Pic*>(oox_unknown);
|
||||
convert(pPic);
|
||||
convert(dynamic_cast<PPTX::Logic::Pic*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_GroupShape:
|
||||
case OOX::et_p_ShapeTree:
|
||||
{
|
||||
PPTX::Logic::SpTree* pGroupShape= dynamic_cast<PPTX::Logic::SpTree*>(oox_unknown);
|
||||
convert(pGroupShape);
|
||||
convert(dynamic_cast<PPTX::Logic::SpTree*>(oox_unknown));
|
||||
}break;
|
||||
|
||||
case OOX::et_w_commentRangeEnd:
|
||||
{
|
||||
OOX::Logic::CCommentRangeEnd* pCommEnd = dynamic_cast<OOX::Logic::CCommentRangeEnd*>(oox_unknown);
|
||||
convert(pCommEnd);
|
||||
convert(dynamic_cast<OOX::Logic::CCommentRangeEnd*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_commentRangeStart:
|
||||
{
|
||||
OOX::Logic::CCommentRangeStart* pCommStart = dynamic_cast<OOX::Logic::CCommentRangeStart*>(oox_unknown);
|
||||
convert(pCommStart);
|
||||
convert(dynamic_cast<OOX::Logic::CCommentRangeStart*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_commentReference:
|
||||
{
|
||||
convert(dynamic_cast<OOX::Logic::CCommentReference*>(oox_unknown)); //если нет Start - означает начало с предыдущего Run
|
||||
convert(dynamic_cast<OOX::Logic::CCommentReference*>(oox_unknown));
|
||||
//если нет Start - означает начало с предыдущего Run
|
||||
}break;
|
||||
case OOX::et_w_footnoteReference:
|
||||
{
|
||||
@ -386,13 +358,11 @@ void DocxConverter::convert(OOX::WritingElement *oox_unknown)
|
||||
}break;
|
||||
case OOX::et_w_tr:
|
||||
{
|
||||
OOX::Logic::CTr* pRow= dynamic_cast<OOX::Logic::CTr*>(oox_unknown);
|
||||
convert(pRow);
|
||||
convert(dynamic_cast<OOX::Logic::CTr*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_tc:
|
||||
{
|
||||
OOX::Logic::CTc* pCell= dynamic_cast<OOX::Logic::CTc*>(oox_unknown);
|
||||
convert(pCell);
|
||||
convert(dynamic_cast<OOX::Logic::CTc*>(oox_unknown));
|
||||
}break;
|
||||
case OOX::et_w_bookmarkStart:
|
||||
{
|
||||
|
||||
@ -42,6 +42,16 @@
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Timing/Seq.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Timing/CTn.h"
|
||||
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/EmptyTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/OrientationTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/EightDirectionTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/OptionalBlackTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/SideDirectionTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/CornerDirectionTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/WheelTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/SplitTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/ZoomTransition.h"
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include "../OdfFormat/odp_conversion_context.h"
|
||||
@ -365,13 +375,18 @@ void PptxConverter::convert_slides()
|
||||
|
||||
convert_slide(&slide->Layout->cSld, current_txStyles, true, bShowLayoutMasterSp, 3);
|
||||
|
||||
if (slide->Layout->transition.IsInit()) convert (slide->Layout->transition.GetPointer());
|
||||
else convert (slide->Master->transition.GetPointer());
|
||||
|
||||
if (slide->Layout->timing.IsInit()) convert (slide->Layout->timing.GetPointer());
|
||||
else convert (slide->Master->timing.GetPointer());
|
||||
|
||||
if (!presentation->notesMasterIdLst.empty())
|
||||
{
|
||||
rId = presentation->notesMasterIdLst[0].rid.get();
|
||||
smart_ptr<PPTX::NotesMaster> notes_master = ((*presentation)[rId]).smart_dynamic_cast<PPTX::NotesMaster>();
|
||||
convert(notes_master.operator->());
|
||||
}
|
||||
//add note master
|
||||
odp_context->end_master_slide();
|
||||
|
||||
m_mapMasters.insert(std::make_pair(master_name, master_style_name));
|
||||
@ -490,6 +505,24 @@ void PptxConverter::convert(OOX::WritingElement *oox_unknown)
|
||||
|
||||
switch(oox_unknown->getType())
|
||||
{
|
||||
case OOX::et_p_EmptyTransition:
|
||||
convert(dynamic_cast<PPTX::Logic::EmptyTransition*>(oox_unknown)); break;
|
||||
case OOX::et_p_OrientationTransition:
|
||||
convert(dynamic_cast<PPTX::Logic::OrientationTransition*>(oox_unknown)); break;
|
||||
case OOX::et_p_EightDirectionTransition:
|
||||
convert(dynamic_cast<PPTX::Logic::EightDirectionTransition*>(oox_unknown)); break;
|
||||
case OOX::et_p_OptionalBlackTransition:
|
||||
convert(dynamic_cast<PPTX::Logic::OptionalBlackTransition*>(oox_unknown)); break;
|
||||
case OOX::et_p_CornerDirectionTransition:
|
||||
convert(dynamic_cast<PPTX::Logic::CornerDirectionTransition*>(oox_unknown)); break;
|
||||
case OOX::et_p_SideDirectionTransition:
|
||||
convert(dynamic_cast<PPTX::Logic::SideDirectionTransition*>(oox_unknown)); break;
|
||||
case OOX::et_p_WheelTransition:
|
||||
convert(dynamic_cast<PPTX::Logic::WheelTransition*>(oox_unknown)); break;
|
||||
case OOX::et_p_SplitTransition:
|
||||
convert(dynamic_cast<PPTX::Logic::SplitTransition*>(oox_unknown)); break;
|
||||
case OOX::et_p_ZoomTransition:
|
||||
convert(dynamic_cast<PPTX::Logic::ZoomTransition*>(oox_unknown)); break;
|
||||
default:
|
||||
{
|
||||
OoxConverter::convert(oox_unknown);
|
||||
@ -542,8 +575,7 @@ void PptxConverter::convert( PPTX::Logic::Transition *oox_transition )
|
||||
if (oox_transition->dur.is_init())
|
||||
odp_context->current_slide().set_transition_duration(*oox_transition->dur);
|
||||
|
||||
odp_context->current_slide().set_transition_type(5);
|
||||
//convert(oox_transition->base.operator->());
|
||||
convert(oox_transition->base.base.operator->());
|
||||
|
||||
//if (oox_transition->sndAc.is_init() && oox_transition->sndAc->stSnd.is_init())
|
||||
//{
|
||||
@ -591,6 +623,127 @@ void PptxConverter::convert(PPTX::Logic::TimeNodeBase *oox_time_base)
|
||||
odp_context->current_slide().end_timing_seq();
|
||||
}
|
||||
}
|
||||
void PptxConverter::convert(PPTX::Logic::EmptyTransition *oox_transition)
|
||||
{
|
||||
if (!oox_transition) return;
|
||||
|
||||
if (oox_transition->name == L"random")
|
||||
odp_context->current_slide().set_transition_type(40);
|
||||
if (oox_transition->name == L"circle")
|
||||
odp_context->current_slide().set_transition_type(16);
|
||||
if (oox_transition->name == L"dissolve")
|
||||
odp_context->current_slide().set_transition_type(39);
|
||||
if (oox_transition->name == L"diamond")
|
||||
{
|
||||
odp_context->current_slide().set_transition_type(11);
|
||||
odp_context->current_slide().set_transition_subtype(L"diamond");
|
||||
}
|
||||
if (oox_transition->name == L"newsflash")
|
||||
odp_context->current_slide().set_transition_type(5);
|
||||
if (oox_transition->name == L"plus")
|
||||
odp_context->current_slide().set_transition_type(2);//??
|
||||
if (oox_transition->name == L"wedge")
|
||||
odp_context->current_slide().set_transition_type(24);
|
||||
}
|
||||
void PptxConverter::convert(PPTX::Logic::OrientationTransition *oox_transition)
|
||||
{
|
||||
if (!oox_transition) return;
|
||||
|
||||
if (oox_transition->name == L"blinds")
|
||||
odp_context->current_slide().set_transition_type(38);
|
||||
if (oox_transition->name == L"checker")
|
||||
odp_context->current_slide().set_transition_type(37);
|
||||
if (oox_transition->name == L"comb")
|
||||
{
|
||||
odp_context->current_slide().set_transition_type(34);
|
||||
|
||||
if (oox_transition->dir.IsInit())
|
||||
{
|
||||
if (oox_transition->dir->get() == L"horz")
|
||||
odp_context->current_slide().set_transition_subtype(L"combHorizontal");
|
||||
if (oox_transition->dir->get() == L"vert")
|
||||
odp_context->current_slide().set_transition_subtype(L"combVertical");
|
||||
}
|
||||
}
|
||||
if (oox_transition->name == L"randomBar")
|
||||
odp_context->current_slide().set_transition_type(40);
|
||||
}
|
||||
void PptxConverter::convert(PPTX::Logic::EightDirectionTransition *oox_transition)
|
||||
{
|
||||
if (!oox_transition) return;
|
||||
|
||||
if (oox_transition->name == L"cover")
|
||||
odp_context->current_slide().set_transition_type(1);
|
||||
if (oox_transition->name == L"pull")
|
||||
odp_context->current_slide().set_transition_type(35);
|
||||
}
|
||||
void PptxConverter::convert(PPTX::Logic::OptionalBlackTransition *oox_transition)
|
||||
{
|
||||
if (!oox_transition) return;
|
||||
|
||||
if (oox_transition->name == L"cut")
|
||||
odp_context->current_slide().set_transition_type(36);
|
||||
if (oox_transition->name == L"fade")
|
||||
odp_context->current_slide().set_transition_type(36);
|
||||
}
|
||||
void PptxConverter::convert(PPTX::Logic::SideDirectionTransition *oox_transition)
|
||||
{
|
||||
if (!oox_transition) return;
|
||||
|
||||
std::wstring dir;
|
||||
if (oox_transition->dir.IsInit()) dir = oox_transition->dir->get();
|
||||
|
||||
if (oox_transition->name == L"push")
|
||||
{
|
||||
odp_context->current_slide().set_transition_type(34);
|
||||
if (dir == L"d") odp_context->current_slide().set_transition_subtype(L"fromTop");
|
||||
if (dir == L"l") odp_context->current_slide().set_transition_subtype(L"fromRight");
|
||||
if (dir == L"r") odp_context->current_slide().set_transition_subtype(L"fromLeft");
|
||||
if (dir == L"u") odp_context->current_slide().set_transition_subtype(L"fromBottom");
|
||||
}
|
||||
if (oox_transition->name == L"wipe")
|
||||
odp_context->current_slide().set_transition_type(0);
|
||||
}
|
||||
void PptxConverter::convert(PPTX::Logic::CornerDirectionTransition *oox_transition)
|
||||
{
|
||||
if (!oox_transition) return;
|
||||
//name == strips
|
||||
odp_context->current_slide().set_transition_type(4);
|
||||
|
||||
if (oox_transition->dir.IsInit())
|
||||
{
|
||||
if (oox_transition->dir->get() == L"rd") odp_context->current_slide().set_transition_subtype(L"horizontalLeft");
|
||||
if (oox_transition->dir->get() == L"lu") odp_context->current_slide().set_transition_subtype(L"horizontalRight");
|
||||
if (oox_transition->dir->get() == L"ld") odp_context->current_slide().set_transition_subtype(L"verticalRight");
|
||||
}
|
||||
}
|
||||
void PptxConverter::convert(PPTX::Logic::WheelTransition *oox_transition)
|
||||
{
|
||||
if (!oox_transition) return;
|
||||
//name == wheel
|
||||
odp_context->current_slide().set_transition_type(21);
|
||||
|
||||
switch (oox_transition->spokes.get_value_or(0))
|
||||
{
|
||||
case 1: odp_context->current_slide().set_transition_subtype(L"oneBlade"); break;
|
||||
case 3: odp_context->current_slide().set_transition_subtype(L"threeBlade"); break;
|
||||
case 4: odp_context->current_slide().set_transition_subtype(L"fourBlade"); break;
|
||||
case 8: odp_context->current_slide().set_transition_subtype(L"eightBlade"); break;
|
||||
}
|
||||
}
|
||||
void PptxConverter::convert(PPTX::Logic::SplitTransition *oox_transition)
|
||||
{
|
||||
if (!oox_transition) return;
|
||||
//name == split
|
||||
odp_context->current_slide().set_transition_type(8);
|
||||
}
|
||||
void PptxConverter::convert(PPTX::Logic::ZoomTransition *oox_transition)
|
||||
{
|
||||
if (!oox_transition) return;
|
||||
//name == zoom
|
||||
odp_context->current_slide().set_transition_type(11);
|
||||
}
|
||||
|
||||
void PptxConverter::convert(PPTX::Logic::CTn *oox_time_common)
|
||||
{
|
||||
if (!oox_time_common) return;
|
||||
|
||||
@ -69,7 +69,15 @@ namespace PPTX
|
||||
class TxStyles;
|
||||
class TimeNodeBase;
|
||||
class CTn;
|
||||
|
||||
class EmptyTransition;
|
||||
class OrientationTransition;
|
||||
class EightDirectionTransition;
|
||||
class OptionalBlackTransition;
|
||||
class CornerDirectionTransition;
|
||||
class SideDirectionTransition;
|
||||
class WheelTransition;
|
||||
class SplitTransition;
|
||||
class ZoomTransition;
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,6 +144,16 @@ namespace Oox2Odf
|
||||
|
||||
void convert(PPTX::Logic::Ln *oox_ln_border, std::wstring & odf_border);
|
||||
private:
|
||||
void convert(PPTX::Logic::EmptyTransition *oox_transition);
|
||||
void convert(PPTX::Logic::OrientationTransition *oox_transition);
|
||||
void convert(PPTX::Logic::EightDirectionTransition *oox_transition);
|
||||
void convert(PPTX::Logic::OptionalBlackTransition *oox_transition);
|
||||
void convert(PPTX::Logic::CornerDirectionTransition *oox_transition);
|
||||
void convert(PPTX::Logic::SideDirectionTransition *oox_transition);
|
||||
void convert(PPTX::Logic::WheelTransition *oox_transition);
|
||||
void convert(PPTX::Logic::SplitTransition *oox_transition);
|
||||
void convert(PPTX::Logic::ZoomTransition *oox_transition);
|
||||
|
||||
PPTX::Folder *pptx_document;
|
||||
PPTX::Presentation *presentation;
|
||||
cpdoccore::odf_writer::package::odf_document *output_document;
|
||||
|
||||
@ -45,7 +45,11 @@ namespace PPTX
|
||||
public:
|
||||
PPTX_LOGIC_BASE(CornerDirectionTransition)
|
||||
|
||||
public:
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
return OOX::et_p_CornerDirectionTransition;
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
name = XmlUtils::GetNameNoNS(node.GetName());
|
||||
@ -61,8 +65,8 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
std::wstring name;
|
||||
nullable_limit<Limit::CornerDirectionVal> dir;
|
||||
std::wstring name;
|
||||
nullable_limit<Limit::CornerDirectionVal> dir;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
|
||||
@ -45,7 +45,11 @@ namespace PPTX
|
||||
public:
|
||||
PPTX_LOGIC_BASE(EightDirectionTransition)
|
||||
|
||||
public:
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
return OOX::et_p_EightDirectionTransition;
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
name = XmlUtils::GetNameNoNS(node.GetName());
|
||||
@ -60,8 +64,7 @@ namespace PPTX
|
||||
return XmlUtils::CreateNode(_T("p:") + name, oAttr);
|
||||
}
|
||||
|
||||
public:
|
||||
std::wstring name;
|
||||
std::wstring name;
|
||||
nullable_limit<Limit::EightDirectionVal> dir;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
@ -44,7 +44,11 @@ namespace PPTX
|
||||
public:
|
||||
PPTX_LOGIC_BASE(EmptyTransition)
|
||||
|
||||
public:
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
return OOX::et_p_EmptyTransition;
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
name = XmlUtils::GetNameNoNS(node.GetName());
|
||||
@ -55,7 +59,6 @@ namespace PPTX
|
||||
return _T("<p:") + name + _T("/>");
|
||||
}
|
||||
|
||||
public:
|
||||
std::wstring name;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
@ -44,10 +44,14 @@ namespace PPTX
|
||||
public:
|
||||
PPTX_LOGIC_BASE(OptionalBlackTransition)
|
||||
|
||||
public:
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
return OOX::et_p_OptionalBlackTransition;
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
name = XmlUtils::GetNameNoNS(node.GetName());
|
||||
name = XmlUtils::GetNameNoNS(node.GetName());
|
||||
node.ReadAttributeBase(L"thruBlk", thruBlk);
|
||||
}
|
||||
|
||||
@ -59,9 +63,9 @@ namespace PPTX
|
||||
return XmlUtils::CreateNode(_T("p:") + name, oAttr);
|
||||
}
|
||||
|
||||
public:
|
||||
std::wstring name;
|
||||
nullable_bool thruBlk;
|
||||
std::wstring name;
|
||||
nullable_bool thruBlk;
|
||||
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
|
||||
@ -45,7 +45,11 @@ namespace PPTX
|
||||
public:
|
||||
PPTX_LOGIC_BASE(OrientationTransition)
|
||||
|
||||
public:
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
return OOX::et_p_OrientationTransition;
|
||||
}
|
||||
|
||||
void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
name = XmlUtils::GetNameNoNS(node.GetName());
|
||||
@ -60,9 +64,8 @@ namespace PPTX
|
||||
return XmlUtils::CreateNode(_T("p:") + name, oAttr);
|
||||
}
|
||||
|
||||
public:
|
||||
std::wstring name;
|
||||
nullable_limit<Limit::Orient> dir;
|
||||
std::wstring name;
|
||||
nullable_limit<Limit::Orient> dir;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
|
||||
@ -45,7 +45,11 @@ namespace PPTX
|
||||
public:
|
||||
PPTX_LOGIC_BASE(SideDirectionTransition)
|
||||
|
||||
public:
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
return OOX::et_p_SideDirectionTransition;
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
name = XmlUtils::GetNameNoNS(node.GetName());
|
||||
@ -60,8 +64,7 @@ namespace PPTX
|
||||
return XmlUtils::CreateNode(_T("p:") + name, oAttr);
|
||||
}
|
||||
|
||||
public:
|
||||
std::wstring name;
|
||||
std::wstring name;
|
||||
nullable_limit<Limit::SideDirectionVal> dir;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
@ -46,7 +46,11 @@ namespace PPTX
|
||||
public:
|
||||
PPTX_LOGIC_BASE(SplitTransition)
|
||||
|
||||
public:
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
return OOX::et_p_SplitTransition;
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"dir", dir);
|
||||
@ -62,7 +66,6 @@ namespace PPTX
|
||||
return XmlUtils::CreateNode(_T("p:split"), oAttr);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_limit<Limit::InOutDirectionVal> dir;
|
||||
nullable_limit<Limit::Orient> orient;
|
||||
protected:
|
||||
|
||||
@ -44,7 +44,11 @@ namespace PPTX
|
||||
public:
|
||||
PPTX_LOGIC_BASE(WheelTransition)
|
||||
|
||||
public:
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
return OOX::et_p_WheelTransition;
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"spokes", spokes);
|
||||
@ -58,7 +62,6 @@ namespace PPTX
|
||||
return XmlUtils::CreateNode(_T("p:wheel"), oAttr);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_int spokes;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
@ -45,7 +45,11 @@ namespace PPTX
|
||||
public:
|
||||
PPTX_LOGIC_BASE(ZoomTransition)
|
||||
|
||||
public:
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
return OOX::et_p_ZoomTransition;
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
node.ReadAttributeBase(L"dir", dir);
|
||||
@ -59,8 +63,7 @@ namespace PPTX
|
||||
return XmlUtils::CreateNode(_T("p:zoom"), oAttr);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_limit<Limit::InOutDirectionVal> dir;
|
||||
nullable_limit<Limit::InOutDirectionVal> dir;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
};
|
||||
|
||||
@ -799,7 +799,7 @@ namespace ComplexTypes
|
||||
if ( m_oVal.IsInit() )
|
||||
{
|
||||
sResult += _T("w:val=\"");
|
||||
sResult += m_oVal->ToString();
|
||||
sResult += std::to_wstring(m_oVal->ToHps());
|
||||
sResult += _T("\" ");
|
||||
}
|
||||
|
||||
|
||||
@ -3085,6 +3085,11 @@ namespace SimpleTypes
|
||||
m_dValue = fabs( dValue * 72.0 );
|
||||
return m_dValue;
|
||||
}
|
||||
virtual double FromHps(double dValue)
|
||||
{
|
||||
m_dValue = dValue / 2;
|
||||
return m_dValue;
|
||||
}
|
||||
SimpleType_FromString (double)
|
||||
SimpleType_Operator_Equal (CHpsMeasure)
|
||||
UniversalMeasure_AdditionalOpearators(CHpsMeasure)
|
||||
|
||||
@ -142,6 +142,8 @@ namespace OOX
|
||||
pItem = new CSmartTag( oItem );
|
||||
//else if ( _T("w:subDoc") == sName )
|
||||
// pItem = new CSubDoc( oItem );
|
||||
else if ( _T("w:ffData") == sName )
|
||||
m_oFFData = new CFFData( oItem );
|
||||
|
||||
if ( pItem )
|
||||
m_arrItems.push_back( pItem );
|
||||
@ -232,6 +234,8 @@ namespace OOX
|
||||
pItem = new CSmartTag( oReader );
|
||||
//else if ( _T("w:subDoc") == sName )
|
||||
// pItem = new CSubDoc( oReader );
|
||||
else if ( _T("w:ffData") == sName )
|
||||
m_oFFData = new CFFData( oReader );
|
||||
|
||||
if ( pItem )
|
||||
m_arrItems.push_back( pItem );
|
||||
@ -259,6 +263,11 @@ namespace OOX
|
||||
|
||||
sResult += _T(">");
|
||||
|
||||
if (m_oFFData.IsInit())
|
||||
{
|
||||
sResult += m_oFFData->toXML();
|
||||
}
|
||||
|
||||
for (unsigned int nIndex = 0; nIndex < m_arrItems.size(); nIndex++ )
|
||||
{
|
||||
if ( m_arrItems[nIndex] )
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
#include "../WritingElement.h"
|
||||
#include "../../Common/SimpleTypes_Word.h"
|
||||
#include "../../Common/SimpleTypes_Shared.h"
|
||||
#include "../../DocxFormat/Logic/FldChar.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
@ -120,6 +121,7 @@ namespace OOX
|
||||
nullable<std::wstring > m_sInstr;
|
||||
|
||||
// Childs
|
||||
nullable<OOX::Logic::CFFData > m_oFFData;
|
||||
};
|
||||
|
||||
} // namespace Logic
|
||||
|
||||
@ -375,6 +375,16 @@ namespace OOX
|
||||
et_p_fld,
|
||||
et_p_br,
|
||||
et_p_MathPara,
|
||||
|
||||
et_p_EmptyTransition,
|
||||
et_p_OrientationTransition,
|
||||
et_p_EightDirectionTransition,
|
||||
et_p_OptionalBlackTransition,
|
||||
et_p_CornerDirectionTransition,
|
||||
et_p_SideDirectionTransition,
|
||||
et_p_WheelTransition,
|
||||
et_p_SplitTransition,
|
||||
et_p_ZoomTransition,
|
||||
|
||||
et_a_textFit,
|
||||
et_a_hyperlink,
|
||||
|
||||
@ -20,6 +20,8 @@ private:
|
||||
std::string m_sImageValidBase64;
|
||||
std::string m_sImageInvalidBase64;
|
||||
|
||||
std::wstring m_sFolder;
|
||||
|
||||
private:
|
||||
XmlUtils::CXmlNode m_node; // signature file
|
||||
|
||||
@ -50,16 +52,23 @@ private:
|
||||
return *this;
|
||||
}
|
||||
|
||||
CXmlStackNamespaces GetById(const std::string& id)
|
||||
CXmlStackNamespaces GetById(const std::string& id, const bool& isNameUse = false)
|
||||
{
|
||||
return GetByIdRec(*this, id);
|
||||
return GetByIdRec(*this, id, isNameUse);
|
||||
}
|
||||
|
||||
CXmlStackNamespaces GetByIdRec(CXmlStackNamespaces& stack, const std::string& id)
|
||||
CXmlStackNamespaces GetByIdRec(CXmlStackNamespaces& stack, const std::string& id, const bool& isNameUse = false)
|
||||
{
|
||||
if (stack.m_node.GetAttributeA("Id") == id)
|
||||
return stack;
|
||||
|
||||
if (isNameUse)
|
||||
{
|
||||
std::string sName = U_TO_UTF8((stack.m_node.GetName()));
|
||||
if (sName == id)
|
||||
return stack;
|
||||
}
|
||||
|
||||
CXmlStackNamespaces ret = stack;
|
||||
|
||||
std::vector<std::wstring> _names;
|
||||
@ -90,7 +99,7 @@ private:
|
||||
for (int i = 0; i < nCount; i++)
|
||||
{
|
||||
oNodes.GetAt(i, ret.m_node);
|
||||
CXmlStackNamespaces _retRecursion = ret.GetByIdRec(ret, id);
|
||||
CXmlStackNamespaces _retRecursion = ret.GetByIdRec(ret, id, isNameUse);
|
||||
if (_retRecursion.m_node.IsValid())
|
||||
return _retRecursion;
|
||||
}
|
||||
@ -108,7 +117,15 @@ private:
|
||||
|
||||
std::wstring sXmlFind = L"<" + sName + L" ";
|
||||
if (0 == sXml.find(sXmlFind))
|
||||
{
|
||||
sXml.replace(0, sXmlFind.length(), L"<" + sName + L" " + m_namespaces + L" ");
|
||||
}
|
||||
else
|
||||
{
|
||||
sXmlFind = L"<" + sName + L">";
|
||||
if (0 == sXml.find(sXmlFind))
|
||||
sXml.replace(0, sXmlFind.length(), L"<" + sName + L" " + m_namespaces + L">");
|
||||
}
|
||||
}
|
||||
|
||||
return U_TO_UTF8(sXml);
|
||||
@ -152,7 +169,7 @@ public:
|
||||
public:
|
||||
void Check()
|
||||
{
|
||||
// 1) get cert
|
||||
// 1) Certificate
|
||||
XmlUtils::CXmlNode oNodeCert = m_node.ReadNode(L"KeyInfo").ReadNode(L"X509Data").ReadNode(L"X509Certificate");
|
||||
if (!oNodeCert.IsValid())
|
||||
{
|
||||
@ -166,28 +183,212 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
// 2) Objects
|
||||
// 2) Check files (Manifect)
|
||||
XmlUtils::CXmlNode nodeManifect = GetObjectById("idPackageObject");
|
||||
if (!nodeManifect.IsValid())
|
||||
{
|
||||
m_valid = OOXML_SIGNATURE_INVALID;
|
||||
return;
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNodes nodesManifestRefs = nodeManifect.ReadNode(L"Manifest").GetNodes(L"Reference");
|
||||
int nRefsCount = nodesManifestRefs.GetCount();
|
||||
for (int i = 0; i < nRefsCount; i++)
|
||||
{
|
||||
XmlUtils::CXmlNode tmp;
|
||||
nodesManifestRefs.GetAt(i, tmp);
|
||||
|
||||
m_valid = CheckManifestReference(tmp);
|
||||
if (OOXML_SIGNATURE_VALID != m_valid)
|
||||
return;
|
||||
}
|
||||
|
||||
// 3) Images
|
||||
XmlUtils::CXmlNode nodeImageValid = GetObjectById("idValidSigLnImg");
|
||||
if (nodeImageValid.IsValid())
|
||||
m_sImageValidBase64 = U_TO_UTF8(nodeImageValid.GetText());
|
||||
XmlUtils::CXmlNode nodeImageInvalid = GetObjectById("idInvalidSigLnImg");
|
||||
if (nodeImageInvalid.IsValid())
|
||||
m_sImageInvalidBase64 = U_TO_UTF8(nodeImageInvalid.GetText());
|
||||
|
||||
// 4) Objects
|
||||
XmlUtils::CXmlNodes nodesReferences;
|
||||
m_node.ReadNode(L"SignedInfo").GetNodes(L"Reference", nodesReferences);
|
||||
nRefsCount = nodesReferences.GetCount();
|
||||
for (int i = 0; i < nRefsCount; i++)
|
||||
{
|
||||
XmlUtils::CXmlNode tmp;
|
||||
nodesReferences.GetAt(i, tmp);
|
||||
|
||||
m_valid = CheckObjectReference(tmp);
|
||||
if (OOXML_SIGNATURE_VALID != m_valid)
|
||||
return;
|
||||
}
|
||||
|
||||
// 5) Check signature
|
||||
CXmlStackNamespaces stack(m_node);
|
||||
int nCount = nodesReferences.GetCount();
|
||||
CXmlStackNamespaces stackRes = stack.GetById("SignedInfo", true);
|
||||
std::string sXml = stackRes.GetXml();
|
||||
|
||||
std::string sCanonicalizationMethod = m_node.ReadNode(L"SignedInfo").ReadNode(L"CanonicalizationMethod").GetAttributeA("Algorithm");
|
||||
std::string sSignatureMethod = m_node.ReadNode(L"SignedInfo").ReadNode(L"SignatureMethod").GetAttributeA("Algorithm");
|
||||
|
||||
int nSignatureMethod = ICertificate::GetOOXMLHashAlg(sSignatureMethod);
|
||||
if (OOXML_HASH_ALG_INVALID == nSignatureMethod)
|
||||
{
|
||||
m_valid = OOXML_SIGNATURE_NOTSUPPORTED;
|
||||
return;
|
||||
}
|
||||
|
||||
IXmlTransform* pCanonicalizationMethodTransform = IXmlTransform::GetFromType(sCanonicalizationMethod);
|
||||
if (NULL == pCanonicalizationMethodTransform)
|
||||
{
|
||||
m_valid = OOXML_SIGNATURE_NOTSUPPORTED;
|
||||
return;
|
||||
}
|
||||
|
||||
std::string sSignatureCalcValue = pCanonicalizationMethodTransform->Transform(sXml);
|
||||
RELEASEOBJECT(pCanonicalizationMethodTransform);
|
||||
|
||||
std::string sSignatureValue = U_TO_UTF8((m_node.ReadValueString(L"SignatureValue")));
|
||||
|
||||
if (!m_cert->Verify(sSignatureCalcValue, sSignatureValue, nSignatureMethod))
|
||||
m_valid = OOXML_SIGNATURE_INVALID;
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode GetObjectById(std::string sId)
|
||||
{
|
||||
XmlUtils::CXmlNodes oNodes = m_node.GetNodes(L"Object");
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; i++)
|
||||
{
|
||||
XmlUtils::CXmlNode nodeRef;
|
||||
nodesReferences.GetAt(i, nodeRef);
|
||||
|
||||
std::string sId = nodeRef.GetAttributeA("URI");
|
||||
if (0 == sId.find("#"))
|
||||
sId = sId.substr(1);
|
||||
|
||||
CXmlStackNamespaces _stack = stack.GetById(sId);
|
||||
std::string sTmp = _stack.GetXml();
|
||||
XML_UNUSED(sTmp);
|
||||
XmlUtils::CXmlNode tmp;
|
||||
oNodes.GetAt(i, tmp);
|
||||
if (sId == tmp.GetAttributeA("Id"))
|
||||
return tmp;
|
||||
}
|
||||
XmlUtils::CXmlNode ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
friend class COOXMLVerifier;
|
||||
|
||||
private:
|
||||
|
||||
int CheckManifestReference(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
std::wstring sFile = node.GetAttribute("URI");
|
||||
std::wstring::size_type nPos = sFile.find(L"?");
|
||||
if (nPos == std::wstring::npos)
|
||||
return OOXML_SIGNATURE_INVALID;
|
||||
|
||||
sFile = sFile.substr(0, nPos);
|
||||
sFile = m_sFolder + sFile;
|
||||
|
||||
if (!NSFile::CFileBinary::Exists(sFile))
|
||||
return OOXML_SIGNATURE_INVALID;
|
||||
|
||||
XmlUtils::CXmlNode nodeMethod = node.ReadNode(L"DigestMethod");
|
||||
if (!nodeMethod.IsValid())
|
||||
return OOXML_SIGNATURE_INVALID;
|
||||
|
||||
int nAlg = ICertificate::GetOOXMLHashAlg(nodeMethod.GetAttributeA("Algorithm"));
|
||||
|
||||
if (OOXML_HASH_ALG_INVALID == nAlg)
|
||||
return OOXML_SIGNATURE_NOTSUPPORTED;
|
||||
|
||||
std::string sValue = U_TO_UTF8((node.ReadNodeText(L"DigestValue")));
|
||||
std::string sCalcValue = "";
|
||||
|
||||
XmlUtils::CXmlNode nodeTransform = node.ReadNode(L"Transforms");
|
||||
if (!nodeTransform.IsValid())
|
||||
{
|
||||
// simple hash
|
||||
sCalcValue = m_cert->GetHash(sFile, nAlg);
|
||||
sValue = U_TO_UTF8((node.ReadNodeText(L"DigestValue")));
|
||||
}
|
||||
else
|
||||
{
|
||||
// XML
|
||||
CXmlTransforms oTransforms(nodeTransform);
|
||||
if (!oTransforms.GetValid())
|
||||
return OOXML_SIGNATURE_NOTSUPPORTED;
|
||||
|
||||
std::string sXml;
|
||||
NSFile::CFileBinary::ReadAllTextUtf8A(sFile, sXml);
|
||||
|
||||
sXml = oTransforms.Transform(sXml);
|
||||
|
||||
sCalcValue = m_cert->GetHash(sXml, nAlg);
|
||||
sValue = U_TO_UTF8((node.ReadNodeText(L"DigestValue")));
|
||||
}
|
||||
|
||||
if (sCalcValue != sValue)
|
||||
return OOXML_SIGNATURE_INVALID;
|
||||
|
||||
return OOXML_SIGNATURE_VALID;
|
||||
}
|
||||
|
||||
int CheckObjectReference(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
std::string sURI = node.GetAttributeA("URI");
|
||||
if ("" == sURI)
|
||||
return OOXML_SIGNATURE_INVALID;
|
||||
|
||||
if (0 == sURI.find("#"))
|
||||
sURI = sURI.substr(1);
|
||||
|
||||
std::string sValue = U_TO_UTF8((node.ReadNodeText(L"DigestValue")));
|
||||
|
||||
CXmlTransforms oTransforms;
|
||||
|
||||
CXmlTransformC14N* pTransform = new CXmlTransformC14N();
|
||||
pTransform->CheckC14NTransform("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");
|
||||
oTransforms.AddTransform(pTransform);
|
||||
|
||||
#if 0
|
||||
XmlUtils::CXmlNode nodeTransform = node.ReadNode(L"Transforms");
|
||||
if (!nodeTransform.IsValid())
|
||||
{
|
||||
// simple hash
|
||||
sCalcValue = m_cert->GetHash(sFile, nAlg);
|
||||
sValue = U_TO_UTF8((node.ReadNodeText(L"DigestValue")));
|
||||
}
|
||||
else
|
||||
{
|
||||
// XML
|
||||
CXmlTransforms oTransforms(nodeTransform);
|
||||
if (!oTransforms.GetValid())
|
||||
return OOXML_SIGNATURE_NOTSUPPORTED;
|
||||
|
||||
std::string sXml;
|
||||
NSFile::CFileBinary::ReadAllTextUtf8A(sFile, sXml);
|
||||
|
||||
sXml = oTransforms.Transform(sXml);
|
||||
|
||||
sCalcValue = m_cert->GetHash(sXml, nAlg);
|
||||
sValue = U_TO_UTF8((node.ReadNodeText(L"DigestValue")));
|
||||
}
|
||||
#endif
|
||||
|
||||
CXmlStackNamespaces stack(m_node);
|
||||
CXmlStackNamespaces stackRes = stack.GetById(sURI);
|
||||
std::string sXml = stackRes.GetXml();
|
||||
|
||||
sXml = oTransforms.Transform(sXml);
|
||||
|
||||
XmlUtils::CXmlNode nodeMethod = node.ReadNode(L"DigestMethod");
|
||||
if (!nodeMethod.IsValid())
|
||||
return OOXML_SIGNATURE_INVALID;
|
||||
|
||||
int nAlg = ICertificate::GetOOXMLHashAlg(nodeMethod.GetAttributeA("Algorithm"));
|
||||
std::string sCalcValue = m_cert->GetHash(sXml, nAlg);
|
||||
|
||||
if (sCalcValue != sValue)
|
||||
return OOXML_SIGNATURE_INVALID;
|
||||
|
||||
return OOXML_SIGNATURE_VALID;
|
||||
}
|
||||
};
|
||||
|
||||
class COOXMLVerifier
|
||||
@ -229,6 +430,7 @@ public:
|
||||
|
||||
COOXMLSignature* pSignature = new COOXMLSignature();
|
||||
pSignature->m_node = nodeSig;
|
||||
pSignature->m_sFolder = m_sFolder;
|
||||
pSignature->Check();
|
||||
|
||||
m_arSignatures.push_back(pSignature);
|
||||
|
||||
@ -181,6 +181,9 @@ public:
|
||||
|
||||
bResult = CryptAcquireCertificatePrivateKey(m_context, 0, NULL, &hCryptProv, &dwKeySpec, NULL);
|
||||
|
||||
if (!bResult)
|
||||
bResult = CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
|
||||
|
||||
if (!bResult)
|
||||
return "";
|
||||
|
||||
@ -264,14 +267,17 @@ public:
|
||||
BOOL bResult = CryptAcquireCertificatePrivateKey(m_context, 0, NULL, &hCryptProv, &dwKeySpec, NULL);
|
||||
|
||||
if (!bResult)
|
||||
return FALSE;
|
||||
bResult = CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
|
||||
|
||||
if (!bResult)
|
||||
return false;
|
||||
|
||||
bResult = CryptCreateHash(hCryptProv, GetHashId(nAlg), 0, 0, &hHash);
|
||||
|
||||
if (!bResult)
|
||||
{
|
||||
CryptReleaseContext(hCryptProv, 0);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
BYTE* pDataHash = NULL;
|
||||
|
||||
@ -110,8 +110,9 @@ public:
|
||||
|
||||
virtual std::string Transform(const std::string& xml)
|
||||
{
|
||||
// TODO
|
||||
return xml;
|
||||
if (-1 == m_mode)
|
||||
return xml;
|
||||
return CXmlCanonicalizator::Execute(xml, m_mode, m_comments);
|
||||
}
|
||||
|
||||
virtual void LoadFromXml(XmlUtils::CXmlNode& node)
|
||||
@ -148,6 +149,11 @@ protected:
|
||||
bool m_valid;
|
||||
|
||||
public:
|
||||
CXmlTransforms()
|
||||
{
|
||||
m_valid = true;
|
||||
}
|
||||
|
||||
CXmlTransforms(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
m_valid = true;
|
||||
@ -181,6 +187,25 @@ public:
|
||||
m_transforms.clear();
|
||||
}
|
||||
|
||||
bool GetValid()
|
||||
{
|
||||
return m_valid;
|
||||
}
|
||||
|
||||
std::string Transform(const std::string& xml)
|
||||
{
|
||||
std::string sResult = xml;
|
||||
for (std::vector<IXmlTransform*>::iterator i = m_transforms.begin(); i != m_transforms.end(); i++)
|
||||
{
|
||||
sResult = (*i)->Transform(sResult);
|
||||
}
|
||||
return sResult;
|
||||
}
|
||||
|
||||
void AddTransform(IXmlTransform* transform)
|
||||
{
|
||||
m_transforms.push_back(transform);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //_XML_TRANSFORM_H_
|
||||
|
||||
@ -37,7 +37,9 @@ void main(void)
|
||||
for (std::vector<COOXMLSignature*>::iterator i = oVerifier.m_arSignatures.begin(); i != oVerifier.m_arSignatures.end(); i++)
|
||||
{
|
||||
COOXMLSignature* pSign = *i;
|
||||
int nRes = pSign->GetValid();
|
||||
XML_UNUSED(pSign);
|
||||
XML_UNUSED(nRes);
|
||||
}
|
||||
|
||||
XML_UNUSED(nCount);
|
||||
|
||||
@ -45,7 +45,8 @@ namespace TestDocsWithChart
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
getFilesPivot();
|
||||
getFilesConditional();
|
||||
//getFilesPivot();
|
||||
//getFilesAlternateContent();
|
||||
//getFiles();
|
||||
//convertFiles();
|
||||
@ -74,6 +75,45 @@ namespace TestDocsWithChart
|
||||
|
||||
}
|
||||
}
|
||||
static void getFilesConditional()
|
||||
{
|
||||
//string sFindText = "conditionalFormatting";
|
||||
//string sDirInput = @"\\192.168.3.208\allusers\Files\XLSX";
|
||||
//string sDirOutput = @"D:\Files\Conditional";
|
||||
string sFindText = "type=\"expression\"";
|
||||
string sDirInput = @"D:\Files\Conditional";
|
||||
string sDirOutput = @"D:\Files\ConditionalFormulaExpression";
|
||||
String[] allfiles = System.IO.Directory.GetFiles(sDirInput, "*.*", System.IO.SearchOption.AllDirectories);
|
||||
|
||||
for (var i = 0; i < allfiles.Length; ++i)
|
||||
{
|
||||
string file = allfiles[i];
|
||||
try
|
||||
{
|
||||
ZipArchive zip = ZipFile.OpenRead(file);
|
||||
string sOutputPath = Path.Combine(sDirOutput, Path.GetFileName(file));
|
||||
foreach (ZipArchiveEntry entry in zip.Entries)
|
||||
{
|
||||
if (entry.FullName.EndsWith(".xml", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
using (StreamReader reader = new StreamReader(entry.Open(), Encoding.UTF8))
|
||||
{
|
||||
string sXml = reader.ReadToEnd();
|
||||
if (-1 != sXml.IndexOf(sFindText))
|
||||
{
|
||||
System.IO.File.Copy(file, sOutputPath, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
static void getFilesAlternateContent()
|
||||
{
|
||||
string sAlternateContent = ":Choice ";
|
||||
|
||||
Reference in New Issue
Block a user