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

PPT - bug 5395 + нумерация+ ....

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@64841 954022d7-b5bf-4e40-9824-e11837661b57
parent f76d42f8
......@@ -542,29 +542,29 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape)
{
IElement* pElem = NULL;
oArrayShapes[nShape]->GetElement(&pElem, &m_oExMedia, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight,
pTheme, pLayout, pThemeWrapper, pSlideWrapper, pSlide);
if (NULL != pElem)
{
AddAnimation ( dwSlideID, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight, pElem );
if (pElem->m_bIsBackground)
if (pElem->m_bIsBackground && !pElem->m_bHaveAnchor)
{
if (!oArrayAtoms[0]->m_bMasterBackground)
//if (!oArrayAtoms[0]->m_bMasterBackground)
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
if (NULL != pShape)
{
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
if (NULL != pShape)
{
pShape->SetupProperties(pSlide, pTheme, pLayout);
pShape->SetupProperties(pSlide, pTheme, pLayout);
pSlide->m_bIsBackground = true;
pSlide->m_oBackground = pShape->m_oShape.m_oBrush;
}
pSlide->m_bIsBackground = true;
pSlide->m_oBackground = pShape->m_oShape.m_oBrush;
}
RELEASEINTERFACE(pElem);
continue;
}
RELEASEOBJECT(pElem);
continue;
}else
AddAnimation ( dwSlideID, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight, pElem );
pSlide->m_arElements.push_back(pElem);
}
......@@ -744,6 +744,8 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
pLayout->m_bUseThemeColorScheme = true;
pLayout->m_bShowMasterShapes = bMasterObjects;
if (oArraySlideAtoms[0]->m_oLayout.m_nGeom == 1) oArraySlideAtoms[0]->m_oLayout.m_nGeom = 15;
pLayout->m_strLayoutType = ConvertLayoutType(oArraySlideAtoms[0]->m_oLayout.m_nGeom, oArraySlideAtoms[0]->m_oLayout.m_pPlaceHolderID);
// ...-----------------------------------------------------------
......
......@@ -182,6 +182,8 @@ public:
NSOfficePPT::PlaceholderEnum phbody = (NSOfficePPT::PlaceholderEnum)pPlaceholders[0];
switch (phbody)
{
case NSOfficePPT::MasterTitle:
return _T("title");
case NSOfficePPT::Table:
return _T("tbl");
case NSOfficePPT::OrganizationChart:
......
......@@ -106,10 +106,10 @@ IRecord* CreateByType(SRecordHeader oHeader)
CREATE_BY_TYPE(RECORD_TYPE_COMPOSITEMASTERID , CRecordTripCompositeMasterId12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPCONTENTMASTERINFO12 , CRecordRoundTripContentMasterInfo12Atom) // ECMA-376
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPSHAPEID12 , CRecordRoundTripShapeId12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPHFPLACEHOLDER12 , CRecordRoundTripHFPlaceholder12Atom)
CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPHFPLACEHOLDER12 , CRecordRoundTripHFPlaceholder12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPCONTENTMASTERID , CRecordRoundTripContentMasterId12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPOARTTEXTSTYLES12 , CRecordRoundTripOArtTextStyles12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPHEADERFOOTERDEFAULTS12ATOM , CRecordRoundTripHeaderFooterDefaults12Atom)
CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPHEADERFOOTERDEFAULTS12ATOM , CRecordRoundTripHeaderFooterDefaults12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPDOCFLAGS12 , CRecordRoundTripDocFlags12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPSHAPECHECKSUMFORCUSTOMLAYOUTS12 , CRecordRoundTripShapeCheckSumForCustomLayouts12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPNOTESMASTERTEXTSTYLES12 , CRecordRoundTripNotesMasterTextStyles12Atom)
......@@ -193,7 +193,7 @@ IRecord* CreateByType(SRecordHeader oHeader)
CREATE_BY_TYPE(RECORD_TYPE_TXINTERACTIVEINFO_ATOM , CRecordTextInteractiveInfoAtom)
//
CREATE_BY_TYPE ( RECORD_PROG_TAGS , SlideProgTagsContainer )
CREATE_BY_TYPE ( RECORD_PROG_TAGS , SlideProgTagsContainer )
CREATE_BY_TYPE(RECORD_TYPE_SOUNDCOLLECTION , CRecordSoundCollectionContainer)
CREATE_BY_TYPE(RECORD_TYPE_EXOBJLIST , CRecordExObjListContainer)
......@@ -202,14 +202,13 @@ IRecord* CreateByType(SRecordHeader oHeader)
CREATE_BY_TYPE(RECORD_TYPE_SOUNDDATA , CRecordSoundDataBlob)
default:
{
#ifdef _DEBUG
char str[1024]={};
sprintf(str, "Unknown record type: %xd\n" , oHeader.RecType);
std::cout << str;
#endif
}
break;
{
//#ifdef _DEBUG
// char str[1024]={};
// sprintf(str, "Unknown record type: %xd\n" , oHeader.RecType);
// std::cout << str;
//#endif
}break;
};
if (NULL == pRecord)
......@@ -223,5 +222,10 @@ IRecord* CreateByType(SRecordHeader oHeader)
pRecord = new CUnknownRecord();
}
}
#ifdef _DEBUG
wchar_t str[1024]={};
swprintf(str, L"%s record type: %xd\n" , GetRecordName((DWORD)oHeader.RecType).GetBuffer(), oHeader.RecType);
std::wcout << str;
#endif
return pRecord;
}
......@@ -95,12 +95,12 @@ public:
return lIndex;
LONG lResult = 0;
size_t nCount = m_parEmptyPictures->size();
DWORD nCount = m_parEmptyPictures->size();
if (lIndex > nCount)
return lIndex;
for (size_t nIndex = 0; nIndex < (std::min)(lIndex, (DWORD)nCount); ++nIndex)
for (DWORD nIndex = 0; nIndex < (std::min)(lIndex, nCount); ++nIndex)
{
if ((*m_parEmptyPictures)[nIndex])
++lResult;
......
......@@ -221,7 +221,7 @@ public:
}break;
case pibName:
{
pElement->m_sName = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue /2);
pElement->m_sName = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue /2-1);
}break;
case cropFromTop:
{
......@@ -431,6 +431,9 @@ public:
oAtom.FromValue(pProperty->m_lValue);
//pElemProps->SetAt(CElementProperty::epBrushColor1, oAtom.ToValueProperty());
oAtom.ToColor(&pParentShape->m_oBrush.Color1);
pParentShape->m_oBrush.Type = c_BrushTypeSolid;
break;
}
case NSOfficeDrawing::fillBackColor:
......@@ -677,7 +680,7 @@ public:
{
if (pProperty->m_bComplex && 0 < pProperty->m_lValue)
{
std::wstring str = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue/2);
std::wstring str = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue/2-1);
//pParentShape->m_oText.m_sText = str;
}
break;
......@@ -687,7 +690,7 @@ public:
{
if (pProperty->m_bComplex && 0 < pProperty->m_lValue)
{
std::wstring str = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue/2);
std::wstring str = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue/2-1);
pParentShape->m_oText.m_oAttributes.m_oFont.Name = std_string2string(str);
//pElemProps->SetAt(CElementProperty::epFontName, (CString)str);
}
......@@ -756,7 +759,7 @@ public:
default:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 0;
pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = -1; // not set
//pElemProps->SetAt(CElementProperty::epFontHorAlign, (DWORD)1);
//pElemProps->SetAt(CElementProperty::epFontVertAlign, (DWORD)0);
break;
......@@ -923,9 +926,9 @@ public:
if (!bIsFilled)
{
pParentShape->m_oBrush.Type = (int)c_BrushTypeSolid;
pParentShape->m_oBrush.Alpha1 = 0;
pParentShape->m_oBrush.Alpha2 = 0;
pParentShape->m_oBrush.Type = c_BrushTypeNoFill;//(int)c_BrushTypeSolid;
/*pParentShape->m_oBrush.Alpha1 = 0;
pParentShape->m_oBrush.Alpha2 = 0;*/
//pElemProps->SetAt(CElementProperty::epFilled, (DWORD)0);
}
}
......@@ -1220,13 +1223,13 @@ public:
{
pShapeElem->m_oShape.m_oText.m_lTextType = oArrayTextHeader[0]->m_nTextType;
pShapeElem->m_oShape.m_oText.m_lTextMasterType = oArrayTextHeader[0]->m_nTextType;
oElementInfo.m_lMasterTextType = oArrayTextHeader[0]->m_nTextType;
oElementInfo.m_lMasterTextType = oArrayTextHeader[0]->m_nTextType;
}
else
{
pShapeElem->m_oShape.m_oText.m_lTextType = NSOfficePPT::NoPresent;
pShapeElem->m_oShape.m_oText.m_lTextMasterType = NSOfficePPT::NoPresent;
oElementInfo.m_lMasterTextType = NSOfficePPT::NoPresent;
oElementInfo.m_lMasterTextType = NSOfficePPT::NoPresent;
}
//
......@@ -1250,10 +1253,24 @@ public:
if (0 == pElem->m_lPlaceholderType)
pElem->m_lPlaceholderID = 1;
else if (15 == pElem->m_lPlaceholderType)
else if (15 == pElem->m_lPlaceholderType)//??
pElem->m_lPlaceholderID = -1;
pElem->m_lPlaceholderType = CPPTElement::CorrectPlaceHolderType(pElem->m_lPlaceholderType);
if (pElem->m_lPlaceholderID != -1)
{
pLayout->m_mapPlaceholders.insert(std::pair<LONG, LONG>(pElem->m_lPlaceholderID, pElem->m_lPlaceholderType));
}
}
std::vector<CRecordRoundTripHFPlaceholder12Atom*> oArrayHFPlaceholder;
this->GetRecordsByType(&oArrayHFPlaceholder, true, true);
if (0 < oArrayHFPlaceholder.size())
{
pElem->m_lPlaceholderType= oArrayHFPlaceholder[0]->m_nPlacementID;//PT_MasterDate, PT_MasterSlideNumber, PT_MasterFooter, or PT_MasterHeader
pElem->m_lPlaceholderType = CPPTElement::CorrectPlaceHolderType(pElem->m_lPlaceholderType);
}
CString strText = _T("");
......@@ -1326,31 +1343,31 @@ public:
// . 90 270 0 180 -
// 90 .
double dAngle = pShapeElem->m_dRotate;
if (0 <= dAngle)
{
LONG lCount = (LONG)dAngle / 360;
dAngle -= (lCount * 360.0);
}
else
{
LONG lCount = (LONG)dAngle / 360;
dAngle += ((-lCount + 1) * 360.0);
}
if (((dAngle > 45) && (dAngle < 135)) || ((dAngle > 225) && (dAngle < 315)))
{
double dW = pShapeElem->m_rcBounds.GetWidth();
double dH = pShapeElem->m_rcBounds.GetHeight();
double dCx = (pShapeElem->m_rcBounds.left + pShapeElem->m_rcBounds.right) / 2.0;
double dCy = (pShapeElem->m_rcBounds.top + pShapeElem->m_rcBounds.bottom) / 2.0;
pShapeElem->m_rcBounds.left = dCx - dH / 2.0;
pShapeElem->m_rcBounds.right = dCx + dH / 2.0;
pShapeElem->m_rcBounds.top = dCy - dW / 2.0;
pShapeElem->m_rcBounds.bottom = dCy + dW / 2.0;
}
//double dAngle = pShapeElem->m_dRotate;
//if (0 <= dAngle)
//{
// LONG lCount = (LONG)dAngle / 360;
// dAngle -= (lCount * 360.0);
//}
//else
//{
// LONG lCount = (LONG)dAngle / 360;
// dAngle += ((-lCount + 1) * 360.0);
//}
//if (((dAngle > 45) && (dAngle < 135)) || ((dAngle > 225) && (dAngle < 315)))
//{
// double dW = pShapeElem->m_rcBounds.GetWidth();
// double dH = pShapeElem->m_rcBounds.GetHeight();
// double dCx = (pShapeElem->m_rcBounds.left + pShapeElem->m_rcBounds.right) / 2.0;
// double dCy = (pShapeElem->m_rcBounds.top + pShapeElem->m_rcBounds.bottom) / 2.0;
// pShapeElem->m_rcBounds.left = dCx - dH / 2.0;
// pShapeElem->m_rcBounds.right = dCx + dH / 2.0;
// pShapeElem->m_rcBounds.top = 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);
......@@ -1381,7 +1398,9 @@ public:
pElem->m_oMetric.SetUnitsContainerSize(lSlideWidth, lSlideHeight);
}
pElem->m_bIsBackground = (true == oArrayShape[0]->m_bBackground);
pElem->m_bIsBackground = (true == oArrayShape[0]->m_bBackground);
pElem->m_bHaveAnchor = (true == oArrayShape[0]->m_bHaveAnchor);
*ppElement = pElem;
}
......
......@@ -28,13 +28,13 @@ public:
m_nFormatID = StreamUtils::ReadWORD(pStream);
USHORT nFlag = StreamUtils::ReadWORD(pStream);
m_bHasDate = ((nFlag & 0x01) == 0x01);
m_bHasTodayDate = ((nFlag & 0x02) == 0x02);
m_bHasUserDate = ((nFlag & 0x04) == 0x04);
m_bHasSlideNumber = ((nFlag & 0x08) == 0x08);
m_bHasHeader = ((nFlag & 0x10) == 0x10);
m_bHasFooter = ((nFlag & 0x20) == 0x20);
USHORT nFlag = StreamUtils::ReadWORD(pStream);
m_bHasDate = ((nFlag & 0x01) == 0x01);
m_bHasTodayDate = ((nFlag & 0x02) == 0x02);
m_bHasUserDate = ((nFlag & 0x04) == 0x04);
m_bHasSlideNumber = ((nFlag & 0x08) == 0x08);
m_bHasHeader = ((nFlag & 0x10) == 0x10);
m_bHasFooter = ((nFlag & 0x20) == 0x20);
}
virtual CString ToString()
{
......@@ -61,4 +61,42 @@ public:
return oWriter.GetXmlString();
}
};
\ No newline at end of file
};
class CRecordRoundTripHeaderFooterDefaults12Atom : public CUnknownRecord
{
WORD m_nFormatID;
bool m_bIncludeDate;
bool m_bIncludeFooter;
bool m_bIncludeHeader;
bool m_bIncludeSlideNumber;
public:
CRecordRoundTripHeaderFooterDefaults12Atom()
{
}
~CRecordRoundTripHeaderFooterDefaults12Atom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
BYTE nFlag = StreamUtils::ReadBYTE(pStream);
m_bIncludeDate = ((nFlag & 0x04) == 0x04);
m_bIncludeFooter = ((nFlag & 0x08) == 0x08);
m_bIncludeHeader = ((nFlag & 0x10) == 0x10);
m_bIncludeSlideNumber = ((nFlag & 0x20) == 0x20);
}
virtual CString ToString()
{
return _T("");
}
};
......@@ -33,6 +33,49 @@ public:
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length") , CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type") , CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance") , CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("Position") , (DWORD)m_nPosition, &oWriter);
CDirectory::WriteValueToNode(_T("PlacementID") , (DWORD)m_nPlacementID, &oWriter);
CDirectory::WriteValueToNode(_T("Size") , (DWORD)m_nSize, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
class CRecordRoundTripHFPlaceholder12Atom : public CUnknownRecord
{
public:
BYTE m_nPlacementID;
public:
CRecordRoundTripHFPlaceholder12Atom()
{
}
~CRecordRoundTripHFPlaceholder12Atom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nPlacementID = StreamUtils::ReadBYTE(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
......@@ -40,12 +83,11 @@ public:
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("Position"), (DWORD)m_nPosition, &oWriter);
CDirectory::WriteValueToNode(_T("PlacementID"), (DWORD)m_nPlacementID, &oWriter);
CDirectory::WriteValueToNode(_T("Size"), (DWORD)m_nSize, &oWriter);
CDirectory::WriteValueToNode(_T("PlacementID") , (DWORD)m_nPlacementID, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
};
......@@ -350,7 +350,7 @@ namespace NSBinPptxRW
if ( oDownloader.IsFileDownloaded() )
{
return std_string2string(oDownloader.GetFilePath());
return std_string2string(oDownloader.GetFilePath());
}
#endif
return _T("");
......
......@@ -260,7 +260,7 @@ namespace NSShapeImageGen
return GenerateImageID(punkImage, (std::max)(1.0, width), (std::max)(1.0, height));
}
CImageInfo WriteImage(const CString& strFile, COleInfo* pOle, double& x, double& y, double& width, double& height)
CImageInfo WriteImage(const CString& strFile, COleInfo* pOle, double& x, double& y, double& width, double& height)
{
bool bIsDownload = false;
int n1 = strFile.Find(_T("www"));
......@@ -301,7 +301,7 @@ namespace NSShapeImageGen
}
if ( oDownloader.IsFileDownloaded() )
strDownload = std_string2string(oDownloader.GetFilePath());
strDownload = std_string2string(oDownloader.GetFilePath());
#endif
......@@ -599,7 +599,7 @@ namespace NSShapeImageGen
return oInfo;
}
CImageInfo GenerateImageID_2(CString& strFileName, CString& strUrl, double dWidth, double dHeight)
CImageInfo GenerateImageID_2(const CString & strFileName, const CString & strUrl, double dWidth, double dHeight)
{
CImageInfo oInfo;
LONG lWidth = (LONG)(dWidth * 96 / 25.4);
......
......@@ -694,7 +694,7 @@ namespace NSPresentationEditor
}
bool IsEqual(CBrush* pBrush)
bool IsEqual(CBrush* pBrush)
{
if (NULL == pBrush)
return false;
......@@ -712,7 +712,7 @@ namespace NSPresentationEditor
void SetDefaultParams()
{
Type = c_BrushTypeSolid;
Type = c_BrushTypeNoFill;
Color1 = 0xFFFFFFFF;
Alpha1 = 255;
......@@ -726,7 +726,7 @@ namespace NSPresentationEditor
TexturePath = _T("");
Rectable = false;
Rectable = false;
Rect.X = 0.0F;
Rect.Y = 0.0F;
......@@ -1160,7 +1160,7 @@ namespace NSPresentationEditor
m_oTextBrush.Color1 = 0xFF;
m_nTextAlignHorizontal = 0;
m_nTextAlignVertical = 1; //middle
m_nTextAlignVertical = -1; //not set
m_dTextRotate = 0;
}
CTextAttributes& operator =(const CTextAttributes& oSrc)
......
......@@ -46,7 +46,8 @@ namespace NSPresentationEditor
bool m_bFlipH; //
bool m_bFlipV; //
bool m_bIsBackground; // background??
bool m_bIsBackground;
bool m_bHaveAnchor;
bool m_bIsChangeable; //
bool m_bIsLayoutElement; // ,
......@@ -85,6 +86,7 @@ namespace NSPresentationEditor
IElement()
{
m_bIsBackground = false;
m_bHaveAnchor = true;
m_bIsChangeable = true;
m_bIsLayoutElement = false;
......@@ -148,6 +150,7 @@ namespace NSPresentationEditor
return;
pDublicate->m_bIsBackground = m_bIsBackground;
pDublicate->m_bHaveAnchor = m_bHaveAnchor;
pDublicate->m_bIsChangeable = m_bIsChangeable;
pDublicate->m_bIsLayoutElement = m_bIsLayoutElement;
......
......@@ -997,12 +997,12 @@ namespace NSPresentationEditor
}
case CElementProperty::epFontBold:
{
m_oShape.m_oText.m_oAttributes.m_oFont.Bold = (bool)pProperty->m_dwValue;
m_oShape.m_oText.m_oAttributes.m_oFont.Bold = (bool)pProperty->m_dwValue;
break;
}
case CElementProperty::epFontItalic:
{
m_oShape.m_oText.m_oAttributes.m_oFont.Italic = (bool)pProperty->m_dwValue;
m_oShape.m_oText.m_oAttributes.m_oFont.Italic = (bool)pProperty->m_dwValue;
break;
}
case CElementProperty::epFontStrikeout:
......
......@@ -9,6 +9,8 @@ namespace NSPresentationEditor
public:
std::vector<IElement*> m_arElements;
std::vector<CColor> m_arColorScheme;
std::map<LONG, LONG> m_mapPlaceholders;
bool m_bUseThemeColorScheme;
......@@ -92,7 +94,7 @@ namespace NSPresentationEditor
m_bUseThemeColorScheme = true;
m_bShowMasterShapes = true;
m_strLayoutType = _T("title");
m_strLayoutType = _T("obj");
m_bIsBackground = false;
m_lWidth = m_lHeight = m_lOriginalWidth = m_lOriginalHeight = 0;
......
......@@ -82,6 +82,7 @@ namespace SVG
const long c_BrushTypePattern = 3009;
const long c_BrushTypeHatch1 = 4009;
const long c_BrushTypeHatch53 = 4061;
const long c_BrushTypeNoFill = 5000;
}
namespace StringHelpers
......
#pragma once
#include "Attributes.h"
#define GETBIT(from, num) ((from & (1 << num)) != 0)
#define GETBITS(from, numL, numH) ((from & (((1 << (numH - numL + 1)) - 1) << numL)) >> numL)
namespace NSPresentationEditor
{
static void CorrectColorPPT(LONG& lSchemeIndex)
......@@ -125,13 +128,13 @@ namespace NSPresentationEditor
R = 0;
G = 0;
B = 0;
Index = 0;
Index = -1;
bPaletteIndex = false;
bPaletteRGB = false;
bSystemRGB = false;
bSchemeIndex = false;
bSysIndex = false;
bPaletteIndex = false;
bPaletteRGB = false;
bSystemRGB = false;
bSchemeIndex = false;
bSysIndex = false;
}
SColorAtom(const SColorAtom& oSrc)
......@@ -147,11 +150,11 @@ namespace NSPresentationEditor
Index = oSrc.Index;
bPaletteIndex = oSrc.bPaletteIndex;
bPaletteRGB = oSrc.bPaletteRGB;
bSystemRGB = oSrc.bSystemRGB;
bSchemeIndex = oSrc.bSchemeIndex;
bSysIndex = oSrc.bSysIndex;
bPaletteIndex = oSrc.bPaletteIndex;
bPaletteRGB = oSrc.bPaletteRGB;
bSystemRGB = oSrc.bSystemRGB;
bSchemeIndex = oSrc.bSchemeIndex;
bSysIndex = oSrc.bSysIndex;
return *this;
}
......@@ -209,21 +212,51 @@ namespace NSPresentationEditor
R = _R;
G = _G;
B = _B;
Index = 0x00;
Index = -1;
}
void FromValue(DWORD dwValue)
{
R = (BYTE)(dwValue);
G = (BYTE)(dwValue >> 8);
B = (BYTE)(dwValue >> 16);
Index = (BYTE)(dwValue >> 24);
bPaletteIndex = (0x01 == (Index & 0x01));
bPaletteRGB = (0x02 == (Index & 0x02));
bSystemRGB = (0x04 == (Index & 0x04));
bSchemeIndex = (0x08 == (Index & 0x08));
bSysIndex = (0x10 == (Index & 0x10));
//R = (BYTE)(dwValue);
//G = (BYTE)(dwValue >> 8);
//B = (BYTE)(dwValue >> 16);
//Index = (BYTE)(dwValue >> 24);
//bPaletteIndex = (0x01 == (Index & 0x01));
//bPaletteRGB = (0x02 == (Index & 0x02));
//bSystemRGB = (0x04 == (Index & 0x04));
//bSchemeIndex = (0x08 == (Index & 0x08));
//bSysIndex = (0x10 == (Index & 0x10));
R = static_cast<unsigned char>(GETBITS(dwValue, 0, 7));
G = static_cast<unsigned char>(GETBITS(dwValue, 8, 15));
B = static_cast<unsigned char>(GETBITS(dwValue, 16, 23));
Index = -1;
bPaletteIndex = GETBIT(dwValue, 24);
bPaletteRGB = GETBIT(dwValue, 25);
bSystemRGB = GETBIT(dwValue, 26);
bSchemeIndex = GETBIT(dwValue, 27);
bSysIndex = GETBIT(dwValue, 28);
/*if(!bSchemeIndex && !bPaletteIndex && !bSysIndex)
{
colorRGB = STR::toRGB(red, green, blue);
}
else */
if(bSchemeIndex)
{
Index = R;
}
else if(bPaletteIndex)
{
Index = ((G) << 8) + R;
}
else if(bSysIndex)
{
Index = ((G) << 8) + R;
}
}
void ToColor(CColor* pColor)
......@@ -232,6 +265,8 @@ namespace NSPresentationEditor
pColor->G = G;
pColor->B = B;
pColor->m_lSchemeIndex = -1;
if (bSchemeIndex)
{
pColor->m_lSchemeIndex = R;
......
......@@ -58,6 +58,8 @@ void NSPresentationEditor::CPPTXWriter::CreateFile(CPPTUserInfo* pUserInfo )
m_pDocument = dynamic_cast<CDocument*>(pUserInfo);
//m_pDocument->Calculate();
m_pDocument->m_oInfo.m_lUnitsHor = 36000 * m_pDocument->m_oInfo.m_lMillimetresHor;
m_pDocument->m_oInfo.m_lUnitsVer = 36000 * m_pDocument->m_oInfo.m_lMillimetresVer;
......@@ -483,9 +485,15 @@ void NSPresentationEditor::CPPTXWriter::WriteThemes()
oStringWriter.WriteString(std::wstring(L"<a:fontScheme name=\"default\"><a:majorFont><a:latin typeface=\""));
oStringWriter.WriteString(pTheme->m_arFonts[0].Name);
oStringWriter.WriteString(std::wstring(L"\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/></a:majorFont><a:minorFont><a:latin typeface=\""));
oStringWriter.WriteString(pTheme->m_arFonts[1].Name);
oStringWriter.WriteString(std::wstring(L"\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/></a:minorFont></a:fontScheme>"));
oStringWriter.WriteString(std::wstring(L"\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/></a:majorFont>"));
oStringWriter.WriteString(std::wstring(L"<a:minorFont><a:latin typeface=\""));
if (pTheme->m_arFonts.size() >1 ) oStringWriter.WriteString(pTheme->m_arFonts[1].Name);
else oStringWriter.WriteString(pTheme->m_arFonts[0].Name);
oStringWriter.WriteString(std::wstring(L"\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/></a:minorFont>"));
oStringWriter.WriteString(std::wstring(L"</a:fontScheme>"));
oStringWriter.WriteString(std::wstring(L"<a:fmtScheme name=\"Default\">\
<a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\">\
......@@ -670,29 +678,60 @@ accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\"
void NSPresentationEditor::CPPTXWriter::WriteBackground(CStringWriter& oWriter, CRelsGenerator& oRels, CBrush& oBackground)
{
oWriter.WriteString(std::wstring(L"<p:bg><p:bgPr>"));
if (oBackground.Type == c_BrushTypeTexture)
{
CString strRid = oRels.WriteImage(oBackground.TexturePath);
CString strWrite = _T("<p:bg><p:bgPr><a:blipFill dpi=\"0\" rotWithShape=\"0\"><a:blip r:embed=\"") + strRid +
_T("\"/><a:srcRect/><a:stretch><a:fillRect/></a:stretch></a:blipFill><a:effectLst/></p:bgPr></p:bg>");
oWriter.WriteString(std::wstring(L"<a:blipFill dpi=\"0\" rotWithShape=\"0\"><a:blip r:embed=\""));
oWriter.WriteString(strRid + _T("\">"));
if (oBackground.TextureAlpha != 255)
{
CString strAlpha;
strAlpha.Format(L"%d", (int)(oBackground.TextureAlpha * 100000. / 255));
oWriter.WriteString(std::wstring(L"<a:alphaModFix amt=\"") + string2std_string(strAlpha) + L"\"/>");
}
oWriter.WriteString(std::wstring(L"</a:blip><a:srcRect/>"));
oWriter.WriteString(strWrite);
if (oBackground.TextureMode == 1)
oWriter.WriteString(std::wstring(L"<a:tile algn=\"tl\"/>"));
else
oWriter.WriteString(std::wstring(L"<a:stretch><a:fillRect/></a:stretch>"));
oWriter.WriteString(std::wstring(L"</a:blipFill><a:effectLst/>"));
oWriter.WriteString(std::wstring(L"</p:bgPr></p:bg>"));
return;
}
if (oBackground.Color1.m_lSchemeIndex == -1)
{
CString str = _T("");
str.Format(_T("<a:solidFill><a:srgbClr val=\"%06x\"/></a:solidFill>"), oBackground.Color1.GetLONG_RGB());
str = _T("<p:bg><p:bgPr>") + str + _T("</p:bgPr></p:bg>");
oWriter.WriteString(str);
CString strColor;
strColor.Format(L"%06x", oBackground.Color1.GetLONG_RGB());
oWriter.WriteString(std::wstring(L"<a:solidFill><a:srgbClr val=\"") + string2std_string(strColor) + _T("\">"));
if (oBackground.Alpha1 != 255)
{
CString strAlpha;
strAlpha.Format(L"%d", (int)(oBackground.Alpha1 * 100000. / 255));
oWriter.WriteString(std::wstring(L"<a:alpha val=\"") + string2std_string(strAlpha) + _T("\"/>"));
}
oWriter.WriteString(std::wstring(L"</a:srgbClr></a:solidFill>"));
}
else
{
CString str = _T("<a:solidFill><a:schemeClr val=\"") + CStylesWriter::GetColorInScheme(oBackground.Color1.m_lSchemeIndex) + _T("\"/></a:solidFill>");
str = _T("<p:bg><p:bgPr>") + str + _T("</p:bgPr></p:bg>");
oWriter.WriteString(str);
oWriter.WriteString(std::wstring(L"<a:solidFill><a:schemeClr val=\""));
oWriter.WriteString(CStylesWriter::GetColorInScheme(oBackground.Color1.m_lSchemeIndex) + _T("\"/>"));
if (oBackground.Alpha1 != 255)
{
CString strAlpha;
strAlpha.Format(L"%d", (int)(oBackground.Alpha1 * 100000 / 255));
oWriter.WriteString(std::wstring(L"<a:alpha val=\"") + string2std_string(strAlpha) + _T("\"/>"));
}
oWriter.WriteString(std::wstring(L"</a:solidFill>"));
}
oWriter.WriteString(std::wstring(L"</p:bgPr></p:bg>"));
}
void NSPresentationEditor::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRelsGenerator& oRels, IElement* pElement, CLayout* pLayout)
......
......@@ -115,89 +115,91 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
{
m_oWriter.WriteString(m_pShapeElement->m_oShape.m_strPPTXShape);
}
}/*else
m_oWriter.WriteString(std::wstring(L"<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>"));*/
CBrush* pBrush = &m_pShapeElement->m_oShape.m_oBrush;
if (pBrush->Type == c_BrushTypeTexture)
{
CString strRid = m_pRels->WriteImage(pBrush->TexturePath);
CString strWrite = _T("<a:blipFill dpi=\"0\" rotWithShape=\"1\"><a:blip r:embed=\"") + strRid +
_T("\"/><a:srcRect/><a:stretch><a:fillRect/></a:stretch></a:blipFill>");
CBrush* pBrush = &m_pShapeElement->m_oShape.m_oBrush;
if (pBrush->Type == c_BrushTypeTexture)
{
CString strRid = m_pRels->WriteImage(pBrush->TexturePath);
m_oWriter.WriteString(strWrite);
m_oWriter.WriteString(std::wstring(L"<a:blipFill dpi=\"0\" rotWithShape=\"1\"><a:blip r:embed=\"") + string2std_string(strRid) +
_T("\"/><a:srcRect/><a:stretch><a:fillRect/></a:stretch></a:blipFill>"));
}
else if (pBrush->Type == c_BrushTypeNoFill)
{
m_oWriter.WriteString(std::wstring(L"<a:noFill/>"));
}
else if (pBrush->Color1.m_lSchemeIndex == -1)
{
if (255 == pBrush->Alpha1)
{
CString str = _T("");
str.Format(_T("<a:solidFill><a:srgbClr val=\"%06x\"/></a:solidFill>"), pBrush->Color1.GetLONG_RGB());
m_oWriter.WriteString(str);
}
else if (pBrush->Color1.m_lSchemeIndex == -1)
else
{
if (255 == pBrush->Alpha1)
{
CString str = _T("");
str.Format(_T("<a:solidFill><a:srgbClr val=\"%06x\"/></a:solidFill>"), pBrush->Color1.GetLONG_RGB());
m_oWriter.WriteString(str);
}
else
{
CString str = _T("");
str.Format(_T("<a:solidFill><a:srgbClr val=\"%06x\"><a:alpha val=\"%d\"/></a:srgbClr></a:solidFill>"), pBrush->Color1.GetLONG_RGB(), (int)(pBrush->Alpha1 * 100000 / 255));
m_oWriter.WriteString(str);
}
CString str = _T("");
str.Format(_T("<a:solidFill><a:srgbClr val=\"%06x\"><a:alpha val=\"%d\"/></a:srgbClr></a:solidFill>"), pBrush->Color1.GetLONG_RGB(), (int)(pBrush->Alpha1 * 100000 / 255));
m_oWriter.WriteString(str);
}
}
else
{
if (255 == pBrush->Alpha1)
{
CString str = _T("<a:solidFill><a:schemeClr val=\"") + CStylesWriter::GetColorInScheme(pBrush->Color1.m_lSchemeIndex) + _T("\"/></a:solidFill>");
m_oWriter.WriteString(str);
}
else
{
if (255 == pBrush->Alpha1)
{
CString str = _T("<a:solidFill><a:schemeClr val=\"") + CStylesWriter::GetColorInScheme(pBrush->Color1.m_lSchemeIndex) + _T("\"/></a:solidFill>");
m_oWriter.WriteString(str);
}
else
{
CString strAlpha; strAlpha.Format(_T("%d"), (int)(pBrush->Alpha1 * 100000 / 255));
CString strAlpha; strAlpha.Format(_T("%d"), (int)(pBrush->Alpha1 * 100000 / 255));
CString str = _T("<a:solidFill><a:schemeClr val=\"") + CStylesWriter::GetColorInScheme(pBrush->Color1.m_lSchemeIndex) + _T("\"><a:alpha val=\"") + strAlpha + _T("\"/></a:schemeClr></a:solidFill>");
CString str = _T("<a:solidFill><a:schemeClr val=\"") + CStylesWriter::GetColorInScheme(pBrush->Color1.m_lSchemeIndex) + _T("\"><a:alpha val=\"") + strAlpha + _T("\"/></a:schemeClr></a:solidFill>");
m_oWriter.WriteString(str);
}
m_oWriter.WriteString(str);
}
//m_oWriter.WriteString(std::wstring(L"<a:effectLst/>"));
}
//m_oWriter.WriteString(std::wstring(L"<a:effectLst/>"));
CPen* pPen = &m_pShapeElement->m_oShape.m_oPen;
CString strLine = _T("");
strLine.Format(_T("<a:ln w=\"%d\">"), (int)(pPen->Size * 36000));
m_oWriter.WriteString(strLine);
CPen* pPen = &m_pShapeElement->m_oShape.m_oPen;
CString strLine = _T("");
strLine.Format(_T("<a:ln w=\"%d\">"), (int)(pPen->Size * 36000));
m_oWriter.WriteString(strLine);
if (pPen->Color.m_lSchemeIndex == -1)
if (pPen->Color.m_lSchemeIndex == -1)
{
if (255 == pPen->Alpha)
{
if (255 == pPen->Alpha)
{
CString str = _T("");
str.Format(_T("<a:solidFill><a:srgbClr val=\"%06x\"/></a:solidFill>"), pPen->Color.GetLONG_RGB());
m_oWriter.WriteString(str);
}
else
{
CString str = _T("");
str.Format(_T("<a:solidFill><a:srgbClr val=\"%06x\"><a:alpha val=\"%d\"/></a:srgbClr></a:solidFill>"), pPen->Color.GetLONG_RGB(), (int)(pPen->Alpha * 100000 / 255));
m_oWriter.WriteString(str);
}
CString str = _T("");
str.Format(_T("<a:solidFill><a:srgbClr val=\"%06x\"/></a:solidFill>"), pPen->Color.GetLONG_RGB());
m_oWriter.WriteString(str);
}
else
{
if (255 == pPen->Alpha)
{
CString str = _T("<a:solidFill><a:schemeClr val=\"") + CStylesWriter::GetColorInScheme(pPen->Color.m_lSchemeIndex) + _T("\"/></a:solidFill>");
m_oWriter.WriteString(str);
}
else
{
CString strAlpha; strAlpha.Format(_T("%d"), (int)(pPen->Alpha * 100000 / 255));
CString str = _T("<a:solidFill><a:schemeClr val=\"") + CStylesWriter::GetColorInScheme(pPen->Color.m_lSchemeIndex) + _T("\"><a:alpha val=\"") + strAlpha + _T("\"/></a:schemeClr></a:solidFill>");
m_oWriter.WriteString(str);
}
CString str = _T("");
str.Format(_T("<a:solidFill><a:srgbClr val=\"%06x\"><a:alpha val=\"%d\"/></a:srgbClr></a:solidFill>"), pPen->Color.GetLONG_RGB(), (int)(pPen->Alpha * 100000 / 255));
m_oWriter.WriteString(str);
}
}
else
{
if (255 == pPen->Alpha)
{
CString str = _T("<a:solidFill><a:schemeClr val=\"") + CStylesWriter::GetColorInScheme(pPen->Color.m_lSchemeIndex) + _T("\"/></a:solidFill>");
m_oWriter.WriteString(str);
}
else
{
CString strAlpha; strAlpha.Format(_T("%d"), (int)(pPen->Alpha * 100000 / 255));
m_oWriter.WriteString(std::wstring(L"<a:round/><a:headEnd/><a:tailEnd/></a:ln>"));
CString str = _T("<a:solidFill><a:schemeClr val=\"") + CStylesWriter::GetColorInScheme(pPen->Color.m_lSchemeIndex) + _T("\"><a:alpha val=\"") + strAlpha + _T("\"/></a:schemeClr></a:solidFill>");
m_oWriter.WriteString(str);
}
}
m_oWriter.WriteString(std::wstring(L"<a:round/><a:headEnd/><a:tailEnd/></a:ln>"));
m_oWriter.WriteString(std::wstring(L"</p:spPr>"));
......
......@@ -7,7 +7,7 @@
namespace NSPresentationEditor
{
AVSINLINE CString GetPhType(const LONG& lType)
AVSINLINE std::wstring GetPhType(const LONG& lType)
{
switch (lType)
{
......@@ -385,7 +385,8 @@ namespace NSPresentationEditor
m_oWriter.WriteString(std::wstring(L"<p:nvSpPr>"));
CString strShapeID = _T("");
strShapeID.Format(L"%d", m_lNextShapeID);
strShapeID.Format(L"%d", m_pShapeElement->m_lID);
m_oWriter.WriteString(std::wstring(L"<p:cNvPr id=\"") + string2std_string(strShapeID) + L"\"");
......@@ -406,16 +407,18 @@ namespace NSPresentationEditor
if (-1 == m_pShapeElement->m_lPlaceholderID)
{
CString strPlaceholder = _T("<p:nvPr><p:ph type=\"") + GetPhType(m_pShapeElement->m_lPlaceholderType) +_T("\"/></p:nvPr>");
m_oWriter.WriteString(strPlaceholder);
m_oWriter.WriteString(std::wstring(L"<p:nvPr><p:ph type=\"") + GetPhType(m_pShapeElement->m_lPlaceholderType) +_T("\"/></p:nvPr>"));
}
else
{
CString strIdx; strIdx.Format(_T("%d"), m_pShapeElement->m_lPlaceholderID);
CString strPlaceholder = _T("<p:nvPr><p:ph type=\"") + GetPhType(m_pShapeElement->m_lPlaceholderType) + _T("\" idx=\"") + strIdx + _T("\"/></p:nvPr>");
m_oWriter.WriteString(strPlaceholder);
m_oWriter.WriteString(std::wstring(L"<p:nvPr><p:ph type=\"") + GetPhType(m_pShapeElement->m_lPlaceholderType) + _T("\" idx=\"") + string2std_string(strIdx) + _T("\""));
if (5 == m_pShapeElement->m_lPlaceholderType)
m_oWriter.WriteString(std::wstring(L" size=\"half\""));
if (12 == m_pShapeElement->m_lPlaceholderType)
m_oWriter.WriteString(std::wstring(L" size=\"quarter\""));
m_oWriter.WriteString(std::wstring(L"/></p:nvPr>"));
}
}
else
......@@ -453,16 +456,13 @@ namespace NSPresentationEditor
if (-1 == m_pImageElement->m_lPlaceholderID)
{
CString strPlaceholder = _T("<p:nvPr><p:ph type=\"") + GetPhType(m_pImageElement->m_lPlaceholderType) +_T("\"/></p:nvPr>");
m_oWriter.WriteString(strPlaceholder);
m_oWriter.WriteString(std::wstring(L"<p:nvPr><p:ph type=\"") + GetPhType(m_pImageElement->m_lPlaceholderType) +_T("\"/></p:nvPr>"));
}
else
{
CString strIdx; strIdx.Format(_T("%d"), m_pImageElement->m_lPlaceholderID);
CString strPlaceholder = _T("<p:nvPr><p:ph type=\"") + GetPhType(m_pImageElement->m_lPlaceholderType) + _T("\" idx=\"") + strIdx + _T("\"/></p:nvPr>");
m_oWriter.WriteString(std::wstring(L"<p:nvPr><p:ph type=\"") + GetPhType(m_pImageElement->m_lPlaceholderType) + _T("\" idx=\"") + string2std_string(strIdx) + _T("\"/></p:nvPr>"));
m_oWriter.WriteString(strPlaceholder);
}
}
else
......@@ -491,8 +491,12 @@ namespace NSPresentationEditor
m_oWriter.WriteString(std::wstring(L"<a:bodyPr lIns=\"0\" tIns=\"0\" rIns=\"0\" bIns=\"0\""));
if (m_pShapeElement->m_oShape.m_oText.m_oAttributes.m_nTextAlignVertical == 0 ) m_oWriter.WriteString(" anchor=\"t\"");
if (m_pShapeElement->m_oShape.m_oText.m_oAttributes.m_nTextAlignVertical == 2 ) m_oWriter.WriteString(" anchor=\"b\"");
if (m_pShapeElement->m_oShape.m_oText.m_oAttributes.m_nTextAlignVertical == 0 )
m_oWriter.WriteString(" anchor=\"t\"");
else if (m_pShapeElement->m_oShape.m_oText.m_oAttributes.m_nTextAlignVertical == 2 )
m_oWriter.WriteString(" anchor=\"b\"");
else if (m_pShapeElement->m_oShape.m_oText.m_oAttributes.m_nTextAlignVertical == 1 )
m_oWriter.WriteString(" anchor=\"ctr\"");
m_oWriter.WriteString(std::wstring(L"/>"));
CString str3 = _T("<a:lstStyle>");
......@@ -615,6 +619,15 @@ namespace NSPresentationEditor
m_oWriter.WriteString(std::wstring(L"</a:pPr>"));
std::wstring typeRun = L"a:r";
//if (m_pShapeElement->m_lPlaceholderType == 12)
//{
// m_oWriter.WriteString(std::wstring(L"<a:fld id=\"{D038279B-FC19-497E-A7D1-5ADD9CAF016F}\" type=\"slidenum\">"));
// m_oWriter.WriteString(std::wstring(L"<a:rPr/><a:t>#</a:t></a:fld>"));
//}
//else
size_t nCountSpans = pParagraph->m_arSpans.size();
for (size_t nSpan = 0; nSpan < nCountSpans; ++nSpan)
{
......@@ -637,6 +650,8 @@ namespace NSPresentationEditor
}
}
if (pParagraph->m_arSpans[nSpan].m_strText.IsEmpty()) continue;
NSPresentationEditor::CTextCFRun* pCF = &pParagraph->m_arSpans[nSpan].m_oRun;
bool bIsBr = false;
......@@ -653,8 +668,14 @@ namespace NSPresentationEditor
}
else
{
CString strRun1 = _T("<a:r><a:rPr");
m_oWriter.WriteString(strRun1);
if (m_pShapeElement->m_lPlaceholderType == 12)//todooo + date
{
m_oWriter.WriteString(std::wstring(L"<a:fld id=\"{D038279B-FC19-497E-A7D1-5ADD9CAF016F}\" type=\"slidenum\"><a:rPr"));
}
else
{
m_oWriter.WriteString(std::wstring(L"<a:r><a:rPr"));
}
}
if (pCF->Size.is_init())
......@@ -728,7 +749,11 @@ namespace NSPresentationEditor
CString strT2 = _T("</a:t>");
m_oWriter.WriteString(strT2);
m_oWriter.WriteString(std::wstring(L"</a:r>"));
if (m_pShapeElement->m_lPlaceholderType == 12)
m_oWriter.WriteString(std::wstring(L"</a:fld>"));
else
m_oWriter.WriteString(std::wstring(L"</a:r>"));
}
else
{
......
......@@ -270,7 +270,11 @@ public:
}
}
if (pCF->Typeface.is_init())
if ((pCF->FontProperties.is_init()) && (!pCF->FontProperties->strFontName.empty()))
{
oWriter.WriteString(std::wstring(L"<a:latin typeface=\"") + pCF->FontProperties->strFontName + _T("\"/>"));
}
else if (pCF->Typeface.is_init())
{
if (0 == pCF->Typeface.get())
{
......@@ -283,10 +287,7 @@ public:
oWriter.WriteString(strProp);
}
}
else if (pCF->FontProperties.is_init())
{
oWriter.WriteString(std::wstring(L"<a:latin typeface=\"") + pCF->FontProperties->strFontName + _T("\"/>"));
}
CString strCF2 = _T("</a:defRPr>");
oWriter.WriteString(strCF2);
......
......@@ -65,7 +65,7 @@
Name="VCLibrarianTool"
AdditionalDependencies="urlmon.lib"
AdditionalLibraryDirectories=""
IgnoreAllDefaultLibraries="false"
IgnoreAllDefaultLibraries="true"
/>
<Tool
Name="VCALinkTool"
......
......@@ -65,6 +65,7 @@ const long c_BrushTypeTexture = 3008;
const long c_BrushTypePattern = 3009;
const long c_BrushTypeHatch1 = 4009;
const long c_BrushTypeHatch53 = 4061;
const long c_BrushTypeNoFill = 5000;
const long c_BrushTextureModeStretch = 0;
const long c_BrushTextureModeTile = 1;
......
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