Commit 72ac11ac authored by ElenaSubbotina's avatar ElenaSubbotina

fix bug 34901

parent f70ea2b7
......@@ -7196,6 +7196,8 @@ namespace BinDocxRW
}
void WriteColorSchemeMapping(const PPTX::Logic::ClrMap& oColorSchemeMapping)
{
int re_index[] = {0, 1, 2, 3, 4, 5, 10, 11, 6, 7, 8, 9, 10, 6, 7};
int nCurPos = 0;
std::map<std::wstring, PPTX::Limit::ColorSchemeIndex>::const_iterator pFind;
......@@ -7204,84 +7206,84 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent1);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
}
pFind = oColorSchemeMapping.ColorMap.find(L"accent2");
if(pFind != oColorSchemeMapping.ColorMap.end())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent2);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
}
pFind = oColorSchemeMapping.ColorMap.find(L"accent3");
if(pFind != oColorSchemeMapping.ColorMap.end())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent3);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
}
pFind = oColorSchemeMapping.ColorMap.find(L"accent4");
if(pFind != oColorSchemeMapping.ColorMap.end())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent4);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
}
pFind = oColorSchemeMapping.ColorMap.find(L"accent5");
if(pFind != oColorSchemeMapping.ColorMap.end())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent5);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
}
pFind = oColorSchemeMapping.ColorMap.find(L"accent6");
if(pFind != oColorSchemeMapping.ColorMap.end())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent6);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
}
pFind = oColorSchemeMapping.ColorMap.find(L"bg1");
if(pFind != oColorSchemeMapping.ColorMap.end())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Bg1);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
}
pFind = oColorSchemeMapping.ColorMap.find(L"bg2");
if(pFind != oColorSchemeMapping.ColorMap.end())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Bg2);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
}
pFind = oColorSchemeMapping.ColorMap.find(L"folHlink");
if(pFind != oColorSchemeMapping.ColorMap.end())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::FollowedHyperlink);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
}
pFind = oColorSchemeMapping.ColorMap.find(L"hlink");
if(pFind != oColorSchemeMapping.ColorMap.end())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Hyperlink);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
}
pFind = oColorSchemeMapping.ColorMap.find(L"tx1");
if(pFind != oColorSchemeMapping.ColorMap.end())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::T1);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
}
pFind = oColorSchemeMapping.ColorMap.find(L"tx2");
if(pFind != oColorSchemeMapping.ColorMap.end())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::T2);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(pFind->second.GetBYTECode());
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
}
};
};
......
......@@ -145,19 +145,21 @@ namespace PPTX
lColorIndex._set(node.GetAttribute(_T("w:followedHyperlink"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("folHlink"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("w:hyperlink"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("hlink"), lColorIndex));
}
lColorIndex._set(node.GetAttribute(_T("accent1"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("accent1"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("accent2"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("accent2"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("accent3"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("accent3"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("accent4"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("accent4"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("accent5"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("accent5"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("accent6"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("accent6"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("bg1"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("bg1"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("bg2"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("bg2"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("tx1"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("tx1"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("tx2"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("tx2"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("folHlink")));ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("folHlink"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("hlink"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("hlink"), lColorIndex));
else
{
lColorIndex._set(node.GetAttribute(_T("accent1"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("accent1"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("accent2"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("accent2"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("accent3"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("accent3"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("accent4"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("accent4"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("accent5"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("accent5"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("accent6"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("accent6"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("bg1"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("bg1"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("bg2"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("bg2"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("tx1"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("tx1"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("tx2"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("tx2"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("folHlink")));ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("folHlink"), lColorIndex));
lColorIndex._set(node.GetAttribute(_T("hlink"))); ColorMap.insert(std::pair<std::wstring,Limit::ColorSchemeIndex>(_T("hlink"), lColorIndex));
}
}
virtual std::wstring toXML() const
......
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