mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
PPTFormat автоподстановки + правка багов
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@65724 954022d7-b5bf-4e40-9824-e11837661b57
This commit is contained in:
committed by
Alexander Trofimov
parent
64b48af5cb
commit
47bb783e36
@ -560,7 +560,10 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------
|
||||
std::vector<std::wstring> users_placeholders[3];
|
||||
bool bHasDate = false;
|
||||
bool bHasSlideNumber = false;
|
||||
bool bHasFooter = false;
|
||||
int nFormatDate = 1;
|
||||
|
||||
std::vector<CRecordHeadersFootersContainer*> oArrayHeadersFootersInfo;
|
||||
pRecordSlide->GetRecordsByType(&oArrayHeadersFootersInfo, true, false);
|
||||
@ -569,24 +572,24 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
{
|
||||
if (oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom)
|
||||
{
|
||||
pSlide->m_bHasDate = oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasDate ||
|
||||
oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasTodayDate ||
|
||||
oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasUserDate;
|
||||
pSlide->m_bHasFooter = oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasFooter;
|
||||
pSlide->m_bHasSlideNumber = oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasSlideNumber;
|
||||
bHasDate = oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasDate ||
|
||||
oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasTodayDate ||
|
||||
oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasUserDate;
|
||||
bHasFooter = oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasFooter;
|
||||
bHasSlideNumber = oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasSlideNumber;
|
||||
|
||||
if (oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasUserDate) pSlide->m_nFormatDate = 2;
|
||||
if (oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasUserDate) nFormatDate = 2;
|
||||
}
|
||||
for (int i = 0 ; i < 3; i++) users_placeholders[i] = oArrayHeadersFootersInfo[0]->m_HeadersFootersString[i];
|
||||
for (int i = 0 ; i < 3; i++) pSlide->m_PlaceholdersReplaceString[i] = oArrayHeadersFootersInfo[0]->m_HeadersFootersString[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
pSlide->m_bHasDate = pLayout->m_bHasDate;
|
||||
pSlide->m_bHasFooter = pLayout->m_bHasFooter;
|
||||
pSlide->m_bHasSlideNumber = pLayout->m_bHasSlideNumber;
|
||||
pSlide->m_nFormatDate = m_nFormatDate;
|
||||
bHasDate = pLayout->m_bHasDate;
|
||||
bHasFooter = pLayout->m_bHasFooter;
|
||||
bHasSlideNumber = pLayout->m_bHasSlideNumber;
|
||||
nFormatDate = pLayout->m_nFormatDate;
|
||||
|
||||
for (int i = 0 ; i < 3; i++) users_placeholders[i] = m_PlaceholdersReplaceString[i];
|
||||
for (int i = 0 ; i < 3; i++) pSlide->m_PlaceholdersReplaceString[i] = pLayout->m_PlaceholdersReplaceString[i];
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
std::vector<CRecordCString*> oArrayStrings;
|
||||
@ -609,16 +612,16 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
|
||||
for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
{
|
||||
IElement* pElem = NULL;
|
||||
IElement* pElement = NULL;
|
||||
|
||||
oArrayShapes[nShape]->GetElement(&pElem, &m_oExMedia, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight,
|
||||
oArrayShapes[nShape]->GetElement(&pElement, &m_oExMedia, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight,
|
||||
pTheme, pLayout, pThemeWrapper, pSlideWrapper, pSlide);
|
||||
|
||||
if (NULL != pElem)
|
||||
if (NULL != pElement)
|
||||
{
|
||||
if (pElem->m_bIsBackground && !pElem->m_bHaveAnchor && !bMasterBackGround)
|
||||
if (pElement->m_bIsBackground && !pElement->m_bHaveAnchor && !bMasterBackGround)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
if (NULL != pShape)
|
||||
{
|
||||
pShape->SetupProperties(pSlide, pTheme, pLayout);
|
||||
@ -626,75 +629,39 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
pSlide->m_bIsBackground = true;
|
||||
pSlide->m_oBackground = pShape->m_oBrush;
|
||||
}
|
||||
RELEASEOBJECT(pElem);
|
||||
RELEASEOBJECT(pElement);
|
||||
continue;
|
||||
|
||||
}else
|
||||
AddAnimation ( dwSlideID, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight, pElem );
|
||||
AddAnimation ( dwSlideID, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight, pElement );
|
||||
|
||||
if (pElem->m_bHaveAnchor)
|
||||
if (pElement->m_bHaveAnchor)
|
||||
{
|
||||
pSlide->m_arElements.push_back(pElem);
|
||||
}
|
||||
if (pElem->m_lPlaceholderType >= 0 )
|
||||
{
|
||||
pSlide->m_mapPlaceholders.insert(std::pair<int,int>(pElem->m_lPlaceholderType, pSlide->m_arElements.size() - 1) );
|
||||
pSlide->m_arElements.push_back(pElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//todooo ... <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ID a-la <20><><EFBFBD> <20> AddLayout
|
||||
|
||||
AddLayoutSlidePlaceholder(pSlide, MasterSlideNumber , pLayout);
|
||||
AddLayoutSlidePlaceholder(pSlide, MasterDate , pLayout);
|
||||
|
||||
//------------- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//-------------<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
std::multimap<int, int>::iterator it;
|
||||
IElement* pElement = NULL;
|
||||
|
||||
if (pSlide->m_bHasSlideNumber)
|
||||
{
|
||||
AddLayoutSlidePlaceholder(pSlide, MasterSlideNumber, pLayout, true);
|
||||
}
|
||||
if (bHasSlideNumber) AddLayoutSlidePlaceholder(pSlide, MasterSlideNumber, pLayout, true);
|
||||
|
||||
if (pSlide->m_bHasDate)
|
||||
if (bHasDate)
|
||||
{
|
||||
IElement *pElement = AddLayoutSlidePlaceholder(pSlide, MasterDate, pLayout, true);
|
||||
|
||||
if (pElement)
|
||||
{
|
||||
pElement->m_nFormatDate = pSlide->m_nFormatDate;
|
||||
|
||||
if ( pElement->m_lPlaceholderUserStr >= 0)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
if (NULL != pShape)
|
||||
{
|
||||
if (pElement->m_lPlaceholderUserStr < users_placeholders[0].size())
|
||||
{
|
||||
pShape->SetUpTextPlaceholder(users_placeholders[0][pElement->m_lPlaceholderUserStr]);
|
||||
}
|
||||
else pShape->SetUpTextPlaceholder(L"");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pElement) pElement->m_nFormatDate = nFormatDate;
|
||||
}
|
||||
|
||||
if (pSlide->m_bHasFooter)
|
||||
{
|
||||
IElement *pElement = AddLayoutSlidePlaceholder(pSlide, MasterFooter, pLayout, true);
|
||||
|
||||
if ((pElement) && (pElement->m_lPlaceholderUserStr >= 0))
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
if (NULL != pShape)
|
||||
{
|
||||
if (pElement->m_lPlaceholderUserStr < users_placeholders[2].size())
|
||||
{
|
||||
pShape->SetUpTextPlaceholder(users_placeholders[2][pElement->m_lPlaceholderUserStr]);
|
||||
}
|
||||
else pShape->SetUpTextPlaceholder(L"");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bHasFooter) AddLayoutSlidePlaceholder(pSlide, MasterFooter, pLayout, true);
|
||||
}
|
||||
|
||||
IElement* CPPTUserInfo::AddLayoutSlidePlaceholder (CSlide *pSlide, int placeholderType, CLayout *pLayout, bool idx_only)
|
||||
@ -703,6 +670,7 @@ IElement* CPPTUserInfo::AddLayoutSlidePlaceholder (CSlide *pSlide, int placehold
|
||||
|
||||
for (std::multimap<int, int>::iterator it = pLayout->m_mapPlaceholders.begin(); it != pLayout->m_mapPlaceholders.end(); it++)
|
||||
{
|
||||
pElement = NULL;
|
||||
if (it->first == placeholderType )
|
||||
{
|
||||
if (idx_only == false)
|
||||
@ -740,15 +708,19 @@ IElement* CPPTUserInfo::AddLayoutSlidePlaceholder (CSlide *pSlide, int placehold
|
||||
return pElement;
|
||||
}
|
||||
|
||||
IElement* CPPTUserInfo::AddThemeLayoutPlaceholder (CLayout *pLayout, int placeholderType, CTheme* pTheme)
|
||||
IElement* CPPTUserInfo::AddThemeLayoutPlaceholder (CLayout *pLayout, int placeholderType, CTheme* pTheme, bool idx_only)
|
||||
{
|
||||
IElement* pElement = NULL;
|
||||
|
||||
for (std::multimap<int, int>::iterator it = pTheme->m_mapPlaceholders.begin(); it != pTheme->m_mapPlaceholders.end(); it++)
|
||||
{
|
||||
if (it->first == placeholderType )
|
||||
{
|
||||
{
|
||||
if (idx_only && pTheme->m_arElements[it->second]->m_lPlaceholderID < 0) continue;
|
||||
|
||||
pElement = pTheme->m_arElements[it->second]->CreateDublicate();
|
||||
|
||||
pElement->m_bPlaceholderSet = true;
|
||||
|
||||
pLayout->m_arElements.push_back(dynamic_cast<IElement*>(pElement));
|
||||
pLayout->m_mapPlaceholders.insert(std::pair<int, int>(placeholderType, pLayout->m_arElements.size()-1));
|
||||
@ -869,17 +841,45 @@ int CPPTUserInfo::AddNewLayout(CTheme* pTheme, CRecordSlide* pRecordSlide, bool
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//if (layoutRecord.m_nGeom==0x0F) return ind; // big object only !!!
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> idx <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
for (std::multimap<int, int>::iterator it = pTheme->m_mapPlaceholders.begin(); it != pTheme->m_mapPlaceholders.end(); it++)
|
||||
{
|
||||
IElement *pElemTheme = pTheme->m_arElements[it->second]->CreateDublicate();
|
||||
|
||||
if (pElemTheme->m_lPlaceholderID >= 0) continue;
|
||||
|
||||
bool found = false;
|
||||
for (std::multimap<int, int>::iterator it1 = pLayout->m_mapPlaceholders.begin(); it1 != pLayout->m_mapPlaceholders.end(); it1++)
|
||||
{
|
||||
if (it1->first == it->first)
|
||||
{
|
||||
IElement* pElemLayout = pLayout->m_arElements[it1->second];
|
||||
if (pElemLayout->m_lPlaceholderID == pElemTheme->m_lPlaceholderID)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (found == false)
|
||||
{
|
||||
pLayout->m_arElements.push_back(dynamic_cast<IElement*>(pElemTheme));
|
||||
pLayout->m_mapPlaceholders.insert(std::pair<int, int>(it->first, pLayout->m_arElements.size()-1));
|
||||
}
|
||||
}
|
||||
|
||||
pLayout->m_bHasDate = pTheme->m_bHasDate;
|
||||
pLayout->m_bHasFooter = pTheme->m_bHasFooter;
|
||||
pLayout->m_bHasSlideNumber = pTheme->m_bHasSlideNumber;
|
||||
pLayout->m_nFormatDate = pTheme->m_nFormatDate;
|
||||
|
||||
AddThemeLayoutPlaceholder(pLayout, MasterSlideNumber, pTheme);
|
||||
AddThemeLayoutPlaceholder(pLayout, MasterDate, pTheme);
|
||||
AddThemeLayoutPlaceholder(pLayout, MasterFooter, pTheme);
|
||||
for (int i = 0; i < 3; i++) pLayout->m_PlaceholdersReplaceString[i] = pTheme->m_PlaceholdersReplaceString[i];
|
||||
|
||||
if (pLayout->m_bHasSlideNumber) AddThemeLayoutPlaceholder(pLayout, MasterSlideNumber, pTheme, true);
|
||||
if (pLayout->m_bHasDate) AddThemeLayoutPlaceholder(pLayout, MasterDate, pTheme, true);
|
||||
if (pLayout->m_bHasFooter) AddThemeLayoutPlaceholder(pLayout, MasterFooter, pTheme, true);
|
||||
|
||||
return ind;
|
||||
}
|
||||
@ -989,6 +989,14 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
}
|
||||
for(int i = 0 ; i< 3; i++) pTheme->m_PlaceholdersReplaceString[i] = oArrayHeadersFootersInfo[0]->m_HeadersFootersString[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
pTheme->m_bHasDate = m_bHasDate;
|
||||
pTheme->m_bHasFooter = m_bHasFooter;
|
||||
pTheme->m_bHasSlideNumber = m_bHasSlideNumber;
|
||||
pTheme->m_nFormatDate = m_nFormatDate;
|
||||
for (int i = 0 ; i < 3; i++) pTheme->m_PlaceholdersReplaceString[i] = m_PlaceholdersReplaceString[i];
|
||||
}
|
||||
std::vector<CRecordCString*> oArrayStrings;
|
||||
pMaster->GetRecordsByType(&oArrayStrings, false, false);
|
||||
for (int i=0; i < oArrayStrings.size(); i++)
|
||||
@ -1106,16 +1114,16 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
|
||||
for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
{
|
||||
NSPresentationEditor::IElement* pElem = NULL;
|
||||
oArrayShapes[nShape]->GetElement(&pElem, &m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pMasterWrapper, pMasterWrapper);
|
||||
NSPresentationEditor::IElement* pElement = NULL;
|
||||
oArrayShapes[nShape]->GetElement(&pElement, &m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pMasterWrapper, pMasterWrapper);
|
||||
|
||||
if (NULL != pElem)
|
||||
if (NULL != pElement)
|
||||
{
|
||||
AddAnimation ( dwMasterID, lOriginWidth, lOriginHeight, pElem );
|
||||
AddAnimation ( dwMasterID, lOriginWidth, lOriginHeight, pElement );
|
||||
|
||||
if (pElem->m_bIsBackground && !pElem->m_bHaveAnchor)
|
||||
if (pElement->m_bIsBackground && !pElement->m_bHaveAnchor)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
if (NULL != pShape)
|
||||
{
|
||||
pShape->SetupProperties(NULL, pTheme, pLayout);
|
||||
@ -1124,48 +1132,42 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
pTheme->m_oBackground = pShape->m_oBrush;
|
||||
}
|
||||
|
||||
RELEASEINTERFACE(pElem);
|
||||
RELEASEINTERFACE(pElement);
|
||||
continue;
|
||||
}
|
||||
pTheme->m_arElements.push_back(pElem);
|
||||
pTheme->m_arElements.push_back(pElement);
|
||||
|
||||
if ( pElem->m_lPlaceholderType >0)
|
||||
if ( pElement->m_lPlaceholderType >0)
|
||||
{
|
||||
if (pElem->m_lPlaceholderID >=0)
|
||||
{
|
||||
if (pElem->m_lPlaceholderType == MasterSlideNumber) pTheme->m_bHasSlideNumber = true;
|
||||
if (pElem->m_lPlaceholderType == MasterDate) pTheme->m_bHasDate = true;
|
||||
if (pElem->m_lPlaceholderType == MasterFooter) pTheme->m_bHasFooter = true;
|
||||
}
|
||||
pTheme->m_mapPlaceholders.insert(std::pair<int, int>(pElem->m_lPlaceholderType, pTheme->m_arElements.size()-1));
|
||||
pTheme->m_mapPlaceholders.insert(std::pair<int, int>(pElement->m_lPlaceholderType, pTheme->m_arElements.size()-1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pTheme->m_bHasSlideNumber)
|
||||
{
|
||||
IElement *pElem = NULL;
|
||||
IElement *pElement = NULL;
|
||||
if (pTheme->m_mapPlaceholders.find(MasterSlideNumber) == pTheme->m_mapPlaceholders.end())
|
||||
{
|
||||
pElem = AddNewThemePlaceholder(pTheme, MasterSlideNumber, 2);
|
||||
pElement = AddNewThemePlaceholder(pTheme, MasterSlideNumber, 2);
|
||||
}
|
||||
}
|
||||
if (pTheme->m_bHasDate)
|
||||
{
|
||||
IElement *pElem = NULL;
|
||||
IElement *pElement = NULL;
|
||||
if (pTheme->m_mapPlaceholders.find(MasterDate) == pTheme->m_mapPlaceholders.end() && pTheme->m_nFormatDate == 1)
|
||||
{
|
||||
pElem = AddNewThemePlaceholder(pTheme, MasterDate, 2);
|
||||
pElement = AddNewThemePlaceholder(pTheme, MasterDate, 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (pTheme->m_bHasFooter)
|
||||
{
|
||||
IElement *pElem = NULL;
|
||||
IElement *pElement = NULL;
|
||||
if (pTheme->m_mapPlaceholders.find(MasterFooter) == pTheme->m_mapPlaceholders.end())
|
||||
{
|
||||
pElem = AddNewThemePlaceholder(pTheme, MasterFooter, 1);
|
||||
pElement = AddNewThemePlaceholder(pTheme, MasterFooter, 1);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1321,8 +1323,18 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
pLayout->m_bHasSlideNumber = oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasSlideNumber;
|
||||
|
||||
if (oArrayHeadersFootersInfo[0]->m_oHeadersFootersAtom->m_bHasUserDate) pLayout->m_nFormatDate = 2;
|
||||
|
||||
for (int i = 0 ; i < 3; i++) pLayout->m_PlaceholdersReplaceString[i] = oArrayHeadersFootersInfo[0]->m_HeadersFootersString[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{//????
|
||||
pLayout->m_bHasDate = m_bHasDate;
|
||||
pLayout->m_bHasFooter = m_bHasFooter;
|
||||
pLayout->m_bHasSlideNumber = m_bHasSlideNumber;
|
||||
pLayout->m_nFormatDate = m_nFormatDate;
|
||||
for (int i = 0 ; i < 3; i++) pLayout->m_PlaceholdersReplaceString[i] = m_PlaceholdersReplaceString[i];
|
||||
}
|
||||
|
||||
std::vector<CRecordCString*> oArrayStrings;
|
||||
pCurMaster->GetRecordsByType(&oArrayStrings, false, false);
|
||||
@ -1340,16 +1352,16 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
|
||||
for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
{
|
||||
IElement* pElem = NULL;
|
||||
oArrayShapes[nShape]->GetElement(&pElem, &m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pThemeWrapper, pMasterWrapper);
|
||||
IElement* pElement = NULL;
|
||||
oArrayShapes[nShape]->GetElement(&pElement, &m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pThemeWrapper, pMasterWrapper);
|
||||
|
||||
if (NULL != pElem)
|
||||
if (NULL != pElement)
|
||||
{
|
||||
AddAnimation ( dwMasterID, lOriginWidth, lOriginHeight, pElem );
|
||||
AddAnimation ( dwMasterID, lOriginWidth, lOriginHeight, pElement );
|
||||
|
||||
if (pElem->m_bIsBackground && !pElem->m_bHaveAnchor)
|
||||
if (pElement->m_bIsBackground && !pElement->m_bHaveAnchor)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
|
||||
if (NULL != pShape)
|
||||
{
|
||||
@ -1358,22 +1370,22 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
pLayout->m_bIsBackground = true;
|
||||
pLayout->m_oBackground = pShape->m_oBrush;
|
||||
}
|
||||
RELEASEINTERFACE(pElem);
|
||||
RELEASEINTERFACE(pElement);
|
||||
continue;
|
||||
}
|
||||
|
||||
pElem->m_bPlaceholderSet = true;
|
||||
pLayout->m_arElements.push_back(pElem);
|
||||
pElement->m_bPlaceholderSet = true;
|
||||
pLayout->m_arElements.push_back(pElement);
|
||||
|
||||
if ( pElem->m_lPlaceholderType >0)
|
||||
if ( pElement->m_lPlaceholderType >0)
|
||||
{
|
||||
if (pElem->m_lPlaceholderID >=0)
|
||||
if (pElement->m_lPlaceholderID >=0)
|
||||
{
|
||||
if (pElem->m_lPlaceholderType == MasterSlideNumber) pLayout->m_bHasSlideNumber = true;
|
||||
if (pElem->m_lPlaceholderType == MasterDate) pLayout->m_bHasDate = true;
|
||||
if (pElem->m_lPlaceholderType == MasterFooter) pLayout->m_bHasFooter = true;
|
||||
if (pElement->m_lPlaceholderType == MasterSlideNumber) pLayout->m_bHasSlideNumber = true;
|
||||
if (pElement->m_lPlaceholderType == MasterDate) pLayout->m_bHasDate = true;
|
||||
if (pElement->m_lPlaceholderType == MasterFooter) pLayout->m_bHasFooter = true;
|
||||
}
|
||||
pLayout->m_mapPlaceholders.insert(std::pair<int, int>(pElem->m_lPlaceholderType, pLayout->m_arElements.size()-1));
|
||||
pLayout->m_mapPlaceholders.insert(std::pair<int, int>(pElement->m_lPlaceholderType, pLayout->m_arElements.size()-1));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ public:
|
||||
std::vector<CFont> m_arrFonts;
|
||||
NSPresentationEditor::CTextStyles m_oDefaultTextStyle;
|
||||
|
||||
std::vector<std::wstring> m_PlaceholdersReplaceString[3]; //0-dates, 1 - headers, 2 - footers
|
||||
vector_string m_PlaceholdersReplaceString[3]; //0-dates, 1 - headers, 2 - footers
|
||||
|
||||
bool m_bHasDate;
|
||||
bool m_bHasSlideNumber;
|
||||
@ -265,6 +265,6 @@ public:
|
||||
|
||||
IElement* AddNewThemePlaceholder (CTheme* pTheme, int placeholderType, int placeholderSizePreset = -1);
|
||||
|
||||
IElement* AddThemeLayoutPlaceholder (CLayout *pLayout, int placeholderType, CTheme* pTheme);
|
||||
IElement* AddThemeLayoutPlaceholder (CLayout *pLayout, int placeholderType, CTheme* pTheme, bool idx_only = false);
|
||||
IElement* AddLayoutSlidePlaceholder (CSlide *pSlide, int placeholderType, CLayout *pLayout, bool idx_only = false);
|
||||
};
|
||||
|
||||
@ -154,8 +154,7 @@ class CRecordSlideNumberMetaAtom : public CRecordMetaCharacterAtom
|
||||
class CRecordHeadersFootersContainer : public CRecordsContainer
|
||||
{
|
||||
public:
|
||||
std::vector<std::wstring> m_HeadersFootersString[3]; //0-dates, 1 - headers, 2 - footers
|
||||
|
||||
vector_string m_HeadersFootersString[3]; //0-dates, 1 - headers, 2 - footers
|
||||
|
||||
CRecordHeadersFootersAtom *m_oHeadersFootersAtom;
|
||||
|
||||
|
||||
@ -82,80 +82,7 @@ namespace NSPresentationEditor
|
||||
|
||||
public:
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> layouts
|
||||
void CalculateLayouts()
|
||||
{
|
||||
size_t nCountThemes = m_arThemes.size();
|
||||
for (size_t i = 0; i < nCountThemes; ++i)
|
||||
{
|
||||
CTheme* pTheme = &m_arThemes[i];
|
||||
size_t nCountLayouts = pTheme->m_arLayouts.size();
|
||||
|
||||
for (size_t j = 0; j < nCountLayouts; ++j)
|
||||
{
|
||||
CLayout* pLayout = &pTheme->m_arLayouts[j];
|
||||
|
||||
size_t nCountElements = pLayout->m_arElements.size();
|
||||
for (size_t nElem = 0; nElem < nCountElements; ++nElem)
|
||||
{
|
||||
if (pLayout->m_bUseThemeColorScheme)
|
||||
{
|
||||
pLayout->m_arElements[nElem]->SetupProperties(NULL, &m_arThemes[i], NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
//pLayout->m_arElements[nElem]->SetupProperties(NULL, &m_arThemes[i], NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void Calculate()
|
||||
{
|
||||
CalculateLayouts();
|
||||
|
||||
size_t nCount = m_arSlides.size();
|
||||
for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
|
||||
{
|
||||
int lThemeID = m_arSlides[nIndex]->m_lThemeID;
|
||||
|
||||
if ((0 > lThemeID) || (lThemeID >= (LONG)m_arThemes.size()))
|
||||
{
|
||||
m_arSlides[nIndex]->Calculate(NULL);
|
||||
continue;
|
||||
}
|
||||
|
||||
m_arSlides[nIndex]->Calculate(&m_arThemes[lThemeID]);
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
size_t nCountThemes = m_arThemes.size();
|
||||
for (size_t i = 0; i < nCountThemes; ++i)
|
||||
{
|
||||
CTheme* pTheme = &m_arThemes[i];
|
||||
|
||||
size_t nCountEl = pTheme->m_arElements.size();
|
||||
for (size_t j = 0; j < nCountEl; ++j)
|
||||
{
|
||||
pTheme->m_arElements[j]->m_pTheme = pTheme;
|
||||
}
|
||||
|
||||
size_t nCountLayouts = pTheme->m_arLayouts.size();
|
||||
for (size_t j = 0; j < nCountLayouts; ++j)
|
||||
{
|
||||
CLayout* pLayout = &pTheme->m_arLayouts[j];
|
||||
|
||||
nCountEl = pLayout->m_arElements.size();
|
||||
for (size_t k = 0; k < nCountEl; ++k)
|
||||
{
|
||||
pLayout->m_arElements[k]->m_pTheme = pTheme;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CString GetXmlSlideTransition ( CSlide& oSlide/*, CAudioOverlay& oAudioOverlay*/ )
|
||||
{
|
||||
CString Source = CString ( _T("") );
|
||||
@ -529,9 +456,35 @@ namespace NSPresentationEditor
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
void ResetAutoText(IElement *pElement, vector_string const (&placeholdersReplaceString)[3])
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
|
||||
if (NULL == pShape) return;
|
||||
|
||||
if (pElement->m_lPlaceholderType == NSOfficePPT::MasterSlideNumber) pShape->SetUpTextPlaceholder(L"<#>");
|
||||
|
||||
int ind = -1;
|
||||
if (pElement->m_lPlaceholderType == NSOfficePPT::MasterDate) ind = 0;
|
||||
if (pElement->m_lPlaceholderType == NSOfficePPT::MasterFooter) ind = 2;
|
||||
|
||||
if (pElement->m_lPlaceholderUserStr >= 0 && ind >= 0)
|
||||
{
|
||||
if (pElement->m_lPlaceholderUserStr < placeholdersReplaceString[ind].size())
|
||||
pShape->SetUpTextPlaceholder( placeholdersReplaceString[ind][pElement->m_lPlaceholderUserStr] );
|
||||
else pShape->SetUpTextPlaceholder(L"");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pElement->m_lPlaceholderType == NSOfficePPT::MasterDate)
|
||||
pShape->SetUpTextPlaceholder(L"*"); //<2F><><EFBFBD><EFBFBD>
|
||||
}
|
||||
}
|
||||
|
||||
void CalculateEditor(const NSPresentationEditor::CMetricInfo& oInfo, bool bIsPlaceholderSetUp = false)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
m_oInfo = oInfo;
|
||||
|
||||
double dScaleX = (double)m_oInfo.m_lMillimetresHor / m_oInfo.m_lUnitsHor;
|
||||
@ -548,6 +501,10 @@ namespace NSPresentationEditor
|
||||
{
|
||||
IElement* pElement = pTheme->m_arElements[nIndexEl];
|
||||
|
||||
if (pElement->m_lPlaceholderType > 0)
|
||||
{
|
||||
ResetAutoText(pElement, pTheme->m_PlaceholdersReplaceString);
|
||||
}
|
||||
pElement->m_pTheme = pTheme;
|
||||
pElement->m_pLayout = NULL;
|
||||
|
||||
@ -571,6 +528,11 @@ namespace NSPresentationEditor
|
||||
for (size_t nIndexLayoutEl = 0; nIndexLayoutEl < nCountLayoutElements; ++nIndexLayoutEl)
|
||||
{
|
||||
IElement* pElement = pLayout->m_arElements[nIndexLayoutEl];
|
||||
|
||||
if (pElement->m_lPlaceholderType > 0)
|
||||
{
|
||||
ResetAutoText(pElement, pLayout->m_PlaceholdersReplaceString);
|
||||
}
|
||||
|
||||
pElement->m_oMetric = m_oInfo;
|
||||
pElement->NormalizeCoords(dScaleX, dScaleY);
|
||||
@ -651,6 +613,10 @@ namespace NSPresentationEditor
|
||||
{
|
||||
IElement* pElement = pSlide->m_arElements[nIndexEl];
|
||||
|
||||
if (pElement->m_lPlaceholderType > 0)
|
||||
{
|
||||
ResetAutoText(pElement, pSlide->m_PlaceholdersReplaceString);
|
||||
}
|
||||
pElement->m_pTheme = pTheme;
|
||||
pElement->m_pLayout = pLayout;
|
||||
|
||||
@ -663,7 +629,5 @@ namespace NSPresentationEditor
|
||||
pSlide->SetUpPlaceholderStyles(pLayout);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@ -267,8 +267,9 @@ namespace NSPresentationEditor
|
||||
pDublicate->m_lPlaceholderID = m_lPlaceholderID;
|
||||
pDublicate->m_lPlaceholderType = m_lPlaceholderType;
|
||||
pDublicate->m_bPlaceholderSet = m_bPlaceholderSet;
|
||||
|
||||
pDublicate->m_lPlaceholderSizePreset = m_lPlaceholderSizePreset;
|
||||
pDublicate->m_lPlaceholderUserStr = m_lPlaceholderUserStr;
|
||||
pDublicate->m_lPlaceholderUserStr = m_lPlaceholderUserStr;
|
||||
pDublicate->m_nFormatDate = m_nFormatDate;
|
||||
|
||||
pDublicate->m_oMetric = m_oMetric;
|
||||
|
||||
@ -94,15 +94,28 @@ bool NSPresentationEditor::CShapeElement::SetUpTextPlaceholder(std::wstring newT
|
||||
bool result = false;
|
||||
NSPresentationEditor::CTextAttributesEx* pText = &m_oShape.m_oText;
|
||||
|
||||
if (pText->m_arParagraphs.size() > 0)
|
||||
for (int p = 0 ; p < pText->m_arParagraphs.size(); p++) //тут по всем -> 1-(33).ppt
|
||||
{
|
||||
if (pText->m_arParagraphs[0].m_arSpans.size() >0)
|
||||
if (pText->m_arParagraphs[p].m_arSpans.size() >0)//??? по всем?
|
||||
{
|
||||
int pos = pText->m_arParagraphs[0].m_arSpans[0].m_strText.find(L"*");
|
||||
int pos = pText->m_arParagraphs[p].m_arSpans[0].m_strText.find(L"*");
|
||||
|
||||
if (pos >= 0)
|
||||
{
|
||||
ReplaceAll(pText->m_arParagraphs[0].m_arSpans[0].m_strText, L"*", newText);
|
||||
CSpan first = pText->m_arParagraphs[p].m_arSpans[0];
|
||||
CSpan last = pText->m_arParagraphs[p].m_arSpans[0];
|
||||
|
||||
first.m_strText = pText->m_arParagraphs[p].m_arSpans[0].m_strText.substr(0, pos);
|
||||
last.m_strText = pText->m_arParagraphs[p].m_arSpans[0].m_strText.substr(pos + 1);
|
||||
|
||||
pText->m_arParagraphs[p].m_arSpans[0].m_strText = newText;
|
||||
pText->m_arParagraphs[p].m_arSpans[0].m_bField = true;
|
||||
|
||||
if (last.m_strText.empty() == false)
|
||||
pText->m_arParagraphs[p].m_arSpans.insert(pText->m_arParagraphs[p].m_arSpans.begin() + 1, last);
|
||||
if (first.m_strText.empty() == false)
|
||||
pText->m_arParagraphs[p].m_arSpans.insert(pText->m_arParagraphs[p].m_arSpans.begin(), first);
|
||||
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,6 +29,7 @@ namespace NSPresentationEditor
|
||||
bool m_bHasSlideNumber;
|
||||
bool m_bHasFooter;
|
||||
int m_nFormatDate;
|
||||
vector_string m_PlaceholdersReplaceString[3]; //0-dates, 1 - headers, 2 - footers
|
||||
|
||||
bool m_bShowMasterShapes;
|
||||
std::wstring m_strLayoutType;
|
||||
@ -76,6 +77,8 @@ namespace NSPresentationEditor
|
||||
m_bHasFooter = oSrc.m_bHasFooter;
|
||||
m_nFormatDate = oSrc.m_nFormatDate;
|
||||
|
||||
for (int i = 0 ; i < 3 ; i++) m_PlaceholdersReplaceString[i] = oSrc.m_PlaceholdersReplaceString[i];
|
||||
|
||||
m_bShowMasterShapes = oSrc.m_bShowMasterShapes;
|
||||
m_strLayoutType = oSrc.m_strLayoutType;
|
||||
|
||||
@ -109,6 +112,7 @@ namespace NSPresentationEditor
|
||||
m_bHasSlideNumber = false;
|
||||
m_bHasFooter = false;
|
||||
m_nFormatDate = 1;
|
||||
for (int i = 0 ; i < 3 ; i++) m_PlaceholdersReplaceString[i].clear();
|
||||
|
||||
m_bUseThemeColorScheme = true;
|
||||
m_bShowMasterShapes = true;
|
||||
|
||||
@ -35,11 +35,7 @@ namespace NSPresentationEditor
|
||||
|
||||
CMetricInfo m_oInfo;
|
||||
|
||||
bool m_bHasDate;
|
||||
bool m_bHasSlideNumber;
|
||||
bool m_bHasFooter;
|
||||
int m_nFormatDate;
|
||||
|
||||
vector_string m_PlaceholdersReplaceString[3];
|
||||
std::wstring m_strComment;
|
||||
std::wstring m_sName;
|
||||
public:
|
||||
@ -75,15 +71,11 @@ namespace NSPresentationEditor
|
||||
m_dEndTime = 0.0;
|
||||
m_dDuration = 30000.0;
|
||||
|
||||
m_bHasDate = false;
|
||||
m_bHasSlideNumber = false;
|
||||
m_bHasFooter = false;
|
||||
m_nFormatDate = 1;
|
||||
|
||||
m_bShowMasterShapes = true;
|
||||
m_strComment.clear();
|
||||
m_sName.clear();
|
||||
|
||||
for (int i = 0 ; i < 3 ; i++) m_PlaceholdersReplaceString[i].clear();
|
||||
}
|
||||
|
||||
CSlide(const CSlide& oSrc)
|
||||
@ -118,62 +110,13 @@ namespace NSPresentationEditor
|
||||
|
||||
m_bShowMasterShapes = oSrc.m_bShowMasterShapes;
|
||||
|
||||
m_bHasDate = oSrc.m_bHasDate;
|
||||
m_bHasSlideNumber = oSrc.m_bHasSlideNumber;
|
||||
m_bHasFooter = oSrc.m_bHasFooter;
|
||||
m_nFormatDate = oSrc.m_nFormatDate;
|
||||
for (int i = 0 ; i < 3 ; i++) m_PlaceholdersReplaceString[i] = oSrc.m_PlaceholdersReplaceString[i];
|
||||
|
||||
m_strComment = oSrc.m_strComment;
|
||||
m_sName = oSrc.m_sName;
|
||||
}
|
||||
|
||||
public:
|
||||
void Calculate(CTheme* pTheme)
|
||||
{
|
||||
CLayout* pLayout = NULL;
|
||||
|
||||
if (NULL != pTheme)
|
||||
{
|
||||
if ((0 <= m_lLayoutID) && (m_lLayoutID < (LONG)pTheme->m_arLayouts.size()))
|
||||
{
|
||||
pLayout = &pTheme->m_arLayouts[m_lLayoutID];
|
||||
}
|
||||
}
|
||||
|
||||
// <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
size_t nCount = m_arElements.size();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
CalculateElement(i, pTheme, pLayout);
|
||||
m_arElements[i]->m_pTheme = pTheme;
|
||||
}
|
||||
}
|
||||
|
||||
void CalculateElement(size_t nIndexElement, CTheme* pTheme, CLayout* pLayout)
|
||||
{
|
||||
IElement* pElement = m_arElements[nIndexElement];
|
||||
if (NULL == pElement)
|
||||
return;
|
||||
|
||||
LONG lPlaceholderID = pElement->m_lPlaceholderType;
|
||||
if (-1 == lPlaceholderID)
|
||||
{
|
||||
//pElement->SetupProperties(pTheme, pColorScheme);
|
||||
m_arElements[nIndexElement]->SetupProperties(this, pTheme, pLayout);
|
||||
return;
|
||||
}
|
||||
|
||||
IElement* pLayoutElem = pLayout->GetPlaceholder(lPlaceholderID, FALSE);
|
||||
|
||||
if (NULL == pLayoutElem)
|
||||
{
|
||||
m_arElements[nIndexElement]->SetupProperties(this, pTheme, pLayout);
|
||||
return;
|
||||
}
|
||||
|
||||
m_arElements[nIndexElement]->SetupProperties(this, pTheme, pLayout);
|
||||
}
|
||||
|
||||
void SetMetricInfo(const CMetricInfo& oInfo)
|
||||
{
|
||||
m_oInfo = oInfo;
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
#define GETBIT(from, num) ((from & (1 << num)) != 0)
|
||||
#define GETBITS(from, numL, numH) ((from & (((1 << (numH - numL + 1)) - 1) << numL)) >> numL)
|
||||
|
||||
typedef std::vector<std::wstring> vector_string;
|
||||
|
||||
namespace NSPresentationEditor
|
||||
{
|
||||
static void CorrectColorPPT(LONG& lSchemeIndex)
|
||||
|
||||
@ -601,9 +601,9 @@ namespace NSPresentationEditor
|
||||
public:
|
||||
CTextCFRun m_oRun;
|
||||
std::wstring m_strText;
|
||||
bool m_bField;
|
||||
|
||||
public:
|
||||
CSpan() : m_oRun(), m_strText(_T(""))
|
||||
CSpan() : m_oRun(), m_strText(_T("")), m_bField(false)
|
||||
{
|
||||
}
|
||||
CSpan(const CSpan& oSrc)
|
||||
@ -614,6 +614,7 @@ namespace NSPresentationEditor
|
||||
{
|
||||
m_oRun = oSrc.m_oRun;
|
||||
m_strText = oSrc.m_strText;
|
||||
m_bField = oSrc.m_bField;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ namespace NSPresentationEditor
|
||||
|
||||
int m_nFormatDate;//1- current, 2 - user
|
||||
|
||||
std::vector<std::wstring> m_PlaceholdersReplaceString[3]; //0-dates, 1 - headers, 2 - footers
|
||||
vector_string m_PlaceholdersReplaceString[3]; //0-dates, 1 - headers, 2 - footers
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
CTheme() : m_arColorScheme(), m_arFonts(), m_arBrushes(),
|
||||
@ -76,6 +76,8 @@ namespace NSPresentationEditor
|
||||
m_bHasFooter = oSrc.m_bHasFooter;
|
||||
m_nFormatDate = oSrc.m_nFormatDate;
|
||||
|
||||
for (int i = 0 ; i < 3 ; i++) m_PlaceholdersReplaceString[i] = oSrc.m_PlaceholdersReplaceString[i];
|
||||
|
||||
for (int i = 0; i < oSrc.m_arExtraColorScheme.size(); ++i)
|
||||
{
|
||||
m_arExtraColorScheme.push_back(oSrc.m_arExtraColorScheme[i]);
|
||||
@ -153,6 +155,8 @@ namespace NSPresentationEditor
|
||||
m_bHasSlideNumber = false;
|
||||
m_bHasFooter = false;
|
||||
m_nFormatDate = 1;
|
||||
|
||||
for (int i = 0 ; i < 3 ; i++) m_PlaceholdersReplaceString[i].clear();
|
||||
}
|
||||
|
||||
~CTheme()
|
||||
|
||||
@ -947,11 +947,11 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_pShapeElement->m_lPlaceholderType == PT_MasterSlideNumber)
|
||||
if (m_pShapeElement->m_lPlaceholderType == PT_MasterSlideNumber && pParagraph->m_arSpans[nSpan].m_bField)
|
||||
{
|
||||
m_oWriter.WriteString(std::wstring(L"<a:fld id=\"{D038279B-FC19-497E-A7D1-5ADD9CAF016F}\" type=\"slidenum\"><a:rPr"));
|
||||
}
|
||||
else if (m_pShapeElement->m_lPlaceholderType == PT_MasterDate && m_pShapeElement->m_nFormatDate == 1)
|
||||
else if (m_pShapeElement->m_lPlaceholderType == PT_MasterDate && m_pShapeElement->m_nFormatDate == 1 && pParagraph->m_arSpans[nSpan].m_bField)
|
||||
{
|
||||
m_oWriter.WriteString(std::wstring(L"<a:fld id=\"{D7E01130-044F-4930-9A27-C729C70D8524}\" type=\"datetime1\"><a:rPr"));
|
||||
}
|
||||
@ -1066,8 +1066,8 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
|
||||
CString strT2 = _T("</a:t>");
|
||||
m_oWriter.WriteString(strT2);
|
||||
|
||||
if (m_pShapeElement->m_lPlaceholderType == PT_MasterSlideNumber ||
|
||||
(m_pShapeElement->m_lPlaceholderType == PT_MasterDate && m_pShapeElement->m_nFormatDate == 1))
|
||||
if ((m_pShapeElement->m_lPlaceholderType == PT_MasterSlideNumber ||
|
||||
(m_pShapeElement->m_lPlaceholderType == PT_MasterDate && m_pShapeElement->m_nFormatDate == 1)) && pParagraph->m_arSpans[nSpan].m_bField)
|
||||
{
|
||||
m_oWriter.WriteString(std::wstring(L"</a:fld>"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user