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@65645 954022d7-b5bf-4e40-9824-e11837661b57
This commit is contained in:
committed by
Alexander Trofimov
parent
63fd3bbc5a
commit
b667c8a926
@ -29,6 +29,11 @@ CPPTUserInfo::CPPTUserInfo() : CDocument(),
|
||||
|
||||
m_bRtl = false;
|
||||
m_bShowComments = false;
|
||||
|
||||
m_bHasDate = false;
|
||||
m_bHasSlideNumber = false;
|
||||
m_bHasFooter = false;
|
||||
m_nFormatDate = 1;
|
||||
}
|
||||
|
||||
CPPTUserInfo::~CPPTUserInfo()
|
||||
@ -273,8 +278,6 @@ void CPPTUserInfo::FromDocument()
|
||||
{
|
||||
m_arSlides.clear();
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...
|
||||
std::vector<CRecordDocumentAtom*> oArrayDoc;
|
||||
m_oDocument.GetRecordsByType(&oArrayDoc, true, true);
|
||||
|
||||
@ -304,16 +307,28 @@ void CPPTUserInfo::FromDocument()
|
||||
}
|
||||
}
|
||||
std::vector<CRecordHeadersFootersContainer*> oArrayHeadersFootersInfo;
|
||||
m_oDocument.GetRecordsByType(&oArrayHeadersFootersInfo, true, false);
|
||||
m_oDocument.GetRecordsByType(&oArrayHeadersFootersInfo, false, false);
|
||||
|
||||
for (int j = 0 ; j < oArrayHeadersFootersInfo.size(); j++)
|
||||
if (0 != oArrayHeadersFootersInfo.size())
|
||||
{
|
||||
std::vector<CRecordCString*> oHeadersFootersInfo;
|
||||
oArrayHeadersFootersInfo[j]->GetRecordsByType(&oHeadersFootersInfo, true, false);
|
||||
std::vector<CRecordHeadersFootersAtom*> oHeadersFootersInfo;
|
||||
oArrayHeadersFootersInfo[0]->GetRecordsByType(&oHeadersFootersInfo, true, false);
|
||||
|
||||
for (int i = 0 ;i < oHeadersFootersInfo.size(); i++)
|
||||
if (!oHeadersFootersInfo.empty())
|
||||
{
|
||||
m_oFootersHeaderString.push_back(oHeadersFootersInfo[i]->m_strText);
|
||||
m_bHasDate = oHeadersFootersInfo[0]->m_bHasDate || oHeadersFootersInfo[0]->m_bHasTodayDate || oHeadersFootersInfo[0]->m_bHasUserDate;
|
||||
m_bHasFooter = oHeadersFootersInfo[0]->m_bHasFooter;
|
||||
m_bHasSlideNumber = oHeadersFootersInfo[0]->m_bHasSlideNumber;
|
||||
|
||||
if (oHeadersFootersInfo[0]->m_bHasUserDate) m_nFormatDate = 2;
|
||||
}
|
||||
|
||||
std::vector<CRecordCString*> oHeadersFootersStr;
|
||||
oArrayHeadersFootersInfo[0]->GetRecordsByType(&oHeadersFootersStr, true, false);
|
||||
|
||||
for (int i = 0 ;i < oHeadersFootersStr.size(); i++)
|
||||
{
|
||||
m_oFootersHeaderString.push_back(oHeadersFootersStr[i]->m_strText);
|
||||
}
|
||||
}
|
||||
|
||||
@ -386,7 +401,6 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
|
||||
CRecordSlide* pRecordSlide = pPairSlide->second;
|
||||
|
||||
|
||||
if (NULL == pRecordSlide) return;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@ -478,12 +492,6 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
//????? <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> !!!
|
||||
pPairTheme = m_mapMasterToTheme.begin();
|
||||
}
|
||||
//------------------<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ... )
|
||||
std::vector<CRecordHeadersFootersAtom*> oArrayHeadersFootersAtoms;
|
||||
pRecordSlide->GetRecordsByType(&oArrayHeadersFootersAtoms, true, true);
|
||||
|
||||
CRecordHeadersFootersAtom* headers_footers = NULL;
|
||||
if (!oArrayHeadersFootersAtoms.empty()) headers_footers = oArrayHeadersFootersAtoms[0];
|
||||
//-----------------
|
||||
pSlide->m_lThemeID = pPairTheme->second;
|
||||
|
||||
@ -506,7 +514,8 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
|
||||
if (pPairLayoutGeom == pTheme->m_mapGeomToLayout.end())
|
||||
{
|
||||
pSlide->m_lLayoutID = AddNewLayout(pTheme, &oArraySlideAtoms[0]->m_oLayout, pRecordSlide->m_oPersist.m_arTextAttrs, headers_footers, true, bMasterObjects);
|
||||
pSlide->m_lLayoutID = AddNewLayout(pTheme, pRecordSlide, true, bMasterObjects);
|
||||
|
||||
pLayout = &pTheme->m_arLayouts[pSlide->m_lLayoutID];
|
||||
pLayout->m_bShowMasterShapes = true;
|
||||
}
|
||||
@ -558,6 +567,42 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------
|
||||
pSlide->m_bHasDate = pLayout->m_bHasDate;
|
||||
pSlide->m_bHasFooter = pLayout->m_bHasFooter;
|
||||
pSlide->m_bHasSlideNumber = pLayout->m_bHasSlideNumber;
|
||||
pSlide->m_nFormatDate = m_nFormatDate;
|
||||
|
||||
std::vector<std::wstring> users_placeholders = m_oFootersHeaderString;
|
||||
//------------------------------------------------------------------------------------
|
||||
std::vector<CRecordHeadersFootersContainer*> oArrayHeadersFootersInfo;
|
||||
pRecordSlide->GetRecordsByType(&oArrayHeadersFootersInfo, false, true);
|
||||
|
||||
if (0 != oArrayHeadersFootersInfo.size())
|
||||
{
|
||||
std::vector<CRecordHeadersFootersAtom*> oHeadersFootersInfo;
|
||||
oArrayHeadersFootersInfo[0]->GetRecordsByType(&oHeadersFootersInfo, true, false);
|
||||
|
||||
if (!oHeadersFootersInfo.empty())
|
||||
{
|
||||
pSlide->m_bHasDate = oHeadersFootersInfo[0]->m_bHasDate || oHeadersFootersInfo[0]->m_bHasTodayDate || oHeadersFootersInfo[0]->m_bHasUserDate;
|
||||
pSlide->m_bHasFooter = oHeadersFootersInfo[0]->m_bHasFooter;
|
||||
pSlide->m_bHasSlideNumber = oHeadersFootersInfo[0]->m_bHasSlideNumber;
|
||||
|
||||
if (oHeadersFootersInfo[0]->m_bHasUserDate) pSlide->m_nFormatDate = 2;
|
||||
else pSlide->m_nFormatDate = 1;
|
||||
}
|
||||
|
||||
std::vector<CRecordCString*> oHeadersFootersStr;
|
||||
oArrayHeadersFootersInfo[0]->GetRecordsByType(&oHeadersFootersStr, true, false);
|
||||
|
||||
if (!oHeadersFootersStr.empty()) users_placeholders.clear();
|
||||
for (int i = 0 ;i < oHeadersFootersStr.size(); i++)
|
||||
{
|
||||
users_placeholders.push_back(oHeadersFootersStr[i]->m_strText);
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
std::vector<CRecordCString*> oArrayStrings;
|
||||
pRecordSlide->GetRecordsByType(&oArrayStrings, false, false);
|
||||
|
||||
@ -568,7 +613,7 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
pSlide->m_sName = oArrayStrings[i]->m_strText;
|
||||
}
|
||||
}
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...
|
||||
//------------- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ------------------------------------------------------------------------------------------
|
||||
std::vector<CRecordShapeContainer*> oArrayShapes;
|
||||
|
||||
pRecordSlide->GetRecordsByType(&oArrayShapes, true);
|
||||
@ -608,46 +653,59 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
pSlide->m_arElements.push_back(pElem);
|
||||
}
|
||||
if (pElem->m_lPlaceholderType > 0 )
|
||||
{
|
||||
if (pElem->m_lPlaceholderUserStr >= 0 && pElem->m_lPlaceholderUserStr < users_placeholders.size())
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
|
||||
if (NULL != pShape)
|
||||
pShape->SetUpText(users_placeholders[pElem->m_lPlaceholderUserStr]);
|
||||
}
|
||||
slidePlaceholders.insert(std::pair<int,int>(pElem->m_lPlaceholderType, pSlide->m_arElements.size() - 1) );
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
//------------- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
std::map<int, int>::iterator it;
|
||||
|
||||
it = pLayout->m_mapPlaceholders.find(NSOfficePPT::MasterSlideNumber);
|
||||
if ( it != pLayout->m_mapPlaceholders.end() &&
|
||||
slidePlaceholders.find(NSOfficePPT::MasterSlideNumber) == slidePlaceholders.end())
|
||||
IElement* pElement = NULL;
|
||||
|
||||
if (pSlide->m_bHasSlideNumber)
|
||||
{
|
||||
IElement* pElement = pLayout->m_arElements[it->second]->CreateDublicate();
|
||||
pSlide->m_arElements.push_back(pElement);
|
||||
|
||||
it = pLayout->m_mapPlaceholders.find(NSOfficePPT::MasterSlideNumber);
|
||||
if ( it != pLayout->m_mapPlaceholders.end() &&
|
||||
slidePlaceholders.find(NSOfficePPT::MasterSlideNumber) == slidePlaceholders.end())
|
||||
{
|
||||
pElement = pLayout->m_arElements[it->second]->CreateDublicate();
|
||||
pSlide->m_arElements.push_back(pElement);
|
||||
}
|
||||
}
|
||||
|
||||
it = pLayout->m_mapPlaceholders.find(MasterDate);
|
||||
if ( it != pLayout->m_mapPlaceholders.end() &&
|
||||
slidePlaceholders.find(NSOfficePPT::MasterDate) == slidePlaceholders.end())
|
||||
if (pSlide->m_bHasDate)
|
||||
{
|
||||
IElement* pElement = pLayout->m_arElements[it->second]->CreateDublicate();
|
||||
pSlide->m_arElements.push_back(pElement);
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 97 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> Notes
|
||||
//it = pLayout->m_mapPlaceholders.find(MasterHeader);
|
||||
//if ( it != pLayout->m_mapPlaceholders.end() &&
|
||||
// slidePlaceholders.find(NSOfficePPT::MasterHeader) == slidePlaceholders.end())
|
||||
//{
|
||||
// IElement* pElement = pLayout->m_arElements[it->second]->CreateDublicate();
|
||||
// pSlide->m_arElements.push_back(pElement);
|
||||
//}
|
||||
|
||||
it = pLayout->m_mapPlaceholders.find(MasterFooter);
|
||||
if ( it != pLayout->m_mapPlaceholders.end() &&
|
||||
slidePlaceholders.find(NSOfficePPT::MasterFooter) == slidePlaceholders.end())
|
||||
{
|
||||
IElement* pElement = pLayout->m_arElements[it->second]->CreateDublicate();
|
||||
pSlide->m_arElements.push_back(pElement);
|
||||
it = pLayout->m_mapPlaceholders.find(MasterDate);
|
||||
if ( it != pLayout->m_mapPlaceholders.end() &&
|
||||
slidePlaceholders.find(NSOfficePPT::MasterDate) == slidePlaceholders.end())
|
||||
{
|
||||
pElement = pLayout->m_arElements[it->second]->CreateDublicate();
|
||||
pSlide->m_arElements.push_back(pElement);
|
||||
}
|
||||
else
|
||||
{
|
||||
it = slidePlaceholders.find(NSOfficePPT::MasterDate);
|
||||
pElement = pSlide->m_arElements[it->second];
|
||||
}
|
||||
pElement->m_nFormatDate = pSlide->m_nFormatDate;
|
||||
}
|
||||
|
||||
if (pSlide->m_bHasFooter)
|
||||
{
|
||||
it = pLayout->m_mapPlaceholders.find(MasterFooter);
|
||||
if ( it != pLayout->m_mapPlaceholders.end() &&
|
||||
slidePlaceholders.find(NSOfficePPT::MasterFooter) == slidePlaceholders.end())
|
||||
{
|
||||
pElement = pLayout->m_arElements[it->second]->CreateDublicate();
|
||||
pSlide->m_arElements.push_back(pElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IElement* CPPTUserInfo::AddThemeLayoutPlaceholder (CLayout *pLayout, int placeholderType, NSPresentationEditor::CTheme* pTheme)
|
||||
@ -688,13 +746,20 @@ IElement* CPPTUserInfo::AddNewLayoutPlaceholder (CLayout *pLayout, int placehold
|
||||
return pShape;
|
||||
}
|
||||
|
||||
int CPPTUserInfo::AddNewLayout(CTheme* pTheme, SSlideLayoutAtom* layoutRecord, std::vector<CTextFullSettings> & text,
|
||||
CRecordHeadersFootersAtom* headers_footers, bool addShapes, bool bMasterObjects)
|
||||
int CPPTUserInfo::AddNewLayout(CTheme* pTheme, CRecordSlide* pRecordSlide, bool addShapes, bool bMasterObjects)
|
||||
{
|
||||
if (pTheme == NULL) return -1;
|
||||
if (pTheme == NULL) return -1;
|
||||
if (pRecordSlide == NULL) return -1;
|
||||
|
||||
int ind = pTheme->m_arLayouts.size();
|
||||
std::vector<CRecordSlideAtom*> oArraySlideAtoms;
|
||||
|
||||
pRecordSlide->GetRecordsByType(&oArraySlideAtoms, true);
|
||||
if (0 == oArraySlideAtoms.size()) return -1;
|
||||
|
||||
SSlideLayoutAtom & layoutRecord = oArraySlideAtoms[0]->m_oLayout;
|
||||
|
||||
int ind = pTheme->m_arLayouts.size();
|
||||
|
||||
CLayout layout;
|
||||
pTheme->m_arLayouts.push_back(layout);
|
||||
CLayout *pLayout = &pTheme->m_arLayouts.back();
|
||||
@ -710,14 +775,14 @@ int CPPTUserInfo::AddNewLayout(CTheme* pTheme, SSlideLayoutAtom* layoutRecord, s
|
||||
pLayout->m_bUseThemeColorScheme = true;
|
||||
pLayout->m_bShowMasterShapes = true;
|
||||
|
||||
pLayout->m_strLayoutType = ConvertLayoutType(layoutRecord->m_nGeom, layoutRecord->m_pPlaceHolderID);
|
||||
pLayout->m_strLayoutType = ConvertLayoutType(layoutRecord.m_nGeom, layoutRecord.m_pPlaceHolderID);
|
||||
|
||||
if (!addShapes) return ind;
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
pTheme->m_mapGeomToLayout.insert(std::pair<_UINT64, LONG>(layoutRecord->m_hash, ind));
|
||||
pTheme->m_mapGeomToLayout.insert(std::pair<_UINT64, LONG>(layoutRecord.m_hash, ind));
|
||||
|
||||
int defObjSize = -1;
|
||||
switch (layoutRecord->m_nGeom)
|
||||
switch (layoutRecord.m_nGeom)
|
||||
{
|
||||
case 0x01: // SL_TitleBody
|
||||
defObjSize = 0; break;
|
||||
@ -740,9 +805,9 @@ int CPPTUserInfo::AddNewLayout(CTheme* pTheme, SSlideLayoutAtom* layoutRecord, s
|
||||
|
||||
for (int i = 0 ; i < 8; i ++)
|
||||
{
|
||||
if (layoutRecord->m_pPlaceHolderID[i] == 0) break;
|
||||
if (layoutRecord.m_pPlaceHolderID[i] == 0) break;
|
||||
|
||||
switch(layoutRecord->m_pPlaceHolderID[i])
|
||||
switch(layoutRecord.m_pPlaceHolderID[i])
|
||||
{
|
||||
case NSOfficePPT::MasterTitle :
|
||||
case NSOfficePPT::MasterBody :
|
||||
@ -755,7 +820,7 @@ int CPPTUserInfo::AddNewLayout(CTheme* pTheme, SSlideLayoutAtom* layoutRecord, s
|
||||
case NSOfficePPT::MasterHeader:
|
||||
case NSOfficePPT::MasterFooter:
|
||||
{
|
||||
int usualType = layoutRecord->m_pPlaceHolderID[i];
|
||||
int usualType = layoutRecord.m_pPlaceHolderID[i];
|
||||
CorrectPlaceholderType(usualType);
|
||||
|
||||
if (!AddThemeLayoutPlaceholder(pLayout, usualType, pTheme))
|
||||
@ -764,43 +829,31 @@ int CPPTUserInfo::AddNewLayout(CTheme* pTheme, SSlideLayoutAtom* layoutRecord, s
|
||||
}
|
||||
}break;
|
||||
default:
|
||||
AddNewLayoutPlaceholder(pLayout, layoutRecord->m_pPlaceHolderID[i], defObjSize);
|
||||
AddNewLayoutPlaceholder(pLayout, layoutRecord.m_pPlaceHolderID[i], defObjSize);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//if (layoutRecord->m_nGeom==0x0F) return ind; // big object only !!!
|
||||
//if (layoutRecord.m_nGeom==0x0F) return ind; // big object only !!!
|
||||
|
||||
if (headers_footers)
|
||||
pLayout->m_bHasDate = pTheme->m_bHasDate;
|
||||
pLayout->m_bHasFooter = pTheme->m_bHasFooter;
|
||||
pLayout->m_bHasSlideNumber = pTheme->m_bHasSlideNumber;
|
||||
pLayout->m_nFormatDate = pTheme->m_nFormatDate;
|
||||
|
||||
if (pLayout->m_bHasSlideNumber)
|
||||
{
|
||||
if (headers_footers->m_bHasSlideNumber)
|
||||
{
|
||||
AddThemeLayoutPlaceholder(pLayout, MasterSlideNumber, pTheme);
|
||||
}
|
||||
if (headers_footers->m_bHasTodayDate ||
|
||||
headers_footers->m_bHasUserDate ||
|
||||
headers_footers->m_bHasDate)
|
||||
{
|
||||
AddThemeLayoutPlaceholder(pLayout, MasterDate, pTheme);
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 97 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> Notes
|
||||
//if (headers_footers->m_bHasHeader)
|
||||
//{
|
||||
// AddThemeLayoutPlaceholder(pLayout, MasterHeader, pTheme);
|
||||
//}
|
||||
if (headers_footers->m_bHasFooter)
|
||||
{
|
||||
AddThemeLayoutPlaceholder(pLayout, MasterFooter, pTheme);
|
||||
}
|
||||
AddThemeLayoutPlaceholder(pLayout, MasterSlideNumber, pTheme);
|
||||
}
|
||||
else if (bMasterObjects)
|
||||
if (pLayout->m_bHasDate)
|
||||
{
|
||||
AddThemeLayoutPlaceholder(pLayout, MasterSlideNumber ,pTheme);
|
||||
AddThemeLayoutPlaceholder(pLayout, MasterDate ,pTheme);
|
||||
AddThemeLayoutPlaceholder(pLayout, MasterFooter ,pTheme);
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 97 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> Notes
|
||||
//AddThemeLayoutPlaceholder(pLayout, MasterHeader ,pTheme);
|
||||
AddThemeLayoutPlaceholder(pLayout, MasterDate, pTheme);
|
||||
}
|
||||
if (pLayout->m_bHasFooter)
|
||||
{
|
||||
AddThemeLayoutPlaceholder(pLayout, MasterFooter, pTheme);
|
||||
}
|
||||
|
||||
|
||||
return ind;
|
||||
}
|
||||
@ -893,6 +946,41 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
pTheme->m_lOriginalWidth = lOriginWidth;
|
||||
pTheme->m_lOriginalHeight = lOriginHeight;
|
||||
|
||||
pTheme->m_bHasDate = m_bHasDate;
|
||||
pTheme->m_bHasFooter = m_bHasFooter;
|
||||
pTheme->m_bHasSlideNumber = m_bHasSlideNumber;
|
||||
pTheme->m_nFormatDate = m_nFormatDate;
|
||||
|
||||
std::vector<std::wstring> users_placeholders = m_oFootersHeaderString;
|
||||
|
||||
std::vector<CRecordHeadersFootersContainer*> oArrayHeadersFootersInfo;
|
||||
pMaster->GetRecordsByType(&oArrayHeadersFootersInfo, false, true);
|
||||
|
||||
if (0 != oArrayHeadersFootersInfo.size())
|
||||
{
|
||||
std::vector<CRecordHeadersFootersAtom*> oHeadersFootersInfo;
|
||||
oArrayHeadersFootersInfo[0]->GetRecordsByType(&oHeadersFootersInfo, true, false);
|
||||
|
||||
if (!oHeadersFootersInfo.empty())
|
||||
{
|
||||
pTheme->m_bHasDate = oHeadersFootersInfo[0]->m_bHasDate || oHeadersFootersInfo[0]->m_bHasTodayDate || oHeadersFootersInfo[0]->m_bHasUserDate;
|
||||
pTheme->m_bHasFooter = oHeadersFootersInfo[0]->m_bHasFooter;
|
||||
pTheme->m_bHasSlideNumber = oHeadersFootersInfo[0]->m_bHasSlideNumber;
|
||||
|
||||
if (oHeadersFootersInfo[0]->m_bHasUserDate )
|
||||
m_nFormatDate = 2;
|
||||
else m_nFormatDate = 1;
|
||||
}
|
||||
|
||||
std::vector<CRecordCString*> oHeadersFootersStr;
|
||||
oArrayHeadersFootersInfo[0]->GetRecordsByType(&oHeadersFootersStr, true, false);
|
||||
|
||||
if (!oHeadersFootersStr.empty()) users_placeholders.clear();
|
||||
for (int i = 0 ;i < oHeadersFootersStr.size(); i++)
|
||||
{
|
||||
users_placeholders.push_back(oHeadersFootersStr[i]->m_strText);
|
||||
}
|
||||
}
|
||||
std::vector<CRecordCString*> oArrayStrings;
|
||||
pMaster->GetRecordsByType(&oArrayStrings, false, false);
|
||||
for (int i=0; i < oArrayStrings.size(); i++)
|
||||
@ -1036,46 +1124,38 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
pTheme->m_arElements.push_back(pElem);
|
||||
|
||||
if ( pElem->m_lPlaceholderType >0)
|
||||
{
|
||||
if (pElem->m_lPlaceholderUserStr >= 0 && pElem->m_lPlaceholderUserStr < users_placeholders.size())
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
|
||||
if (NULL != pShape)
|
||||
pShape->SetUpText(users_placeholders[pElem->m_lPlaceholderUserStr]);
|
||||
}
|
||||
pTheme->m_mapPlaceholders.insert(std::pair<int, int>(pElem->m_lPlaceholderType, pTheme->m_arElements.size()-1));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
std::vector<CRecordHeadersFootersAtom*> oArrayHeadersFootersAtoms;
|
||||
pMaster->GetRecordsByType(&oArrayHeadersFootersAtoms, true, true);
|
||||
|
||||
if (!oArrayHeadersFootersAtoms.empty())
|
||||
if (pTheme->m_bHasSlideNumber)
|
||||
{
|
||||
if (oArrayHeadersFootersAtoms[0]->m_bHasSlideNumber)
|
||||
if (pTheme->m_mapPlaceholders.find(MasterSlideNumber) == pTheme->m_mapPlaceholders.end())
|
||||
{
|
||||
if (pTheme->m_mapPlaceholders.find(MasterSlideNumber) == pTheme->m_mapPlaceholders.end())
|
||||
{
|
||||
AddNewThemePlaceholder(pTheme, MasterSlideNumber, 2);
|
||||
}
|
||||
AddNewThemePlaceholder(pTheme, MasterSlideNumber, 2);
|
||||
}
|
||||
if (oArrayHeadersFootersAtoms[0]->m_bHasTodayDate ||
|
||||
oArrayHeadersFootersAtoms[0]->m_bHasUserDate ||
|
||||
oArrayHeadersFootersAtoms[0]->m_bHasDate)
|
||||
}
|
||||
if (pTheme->m_bHasDate && pTheme->m_nFormatDate == 1)
|
||||
{
|
||||
if (pTheme->m_mapPlaceholders.find(MasterDate) == pTheme->m_mapPlaceholders.end())
|
||||
{
|
||||
if (pTheme->m_mapPlaceholders.find(MasterDate) == pTheme->m_mapPlaceholders.end())
|
||||
{
|
||||
AddNewThemePlaceholder(pTheme, MasterDate, 2);
|
||||
}
|
||||
AddNewThemePlaceholder(pTheme, MasterDate, 2);
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 97 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> Notes
|
||||
//if (oArrayHeadersFootersAtoms[0]->m_bHasHeader)
|
||||
//{
|
||||
// if (pLayout->m_mapPlaceholders.find(MasterHeader) == pLayout->m_mapPlaceholders.end())
|
||||
// {
|
||||
// AddNewThemePlaceholder(pTheme, MasterHeader, 1);
|
||||
// }
|
||||
//}
|
||||
if (oArrayHeadersFootersAtoms[0]->m_bHasFooter)
|
||||
}
|
||||
if (pTheme->m_bHasFooter)
|
||||
{
|
||||
if (pTheme->m_mapPlaceholders.find(MasterFooter) == pTheme->m_mapPlaceholders.end())
|
||||
{
|
||||
if (pLayout->m_mapPlaceholders.find(MasterFooter) == pLayout->m_mapPlaceholders.end())
|
||||
{
|
||||
AddNewThemePlaceholder(pTheme, MasterFooter, 1);
|
||||
}
|
||||
}
|
||||
AddNewThemePlaceholder(pTheme, MasterFooter, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1170,7 +1250,7 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
|
||||
CLayout* pLayout = NULL;
|
||||
|
||||
int lLayoutID = AddNewLayout(pTheme, &oArraySlideAtoms[0]->m_oLayout, pCurMaster->m_oPersist.m_arTextAttrs, NULL, false, false);
|
||||
int lLayoutID = AddNewLayout(pTheme, pCurMaster, false, false);
|
||||
|
||||
pLayout = &pTheme->m_arLayouts[lLayoutID];
|
||||
pLayout->m_bShowMasterShapes = false;
|
||||
@ -1215,6 +1295,32 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
}
|
||||
}
|
||||
}
|
||||
std::vector<CRecordHeadersFootersContainer*> oArrayHeadersFootersInfo;
|
||||
pCurMaster->GetRecordsByType(&oArrayHeadersFootersInfo, false, true);
|
||||
|
||||
if (0 != oArrayHeadersFootersInfo.size())
|
||||
{
|
||||
std::vector<CRecordHeadersFootersAtom*> oHeadersFootersInfo;
|
||||
oArrayHeadersFootersInfo[0]->GetRecordsByType(&oHeadersFootersInfo, true, false);
|
||||
|
||||
if (!oHeadersFootersInfo.empty())
|
||||
{
|
||||
pLayout->m_bHasDate = oHeadersFootersInfo[0]->m_bHasDate || oHeadersFootersInfo[0]->m_bHasTodayDate || oHeadersFootersInfo[0]->m_bHasUserDate;
|
||||
pLayout->m_bHasFooter = oHeadersFootersInfo[0]->m_bHasFooter;
|
||||
pLayout->m_bHasSlideNumber = oHeadersFootersInfo[0]->m_bHasSlideNumber;
|
||||
|
||||
if (oHeadersFootersInfo[0]->m_bHasUserDate) pLayout->m_nFormatDate = 2;
|
||||
}
|
||||
|
||||
std::vector<CRecordCString*> oHeadersFootersStr;
|
||||
oArrayHeadersFootersInfo[0]->GetRecordsByType(&oHeadersFootersStr, true, false);
|
||||
|
||||
for (int i = 0 ;i < oHeadersFootersStr.size(); i++)
|
||||
{
|
||||
m_oFootersHeaderString.push_back(oHeadersFootersStr[i]->m_strText);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<CRecordCString*> oArrayStrings;
|
||||
pCurMaster->GetRecordsByType(&oArrayStrings, false, false);
|
||||
|
||||
@ -1261,41 +1367,27 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
|
||||
}
|
||||
}
|
||||
std::vector<CRecordHeadersFootersAtom*> oArrayHeadersFootersAtoms;
|
||||
pCurMaster->GetRecordsByType(&oArrayHeadersFootersAtoms, true, true);
|
||||
|
||||
if (!oArrayHeadersFootersAtoms.empty())
|
||||
if (pLayout->m_bHasSlideNumber)
|
||||
{
|
||||
if (oArrayHeadersFootersAtoms[0]->m_bHasSlideNumber)
|
||||
if (pLayout->m_mapPlaceholders.find(MasterSlideNumber) == pLayout->m_mapPlaceholders.end())
|
||||
{
|
||||
if (pLayout->m_mapPlaceholders.find(MasterSlideNumber) == pLayout->m_mapPlaceholders.end())
|
||||
{
|
||||
AddNewLayoutPlaceholder(pLayout, MasterSlideNumber, 2);
|
||||
}
|
||||
AddNewLayoutPlaceholder(pLayout, MasterSlideNumber, 2);
|
||||
}
|
||||
if (oArrayHeadersFootersAtoms[0]->m_bHasTodayDate ||
|
||||
oArrayHeadersFootersAtoms[0]->m_bHasUserDate ||
|
||||
oArrayHeadersFootersAtoms[0]->m_bHasDate)
|
||||
}
|
||||
if (pLayout->m_bHasDate && pLayout->m_nFormatDate == 1)
|
||||
{
|
||||
if (pLayout->m_mapPlaceholders.find(MasterDate) == pLayout->m_mapPlaceholders.end())
|
||||
{
|
||||
if (pLayout->m_mapPlaceholders.find(MasterDate) == pLayout->m_mapPlaceholders.end())
|
||||
{
|
||||
AddNewLayoutPlaceholder(pLayout, MasterDate, 2);
|
||||
}
|
||||
AddNewLayoutPlaceholder(pLayout, MasterDate, 2);
|
||||
}
|
||||
if (oArrayHeadersFootersAtoms[0]->m_bHasHeader)
|
||||
}
|
||||
if (pLayout->m_bHasFooter)
|
||||
{
|
||||
if (pLayout->m_mapPlaceholders.find(MasterFooter) == pLayout->m_mapPlaceholders.end())
|
||||
{
|
||||
if (pLayout->m_mapPlaceholders.find(MasterHeader) == pLayout->m_mapPlaceholders.end())
|
||||
{
|
||||
AddNewLayoutPlaceholder(pLayout, MasterHeader, 1);
|
||||
}
|
||||
}
|
||||
if (oArrayHeadersFootersAtoms[0]->m_bHasFooter)
|
||||
{
|
||||
if (pLayout->m_mapPlaceholders.find(MasterFooter) == pLayout->m_mapPlaceholders.end())
|
||||
{
|
||||
AddNewLayoutPlaceholder(pLayout, MasterFooter, 1);
|
||||
}
|
||||
}
|
||||
AddNewLayoutPlaceholder(pLayout, MasterFooter, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -43,6 +43,10 @@ public:
|
||||
NSPresentationEditor::CTextStyles m_oDefaultTextStyle;
|
||||
|
||||
std::vector<std::wstring> m_oFootersHeaderString;
|
||||
bool m_bHasDate;
|
||||
bool m_bHasSlideNumber;
|
||||
bool m_bHasFooter;
|
||||
int m_nFormatDate;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
CPPTDocumentInfo* m_pDocumentInfo;
|
||||
@ -254,8 +258,7 @@ public:
|
||||
void AddAnimation (DWORD dwSlideID, double Width, double Height, IElement* pElement);
|
||||
void AddAudioTransition (DWORD dwSlideID, CTransition* pTransition, const std::wstring& strFilePath);
|
||||
|
||||
int AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayoutAtom* layoutRecord, std::vector<CTextFullSettings> & text,
|
||||
CRecordHeadersFootersAtom* headers_footers, bool addShapes, bool bMasterObjects);
|
||||
int AddNewLayout(NSPresentationEditor::CTheme* pTheme, CRecordSlide* pRecordSlide, bool addShapes, bool bMasterObjects);
|
||||
|
||||
IElement* AddNewLayoutPlaceholder (CLayout *pLayout, int placeholderType, int placeholderSizePreset = -1);
|
||||
IElement* AddThemeLayoutPlaceholder (CLayout *pLayout, int placeholderType, CTheme* pTheme);
|
||||
|
||||
@ -97,7 +97,7 @@ typedef BYTE BOOL1;
|
||||
|
||||
#define RECORD_TYPE_SLIDENUMBER_META_ATOM 0x0FD8
|
||||
|
||||
#define RECORD_TYPE_HEADERSFOOTERS 4057
|
||||
#define RECORD_TYPE_HEADERSFOOTERS 0x0FD9
|
||||
#define RECORD_TYPE_HEADERSFOOTERS_ATOM 4058
|
||||
#define RECORD_TYPE_TXINTERACTIVEINFO_ATOM 4063
|
||||
#define RECORD_TYPE_CHARFORMAT_ATOM 4066
|
||||
|
||||
@ -1456,24 +1456,25 @@ public:
|
||||
}
|
||||
//meta placeholders
|
||||
std::vector<CRecordFooterMetaAtom*> oArrayFooterMeta;
|
||||
|
||||
GetRecordsByType(&oArrayFooterMeta, true, true);
|
||||
if (0 < oArrayFooterMeta.size())
|
||||
{
|
||||
pElem->m_lPlaceholderType = PT_MasterFooter;
|
||||
|
||||
DWORD posText = oArrayFooterMeta[0]->m_nPosition;
|
||||
if (posText < pTheme->m_oFootersHeaderString.size())
|
||||
strShapeText = pTheme->m_oFootersHeaderString[posText];
|
||||
pElem->m_lPlaceholderType = PT_MasterFooter;
|
||||
pElem->m_lPlaceholderUserStr = oArrayFooterMeta[0]->m_nPosition;
|
||||
}
|
||||
std::vector<CRecordSlideNumberMetaAtom*> oArraySlideNumberMeta;
|
||||
GetRecordsByType(&oArraySlideNumberMeta, true, true);
|
||||
if (0 < oArraySlideNumberMeta.size())
|
||||
{
|
||||
pElem->m_lPlaceholderType = PT_MasterSlideNumber;
|
||||
DWORD posText = oArraySlideNumberMeta[0]->m_nPosition;
|
||||
|
||||
if (posText < pTheme->m_oFootersHeaderString.size())
|
||||
strShapeText = pTheme->m_oFootersHeaderString[posText];
|
||||
}
|
||||
std::vector<CRecordGenericDateMetaAtom*> oArrayDateMeta;
|
||||
GetRecordsByType(&oArrayDateMeta, true, true);
|
||||
if (0 < oArrayDateMeta.size())
|
||||
{
|
||||
pElem->m_lPlaceholderType = PT_MasterDate;
|
||||
pElem->m_lPlaceholderUserStr = oArrayDateMeta[0]->m_nPosition;
|
||||
}
|
||||
//------------- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ---------------------------------------------------------------------------------
|
||||
std::vector<CRecordClientAnchor*> oArrayAnchor;
|
||||
|
||||
@ -73,9 +73,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class CRecordMetaCharacterAtom : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
@ -99,35 +96,36 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class CRecordRTFDateTimeMetaAtom : public CRecordMetaCharacterAtom
|
||||
class CRecordGenericDateMetaAtom : public CRecordMetaCharacterAtom
|
||||
{
|
||||
};
|
||||
|
||||
class CRecordRTFDateTimeMetaAtom : public CRecordGenericDateMetaAtom
|
||||
{
|
||||
public:
|
||||
std::string m_strFormat;
|
||||
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
|
||||
{
|
||||
CRecordMetaCharacterAtom::ReadFromStream(oHeader, pStream);
|
||||
CRecordGenericDateMetaAtom::ReadFromStream(oHeader, pStream);
|
||||
|
||||
m_strFormat = StreamUtils::ReadStringA(pStream, 128);
|
||||
}
|
||||
};
|
||||
|
||||
class CRecordDateTimeMetaAtom : public CRecordMetaCharacterAtom
|
||||
class CRecordDateTimeMetaAtom : public CRecordGenericDateMetaAtom
|
||||
{
|
||||
public:
|
||||
BYTE m_FormatID;
|
||||
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
|
||||
{
|
||||
CRecordMetaCharacterAtom::ReadFromStream(oHeader, pStream);
|
||||
CRecordGenericDateMetaAtom::ReadFromStream(oHeader, pStream);
|
||||
|
||||
m_FormatID = StreamUtils::ReadBYTE(pStream);
|
||||
}
|
||||
};
|
||||
|
||||
class CRecordGenericDateMetaAtom : public CRecordMetaCharacterAtom
|
||||
{
|
||||
};
|
||||
|
||||
class CRecordFooterMetaAtom : public CRecordMetaCharacterAtom
|
||||
{
|
||||
|
||||
@ -45,8 +45,6 @@ public:
|
||||
|
||||
while (lMemCount < m_lCount + 1)
|
||||
{
|
||||
if (pStream->tell() >= m_lOffsetInStream + m_oHeader.RecLen) break;
|
||||
|
||||
CTextPFRun_ppt elm;
|
||||
m_arrPFs.push_back(elm);
|
||||
m_arrPFs[lCountItems].LoadFromStream(pStream);
|
||||
@ -59,8 +57,6 @@ public:
|
||||
lCountItems = 0;
|
||||
while (lMemCount < m_lCount + 1)
|
||||
{
|
||||
if (pStream->tell() >= m_lOffsetInStream + m_oHeader.RecLen) break;
|
||||
|
||||
CTextCFRun_ppt elm;
|
||||
m_arrCFs.push_back(elm);
|
||||
|
||||
|
||||
@ -156,16 +156,6 @@ namespace NSPresentationEditor
|
||||
}
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void ClearPreset()
|
||||
{
|
||||
size_t nCount = m_arSlides.size();
|
||||
for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
|
||||
{
|
||||
m_arSlides[nIndex]->ClearPreset();
|
||||
}
|
||||
}
|
||||
|
||||
CString GetXmlSlideTransition ( CSlide& oSlide/*, CAudioOverlay& oAudioOverlay*/ )
|
||||
{
|
||||
CString Source = CString ( _T("") );
|
||||
|
||||
@ -120,6 +120,8 @@ namespace NSPresentationEditor
|
||||
int m_lPlaceholderType;
|
||||
bool m_bPlaceholderSet;
|
||||
int m_lPlaceholderSizePreset;
|
||||
int m_lPlaceholderUserStr;
|
||||
int m_nFormatDate;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
CMetricInfo m_oMetric;
|
||||
@ -134,7 +136,6 @@ namespace NSPresentationEditor
|
||||
bool m_bHaveAnchor;
|
||||
|
||||
bool m_bIsChangeable; // <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool m_bIsLayoutElement; // <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
CElementProperties m_oProperties;
|
||||
|
||||
@ -175,7 +176,6 @@ namespace NSPresentationEditor
|
||||
m_bHaveAnchor = true;
|
||||
|
||||
m_bIsChangeable = true;
|
||||
m_bIsLayoutElement = false;
|
||||
|
||||
m_lID = -1;
|
||||
m_lLayoutID = -1;
|
||||
@ -184,6 +184,8 @@ namespace NSPresentationEditor
|
||||
m_lPlaceholderType = -1;
|
||||
m_bPlaceholderSet = false;
|
||||
m_lPlaceholderSizePreset = -1;
|
||||
m_lPlaceholderUserStr = -1;
|
||||
m_nFormatDate = 1;
|
||||
|
||||
m_etType = etPicture;
|
||||
|
||||
@ -246,7 +248,6 @@ namespace NSPresentationEditor
|
||||
pDublicate->m_bHaveAnchor = m_bHaveAnchor;
|
||||
|
||||
pDublicate->m_bIsChangeable = m_bIsChangeable;
|
||||
pDublicate->m_bIsLayoutElement = m_bIsLayoutElement;
|
||||
|
||||
pDublicate->m_etType = m_etType;
|
||||
|
||||
@ -267,6 +268,8 @@ namespace NSPresentationEditor
|
||||
pDublicate->m_lPlaceholderType = m_lPlaceholderType;
|
||||
pDublicate->m_bPlaceholderSet = m_bPlaceholderSet;
|
||||
pDublicate->m_lPlaceholderSizePreset = m_lPlaceholderSizePreset;
|
||||
pDublicate->m_lPlaceholderUserStr = m_lPlaceholderUserStr;
|
||||
pDublicate->m_nFormatDate = m_nFormatDate;
|
||||
|
||||
pDublicate->m_oMetric = m_oMetric;
|
||||
pDublicate->m_oProperties = m_oProperties;
|
||||
|
||||
@ -88,3 +88,21 @@ void NSPresentationEditor::CShapeElement::SetupTextProperties(CSlide* pSlide, CT
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NSPresentationEditor::CShapeElement::SetUpText(std::wstring newText)
|
||||
{
|
||||
NSPresentationEditor::CTextAttributesEx* pText = &m_oShape.m_oText;
|
||||
|
||||
if (pText->m_arParagraphs.size() > 0)
|
||||
{
|
||||
if (pText->m_arParagraphs[0].m_arSpans.size() >0)
|
||||
{
|
||||
ReplaceAll(pText->m_arParagraphs[0].m_arSpans[0].m_strText, L"*", newText);
|
||||
pText->m_arParagraphs[0].m_arSpans.erase(pText->m_arParagraphs[0].m_arSpans.begin()+1,pText->m_arParagraphs[0].m_arSpans.end());
|
||||
}
|
||||
pText->m_arParagraphs.erase(pText->m_arParagraphs.begin()+1,pText->m_arParagraphs.end());
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -497,74 +497,6 @@ namespace NSPresentationEditor
|
||||
{
|
||||
}
|
||||
|
||||
//virtual void WriteToXml(XmlUtils::CXmlWriter& oWriter)
|
||||
//{
|
||||
// CString strXml = SaveToXML();
|
||||
// oWriter.WriteString(strXml);
|
||||
//}
|
||||
//virtual void ReadFromXml(XmlUtils::CXmlNode& oNode)
|
||||
//{
|
||||
//}
|
||||
|
||||
//virtual CString SaveToXML()
|
||||
//{
|
||||
// if (!m_oAnimations.m_arAnimations.empty())
|
||||
// return ToAnimationXml();
|
||||
//
|
||||
// CGeomShapeInfo oInfo;
|
||||
// oInfo.SetBounds(m_rcBounds);
|
||||
|
||||
// oInfo.m_dRotate = m_dRotate;
|
||||
// oInfo.m_bFlipH = m_bFlipH;
|
||||
// oInfo.m_bFlipV = m_bFlipV;
|
||||
|
||||
// return m_oShape.ToXml(oInfo, m_oMetric, m_dStartTime, m_dEndTime, m_pTheme, m_pLayout);
|
||||
//}
|
||||
|
||||
//CString ToAnimationXml()
|
||||
//{
|
||||
// CGeomShapeInfo oInfo;
|
||||
// oInfo.SetBounds(m_rcBounds);
|
||||
|
||||
// oInfo.m_dRotate = m_dRotate;
|
||||
// oInfo.m_bFlipH = m_bFlipH;
|
||||
// oInfo.m_bFlipV = m_bFlipV;
|
||||
|
||||
// m_oAnimations.m_dSlideWidth = m_oMetric.m_lMillimetresHor;
|
||||
// m_oAnimations.m_dSlideHeight = m_oMetric.m_lMillimetresVer;
|
||||
|
||||
// CString timeXML;
|
||||
// timeXML.Format(_T("<timeline type = \"1\" begin=\"%f\" end=\"%f\" fadein=\"0\" fadeout=\"0\" completeness=\"1.0\"/> "), m_dStartTime, m_dEndTime );
|
||||
//
|
||||
// CString baseXML = m_oShape.ToXml(oInfo, m_oMetric, m_dStartTime, m_dEndTime, m_pTheme, m_pLayout);
|
||||
|
||||
// if ( -1 != baseXML.Find ( _T("<ImagePaint-DrawTextEx") ) )
|
||||
// {
|
||||
// CString sBounds; // FIX
|
||||
// sBounds.Format(_T("<bounds left='%d' top='%d' right='%d' bottom='%d'/>"),
|
||||
// (LONG)m_rcBounds.left, (LONG)m_rcBounds.top, (LONG)m_rcBounds.right, (LONG)m_rcBounds.bottom);
|
||||
|
||||
// CString sReplace = m_oAnimations.ToXml(m_dStartTime, m_dEndTime) + timeXML + sBounds + _T("</ImagePaint-DrawTextAnimateEx>");
|
||||
//
|
||||
// baseXML.Replace ( _T("</ImagePaint-DrawTextEx>"), sReplace );
|
||||
// baseXML.Replace ( _T("<ImagePaint-DrawTextEx"), _T("<ImagePaint-DrawTextAnimateEx") );
|
||||
// }
|
||||
|
||||
// if ( -1 != baseXML.Find ( _T("<ImagePaint-DrawGraphicPath") ) )
|
||||
// {
|
||||
// CString sAnim = m_oAnimations.ToXml(m_dStartTime, m_dEndTime, true);
|
||||
// if (sAnim.GetLength())
|
||||
// {
|
||||
// CString sReplace = sAnim + timeXML + _T("</ImagePaint-DrawGraphicPathAnimate>");
|
||||
//
|
||||
// baseXML.Replace ( _T("</ImagePaint-DrawGraphicPath>"), sReplace );
|
||||
// baseXML.Replace ( _T("<ImagePaint-DrawGraphicPath"), _T("<ImagePaint-DrawGraphicPathAnimate") );
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return baseXML;
|
||||
//}
|
||||
|
||||
virtual IElement* CreateDublicate()
|
||||
{
|
||||
CShapeElement* pShapeElement = new CShapeElement(m_ClassType, m_lShapeType);
|
||||
@ -577,7 +509,7 @@ namespace NSPresentationEditor
|
||||
m_oShape.SetToDublicate(&pShapeElement->m_oShape);
|
||||
return (IElement*)pShapeElement;
|
||||
}
|
||||
|
||||
void SetUpText(std::wstring newText);
|
||||
|
||||
virtual void SetupProperties(CSlide* pSlide, CTheme* pTheme, CLayout* pLayout)
|
||||
{
|
||||
|
||||
@ -14,17 +14,22 @@ namespace NSPresentationEditor
|
||||
bool m_bUseThemeColorScheme;
|
||||
|
||||
// "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"(<28> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>), <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
long m_lOriginalWidth;
|
||||
long m_lOriginalHeight;
|
||||
long m_lOriginalWidth;
|
||||
long m_lOriginalHeight;
|
||||
|
||||
bool m_bIsBackground;
|
||||
CBrush m_oBackground;
|
||||
bool m_bIsBackground;
|
||||
CBrush m_oBackground;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
long m_lWidth;
|
||||
long m_lHeight;
|
||||
long m_lWidth;
|
||||
long m_lHeight;
|
||||
|
||||
CMetricInfo m_oInfo;
|
||||
CMetricInfo m_oInfo;
|
||||
|
||||
bool m_bHasDate;
|
||||
bool m_bHasSlideNumber;
|
||||
bool m_bHasFooter;
|
||||
int m_nFormatDate;
|
||||
|
||||
bool m_bShowMasterShapes;
|
||||
std::wstring m_strLayoutType;
|
||||
@ -67,6 +72,11 @@ namespace NSPresentationEditor
|
||||
m_bIsBackground = oSrc.m_bIsBackground;
|
||||
m_oBackground = oSrc.m_oBackground;
|
||||
|
||||
m_bHasDate = oSrc.m_bHasDate;
|
||||
m_bHasSlideNumber = oSrc.m_bHasSlideNumber;
|
||||
m_bHasFooter = oSrc.m_bHasFooter;
|
||||
m_nFormatDate = oSrc.m_nFormatDate;
|
||||
|
||||
m_bShowMasterShapes = oSrc.m_bShowMasterShapes;
|
||||
m_strLayoutType = oSrc.m_strLayoutType;
|
||||
|
||||
@ -96,6 +106,11 @@ namespace NSPresentationEditor
|
||||
m_arElements.clear();
|
||||
m_mapPlaceholders.clear();
|
||||
|
||||
m_bHasDate = false;
|
||||
m_bHasSlideNumber = false;
|
||||
m_bHasFooter = false;
|
||||
m_nFormatDate = 1;
|
||||
|
||||
m_bUseThemeColorScheme = true;
|
||||
m_bShowMasterShapes = true;
|
||||
m_strLayoutType = _T("obj");
|
||||
|
||||
@ -14,19 +14,19 @@ namespace NSPresentationEditor
|
||||
CSlideShowInfo m_oSlideShow;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
long m_lWidth;
|
||||
long m_lHeight;
|
||||
long m_lWidth;
|
||||
long m_lHeight;
|
||||
|
||||
// <20> <20><><EFBFBD> <20><><EFBFBD> - "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" (<28> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>), <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
long m_lOriginalWidth;
|
||||
long m_lOriginalHeight;
|
||||
long m_lOriginalWidth;
|
||||
long m_lOriginalHeight;
|
||||
|
||||
double m_dStartTime;
|
||||
double m_dEndTime;
|
||||
double m_dDuration;
|
||||
double m_dStartTime;
|
||||
double m_dEndTime;
|
||||
double m_dDuration;
|
||||
|
||||
bool m_bIsBackground;
|
||||
CBrush m_oBackground;
|
||||
bool m_bIsBackground;
|
||||
CBrush m_oBackground;
|
||||
|
||||
std::vector<CColor> m_arColorScheme;
|
||||
bool m_bUseLayoutColorScheme;
|
||||
@ -34,6 +34,11 @@ namespace NSPresentationEditor
|
||||
|
||||
CMetricInfo m_oInfo;
|
||||
|
||||
bool m_bHasDate;
|
||||
bool m_bHasSlideNumber;
|
||||
bool m_bHasFooter;
|
||||
int m_nFormatDate;
|
||||
|
||||
std::wstring m_strComment;
|
||||
std::wstring m_sName;
|
||||
public:
|
||||
@ -56,18 +61,23 @@ namespace NSPresentationEditor
|
||||
m_arColorScheme.clear();
|
||||
m_arElements.clear();
|
||||
|
||||
m_lThemeID = -1;
|
||||
m_lLayoutID = -1;
|
||||
m_lThemeID = -1;
|
||||
m_lLayoutID = -1;
|
||||
|
||||
m_lWidth = 270;
|
||||
m_lHeight = 190;
|
||||
m_lWidth = 270;
|
||||
m_lHeight = 190;
|
||||
|
||||
m_lOriginalWidth = 6000;
|
||||
m_lOriginalHeight = 5000;
|
||||
|
||||
m_dStartTime = 0.0;
|
||||
m_dEndTime = 0.0;
|
||||
m_dDuration = 30000.0;
|
||||
m_dStartTime = 0.0;
|
||||
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();
|
||||
@ -75,42 +85,6 @@ namespace NSPresentationEditor
|
||||
|
||||
}
|
||||
|
||||
//CSlide& operator=(const CSlide& oSrc)
|
||||
//{
|
||||
// Clear();
|
||||
//
|
||||
// size_t nCount = oSrc.m_arElements.size();
|
||||
// for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
|
||||
// {
|
||||
// m_arElements.push_back(oSrc.m_arElements[nIndex]->CreateDublicate());
|
||||
// }
|
||||
|
||||
// m_arColorScheme = oSrc.m_arColorScheme;
|
||||
|
||||
// m_oSlideShow = oSrc.m_oSlideShow;
|
||||
|
||||
// m_lThemeID = oSrc.m_lThemeID;
|
||||
// m_lLayoutID = oSrc.m_lLayoutID;
|
||||
|
||||
// m_lWidth = oSrc.m_lWidth;
|
||||
// m_lHeight = oSrc.m_lHeight;
|
||||
|
||||
// m_lOriginalWidth = oSrc.m_lOriginalWidth;
|
||||
// m_lOriginalHeight = oSrc.m_lOriginalHeight;
|
||||
//
|
||||
// m_dStartTime = oSrc.m_dStartTime;
|
||||
// m_dEndTime = oSrc.m_dEndTime;
|
||||
// m_dDuration = oSrc.m_dDuration;
|
||||
|
||||
// m_bIsBackground = oSrc.m_bIsBackground;
|
||||
// m_oBackground = oSrc.m_oBackground;
|
||||
|
||||
// m_bShowMasterShapes = oSrc.m_bShowMasterShapes;
|
||||
|
||||
// m_strComment = oSrc.m_strComment;
|
||||
// return *this;
|
||||
//}
|
||||
|
||||
CSlide(const CSlide& oSrc)
|
||||
{
|
||||
Clear();
|
||||
@ -143,6 +117,11 @@ 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;
|
||||
|
||||
m_strComment = oSrc.m_strComment;
|
||||
m_sName = oSrc.m_sName;
|
||||
}
|
||||
@ -169,30 +148,6 @@ namespace NSPresentationEditor
|
||||
}
|
||||
}
|
||||
|
||||
void ClearPreset()
|
||||
{
|
||||
LONG nCount = (LONG)m_arElements.size();
|
||||
for (LONG i = 0; i < nCount; ++i)
|
||||
{
|
||||
IElement* pElement = m_arElements[i];
|
||||
|
||||
if (NULL == pElement)
|
||||
{
|
||||
m_arElements.erase(m_arElements.begin() + i);
|
||||
--i;
|
||||
--nCount;
|
||||
continue;
|
||||
}
|
||||
else if (pElement->m_bIsLayoutElement)
|
||||
{
|
||||
m_arElements.erase(m_arElements.begin() + i);
|
||||
--i;
|
||||
--nCount;
|
||||
RELEASEINTERFACE(pElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CalculateElement(size_t nIndexElement, CTheme* pTheme, CLayout* pLayout)
|
||||
{
|
||||
IElement* pElement = m_arElements[nIndexElement];
|
||||
|
||||
@ -35,13 +35,14 @@ namespace NSPresentationEditor
|
||||
|
||||
std::vector<std::vector<CColor>>m_arExtraColorScheme;
|
||||
|
||||
long m_lOriginalWidth;
|
||||
long m_lOriginalHeight;
|
||||
long m_lOriginalWidth;
|
||||
long m_lOriginalHeight;
|
||||
|
||||
bool m_bHasDate;
|
||||
bool m_bHasSlideNumber;
|
||||
bool m_bHasHeader;
|
||||
bool m_bHasFooter;
|
||||
bool m_bHasDate;
|
||||
bool m_bHasSlideNumber;
|
||||
bool m_bHasFooter;
|
||||
|
||||
int m_nFormatDate;//1- current, 2 - user
|
||||
|
||||
std::vector<std::wstring> m_oFootersHeaderString;
|
||||
|
||||
@ -49,13 +50,7 @@ namespace NSPresentationEditor
|
||||
CTheme() : m_arColorScheme(), m_arFonts(), m_arBrushes(),
|
||||
m_arPens(), m_arEffects(), m_arLayouts()
|
||||
{
|
||||
m_sThemeName = L"Default";
|
||||
m_lOriginalWidth = m_lOriginalHeight = 0;
|
||||
|
||||
m_bHasDate = false;
|
||||
m_bHasSlideNumber = false;
|
||||
m_bHasHeader = false;
|
||||
m_bHasFooter = false;
|
||||
Clear();
|
||||
}
|
||||
|
||||
CTheme(const CTheme& oSrc)
|
||||
@ -78,8 +73,8 @@ namespace NSPresentationEditor
|
||||
|
||||
m_bHasDate = oSrc.m_bHasDate;
|
||||
m_bHasSlideNumber = oSrc.m_bHasSlideNumber;
|
||||
m_bHasHeader = oSrc.m_bHasHeader;
|
||||
m_bHasFooter = oSrc.m_bHasFooter;
|
||||
m_nFormatDate = oSrc.m_nFormatDate;
|
||||
|
||||
for (int i = 0; i < oSrc.m_arExtraColorScheme.size(); ++i)
|
||||
{
|
||||
@ -152,12 +147,12 @@ namespace NSPresentationEditor
|
||||
|
||||
m_lOriginalWidth = m_lOriginalHeight = 0;
|
||||
|
||||
m_sThemeName = L"Default";
|
||||
m_sThemeName = L"Default";
|
||||
|
||||
m_bHasDate = false;
|
||||
m_bHasSlideNumber = false;
|
||||
m_bHasHeader = false;
|
||||
m_bHasFooter = false;
|
||||
m_bHasDate = false;
|
||||
m_bHasSlideNumber = false;
|
||||
m_bHasFooter = false;
|
||||
m_nFormatDate = 1;
|
||||
}
|
||||
|
||||
~CTheme()
|
||||
|
||||
@ -951,7 +951,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
|
||||
{
|
||||
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)
|
||||
else if (m_pShapeElement->m_lPlaceholderType == PT_MasterDate && m_pShapeElement->m_nFormatDate == 1)
|
||||
{
|
||||
m_oWriter.WriteString(std::wstring(L"<a:fld id=\"{D7E01130-044F-4930-9A27-C729C70D8524}\" type=\"datetime1\"><a:rPr"));
|
||||
}
|
||||
@ -1067,7 +1067,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
|
||||
m_oWriter.WriteString(strT2);
|
||||
|
||||
if (m_pShapeElement->m_lPlaceholderType == PT_MasterSlideNumber ||
|
||||
m_pShapeElement->m_lPlaceholderType == PT_MasterDate)
|
||||
(m_pShapeElement->m_lPlaceholderType == PT_MasterDate && m_pShapeElement->m_nFormatDate == 1))
|
||||
{
|
||||
m_oWriter.WriteString(std::wstring(L"</a:fld>"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user