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

PPTFormat правки по результатам тестирования, убрано лишнее

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@65567 954022d7-b5bf-4e40-9824-e11837661b57
parent e3f5f625
...@@ -68,7 +68,7 @@ HRESULT COfficePPTFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDs ...@@ -68,7 +68,7 @@ HRESULT COfficePPTFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDs
m_Status = NULLMODE; m_Status = NULLMODE;
return S_FALSE; return S_FALSE;
} }
if (0 < ((CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_arUsers.size()) if (!((CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_arUsers.empty())
{ {
NSPresentationEditor::CPPTXWriter oPPTXWriter; NSPresentationEditor::CPPTXWriter oPPTXWriter;
oPPTXWriter.m_strTempDirectory = std_string2string(sDstPath); oPPTXWriter.m_strTempDirectory = std_string2string(sDstPath);
......
...@@ -26,6 +26,9 @@ CPPTUserInfo::CPPTUserInfo() : CDocument(), ...@@ -26,6 +26,9 @@ CPPTUserInfo::CPPTUserInfo() : CDocument(),
m_strFileDirectory = _T(""); m_strFileDirectory = _T("");
m_bIsSetupEmpty = false; m_bIsSetupEmpty = false;
m_bRtl = false;
m_bShowComments = false;
} }
CPPTUserInfo::~CPPTUserInfo() CPPTUserInfo::~CPPTUserInfo()
...@@ -297,9 +300,6 @@ void CPPTUserInfo::FromDocument() ...@@ -297,9 +300,6 @@ void CPPTUserInfo::FromDocument()
if (oSI[0]->m_oSIRun.bLang) if (oSI[0]->m_oSIRun.bLang)
m_wLanguage = oSI[0]->m_oSIRun.Lang; m_wLanguage = oSI[0]->m_oSIRun.Lang;
if (oSI[0]->m_oSIRun.bBidi)
m_bBidi = oSI[0]->m_oSIRun.Bidi;
m_oDefaultTextStyle.SetLanguage(m_wLanguage); m_oDefaultTextStyle.SetLanguage(m_wLanguage);
} }
} }
...@@ -312,6 +312,9 @@ void CPPTUserInfo::FromDocument() ...@@ -312,6 +312,9 @@ void CPPTUserInfo::FromDocument()
m_oInfo.m_lMillimetresHor = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginWidth); m_oInfo.m_lMillimetresHor = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginWidth);
m_oInfo.m_lMillimetresVer = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginHeight); m_oInfo.m_lMillimetresVer = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginHeight);
m_bRtl = (oArrayDoc[0]->m_bRightToLeft!=0);
m_bShowComments = (oArrayDoc[0]->m_bShowComments!=0);
LoadMasters(lOriginWidth, lOriginHeight); LoadMasters(lOriginWidth, lOriginHeight);
double DurationSlide = PPT_DEFAULT_SLIDE_DURATION; double DurationSlide = PPT_DEFAULT_SLIDE_DURATION;
......
...@@ -66,8 +66,8 @@ public: ...@@ -66,8 +66,8 @@ public:
std::vector<CColor> m_oSchemeColors; std::vector<CColor> m_oSchemeColors;
nullable<WORD> m_wLanguage; // () nullable<WORD> m_wLanguage; // ()
nullable<bool> m_bBidi; // bi-direction bool m_bRtl;
bool m_bShowComments;
public: public:
CPPTUserInfo(); CPPTUserInfo();
......
...@@ -7,6 +7,73 @@ ...@@ -7,6 +7,73 @@
using namespace NSPresentationEditor; using namespace NSPresentationEditor;
namespace NSPresentationEditor
{
static CColor GetStandartPaletteColor(int index)
{
CColor color;
static BYTE palette [56][3] =
{
{ 0 , 0 , 0 },
{ 255 , 255 , 255 },
{ 255 , 0 , 0 },
{ 0 , 255 , 0 },
{ 0 , 0 , 255 },
{ 255 , 255 , 0 },
{ 255 , 0 , 255 },
{ 0 , 255 , 255 },
{ 128 , 0 , 0 },
{ 0 , 128 , 0 },
{ 0 , 0 , 128 },
{ 128 , 128 , 0 },
{ 128 , 0 , 128 },
{ 0 , 128 , 128 },
{ 192 , 192 , 192 },
{ 128 , 128 , 128 },
{ 153 , 153 , 255 },
{ 153 , 51 , 102 },
{ 255 , 255 , 204 },
{ 204 , 255 , 255 },
{ 102 , 0 , 102 },
{ 255 , 128 , 128 },
{ 0 , 102 , 204 },
{ 204 , 204 , 255 },
{ 0 , 0 , 128 },
{ 255 , 0 , 255 },
{ 255 , 255 , 0 },
{ 0 , 255 , 255 },
{ 128 , 0 , 128 },
{ 128 , 0 , 0 },
{ 0 , 128 , 128 },
{ 0 , 0 , 255 },
{ 0 , 204 , 255 },
{ 204 , 255 , 255 },
{ 204 , 255 , 204 },
{ 255 , 255 , 153 },
{ 153 , 204 , 255 },
{ 255 , 153 , 204 },
{ 204 , 153 , 255 },
{ 255 , 204 , 153 },
{ 51 , 102 , 255 },
{ 51 , 204 , 204 },
{ 153 , 204 , 0 },
{ 255 , 204 , 0 },
{ 255 , 153 , 0 },
{ 255 , 102 , 0 },
{ 102 , 102 , 153 },
{ 150 , 150 , 150 },
{ 0 , 51 , 102 },
{ 51 , 153 , 102 },
{ 0 , 51 , 0 },
{ 51 , 51 , 0 },
{ 153 , 51 , 0 },
{ 153 , 51 , 102 },
{ 51 , 51 , 153 }
};
color.SetRGB(palette[index][0], palette[index][1], palette[index][2]);
return color;
}
}
namespace NSZLib namespace NSZLib
{ {
...@@ -272,7 +339,11 @@ void CTextPFRun_ppt::LoadFromStream(POLE::Stream* pStream, bool bIsIndentation) ...@@ -272,7 +339,11 @@ void CTextPFRun_ppt::LoadFromStream(POLE::Stream* pStream, bool bIsIndentation)
oColor.A = 255; oColor.A = 255;
oColor.m_lSchemeIndex = -1; oColor.m_lSchemeIndex = -1;
if (oColorAtom.Index < 10) //if (oColorAtom.Index < 64 && oColorAtom.bPaletteIndex) 1-(23).ppt
//{
// oColor = NSPresentationEditor::GetStandartPaletteColor(oColorAtom.Index);
//}
if (oColorAtom.Index < 10 && oColorAtom.bSchemeIndex)
{ {
oColor.m_lSchemeIndex = oColorAtom.Index; oColor.m_lSchemeIndex = oColorAtom.Index;
NSPresentationEditor::CorrectColorPPT(oColor.m_lSchemeIndex); NSPresentationEditor::CorrectColorPPT(oColor.m_lSchemeIndex);
...@@ -428,7 +499,11 @@ void CTextCFRun_ppt::LoadFromStream(POLE::Stream* pStream, bool bIsIndentation) ...@@ -428,7 +499,11 @@ void CTextCFRun_ppt::LoadFromStream(POLE::Stream* pStream, bool bIsIndentation)
oColor.A = 255; oColor.A = 255;
oColor.m_lSchemeIndex = -1; oColor.m_lSchemeIndex = -1;
if (oColorAtom.Index < 10/* && oColorAtom.bSchemeIndex*/) //if (oColorAtom.Index < 64 && oColorAtom.bPaletteIndex && !oColorAtom.bPaletteRGB)
//{
// oColor = NSPresentationEditor::GetStandartPaletteColor(oColorAtom.Index);
//}
if (oColorAtom.Index < 10 && oColorAtom.bSchemeIndex)
{ {
oColor.m_lSchemeIndex = oColorAtom.Index; oColor.m_lSchemeIndex = oColorAtom.Index;
NSPresentationEditor::CorrectColorPPT(oColor.m_lSchemeIndex); NSPresentationEditor::CorrectColorPPT(oColor.m_lSchemeIndex);
...@@ -469,9 +544,11 @@ namespace NSPresentationEditor ...@@ -469,9 +544,11 @@ namespace NSPresentationEditor
oAttributes.m_arParagraphs.push_back(elm); oAttributes.m_arParagraphs.push_back(elm);
NSPresentationEditor::CParagraph* pPar = &oAttributes.m_arParagraphs[nIndexPF]; NSPresentationEditor::CParagraph* pPar = &oAttributes.m_arParagraphs[nIndexPF];
pPar->m_lTextLevel = oArrayPF[nIndexPF].m_lLevel;
pPar->m_oPFRun = oArrayPF[nIndexPF].m_oRun; pPar->m_oPFRun = oArrayPF[nIndexPF].m_oRun;
pPar->m_lTextType = oAttributes.m_lTextType; pPar->m_lTextType = oAttributes.m_lTextType;
pPar->m_lTextLevel = oArrayPF[nIndexPF].m_lLevel; pPar->m_lStyleThemeIndex = oAttributes.m_lStyleThemeIndex;
int nCountInPF = oArrayPF[nIndexPF].m_lCount; int nCountInPF = oArrayPF[nIndexPF].m_lCount;
......
...@@ -1645,16 +1645,19 @@ public: ...@@ -1645,16 +1645,19 @@ public:
pShapeElem->m_rcBounds.bottom = dCy + dW / 2.0; pShapeElem->m_rcBounds.bottom = dCy + dW / 2.0;
} }
pSlideWrapper->m_mapElements.insert(std::pair<LONG, CElementInfo>(pShapeElem->m_lID, oElementInfo));
SetUpTextStyle(strText, pTheme, pLayout, pElem, pThemeWrapper, pSlideWrapper, pSlide);
//------------------------------------------------------------------------------------
std::vector<CRecordMasterTextPropAtom*> oArrayMasterTextProp; std::vector<CRecordMasterTextPropAtom*> oArrayMasterTextProp;
GetRecordsByType(&oArrayMasterTextProp, true); GetRecordsByType(&oArrayMasterTextProp, true);
CRecordMasterTextPropAtom* master_level = NULL;
if (!oArrayMasterTextProp.empty()) if (!oArrayMasterTextProp.empty())
{ master_level = oArrayMasterTextProp[0];
SetUpTextMasterIndent(pElem, oArrayMasterTextProp[0]);
} pSlideWrapper->m_mapElements.insert(std::pair<LONG, CElementInfo>(pShapeElem->m_lID, oElementInfo));
SetUpTextStyle(strText, pTheme, pLayout, pElem, pThemeWrapper, pSlideWrapper, pSlide, master_level);
//------------------------------------------------------------------------------------
} }
else else
{ {
...@@ -1751,17 +1754,17 @@ public: ...@@ -1751,17 +1754,17 @@ public:
protected: protected:
void SetUpTextMasterIndent(IElement* pElem, CRecordMasterTextPropAtom* master_levels) void ApplyThemeStyle(IElement* pElem, CTheme* pTheme, CRecordMasterTextPropAtom* master_levels)
{ {
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem); CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
if (NULL == pShape) if (NULL == pShape)
return; return;
if (master_levels->m_arrProps.empty()) return;
CTextAttributesEx* pText = &(pShape->m_oShape.m_oText); CTextAttributesEx* pText = &(pShape->m_oShape.m_oText);
int pos_text = 0, pos_si = 0;
int ind = 0; if (master_levels)
{
for (int i = 0; i < pText->m_arParagraphs.size(); i++) for (int i = 0; i < pText->m_arParagraphs.size(); i++)
{ {
if (i >= master_levels->m_arrProps.size()) break; if (i >= master_levels->m_arrProps.size()) break;
...@@ -1770,9 +1773,12 @@ protected: ...@@ -1770,9 +1773,12 @@ protected:
pText->m_arParagraphs[i].m_oPFRun.leftMargin.reset(); pText->m_arParagraphs[i].m_oPFRun.leftMargin.reset();
pText->m_arParagraphs[i].m_oPFRun.indent.reset(); pText->m_arParagraphs[i].m_oPFRun.indent.reset();
} }
}
pText->ApplyThemeStyle(pTheme);
} }
void SetUpTextStyle(std::wstring& strText, CTheme* pTheme, CLayout* pLayout, IElement* pElem, CSlideInfo* pThemeWrapper, CSlideInfo* pSlideWrapper, CSlide* pSlide = NULL) void SetUpTextStyle(std::wstring& strText, CTheme* pTheme, CLayout* pLayout, IElement* pElem, CSlideInfo* pThemeWrapper, CSlideInfo* pSlideWrapper, CSlide* pSlide, CRecordMasterTextPropAtom* master_levels)
{ {
// shape // shape
// - // -
...@@ -1909,7 +1915,7 @@ protected: ...@@ -1909,7 +1915,7 @@ protected:
case NSOfficePPT::MasterTitle: case NSOfficePPT::MasterTitle:
case NSOfficePPT::VerticalTextTitle: case NSOfficePPT::VerticalTextTitle:
{ {
pTextSettings->m_lTextType = 1; pTextSettings->m_lStyleThemeIndex = 1;
if (NSOfficePPT::_Title != eTypeMaster) if (NSOfficePPT::_Title != eTypeMaster)
{ {
...@@ -1924,7 +1930,7 @@ protected: ...@@ -1924,7 +1930,7 @@ protected:
case NSOfficePPT::CenteredTitle: case NSOfficePPT::CenteredTitle:
case NSOfficePPT::MasterCenteredTitle: case NSOfficePPT::MasterCenteredTitle:
{ {
pTextSettings->m_lTextType = 1; pTextSettings->m_lStyleThemeIndex = 1;
if (NSOfficePPT::_Title != eTypeMaster) if (NSOfficePPT::_Title != eTypeMaster)
{ {
...@@ -1944,9 +1950,9 @@ protected: ...@@ -1944,9 +1950,9 @@ protected:
case NSOfficePPT::MasterSubtitle: case NSOfficePPT::MasterSubtitle:
case NSOfficePPT::Subtitle: case NSOfficePPT::Subtitle:
{ {
pTextSettings->m_lTextType = 2; pTextSettings->m_lStyleThemeIndex = 2;
if (NSOfficePPT::_Body != eTypeMaster) if ((NSOfficePPT::_Body != eTypeMaster) || !pLayout)
{ {
if (0 <= nTextMasterType && nTextMasterType < 9) if (0 <= nTextMasterType && nTextMasterType < 9)
{ {
...@@ -1958,9 +1964,9 @@ protected: ...@@ -1958,9 +1964,9 @@ protected:
} }
default: default:
{ {
pTextSettings->m_lTextType = 3; pTextSettings->m_lStyleThemeIndex = 3;
if (NSOfficePPT::Other != eTypeMaster) if ((NSOfficePPT::Other != eTypeMaster) || !pLayout)
{ {
if (0 <= nTextMasterType && nTextMasterType < 9) if (0 <= nTextMasterType && nTextMasterType < 9)
{ {
...@@ -2016,6 +2022,7 @@ protected: ...@@ -2016,6 +2022,7 @@ protected:
{ {
pTextSettings->m_oLayoutStyles = pElementLayoutPH->m_oShape.m_oText.m_oStyles; pTextSettings->m_oLayoutStyles = pElementLayoutPH->m_oShape.m_oText.m_oStyles;
pTextSettings->m_lTextType = pElementLayoutPH->m_oShape.m_oText.m_lTextType; pTextSettings->m_lTextType = pElementLayoutPH->m_oShape.m_oText.m_lTextType;
pTextSettings->m_lStyleThemeIndex = pElementLayoutPH->m_oShape.m_oText.m_lStyleThemeIndex;
} }
else else
{ {
...@@ -2025,13 +2032,13 @@ protected: ...@@ -2025,13 +2032,13 @@ protected:
case NSOfficePPT::MasterTitle: case NSOfficePPT::MasterTitle:
case NSOfficePPT::VerticalTextTitle: case NSOfficePPT::VerticalTextTitle:
{ {
pTextSettings->m_lTextType = 1; pTextSettings->m_lStyleThemeIndex = 1;
break; break;
} }
case NSOfficePPT::CenteredTitle: case NSOfficePPT::CenteredTitle:
case NSOfficePPT::MasterCenteredTitle: case NSOfficePPT::MasterCenteredTitle:
{ {
pTextSettings->m_lTextType = 1; pTextSettings->m_lStyleThemeIndex = 1;
break; break;
} }
case NSOfficePPT::Body: case NSOfficePPT::Body:
...@@ -2040,12 +2047,12 @@ protected: ...@@ -2040,12 +2047,12 @@ protected:
case NSOfficePPT::MasterNotesBody: case NSOfficePPT::MasterNotesBody:
case NSOfficePPT::VerticalTextBody: case NSOfficePPT::VerticalTextBody:
{ {
pTextSettings->m_lTextType = 2; pTextSettings->m_lStyleThemeIndex = 2;
break; break;
} }
default: default:
{ {
pTextSettings->m_lTextType = 3; pTextSettings->m_lStyleThemeIndex = 3;
break; break;
} }
} }
...@@ -2053,7 +2060,7 @@ protected: ...@@ -2053,7 +2060,7 @@ protected:
} }
else else
{ {
pTextSettings->m_lTextType = 0; pTextSettings->m_lStyleThemeIndex = 0;
} }
// (persist own) - m_oStyles // (persist own) - m_oStyles
...@@ -2124,18 +2131,20 @@ protected: ...@@ -2124,18 +2131,20 @@ protected:
} }
StreamUtils::StreamSeek(lPosition, oElemInfo.m_pStream); StreamUtils::StreamSeek(lPosition, oElemInfo.m_pStream);
} }
pShape->m_oShape.m_oText.RecalcParagraphsPPT(pTheme); pShape->m_oShape.m_oText.RecalcParagraphsPPT();
ApplyThemeStyle(pElem, pTheme, master_levels);
if (pShape->m_oActions.m_bPresent) if (pShape->m_oActions.m_bPresent)
{ {
//todooo //todooo - 1-(34).ppt
/* NSPresentationEditor::CColor oColor; NSPresentationEditor::CColor oColor;
if ((NULL != pSlide) && !pSlide->m_bUseLayoutColorScheme) oColor = pSlide->GetColor(11); if ((NULL != pSlide) && !pSlide->m_bUseLayoutColorScheme) oColor = pSlide->GetColor(11);
else if ((NULL != pLayout) && (!pLayout->m_bUseThemeColorScheme)) oColor = pLayout->GetColor(11); else if ((NULL != pLayout) && (!pLayout->m_bUseThemeColorScheme)) oColor = pLayout->GetColor(11);
else if (NULL != pTheme) oColor = pTheme->GetColor(11); else if (NULL != pTheme) oColor = pTheme->GetColor(11);
oColor.m_lSchemeIndex = 1*/1; oColor.m_lSchemeIndex = 11;
/*ApplyHyperlink(pShape, oColor);*/ ApplyHyperlink(pShape, oColor);
} }
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShape->m_oShape.m_pShape); CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShape->m_oShape.m_pShape);
......
...@@ -19,6 +19,7 @@ public: ...@@ -19,6 +19,7 @@ public:
std::wstring m_strText; std::wstring m_strText;
DWORD m_nTextType; DWORD m_nTextType;
DWORD m_lStyleThemeIndex;
public: public:
CTextFullSettings() : m_arRanges() CTextFullSettings() : m_arRanges()
...@@ -28,6 +29,7 @@ public: ...@@ -28,6 +29,7 @@ public:
m_pTextRuler = NULL; m_pTextRuler = NULL;
m_nTextType = 0xFFFFFFFF; m_nTextType = 0xFFFFFFFF;
m_lStyleThemeIndex = 0; //default
m_strText.clear(); m_strText.clear();
} }
CTextFullSettings(const CTextFullSettings& oSrc) CTextFullSettings(const CTextFullSettings& oSrc)
...@@ -39,6 +41,7 @@ public: ...@@ -39,6 +41,7 @@ public:
m_pTextStyleProp = oSrc.m_pTextStyleProp; m_pTextStyleProp = oSrc.m_pTextStyleProp;
m_pTextSpecInfo = oSrc.m_pTextSpecInfo; m_pTextSpecInfo = oSrc.m_pTextSpecInfo;
m_pTextRuler = oSrc.m_pTextRuler; m_pTextRuler = oSrc.m_pTextRuler;
m_lStyleThemeIndex = oSrc.m_lStyleThemeIndex;
m_nTextType = oSrc.m_nTextType; m_nTextType = oSrc.m_nTextType;
m_strText = oSrc.m_strText; m_strText = oSrc.m_strText;
...@@ -59,6 +62,8 @@ public: ...@@ -59,6 +62,8 @@ public:
return m_strText; return m_strText;
pTextAttributes->m_lTextType = m_nTextType; pTextAttributes->m_lTextType = m_nTextType;
pTextAttributes->m_lStyleThemeIndex = m_lStyleThemeIndex;
if (NULL != m_pTextStyleProp) if (NULL != m_pTextStyleProp)
NSPresentationEditor::ConvertPPTTextToEditorStructure(m_pTextStyleProp->m_arrPFs, m_pTextStyleProp->m_arrCFs, m_strText, *pTextAttributes); NSPresentationEditor::ConvertPPTTextToEditorStructure(m_pTextStyleProp->m_arrPFs, m_pTextStyleProp->m_arrCFs, m_strText, *pTextAttributes);
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;../../../DesktopEditor/freetype-2.5.2/include&quot;" AdditionalIncludeDirectories="&quot;../../../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_SVG_CONVERT_TO_IMAGE_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;_PRESENTATION_WRITER_" PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
...@@ -986,46 +986,6 @@ ...@@ -986,46 +986,6 @@
RelativePath="..\..\..\ASCPresentationEditor\PPTXWriter\StylesWriter.h" RelativePath="..\..\..\ASCPresentationEditor\PPTXWriter\StylesWriter.h"
> >
</File> </File>
<File
RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\SVGConverter.cpp"
>
</File>
<File
RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\SVGConverter.h"
>
</File>
<File
RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\SVGFramework.cpp"
>
</File>
<File
RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\SVGFramework.h"
>
</File>
<File
RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\SVGTransformer.cpp"
>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\SVGTransformer.h"
>
</File>
<File <File
RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\TextAttributesEx.cpp" RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\TextAttributesEx.cpp"
> >
......
...@@ -1092,8 +1092,8 @@ namespace NSPresentationEditor ...@@ -1092,8 +1092,8 @@ namespace NSPresentationEditor
void SetDefaultParams() void SetDefaultParams()
{ {
Visible = false; Visible = false;
DistanceX = 0.1; DistanceX = 0.5;
DistanceY = 0.1; DistanceY = 0.5;
BlurSize = 0; BlurSize = 0;
Alpha = 255; Alpha = 255;
......
...@@ -2,14 +2,6 @@ ...@@ -2,14 +2,6 @@
#include "Theme.h" #include "Theme.h"
#include "Shapes/Shape.h" #include "Shapes/Shape.h"
#ifdef _SVG_CONVERT_TO_IMAGE_
#include "SVGTransformer.h"
#endif
#ifdef _PRESENTATION_WRITER_
#include "SVGConverter.h"
#endif
#ifndef DISABLE_FILE_DOWNLOADER #ifndef DISABLE_FILE_DOWNLOADER
#include "../../Common/FileDownloader.h" #include "../../Common/FileDownloader.h"
#endif #endif
...@@ -505,73 +497,73 @@ namespace NSPresentationEditor ...@@ -505,73 +497,73 @@ namespace NSPresentationEditor
{ {
} }
virtual void WriteToXml(XmlUtils::CXmlWriter& oWriter) //virtual void WriteToXml(XmlUtils::CXmlWriter& oWriter)
{ //{
CString strXml = SaveToXML(); // CString strXml = SaveToXML();
oWriter.WriteString(strXml); // oWriter.WriteString(strXml);
} //}
virtual void ReadFromXml(XmlUtils::CXmlNode& oNode) //virtual void ReadFromXml(XmlUtils::CXmlNode& oNode)
{ //{
} //}
virtual CString SaveToXML() //virtual CString SaveToXML()
{ //{
if (!m_oAnimations.m_arAnimations.empty()) // if (!m_oAnimations.m_arAnimations.empty())
return ToAnimationXml(); // return ToAnimationXml();
//
CGeomShapeInfo oInfo; // CGeomShapeInfo oInfo;
oInfo.SetBounds(m_rcBounds); // oInfo.SetBounds(m_rcBounds);
oInfo.m_dRotate = m_dRotate; // oInfo.m_dRotate = m_dRotate;
oInfo.m_bFlipH = m_bFlipH; // oInfo.m_bFlipH = m_bFlipH;
oInfo.m_bFlipV = m_bFlipV; // oInfo.m_bFlipV = m_bFlipV;
return m_oShape.ToXml(oInfo, m_oMetric, m_dStartTime, m_dEndTime, m_pTheme, m_pLayout); // return m_oShape.ToXml(oInfo, m_oMetric, m_dStartTime, m_dEndTime, m_pTheme, m_pLayout);
} //}
CString ToAnimationXml() //CString ToAnimationXml()
{ //{
CGeomShapeInfo oInfo; // CGeomShapeInfo oInfo;
oInfo.SetBounds(m_rcBounds); // oInfo.SetBounds(m_rcBounds);
oInfo.m_dRotate = m_dRotate; // oInfo.m_dRotate = m_dRotate;
oInfo.m_bFlipH = m_bFlipH; // oInfo.m_bFlipH = m_bFlipH;
oInfo.m_bFlipV = m_bFlipV; // oInfo.m_bFlipV = m_bFlipV;
m_oAnimations.m_dSlideWidth = m_oMetric.m_lMillimetresHor; // m_oAnimations.m_dSlideWidth = m_oMetric.m_lMillimetresHor;
m_oAnimations.m_dSlideHeight = m_oMetric.m_lMillimetresVer; // m_oAnimations.m_dSlideHeight = m_oMetric.m_lMillimetresVer;
CString timeXML; // CString timeXML;
timeXML.Format(_T("<timeline type = \"1\" begin=\"%f\" end=\"%f\" fadein=\"0\" fadeout=\"0\" completeness=\"1.0\"/> "), m_dStartTime, m_dEndTime ); // timeXML.Format(_T("<timeline type = \"1\" begin=\"%f\" end=\"%f\" fadein=\"0\" fadeout=\"0\" completeness=\"1.0\"/> "), m_dStartTime, m_dEndTime );
//
CString baseXML = m_oShape.ToXml(oInfo, m_oMetric, m_dStartTime, m_dEndTime, m_pTheme, m_pLayout); // CString baseXML = m_oShape.ToXml(oInfo, m_oMetric, m_dStartTime, m_dEndTime, m_pTheme, m_pLayout);
if ( -1 != baseXML.Find ( _T("<ImagePaint-DrawTextEx") ) ) // if ( -1 != baseXML.Find ( _T("<ImagePaint-DrawTextEx") ) )
{ // {
CString sBounds; // FIX // CString sBounds; // FIX
sBounds.Format(_T("<bounds left='%d' top='%d' right='%d' bottom='%d'/>"), // sBounds.Format(_T("<bounds left='%d' top='%d' right='%d' bottom='%d'/>"),
(LONG)m_rcBounds.left, (LONG)m_rcBounds.top, (LONG)m_rcBounds.right, (LONG)m_rcBounds.bottom); // (LONG)m_rcBounds.left, (LONG)m_rcBounds.top, (LONG)m_rcBounds.right, (LONG)m_rcBounds.bottom);
CString sReplace = m_oAnimations.ToXml(m_dStartTime, m_dEndTime) + timeXML + sBounds + _T("</ImagePaint-DrawTextAnimateEx>"); // CString sReplace = m_oAnimations.ToXml(m_dStartTime, m_dEndTime) + timeXML + sBounds + _T("</ImagePaint-DrawTextAnimateEx>");
//
baseXML.Replace ( _T("</ImagePaint-DrawTextEx>"), sReplace ); // baseXML.Replace ( _T("</ImagePaint-DrawTextEx>"), sReplace );
baseXML.Replace ( _T("<ImagePaint-DrawTextEx"), _T("<ImagePaint-DrawTextAnimateEx") ); // baseXML.Replace ( _T("<ImagePaint-DrawTextEx"), _T("<ImagePaint-DrawTextAnimateEx") );
} // }
if ( -1 != baseXML.Find ( _T("<ImagePaint-DrawGraphicPath") ) ) // if ( -1 != baseXML.Find ( _T("<ImagePaint-DrawGraphicPath") ) )
{ // {
CString sAnim = m_oAnimations.ToXml(m_dStartTime, m_dEndTime, true); // CString sAnim = m_oAnimations.ToXml(m_dStartTime, m_dEndTime, true);
if (sAnim.GetLength()) // if (sAnim.GetLength())
{ // {
CString sReplace = sAnim + timeXML + _T("</ImagePaint-DrawGraphicPathAnimate>"); // CString sReplace = sAnim + timeXML + _T("</ImagePaint-DrawGraphicPathAnimate>");
//
baseXML.Replace ( _T("</ImagePaint-DrawGraphicPath>"), sReplace ); // baseXML.Replace ( _T("</ImagePaint-DrawGraphicPath>"), sReplace );
baseXML.Replace ( _T("<ImagePaint-DrawGraphicPath"), _T("<ImagePaint-DrawGraphicPathAnimate") ); // baseXML.Replace ( _T("<ImagePaint-DrawGraphicPath"), _T("<ImagePaint-DrawGraphicPathAnimate") );
} // }
} // }
//
return baseXML; // return baseXML;
} //}
virtual IElement* CreateDublicate() virtual IElement* CreateDublicate()
{ {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#include "../../DesktopEditor/graphics/IRenderer.h"
#include "SVGTransformer.h"
//HRESULT SVGTransformer::LoadFile (BSTR bstrFile)
//{
// m_oStorage.Clear();
//
// m_oXmlParser.SetWorkingDirectory(FileUtils::FilePath(CString(bstrFile)));
// m_oRender.SetWorkingDirectory(FileUtils::FilePath(CString(bstrFile)));
// m_oStorage.SetWorkingDirectory(FileUtils::FilePath(CString(bstrFile)));
//
// if (0 == m_oXmlParser.LoadFromFile (CString(bstrFile), &m_oStorage))
// return AVS_ERROR_FILEFORMAT;
//
// return S_OK;
//}
HRESULT SVGTransformer::Load (CString strXml)
{
m_oStorage.Clear();
if (0 == m_oXmlParser.LoadFromString (strXml, &m_oStorage))
return S_FALSE;
return S_OK;
}
HRESULT SVGTransformer::Draw (void* pUnk, double dX, double dY, double dWidth, double dHeight)
{
if (NULL == pUnk)
return S_FALSE;
IRenderer* render = (IRenderer*)pUnk;
//pUnk->QueryInterface (&render);
//pUnk->Release();
if (NULL == render)
return S_FALSE;
m_oRender.SetCSS(m_oXmlParser.GetCSS());
m_oRender.Draw(&m_oStorage, render, m_oXmlParser.GetUnitSystem());
return S_OK;
}
HRESULT SVGTransformer::get_Width (LONG* pWidth)
{
*pWidth = m_oXmlParser.GetWidth();
return S_OK;
}
HRESULT SVGTransformer::get_Height (LONG* pHeight)
{
*pHeight = m_oXmlParser.GetHeight();
return S_OK;
}
HRESULT SVGTransformer::get_Metrics (LONG* pMetrics)
{
*pMetrics = m_oXmlParser.GetMetics();
return S_OK;
}
//
//HRESULT SVGTransformer::SetAdditionalParam (BSTR ParamName, VARIANT ParamValue)
//{
// if (CString(L"DefaultWidth") == CComBSTR (ParamName))
// {
// m_oXmlParser.SetDefaultWidth(ParamValue.lVal);
// return S_OK;
// }
//
// if (CString(L"DefaultHeight") == CComBSTR (ParamName))
// {
// m_oXmlParser.SetDefaultHeight(ParamValue.lVal);
// return S_OK;
// }
//
// if (CString (L"WorkingDirectory") == ParamName)
// {
// m_oXmlParser.SetWorkingDirectory((CString)ParamValue.bstrVal);
// m_oRender.SetWorkingDirectory((CString)ParamValue.bstrVal);
// m_oStorage.SetWorkingDirectory((CString)ParamValue.bstrVal);
//
// return S_OK;
// }
//
// return S_OK;
//}
//
//HRESULT SVGTransformer::GetAdditionalParam (BSTR ParamName, VARIANT* ParamValue)
//{
// return S_OK;
//}
\ No newline at end of file
#pragma once
//#include "../../../Interfaces/AVSRenderer.h"
//#include "../../../../../AVSOfficeStudio/Common/OfficeFileErrorDescription.h"
//#include "../../../../../../../Common/GdiPlusEx.h"
//#include "../../DesktopEditor/graphics/IRenderer.h"
#include "SVGFramework.h"
// ISVGTransformer
//[
// object,
// uuid("89CCD2D4-3A3B-438C-A45F-7401AFB901A2"),
// dual, helpstring("ISVGTransformer Interface"),
// pointer_default(unique)
//]
//__interface ISVGTransformer : IDispatch
//{
// [id(10101)] HRESULT LoadFile([in] BSTR File);
// [id(10102)] HRESULT Load([in] BSTR Str);
//
// [id(10103)] HRESULT Draw([in] IUnknown* pUnk, [in] double dX, [in] double dY, [in] double dWidth, [in] double dHeight);
// [id(10104), propget] HRESULT Width([out, retval] LONG* Width);
// [id(10105), propget] HRESULT Height([out, retval] LONG* Height);
// [id(10106), propget] HRESULT Metrics([out, retval] LONG* Metrics);
//
// [id(10201)] HRESULT SetAdditionalParam([in] BSTR ParamName, [in] VARIANT ParamValue);
// [id(10202)] HRESULT GetAdditionalParam([in] BSTR ParamName, [out] VARIANT * ParamValue);
//};
//
//// _ISVGDrawerEvents
//[
// dispinterface,
// uuid("541E44F9-BDE1-4425-BE00-9D952CE2A565"),
// helpstring("_ISVGTransformerEvents Interface")
//]
//__interface _ISVGTransformerEvents
//{
//
//};
//
//// CSVGDrawer
//
//[
// coclass,
// default(ISVGTransformer, _ISVGTransformerEvents),
// threading(apartment),
// event_source(com),
// vi_progid("AVSOfficeSVGFile.SVGTransformer"),
// progid("AVSOfficeSVGFile.SVGTransformer.1"),
// version(1.0),
// uuid("AB7920A5-428A-44FD-9C36-2398FA802F74"),
// helpstring("SVGDrawer Class")
//]
class /*ATL_NO_VTABLE */SVGTransformer /*: public ISVGTransformer*/
{
public:
SVGTransformer()
{
//m_oGdiPlusInit.Init();
}
//__event __interface _ISVGTransformerEvents;
//DECLARE_PROTECT_FINAL_CONSTRUCT()
//HRESULT FinalConstruct()
//{
// return S_OK;
//}
//void FinalRelease()
//{
//}
public:
//HRESULT ( LoadFile )( BSTR File );
HRESULT ( Load )( CString Str );
HRESULT ( Draw )( void* pRender, double dX, double dY, double dWidth, double dHeight );
HRESULT ( get_Width ) ( LONG* pWidth );
HRESULT ( get_Height ) ( LONG* pHeight );
HRESULT ( get_Metrics ) ( LONG* pMetrics );
//HRESULT ( SetAdditionalParam )( BSTR ParamName, VARIANT ParamValue );
//HRESULT ( GetAdditionalParam )( BSTR ParamName, VARIANT* ParamValue );
private:
//CGdiPlusInit m_oGdiPlusInit;
SVG::Parser m_oXmlParser;
SVG::Storage m_oStorage;
SVG::Painter m_oRender;
};
...@@ -115,14 +115,14 @@ public: ...@@ -115,14 +115,14 @@ public:
} }
virtual CString GetTextXml(CGeomShapeInfo& oGeomInfo, CMetricInfo& pInfo, double dStartTime, double dEndTime, CTheme* pTheme, CLayout* pLayout) //virtual CString GetTextXml(CGeomShapeInfo& oGeomInfo, CMetricInfo& pInfo, double dStartTime, double dEndTime, CTheme* pTheme, CLayout* pLayout)
{ //{
if (m_oText.IsEmptyText()) // if (m_oText.IsEmptyText())
return _T(""); // return _T("");
GetTextRect(oGeomInfo); // GetTextRect(oGeomInfo);
return m_oText.ToString(oGeomInfo, pInfo, dStartTime, dEndTime, pTheme, pLayout); // return m_oText.ToString(oGeomInfo, pInfo, dStartTime, dEndTime, pTheme, pLayout);
} //}
//virtual CString GetBrushXml() //virtual CString GetBrushXml()
...@@ -285,29 +285,29 @@ public: ...@@ -285,29 +285,29 @@ public:
oInfo.bottom = dTop + dHeight; oInfo.bottom = dTop + dHeight;
} }
virtual CString ToXml(CGeomShapeInfo& oGeomInfo, CMetricInfo& pInfo, double dStartTime, double dEndTime, CTheme* pTheme, CLayout* pLayout) //virtual CString ToXml(CGeomShapeInfo& oGeomInfo, CMetricInfo& pInfo, double dStartTime, double dEndTime, CTheme* pTheme, CLayout* pLayout)
{ //{
CString strImageTransform = _T(""); // CString strImageTransform = _T("");
oGeomInfo.m_dLimoX = m_lLimoX; // oGeomInfo.m_dLimoX = m_lLimoX;
oGeomInfo.m_dLimoY = m_lLimoY; // oGeomInfo.m_dLimoY = m_lLimoY;
m_pShape->m_oPath.SetCoordsize((LONG)m_dWidthLogic, (LONG)m_dHeightLogic); // m_pShape->m_oPath.SetCoordsize((LONG)m_dWidthLogic, (LONG)m_dHeightLogic);
//
CBrush brush; // // CBrush brush; //
CPen pen; // CPen pen;
CString strDrawing = m_pShape->ToXML(oGeomInfo, pInfo, dStartTime, dEndTime, brush, pen); // CString strDrawing = m_pShape->ToXML(oGeomInfo, pInfo, dStartTime, dEndTime, brush, pen);
if (m_lDrawType & c_ShapeDrawType_Graphic) // if (m_lDrawType & c_ShapeDrawType_Graphic)
{ // {
strImageTransform += strDrawing; // strImageTransform += strDrawing;
} // }
if (m_lDrawType & c_ShapeDrawType_Text) // if (m_lDrawType & c_ShapeDrawType_Text)
{ // {
strImageTransform += GetTextXml(oGeomInfo, pInfo, dStartTime, dEndTime, pTheme, pLayout); // strImageTransform += GetTextXml(oGeomInfo, pInfo, dStartTime, dEndTime, pTheme, pLayout);
} // }
return strImageTransform; // return strImageTransform;
} //}
void ToRenderer(IRenderer* pRenderer, CGeomShapeInfo& oGeomInfo, CMetricInfo& pInfo, double dStartTime, double dEndTime) void ToRenderer(IRenderer* pRenderer, CGeomShapeInfo& oGeomInfo, CMetricInfo& pInfo, double dStartTime, double dEndTime)
{ {
......
...@@ -3,12 +3,8 @@ ...@@ -3,12 +3,8 @@
namespace NSPresentationEditor namespace NSPresentationEditor
{ {
CString CTextAttributesEx::ToString(CGeomShapeInfo& oInfo, CMetricInfo& pMetricInfo, double dStartTime, double dEndTime, CTheme* pTheme, CLayout* pLayout)
{
return L"";
}
void CTextAttributesEx::RecalcParagraphsPPT(CTheme* pTheme) void CTextAttributesEx::RecalcParagraphsPPT()
{ {
for (int i = 0; i < m_arParagraphs.size(); ++i) for (int i = 0; i < m_arParagraphs.size(); ++i)
{ {
...@@ -55,10 +51,25 @@ namespace NSPresentationEditor ...@@ -55,10 +51,25 @@ namespace NSPresentationEditor
} }
} }
} }
}
void CTextAttributesEx::RecalcParagraphs(CTheme* pTheme)
{
#ifdef PPT_DEF
RecalcParagraphsPPT();
ApplyThemeStyle(pTheme);
#else
size_t nCount = m_arParagraphs.size();
for (size_t i = 0; i < nCount; ++i)
{
m_arParagraphs[i].CheckErrors();
}
#endif
}
void CTextAttributesEx::ApplyThemeStyle(CTheme* pTheme)
{
if (NULL != pTheme) if (NULL != pTheme)
{ {
//
size_t nCountPFs = m_arParagraphs.size(); size_t nCountPFs = m_arParagraphs.size();
for (size_t nIndexP = 0; nIndexP < nCountPFs; ++nIndexP) for (size_t nIndexP = 0; nIndexP < nCountPFs; ++nIndexP)
{ {
...@@ -76,33 +87,33 @@ namespace NSPresentationEditor ...@@ -76,33 +87,33 @@ namespace NSPresentationEditor
nullable_base<LONG> spaceBefore; nullable_base<LONG> spaceBefore;
if (-1 != m_lTextType && m_lTextType < 4 && pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel].is_init()) if (-1 != m_lStyleThemeIndex && m_lStyleThemeIndex < 4 && pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel].is_init())
{ {
if (pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.hasBullet.is_init()) if (pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.hasBullet.is_init())
{ {
hasBullet = pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.hasBullet; hasBullet = pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.hasBullet;
if (pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.bulletColor.is_init()) if (pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.bulletColor.is_init())
bulletColor = pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.bulletColor; bulletColor = pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.bulletColor;
if (pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.bulletChar.is_init() ) if (pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.bulletChar.is_init() )
{ {
bulletFontRef = pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.bulletFontRef; bulletFontRef = pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.bulletFontRef;
bulletChar = pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.bulletChar; bulletChar = pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.bulletChar;
} }
if (pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.bulletSize.is_init()) if (pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.bulletSize.is_init())
bulletSize = pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.bulletSize; bulletSize = pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.bulletSize;
} }
if (pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.leftMargin.is_init()) if (pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.leftMargin.is_init())
margin = pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.leftMargin; margin = pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.leftMargin;
if (pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.indent.is_init()) if (pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.indent.is_init())
indent = pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.indent; indent = pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.indent;
if (pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.spaceBefore.is_init()) if (pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.spaceBefore.is_init())
spaceBefore = pTheme->m_pStyles[m_lTextType].m_pLevels[lLevel]->m_oPFRun.spaceBefore; spaceBefore = pTheme->m_pStyles[m_lStyleThemeIndex].m_pLevels[lLevel]->m_oPFRun.spaceBefore;
} }
if (m_oLayoutStyles.m_pLevels[lLevel].is_init()) if (m_oLayoutStyles.m_pLevels[lLevel].is_init())
{ {
...@@ -212,19 +223,6 @@ namespace NSPresentationEditor ...@@ -212,19 +223,6 @@ namespace NSPresentationEditor
ApplyRuler(pTheme); ApplyRuler(pTheme);
} }
void CTextAttributesEx::RecalcParagraphs(CTheme* pTheme)
{
#ifdef PPT_DEF
RecalcParagraphsPPT(pTheme);
#else
size_t nCount = m_arParagraphs.size();
for (size_t i = 0; i < nCount; ++i)
{
m_arParagraphs[i].CheckErrors();
}
#endif
}
void CTextAttributesEx::ApplyRuler(CTheme* pTheme) void CTextAttributesEx::ApplyRuler(CTheme* pTheme)
{ {
if (m_oRuler.tabsStops.size() > 0 || m_oRuler.DefaultTabSize.is_init())//presentacio1.ppt 2 if (m_oRuler.tabsStops.size() > 0 || m_oRuler.DefaultTabSize.is_init())//presentacio1.ppt 2
......
...@@ -19,6 +19,7 @@ namespace NSPresentationEditor ...@@ -19,6 +19,7 @@ namespace NSPresentationEditor
LONG m_lTextMasterType; // only ppt property LONG m_lTextMasterType; // only ppt property
public: public:
DWORD m_lTextType; DWORD m_lTextType;
DWORD m_lStyleThemeIndex;
int m_lPlaceholderType; int m_lPlaceholderType;
int m_lPlaceholderID; int m_lPlaceholderID;
...@@ -56,6 +57,8 @@ namespace NSPresentationEditor ...@@ -56,6 +57,8 @@ namespace NSPresentationEditor
m_lPlaceholderType = -1; m_lPlaceholderType = -1;
m_lPlaceholderID = -1; m_lPlaceholderID = -1;
m_lStyleThemeIndex = 0;//default
m_lFontRef = -1; m_lFontRef = -1;
m_bIsSlideFontRef = false; m_bIsSlideFontRef = false;
...@@ -105,7 +108,6 @@ namespace NSPresentationEditor ...@@ -105,7 +108,6 @@ namespace NSPresentationEditor
m_arParagraphs.clear(); m_arParagraphs.clear();
} }
CString ToString(CGeomShapeInfo& oInfo, CMetricInfo& pMetricInfo, double dStartTime, double dEndTime, CTheme* pTheme, CLayout* pLayout);
public: public:
inline void NormalizeString(CString& strText) inline void NormalizeString(CString& strText)
...@@ -118,7 +120,8 @@ namespace NSPresentationEditor ...@@ -118,7 +120,8 @@ namespace NSPresentationEditor
} }
void RecalcParagraphs (CTheme* pTheme = NULL); void RecalcParagraphs (CTheme* pTheme = NULL);
void RecalcParagraphsPPT(CTheme* pTheme = NULL); void RecalcParagraphsPPT();
void ApplyThemeStyle (CTheme* pTheme = NULL);
void ApplyRuler (CTheme* pTheme); void ApplyRuler (CTheme* pTheme);
void ApplyRuler (CTextPFRun* pPar, WORD lIndentLevel); void ApplyRuler (CTextPFRun* pPar, WORD lIndentLevel);
......
...@@ -857,8 +857,9 @@ namespace NSPresentationEditor ...@@ -857,8 +857,9 @@ namespace NSPresentationEditor
class CParagraph class CParagraph
{ {
public: public:
LONG m_lTextType; int m_lTextType;
LONG m_lTextLevel; int m_lTextLevel;
int m_lStyleThemeIndex;
CTextPFRun m_oPFRun; CTextPFRun m_oPFRun;
std::vector<CSpan> m_arSpans; std::vector<CSpan> m_arSpans;
...@@ -868,6 +869,7 @@ namespace NSPresentationEditor ...@@ -868,6 +869,7 @@ namespace NSPresentationEditor
{ {
m_lTextType = 0; m_lTextType = 0;
m_lTextLevel = 0; m_lTextLevel = 0;
m_lStyleThemeIndex = 0;
} }
CParagraph(const CParagraph& oSrc) CParagraph(const CParagraph& oSrc)
{ {
...@@ -877,6 +879,7 @@ namespace NSPresentationEditor ...@@ -877,6 +879,7 @@ namespace NSPresentationEditor
{ {
m_lTextLevel = oSrc.m_lTextLevel; m_lTextLevel = oSrc.m_lTextLevel;
m_lTextType = oSrc.m_lTextType; m_lTextType = oSrc.m_lTextType;
m_lStyleThemeIndex = oSrc.m_lStyleThemeIndex;
m_oPFRun = oSrc.m_oPFRun; m_oPFRun = oSrc.m_oPFRun;
......
#pragma once #pragma once
#include "Structures.h" #include "Structures.h"
#include "Layout.h" #include "Layout.h"
#include "../PPTXWriter/CSS.h" //#include "../PPTXWriter/CSS.h"
namespace NSPresentationEditor namespace NSPresentationEditor
{ {
......
This diff is collapsed.
...@@ -398,9 +398,19 @@ void NSPresentationEditor::CPPTXWriter::WritePresInfo() ...@@ -398,9 +398,19 @@ void NSPresentationEditor::CPPTXWriter::WritePresInfo()
} }
strDefaultTextStyle += _T("</p:defaultTextStyle>"); strDefaultTextStyle += _T("</p:defaultTextStyle>");
CString strPres = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\ CString strPres = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>");
<p:presentation xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" saveSubsetFonts=\"1\">\ strPres += _T("<p:presentation xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" saveSubsetFonts=\"1\"");
<p:sldMasterIdLst>") + strPresMasters + _T("</p:sldMasterIdLst>") + strNotesIDs + _T("<p:sldIdLst>") + strPresSlides + _T("</p:sldIdLst>") + strSizePres + strDefaultTextStyle + _T("</p:presentation>"); if ((m_pUserInfo) && (m_pUserInfo->m_bRtl))
{
strPres += _T(" rtl=\"1\"");
}
strPres += _T(">");
strPres += _T("<p:sldMasterIdLst>") + strPresMasters + _T("</p:sldMasterIdLst>");
strPres += strNotesIDs ;
strPres +=_T("<p:sldIdLst>") + strPresSlides + _T("</p:sldIdLst>");
strPres += strSizePres;
strPres += strDefaultTextStyle;
strPres +=_T("</p:presentation>");
oFile.CreateFile(m_strTempDirectory+ FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("presentation.xml")); oFile.CreateFile(m_strTempDirectory+ FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("presentation.xml"));
oFile.WriteStringUTF8(strPres); oFile.WriteStringUTF8(strPres);
......
#pragma once #pragma once
#include "CSS.h" //#include "CSS.h"
class CStylesWriter class CStylesWriter
{ {
......
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