Tile fromPPTY

This commit is contained in:
konovalovsergey
2016-04-04 13:43:17 +03:00
committed by Alexander Trofimov
parent ec139df569
commit f36f627c4a
4 changed files with 92 additions and 4 deletions

View File

@ -57,8 +57,43 @@ namespace PPTX
return 8;
return 7;
}
virtual void SetBYTECode(const BYTE& src)
{
switch (src)
{
case 0:
m_strValue = _T("b");
break;
case 1:
m_strValue = _T("bl");
break;
case 2:
m_strValue = _T("br");
break;
case 3:
m_strValue = _T("ctr");
break;
case 4:
m_strValue = _T("l");
break;
case 5:
m_strValue = _T("r");
break;
case 6:
m_strValue = _T("t");
break;
case 7:
m_strValue = _T("tl");
break;
case 8:
m_strValue = _T("tr");
break;
default:
break;
}
}
};
} // namespace Limit
} // namespace PPTX
#endif // PPTX_LIMIT_RECTALIGN_INCLUDE_H_
#endif // PPTX_LIMIT_RECTALIGN_INCLUDE_H_

View File

@ -409,7 +409,7 @@ namespace PPTX
case 2:
{
tile = new PPTX::Logic::Tile();
pReader->SkipRecord();
tile->fromPPTY(pReader);
break;
}
case 3:

View File

@ -81,6 +81,59 @@ namespace PPTX
pWriter->WriteLimit2(5, flip);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
case 0:
{
sx = pReader->GetLong();
break;
}
case 1:
{
sy = pReader->GetLong();
break;
}
case 2:
{
tx = pReader->GetLong();
break;
}
case 3:
{
ty = pReader->GetLong();
break;
}
case 4:
{
algn = new Limit::RectAlign();
algn->SetBYTECode(pReader->GetUChar());
break;
}
case 5:
{
flip = new Limit::Flip();
flip->SetBYTECode(pReader->GetUChar());
break;
}
default:
break;
}
}
pReader->Seek(_end_rec);
}
public:
nullable_limit<Limit::RectAlign> algn;
@ -95,4 +148,4 @@ namespace PPTX
} // namespace Logic
} // namespace PPTX
#endif // PPTX_LOGIC_TILE_INCLUDE_H_
#endif // PPTX_LOGIC_TILE_INCLUDE_H_

View File

@ -388,7 +388,7 @@ namespace PPTX
case 2:
{
pFill->tile = new PPTX::Logic::Tile();
pReader->SkipRecord();
pFill->tile->fromPPTY(pReader);
break;
}
case 3: