Commit 2179da0f authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

bug 31328 - DocxFormat - градиент (old format)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@67675 954022d7-b5bf-4e40-9824-e11837661b57
parent 784c0369
...@@ -3284,11 +3284,11 @@ void CDrawingConverter::CheckBrushShape(PPTX::Logic::SpTreeElem& oElem, XmlUtils ...@@ -3284,11 +3284,11 @@ void CDrawingConverter::CheckBrushShape(PPTX::Logic::SpTreeElem& oElem, XmlUtils
sOpacity.reset(); sOpacity.reset();
oNodeFill.ReadAttributeBase(_T("opacity"), sOpacity); oNodeFill.ReadAttributeBase(_T("opacity"), sOpacity);
sFillColor.reset(); nullable_string sColor;
oNodeFill.ReadAttributeBase(L"color", sFillColor); oNodeFill.ReadAttributeBase(L"color", sColor);
if (sFillColor.is_init()) if (sColor.is_init())
{ {
NSPresentationEditor::CColor color = NS_DWC_Common::getColorFromString(*sFillColor); NSPresentationEditor::CColor color = NS_DWC_Common::getColorFromString(*sColor);
PPTX::Logic::SolidFill* pSolid = new PPTX::Logic::SolidFill(); PPTX::Logic::SolidFill* pSolid = new PPTX::Logic::SolidFill();
pSolid->m_namespace = _T("a"); pSolid->m_namespace = _T("a");
...@@ -3296,7 +3296,11 @@ void CDrawingConverter::CheckBrushShape(PPTX::Logic::SpTreeElem& oElem, XmlUtils ...@@ -3296,7 +3296,11 @@ void CDrawingConverter::CheckBrushShape(PPTX::Logic::SpTreeElem& oElem, XmlUtils
pSolid->Color.Color->SetRGB(color.R, color.G, color.B); pSolid->Color.Color->SetRGB(color.R, color.G, color.B);
pShape->spPr.Fill.Fill = pSolid; pShape->spPr.Fill.Fill = pSolid;
if (!sFillColor.is_init())
sFillColor = sColor;
} }
if (!sColor.is_init()) sColor = sFillColor;
nullable_string sRid; nullable_string sRid;
oNodeFill.ReadAttributeBase(L"r:id", sRid); oNodeFill.ReadAttributeBase(L"r:id", sRid);
...@@ -3314,10 +3318,65 @@ void CDrawingConverter::CheckBrushShape(PPTX::Logic::SpTreeElem& oElem, XmlUtils ...@@ -3314,10 +3318,65 @@ void CDrawingConverter::CheckBrushShape(PPTX::Logic::SpTreeElem& oElem, XmlUtils
pShape->spPr.Fill.Fill = pBlipFill; pShape->spPr.Fill.Fill = pBlipFill;
} }
nullable_string sRotate;
oNodeFill.ReadAttributeBase(L"rotate", sRotate);
nullable_string sMethod;
oNodeFill.ReadAttributeBase(L"method", sMethod);
nullable_string sColor2;
oNodeFill.ReadAttributeBase(L"color2", sColor2);
nullable_string sFocus;
oNodeFill.ReadAttributeBase(L"focus", sFocus);
//
if (sType.is_init() && (*sType == _T("gradient") || *sType == _T("gradientradial"))) if (sType.is_init() && (*sType == _T("gradient") || *sType == _T("gradientradial")))
{ {
// TODO: PPTX::Logic::GradFill* pGradFill = new PPTX::Logic::GradFill();
pGradFill->m_namespace = _T("a");
if (sColor.is_init())
{
NSPresentationEditor::CColor color = NS_DWC_Common::getColorFromString(*sColor);
PPTX::Logic::Gs Gs_;
Gs_.color.Color = new PPTX::Logic::SrgbClr();
Gs_.color.Color->SetRGB(color.R, color.G, color.B);
Gs_.pos = 0;
pGradFill->GsLst.push_back( Gs_ );
}
if (sColor2.is_init())
{
PPTX::Logic::Gs Gs_;
Gs_.color.Color = new PPTX::Logic::SrgbClr();
if (sColor2->Find(L"fill") != -1)
{
//todooo
Gs_.color.Color->SetRGB(0xff, 0xff, 0xff);
}
else
{
NSPresentationEditor::CColor color = NS_DWC_Common::getColorFromString(*sColor2);
Gs_.color.Color->SetRGB(color.R, color.G, color.B);
}
Gs_.pos = 100 * 1000;
pGradFill->GsLst.push_back( Gs_ );
}
//todooo method
if (sRotate.is_init())
{
pGradFill->lin = new PPTX::Logic::Lin();
pGradFill->lin->scaled = 1;
if (*sRotate == L"l") pGradFill->lin->ang = 0 * 60000;
if (*sRotate == L"t") pGradFill->lin->ang = 90 * 60000;
if (*sRotate == L"b") pGradFill->lin->ang = 270 * 60000;
if (*sRotate == L"r") pGradFill->lin->ang = 180 * 60000;
}
pShape->spPr.Fill.Fill = pGradFill;
} }
if (sOpacity.is_init()) if (sOpacity.is_init())
......
...@@ -51,12 +51,12 @@ ...@@ -51,12 +51,12 @@
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;AGG_BMP_ALPHA_BLEND;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;AGG_BMP_ALPHA_BLEND;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="1"
StructMemberAlignment="0" StructMemberAlignment="0"
PrecompiledHeaderFile="" PrecompiledHeaderFile=""
AssemblerListingLocation="$(ConfigurationName)\" AssemblerListingLocation="$(ConfigurationName)\agg2d.pch"
ObjectFile="$(ConfigurationName)\" ObjectFile="$(ConfigurationName)\"
ProgramDataBaseFileName="$(ConfigurationName)\" ProgramDataBaseFileName="$(ConfigurationName)\agg2D.pdb"
BrowseInformation="0" BrowseInformation="0"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"
...@@ -133,10 +133,10 @@ ...@@ -133,10 +133,10 @@
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
StructMemberAlignment="0" StructMemberAlignment="0"
PrecompiledHeaderFile="..\Debug\agg2d.pch" PrecompiledHeaderFile=""
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)\" AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)\agg2d.pch"
ObjectFile="$(PlatformName)\$(ConfigurationName)\" ObjectFile="$(PlatformName)\$(ConfigurationName)\"
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)\" ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)\agg2D.pdb"
BrowseInformation="0" BrowseInformation="0"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"
...@@ -212,10 +212,10 @@ ...@@ -212,10 +212,10 @@
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;AGG_BMP_ALPHA_BLEND;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;AGG_BMP_ALPHA_BLEND;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS"
RuntimeLibrary="2" RuntimeLibrary="2"
BufferSecurityCheck="false" BufferSecurityCheck="false"
PrecompiledHeaderFile="..\Release\agg2d.pch" PrecompiledHeaderFile=""
AssemblerListingLocation="$(ConfigurationName)\" AssemblerListingLocation="$(ConfigurationName)\agg2d.pch"
ObjectFile="$(ConfigurationName)\" ObjectFile="$(ConfigurationName)\"
ProgramDataBaseFileName="$(ConfigurationName)\" ProgramDataBaseFileName="$(ConfigurationName)\agg2D.pdb"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"
DebugInformationFormat="3" DebugInformationFormat="3"
...@@ -292,9 +292,9 @@ ...@@ -292,9 +292,9 @@
RuntimeLibrary="2" RuntimeLibrary="2"
BufferSecurityCheck="false" BufferSecurityCheck="false"
PrecompiledHeaderFile="..\Release\agg2d.pch" PrecompiledHeaderFile="..\Release\agg2d.pch"
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)\" AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)\agg2d.pch"
ObjectFile="$(PlatformName)\$(ConfigurationName)\" ObjectFile="$(PlatformName)\$(ConfigurationName)\"
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)\" ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)\agg2D.pdb"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"
DebugInformationFormat="3" DebugInformationFormat="3"
......
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