Commit 929dad41 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

PptFormatReader - bug #31886


git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@68837 954022d7-b5bf-4e40-9824-e11837661b57
parent 60d0aba7
......@@ -852,7 +852,12 @@ void NSPresentationEditor::CPPTXWriter::WriteSlide(int nIndexSlide)
oRels.StartSlide(nLayout, nIndexSlide);
}
oWriter.WriteString(std::wstring(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><p:sld xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">"));
oWriter.WriteString(std::wstring(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"));
oWriter.WriteString(std::wstring(L"<p:sld xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\""));
if (!pSlide->m_bShowMasterShapes)
oWriter.WriteString(std::wstring(L" showMasterSp=\"0\""));
oWriter.WriteString(std::wstring(L">"));
oWriter.WriteString(std::wstring(L"<p:cSld"));
if ( pSlide->m_sName.empty() == false)
......
......@@ -538,6 +538,8 @@ void NSPresentationEditor::CShapeWriter::WriteImageInfo()
if (m_pImageElement->m_sName.empty()) m_pImageElement->m_sName = std::wstring(L"Image ") + string2std_string(strShapeID);
if (m_pImageElement->m_bHidden) m_oWriter.WriteString(std::wstring(L" hidden=\"1\""));
m_oWriter.WriteString(std::wstring(L" name=\""));
m_oWriter.WriteStringXML(m_pImageElement->m_sName);
m_oWriter.WriteString(std::wstring(L"\""));
......@@ -591,6 +593,8 @@ void NSPresentationEditor::CShapeWriter::WriteShapeInfo()
if (m_pShapeElement->m_sName.empty()) m_pShapeElement->m_sName = std::wstring(L"Shape ") + string2std_string(strShapeID);
if (m_pShapeElement->m_bHidden) m_oWriter.WriteString(std::wstring(L" hidden=\"1\""));
m_oWriter.WriteString(std::wstring(L" name=\""));
m_oWriter.WriteStringXML(m_pShapeElement->m_sName);
m_oWriter.WriteString(std::wstring(L"\""));
......
......@@ -496,11 +496,13 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
if (pPairLayoutTitle != pTheme->m_mapTitleLayout.end())
{
//
pSlide->m_lLayoutID = pPairLayoutTitle->second;
pLayout = &pTheme->m_arLayouts[pSlide->m_lLayoutID];
pSlide->m_bShowMasterShapes = bMasterObjects;
pSlide->m_lLayoutID = pPairLayoutTitle->second;
pLayout = &pTheme->m_arLayouts[pSlide->m_lLayoutID];
}
else
{
pSlide->m_bShowMasterShapes = true; //???
//
std::map<_UINT64, LONG>::iterator pPairLayoutGeom = pTheme->m_mapGeomToLayout.find(oArraySlideAtoms[0]->m_oLayout.m_hash);
......@@ -607,7 +609,6 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
pRecordSlide->GetRecordsByType(&oArrayShapes, true);
pSlide->m_bShowMasterShapes = bMasterObjects;
pSlide->m_bIsBackground = false;
for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape)
......
......@@ -386,9 +386,8 @@ public:
pElement->m_oBrush.Type = c_BrushTypeTexture;
pElement->m_oBrush.TextureMode = c_BrushTextureModeTile;
}
break;
}
}
}break;
case fillColor:
{
SColorAtom oAtom;
......@@ -401,9 +400,8 @@ public:
if (pElement->m_oBrush.Type == c_BrushTypeNoFill )
pElement->m_oBrush.Type = c_BrushTypeSolid;
break;
}
}break;
case fillBackColor:
{
SColorAtom oAtom;
......@@ -483,7 +481,7 @@ public:
pElement->m_oBrush.ColorsPosition.push_back(std::pair<CColor, double>(color, 100. * FIXED_POINT_unsigned(dwPosition)));
}
}break;
case fNoFillHitTest:
case fillBoolean:
{
BYTE flag1 = (BYTE)(pProperty->m_lValue);
BYTE flag2 = (BYTE)(pProperty->m_lValue >> 16);
......@@ -509,7 +507,7 @@ public:
break;
}
case NSOfficeDrawing::fFillOK:
case NSOfficeDrawing::geoBoolean:
{
BYTE flag1 = (BYTE)(pProperty->m_lValue);
BYTE flag2 = (BYTE)(pProperty->m_lValue >> 8);
......@@ -539,7 +537,7 @@ public:
break;
}
// line --------------------------------------------------------
case fNoLineDrawDash: //Line Style Boolean Properties
case lineBoolean: //Line Style Boolean Properties
{
bool bNoLineDrawDash = GETBIT(pProperty->m_lValue, 0);
bool bLineFillShape = GETBIT(pProperty->m_lValue, 1);
......@@ -778,7 +776,7 @@ public:
{
pElement->m_oShadow.PerspectiveY = ((int)pProperty->m_lValue) ;// EMU_MM;//FIXED_POINT(pProperty->m_lValue);
}break;
case fshadowObscured:
case shadowBoolean:
{
bool fshadowObscured = GETBIT(pProperty->m_lValue, 0);
bool fShadow = GETBIT(pProperty->m_lValue, 1);
......@@ -794,6 +792,45 @@ public:
pElement->m_oShadow.Visible = fshadowObscured;
}
}break;
case groupShapeBoolean:
{
bool fUsefLayoutInCell = GETBIT(pProperty->m_lValue, 0);
bool fUsefIsBullet = GETBIT(pProperty->m_lValue, 1);
bool fUsefStandardHR = GETBIT(pProperty->m_lValue, 2);
bool fUsefNoshadeHR = GETBIT(pProperty->m_lValue, 3);
bool fUsefHorizRule = GETBIT(pProperty->m_lValue, 4);
bool fUsefUserDrawn = GETBIT(pProperty->m_lValue, 5);
bool fUsefAllowOverlap = GETBIT(pProperty->m_lValue, 6);
bool fUsefReallyHidden = GETBIT(pProperty->m_lValue, 7);
bool fUsefScriptAnchor = GETBIT(pProperty->m_lValue, 8);
bool fUsefEditedWrap = GETBIT(pProperty->m_lValue, 9);
bool fUsefBehindDocument = GETBIT(pProperty->m_lValue, 10);
bool fUsefOnDblClickNotify = GETBIT(pProperty->m_lValue, 11);
bool fUsefIsButton = GETBIT(pProperty->m_lValue, 12);
bool fUsefOneD = GETBIT(pProperty->m_lValue, 13);
bool fUsefHidden = GETBIT(pProperty->m_lValue, 14);
bool fUsefPrint = GETBIT(pProperty->m_lValue, 15);
bool fLayoutInCell = fUsefLayoutInCell ? GETBIT(pProperty->m_lValue, 16) : true;
bool fIsBullet = fUsefIsBullet ? GETBIT(pProperty->m_lValue, 17) : false;
bool fStandardHR = fUsefStandardHR ? GETBIT(pProperty->m_lValue, 18) : false;
bool fNoshadeHR = fUsefNoshadeHR ? GETBIT(pProperty->m_lValue, 19) : false;
bool fHorizRule = fUsefHorizRule ? GETBIT(pProperty->m_lValue, 20) : false;
bool fUserDrawn = fUsefUserDrawn ? GETBIT(pProperty->m_lValue, 21) : false;
bool fAllowOverlap = fUsefAllowOverlap ? GETBIT(pProperty->m_lValue, 22) : true;
bool fReallyHidden = fUsefReallyHidden ? GETBIT(pProperty->m_lValue, 23) : false;
bool fScriptAnchor = fUsefScriptAnchor ? GETBIT(pProperty->m_lValue, 24) : false;
bool fEditedWrap = fUsefEditedWrap ? GETBIT(pProperty->m_lValue, 25) : false;
bool fBehindDocument = fUsefBehindDocument ? GETBIT(pProperty->m_lValue, 26) : false;
bool fOnDblClickNotify = fUsefOnDblClickNotify ? GETBIT(pProperty->m_lValue, 27) : false;
bool fIsButton = fUsefIsButton ? GETBIT(pProperty->m_lValue, 28) : false;
bool fOneD = fUsefOneD ? GETBIT(pProperty->m_lValue, 29) : false;
bool fHidden = fUsefHidden ? GETBIT(pProperty->m_lValue, 30) : false;
bool fPrint = fUsefPrint ? GETBIT(pProperty->m_lValue, 31) : true;
pElement->m_bHidden = fHidden || fIsBullet;
//presentation_ticio_20100610.ppt
}break;
default:
break;
}
......@@ -878,58 +915,59 @@ public:
// ...
// geometry ----------------------------------------------------
// top, left, right, bottom logic
case NSOfficeDrawing::metroBlob:
{
// oox
//NSFile::CFileBinary f;
//f.CreateFileW(L"d:\\test.zip");
//f.WriteFile(pProperty->m_pOptions, pProperty->m_lValue);
//f.CloseFile();
}break;
case NSOfficeDrawing::geoRight:
{
if (0 < pProperty->m_lValue)
pParentShape->m_dWidthLogic = (double)(pProperty->m_lValue);
break;
}
pParentShape->m_dWidthLogic = (double)(pProperty->m_lValue);
}break;
case NSOfficeDrawing::geoBottom:
{
if (0 < pProperty->m_lValue)
pParentShape->m_dHeightLogic = (double)(pProperty->m_lValue);
break;
}
pParentShape->m_dHeightLogic = (double)(pProperty->m_lValue);
}break;
// shapePath
case NSOfficeDrawing::shapePath:
{
pShape->m_oCustomVML.SetPath((RulesType)pProperty->m_lValue);
break;
}
pShape->m_oCustomVML.SetPath((RulesType)pProperty->m_lValue);
}break;
// segmentsInfo
case NSOfficeDrawing::pSegmentInfo:
{
if (pProperty->m_bComplex)
{
pShape->m_oCustomVML.LoadSegments(pProperty);
}
break;
}
}
}break;
// verticesInfo
case NSOfficeDrawing::pVertices:
{
if (pProperty->m_bComplex)
{
pShape->m_oCustomVML.LoadVertices(pProperty);
}
break;
}
}
}break;
case NSOfficeDrawing::pGuides:
{
if (pProperty->m_bComplex)
{
pShape->m_oCustomVML.LoadGuides(pProperty);
}
break;
}
}
}break;
case NSOfficeDrawing::pAdjustHandles:
{
if (pProperty->m_bComplex)
{
pShape->m_oCustomVML.LoadAHs(pProperty);
}
break;
}
}
}break;
case NSOfficeDrawing::adjustValue:
case NSOfficeDrawing::adjust2Value:
case NSOfficeDrawing::adjust3Value:
......@@ -949,17 +987,15 @@ public:
else
{
pShape->m_oCustomVML.LoadAdjusts(lIndexAdj, (LONG)pProperty->m_lValue);
}
break;
}
}
}break;
//--------------------------------------------------------------------------------------------------------------------
case lTxid:
{
}break;
case NSOfficeDrawing::dxTextLeft:
{
pParentShape->m_dTextMarginX = (double)pProperty->m_lValue / EMU_MM;
pParentShape->m_dTextMarginX = (double)pProperty->m_lValue / EMU_MM;
}break;
case NSOfficeDrawing::dxTextRight:
{
......@@ -975,8 +1011,7 @@ public:
}break;
case NSOfficeDrawing::WrapText:
{
pParentShape->m_oText.m_lWrapMode = (LONG)pProperty->m_lValue;
pParentShape->m_oText.m_lWrapMode = (LONG)pProperty->m_lValue;
}break;
case NSOfficeDrawing::gtextUNICODE://word art text
{
......@@ -1007,9 +1042,8 @@ public:
{
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);
}
break;
}
}
}break;
case NSOfficeDrawing::gtextSize:
{
pParentShape->m_oText.m_oAttributes.m_oFont.Size = (INT)((pProperty->m_lValue >> 16) & 0x0000FFFF);
......@@ -1092,7 +1126,7 @@ public:
};
break;
}
case NSOfficeDrawing::gtextFStrikethrough:
case NSOfficeDrawing::gtextBoolean:
{
// -
BYTE flag1 = (BYTE)(pProperty->m_lValue);
......@@ -1158,7 +1192,7 @@ public:
break;
}
}break;
case NSOfficeDrawing::fFitTextToShape:
case NSOfficeDrawing::textBoolean:
{
BYTE flag1 = (BYTE)(pProperty->m_lValue);
BYTE flag2 = (BYTE)(pProperty->m_lValue >> 8);
......@@ -1187,7 +1221,6 @@ public:
pParentShape->m_oText.m_bAutoFit = bFitShapeToText;
}break;
default:
break;
}
......
......@@ -134,6 +134,7 @@ namespace NSPresentationEditor
bool m_bIsBackground;
bool m_bHaveAnchor;
bool m_bHidden;
bool m_bIsChangeable; //
......@@ -174,6 +175,7 @@ namespace NSPresentationEditor
{
m_bIsBackground = false;
m_bHaveAnchor = true;
m_bHidden = false;
m_bIsChangeable = true;
......@@ -246,6 +248,7 @@ namespace NSPresentationEditor
pDublicate->m_bIsBackground = m_bIsBackground;
pDublicate->m_bHaveAnchor = m_bHaveAnchor;
pDublicate->m_bHidden = m_bHidden;
pDublicate->m_bIsChangeable = m_bIsChangeable;
......
......@@ -1034,11 +1034,7 @@ namespace NSOfficeDrawing
txdir=139,
ccol=140,
dzColMargin=141,
fSelectText=187,
fAutoTextMargin=188,
fRotateText=189,
fFitShapeToText=190,
fFitTextToShape=191,
textBoolean=191,
//GeoText
gtextUNICODE=192,
......@@ -1049,21 +1045,7 @@ namespace NSOfficeDrawing
gtextFont=197,
gtextCSSFont=198,
gtextFReverseRows=240,
fGtext=241,
gtextFVertical=242,
gtextFKern=243,
gtextFTight=244,
gtextFStretch=245,
gtextFShrinkFit=246,
gtextFBestFit=247,
gtextFNormalize=248,
gtextFDxMeasure=249,
gtextFBold=250,
gtextFItalic=251,
gtextFUnderline=252,
gtextFShadow=253,
gtextFSmallcaps=254,
gtextFStrikethrough=255,
gtextBoolean=255,
//BLIP
cropFromTop=256,
......@@ -1120,13 +1102,7 @@ namespace NSOfficeDrawing
pInscribe=343,
cxk=344,
pFragments=345,
fColumnLineOK=377,
fShadowOK=378,
f3DOK=379,
fLineOK=380,
fGtextOK=381,
fFillShadeShapeOK=382,
fFillOK=383,
geoBoolean=383,
//Fill Style
fillType=384,
......@@ -1164,7 +1140,7 @@ namespace NSOfficeDrawing
fHitTestFill=444,
fillShape=445,
fillUseRect=446,
fNoFillHitTest=447,
fillBoolean=447,
//Line Style
lineColor=448,
......@@ -1191,13 +1167,7 @@ namespace NSOfficeDrawing
lineEndArrowLength=469,
lineJoinStyle=470,
lineEndCapStyle=471,
fInsetPen=505,
fInsetPenOK=506,
fArrowheadsOK=507,
fLine=508,
fHitTestLine=509,
lineFillShape=510,
fNoLineDrawDash=511,
lineBoolean=511,
//Shadow Style
shadowType=512,
......@@ -1218,8 +1188,7 @@ namespace NSOfficeDrawing
shadowWeight=527,
shadowOriginX=528,
shadowOriginY=529,
fShadow=574,
fshadowObscured=575,
shadowBoolean=575,
//Perspective Style
perspectiveType=576,
......@@ -1234,7 +1203,7 @@ namespace NSOfficeDrawing
perspectiveWeight=585,
perspectiveOriginX=586,
perspectiveOriginY=587,
fPerspective=639,
perspectiveBoolean=639,
//3D Object
c3DSpecularAmt=640,
......@@ -1363,15 +1332,7 @@ namespace NSOfficeDrawing
wzAccessBlob=936,
metroBlob=937,
dhgt=938,
fLayoutInCell=944,
fIsBullet=945,
fStandardHR=946,
fNoshadeHR=947,
fHorizRule=948,
fUserDrawn=949,
fAllowOverlap=950,
fReallyHidden=951,
fScriptAnchor=952,
groupShapeBoolean=959,
//Unknown HTML
wzLineId=1026,
......
......@@ -25,7 +25,7 @@ public:
AddGuide(_T("sum 10800 0 @9"));
AddGuide(_T("sum @9 10800 0"));
AddGuide(_T("prod #0 9598 32768"));
AddGuide(_T(" sum 21600 0 @12"));
AddGuide(_T("sum 21600 0 @12"));
AddGuide(_T("ellipse @13 21600 10800"));
AddGuide(_T("sum 10800 0 @14"));
AddGuide(_T("sum @14 10800 0"));
......
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