Commit f36f627c authored by konovalovsergey's avatar konovalovsergey Committed by Alexander Trofimov

Tile fromPPTY

parent ec139df5
......@@ -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_
\ No newline at end of file
#endif // PPTX_LIMIT_RECTALIGN_INCLUDE_H_
......@@ -409,7 +409,7 @@ namespace PPTX
case 2:
{
tile = new PPTX::Logic::Tile();
pReader->SkipRecord();
tile->fromPPTY(pReader);
break;
}
case 3:
......
......@@ -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_
\ No newline at end of file
#endif // PPTX_LOGIC_TILE_INCLUDE_H_
......@@ -388,7 +388,7 @@ namespace PPTX
case 2:
{
pFill->tile = new PPTX::Logic::Tile();
pReader->SkipRecord();
pFill->tile->fromPPTY(pReader);
break;
}
case 3:
......
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