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

Конвертация ppt -> pptx . Убрана промежуточная конвертация в xml, + crop...

Конвертация ppt -> pptx . Убрана промежуточная конвертация в xml, + crop image, + text anchor, .... Также частично заменен CString на std. Bug 30205.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@64814 954022d7-b5bf-4e40-9824-e11837661b57
parent 1349fbf8
...@@ -72,30 +72,14 @@ HRESULT COfficePPTFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDs ...@@ -72,30 +72,14 @@ HRESULT COfficePPTFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDs
if (0 < ((CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_arUsers.size()) if (0 < ((CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_arUsers.size())
{ {
m_strEditorXml = ((CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_arUsers[0]->ToXmlEditor2();
}
//////////////////////////////////////
if (m_strEditorXml.GetLength() <1) return S_FALSE;
if (sDstPath.length() > 0)
{
NSPresentationEditor::CDocument oPresentationEditor;
NSPresentationEditor::CPPTXWriter oPPTXWriter; NSPresentationEditor::CPPTXWriter oPPTXWriter;
oPresentationEditor.LoadFromXML(m_strEditorXml);
oPPTXWriter.m_strTempDirectory = std_string2string(sDstPath); oPPTXWriter.m_strTempDirectory = std_string2string(sDstPath);
oPPTXWriter.CreateFile(&oPresentationEditor); oPPTXWriter.CreateFile(((CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_arUsers[0]);
oPPTXWriter.CloseFile(); oPPTXWriter.CloseFile();
}
//CloseFile(); нельзя тута- поскольку в Win32 используется PresentationEditor для конвертации xml -> pptx
}
return S_OK; return S_OK;
} }
...@@ -107,6 +91,11 @@ HRESULT COfficePPTFile::GetAdditionalParam (CString sParamName, VARIANT* ParamVa ...@@ -107,6 +91,11 @@ HRESULT COfficePPTFile::GetAdditionalParam (CString sParamName, VARIANT* ParamVa
if (_T("EditorXml") == sParamName) if (_T("EditorXml") == sParamName)
{ {
#if defined(_WIN32) || defined (_WIN64) #if defined(_WIN32) || defined (_WIN64)
if (m_strEditorXml.IsEmpty())
{
m_strEditorXml = ((CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_arUsers[0]->ToXmlEditor2();
}
ParamValue->bstrVal = m_strEditorXml.AllocSysString(); ParamValue->bstrVal = m_strEditorXml.AllocSysString();
#else #else
ParamValue->bstrVal = m_strEditorXml; ParamValue->bstrVal = m_strEditorXml;
......
...@@ -137,20 +137,22 @@ public: ...@@ -137,20 +137,22 @@ public:
void CorrectColorScheme(std::vector<CColor>& oScheme) void CorrectColorScheme(std::vector<CColor>& oScheme)
{ {
if (oScheme.size() < 1) return;
std::vector<CColor> oArrayMem; std::vector<CColor> oArrayMem;
oArrayMem.push_back(oScheme[0]);//0 oArrayMem.push_back(oScheme[0]);//0
oArrayMem.push_back(oScheme[1]);//1 oArrayMem.push_back(oScheme[1]);//1
oArrayMem.push_back(oScheme[2]);//2 oArrayMem.push_back(oScheme[2]);//2
oArrayMem.push_back(oScheme[3]);//3 oArrayMem.push_back(oScheme[3]);//3
oArrayMem.push_back(oScheme[0]);//4 oArrayMem.push_back(oScheme[0]);//4
oArrayMem.push_back(oScheme[5]);//5 //accent1 oArrayMem.push_back(oScheme[4]);//5 //accent1
oArrayMem.push_back(oScheme[6]);//6 //accent2 oArrayMem.push_back(oScheme[5]);//6 //accent2
oArrayMem.push_back(oScheme[7]);//7 //accent3 oArrayMem.push_back(oScheme[0]);//7 //accent3
oArrayMem.push_back(oScheme[5]);//8 //accent4 oArrayMem.push_back(oScheme[5]);//8 //accent4
oArrayMem.push_back(oScheme[6]);//9 //accent5 oArrayMem.push_back(oScheme[4]);//9 //accent5
oArrayMem.push_back(oScheme[7]);//10 //accent6 oArrayMem.push_back(oScheme[7]);//10 //accent6
oArrayMem.push_back(oScheme[5]);//11 //hlink oArrayMem.push_back(oScheme[6]);//11 //hlink
oArrayMem.push_back(oScheme[6]);//12 //folHlink oArrayMem.push_back(oScheme[7]);//12 //folHlink
oArrayMem.push_back(oScheme[0]);//13 //lt1 oArrayMem.push_back(oScheme[0]);//13 //lt1
oArrayMem.push_back(oScheme[1]);//14 //dk1 oArrayMem.push_back(oScheme[1]);//14 //dk1
oArrayMem.push_back(oScheme[2]);//15 //lt2 oArrayMem.push_back(oScheme[2]);//15 //lt2
...@@ -279,6 +281,6 @@ public: ...@@ -279,6 +281,6 @@ public:
return _T("obj"); return _T("obj");
} }
void AddAnimation (DWORD dwSlideID, double Width, double Height, IElement* pElement); void AddAnimation (DWORD dwSlideID, double Width, double Height, IElement* pElement);
void AddAudioTransition (DWORD dwSlideID, CTransition* pTransition, const CString& strFilePath); void AddAudioTransition (DWORD dwSlideID, CTransition* pTransition, const std::wstring& strFilePath);
}; };
...@@ -599,7 +599,19 @@ public: ...@@ -599,7 +599,19 @@ public:
} }
if (bulletChar_) if (bulletChar_)
m_oRun.bulletChar = (WCHAR)StreamUtils::ReadWORD(pStream); {
if (sizeof(wchar_t) == 2)
{
m_oRun.bulletChar = (WCHAR)StreamUtils::ReadWORD(pStream);
}
else
{
unsigned short utf16 = (unsigned short)StreamUtils::ReadWORD(pStream);
std::wstring utf32 = NSFile::CUtf8Converter::GetWStringFromUTF16(&utf16, 1);
if (!utf32.empty())
m_oRun.bulletChar = utf32.c_str()[0];
}
}
if (bulletFontRef_) if (bulletFontRef_)
m_oRun.bulletFontRef = StreamUtils::ReadWORD(pStream); m_oRun.bulletFontRef = StreamUtils::ReadWORD(pStream);
if (bulletSize_) if (bulletSize_)
...@@ -788,11 +800,14 @@ public: ...@@ -788,11 +800,14 @@ public:
oColor.A = 255; oColor.A = 255;
oColor.m_lSchemeIndex = -1; oColor.m_lSchemeIndex = -1;
if (oColorAtom.Index < 10) 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);
} }
else
{
}
m_oRun.Color = oColor; m_oRun.Color = oColor;
} }
......
...@@ -98,9 +98,9 @@ public: ...@@ -98,9 +98,9 @@ public:
size_t nCount = m_parEmptyPictures->size(); size_t nCount = m_parEmptyPictures->size();
if (lIndex > nCount) if (lIndex > nCount)
return 0; return lIndex;
for (size_t nIndex = 0; nIndex < lIndex; ++nIndex) for (size_t nIndex = 0; nIndex < min(lIndex, nCount); ++nIndex)
{ {
if ((*m_parEmptyPictures)[nIndex]) if ((*m_parEmptyPictures)[nIndex])
++lResult; ++lResult;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
class CRecordCString : public CUnknownRecord class CRecordCString : public CUnknownRecord
{ {
public: public:
CStringW m_strText; std::wstring m_strText;
public: public:
...@@ -32,7 +32,7 @@ public: ...@@ -32,7 +32,7 @@ public:
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance)); oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE); oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("String"), (CString)m_strText, &oWriter); CDirectory::WriteValueToNode(_T("String"), std_string2string(m_strText), &oWriter);
oWriter.WriteNodeEnd(strName); oWriter.WriteNodeEnd(strName);
......
...@@ -28,47 +28,64 @@ public: ...@@ -28,47 +28,64 @@ public:
{ {
switch (lType) switch (lType)
{ {
case 0x01: case 0x00: //PT_None
case 0x0D: break;
case 0x11:
return 15; // title case 0x01: //PT_MasterTitle
case 0x02: case 0x0D: //PT_Title
case 0x0E: case 0x11: //PT_VerticalTitle
case 0x06: return 15; // title
case 0x12:
case 0x0C: case 0x02: //PT_MasterBody
return 0; // body case 0x0E: //PT_Body
case 0x03: case 0x06: //PT_MasterNotesBody
case 0x0F: case 0x12: //PT_VerticalBody
return 15; // centerTitle case 0x0C: //PT_NotesBody
case 0x04: return 0; // body
case 0x10:
return 0; // subtitle case 0x03: //PT_MasterCenterTitle
case 0x13: case 0x0F: //PT_CenterTitle
case 0x19: return 3; // ctrTitle
return 9; // object
case 0x05: case 0x04: //PT_MasterSubTitle
case 0x14: case 0x10: //PT_SubTitle
case 0x0B: return 13; // subtitle
return 11; // slideImg
case 0x15: case 0x13: //PT_Object
return 14; // table case 0x19: //PT_VerticalObject
case 0x16: return 9; // object
return 2; // clipArt
case 0x17: case 0x05: //PT_MasterNotesSlideImage
return 1; // chart case 0x14: //PT_Graph //????
case 0x18: case 0x0B: //PT_NotesSlideImage
return 8; // media return 11; // slideImg
case 0x1A:
return 10; // picture case 0x15: //PT_Table
case 0x07: return 14; // table
return 5; // date
case 0x08: case 0x16: //PT_ClipArt
return 12; // sldNum return 2; // clipArt
case 0x09:
return 6; // footer case 0x17: //PT_OrgChart
case 0x0A: return 1; // chart
return 7; // header
case 0x18: //PT_Media
return 8; // media
case 0x1A: //PT_Picture
return 10; // picture
case 0x07: //PT_MasterDate
return 5; // date
case 0x08: //PT_MasterSlideNumber
return 12; // sldNum
case 0x09: //PT_MasterFooter
return 6; // footer
case 0x0A: //PT_MasterHeader
return 7; // header
default: default:
break; break;
} }
...@@ -136,6 +153,16 @@ public: ...@@ -136,6 +153,16 @@ public:
{ {
switch (pProperty->m_ePID) switch (pProperty->m_ePID)
{ {
case wzName:
{
pElement->m_sName = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue /2 - 1);
return true;
}
case wzDescription:
{
pElement->m_sDescription = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue /2 - 1);
return true;
}
case hspMaster: case hspMaster:
{ {
pElement->m_lLayoutID = (LONG)pProperty->m_lValue; pElement->m_lLayoutID = (LONG)pProperty->m_lValue;
...@@ -181,15 +208,44 @@ public: ...@@ -181,15 +208,44 @@ public:
} }
inline void SetUpPropertyImage(CImageElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty) inline void SetUpPropertyImage(CImageElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
{ {
if (SetUpProperty((IElement*)pElement, pTheme, pInfo, pSlide, pProperty)) SetUpProperty((IElement*)pElement, pTheme, pInfo, pSlide, pProperty);
return;
if (Pib == pProperty->m_ePID) switch(pProperty->m_ePID)
{ {
DWORD dwIndex = pInfo->GetIndexPicture(pProperty->m_lValue); case Pib:
{
DWORD dwIndex = pInfo->GetIndexPicture(pProperty->m_lValue);
CString strVal = CDirectory::ToString(dwIndex); CString strVal = CDirectory::ToString(dwIndex);
pElement->m_strFileName = pElement->m_strFileName + strVal + L".jpg"; pElement->m_strFileName = pElement->m_strFileName + strVal.GetBuffer() + L".jpg";
}break;
case pibName:
{
pElement->m_sName = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue /2);
}break;
case cropFromTop:
{
pElement->m_lcropFromTop = pProperty->m_lValue;
pElement->m_bCropEnabled = true;
}break;
case cropFromBottom:
{
pElement->m_lcropFromBottom = pProperty->m_lValue;
pElement->m_bCropEnabled = true;
}break;
case cropFromLeft:
{
pElement->m_lcropFromLeft = pProperty->m_lValue;
pElement->m_bCropEnabled = true;
}break;
case cropFromRight:
{
pElement->m_lcropFromRight = pProperty->m_lValue;
pElement->m_bCropEnabled = true;
}break;
case pibFlags:
{
}break;
} }
} }
inline void SetUpPropertyShape(CShapeElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty) inline void SetUpPropertyShape(CShapeElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
...@@ -279,8 +335,8 @@ public: ...@@ -279,8 +335,8 @@ public:
} }
case NSOfficeDrawing::dyTextTop: case NSOfficeDrawing::dyTextTop:
{ {
//pParentShape->m_dTextMarginY = (double)pProperty->m_lValue / EMU_MM; pParentShape->m_dTextMarginY = (double)pProperty->m_lValue / EMU_MM;
pElemProps->SetAt(CElementProperty::epTextMarginTop, pProperty->m_lValue); //pElemProps->SetAt(CElementProperty::epTextMarginTop, pProperty->m_lValue);
break; break;
} }
case NSOfficeDrawing::dyTextBottom: case NSOfficeDrawing::dyTextBottom:
...@@ -358,15 +414,15 @@ public: ...@@ -358,15 +414,15 @@ public:
CString strVal = CDirectory::ToString(dwIndex); CString strVal = CDirectory::ToString(dwIndex);
int nIndex = pParentShape->m_oBrush.TexturePath.ReverseFind(FILE_SEPARATOR_CHAR); int nIndex = pParentShape->m_oBrush.TexturePath.rfind(FILE_SEPARATOR_CHAR);
int nLen = pParentShape->m_oBrush.TexturePath.GetLength() - 1; int nLen = pParentShape->m_oBrush.TexturePath.length() - 1;
if (nLen != nIndex) if (nLen != nIndex)
{ {
pParentShape->m_oBrush.TexturePath.Delete(nIndex + 1, nLen - nIndex); pParentShape->m_oBrush.TexturePath.erase(nIndex + 1, nLen - nIndex);
} }
//pElemProps->SetAt(CElementProperty::epBrushTxPath, pParentShape->m_oBrush.TexturePath + strVal + L".jpg"); //pElemProps->SetAt(CElementProperty::epBrushTxPath, pParentShape->m_oBrush.TexturePath + strVal + L".jpg");
pParentShape->m_oBrush.TexturePath = pParentShape->m_oBrush.TexturePath + strVal + L".jpg"; pParentShape->m_oBrush.TexturePath = pParentShape->m_oBrush.TexturePath + strVal.GetBuffer() + L".jpg";
break; break;
} }
case NSOfficeDrawing::fillColor: case NSOfficeDrawing::fillColor:
...@@ -621,7 +677,7 @@ public: ...@@ -621,7 +677,7 @@ public:
{ {
if (pProperty->m_bComplex && 0 < pProperty->m_lValue) if (pProperty->m_bComplex && 0 < pProperty->m_lValue)
{ {
CStringW str = CDirectory::BYTEArrayToStringW(pProperty->m_pOptions, pProperty->m_lValue); std::wstring str = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue/2);
//pParentShape->m_oText.m_sText = str; //pParentShape->m_oText.m_sText = str;
} }
break; break;
...@@ -631,8 +687,8 @@ public: ...@@ -631,8 +687,8 @@ public:
{ {
if (pProperty->m_bComplex && 0 < pProperty->m_lValue) if (pProperty->m_bComplex && 0 < pProperty->m_lValue)
{ {
CStringW str = CDirectory::BYTEArrayToStringW(pProperty->m_pOptions, pProperty->m_lValue); std::wstring str = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue/2);
pParentShape->m_oText.m_oAttributes.m_oFont.Name = (CString)str; pParentShape->m_oText.m_oAttributes.m_oFont.Name = std_string2string(str);
//pElemProps->SetAt(CElementProperty::epFontName, (CString)str); //pElemProps->SetAt(CElementProperty::epFontName, (CString)str);
} }
break; break;
...@@ -994,7 +1050,7 @@ public: ...@@ -994,7 +1050,7 @@ public:
CExFilesInfo oInfo; CExFilesInfo oInfo;
CString strPathPicture = _T(""); std::wstring strPathPicture = _T("");
// ( ) // ( )
CExFilesInfo::ExFilesType exType = CExFilesInfo::eftNone; CExFilesInfo::ExFilesType exType = CExFilesInfo::eftNone;
......
...@@ -53,13 +53,13 @@ public: ...@@ -53,13 +53,13 @@ public:
, &pStrUtf32_Conv, &pStrUtf32 [lLen] , &pStrUtf32_Conv, &pStrUtf32 [lLen]
, strictConversion)) , strictConversion))
{ {
m_strFaceName = CString((wchar_t*)pStrUtf32, lLen); m_strFaceName = CString((wchar_t*)pStrUtf32/*, lLen*/);
} }
delete [] pStrUtf32; delete [] pStrUtf32;
} }
else else
{ {
m_strFaceName = CString((wchar_t*)utf16FaceName, lReadByte/2); m_strFaceName = CString((wchar_t*)utf16FaceName/*, lReadByte/2*/); // по факту .. нули нам не нужны
} }
m_lfCharSet = StreamUtils::ReadBYTE(pStream); m_lfCharSet = StreamUtils::ReadBYTE(pStream);
......
...@@ -28,10 +28,9 @@ public: ...@@ -28,10 +28,9 @@ public:
CString strName = GetRecordName((DWORD)m_oHeader.RecType); CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE); oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen)); oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType)); oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance)); oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE); oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("ID"), m_dwID, &oWriter); CDirectory::WriteValueToNode(_T("ID"), m_dwID, &oWriter);
...@@ -40,4 +39,4 @@ public: ...@@ -40,4 +39,4 @@ public:
return oWriter.GetXmlString(); return oWriter.GetXmlString();
} }
}; };
\ No newline at end of file
...@@ -36,8 +36,9 @@ public: ...@@ -36,8 +36,9 @@ public:
m_nNotesIDRef = (UINT)StreamUtils::ReadDWORD(pStream); m_nNotesIDRef = (UINT)StreamUtils::ReadDWORD(pStream);
USHORT nFlag = StreamUtils::ReadWORD(pStream); USHORT nFlag = StreamUtils::ReadWORD(pStream);
m_bMasterObjects = ((nFlag & 0x01) == 0x01);
m_bMasterScheme = ((nFlag & 0x02) == 0x02); m_bMasterObjects = ((nFlag & 0x01) == 0x01);
m_bMasterScheme = ((nFlag & 0x02) == 0x02);
m_bMasterBackground = ((nFlag & 0x04) == 0x04); m_bMasterBackground = ((nFlag & 0x04) == 0x04);
StreamUtils::StreamSkip(2, pStream); StreamUtils::StreamSkip(2, pStream);
......
...@@ -40,15 +40,15 @@ public: ...@@ -40,15 +40,15 @@ public:
RELEASEARRAYOBJECTS(m_pData); RELEASEARRAYOBJECTS(m_pData);
} }
void SaveToFile(CString strFile) void SaveToFile(std::wstring strFile)
{ {
if ((NULL == m_pData) || (0 >= m_lSize)) if ((NULL == m_pData) || (0 >= m_lSize))
return; return;
CFile oFile; NSFile::CFileBinary oFile;
oFile.CreateFile(strFile); oFile.CreateFileW(strFile);
oFile.WriteFile((void*)m_pData, (DWORD)m_lSize); oFile.WriteFile((BYTE*)m_pData, (DWORD)m_lSize);
oFile.CloseFile(); oFile.CloseFile();
ReleaseData(); ReleaseData();
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
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_;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_" 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_;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="3"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="false" Detect64BitPortabilityProblems="false"
...@@ -215,8 +215,8 @@ ...@@ -215,8 +215,8 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
AdditionalIncludeDirectories="&quot;../../../../DesktopEditor/freetype-2.5.2/include&quot;" AdditionalIncludeDirectories="&quot;../../../DesktopEditor/freetype-2.5.2/include&quot;;&quot;C:\_WORK\trunk\ServerComponents\DesktopEditor\freetype-2.5.2\include&quot;"
PreprocessorDefinitions="NDEBUG;_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_;BUILD_CONFIG_FULL_VERSION;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_" PreprocessorDefinitions="NDEBUG;_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_;BUILD_CONFIG_FULL_VERSION;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_;DONT_WRITE_EMBEDDED_FONTS"
StringPooling="true" StringPooling="true"
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
......
...@@ -9,27 +9,27 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeUtilsLib", "..\..\ ...@@ -9,27 +9,27 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeUtilsLib", "..\..\
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTXFormat", "..\..\ASCOfficePPTXFile\PPTXLib\PPTXFormat.vcproj", "{36636678-AE25-4BE6-9A34-2561D1BCF302}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTXFormat", "..\..\ASCOfficePPTXFile\PPTXLib\PPTXFormat.vcproj", "{36636678-AE25-4BE6-9A34-2561D1BCF302}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
{DC24710E-8DF2-4A7A-B7C3-2313E294143C} = {DC24710E-8DF2-4A7A-B7C3-2313E294143C} {DC24710E-8DF2-4A7A-B7C3-2313E294143C} = {DC24710E-8DF2-4A7A-B7C3-2313E294143C}
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCHTMLRenderer", "..\..\ASCHTMLRenderer\ASCHTMLRendererLib.vcproj", "{DC24710E-8DF2-4A7A-B7C3-2313E294143C}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCHTMLRenderer", "..\..\ASCHTMLRenderer\ASCHTMLRendererLib.vcproj", "{DC24710E-8DF2-4A7A-B7C3-2313E294143C}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6} = {3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7} {43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6} = {3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}"
...@@ -47,6 +47,9 @@ EndProject ...@@ -47,6 +47,9 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "..\..\DesktopEditor\freetype-2.5.2\builds\windows\vc2005\freetype.vcproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "..\..\DesktopEditor\freetype-2.5.2\builds\windows\vc2005\freetype.vcproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raster", "..\..\DesktopEditor\raster\raster_vs2005.vcproj", "{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raster", "..\..\DesktopEditor\raster\raster_vs2005.vcproj", "{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}"
ProjectSection(ProjectDependencies) = postProject
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jasper", "..\..\DesktopEditor\cximage\jasper\jasper_vs2005.vcproj", "{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jasper", "..\..\DesktopEditor\cximage\jasper\jasper_vs2005.vcproj", "{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}"
EndProject EndProject
...@@ -62,11 +65,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpsd", "..\..\DesktopEdit ...@@ -62,11 +65,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpsd", "..\..\DesktopEdit
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTFormatLib", "..\PPTFormatLib\Win32\PPTFormatLib.vcproj", "{7B27E40E-F70A-4A74-A77C-0944D7931D15}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTFormatLib", "..\PPTFormatLib\Win32\PPTFormatLib.vcproj", "{7B27E40E-F70A-4A74-A77C-0944D7931D15}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6} = {3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{DC24710E-8DF2-4A7A-B7C3-2313E294143C} = {DC24710E-8DF2-4A7A-B7C3-2313E294143C}
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0} {21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
{DC24710E-8DF2-4A7A-B7C3-2313E294143C} = {DC24710E-8DF2-4A7A-B7C3-2313E294143C}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6} = {3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PptFormatTest", "..\..\Test\Applications\DocxFormatTests\PptFormatTest\win32\PptFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PptFormatTest", "..\..\Test\Applications\DocxFormatTests\PptFormatTest\win32\PptFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
...@@ -78,6 +81,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "..\..\Common\Doc ...@@ -78,6 +81,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "..\..\Common\Doc
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig", "..\..\DesktopEditor\cximage\jbig\jbig_vs2005.vcproj", "{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig", "..\..\DesktopEditor\cximage\jbig\jbig_vs2005.vcproj", "{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig2", "..\..\DesktopEditor\raster\JBig2\win32\jbig2.vcproj", "{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32 Debug|Win32 = Debug|Win32
...@@ -442,6 +447,22 @@ Global ...@@ -442,6 +447,22 @@ Global
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Unicode Release|Win32.Build.0 = Unicode Release|Win32
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Unicode Release|x64.ActiveCfg = Unicode Release|x64 {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Unicode Release|x64.ActiveCfg = Unicode Release|x64
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Unicode Release|x64.Build.0 = Unicode Release|x64 {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Unicode Release|x64.Build.0 = Unicode Release|x64
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|Win32.ActiveCfg = Debug|Win32
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|Win32.Build.0 = Debug|Win32
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|x64.ActiveCfg = Debug|x64
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|x64.Build.0 = Debug|x64
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|Win32.ActiveCfg = Release|Win32
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|Win32.Build.0 = Release|Win32
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|x64.ActiveCfg = Release|x64
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|x64.Build.0 = Release|x64
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Unicode Debug|Win32.ActiveCfg = Debug|Win32
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Unicode Debug|Win32.Build.0 = Debug|Win32
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Unicode Debug|x64.ActiveCfg = Debug|x64
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Unicode Debug|x64.Build.0 = Debug|x64
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Unicode Release|Win32.ActiveCfg = Release|Win32
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Unicode Release|Win32.Build.0 = Release|Win32
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Unicode Release|x64.ActiveCfg = Release|x64
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Unicode Release|x64.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES;_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_;USE_AVSOFFICESTUDIO_XMLUTILS;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_" PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES;_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_;USE_AVSOFFICESTUDIO_XMLUTILS;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="3"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="false" Detect64BitPortabilityProblems="false"
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
AdditionalDependencies="Urlmon.lib" AdditionalDependencies="Urlmon.lib"
LinkIncremental="2" LinkIncremental="2"
IgnoreAllDefaultLibraries="false" IgnoreAllDefaultLibraries="false"
IgnoreDefaultLibraryNames="" IgnoreDefaultLibraryNames="LIBCMTD.lib"
MergedIDLBaseFileName="_ASCOfficePPTFile.idl" MergedIDLBaseFileName="_ASCOfficePPTFile.idl"
GenerateDebugInformation="true" GenerateDebugInformation="true"
SubSystem="2" SubSystem="2"
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
AdditionalIncludeDirectories="" AdditionalIncludeDirectories="&quot;../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_XMLLITE_READER_;USE_LITE_READER;USE_AVSOFFICESTUDIO_XMLUTILS;LIBXML_READER_ENABLED;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_" PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_XMLLITE_READER_;USE_LITE_READER;USE_AVSOFFICESTUDIO_XMLUTILS;LIBXML_READER_ENABLED;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_"
StringPooling="true" StringPooling="true"
RuntimeLibrary="2" RuntimeLibrary="2"
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//1 //1
//0 //0
//1 //1
//269 //272
#define INTVER 1,0,1,269 #define INTVER 1,0,1,272
#define STRVER "1,0,1,269\0" #define STRVER "1,0,1,272\0"
...@@ -6057,47 +6057,11 @@ ...@@ -6057,47 +6057,11 @@
> >
</File> </File>
<File <File
RelativePath="..\XlsFormat\Logic\SummaryInformationStream\Structures\Property.cpp" RelativePath="..\XlsFormat\Logic\SummaryInformationStream\Structures\Property.h"
> >
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\$(InputName)1.obj"
XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath="..\XlsFormat\Logic\SummaryInformationStream\Structures\Property.h" RelativePath="..\XlsFormat\Logic\SummaryInformationStream\Structures\Property_Structures.cpp"
> >
</File> </File>
<File <File
...@@ -6130,14 +6094,6 @@ ...@@ -6130,14 +6094,6 @@
<Filter <Filter
Name="Auxiliary" Name="Auxiliary"
> >
<File
RelativePath="..\XlsFormat\Auxiliary\BetterVariantT.cpp"
>
</File>
<File
RelativePath="..\XlsFormat\Auxiliary\BetterVariantT.h"
>
</File>
<File <File
RelativePath="..\XlsFormat\Auxiliary\HelpersTagsGenerator.cpp" RelativePath="..\XlsFormat\Auxiliary\HelpersTagsGenerator.cpp"
> >
......
...@@ -6,22 +6,22 @@ namespace NSPresentationEditor ...@@ -6,22 +6,22 @@ namespace NSPresentationEditor
class CAudioPart class CAudioPart
{ {
public: public:
CString m_strFile; std::wstring m_strFile;
double m_dStartTime; double m_dStartTime;
double m_dEndTime; double m_dEndTime;
double m_dClipStartTime; double m_dClipStartTime;
double m_dClipEndTime; double m_dClipEndTime;
double m_dAudioDuration; double m_dAudioDuration;
bool m_bLoop; bool m_bLoop;
bool m_bStop; bool m_bStop;
bool m_bIsTransition; bool m_bIsTransition;
double m_dAmplify; double m_dAmplify;
public: public:
CAudioPart() CAudioPart()
...@@ -244,15 +244,15 @@ namespace NSPresentationEditor ...@@ -244,15 +244,15 @@ namespace NSPresentationEditor
strOverlay1.Format(_T("<AudioSource StartTime='%lf' Duration='%lf' Amplify='%lf'>"), strOverlay1.Format(_T("<AudioSource StartTime='%lf' Duration='%lf' Amplify='%lf'>"),
pPart->m_dStartTime, pPart->m_dEndTime - pPart->m_dStartTime, pPart->m_dAmplify); pPart->m_dStartTime, pPart->m_dEndTime - pPart->m_dStartTime, pPart->m_dAmplify);
int lIndex = pPart->m_strFile.Find(L"file:///"); int lIndex = pPart->m_strFile.find(L"file:///");
if (0 == lIndex) if (0 == lIndex)
{ {
pPart->m_strFile = pPart->m_strFile.Mid(8); pPart->m_strFile = pPart->m_strFile.substr(8);
pPart->m_strFile.Replace('/', '\\'); //pPart->m_strFile.Replace('/', '\\');
pPart->m_strFile.Replace(L"%20", L" "); //pPart->m_strFile.Replace(L"%20", L" ");
} }
CString strFile_ = pPart->m_strFile; CString strFile_ = std_string2string(pPart->m_strFile);
CorrectXmlString(strFile_); CorrectXmlString(strFile_);
strOverlay2.Format(_T("<Source StartTime='%lf' EndTime='%lf' FilePath='%s'/></AudioSource>"), strOverlay2.Format(_T("<Source StartTime='%lf' EndTime='%lf' FilePath='%s'/></AudioSource>"),
......
...@@ -102,7 +102,7 @@ namespace NSPresentationEditor ...@@ -102,7 +102,7 @@ namespace NSPresentationEditor
} }
else else
{ {
pLayout->m_arElements[nElem]->SetupProperties(NULL, &m_arThemes[i], NULL); //pLayout->m_arElements[nElem]->SetupProperties(NULL, &m_arThemes[i], NULL);
} }
} }
} }
...@@ -934,17 +934,18 @@ namespace NSPresentationEditor ...@@ -934,17 +934,18 @@ namespace NSPresentationEditor
strMetric.Format(_T(" hor_mm=\"%d\" ver_mm=\"%d\" hor_uni=\"%d\" ver_uni=\"%d\">"), strMetric.Format(_T(" hor_mm=\"%d\" ver_mm=\"%d\" hor_uni=\"%d\" ver_uni=\"%d\">"),
m_oInfo.m_lMillimetresHor, m_oInfo.m_lMillimetresVer, m_oInfo.m_lUnitsHor, m_oInfo.m_lUnitsVer); m_oInfo.m_lMillimetresHor, m_oInfo.m_lMillimetresVer, m_oInfo.m_lUnitsHor, m_oInfo.m_lUnitsVer);
oWriter.WriteString(_T("<Presentation xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"") + strMetric); oWriter.WriteString(std::wstring(L"<Presentation xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\""));
oWriter.WriteString(strMetric);
oWriter.WriteString(_T("<Themes>")); oWriter.WriteString(std::wstring(L"<Themes>"));
size_t nCount = m_arThemes.size(); size_t nCount = m_arThemes.size();
for (size_t i = 0; i < nCount; ++i) for (size_t i = 0; i < nCount; ++i)
{ {
oWriter.WriteString(m_arThemes[i].ToXmlEditor(m_oInfo)); oWriter.WriteString(m_arThemes[i].ToXmlEditor(m_oInfo));
} }
oWriter.WriteString(_T("</Themes>")); oWriter.WriteString(std::wstring(L"</Themes>"));
oWriter.WriteString(_T("<Slides>")); oWriter.WriteString(std::wstring(L"<Slides>"));
nCount = m_arSlides.size(); nCount = m_arSlides.size();
for (size_t i = 0; i < nCount; ++i) for (size_t i = 0; i < nCount; ++i)
{ {
...@@ -964,9 +965,9 @@ namespace NSPresentationEditor ...@@ -964,9 +965,9 @@ namespace NSPresentationEditor
oWriter.WriteString(m_arSlides[i].ToXmlEditor(pThemeSlide, pLayoutSlide, m_oInfo)); oWriter.WriteString(m_arSlides[i].ToXmlEditor(pThemeSlide, pLayoutSlide, m_oInfo));
} }
oWriter.WriteString(_T("</Slides>")); oWriter.WriteString(std::wstring(L"</Slides>"));
oWriter.WriteString(_T("</Presentation>")); oWriter.WriteString(std::wstring(L"</Presentation>"));
oWriter.CorrectUnicodeString(); oWriter.CorrectUnicodeString();
return oWriter.GetData(); return oWriter.GetData();
......
...@@ -56,6 +56,9 @@ namespace NSPresentationEditor ...@@ -56,6 +56,9 @@ namespace NSPresentationEditor
CTheme* m_pTheme; CTheme* m_pTheme;
CLayout* m_pLayout; CLayout* m_pLayout;
std::wstring m_sName;
std::wstring m_sDescription;
protected: protected:
ULONG m_lCountRef; ULONG m_lCountRef;
...@@ -129,8 +132,9 @@ namespace NSPresentationEditor ...@@ -129,8 +132,9 @@ namespace NSPresentationEditor
} }
virtual void NormalizeCoordsByMetric() virtual void NormalizeCoordsByMetric()
{ {
double dScaleX = m_oMetric.m_lUnitsHor / m_oMetric.m_lMillimetresHor; double dScaleX = (double)m_oMetric.m_lUnitsHor / m_oMetric.m_lMillimetresHor;
double dScaleY = m_oMetric.m_lUnitsVer / m_oMetric.m_lMillimetresVer; double dScaleY = (double)m_oMetric.m_lUnitsVer / m_oMetric.m_lMillimetresVer;
m_rcBoundsOriginal.left = dScaleX * m_rcBounds.left; m_rcBoundsOriginal.left = dScaleX * m_rcBounds.left;
m_rcBoundsOriginal.right = dScaleX * m_rcBounds.right; m_rcBoundsOriginal.right = dScaleX * m_rcBounds.right;
m_rcBoundsOriginal.top = dScaleY * m_rcBounds.top; m_rcBoundsOriginal.top = dScaleY * m_rcBounds.top;
......
...@@ -81,7 +81,6 @@ namespace NSPresentationEditor ...@@ -81,7 +81,6 @@ namespace NSPresentationEditor
{ {
m_ID = type; m_ID = type;
m_dwValue = 0; m_dwValue = 0;
m_strAdvanced = NULL;
} }
CElementProperty(const CElementProperty& oSrc) CElementProperty(const CElementProperty& oSrc)
{ {
...@@ -91,26 +90,16 @@ namespace NSPresentationEditor ...@@ -91,26 +90,16 @@ namespace NSPresentationEditor
{ {
m_ID = oSrc.m_ID; m_ID = oSrc.m_ID;
m_dwValue = oSrc.m_dwValue; m_dwValue = oSrc.m_dwValue;
m_strAdvanced = NULL; m_strAdvanced = oSrc.m_strAdvanced;
if (NULL != oSrc.m_strAdvanced)
{
m_strAdvanced = new WCHAR[m_dwValue];
memcpy(m_strAdvanced, oSrc.m_strAdvanced, m_dwValue * sizeof(WCHAR));
}
return *this; return *this;
} }
inline bool IsAdvanced()
{
return (NULL != m_strAdvanced);
}
public: public:
Type m_ID; Type m_ID;
DWORD m_dwValue; DWORD m_dwValue;
LPWSTR m_strAdvanced; std::wstring m_strAdvanced;
}; };
class CElementProperties class CElementProperties
...@@ -173,15 +162,12 @@ namespace NSPresentationEditor ...@@ -173,15 +162,12 @@ namespace NSPresentationEditor
m_arProperties[eType] = oProp; m_arProperties[eType] = oProp;
} }
inline void SetAt(const CElementProperty::Type& eType, CString strValue) inline void SetAt(const CElementProperty::Type& eType, std::wstring strValue)
{ {
CElementProperty oProp(eType); CElementProperty oProp(eType);
oProp.m_dwValue = strValue.GetLength() + 1; oProp.m_dwValue = strValue.length() + 1;
oProp.m_strAdvanced = new WCHAR[oProp.m_dwValue];
memcpy(oProp.m_strAdvanced, strValue.GetBuffer(), strValue.GetLength() * sizeof(WCHAR));
oProp.m_strAdvanced[oProp.m_dwValue - 1] = 0; oProp.m_strAdvanced = strValue;
m_arProperties[eType] = oProp; m_arProperties[eType] = oProp;
} }
......
...@@ -15,7 +15,7 @@ namespace NSPresentationEditor ...@@ -15,7 +15,7 @@ namespace NSPresentationEditor
if (!m_bUseThemeColorScheme) if (!m_bUseThemeColorScheme)
{ {
// colors ---- // colors ----
oWriter.WriteString(_T("<Colors>")); oWriter.WriteString(std::wstring(L"<Colors>"));
size_t nCountColors = m_arColorScheme.size(); size_t nCountColors = m_arColorScheme.size();
for (size_t i = 0; i < nCountColors; ++i) for (size_t i = 0; i < nCountColors; ++i)
...@@ -27,7 +27,7 @@ namespace NSPresentationEditor ...@@ -27,7 +27,7 @@ namespace NSPresentationEditor
oWriter.WriteString(strFormat); oWriter.WriteString(strFormat);
} }
oWriter.WriteString(_T("</Colors>")); oWriter.WriteString(std::wstring(L"</Colors>"));
// ----------- // -----------
} }
...@@ -59,14 +59,14 @@ namespace NSPresentationEditor ...@@ -59,14 +59,14 @@ namespace NSPresentationEditor
oElem.m_bIsBackground = true; oElem.m_bIsBackground = true;
oElem.m_bIsChangeable = false; oElem.m_bIsChangeable = false;
oWriter.WriteString(_T("<Background>")); oWriter.WriteString(std::wstring(L"<Background>"));
oElem.SetupProperties(NULL, pTheme, this); oElem.SetupProperties(NULL, pTheme, this);
oWriter.WriteString(oElem.ToXmlEditor()); oWriter.WriteString(oElem.ToXmlEditor());
oWriter.WriteString(_T("</Background>")); oWriter.WriteString(std::wstring(L"</Background>"));
} }
// ----------- // -----------
// elements (no placeholders) // elements (no placeholders)
oWriter.WriteString(_T("<Elements>")); oWriter.WriteString(std::wstring(L"<Elements>"));
size_t nCountElems = m_arElements.size(); size_t nCountElems = m_arElements.size();
for (size_t i = 0; i < nCountElems; ++i) for (size_t i = 0; i < nCountElems; ++i)
...@@ -80,13 +80,13 @@ namespace NSPresentationEditor ...@@ -80,13 +80,13 @@ namespace NSPresentationEditor
} }
} }
oWriter.WriteString(_T("</Elements>")); oWriter.WriteString(std::wstring(L"</Elements>"));
// ---------------- // ----------------
// placeholders // placeholders
oWriter.WriteString(_T("<Placeholders>")); oWriter.WriteString(std::wstring(L"<Placeholders>"));
CString strStylesPh = _T(""); std::wstring strStylesPh = _T("");
CString strFontRefs = _T(""); std::wstring strFontRefs = _T("");
for (size_t i = 0; i < nCountElems; ++i) for (size_t i = 0; i < nCountElems; ++i)
{ {
...@@ -133,12 +133,12 @@ namespace NSPresentationEditor ...@@ -133,12 +133,12 @@ namespace NSPresentationEditor
} }
} }
oWriter.WriteString(_T("</Placeholders>")); oWriter.WriteString(std::wstring(L"</Placeholders>"));
oWriter.WriteString(_T("<Styles>") + strStylesPh + _T("</Styles>")); oWriter.WriteString(std::wstring(L"<Styles>") + strStylesPh + _T("</Styles>"));
oWriter.WriteString(_T("<StylesFontRef>") + strFontRefs + _T("</StylesFontRef>")); oWriter.WriteString(std::wstring(L"<StylesFontRef>") + strFontRefs + _T("</StylesFontRef>"));
oWriter.WriteString(_T("</Layout>")); oWriter.WriteString(std::wstring(L"</Layout>"));
return oWriter.GetData(); return oWriter.GetData();
} }
......
...@@ -33,16 +33,12 @@ void NSPresentationEditor::CSVGConverter::_SetFont() ...@@ -33,16 +33,12 @@ void NSPresentationEditor::CSVGConverter::_SetFont()
if (_T("") == m_oFont.Path) if (_T("") == m_oFont.Path)
{ {
std::wstring bsName = string2std_string(m_oFont.Name); m_pFontManager->LoadFontByName(m_oFont.Name, (float)m_oFont.Size, m_oFont.GetStyle(), m_dDpiX, m_dDpiY);
m_pFontManager->LoadFontByName(bsName, (float)m_oFont.Size, m_oFont.GetStyle(), m_dDpiX, m_dDpiY);
} }
else else
{ {
std::wstring bsName = string2std_string(m_oFont.Path); m_pFontManager->LoadFontFromFile(m_oFont.Path, (float)m_oFont.Size, m_dDpiX, m_dDpiY, 0);
m_pFontManager->LoadFontFromFile(bsName, (float)m_oFont.Size, m_dDpiX, m_dDpiY, 0);
} }
m_oInstalledFont = m_oFont; m_oInstalledFont = m_oFont;
...@@ -292,12 +288,12 @@ HRESULT NSPresentationEditor::CSVGConverter::put_BrushAlpha2(const LONG& lAlpha) ...@@ -292,12 +288,12 @@ HRESULT NSPresentationEditor::CSVGConverter::put_BrushAlpha2(const LONG& lAlpha)
HRESULT NSPresentationEditor::CSVGConverter::get_BrushTexturePath(std::wstring* bsPath) HRESULT NSPresentationEditor::CSVGConverter::get_BrushTexturePath(std::wstring* bsPath)
{ {
if (bsPath == NULL) return S_FALSE; if (bsPath == NULL) return S_FALSE;
*bsPath = string2std_string(m_oBrush.TexturePath); *bsPath = m_oBrush.TexturePath;
return S_OK; return S_OK;
} }
HRESULT NSPresentationEditor::CSVGConverter::put_BrushTexturePath(const std::wstring& bsPath) HRESULT NSPresentationEditor::CSVGConverter::put_BrushTexturePath(const std::wstring& bsPath)
{ {
m_oBrush.TexturePath = std_string2string(bsPath); m_oBrush.TexturePath = bsPath;
return S_OK; return S_OK;
} }
HRESULT NSPresentationEditor::CSVGConverter::get_BrushTextureMode(LONG* lMode) HRESULT NSPresentationEditor::CSVGConverter::get_BrushTextureMode(LONG* lMode)
...@@ -344,22 +340,22 @@ HRESULT NSPresentationEditor::CSVGConverter::BrushRect(const INT& val, const dou ...@@ -344,22 +340,22 @@ HRESULT NSPresentationEditor::CSVGConverter::BrushRect(const INT& val, const dou
HRESULT NSPresentationEditor::CSVGConverter::get_FontName(std::wstring* bsName) HRESULT NSPresentationEditor::CSVGConverter::get_FontName(std::wstring* bsName)
{ {
*bsName = string2std_string(m_oFont.Name); *bsName = m_oFont.Name;
return S_OK; return S_OK;
} }
HRESULT NSPresentationEditor::CSVGConverter::put_FontName(const std::wstring& bsName) HRESULT NSPresentationEditor::CSVGConverter::put_FontName(const std::wstring& bsName)
{ {
m_oFont.Name = std_string2string(bsName); m_oFont.Name = bsName;
return S_OK; return S_OK;
} }
HRESULT NSPresentationEditor::CSVGConverter::get_FontPath(std::wstring* bsName) HRESULT NSPresentationEditor::CSVGConverter::get_FontPath(std::wstring* bsName)
{ {
*bsName = string2std_string(m_oFont.Path); *bsName = m_oFont.Path;
return S_OK; return S_OK;
} }
HRESULT NSPresentationEditor::CSVGConverter::put_FontPath(const std::wstring& bsName) HRESULT NSPresentationEditor::CSVGConverter::put_FontPath(const std::wstring& bsName)
{ {
m_oFont.Path = std_string2string(bsName); m_oFont.Path = bsName;
return S_OK; return S_OK;
} }
HRESULT NSPresentationEditor::CSVGConverter::get_FontSize(double* dSize) HRESULT NSPresentationEditor::CSVGConverter::get_FontSize(double* dSize)
......
...@@ -17,7 +17,7 @@ namespace NSPresentationEditor ...@@ -17,7 +17,7 @@ namespace NSPresentationEditor
{ {
//#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) //#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
//#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms." //#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
//#endif //#endiflo
//// ISVGConverter //// ISVGConverter
//[ object, uuid("4EE9D2C3-7317-4540-A205-DB78DBEB9BD0"), dual, pointer_default(unique) ] //[ object, uuid("4EE9D2C3-7317-4540-A205-DB78DBEB9BD0"), dual, pointer_default(unique) ]
......
...@@ -1745,7 +1745,7 @@ namespace SVG ...@@ -1745,7 +1745,7 @@ namespace SVG
if ((strClassName.GetLength () > 1) && (-1 == lLongAttribute ) && (alpha > 0.0)) if ((strClassName.GetLength () > 1) && (-1 == lLongAttribute ) && (alpha > 0.0))
{ {
m_render->put_BrushColor1 (0); m_render->put_BrushColor1 (0xffffff);
m_render->put_BrushAlpha1 ((LONG)( dAlplaFill * 255.0 * alpha)); m_render->put_BrushAlpha1 ((LONG)( dAlplaFill * 255.0 * alpha));
return true; return true;
......
...@@ -53,6 +53,7 @@ namespace NSPresentationEditor ...@@ -53,6 +53,7 @@ namespace NSPresentationEditor
IElement* pElem = m_arElements[nIndex]; IElement* pElem = m_arElements[nIndex];
RELEASEINTERFACE(pElem); RELEASEINTERFACE(pElem);
} }
m_arColorScheme.clear();
m_arElements.clear(); m_arElements.clear();
m_lThemeID = -1; m_lThemeID = -1;
...@@ -83,6 +84,8 @@ namespace NSPresentationEditor ...@@ -83,6 +84,8 @@ namespace NSPresentationEditor
m_arElements.push_back(oSrc.m_arElements[nIndex]->CreateDublicate()); m_arElements.push_back(oSrc.m_arElements[nIndex]->CreateDublicate());
} }
m_arColorScheme = oSrc.m_arColorScheme;
m_oSlideShow = oSrc.m_oSlideShow; m_oSlideShow = oSrc.m_oSlideShow;
m_lThemeID = oSrc.m_lThemeID; m_lThemeID = oSrc.m_lThemeID;
...@@ -117,6 +120,8 @@ namespace NSPresentationEditor ...@@ -117,6 +120,8 @@ namespace NSPresentationEditor
m_arElements.push_back(oSrc.m_arElements[nIndex]->CreateDublicate()); m_arElements.push_back(oSrc.m_arElements[nIndex]->CreateDublicate());
} }
m_arColorScheme = oSrc.m_arColorScheme;
m_oSlideShow = oSrc.m_oSlideShow; m_oSlideShow = oSrc.m_oSlideShow;
m_lThemeID = oSrc.m_lThemeID; m_lThemeID = oSrc.m_lThemeID;
...@@ -391,13 +396,13 @@ namespace NSPresentationEditor ...@@ -391,13 +396,13 @@ namespace NSPresentationEditor
oElem.m_bIsBackground = true; oElem.m_bIsBackground = true;
oElem.m_bIsChangeable = false; oElem.m_bIsChangeable = false;
oWriter.WriteString(_T("<Background>")); oWriter.WriteString(std::wstring(L"<Background>"));
oElem.SetupProperties(this, pTheme, pLayout); oElem.SetupProperties(this, pTheme, pLayout);
oWriter.WriteString(oElem.ToXmlEditor()); oWriter.WriteString(oElem.ToXmlEditor());
oWriter.WriteString(_T("</Background>")); oWriter.WriteString(std::wstring(L"</Background>"));
} }
CString strFontRefs = _T(""); std::wstring strFontRefs = _T("");
// elements // elements
size_t nCount = m_arElements.size(); size_t nCount = m_arElements.size();
...@@ -415,7 +420,7 @@ namespace NSPresentationEditor ...@@ -415,7 +420,7 @@ namespace NSPresentationEditor
oWriter.WriteString(strElement); oWriter.WriteString(strElement);
oWriter.WriteString(pElement->ToXmlEditor()); oWriter.WriteString(pElement->ToXmlEditor());
oWriter.WriteString(_T("</Element>")); oWriter.WriteString(std::wstring(L"</Element>"));
if (etShape == pElement->m_etType) if (etShape == pElement->m_etType)
{ {
...@@ -428,15 +433,15 @@ namespace NSPresentationEditor ...@@ -428,15 +433,15 @@ namespace NSPresentationEditor
CString strRef = _T(""); CString strRef = _T("");
strRef.Format(_T("s_font%d { font-index:%d;font-family:%ls; }\n"), strRef.Format(_T("s_font%d { font-index:%d;font-family:%ls; }\n"),
pTextElement->m_lID, lFontRef, pTheme->m_arFonts[lFontRef].Name); pTextElement->m_lID, lFontRef, pTheme->m_arFonts[lFontRef].Name);
strFontRefs += strRef; strFontRefs += string2std_string(strRef);
} }
} }
} }
} }
oWriter.WriteString(_T("<StylesFontRef>") + strFontRefs + _T("</StylesFontRef>")); oWriter.WriteString(std::wstring(L"<StylesFontRef>") + strFontRefs + _T("</StylesFontRef>"));
oWriter.WriteString(_T("</Slide>")); oWriter.WriteString(std::wstring(L"</Slide>"));
return oWriter.GetData(); return oWriter.GetData();
} }
......
...@@ -13,6 +13,25 @@ namespace NSPresentationEditor ...@@ -13,6 +13,25 @@ namespace NSPresentationEditor
//0x05 //Accent 1 color //0x05 //Accent 1 color
//0x06 //Accent 2 color //0x06 //Accent 2 color
//0x07 //Accent 3 color //0x07 //Accent 3 color
// [0]);//0
// [1]);//1
// [2]);//2
// [3]);//3
// [0]);//4
// [4]);//5 //accent1
// [5]);//6 //accent2
// [0]);//7 //accent3
// [5]);//8 //accent4
// [4]);//9 //accent5
// [7]);//10 //accent6
// [6]);//11 //hlink
// [7]);//12 //folHlink
// [0]);//13 //lt1
// [1]);//14 //dk1
// [2]);//15 //lt2
// [3]);//16 //dk2
switch (lSchemeIndex) switch (lSchemeIndex)
{ {
case 0: case 0:
...@@ -22,22 +41,22 @@ namespace NSPresentationEditor ...@@ -22,22 +41,22 @@ namespace NSPresentationEditor
lSchemeIndex = 14; lSchemeIndex = 14;
break; break;
case 2: case 2:
lSchemeIndex = 16; lSchemeIndex = 15;
break; break;
case 3: case 3:
lSchemeIndex = 15; lSchemeIndex = 16;
break; break;
case 4: case 4:
lSchemeIndex = 5; lSchemeIndex = 5;
break; break;
case 5: case 5:
lSchemeIndex = 5;//6 lSchemeIndex = 6;
break; break;
case 6: case 6:
lSchemeIndex = 6;//11 lSchemeIndex = 11;
break; break;
case 7: case 7:
lSchemeIndex = 7;//12 lSchemeIndex = 12;
break; break;
default: default:
lSchemeIndex = -1; lSchemeIndex = -1;
......
...@@ -126,6 +126,93 @@ namespace NSPresentationEditor ...@@ -126,6 +126,93 @@ namespace NSPresentationEditor
void RecalcParagraphs(CTheme* pTheme = NULL); void RecalcParagraphs(CTheme* pTheme = NULL);
void NormalizeCoordsByMetric(const CMetricInfo & oMetric)
{
double dScaleX = (double)oMetric.m_lUnitsHor / oMetric.m_lMillimetresHor / 24.;
double dScaleY = (double)oMetric.m_lUnitsVer / oMetric.m_lMillimetresVer / 24.;
size_t lCount = m_arParagraphs.size();
for (size_t i = 0; i < lCount; ++i)
{
CTextPFRun* pPar = &m_arParagraphs[i].m_oPFRun;
WORD lIndentLevel = (WORD)m_arParagraphs[i].m_lTextLevel;
switch (lIndentLevel)
{
case 0:
{
if (m_oRuler.LeftMargin1.is_init())
pPar->leftMargin = (LONG)m_oRuler.LeftMargin1.get();
if (m_oRuler.Indent1.is_init())
pPar->indent = (LONG)m_oRuler.Indent1.get();
if (pPar->indent.is_init() && pPar->leftMargin.get())
pPar->indent.get() -= pPar->leftMargin.get();
break;
}
case 1:
{
if (m_oRuler.LeftMargin2.is_init())
pPar->leftMargin = (LONG)m_oRuler.LeftMargin2.get();
if (m_oRuler.Indent2.is_init())
pPar->indent = (LONG)m_oRuler.Indent2.get();
if (pPar->indent.is_init() && pPar->leftMargin.get())
pPar->indent.get() -= pPar->leftMargin.get();
break;
}
case 2:
{
if (m_oRuler.LeftMargin3.is_init())
pPar->leftMargin = (LONG)m_oRuler.LeftMargin3.get();
if (m_oRuler.Indent3.is_init())
pPar->indent = (LONG)m_oRuler.Indent3.get();
if (pPar->indent.is_init() && pPar->leftMargin.get())
pPar->indent.get() -= pPar->leftMargin.get();
break;
}
case 3:
{
if (m_oRuler.LeftMargin4.is_init())
pPar->leftMargin = (LONG)m_oRuler.LeftMargin4.get();
if (m_oRuler.Indent4.is_init())
pPar->indent = (LONG)m_oRuler.Indent4.get();
if (pPar->indent.is_init() && pPar->leftMargin.get())
pPar->indent.get() -= pPar->leftMargin.get();
break;
}
case 4:
{
if (m_oRuler.LeftMargin5.is_init())
pPar->leftMargin = (LONG)m_oRuler.LeftMargin5.get();
if (m_oRuler.Indent5.is_init())
pPar->indent = (LONG)m_oRuler.Indent5.get();
if (pPar->indent.is_init() && pPar->leftMargin.get())
pPar->indent.get() -= pPar->leftMargin.get();
break;
}
default:
break;
}
if (pPar->leftMargin.is_init())
pPar->leftMargin = pPar->leftMargin.get() * dScaleX;
if (pPar->indent.is_init())
pPar->indent = pPar->indent.get() * dScaleX;
if (pPar->lineSpacing.is_init())
pPar->lineSpacing =- pPar->lineSpacing.get();// * dScaleY;
if (pPar->spaceAfter.is_init())
pPar->spaceAfter = -pPar->spaceAfter.get() ;//* dScaleY;
if (pPar->spaceBefore.is_init())
pPar->spaceBefore = -pPar->spaceBefore.get() ;//* dScaleY;
if (pPar->defaultTabSize.is_init())
pPar->defaultTabSize = pPar->defaultTabSize.get()* dScaleX;
}
}
void CorrectRuler() void CorrectRuler()
{ {
size_t lCount = m_arParagraphs.size(); size_t lCount = m_arParagraphs.size();
...@@ -193,7 +280,7 @@ namespace NSPresentationEditor ...@@ -193,7 +280,7 @@ namespace NSPresentationEditor
} }
default: default:
break; break;
}; }
} }
} }
......
...@@ -65,12 +65,12 @@ namespace NSPresentationEditor ...@@ -65,12 +65,12 @@ namespace NSPresentationEditor
class CFontProperties class CFontProperties
{ {
public: public:
BYTE FontNameProp; BYTE FontNameProp;
CString strFontName; std::wstring strFontName;
CString strPanose; std::wstring strPanose;
CString strPitchFamily; std::wstring strPitchFamily;
LONG lFontFixed; LONG lFontFixed;
std::vector<BYTE> arFontCharsets; std::vector<BYTE> arFontCharsets;
public: public:
CFontProperties() : FontNameProp(0), strFontName(_T("")), strPanose(_T("")), strPitchFamily(_T("")), lFontFixed(0), arFontCharsets() CFontProperties() : FontNameProp(0), strFontName(_T("")), strPanose(_T("")), strPitchFamily(_T("")), lFontFixed(0), arFontCharsets()
...@@ -112,11 +112,11 @@ namespace NSPresentationEditor ...@@ -112,11 +112,11 @@ namespace NSPresentationEditor
{ {
public: public:
NSCommon::nullable_base<bool> FontBold; NSCommon::nullable_base<bool> FontBold;
NSCommon::nullable_base<bool> FontItalic; NSCommon::nullable_base<bool> FontItalic;
NSCommon::nullable_base<bool> FontUnderline; NSCommon::nullable_base<bool> FontUnderline;
NSCommon::nullable_base<bool> FontStrikeout; NSCommon::nullable_base<bool> FontStrikeout;
NSCommon::nullable_base<bool> FontShadow; NSCommon::nullable_base<bool> FontShadow;
NSCommon::nullable_base<WORD> Typeface; // fontRef NSCommon::nullable_base<WORD> Typeface; // fontRef
NSCommon::nullable_base<WORD> EAFontRef; // eaFontRef NSCommon::nullable_base<WORD> EAFontRef; // eaFontRef
...@@ -313,26 +313,26 @@ namespace NSPresentationEditor ...@@ -313,26 +313,26 @@ namespace NSPresentationEditor
if (FontProperties.is_init()) if (FontProperties.is_init())
{ {
strXml += (_T("<font-name>") + FontProperties->strFontName + _T("</font-name>")); strXml += (_T("<font-name>") + std_string2string(FontProperties->strFontName) + _T("</font-name>"));
oWriter.WriteString(strXml); oWriter.WriteString(strXml);
oWriter.WriteNodeEnd(_T("Attributes")); oWriter.WriteNodeEnd(_T("Attributes"));
// font properties // font properties
strXml = _T("<FontProperties>"); strXml = _T("<FontProperties>");
strXml += (_T("<Name value='") + FontProperties->strFontName + _T("' />")); strXml += (_T("<Name value='") + std_string2string(FontProperties->strFontName) + _T("' />"));
if (0 < FontProperties->arFontCharsets.size()) if (0 < FontProperties->arFontCharsets.size())
strXml += (_T("<Charset value='") + XmlUtils::IntToString((int)FontProperties->arFontCharsets[0]) + _T("' />")); strXml += (_T("<Charset value='") + XmlUtils::IntToString((int)FontProperties->arFontCharsets[0]) + _T("' />"));
if (_T("unknown") != FontProperties->strPitchFamily) if (_T("unknown") != FontProperties->strPitchFamily)
strXml += (_T("<FamilyClass name='") + FontProperties->strPitchFamily + _T("' />")); strXml += (_T("<FamilyClass name='") + std_string2string(FontProperties->strPitchFamily) + _T("' />"));
if (-1 != FontProperties->lFontFixed) if (-1 != FontProperties->lFontFixed)
strXml += (_T("<FixedWidth value='") + XmlUtils::IntToString(FontProperties->lFontFixed) + _T("' />")); strXml += (_T("<FixedWidth value='") + XmlUtils::IntToString(FontProperties->lFontFixed) + _T("' />"));
if (_T("") != FontProperties->strPanose) if (_T("") != FontProperties->strPanose)
strXml += (_T("<Panose value='") + FontProperties->strPanose + _T("' />")); strXml += (_T("<Panose value='") + std_string2string(FontProperties->strPanose) + _T("' />"));
strXml += (_T("<Style bold='") + XmlUtils::IntToString(nBold) + _T("' italic='") + XmlUtils::IntToString(nItalic) + _T("' />")); strXml += (_T("<Style bold='") + XmlUtils::IntToString(nBold) + _T("' italic='") + XmlUtils::IntToString(nItalic) + _T("' />"));
...@@ -456,7 +456,7 @@ namespace NSPresentationEditor ...@@ -456,7 +456,7 @@ namespace NSPresentationEditor
else if (bIsFontNamPres) else if (bIsFontNamPres)
{ {
strStyle += _T("font-family: "); strStyle += _T("font-family: ");
strStyle += FontProperties->strFontName; strStyle += std_string2string(FontProperties->strFontName);
strStyle += _T(";"); strStyle += _T(";");
} }
...@@ -1236,13 +1236,13 @@ namespace NSPresentationEditor ...@@ -1236,13 +1236,13 @@ namespace NSPresentationEditor
int nAlign = (int)m_oPFRun.textAlignment.get(); int nAlign = (int)m_oPFRun.textAlignment.get();
if (0 == nAlign) if (0 == nAlign)
oWriter.WriteString(_T("text-align:left;")); oWriter.WriteString(std::wstring(L"text-align:left;"));
else if (2 == nAlign) else if (2 == nAlign)
oWriter.WriteString(_T("text-align:right;")); oWriter.WriteString(std::wstring(L"text-align:right;"));
else if (3 == nAlign) else if (3 == nAlign)
oWriter.WriteString(_T("text-align:justify;")); oWriter.WriteString(std::wstring(L"text-align:justify;"));
else else
oWriter.WriteString(_T("text-align:center;")); oWriter.WriteString(std::wstring(L"text-align:center;"));
} }
int nMargin = 0; int nMargin = 0;
...@@ -1352,55 +1352,55 @@ namespace NSPresentationEditor ...@@ -1352,55 +1352,55 @@ namespace NSPresentationEditor
{ {
if (m_oCFRun.FontBold.get()) if (m_oCFRun.FontBold.get())
{ {
oWriter.WriteString(_T("font-weight: bold;")); oWriter.WriteString(std::wstring(L"font-weight: bold;"));
} }
else else
{ {
oWriter.WriteString(_T("font-weight: normal;")); oWriter.WriteString(std::wstring(L"font-weight: normal;"));
} }
} }
if (m_oCFRun.FontItalic.is_init()) if (m_oCFRun.FontItalic.is_init())
{ {
if (m_oCFRun.FontItalic.get()) if (m_oCFRun.FontItalic.get())
{ {
oWriter.WriteString(_T("font-style: italic;")); oWriter.WriteString(std::wstring(L"font-style: italic;"));
} }
else else
{ {
oWriter.WriteString(_T("font-style: normal;")); oWriter.WriteString(std::wstring(L"font-style: normal;"));
} }
} }
if (m_oCFRun.FontUnderline.is_init()) if (m_oCFRun.FontUnderline.is_init())
{ {
if (m_oCFRun.FontUnderline.get()) if (m_oCFRun.FontUnderline.get())
{ {
oWriter.WriteString(_T("text-decoration: underline;")); oWriter.WriteString(std::wstring(L"text-decoration: underline;"));
} }
else else
{ {
oWriter.WriteString(_T("text-decoration: none;")); oWriter.WriteString(std::wstring(L"text-decoration: none;"));
} }
} }
/*if (m_oCFRun.FontStrikeout.is_init()) /*if (m_oCFRun.FontStrikeout.is_init())
{ {
if (m_oCFRun.FontStrikeout.get()) if (m_oCFRun.FontStrikeout.get())
{ {
oWriter.WriteString(_T("text-decoration: line-through;")); oWriter.WriteString(std::wstring(L"text-decoration: line-through;"));
} }
else else
{ {
oWriter.WriteString(_T("text-decoration: normal;")); oWriter.WriteString(std::wstring(L"text-decoration: normal;"));
} }
}*/ }*/
if (m_oCFRun.FontShadow.is_init()) if (m_oCFRun.FontShadow.is_init())
{ {
if (m_oCFRun.FontShadow.get()) if (m_oCFRun.FontShadow.get())
{ {
oWriter.WriteString(_T("text-shadow: black 1px 1px 2px;")); oWriter.WriteString(std::wstring(L"text-shadow: black 1px 1px 2px;"));
} }
else else
{ {
oWriter.WriteString(_T("text-shadow: none;")); oWriter.WriteString(std::wstring(L"text-shadow: none;"));
} }
} }
...@@ -1433,13 +1433,13 @@ namespace NSPresentationEditor ...@@ -1433,13 +1433,13 @@ namespace NSPresentationEditor
if (m_oCFRun.FontProperties.is_init()) if (m_oCFRun.FontProperties.is_init())
{ {
oWriter.WriteString(_T("font-family: ")); oWriter.WriteString(std::wstring(L"font-family: "));
oWriter.WriteString(m_oCFRun.FontProperties->strFontName); oWriter.WriteString(m_oCFRun.FontProperties->strFontName);
oWriter.WriteString(_T("; }\n")); oWriter.WriteString(std::wstring(L"; }\n"));
} }
else else
{ {
oWriter.WriteString(_T(" }\n")); oWriter.WriteString(std::wstring(L" }\n"));
} }
return oWriter.GetData(); return oWriter.GetData();
} }
...@@ -1541,7 +1541,7 @@ namespace NSPresentationEditor ...@@ -1541,7 +1541,7 @@ namespace NSPresentationEditor
oWriter.WriteString(m_pLevels[i]->ToXmlEditor(oInfo, bIsLayout, lTextOrPlaceholderType, lID, (LONG)i)); oWriter.WriteString(m_pLevels[i]->ToXmlEditor(oInfo, bIsLayout, lTextOrPlaceholderType, lID, (LONG)i));
} }
oWriter.WriteString(_T("</Style>")); oWriter.WriteString(std::wstring(L"</Style>"));
return oWriter.GetData(); return oWriter.GetData();
} }
}; };
......
...@@ -6,10 +6,12 @@ namespace NSPresentationEditor ...@@ -6,10 +6,12 @@ namespace NSPresentationEditor
{ {
NSPresentationEditor::CStringWriter oWriter; NSPresentationEditor::CStringWriter oWriter;
oWriter.WriteString(_T("<Theme>")); oWriter.WriteString(std::wstring(L"<Theme name=\""));
oWriter.WriteString(m_sThemeName);
oWriter.WriteString(std::wstring(L"\">"));
// colors ---- // colors ----
oWriter.WriteString(_T("<Colors>")); oWriter.WriteString(std::wstring(L"<Colors>"));
size_t nCountColors = m_arColorScheme.size(); size_t nCountColors = m_arColorScheme.size();
for (size_t i = 0; i < nCountColors; ++i) for (size_t i = 0; i < nCountColors; ++i)
...@@ -21,11 +23,11 @@ namespace NSPresentationEditor ...@@ -21,11 +23,11 @@ namespace NSPresentationEditor
oWriter.WriteString(strFormat); oWriter.WriteString(strFormat);
} }
oWriter.WriteString(_T("</Colors>")); oWriter.WriteString(std::wstring(L"</Colors>"));
// ----------- // -----------
// fonts ----- // fonts -----
oWriter.WriteString(_T("<Fonts>")); oWriter.WriteString(std::wstring(L"<Fonts>"));
size_t nCountFonts = m_arFonts.size(); size_t nCountFonts = m_arFonts.size();
//if (nCountFonts > 1) //if (nCountFonts > 1)
...@@ -40,12 +42,12 @@ namespace NSPresentationEditor ...@@ -40,12 +42,12 @@ namespace NSPresentationEditor
oWriter.WriteString(strFormat); oWriter.WriteString(strFormat);
} }
oWriter.WriteString(_T("</Fonts>")); oWriter.WriteString(std::wstring(L"</Fonts>"));
// ----------- // -----------
// fonts dublicate // fonts dublicate
oWriter.WriteString(_T("<FontsDublicate>")); oWriter.WriteString(std::wstring(L"<FontsDublicate>"));
for (size_t i = 0; i < nCountFonts; ++i) for (size_t i = 0; i < nCountFonts; ++i)
{ {
CString strFormat = _T(""); CString strFormat = _T("");
...@@ -54,18 +56,18 @@ namespace NSPresentationEditor ...@@ -54,18 +56,18 @@ namespace NSPresentationEditor
oWriter.WriteString(strFormat); oWriter.WriteString(strFormat);
} }
oWriter.WriteString(_T("</FontsDublicate>")); oWriter.WriteString(std::wstring(L"</FontsDublicate>"));
// ----------- // -----------
// textstyles ------ // textstyles ------
oWriter.WriteString(_T("<TextStyles>")); oWriter.WriteString(std::wstring(L"<TextStyles>"));
for (long i = 0; i < g_ThemeTextStylesCount; ++i) for (long i = 0; i < g_ThemeTextStylesCount; ++i)
{ {
oWriter.WriteString(m_pStyles[i].ToXmlEditor(oInfo, false, i, -1)); oWriter.WriteString(m_pStyles[i].ToXmlEditor(oInfo, false, i, -1));
} }
oWriter.WriteString(_T("</TextStyles>")); oWriter.WriteString(std::wstring(L"</TextStyles>"));
// ----------------- // -----------------
// background // background
...@@ -94,13 +96,13 @@ namespace NSPresentationEditor ...@@ -94,13 +96,13 @@ namespace NSPresentationEditor
oElem.NormalizeCoords(dScaleX, dScaleY); oElem.NormalizeCoords(dScaleX, dScaleY);
oElem.m_oShape.m_oBrush = m_oBackground; oElem.m_oShape.m_oBrush = m_oBackground;
oWriter.WriteString(_T("<Background>")); oWriter.WriteString(std::wstring(L"<Background>"));
oElem.SetupProperties(NULL, this, NULL); oElem.SetupProperties(NULL, this, NULL);
oWriter.WriteString(oElem.ToXmlEditor()); oWriter.WriteString(oElem.ToXmlEditor());
oWriter.WriteString(_T("</Background>")); oWriter.WriteString(std::wstring(L"</Background>"));
// ----------- // -----------
// elements // elements
oWriter.WriteString(_T("<Elements>")); oWriter.WriteString(std::wstring(L"<Elements>"));
size_t nCountElems = m_arElements.size(); size_t nCountElems = m_arElements.size();
for (size_t i = 0; i < nCountElems; ++i) for (size_t i = 0; i < nCountElems; ++i)
...@@ -111,10 +113,10 @@ namespace NSPresentationEditor ...@@ -111,10 +113,10 @@ namespace NSPresentationEditor
oWriter.WriteString(m_arElements[i]->ToXmlEditor()); oWriter.WriteString(m_arElements[i]->ToXmlEditor());
} }
oWriter.WriteString(_T("</Elements>")); oWriter.WriteString(std::wstring(L"</Elements>"));
// ---------------- // ----------------
// layouts // layouts
oWriter.WriteString(_T("<Layouts>")); oWriter.WriteString(std::wstring(L"<Layouts>"));
size_t nCountLayouts = m_arLayouts.size(); size_t nCountLayouts = m_arLayouts.size();
for (size_t i = 0; i < nCountLayouts; ++i) for (size_t i = 0; i < nCountLayouts; ++i)
...@@ -122,9 +124,9 @@ namespace NSPresentationEditor ...@@ -122,9 +124,9 @@ namespace NSPresentationEditor
oWriter.WriteString(m_arLayouts[i].ToXmlEditor(this, oInfo)); oWriter.WriteString(m_arLayouts[i].ToXmlEditor(this, oInfo));
} }
oWriter.WriteString(_T("</Layouts>")); oWriter.WriteString(std::wstring(L"</Layouts>"));
oWriter.WriteString(_T("</Theme>")); oWriter.WriteString(std::wstring(L"</Theme>"));
return oWriter.GetData(); return oWriter.GetData();
} }
...@@ -133,6 +135,8 @@ namespace NSPresentationEditor ...@@ -133,6 +135,8 @@ namespace NSPresentationEditor
{ {
#ifdef _PRESENTATION_WRITER_ #ifdef _PRESENTATION_WRITER_
//colors //colors
m_sThemeName = oNode.GetAttribute(L"name", L"default");
m_arColorScheme.clear(); m_arColorScheme.clear();
XmlUtils::CXmlNode oNodeColors; XmlUtils::CXmlNode oNodeColors;
if (oNode.GetNode(_T("Colors"), oNodeColors)) if (oNode.GetNode(_T("Colors"), oNodeColors))
......
...@@ -26,10 +26,15 @@ namespace NSPresentationEditor ...@@ -26,10 +26,15 @@ namespace NSPresentationEditor
CMetricInfo m_oInfo; CMetricInfo m_oInfo;
public: std::wstring m_sThemeName;
std::vector<std::vector<CColor>>m_arExtraColorScheme;
//------------------------------------------------------------------------------------
CTheme() : m_arColorScheme(), m_arFonts(), m_arBrushes(), CTheme() : m_arColorScheme(), m_arFonts(), m_arBrushes(),
m_arPens(), m_arEffects(), m_arLayouts() m_arPens(), m_arEffects(), m_arLayouts()
{ {
m_sThemeName = L"Default";
} }
CTheme(const CTheme& oSrc) CTheme(const CTheme& oSrc)
...@@ -44,6 +49,8 @@ namespace NSPresentationEditor ...@@ -44,6 +49,8 @@ namespace NSPresentationEditor
m_arBrushes = oSrc.m_arBrushes; m_arBrushes = oSrc.m_arBrushes;
m_arPens = oSrc.m_arPens; m_arPens = oSrc.m_arPens;
m_arEffects = oSrc.m_arEffects; m_arEffects = oSrc.m_arEffects;
m_sThemeName = oSrc.m_sThemeName;
for (int i = 0; i < g_ThemeTextStylesCount; ++i) for (int i = 0; i < g_ThemeTextStylesCount; ++i)
m_pStyles[i] = oSrc.m_pStyles[i]; m_pStyles[i] = oSrc.m_pStyles[i];
......
...@@ -106,12 +106,12 @@ namespace NSPresentationEditor ...@@ -106,12 +106,12 @@ namespace NSPresentationEditor
WriteString(bsString.GetBSTR(), nLen); WriteString(bsString.GetBSTR(), nLen);
} }
#endif // #if defined(_WIN32) || defined(_WIN64) #endif // #if defined(_WIN32) || defined(_WIN64)
AVSINLINE void WriteString(std::wstring& wString) AVSINLINE void WriteString(const std::wstring & wString)
{ {
size_t nLen = wString.length(); size_t nLen = wString.length();
WriteString(wString.c_str(), nLen); WriteString(wString.c_str(), nLen);
} }
AVSINLINE void WriteString(const CString& sString) AVSINLINE void WriteString(const CString & sString)
{ {
size_t nLen = (size_t)sString.GetLength(); size_t nLen = (size_t)sString.GetLength();
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
class CStylesWriter; class CStylesWriter;
class CPPTUserInfo;
namespace NSPresentationEditor namespace NSPresentationEditor
{ {
...@@ -16,16 +17,19 @@ namespace NSPresentationEditor ...@@ -16,16 +17,19 @@ namespace NSPresentationEditor
CString m_strTempDirectory; CString m_strTempDirectory;
CString m_strDstFileName; CString m_strDstFileName;
CDocument* m_pDocument; CDocument * m_pDocument;
CPPTUserInfo* m_pUserInfo;
CImageManager m_oManager; CImageManager m_oManager;
CShapeWriter* m_pShapeWriter; CShapeWriter* m_pShapeWriter;
public: public:
CPPTXWriter(); CPPTXWriter();
~CPPTXWriter(); ~CPPTXWriter();
void CreateFile(CDocument* pDocument); void CreateFile(CDocument * pDocument);
void CreateFile(CPPTUserInfo* pUserInfo);
void CloseFile(); void CloseFile();
...@@ -34,14 +38,19 @@ namespace NSPresentationEditor ...@@ -34,14 +38,19 @@ namespace NSPresentationEditor
} }
protected: protected:
void WriteContentTypes(); void WriteApp (CFile& oFile);
void WriteApp(CFile& oFile); void WriteContentTypes ();
void WritePresInfo(); void WritePresInfo ();
void WriteAll(); void WriteAll ();
void WriteBackground(CStringWriter& oWriter, CRelsGenerator& oRels, CBrush& oBackground); void WriteThemes ();
void WriteElement(CStringWriter& oWriter, CRelsGenerator& oRels, IElement* pElement, CLayout* pLayout = NULL); void WriteSlides ();
void WriteLayout(CLayout& oLayout, int nIndexLayout, int nStartLayout, int nIndexTheme); void WriteLayout (CLayout& oLayout, int nIndexLayout, int nStartLayout, int nIndexTheme);
void WriteSlide(int nIndexSlide); void WriteSlide (int nIndexSlide);
void WriteColorScheme (CStringWriter& oWriter, const std::wstring & name, const std::vector<CColor> & colors, bool extra = false);
void WriteBackground (CStringWriter& oWriter, CRelsGenerator& oRels, CBrush& oBackground);
void WriteElement (CStringWriter& oWriter, CRelsGenerator& oRels, IElement* pElement, CLayout* pLayout = NULL);
}; };
} }
\ No newline at end of file
...@@ -9,9 +9,9 @@ namespace NSPresentationEditor ...@@ -9,9 +9,9 @@ namespace NSPresentationEditor
class CImageManager class CImageManager
{ {
private: private:
std::map<CString, CString> m_mapImages; std::map<std::wstring, std::wstring> m_mapImages;
LONG m_lIndexNextImage; LONG m_lIndexNextImage;
CString m_strDstMedia; std::wstring m_strDstMedia;
public: public:
CImageManager() : m_mapImages(), m_lIndexNextImage(0) CImageManager() : m_mapImages(), m_lIndexNextImage(0)
...@@ -31,19 +31,21 @@ namespace NSPresentationEditor ...@@ -31,19 +31,21 @@ namespace NSPresentationEditor
} }
public: public:
AVSINLINE CString GenerateImage(const CString& strInput) AVSINLINE std::wstring GenerateImage(const std::wstring& strInput)
{ {
std::map<CString, CString>::iterator pPair = m_mapImages.find(strInput); std::map<std::wstring, std::wstring>::iterator pPair = m_mapImages.find(strInput);
if (m_mapImages.end() != pPair) if (m_mapImages.end() != pPair)
{
return pPair->second; return pPair->second;
}
if (IsNeedDownload(strInput)) if (IsNeedDownload(strInput))
return DownloadImage(strInput); return DownloadImage(strInput);
CString strExts = _T(".jpg"); std::wstring strExts = _T(".jpg");
int nIndexExt = strInput.ReverseFind(TCHAR('.')); int nIndexExt = strInput.rfind(TCHAR('.'));
if (-1 != nIndexExt) if (-1 != nIndexExt)
strExts = strInput.Mid(nIndexExt); strExts = strInput.substr(nIndexExt);
if (strExts == _T(".tmp")) if (strExts == _T(".tmp"))
strExts = _T(".png"); strExts = _T(".png");
...@@ -51,27 +53,27 @@ namespace NSPresentationEditor ...@@ -51,27 +53,27 @@ namespace NSPresentationEditor
CString strImage = _T(""); CString strImage = _T("");
strImage.Format(_T("image%d"), m_lIndexNextImage++); strImage.Format(_T("image%d"), m_lIndexNextImage++);
CString strOutput = m_strDstMedia + strImage + strExts; std::wstring strOutput = m_strDstMedia + string2std_string(strImage) + strExts;
strImage = _T("../media/") + strImage + strExts; strImage = _T("../media/") + strImage + std_string2string(strExts);
m_mapImages[strInput] = strImage; m_mapImages[strInput] = string2std_string(strImage);
// //
if (strOutput != strInput) if (strOutput != strInput)
CDirectory::CopyFile(strInput, strOutput, NULL, NULL); CDirectory::CopyFile(std_string2string(strInput), std_string2string(strOutput), NULL, NULL);
return strImage; return strImage;
} }
AVSINLINE bool IsNeedDownload(const CString& strFile) AVSINLINE bool IsNeedDownload(const std::wstring& strFile)
{ {
int n1 = strFile.Find(_T("www")); int n1 = strFile.find(_T("www"));
int n2 = strFile.Find(_T("http")); int n2 = strFile.find(_T("http"));
int n3 = strFile.Find(_T("ftp")); int n3 = strFile.find(_T("ftp"));
if (((n1 >= 0) && (n1 < 10)) || ((n2 >= 0) && (n2 < 10)) || ((n3 >= 0) && (n3 < 10))) if (((n1 >= 0) && (n1 < 10)) || ((n2 >= 0) && (n2 < 10)) || ((n3 >= 0) && (n3 < 10)))
return true; return true;
return false; return false;
} }
AVSINLINE CString DownloadImage(const CString& strFile) AVSINLINE std::wstring DownloadImage(const std::wstring& strFile)
{ {
#ifndef DISABLE_FILE_DOWNLOADER #ifndef DISABLE_FILE_DOWNLOADER
CFileDownloader oDownloader(strFile, TRUE); CFileDownloader oDownloader(strFile, TRUE);
...@@ -95,7 +97,7 @@ namespace NSPresentationEditor ...@@ -95,7 +97,7 @@ namespace NSPresentationEditor
private: private:
NSPresentationEditor::CStringWriter m_oWriter; NSPresentationEditor::CStringWriter m_oWriter;
int m_lNextRelsID; int m_lNextRelsID;
std::map<CString, int> m_mapImages; std::map<std::wstring, int> m_mapImages;
CImageManager* m_pManager; CImageManager* m_pManager;
public: public:
...@@ -218,10 +220,10 @@ namespace NSPresentationEditor ...@@ -218,10 +220,10 @@ namespace NSPresentationEditor
oFile.CloseFile(); oFile.CloseFile();
} }
AVSINLINE CString WriteImage(const CString& strImagePath) AVSINLINE CString WriteImage(const std::wstring& strImagePath)
{ {
CString strImage = m_pManager->GenerateImage(strImagePath); std::wstring strImage = m_pManager->GenerateImage(strImagePath);
std::map<CString, int>::iterator pPair = m_mapImages.find(strImage); std::map<std::wstring, int>::iterator pPair = m_mapImages.find(strImage);
if (m_mapImages.end() != pPair) if (m_mapImages.end() != pPair)
{ {
...@@ -235,9 +237,9 @@ namespace NSPresentationEditor ...@@ -235,9 +237,9 @@ namespace NSPresentationEditor
CString strRid = _T(""); CString strRid = _T("");
strRid.Format(_T("rId%d"), m_lNextRelsID++); strRid.Format(_T("rId%d"), m_lNextRelsID++);
CString strRels = _T("<Relationship Id=\"") ; std::wstring strRels = _T("<Relationship Id=\"") ;
strRels += strRid + _T("\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\""); strRels += string2std_string(strRid) + _T("\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"");
strRels += strImage + _T("\"/>"); strRels += strImage + _T("\"/>");
m_oWriter.WriteString(strRels); m_oWriter.WriteString(strRels);
......
...@@ -34,7 +34,23 @@ public: ...@@ -34,7 +34,23 @@ public:
return _T("justLow"); return _T("justLow");
return _T("l"); return _T("l");
} }
//oArrayMem.push_back(oScheme[0]);//0
//oArrayMem.push_back(oScheme[1]);//1
//oArrayMem.push_back(oScheme[2]);//2
//oArrayMem.push_back(oScheme[3]);//3
//oArrayMem.push_back(oScheme[0]);//4
//oArrayMem.push_back(oScheme[4]);//5 //accent1
//oArrayMem.push_back(oScheme[5]);//6 //accent2
//oArrayMem.push_back(oScheme[0]);//7 //accent3
//oArrayMem.push_back(oScheme[5]);//8 //accent4
//oArrayMem.push_back(oScheme[4]);//9 //accent5
//oArrayMem.push_back(oScheme[7]);//10 //accent6
//oArrayMem.push_back(oScheme[6]);//11 //hlink
//oArrayMem.push_back(oScheme[7]);//12 //folHlink
//oArrayMem.push_back(oScheme[0]);//13 //lt1
//oArrayMem.push_back(oScheme[1]);//14 //dk1
//oArrayMem.push_back(oScheme[2]);//15 //lt2
//oArrayMem.push_back(oScheme[3]);//16 //dk2
AVSINLINE static CString GetColorInScheme(const LONG& lIndex) AVSINLINE static CString GetColorInScheme(const LONG& lIndex)
{ {
switch (lIndex) switch (lIndex)
...@@ -112,7 +128,7 @@ public: ...@@ -112,7 +128,7 @@ public:
if (pPF->fontAlign.is_init()) if (pPF->fontAlign.is_init())
{ {
CString strProp = GetFontAlign(pPF->fontAlign.get()); CString strProp = GetFontAlign(pPF->fontAlign.get());
oWriter.WriteString(_T(" fontAlgn=\"") + strProp + _T("\"")); oWriter.WriteString(std::wstring(L" fontAlgn=\"") + string2std_string(strProp) + _T("\""));
} }
if (pPF->leftMargin.is_init()) if (pPF->leftMargin.is_init())
{ {
...@@ -129,7 +145,7 @@ public: ...@@ -129,7 +145,7 @@ public:
if (pPF->textAlignment.is_init()) if (pPF->textAlignment.is_init())
{ {
CString strProp = GetTextAlign(pPF->textAlignment.get()); CString strProp = GetTextAlign(pPF->textAlignment.get());
oWriter.WriteString(_T(" algn=\"") + strProp + _T("\"")); oWriter.WriteString(std::wstring(L" algn=\"") + string2std_string(strProp) + _T("\""));
} }
if (pPF->defaultTabSize.is_init()) if (pPF->defaultTabSize.is_init())
{ {
...@@ -144,8 +160,14 @@ public: ...@@ -144,8 +160,14 @@ public:
{ {
if (pPF->hasBullet.get()) if (pPF->hasBullet.get())
{ {
CString strB = _T("<a:buChar char=\"AAAAA\"/>"); //todooo wchar_t bu = 0x2022;
oWriter.WriteString(strB); if (pPF->bulletChar.is_init())
{
bu = pPF->bulletChar.get();
}
oWriter.WriteString(std::wstring(L"<a:buChar char=\""));
oWriter.WriteString(std::wstring(&bu, 1));
oWriter.WriteString(std::wstring(L"\"/>"));
} }
else else
{ {
...@@ -218,18 +240,18 @@ public: ...@@ -218,18 +240,18 @@ public:
if (pCF->FontBold.is_init()) if (pCF->FontBold.is_init())
{ {
if (pCF->FontBold.get()) if (pCF->FontBold.get())
oWriter.WriteString(_T(" b=\"1\"")); oWriter.WriteString(std::wstring(L" b=\"1\""));
else else
oWriter.WriteString(_T(" b=\"0\"")); oWriter.WriteString(std::wstring(L" b=\"0\""));
} }
if (pCF->FontItalic.is_init()) if (pCF->FontItalic.is_init())
{ {
if (pCF->FontItalic.get()) if (pCF->FontItalic.get())
oWriter.WriteString(_T(" i=\"1\"")); oWriter.WriteString(std::wstring(L" i=\"1\""));
else else
oWriter.WriteString(_T(" i=\"0\"")); oWriter.WriteString(std::wstring(L" i=\"0\""));
} }
oWriter.WriteString(_T(">")); oWriter.WriteString(std::wstring(L">"));
if (pCF->Color.is_init()) if (pCF->Color.is_init())
{ {
...@@ -263,7 +285,7 @@ public: ...@@ -263,7 +285,7 @@ public:
} }
else if (pCF->FontProperties.is_init()) else if (pCF->FontProperties.is_init())
{ {
oWriter.WriteString(_T("<a:latin typeface=\"") + pCF->FontProperties->strFontName + _T("\"/>")); oWriter.WriteString(std::wstring(L"<a:latin typeface=\"") + pCF->FontProperties->strFontName + _T("\"/>"));
} }
CString strCF2 = _T("</a:defRPr>"); CString strCF2 = _T("</a:defRPr>");
......
...@@ -269,7 +269,17 @@ public: ...@@ -269,7 +269,17 @@ public:
RELEASEARRAYOBJECTS(pData); RELEASEARRAYOBJECTS(pData);
} }
void WriteStringUTF8(const std::wstring& strXml)
{
BYTE* pData = NULL;
LONG lLen = 0;
NSFile::CUtf8Converter::GetUtf8StringFromUnicode(strXml.c_str(), strXml.length(), pData, lLen, false);
WriteFile(pData, lLen);
RELEASEARRAYOBJECTS(pData);
}
protected: protected:
FILE* m_pFile; FILE* m_pFile;
......
...@@ -29,7 +29,7 @@ class CFileDownloader : public CBaseThread ...@@ -29,7 +29,7 @@ class CFileDownloader : public CBaseThread
{ {
public : public :
CFileDownloader (CString sFileUrl, bool bDelete = true) : CBaseThread(0) CFileDownloader (std::wstring sFileUrl, bool bDelete = true) : CBaseThread(0)
{ {
m_pFile = NULL; m_pFile = NULL;
m_sFilePath = _T(""); m_sFilePath = _T("");
...@@ -44,16 +44,16 @@ public : ...@@ -44,16 +44,16 @@ public :
::fclose( m_pFile ); ::fclose( m_pFile );
m_pFile = NULL; m_pFile = NULL;
} }
if ( m_sFilePath.GetLength() > 0 && m_bDelete ) if ( m_sFilePath.length() > 0 && m_bDelete )
{ {
DeleteFileW( m_sFilePath.GetBuffer() ); DeleteFileW( m_sFilePath.c_str() );
m_sFilePath = _T(""); m_sFilePath = _T("");
} }
} }
CString GetFilePath() std::wstring GetFilePath()
{ {
return m_sFilePath; return m_sFilePath;
} }
...@@ -63,7 +63,7 @@ public : ...@@ -63,7 +63,7 @@ public :
} }
protected : protected :
unsigned int DownloadFile(CString sFileUrl) unsigned int DownloadFile(std::wstring sFileUrl)
{ {
// Проверяем состояние соединения // Проверяем состояние соединения
if ( FALSE == InternetGetConnectedState ( 0, 0 ) ) if ( FALSE == InternetGetConnectedState ( 0, 0 ) )
...@@ -90,7 +90,7 @@ protected : ...@@ -90,7 +90,7 @@ protected :
// Заголовок запроса ( пока содержит 0 байт ( необходимо для проверки ) ) // Заголовок запроса ( пока содержит 0 байт ( необходимо для проверки ) )
CString sHTTPHdr = _T ("Range: bytes=0-0"); CString sHTTPHdr = _T ("Range: bytes=0-0");
// Открываем ссылку для проверки на ее существование, а также на возможность чтения частями // Открываем ссылку для проверки на ее существование, а также на возможность чтения частями
HINTERNET hInternetOpenURL = InternetOpenUrl ( hInternetSession, sFileUrl, sHTTPHdr, -1, INTERNET_FLAG_RESYNCHRONIZE, 0 ); HINTERNET hInternetOpenURL = InternetOpenUrl ( hInternetSession, sFileUrl.c_str(), sHTTPHdr, -1, INTERNET_FLAG_RESYNCHRONIZE, 0 );
if ( NULL != hInternetOpenURL ) if ( NULL != hInternetOpenURL )
{ {
// Открытие произошло, проверяем ответ // Открытие произошло, проверяем ответ
...@@ -173,7 +173,7 @@ protected : ...@@ -173,7 +173,7 @@ protected :
return S_OK; return S_OK;
} }
DWORD DownloadFilePath ( HINTERNET hInternet, LPBYTE pBuffer, LONGLONG nStartByte, LONGLONG nEndByte, CString sFileURL ) DWORD DownloadFilePath ( HINTERNET hInternet, LPBYTE pBuffer, LONGLONG nStartByte, LONGLONG nEndByte, std::wstring sFileURL )
{ {
// Неоткрытая сессия // Неоткрытая сессия
if ( NULL == hInternet ) if ( NULL == hInternet )
...@@ -186,7 +186,7 @@ protected : ...@@ -186,7 +186,7 @@ protected :
// Заголовок запроса ( содержит nEndByte - nStartByte байт ) // Заголовок запроса ( содержит nEndByte - nStartByte байт )
CString sHTTPHdr = _T (""); sHTTPHdr.Format ( _T ("Range: bytes=%lld-%lld"), nStartByte, nEndByte ); CString sHTTPHdr = _T (""); sHTTPHdr.Format ( _T ("Range: bytes=%lld-%lld"), nStartByte, nEndByte );
// Открываем ссылку для закачки // Открываем ссылку для закачки
HINTERNET hInternetOpenURL = InternetOpenUrl ( hInternet, sFileURL, sHTTPHdr, -1, INTERNET_FLAG_RESYNCHRONIZE, 0 ); HINTERNET hInternetOpenURL = InternetOpenUrl ( hInternet, sFileURL.c_str(), sHTTPHdr, -1, INTERNET_FLAG_RESYNCHRONIZE, 0 );
if ( NULL == hInternetOpenURL ) if ( NULL == hInternetOpenURL )
return -1; return -1;
// Открытие произошло, проверяем ответ // Открытие произошло, проверяем ответ
...@@ -329,7 +329,7 @@ protected : ...@@ -329,7 +329,7 @@ protected :
return nFileSize; return nFileSize;
} }
HRESULT DownloadFileAll(CString sFileURL, CString strFileOutput) HRESULT DownloadFileAll(std::wstring sFileURL, std::wstring strFileOutput)
{ {
if ( m_pFile ) if ( m_pFile )
{ {
...@@ -337,7 +337,7 @@ protected : ...@@ -337,7 +337,7 @@ protected :
m_pFile = NULL; m_pFile = NULL;
} }
// Скачиваем файл // Скачиваем файл
return URLDownloadToFile (NULL, sFileURL, strFileOutput, NULL, NULL); return URLDownloadToFile (NULL, sFileURL.c_str(), strFileOutput.c_str(), NULL, NULL);
} }
public: public:
...@@ -357,12 +357,12 @@ public: ...@@ -357,12 +357,12 @@ public:
protected : protected :
FILE *m_pFile; // Хэндл на временный файл FILE *m_pFile; // Хэндл на временный файл
CString m_sFilePath; // Путь к сохраненному файлу на диске std::wstring m_sFilePath; // Путь к сохраненному файлу на диске
CString m_sFileUrl; // Ссылка на скачивание файла std::wstring m_sFileUrl; // Ссылка на скачивание файла
bool m_bComplete; // Закачался файл или нет bool m_bComplete; // Закачался файл или нет
bool m_bDelete; // Удалять ли файл в деструкторе bool m_bDelete; // Удалять ли файл в деструкторе
}; };
#else #else
......
...@@ -18,7 +18,7 @@ namespace SerializeCommon ...@@ -18,7 +18,7 @@ namespace SerializeCommon
CString DownloadImage(const CString& strFile) CString DownloadImage(const CString& strFile)
{ {
#ifndef DISABLE_FILE_DOWNLOADER #ifndef DISABLE_FILE_DOWNLOADER
CFileDownloader oDownloader(strFile, false); CFileDownloader oDownloader(string2std_string(strFile), false);
oDownloader.Start( 1 ); oDownloader.Start( 1 );
while ( oDownloader.IsRunned() ) while ( oDownloader.IsRunned() )
{ {
...@@ -27,7 +27,7 @@ namespace SerializeCommon ...@@ -27,7 +27,7 @@ namespace SerializeCommon
CString strFileName; CString strFileName;
if ( oDownloader.IsFileDownloaded() ) if ( oDownloader.IsFileDownloaded() )
{ {
strFileName = oDownloader.GetFilePath(); strFileName = std_string2string(oDownloader.GetFilePath());
} }
return strFileName; return strFileName;
#else #else
......
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