Commit 1602843a authored by ElenaSubbotina's avatar ElenaSubbotina

fix color alpha

parent cdb7fb8e
...@@ -918,7 +918,7 @@ void OoxConverter::convert(PPTX::Logic::UniColor * color, std::wstring & hexStri ...@@ -918,7 +918,7 @@ void OoxConverter::convert(PPTX::Logic::UniColor * color, std::wstring & hexStri
if ((nARGB >> 24) != 0xff) if ((nARGB >> 24) != 0xff)
{ {
opacity = ((nARGB >> 24) /255.) * 100.; opacity = 100 - ((nARGB >> 24) /255.) * 100.;
} }
} }
else else
......
...@@ -53,12 +53,14 @@ namespace PPTX ...@@ -53,12 +53,14 @@ namespace PPTX
{ {
name = oReader.GetName(); name = oReader.GetName();
ReadAttributes( oReader );
if (XmlUtils::GetNameNoNS(name) == _T("alpha")) if (XmlUtils::GetNameNoNS(name) == _T("alpha"))
{ {
ReadAttributes2( oReader ); ReadAttributes2( oReader );
} }
else
{
ReadAttributes( oReader );
}
} }
void ReadAttributes2(XmlUtils::CXmlLiteReader& oReader) void ReadAttributes2(XmlUtils::CXmlLiteReader& oReader)
{ {
...@@ -67,9 +69,15 @@ namespace PPTX ...@@ -67,9 +69,15 @@ namespace PPTX
WritingElement_ReadAttributes_ReadSingle ( oReader, _T("val"), sTmp) WritingElement_ReadAttributes_ReadSingle ( oReader, _T("val"), sTmp)
WritingElement_ReadAttributes_End( oReader ) WritingElement_ReadAttributes_End( oReader )
if (val.is_init() && sTmp.is_init() && sTmp->find(wchar_t('%')) != -1) if (sTmp.is_init())
{
val = sTmp.get();
if (val.is_init() && std::wstring::npos != sTmp->find(L"%"))
{
*val = (*val) * 1000; *val = (*val) * 1000;
} }
}
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader) void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{ {
WritingElement_ReadAttributes_Start_No_NS( oReader ) WritingElement_ReadAttributes_Start_No_NS( oReader )
...@@ -86,7 +94,7 @@ namespace PPTX ...@@ -86,7 +94,7 @@ namespace PPTX
nullable_string sTmp; nullable_string sTmp;
node.ReadAttributeBase(L"val", sTmp); node.ReadAttributeBase(L"val", sTmp);
if (val.is_init() && sTmp.is_init() && sTmp->find(wchar_t('%')) != -1) if (val.is_init() && sTmp.is_init() && std::wstring::npos != sTmp->find(L"%"))
*val = (*val) * 1000; *val = (*val) * 1000;
} }
} }
......
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