Commit 7e0749dd authored by ElenaSubbotina's avatar ElenaSubbotina

partly fix bug #18056

parent 9f2324d2
...@@ -1226,7 +1226,8 @@ std::wstring NSPresentationEditor::CShapeWriter::ConvertShape() ...@@ -1226,7 +1226,8 @@ std::wstring NSPresentationEditor::CShapeWriter::ConvertShape()
} }
m_oWriter.WriteString(std::wstring(L">")); m_oWriter.WriteString(std::wstring(L">"));
m_oWriter.WriteString(L"<a:off x=\"" + std::to_wstring((int)m_pShapeElement->m_rcBoundsOriginal.left) + L"\" y=\"" + std::to_wstring((int)m_pShapeElement->m_rcBoundsOriginal.top) + L"\"/>"); m_oWriter.WriteString(L"<a:off x=\"" + std::to_wstring((int)m_pShapeElement->m_rcBoundsOriginal.left) +
L"\" y=\"" + std::to_wstring((int)m_pShapeElement->m_rcBoundsOriginal.top) + L"\"/>");
int width = m_pShapeElement->m_rcBoundsOriginal.right - m_pShapeElement->m_rcBoundsOriginal.left; int width = m_pShapeElement->m_rcBoundsOriginal.right - m_pShapeElement->m_rcBoundsOriginal.left;
int height = m_pShapeElement->m_rcBoundsOriginal.bottom - m_pShapeElement->m_rcBoundsOriginal.top; int height = m_pShapeElement->m_rcBoundsOriginal.bottom - m_pShapeElement->m_rcBoundsOriginal.top;
......
...@@ -871,65 +871,80 @@ public: ...@@ -871,65 +871,80 @@ public:
switch (pProperty->m_ePID) switch (pProperty->m_ePID)
{ {
// здесь просто применяем проперти...
// geometry ----------------------------------------------------
// top, left, right, bottom logic
case NSOfficeDrawing::metroBlob: case NSOfficeDrawing::metroBlob:
{ {
//альтернатива в формате oox //альтернатива в формате oox
//NSFile::CFileBinary f; //NSFile::CFileBinary f;
//f.CreateFileW(L"d:\\test.zip"); //f.CreateFileW(L"d:\\test.zip");
//f.WriteFile(pProperty->m_pOptions, pProperty->m_lValue); //f.WriteFile(pProperty->m_pOptions, pProperty->m_lValue);
//f.CloseFile(); //f.CloseFile();
}break; }break;
case NSOfficeDrawing::geoRight: case NSOfficeDrawing::geoRight:
{ {
if (0 < pProperty->m_lValue) if (0 < pProperty->m_lValue)
pParentShape->m_dWidthLogic = (double)(pProperty->m_lValue); pParentShape->m_dWidthLogic = (double)(pProperty->m_lValue);
}break; }break;
case NSOfficeDrawing::geoBottom: case NSOfficeDrawing::geoBottom:
{ {
if (0 < pProperty->m_lValue) if (0 < pProperty->m_lValue)
pParentShape->m_dHeightLogic = (double)(pProperty->m_lValue); pParentShape->m_dHeightLogic = (double)(pProperty->m_lValue);
}break; }break;
// shapePath
case NSOfficeDrawing::shapePath: case NSOfficeDrawing::shapePath:
{ {
pShape->m_oCustomVML.SetPath((RulesType)pProperty->m_lValue); pShape->m_oCustomVML.SetPath((RulesType)pProperty->m_lValue);
pShape->m_bCustomShape = true; pShape->m_bCustomShape = true;
}break; }break;
// segmentsInfo
case NSOfficeDrawing::pSegmentInfo: case NSOfficeDrawing::pSegmentInfo:
{
if (pProperty->m_bComplex)
{ {
if (pProperty->m_bComplex) pShape->m_oCustomVML.LoadSegments(pProperty);
{ pShape->m_bCustomShape = true;
pShape->m_oCustomVML.LoadSegments(pProperty); }
pShape->m_bCustomShape = true; }break;
}
}break;
// verticesInfo
case NSOfficeDrawing::pVertices: case NSOfficeDrawing::pVertices:
{
if (pProperty->m_bComplex)
{ {
if (pProperty->m_bComplex) pShape->m_oCustomVML.LoadVertices(pProperty);
{ pShape->m_bCustomShape = true;
pShape->m_oCustomVML.LoadVertices(pProperty); }
pShape->m_bCustomShape = true; }break;
} case NSOfficeDrawing::pConnectionSites:
}break; {
if (pProperty->m_bComplex)
{
pShape->m_oCustomVML.LoadConnectionSites(pProperty);
}
}break;
case NSOfficeDrawing::pConnectionSitesDir:
{
if (pProperty->m_bComplex)
{
pShape->m_oCustomVML.LoadConnectionSitesDir(pProperty);
}
}break;
case NSOfficeDrawing::pGuides: case NSOfficeDrawing::pGuides:
{
if (pProperty->m_bComplex/* && pShape->m_eType != sptNotchedCircularArrow*/)
{//Тікбұрышты үшбұрыштарды.ppt - slide 25
pShape->m_oCustomVML.LoadGuides(pProperty);
}
}break;
case NSOfficeDrawing::pInscribe:
{
if (pProperty->m_bComplex)
{ {
if (pProperty->m_bComplex && pShape->m_eType != sptNotchedCircularArrow) pShape->m_oCustomVML.LoadInscribe(pProperty);
{//Тікбұрышты үшбұрыштарды.ppt - slide 25 }
pShape->m_oCustomVML.LoadGuides(pProperty); }break;
}
}break;
case NSOfficeDrawing::pAdjustHandles: case NSOfficeDrawing::pAdjustHandles:
{
if (pProperty->m_bComplex)
{ {
if (pProperty->m_bComplex) pShape->m_oCustomVML.LoadAHs(pProperty);
{ }
pShape->m_oCustomVML.LoadAHs(pProperty); }break;
}
}break;
case NSOfficeDrawing::adjustValue: case NSOfficeDrawing::adjustValue:
case NSOfficeDrawing::adjust2Value: case NSOfficeDrawing::adjust2Value:
case NSOfficeDrawing::adjust3Value: case NSOfficeDrawing::adjust3Value:
......
...@@ -994,10 +994,6 @@ ...@@ -994,10 +994,6 @@
RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\Metric.h" RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\Metric.h"
> >
</File> </File>
<File
RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\Shapes\BaseShape\PPTShape\PPTShape.h"
>
</File>
<File <File
RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\Slide.h" RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\Slide.h"
> >
...@@ -1030,6 +1026,26 @@ ...@@ -1030,6 +1026,26 @@
RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\XmlWriter.h" RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\XmlWriter.h"
> >
</File> </File>
<Filter
Name="ppt shapes"
>
<File
RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\Shapes\BaseShape\PPTShape\customgeomshape.h"
>
</File>
<File
RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\Shapes\BaseShape\PPTShape\elementsettings.h"
>
</File>
<File
RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\Shapes\BaseShape\PPTShape\formula.h"
>
</File>
<File
RelativePath="..\..\..\ASCOfficePPTXFile\Editor\Drawing\Shapes\BaseShape\PPTShape\PPTShape.h"
>
</File>
</Filter>
</Filter> </Filter>
<Filter <Filter
Name="OOXWriter" Name="OOXWriter"
......
...@@ -488,6 +488,9 @@ namespace NSCustomVML ...@@ -488,6 +488,9 @@ namespace NSCustomVML
std::vector<CSegment> m_arSegments; std::vector<CSegment> m_arSegments;
std::vector<CGuide> m_arGuides; std::vector<CGuide> m_arGuides;
std::vector<LONG>* m_pAdjustValues; std::vector<LONG>* m_pAdjustValues;
std::vector<Aggplus::POINT> m_arConnectionSites;
std::vector<Aggplus::RECT> m_arInscribe;
std::vector<double> m_arConnectionSitesDir;
bool m_bIsVerticesPresent; bool m_bIsVerticesPresent;
bool m_bIsPathPresent; bool m_bIsPathPresent;
...@@ -496,7 +499,7 @@ namespace NSCustomVML ...@@ -496,7 +499,7 @@ namespace NSCustomVML
CPen m_oPen; CPen m_oPen;
public: public:
CCustomVML() : m_arVertices(), m_arSegments(), m_arGuides(), m_pAdjustValues(NULL) CCustomVML() : m_pAdjustValues(NULL)
{ {
m_ePath = rtCurveTo/*rtLineTo*/; m_ePath = rtCurveTo/*rtLineTo*/;
...@@ -579,6 +582,63 @@ namespace NSCustomVML ...@@ -579,6 +582,63 @@ namespace NSCustomVML
m_arVertices.push_back(oPoint); m_arVertices.push_back(oPoint);
} }
} }
void LoadConnectionSitesDir(CProperty* pProperty)
{
NSOfficeDrawing::CBinaryReader oReader(pProperty->m_pOptions, pProperty->m_lValue);
m_arConnectionSitesDir.clear();
WORD lCount = (WORD)(pProperty->m_lValue / 4);
for (WORD lIndex = 0; lIndex < lCount; ++lIndex)
{
DWORD v = oReader.ReadLONG();
double val = (double)((WORD)(v >> 16) + ((WORD)(v) / 65536.0));
m_arConnectionSitesDir.push_back(val);
}
}
void LoadConnectionSites(CProperty* pProperty)
{
NSOfficeDrawing::CBinaryReader oReader(pProperty->m_pOptions, pProperty->m_lValue);
m_arConnectionSites.clear();
WORD lCount = (WORD)(pProperty->m_lValue / 8);
if (pProperty->m_bIsTruncated)
{
lCount = (WORD)(pProperty->m_lValue / 4);
}
for (WORD lIndex = 0; lIndex < lCount; ++lIndex)
{
Aggplus::POINT oPoint;
if (pProperty->m_bIsTruncated)
{
oPoint.x = (short)oReader.ReadWORD();
oPoint.y = (short)oReader.ReadWORD();
}
else
{
oPoint.x = oReader.ReadLONG();
oPoint.y = oReader.ReadLONG();
}
LONG lMinF = (LONG)0x80000000;
LONG lMaxF = (LONG)0x8000007F;
if (lMinF <= oPoint.x)
{
int nGuideIndex = (DWORD)oPoint.x - 0x80000000;
bool b = false;
}
if (lMinF <= oPoint.y)
{
int nGuideIndex = (DWORD)oPoint.y - 0x80000000;
bool b = false;
}
m_arConnectionSites.push_back(oPoint);
}
}
void LoadVertices(CProperty* pProperty) void LoadVertices(CProperty* pProperty)
{ {
NSOfficeDrawing::CBinaryReader oReader(pProperty->m_pOptions, pProperty->m_lValue); NSOfficeDrawing::CBinaryReader oReader(pProperty->m_pOptions, pProperty->m_lValue);
...@@ -704,8 +764,38 @@ namespace NSCustomVML ...@@ -704,8 +764,38 @@ namespace NSCustomVML
oInfo.Read(oReader); oInfo.Read(oReader);
m_arGuides.push_back(oInfo); m_arGuides.push_back(oInfo);
} }
} }
void LoadInscribe(CProperty* pProperty)
{
NSOfficeDrawing::CBinaryReader oReader(pProperty->m_pOptions, pProperty->m_lValue);
m_arInscribe.clear();
WORD lCount = (WORD)(pProperty->m_lValue / 16);
if (pProperty->m_bIsTruncated)
{
lCount = (WORD)(pProperty->m_lValue / 8);
}
for (WORD lIndex = 0; lIndex < lCount; ++lIndex)
{
Aggplus::RECT oRect;
if (pProperty->m_bIsTruncated)
{
oRect.left = (short)oReader.ReadWORD();
oRect.right = (short)oReader.ReadWORD();
oRect.top = (short)oReader.ReadWORD();
oRect.bottom = (short)oReader.ReadWORD();
}
else
{
oRect.left = (short)oReader.ReadLONG();
oRect.right = (short)oReader.ReadLONG();
oRect.top = (short)oReader.ReadLONG();
oRect.bottom = (short)oReader.ReadLONG();
}
m_arInscribe.push_back(oRect);
}
}
void LoadAdjusts(LONG lIndex, LONG lValue) void LoadAdjusts(LONG lIndex, LONG lValue)
{ {
if (NULL == m_pAdjustValues) if (NULL == m_pAdjustValues)
......
...@@ -47,10 +47,10 @@ CPPTShape* CPPTShape::CreateByType(PPTShapes::ShapeType type) ...@@ -47,10 +47,10 @@ CPPTShape* CPPTShape::CreateByType(PPTShapes::ShapeType type)
CPPTShape* pShape = NULL; CPPTShape* pShape = NULL;
switch (type) switch (type)
{ {
// msosptNotchedCircularArrow 0x00000064 A value that SHOULD NOT be used. // msosptNotchedCircularArrow 0x00000064 A value that SHOULD NOT be used.
// msosptHostControl 0x000000C9 A value that SHOULD NOT be used. // msosptHostControl 0x000000C9 A value that SHOULD NOT be used.
case sptNotchedCircularArrow: //case sptNotchedCircularArrow:
case sptHostControl: case sptHostControl:
{ pShape = new CPPTShape(); pShape->m_eType = type; break; } { pShape = new CPPTShape(); pShape->m_eType = type; break; }
case 0: { pShape = new CRectangleType(); break; } case 0: { pShape = new CRectangleType(); break; }
......
...@@ -251,6 +251,19 @@ namespace oox ...@@ -251,6 +251,19 @@ namespace oox
case msosptRectangle : return L"rect"; case msosptRectangle : return L"rect";
case msosptEllipse : return L"ellipse"; case msosptEllipse : return L"ellipse";
case msosptLine : return L"line"; case msosptLine : return L"line";
case msosptActionButtonBlank : return L"actionButtonBlank";
case msosptActionButtonHome : return L"actionButtonHome";
case msosptActionButtonHelp : return L"actionButtonHelp";
case msosptActionButtonInformation : return L"actionButtonInformation";
case msosptActionButtonForwardNext : return L"actionButtonForwardNext";
case msosptActionButtonBackPrevious : return L"actionButtonBackPrevious";
case msosptActionButtonEnd : return L"actionButtonEnd";
case msosptActionButtonBeginning : return L"actionButtonBeginning";
case msosptActionButtonReturn : return L"actionButtonReturn";
case msosptActionButtonDocument : return L"actionButtonDocument";
case msosptActionButtonSound : return L"actionButtonSound";
case msosptActionButtonMovie : return L"actionButtonMovie";
case msosptLeftArrow : return L"leftArrow";
} }
return L""; return L"";
} }
......
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