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,17 +542,16 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide) ...@@ -542,17 +542,16 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape) for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape)
{ {
IElement* pElem = NULL; IElement* pElem = NULL;
oArrayShapes[nShape]->GetElement(&pElem, &m_oExMedia, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight, oArrayShapes[nShape]->GetElement(&pElem, &m_oExMedia, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight,
pTheme, pLayout, pThemeWrapper, pSlideWrapper, pSlide); pTheme, pLayout, pThemeWrapper, pSlideWrapper, pSlide);
if (NULL != pElem) if (NULL != pElem)
{ {
AddAnimation ( dwSlideID, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight, pElem ); if (pElem->m_bIsBackground && !pElem->m_bHaveAnchor)
if (pElem->m_bIsBackground)
{
if (!oArrayAtoms[0]->m_bMasterBackground)
{ {
//if (!oArrayAtoms[0]->m_bMasterBackground)
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem); CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
if (NULL != pShape) if (NULL != pShape)
{ {
...@@ -561,10 +560,11 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide) ...@@ -561,10 +560,11 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
pSlide->m_bIsBackground = true; pSlide->m_bIsBackground = true;
pSlide->m_oBackground = pShape->m_oShape.m_oBrush; pSlide->m_oBackground = pShape->m_oShape.m_oBrush;
} }
} RELEASEOBJECT(pElem);
RELEASEINTERFACE(pElem);
continue; continue;
}
}else
AddAnimation ( dwSlideID, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight, pElem );
pSlide->m_arElements.push_back(pElem); pSlide->m_arElements.push_back(pElem);
} }
...@@ -744,6 +744,8 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co ...@@ -744,6 +744,8 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
pLayout->m_bUseThemeColorScheme = true; pLayout->m_bUseThemeColorScheme = true;
pLayout->m_bShowMasterShapes = bMasterObjects; 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); pLayout->m_strLayoutType = ConvertLayoutType(oArraySlideAtoms[0]->m_oLayout.m_nGeom, oArraySlideAtoms[0]->m_oLayout.m_pPlaceHolderID);
// ...----------------------------------------------------------- // ...-----------------------------------------------------------
......
...@@ -182,6 +182,8 @@ public: ...@@ -182,6 +182,8 @@ public:
NSOfficePPT::PlaceholderEnum phbody = (NSOfficePPT::PlaceholderEnum)pPlaceholders[0]; NSOfficePPT::PlaceholderEnum phbody = (NSOfficePPT::PlaceholderEnum)pPlaceholders[0];
switch (phbody) switch (phbody)
{ {
case NSOfficePPT::MasterTitle:
return _T("title");
case NSOfficePPT::Table: case NSOfficePPT::Table:
return _T("tbl"); return _T("tbl");
case NSOfficePPT::OrganizationChart: case NSOfficePPT::OrganizationChart:
......
...@@ -106,10 +106,10 @@ IRecord* CreateByType(SRecordHeader oHeader) ...@@ -106,10 +106,10 @@ IRecord* CreateByType(SRecordHeader oHeader)
CREATE_BY_TYPE(RECORD_TYPE_COMPOSITEMASTERID , CRecordTripCompositeMasterId12Atom) CREATE_BY_TYPE(RECORD_TYPE_COMPOSITEMASTERID , CRecordTripCompositeMasterId12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPCONTENTMASTERINFO12 , CRecordRoundTripContentMasterInfo12Atom) // ECMA-376 //CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPCONTENTMASTERINFO12 , CRecordRoundTripContentMasterInfo12Atom) // ECMA-376
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPSHAPEID12 , CRecordRoundTripShapeId12Atom) //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_ROUNDTRIPCONTENTMASTERID , CRecordRoundTripContentMasterId12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPOARTTEXTSTYLES12 , CRecordRoundTripOArtTextStyles12Atom) //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_ROUNDTRIPDOCFLAGS12 , CRecordRoundTripDocFlags12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPSHAPECHECKSUMFORCUSTOMLAYOUTS12 , CRecordRoundTripShapeCheckSumForCustomLayouts12Atom) //CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPSHAPECHECKSUMFORCUSTOMLAYOUTS12 , CRecordRoundTripShapeCheckSumForCustomLayouts12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPNOTESMASTERTEXTSTYLES12 , CRecordRoundTripNotesMasterTextStyles12Atom) //CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPNOTESMASTERTEXTSTYLES12 , CRecordRoundTripNotesMasterTextStyles12Atom)
...@@ -203,13 +203,12 @@ IRecord* CreateByType(SRecordHeader oHeader) ...@@ -203,13 +203,12 @@ IRecord* CreateByType(SRecordHeader oHeader)
default: default:
{ {
#ifdef _DEBUG //#ifdef _DEBUG
char str[1024]={}; // char str[1024]={};
sprintf(str, "Unknown record type: %xd\n" , oHeader.RecType); // sprintf(str, "Unknown record type: %xd\n" , oHeader.RecType);
std::cout << str; // std::cout << str;
#endif //#endif
} }break;
break;
}; };
if (NULL == pRecord) if (NULL == pRecord)
...@@ -223,5 +222,10 @@ IRecord* CreateByType(SRecordHeader oHeader) ...@@ -223,5 +222,10 @@ IRecord* CreateByType(SRecordHeader oHeader)
pRecord = new CUnknownRecord(); 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; return pRecord;
} }
...@@ -95,12 +95,12 @@ public: ...@@ -95,12 +95,12 @@ public:
return lIndex; return lIndex;
LONG lResult = 0; LONG lResult = 0;
size_t nCount = m_parEmptyPictures->size(); DWORD nCount = m_parEmptyPictures->size();
if (lIndex > nCount) if (lIndex > nCount)
return lIndex; 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]) if ((*m_parEmptyPictures)[nIndex])
++lResult; ++lResult;
......
...@@ -221,7 +221,7 @@ public: ...@@ -221,7 +221,7 @@ public:
}break; }break;
case pibName: 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; }break;
case cropFromTop: case cropFromTop:
{ {
...@@ -431,6 +431,9 @@ public: ...@@ -431,6 +431,9 @@ public:
oAtom.FromValue(pProperty->m_lValue); oAtom.FromValue(pProperty->m_lValue);
//pElemProps->SetAt(CElementProperty::epBrushColor1, oAtom.ToValueProperty()); //pElemProps->SetAt(CElementProperty::epBrushColor1, oAtom.ToValueProperty());
oAtom.ToColor(&pParentShape->m_oBrush.Color1); oAtom.ToColor(&pParentShape->m_oBrush.Color1);
pParentShape->m_oBrush.Type = c_BrushTypeSolid;
break; break;
} }
case NSOfficeDrawing::fillBackColor: case NSOfficeDrawing::fillBackColor:
...@@ -677,7 +680,7 @@ public: ...@@ -677,7 +680,7 @@ public:
{ {
if (pProperty->m_bComplex && 0 < pProperty->m_lValue) 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; //pParentShape->m_oText.m_sText = str;
} }
break; break;
...@@ -687,7 +690,7 @@ public: ...@@ -687,7 +690,7 @@ public:
{ {
if (pProperty->m_bComplex && 0 < pProperty->m_lValue) 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); pParentShape->m_oText.m_oAttributes.m_oFont.Name = std_string2string(str);
//pElemProps->SetAt(CElementProperty::epFontName, (CString)str); //pElemProps->SetAt(CElementProperty::epFontName, (CString)str);
} }
...@@ -756,7 +759,7 @@ public: ...@@ -756,7 +759,7 @@ public:
default: default:
{ {
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1; 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::epFontHorAlign, (DWORD)1);
//pElemProps->SetAt(CElementProperty::epFontVertAlign, (DWORD)0); //pElemProps->SetAt(CElementProperty::epFontVertAlign, (DWORD)0);
break; break;
...@@ -923,9 +926,9 @@ public: ...@@ -923,9 +926,9 @@ public:
if (!bIsFilled) if (!bIsFilled)
{ {
pParentShape->m_oBrush.Type = (int)c_BrushTypeSolid; pParentShape->m_oBrush.Type = c_BrushTypeNoFill;//(int)c_BrushTypeSolid;
pParentShape->m_oBrush.Alpha1 = 0; /*pParentShape->m_oBrush.Alpha1 = 0;
pParentShape->m_oBrush.Alpha2 = 0; pParentShape->m_oBrush.Alpha2 = 0;*/
//pElemProps->SetAt(CElementProperty::epFilled, (DWORD)0); //pElemProps->SetAt(CElementProperty::epFilled, (DWORD)0);
} }
} }
...@@ -1250,10 +1253,24 @@ public: ...@@ -1250,10 +1253,24 @@ public:
if (0 == pElem->m_lPlaceholderType) if (0 == pElem->m_lPlaceholderType)
pElem->m_lPlaceholderID = 1; pElem->m_lPlaceholderID = 1;
else if (15 == pElem->m_lPlaceholderType) else if (15 == pElem->m_lPlaceholderType)//??
pElem->m_lPlaceholderID = -1; pElem->m_lPlaceholderID = -1;
pElem->m_lPlaceholderType = CPPTElement::CorrectPlaceHolderType(pElem->m_lPlaceholderType); 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(""); CString strText = _T("");
...@@ -1326,31 +1343,31 @@ public: ...@@ -1326,31 +1343,31 @@ public:
// . 90 270 0 180 - // . 90 270 0 180 -
// 90 . // 90 .
double dAngle = pShapeElem->m_dRotate; //double dAngle = pShapeElem->m_dRotate;
if (0 <= dAngle) //if (0 <= dAngle)
{ //{
LONG lCount = (LONG)dAngle / 360; // LONG lCount = (LONG)dAngle / 360;
dAngle -= (lCount * 360.0); // dAngle -= (lCount * 360.0);
} //}
else //else
{ //{
LONG lCount = (LONG)dAngle / 360; // LONG lCount = (LONG)dAngle / 360;
dAngle += ((-lCount + 1) * 360.0); // dAngle += ((-lCount + 1) * 360.0);
} //}
if (((dAngle > 45) && (dAngle < 135)) || ((dAngle > 225) && (dAngle < 315))) //if (((dAngle > 45) && (dAngle < 135)) || ((dAngle > 225) && (dAngle < 315)))
{ //{
double dW = pShapeElem->m_rcBounds.GetWidth(); // double dW = pShapeElem->m_rcBounds.GetWidth();
double dH = pShapeElem->m_rcBounds.GetHeight(); // double dH = pShapeElem->m_rcBounds.GetHeight();
double dCx = (pShapeElem->m_rcBounds.left + pShapeElem->m_rcBounds.right) / 2.0; // double dCx = (pShapeElem->m_rcBounds.left + pShapeElem->m_rcBounds.right) / 2.0;
double dCy = (pShapeElem->m_rcBounds.top + pShapeElem->m_rcBounds.bottom) / 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.left = dCx - dH / 2.0;
pShapeElem->m_rcBounds.right = dCx + dH / 2.0; // pShapeElem->m_rcBounds.right = dCx + dH / 2.0;
pShapeElem->m_rcBounds.top = dCy - dW / 2.0; // pShapeElem->m_rcBounds.top = dCy - dW / 2.0;
pShapeElem->m_rcBounds.bottom = dCy + dW / 2.0; // pShapeElem->m_rcBounds.bottom = dCy + dW / 2.0;
} //}
pSlideWrapper->m_mapElements.insert(std::pair<LONG, CElementInfo>(pShapeElem->m_lID, oElementInfo)); pSlideWrapper->m_mapElements.insert(std::pair<LONG, CElementInfo>(pShapeElem->m_lID, oElementInfo));
SetUpTextStyle(strText, pTheme, pLayout, pElem, pThemeWrapper, pSlideWrapper, pSlide); SetUpTextStyle(strText, pTheme, pLayout, pElem, pThemeWrapper, pSlideWrapper, pSlide);
...@@ -1382,6 +1399,8 @@ public: ...@@ -1382,6 +1399,8 @@ public:
} }
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; *ppElement = pElem;
} }
......
...@@ -62,3 +62,41 @@ public: ...@@ -62,3 +62,41 @@ public:
return oWriter.GetXmlString(); return oWriter.GetXmlString();
} }
}; };
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: ...@@ -33,6 +33,49 @@ public:
XmlUtils::CXmlWriter oWriter; XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType); 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.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen)); oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType)); oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
...@@ -40,12 +83,11 @@ public: ...@@ -40,12 +83,11 @@ public:
oWriter.WriteNodeEnd(strName, TRUE, FALSE); oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("Position"), (DWORD)m_nPosition, &oWriter); CDirectory::WriteValueToNode(_T("PlacementID") , (DWORD)m_nPlacementID, &oWriter);
CDirectory::WriteValueToNode(_T("PlacementID"), (DWORD)m_nPlacementID, &oWriter);
CDirectory::WriteValueToNode(_T("Size"), (DWORD)m_nSize, &oWriter);
oWriter.WriteNodeEnd(strName); oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString(); return oWriter.GetXmlString();
} }
}; };
...@@ -599,7 +599,7 @@ namespace NSShapeImageGen ...@@ -599,7 +599,7 @@ namespace NSShapeImageGen
return oInfo; 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; CImageInfo oInfo;
LONG lWidth = (LONG)(dWidth * 96 / 25.4); LONG lWidth = (LONG)(dWidth * 96 / 25.4);
......
...@@ -712,7 +712,7 @@ namespace NSPresentationEditor ...@@ -712,7 +712,7 @@ namespace NSPresentationEditor
void SetDefaultParams() void SetDefaultParams()
{ {
Type = c_BrushTypeSolid; Type = c_BrushTypeNoFill;
Color1 = 0xFFFFFFFF; Color1 = 0xFFFFFFFF;
Alpha1 = 255; Alpha1 = 255;
...@@ -1160,7 +1160,7 @@ namespace NSPresentationEditor ...@@ -1160,7 +1160,7 @@ namespace NSPresentationEditor
m_oTextBrush.Color1 = 0xFF; m_oTextBrush.Color1 = 0xFF;
m_nTextAlignHorizontal = 0; m_nTextAlignHorizontal = 0;
m_nTextAlignVertical = 1; //middle m_nTextAlignVertical = -1; //not set
m_dTextRotate = 0; m_dTextRotate = 0;
} }
CTextAttributes& operator =(const CTextAttributes& oSrc) CTextAttributes& operator =(const CTextAttributes& oSrc)
......
...@@ -46,7 +46,8 @@ namespace NSPresentationEditor ...@@ -46,7 +46,8 @@ namespace NSPresentationEditor
bool m_bFlipH; // bool m_bFlipH; //
bool m_bFlipV; // bool m_bFlipV; //
bool m_bIsBackground; // background?? bool m_bIsBackground;
bool m_bHaveAnchor;
bool m_bIsChangeable; // bool m_bIsChangeable; //
bool m_bIsLayoutElement; // , bool m_bIsLayoutElement; // ,
...@@ -85,6 +86,7 @@ namespace NSPresentationEditor ...@@ -85,6 +86,7 @@ namespace NSPresentationEditor
IElement() IElement()
{ {
m_bIsBackground = false; m_bIsBackground = false;
m_bHaveAnchor = true;
m_bIsChangeable = true; m_bIsChangeable = true;
m_bIsLayoutElement = false; m_bIsLayoutElement = false;
...@@ -148,6 +150,7 @@ namespace NSPresentationEditor ...@@ -148,6 +150,7 @@ namespace NSPresentationEditor
return; return;
pDublicate->m_bIsBackground = m_bIsBackground; pDublicate->m_bIsBackground = m_bIsBackground;
pDublicate->m_bHaveAnchor = m_bHaveAnchor;
pDublicate->m_bIsChangeable = m_bIsChangeable; pDublicate->m_bIsChangeable = m_bIsChangeable;
pDublicate->m_bIsLayoutElement = m_bIsLayoutElement; pDublicate->m_bIsLayoutElement = m_bIsLayoutElement;
......
...@@ -10,6 +10,8 @@ namespace NSPresentationEditor ...@@ -10,6 +10,8 @@ namespace NSPresentationEditor
std::vector<IElement*> m_arElements; std::vector<IElement*> m_arElements;
std::vector<CColor> m_arColorScheme; std::vector<CColor> m_arColorScheme;
std::map<LONG, LONG> m_mapPlaceholders;
bool m_bUseThemeColorScheme; bool m_bUseThemeColorScheme;
// ""( ), // ""( ),
...@@ -92,7 +94,7 @@ namespace NSPresentationEditor ...@@ -92,7 +94,7 @@ namespace NSPresentationEditor
m_bUseThemeColorScheme = true; m_bUseThemeColorScheme = true;
m_bShowMasterShapes = true; m_bShowMasterShapes = true;
m_strLayoutType = _T("title"); m_strLayoutType = _T("obj");
m_bIsBackground = false; m_bIsBackground = false;
m_lWidth = m_lHeight = m_lOriginalWidth = m_lOriginalHeight = 0; m_lWidth = m_lHeight = m_lOriginalWidth = m_lOriginalHeight = 0;
......
...@@ -82,6 +82,7 @@ namespace SVG ...@@ -82,6 +82,7 @@ namespace SVG
const long c_BrushTypePattern = 3009; const long c_BrushTypePattern = 3009;
const long c_BrushTypeHatch1 = 4009; const long c_BrushTypeHatch1 = 4009;
const long c_BrushTypeHatch53 = 4061; const long c_BrushTypeHatch53 = 4061;
const long c_BrushTypeNoFill = 5000;
} }
namespace StringHelpers namespace StringHelpers
......
#pragma once #pragma once
#include "Attributes.h" #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 namespace NSPresentationEditor
{ {
static void CorrectColorPPT(LONG& lSchemeIndex) static void CorrectColorPPT(LONG& lSchemeIndex)
...@@ -125,7 +128,7 @@ namespace NSPresentationEditor ...@@ -125,7 +128,7 @@ namespace NSPresentationEditor
R = 0; R = 0;
G = 0; G = 0;
B = 0; B = 0;
Index = 0; Index = -1;
bPaletteIndex = false; bPaletteIndex = false;
bPaletteRGB = false; bPaletteRGB = false;
...@@ -209,21 +212,51 @@ namespace NSPresentationEditor ...@@ -209,21 +212,51 @@ namespace NSPresentationEditor
R = _R; R = _R;
G = _G; G = _G;
B = _B; B = _B;
Index = 0x00; Index = -1;
} }
void FromValue(DWORD dwValue) void FromValue(DWORD dwValue)
{ {
R = (BYTE)(dwValue); //R = (BYTE)(dwValue);
G = (BYTE)(dwValue >> 8); //G = (BYTE)(dwValue >> 8);
B = (BYTE)(dwValue >> 16); //B = (BYTE)(dwValue >> 16);
Index = (BYTE)(dwValue >> 24); //Index = (BYTE)(dwValue >> 24);
bPaletteIndex = (0x01 == (Index & 0x01)); //bPaletteIndex = (0x01 == (Index & 0x01));
bPaletteRGB = (0x02 == (Index & 0x02)); //bPaletteRGB = (0x02 == (Index & 0x02));
bSystemRGB = (0x04 == (Index & 0x04)); //bSystemRGB = (0x04 == (Index & 0x04));
bSchemeIndex = (0x08 == (Index & 0x08)); //bSchemeIndex = (0x08 == (Index & 0x08));
bSysIndex = (0x10 == (Index & 0x10)); //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) void ToColor(CColor* pColor)
...@@ -232,6 +265,8 @@ namespace NSPresentationEditor ...@@ -232,6 +265,8 @@ namespace NSPresentationEditor
pColor->G = G; pColor->G = G;
pColor->B = B; pColor->B = B;
pColor->m_lSchemeIndex = -1;
if (bSchemeIndex) if (bSchemeIndex)
{ {
pColor->m_lSchemeIndex = R; pColor->m_lSchemeIndex = R;
......
...@@ -58,6 +58,8 @@ void NSPresentationEditor::CPPTXWriter::CreateFile(CPPTUserInfo* pUserInfo ) ...@@ -58,6 +58,8 @@ void NSPresentationEditor::CPPTXWriter::CreateFile(CPPTUserInfo* pUserInfo )
m_pDocument = dynamic_cast<CDocument*>(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_lUnitsHor = 36000 * m_pDocument->m_oInfo.m_lMillimetresHor;
m_pDocument->m_oInfo.m_lUnitsVer = 36000 * m_pDocument->m_oInfo.m_lMillimetresVer; m_pDocument->m_oInfo.m_lUnitsVer = 36000 * m_pDocument->m_oInfo.m_lMillimetresVer;
...@@ -483,9 +485,15 @@ void NSPresentationEditor::CPPTXWriter::WriteThemes() ...@@ -483,9 +485,15 @@ void NSPresentationEditor::CPPTXWriter::WriteThemes()
oStringWriter.WriteString(std::wstring(L"<a:fontScheme name=\"default\"><a:majorFont><a:latin typeface=\"")); oStringWriter.WriteString(std::wstring(L"<a:fontScheme name=\"default\"><a:majorFont><a:latin typeface=\""));
oStringWriter.WriteString(pTheme->m_arFonts[0].Name); 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(std::wstring(L"\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/></a:majorFont>"));
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: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\">\ 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\">\ <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\" ...@@ -670,29 +678,60 @@ accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\"
void NSPresentationEditor::CPPTXWriter::WriteBackground(CStringWriter& oWriter, CRelsGenerator& oRels, CBrush& oBackground) void NSPresentationEditor::CPPTXWriter::WriteBackground(CStringWriter& oWriter, CRelsGenerator& oRels, CBrush& oBackground)
{ {
oWriter.WriteString(std::wstring(L"<p:bg><p:bgPr>"));
if (oBackground.Type == c_BrushTypeTexture) if (oBackground.Type == c_BrushTypeTexture)
{ {
CString strRid = oRels.WriteImage(oBackground.TexturePath); CString strRid = oRels.WriteImage(oBackground.TexturePath);
CString strWrite = _T("<p:bg><p:bgPr><a:blipFill dpi=\"0\" rotWithShape=\"0\"><a:blip r:embed=\"") + strRid + oWriter.WriteString(std::wstring(L"<a:blipFill dpi=\"0\" rotWithShape=\"0\"><a:blip r:embed=\""));
_T("\"/><a:srcRect/><a:stretch><a:fillRect/></a:stretch></a:blipFill><a:effectLst/></p:bgPr></p:bg>"); 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; return;
} }
if (oBackground.Color1.m_lSchemeIndex == -1) if (oBackground.Color1.m_lSchemeIndex == -1)
{ {
CString str = _T(""); CString strColor;
str.Format(_T("<a:solidFill><a:srgbClr val=\"%06x\"/></a:solidFill>"), oBackground.Color1.GetLONG_RGB()); strColor.Format(L"%06x", oBackground.Color1.GetLONG_RGB());
str = _T("<p:bg><p:bgPr>") + str + _T("</p:bgPr></p:bg>");
oWriter.WriteString(str); 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 else
{ {
CString str = _T("<a:solidFill><a:schemeClr val=\"") + CStylesWriter::GetColorInScheme(oBackground.Color1.m_lSchemeIndex) + _T("\"/></a:solidFill>"); oWriter.WriteString(std::wstring(L"<a:solidFill><a:schemeClr val=\""));
str = _T("<p:bg><p:bgPr>") + str + _T("</p:bgPr></p:bg>"); oWriter.WriteString(CStylesWriter::GetColorInScheme(oBackground.Color1.m_lSchemeIndex) + _T("\"/>"));
oWriter.WriteString(str); 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) void NSPresentationEditor::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRelsGenerator& oRels, IElement* pElement, CLayout* pLayout)
......
...@@ -115,6 +115,8 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape() ...@@ -115,6 +115,8 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
{ {
m_oWriter.WriteString(m_pShapeElement->m_oShape.m_strPPTXShape); 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; CBrush* pBrush = &m_pShapeElement->m_oShape.m_oBrush;
...@@ -122,10 +124,12 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape() ...@@ -122,10 +124,12 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
{ {
CString strRid = m_pRels->WriteImage(pBrush->TexturePath); CString strRid = m_pRels->WriteImage(pBrush->TexturePath);
CString strWrite = _T("<a:blipFill dpi=\"0\" rotWithShape=\"1\"><a:blip r:embed=\"") + strRid + 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>"); _T("\"/><a:srcRect/><a:stretch><a:fillRect/></a:stretch></a:blipFill>"));
}
m_oWriter.WriteString(strWrite); else if (pBrush->Type == c_BrushTypeNoFill)
{
m_oWriter.WriteString(std::wstring(L"<a:noFill/>"));
} }
else if (pBrush->Color1.m_lSchemeIndex == -1) else if (pBrush->Color1.m_lSchemeIndex == -1)
{ {
...@@ -195,9 +199,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape() ...@@ -195,9 +199,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
m_oWriter.WriteString(str); m_oWriter.WriteString(str);
} }
} }
m_oWriter.WriteString(std::wstring(L"<a:round/><a:headEnd/><a:tailEnd/></a:ln>")); m_oWriter.WriteString(std::wstring(L"<a:round/><a:headEnd/><a:tailEnd/></a:ln>"));
}
m_oWriter.WriteString(std::wstring(L"</p:spPr>")); m_oWriter.WriteString(std::wstring(L"</p:spPr>"));
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
namespace NSPresentationEditor namespace NSPresentationEditor
{ {
AVSINLINE CString GetPhType(const LONG& lType) AVSINLINE std::wstring GetPhType(const LONG& lType)
{ {
switch (lType) switch (lType)
{ {
...@@ -385,7 +385,8 @@ namespace NSPresentationEditor ...@@ -385,7 +385,8 @@ namespace NSPresentationEditor
m_oWriter.WriteString(std::wstring(L"<p:nvSpPr>")); m_oWriter.WriteString(std::wstring(L"<p:nvSpPr>"));
CString strShapeID = _T(""); 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"\""); m_oWriter.WriteString(std::wstring(L"<p:cNvPr id=\"") + string2std_string(strShapeID) + L"\"");
...@@ -406,16 +407,18 @@ namespace NSPresentationEditor ...@@ -406,16 +407,18 @@ namespace NSPresentationEditor
if (-1 == m_pShapeElement->m_lPlaceholderID) 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(std::wstring(L"<p:nvPr><p:ph type=\"") + GetPhType(m_pShapeElement->m_lPlaceholderType) +_T("\"/></p:nvPr>"));
m_oWriter.WriteString(strPlaceholder);
} }
else else
{ {
CString strIdx; strIdx.Format(_T("%d"), m_pShapeElement->m_lPlaceholderID); 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(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(strPlaceholder); m_oWriter.WriteString(std::wstring(L"/></p:nvPr>"));
} }
} }
else else
...@@ -453,16 +456,13 @@ namespace NSPresentationEditor ...@@ -453,16 +456,13 @@ namespace NSPresentationEditor
if (-1 == m_pImageElement->m_lPlaceholderID) 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(std::wstring(L"<p:nvPr><p:ph type=\"") + GetPhType(m_pImageElement->m_lPlaceholderType) +_T("\"/></p:nvPr>"));
m_oWriter.WriteString(strPlaceholder);
} }
else else
{ {
CString strIdx; strIdx.Format(_T("%d"), m_pImageElement->m_lPlaceholderID); 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 else
...@@ -491,8 +491,12 @@ namespace NSPresentationEditor ...@@ -491,8 +491,12 @@ namespace NSPresentationEditor
m_oWriter.WriteString(std::wstring(L"<a:bodyPr lIns=\"0\" tIns=\"0\" rIns=\"0\" bIns=\"0\"")); 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 == 0 )
if (m_pShapeElement->m_oShape.m_oText.m_oAttributes.m_nTextAlignVertical == 2 ) m_oWriter.WriteString(" anchor=\"b\""); 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"/>")); m_oWriter.WriteString(std::wstring(L"/>"));
CString str3 = _T("<a:lstStyle>"); CString str3 = _T("<a:lstStyle>");
...@@ -615,6 +619,15 @@ namespace NSPresentationEditor ...@@ -615,6 +619,15 @@ namespace NSPresentationEditor
m_oWriter.WriteString(std::wstring(L"</a:pPr>")); 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(); size_t nCountSpans = pParagraph->m_arSpans.size();
for (size_t nSpan = 0; nSpan < nCountSpans; ++nSpan) for (size_t nSpan = 0; nSpan < nCountSpans; ++nSpan)
{ {
...@@ -637,6 +650,8 @@ namespace NSPresentationEditor ...@@ -637,6 +650,8 @@ namespace NSPresentationEditor
} }
} }
if (pParagraph->m_arSpans[nSpan].m_strText.IsEmpty()) continue;
NSPresentationEditor::CTextCFRun* pCF = &pParagraph->m_arSpans[nSpan].m_oRun; NSPresentationEditor::CTextCFRun* pCF = &pParagraph->m_arSpans[nSpan].m_oRun;
bool bIsBr = false; bool bIsBr = false;
...@@ -653,8 +668,14 @@ namespace NSPresentationEditor ...@@ -653,8 +668,14 @@ namespace NSPresentationEditor
} }
else else
{ {
CString strRun1 = _T("<a:r><a:rPr"); if (m_pShapeElement->m_lPlaceholderType == 12)//todooo + date
m_oWriter.WriteString(strRun1); {
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()) if (pCF->Size.is_init())
...@@ -728,7 +749,11 @@ namespace NSPresentationEditor ...@@ -728,7 +749,11 @@ namespace NSPresentationEditor
CString strT2 = _T("</a:t>"); CString strT2 = _T("</a:t>");
m_oWriter.WriteString(strT2); m_oWriter.WriteString(strT2);
if (m_pShapeElement->m_lPlaceholderType == 12)
m_oWriter.WriteString(std::wstring(L"</a:fld>"));
else
m_oWriter.WriteString(std::wstring(L"</a:r>")); m_oWriter.WriteString(std::wstring(L"</a:r>"));
} }
else else
{ {
......
...@@ -270,7 +270,11 @@ public: ...@@ -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()) if (0 == pCF->Typeface.get())
{ {
...@@ -283,10 +287,7 @@ public: ...@@ -283,10 +287,7 @@ public:
oWriter.WriteString(strProp); 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>"); CString strCF2 = _T("</a:defRPr>");
oWriter.WriteString(strCF2); oWriter.WriteString(strCF2);
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
Name="VCLibrarianTool" Name="VCLibrarianTool"
AdditionalDependencies="urlmon.lib" AdditionalDependencies="urlmon.lib"
AdditionalLibraryDirectories="" AdditionalLibraryDirectories=""
IgnoreAllDefaultLibraries="false" IgnoreAllDefaultLibraries="true"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
......
...@@ -65,6 +65,7 @@ const long c_BrushTypeTexture = 3008; ...@@ -65,6 +65,7 @@ const long c_BrushTypeTexture = 3008;
const long c_BrushTypePattern = 3009; const long c_BrushTypePattern = 3009;
const long c_BrushTypeHatch1 = 4009; const long c_BrushTypeHatch1 = 4009;
const long c_BrushTypeHatch53 = 4061; const long c_BrushTypeHatch53 = 4061;
const long c_BrushTypeNoFill = 5000;
const long c_BrushTextureModeStretch = 0; const long c_BrushTextureModeStretch = 0;
const long c_BrushTextureModeTile = 1; 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