This commit is contained in:
Elena.Subbotina
2023-11-13 21:26:49 +03:00
parent 499509ed6b
commit 31930c5279
17 changed files with 3440 additions and 3425 deletions

View File

@ -36,25 +36,25 @@ namespace PPT
{
enum PointPathType
{
etMoveTo = 0,
etLineTo = 1,
etCurveTo = 2,
etCloseLoop = 3,
etHorzTo = 4,
etVertTo = 5,
etEnd = 6
etMoveTo = 0,
etLineTo = 1,
etCurveTo = 2,
etCloseLoop = 3,
etHorzTo = 4,
etVertTo = 5,
etEnd = 6
// add arc, c3, c2 ????
};
enum EffectType
{
FadeInType = 1,
FadeExitType = 2,
EmphasisEffect = 3,
MotionEffect = 4,
VerbEffect = 5,
MediaCallEffect = 6
FadeInType = 1,
FadeExitType = 2,
EmphasisEffect = 3,
MotionEffect = 4,
VerbEffect = 5,
MediaCallEffect = 6
};
class CMotionPath
@ -65,157 +65,157 @@ namespace PPT
{
int Type;
double X [ 4 ];
double Y [ 4 ];
double X[4];
double Y[4];
};
public:
// inline bool FromStr (const std::wstring& Str)
// {
// m_Points.clear();
// inline bool FromStr (const std::wstring& Str)
// {
// m_Points.clear();
// int To = 0;
// std::wstring Tokens = _T(" mlczevh");
// int To = 0;
// std::wstring Tokens = L" mlczevh");
// double dEndX = 0.0;
// double dEndY = 0.0;
// double dEndX = 0.0;
// double dEndY = 0.0;
// PathPoint oPoint;
// PathPoint oPoint;
// for ( int i = 0; i < Str.length (); ++i )
// {
// if ( _T('m') == Str [ i ] ) oPoint.Type = etMoveTo;
// else if ( _T('l') == Str [ i ] ) oPoint.Type = etLineTo;
// else if ( _T('c') == Str [ i ] ) oPoint.Type = etCurveTo;
// else if ( _T('z') == Str [ i ] ) oPoint.Type = etCloseLoop; // This action requires no points.
// else if ( _T('e') == Str [ i ] ) oPoint.Type = etEnd; // This action requires no points.
// else if ( _T('h') == Str [ i ] ) oPoint.Type = etHorzTo; //
// else if ( _T('v') == Str [ i ] ) oPoint.Type = etVertTo; //
// else if ( _T('M') == Str [ i ] ) oPoint.Type = etMoveTo;
// else if ( _T('L') == Str [ i ] ) oPoint.Type = etLineTo;
// else if ( _T('C') == Str [ i ] ) oPoint.Type = etCurveTo;
// else if ( _T('Z') == Str [ i ] ) oPoint.Type = etCloseLoop;
// else if ( _T('E') == Str [ i ] ) oPoint.Type = etEnd;
// else continue;
// for ( int i = 0; i < Str.length (); ++i )
// {
// if ( _T('m') == Str [ i ] ) oPoint.Type = etMoveTo;
// else if ( _T('l') == Str [ i ] ) oPoint.Type = etLineTo;
// else if ( _T('c') == Str [ i ] ) oPoint.Type = etCurveTo;
// else if ( _T('z') == Str [ i ] ) oPoint.Type = etCloseLoop; // This action requires no points.
// else if ( _T('e') == Str [ i ] ) oPoint.Type = etEnd; // This action requires no points.
// else if ( _T('h') == Str [ i ] ) oPoint.Type = etHorzTo; //
// else if ( _T('v') == Str [ i ] ) oPoint.Type = etVertTo; //
// else if ( _T('M') == Str [ i ] ) oPoint.Type = etMoveTo;
// else if ( _T('L') == Str [ i ] ) oPoint.Type = etLineTo;
// else if ( _T('C') == Str [ i ] ) oPoint.Type = etCurveTo;
// else if ( _T('Z') == Str [ i ] ) oPoint.Type = etCloseLoop;
// else if ( _T('E') == Str [ i ] ) oPoint.Type = etEnd;
// else continue;
// To = i + 1;
// To = i + 1;
// if ( etMoveTo == oPoint.Type )
// {
// oPoint.X [ 0 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 0 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// if ( etMoveTo == oPoint.Type )
// {
// oPoint.X [ 0 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 0 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// dEndX = oPoint.X [ 0 ];
// dEndY = oPoint.Y [ 0 ];
// dEndX = oPoint.X [ 0 ];
// dEndY = oPoint.Y [ 0 ];
// continue;
// }
// continue;
// }
// if ( etLineTo == oPoint.Type )
// {
// oPoint.X [ 0 ] = dEndX;
// oPoint.Y [ 0 ] = dEndY;
// if ( etLineTo == oPoint.Type )
// {
// oPoint.X [ 0 ] = dEndX;
// oPoint.Y [ 0 ] = dEndY;
// oPoint.X [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.X [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// dEndX = oPoint.X [ 1 ];
// dEndY = oPoint.Y [ 1 ];
// }
// dEndX = oPoint.X [ 1 ];
// dEndY = oPoint.Y [ 1 ];
// }
// if ( etHorzTo == oPoint.Type )
// {
// oPoint.Type = etLineTo;
// if ( etHorzTo == oPoint.Type )
// {
// oPoint.Type = etLineTo;
// oPoint.X [ 0 ] = dEndX;
// oPoint.Y [ 0 ] = dEndY;
// oPoint.X [ 0 ] = dEndX;
// oPoint.Y [ 0 ] = dEndY;
// oPoint.X [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 1 ] = oPoint.Y [ 0 ];
// oPoint.X [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 1 ] = oPoint.Y [ 0 ];
// dEndX = oPoint.X [ 1 ];
// dEndY = oPoint.Y [ 1 ];
// }
// dEndX = oPoint.X [ 1 ];
// dEndY = oPoint.Y [ 1 ];
// }
// if ( etVertTo == oPoint.Type )
// {
// oPoint.Type = etLineTo;
// if ( etVertTo == oPoint.Type )
// {
// oPoint.Type = etLineTo;
// oPoint.X [ 0 ] = dEndX;
// oPoint.Y [ 0 ] = dEndY;
// oPoint.X [ 0 ] = dEndX;
// oPoint.Y [ 0 ] = dEndY;
// oPoint.X [ 1 ] = oPoint.X [ 0 ];
// oPoint.Y [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.X [ 1 ] = oPoint.X [ 0 ];
// oPoint.Y [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// dEndX = oPoint.X [ 1 ];
// dEndY = oPoint.Y [ 1 ];
// }
// dEndX = oPoint.X [ 1 ];
// dEndY = oPoint.Y [ 1 ];
// }
// if ( etCurveTo == oPoint.Type )
// {
// oPoint.X [ 0 ] = dEndX;
// oPoint.Y [ 0 ] = dEndY;
// if ( etCurveTo == oPoint.Type )
// {
// oPoint.X [ 0 ] = dEndX;
// oPoint.Y [ 0 ] = dEndY;
// oPoint.X [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.X [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.X [ 2 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 2 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.X [ 2 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 2 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.X [ 3 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 3 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.X [ 3 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 3 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// dEndX = oPoint.X [ 3 ];
// dEndY = oPoint.Y [ 3 ];
// }
// dEndX = oPoint.X [ 3 ];
// dEndY = oPoint.Y [ 3 ];
// }
// m_Points.push_back ( oPoint );
// }
// m_Points.push_back ( oPoint );
// }
// return ( m_Points.size() >= 2 );
// }
// return ( m_Points.size() >= 2 );
// }
// inline std::wstring ToXml (double dW, double dH)
// {
// std::wstring Xml;
// inline std::wstring ToXml (double dW, double dH)
// {
// std::wstring Xml;
// for ( long i = 0; i < (long)m_Points.size(); ++i )
// {
// std::wstring Fmt;
// for ( long i = 0; i < (long)m_Points.size(); ++i )
// {
// std::wstring Fmt;
// if ( etMoveTo == m_Points [ i ].Type )
// {
// Fmt.Format ( _T("<move x = '%f' y = '%f' />"),
// m_Points [ i ].X [ 0 ] * dW, m_Points [ i ].Y [ 0 ] * dH );
// }
// if ( etMoveTo == m_Points [ i ].Type )
// {
// Fmt.Format ( L"<move x = '%f' y = '%f' />"),
// m_Points [ i ].X [ 0 ] * dW, m_Points [ i ].Y [ 0 ] * dH );
// }
// if ( etLineTo == m_Points [ i ].Type )
// {
// Fmt.Format ( _T("<line x0 = '%f' y0 = '%f' x1 = '%f' y1 = '%f' />"),
// m_Points [ i ].X [ 0 ] * dW, m_Points [ i ].Y [ 0 ] * dH,
// m_Points [ i ].X [ 1 ] * dW, m_Points [ i ].Y [ 1 ] * dH );
// }
// if ( etLineTo == m_Points [ i ].Type )
// {
// Fmt.Format ( L"<line x0 = '%f' y0 = '%f' x1 = '%f' y1 = '%f' />"),
// m_Points [ i ].X [ 0 ] * dW, m_Points [ i ].Y [ 0 ] * dH,
// m_Points [ i ].X [ 1 ] * dW, m_Points [ i ].Y [ 1 ] * dH );
// }
// if ( etCurveTo == m_Points [ i ].Type )
// {
// Fmt.Format ( _T("<curve x0 = '%f' y0 = '%f' x1 = '%f' y1 = '%f' x2 = '%f' y2 = '%f' x3 = '%f' y3 = '%f' />"),
// m_Points [ i ].X [ 0 ] * dW, m_Points [ i ].Y [ 0 ] * dH,
// m_Points [ i ].X [ 1 ] * dW, m_Points [ i ].Y [ 1 ] * dH,
// m_Points [ i ].X [ 2 ] * dW, m_Points [ i ].Y [ 2 ] * dH,
// m_Points [ i ].X [ 3 ] * dW, m_Points [ i ].Y [ 3 ] * dH );
// }
// if ( etCurveTo == m_Points [ i ].Type )
// {
// Fmt.Format ( L"<curve x0 = '%f' y0 = '%f' x1 = '%f' y1 = '%f' x2 = '%f' y2 = '%f' x3 = '%f' y3 = '%f' />"),
// m_Points [ i ].X [ 0 ] * dW, m_Points [ i ].Y [ 0 ] * dH,
// m_Points [ i ].X [ 1 ] * dW, m_Points [ i ].Y [ 1 ] * dH,
// m_Points [ i ].X [ 2 ] * dW, m_Points [ i ].Y [ 2 ] * dH,
// m_Points [ i ].X [ 3 ] * dW, m_Points [ i ].Y [ 3 ] * dH );
// }
// Xml += Fmt;
// }
// Xml += Fmt;
// }
// return Xml;
// }
// return Xml;
// }
inline std::wstring ToStr ()
inline std::wstring ToStr()
{
return _T("");
return L"";
}
private:
@ -228,35 +228,35 @@ namespace PPT
public:
CAnimationSimple()
{
m_nRefID = -1;
m_nRefID = -1;
m_nBeginTime = 0;
m_nDuration = 0;
m_nBeginTime = 0;
m_nDuration = 0;
m_nEffectID = 0;
m_nEffectDir = 0;
m_nEffectType = 0;
m_nEffectNodeType = 0;
m_nEffectID = 0;
m_nEffectDir = 0;
m_nEffectType = 0;
m_nEffectNodeType = 0;
m_dSX = 1.0;
m_dSY = 1.0;
m_dSX = 1.0;
m_dSY = 1.0;
m_dRotateAngle = 0.0;
m_dRotateAngle = 0.0;
m_dTransparency = 1.0;
m_dTransparency = 1.0;
m_nSchemeColor = 0;
m_nColorTo = 0;
m_nSchemeColor = 0;
m_nColorTo = 0;
m_dTimeAccel = 0.0;
m_dTimeDecel = 0.0;
m_dTimeAccel = 0.0;
m_dTimeDecel = 0.0;
m_bIgnoreShape = false;
m_nTextSequence = -1;
m_bRemoveEmptyBlocks = false;
m_bIgnoreShape = false;
m_nTextSequence = -1;
m_bRemoveEmptyBlocks = false;
m_nMediaCMD = -1;
m_nMediaCMD = -1;
}
public:
@ -308,8 +308,8 @@ namespace PPT
}
CAnimationInfo& operator=(const CAnimationInfo& oSrc)
{
m_dSlideWidth = oSrc.m_dSlideWidth;
m_dSlideHeight = oSrc.m_dSlideHeight;
m_dSlideWidth = oSrc.m_dSlideWidth;
m_dSlideHeight = oSrc.m_dSlideHeight;
m_arAnimations.insert(m_arAnimations.end(), oSrc.m_arAnimations.begin(), oSrc.m_arAnimations.end());
return *this;
@ -323,133 +323,133 @@ namespace PPT
}
// std::wstring ToXml(const double& dStartTime, const double& dEndTime, bool bIgnore = false)
// {
// std::wstring baseXML;
// baseXML.Format ( _T("<animations width = '%f' height = '%f'>"), m_dSlideWidth, m_dSlideHeight );
// std::wstring ToXml(const double& dStartTime, const double& dEndTime, bool bIgnore = false)
// {
// std::wstring baseXML;
// baseXML.Format ( L"<animations width = '%f' height = '%f'>"), m_dSlideWidth, m_dSlideHeight );
// std::wstring Source;
// std::wstring Source;
// for ( long i = 0; i < (long)m_arAnimations.size(); ++i )
// {
// CAnimationSimple* pEffect = &m_arAnimations[i];
// if (NULL==pEffect)
// continue;
// for ( long i = 0; i < (long)m_arAnimations.size(); ++i )
// {
// CAnimationSimple* pEffect = &m_arAnimations[i];
// if (NULL==pEffect)
// continue;
// if (bIgnore)
// {
// if (pEffect->m_bIgnoreShape)
// continue;
// }
// if (bIgnore)
// {
// if (pEffect->m_bIgnoreShape)
// continue;
// }
// double dEffectBegin = dStartTime + pEffect->m_nBeginTime;
// double dEffectBegin = dStartTime + pEffect->m_nBeginTime;
// m_oQuery.clear ();
// m_oQuery.clear ();
// m_oQuery.push_back ( _T(" id = '") + PPT::ToString (pEffect->m_nEffectID) + _T("' "));
// m_oQuery.push_back ( _T(" type = '") + PPT::ToString (pEffect->m_nEffectType) + _T("' "));
// m_oQuery.push_back ( _T(" dir = '") + PPT::ToString (pEffect->m_nEffectDir) + _T("' "));
// m_oQuery.push_back ( L" id = '") + PPT::ToString (pEffect->m_nEffectID) + L"' "));
// m_oQuery.push_back ( L" type = '") + PPT::ToString (pEffect->m_nEffectType) + L"' "));
// m_oQuery.push_back ( L" dir = '") + PPT::ToString (pEffect->m_nEffectDir) + L"' "));
// m_oQuery.push_back ( _T(" begin = '") + PPT::ToString (dEffectBegin) + _T("' "));
// m_oQuery.push_back ( _T(" dur = '") + PPT::ToString (pEffect->m_nDuration) + _T("' "));
// m_oQuery.push_back ( _T(" accel = '") + PPT::ToString (pEffect->m_dTimeAccel) + _T("' "));
// m_oQuery.push_back ( _T(" decel = '") + PPT::ToString (pEffect->m_dTimeDecel) + _T("' "));
// m_oQuery.push_back ( L" begin = '") + PPT::ToString (dEffectBegin) + L"' "));
// m_oQuery.push_back ( L" dur = '") + PPT::ToString (pEffect->m_nDuration) + L"' "));
// m_oQuery.push_back ( L" accel = '") + PPT::ToString (pEffect->m_dTimeAccel) + L"' "));
// m_oQuery.push_back ( L" decel = '") + PPT::ToString (pEffect->m_dTimeDecel) + L"' "));
// m_oQuery.push_back ( _T(" sx = '") + PPT::ToString (pEffect->m_dSX) + _T("' "));
// m_oQuery.push_back ( _T(" sy = '") + PPT::ToString (pEffect->m_dSY) + _T("' "));
// m_oQuery.push_back ( _T(" alpha = '") + PPT::ToString (pEffect->m_dTransparency) + _T("' "));
// m_oQuery.push_back ( L" sx = '") + PPT::ToString (pEffect->m_dSX) + L"' "));
// m_oQuery.push_back ( L" sy = '") + PPT::ToString (pEffect->m_dSY) + L"' "));
// m_oQuery.push_back ( L" alpha = '") + PPT::ToString (pEffect->m_dTransparency) + L"' "));
// m_oQuery.push_back ( _T(" angle = '") + PPT::ToString (pEffect->m_dRotateAngle) + _T("' "));
// m_oQuery.push_back ( _T(" color = '") + PPT::ToString (pEffect->m_nColorTo) + _T("' "));
// m_oQuery.push_back ( L" angle = '") + PPT::ToString (pEffect->m_dRotateAngle) + L"' "));
// m_oQuery.push_back ( L" color = '") + PPT::ToString (pEffect->m_nColorTo) + L"' "));
// m_oQuery.push_back ( _T(" block = '") + PPT::ToString (pEffect->m_nTextSequence) + _T("' "));
// m_oQuery.push_back ( _T(" removeemptyblocks = '") + PPT::ToString (pEffect->m_bRemoveEmptyBlocks) + _T("' "));
// m_oQuery.push_back ( L" block = '") + PPT::ToString (pEffect->m_nTextSequence) + L"' "));
// m_oQuery.push_back ( L" removeemptyblocks = '") + PPT::ToString (pEffect->m_bRemoveEmptyBlocks) + L"' "));
// std::wstring Effect;
// std::wstring Effect;
// if (MotionEffect == pEffect->m_nEffectType || pEffect->m_MotionPath.length())
// {
// CMotionPath oPath;
// if ( oPath.FromStr ( pEffect->m_MotionPath ) )
// {
// Effect.Format ( _T("<animateMotion %s >%s</animateMotion>"), FormatXml (), oPath.ToXml(1.0,1.0));
// Source += Effect;
// }
// }
// if (MotionEffect == pEffect->m_nEffectType || pEffect->m_MotionPath.length())
// {
// CMotionPath oPath;
// if ( oPath.FromStr ( pEffect->m_MotionPath ) )
// {
// Effect.Format ( L"<animateMotion %s >%s</animateMotion>"), FormatXml (), oPath.ToXml(1.0,1.0));
// Source += Effect;
// }
// }
// if ( FadeInType == pEffect->m_nEffectType )
// {
// Effect.Format ( _T("<animateFadeIn %s />"), FormatXml ());
// Source += Effect;
// }
// if ( FadeInType == pEffect->m_nEffectType )
// {
// Effect.Format ( L"<animateFadeIn %s />"), FormatXml ());
// Source += Effect;
// }
// if ( FadeExitType == pEffect->m_nEffectType )
// {
// Effect.Format ( _T("<animateFadeExit %s />"), FormatXml ());
// Source += Effect;
// }
// if ( FadeExitType == pEffect->m_nEffectType )
// {
// Effect.Format ( L"<animateFadeExit %s />"), FormatXml ());
// Source += Effect;
// }
// if (EmphasisEffect == pEffect->m_nEffectType )
// {
// if (6 == pEffect->m_nEffectID) // GrowAndShrink Effect
// {
// Effect.Format ( _T("<animateScale %s />"), FormatXml ());
// }
// else if (8 == pEffect->m_nEffectID || 32 == pEffect->m_nEffectID) // Spin Effect || Teeter Effect
// {
// Effect.Format ( _T("<animateRotate %s />"), FormatXml ());
// }
// else if (9 == pEffect->m_nEffectID || 35 == pEffect->m_nEffectID) // Blink - 36 - мигание
// {
// Effect.Format ( _T("<animateAlpha %s />"), FormatXml ());
// }
// else if (26 == pEffect->m_nEffectID) // FlashBulb Effect ( Пульсация )
// {
// Effect.Format ( _T("<animateAlpha %s />"), FormatXml ());
// Source += Effect;
// if (EmphasisEffect == pEffect->m_nEffectType )
// {
// if (6 == pEffect->m_nEffectID) // GrowAndShrink Effect
// {
// Effect.Format ( L"<animateScale %s />"), FormatXml ());
// }
// else if (8 == pEffect->m_nEffectID || 32 == pEffect->m_nEffectID) // Spin Effect || Teeter Effect
// {
// Effect.Format ( L"<animateRotate %s />"), FormatXml ());
// }
// else if (9 == pEffect->m_nEffectID || 35 == pEffect->m_nEffectID) // Blink - 36 - мигание
// {
// Effect.Format ( L"<animateAlpha %s />"), FormatXml ());
// }
// else if (26 == pEffect->m_nEffectID) // FlashBulb Effect ( Пульсация )
// {
// Effect.Format ( L"<animateAlpha %s />"), FormatXml ());
// Source += Effect;
// Effect.Format ( _T("<animateScale %s />"), FormatXml ());
// Source += Effect;
// Effect.Format ( L"<animateScale %s />"), FormatXml ());
// Source += Effect;
// continue;
// }
// else if (27 == pEffect->m_nEffectID // Flicker (÷ветовая пульсация)
// || 1 == pEffect->m_nEffectID // ChangeFillColor - fill color
// || 3 == pEffect->m_nEffectID // ChangeFillColor - font color
// || 7 == pEffect->m_nEffectID // ChangeFillColor - fill lines
// || 19 == pEffect->m_nEffectID) // ColorBlend - object fill color
// {
// Effect.Format ( _T("<animateColor %s />"), FormatXml ());
// }
// else
// {
// Effect.Format ( _T("<animateEmphasis %s />"), FormatXml ());
// }
// continue;
// }
// else if (27 == pEffect->m_nEffectID // Flicker (÷ветовая пульсация)
// || 1 == pEffect->m_nEffectID // ChangeFillColor - fill color
// || 3 == pEffect->m_nEffectID // ChangeFillColor - font color
// || 7 == pEffect->m_nEffectID // ChangeFillColor - fill lines
// || 19 == pEffect->m_nEffectID) // ColorBlend - object fill color
// {
// Effect.Format ( L"<animateColor %s />"), FormatXml ());
// }
// else
// {
// Effect.Format ( L"<animateEmphasis %s />"), FormatXml ());
// }
// Source += Effect;
// }
// Source += Effect;
// }
// if (MediaCallEffect == pEffect->m_nEffectType )
// {
// std::wstring sTime;
// sTime.Format(_T(" begin='%f' dur='%f' accel='%f' decel='%f' "), dStartTime + pEffect->m_nBeginTime, pEffect->m_nDuration, pEffect->m_dTimeAccel, pEffect->m_dTimeDecel);
// if (MediaCallEffect == pEffect->m_nEffectType )
// {
// std::wstring sTime;
// sTime.Format(L" begin='%f' dur='%f' accel='%f' decel='%f' "), dStartTime + pEffect->m_nBeginTime, pEffect->m_nDuration, pEffect->m_dTimeAccel, pEffect->m_dTimeDecel);
// Effect.Format(_T("<mediaCall id='%d' %s event='%d' />"), pEffect->m_nEffectID, sTime, pEffect->m_nMediaCMD);
// Source += Effect;
// }
// }
// Effect.Format(L"<mediaCall id='%d' %s event='%d' />"), pEffect->m_nEffectID, sTime, pEffect->m_nMediaCMD);
// Source += Effect;
// }
// }
// if (bIgnore)
// {
// if (0 == Source.length())
// return _T("");
// }
// if (bIgnore)
// {
// if (0 == Source.length())
// return L"");
// }
// baseXML += Source;
// baseXML += std::wstring(_T("</animations>"));
// baseXML += Source;
// baseXML += std::wstring(L"</animations>"));
// return baseXML;
// }
// return baseXML;
// }
};
}

File diff suppressed because it is too large Load Diff

View File

@ -108,7 +108,7 @@ namespace PPT
{
if (NULL == pAudioElem)
{
m_strFile = _T("");
m_strFile = L"";
m_dStartTime = 0.0;
m_dEndTime = -1.0;
@ -149,7 +149,7 @@ namespace PPT
public:
void CalculateDuration()
{
if (0.0 < m_dAudioDuration || _T("") == m_strFile)
if (0.0 < m_dAudioDuration || L"" == m_strFile)
return;
}
};
@ -260,7 +260,7 @@ namespace PPT
std::wstring GetAudioOverlay()
{
std::wstring strRes = _T("");
std::wstring strRes;
size_t nCount = m_arParts.size();

View File

@ -34,18 +34,18 @@
#include "../../Common/Vml/PPTShape/Ppt2PptxShapeConverter.h"
#ifndef DISABLE_FILE_DOWNLOADER
#include "../../../Common/Network/FileTransporter/include/FileTransporter.h"
#include "../../../DesktopEditor/raster/ImageFileFormatChecker.h"
#include "../../../Common/Network/FileTransporter/include/FileTransporter.h"
#include "../../../DesktopEditor/raster/ImageFileFormatChecker.h"
#endif
std::wstring PPT::CImageElement::DownloadImage(const std::wstring& strFile)
{
#ifndef DISABLE_FILE_DOWNLOADER
NSNetwork::NSFileTransport::CFileDownloader oDownloader(strFile, true);
if ( oDownloader.DownloadSync() )
NSNetwork::NSFileTransport::CFileDownloader oDownloader(strFile, true);
if (oDownloader.DownloadSync())
{
m_strImageFileName = oDownloader.GetFilePath();
CImageFileFormatChecker checker;
if (false == checker.isImageFile(m_strImageFileName))
{
@ -53,7 +53,7 @@ std::wstring PPT::CImageElement::DownloadImage(const std::wstring& strFile)
}
}
#endif
return m_strImageFileName;
return m_strImageFileName;
}
void PPT::CShapeElement::CalculateColor(CColor& oColor, CSlide* pSlide, CTheme* pTheme, CLayout* pLayout)
{
@ -61,11 +61,11 @@ void PPT::CShapeElement::CalculateColor(CColor& oColor, CSlide* pSlide, CTheme*
if (-1 == oColor.m_lSchemeIndex)
return;
std::vector<CColor>* pArray = NULL;
std::vector<CColor>* pArray = NULL;
if (pTheme) pArray = &pTheme->m_arColorScheme;
if (pTheme) pArray = &pTheme->m_arColorScheme;
if ((NULL != pLayout) && (!pLayout->m_bUseThemeColorScheme))
if ((NULL != pLayout) && (!pLayout->m_bUseThemeColorScheme))
pArray = &pLayout->m_arColorScheme;
if (NULL != pSlide)
@ -74,13 +74,13 @@ void PPT::CShapeElement::CalculateColor(CColor& oColor, CSlide* pSlide, CTheme*
pArray = &pSlide->m_arColorScheme;
}
if ((0 > oColor.m_lSchemeIndex) || ((pArray) && (oColor.m_lSchemeIndex >= (LONG)pArray->size())))
if ((0 > oColor.m_lSchemeIndex) || ((pArray) && (oColor.m_lSchemeIndex >= (LONG)pArray->size())))
return;
if (pArray)
{
oColor = pArray->at(oColor.m_lSchemeIndex);
}
if (pArray)
{
oColor = pArray->at(oColor.m_lSchemeIndex);
}
oColor.m_lSchemeIndex = lOldIndex;
}
@ -108,7 +108,7 @@ void PPT::CShapeElement::SetupTextProperties(CSlide* pSlide, CTheme* pTheme, CLa
for (size_t i = 0; i < nCountCFs; ++i)
{
CTextCFRun* pRun = &pAttributes->m_arParagraphs[nIndex].m_arSpans[i].m_oRun;
if (pRun->Color.is_init())
{
int nColorIndex = (int)pRun->Color->m_lSchemeIndex;
@ -149,22 +149,22 @@ bool PPT::CShapeElement::SetUpTextPlaceholder(std::wstring newText)
bool result = false;
PPT::CTextAttributesEx* pText = &m_pShape->m_oText;
for (size_t p = 0 ; p < pText->m_arParagraphs.size(); p++) //тут по всем -> 1-(33).ppt
for (size_t p = 0; p < pText->m_arParagraphs.size(); p++) //тут по всем -> 1-(33).ppt
{
if (pText->m_arParagraphs[p].m_arSpans.size() >0)//??? по всем?
if (pText->m_arParagraphs[p].m_arSpans.size() > 0)//??? по всем?
{
int pos = (int)pText->m_arParagraphs[p].m_arSpans[0].m_strText.find(L"*");
if (pos >= 0)
{
CSpan first = pText->m_arParagraphs[p].m_arSpans[0];
CSpan last = pText->m_arParagraphs[p].m_arSpans[0];
first.m_strText = pText->m_arParagraphs[p].m_arSpans[0].m_strText.substr(0, pos);
last.m_strText = pText->m_arParagraphs[p].m_arSpans[0].m_strText.substr(pos + 1);
first.m_strText = pText->m_arParagraphs[p].m_arSpans[0].m_strText.substr(0, pos);
last.m_strText = pText->m_arParagraphs[p].m_arSpans[0].m_strText.substr(pos + 1);
pText->m_arParagraphs[p].m_arSpans[0].m_strText = newText;
pText->m_arParagraphs[p].m_arSpans[0].m_bField = true;
pText->m_arParagraphs[p].m_arSpans[0].m_bField = true;
if (last.m_strText.empty() == false)
pText->m_arParagraphs[p].m_arSpans.insert(pText->m_arParagraphs[p].m_arSpans.begin() + 1, last);
@ -280,13 +280,13 @@ namespace PPT
{
if (bIsNamespace)
{
return _T("<a:prstGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" prst=\"rect\"><a:avLst/></a:prstGeom>");
return L"<a:prstGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" prst=\"rect\"><a:avLst/></a:prstGeom>";
}
return _T("<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>");
return L"<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>";
std::wstring strXmlPPTX = bIsNamespace ? _T("<a:custGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") : _T("<a:custGeom>");
std::wstring strXmlPPTX = bIsNamespace ? L"<a:custGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">" : L"<a:custGeom>";
strXmlPPTX += _T("</a:custGeom>");
strXmlPPTX += L"</a:custGeom>";
return strXmlPPTX;
}
@ -305,7 +305,7 @@ namespace PPT
m_bShapePreset = false;
}
}
CShapeElement::CShapeElement::CShapeElement() : CElement()
{
m_lShapeType = 0x1000;
@ -327,10 +327,10 @@ namespace PPT
//virtual void NormalizeCoordsByMetric()
//{
// CElement::NormalizeCoordsByMetric();
// double dScaleX = (double)m_oMetric.m_lUnitsHor / m_oMetric.m_lMillimetresHor;
// double dScaleY = (double)m_oMetric.m_lUnitsVer / m_oMetric.m_lMillimetresVer;
// m_pShape->m_oText.m_oBounds.left = (int)(dScaleX * m_pShape->m_oText.m_oBounds.left);
// m_pShape->m_oText.m_oBounds.right = (int)(dScaleX * m_pShape->m_oText.m_oBounds.right);
// m_pShape->m_oText.m_oBounds.top = (int)(dScaleY * m_pShape->m_oText.m_oBounds.top);
@ -373,7 +373,7 @@ namespace PPT
if (NULL == pPPTShape)
{
// такого быть не может
return _T("");
return L"";
}
NSGuidesVML::CFormParam pParamCoef;
@ -389,27 +389,27 @@ namespace PPT
{
if (bIsNamespace)
{
return _T("<a:prstGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" prst=\"rect\"><a:avLst/></a:prstGeom>");
return L"<a:prstGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" prst=\"rect\"><a:avLst/></a:prstGeom>";
}
return _T("<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>");
return L"<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>";
}
else if (pPPTShape->m_eType == PPTShapes::sptCLine)
{
if (bIsNamespace)
{
return _T("<a:prstGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" prst=\"line\"><a:avLst/></a:prstGeom>");
return L"<a:prstGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" prst=\"line\"><a:avLst/></a:prstGeom>";
}
return _T("<a:prstGeom prst=\"line\"><a:avLst/></a:prstGeom>");
return L"<a:prstGeom prst=\"line\"><a:avLst/></a:prstGeom>";
}
else if (pPPTShape->m_eType == PPTShapes::sptCEllipse)
{
if (bIsNamespace)
{
return _T("<a:prstGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" prst=\"ellipse\"><a:avLst/></a:prstGeom>");
return L"<a:prstGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" prst=\"ellipse\"><a:avLst/></a:prstGeom>";
}
return _T("<a:prstGeom prst=\"ellipse\"><a:avLst/></a:prstGeom>");
return L"<a:prstGeom prst=\"ellipse\"><a:avLst/></a:prstGeom>";
}
std::wstring strXmlPPTX = bIsNamespace ? _T("<a:custGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") : _T("<a:custGeom>");
std::wstring strXmlPPTX = bIsNamespace ? L"<a:custGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">" : L"<a:custGeom>";
CFormulaConverter pFormulaConverter;
@ -454,40 +454,40 @@ namespace PPT
//adj----------------------------
if (pFormulaConverter.m_oAdjRes.GetSize() == 0)
strXmlPPTX += _T("<a:avLst/>");
strXmlPPTX += L"<a:avLst/>";
else
strXmlPPTX += _T("<a:avLst>") + pFormulaConverter.m_oAdjRes.GetXmlString() + _T("</a:avLst>");
strXmlPPTX += L"<a:avLst>" + pFormulaConverter.m_oAdjRes.GetXmlString() + L"</a:avLst>";
//guids--------------------------
if (pFormulaConverter.m_oGuidsRes.GetSize() == 0)
strXmlPPTX += _T("<a:gdLst>") + pFormulaConverter.m_oCoef.GetXmlString() + _T("</a:gdLst>");
strXmlPPTX += L"<a:gdLst>" + pFormulaConverter.m_oCoef.GetXmlString() + L"</a:gdLst>";
else
strXmlPPTX += _T("<a:gdLst>") + pFormulaConverter.m_oCoef.GetXmlString() + pFormulaConverter.m_oGuidsRes.GetXmlString() + _T("</a:gdLst>");
strXmlPPTX += L"<a:gdLst>" + pFormulaConverter.m_oCoef.GetXmlString() + pFormulaConverter.m_oGuidsRes.GetXmlString() + L"</a:gdLst>";
//handles---------------------------
if (pFormulaConverter.m_oHandleRes.GetSize() == 0)
strXmlPPTX += _T("<a:ahLst/>");
strXmlPPTX += L"<a:ahLst/>";
else
strXmlPPTX += _T("<a:ahLst>") + pFormulaConverter.m_oHandleRes.GetXmlString() + _T("</a:ahLst>");
strXmlPPTX += L"<a:ahLst>" + pFormulaConverter.m_oHandleRes.GetXmlString() + L"</a:ahLst>";
//connectors-------------------------
strXmlPPTX += _T("<a:cxnLst/>");
strXmlPPTX += L"<a:cxnLst/>";
//textRect---------------------------
if (pFormulaConverter.m_oTextRect.GetSize() != 0)
strXmlPPTX += pFormulaConverter.m_oTextRect.GetXmlString();
//path------------------------------
strXmlPPTX += _T("<a:pathLst>");
strXmlPPTX += L"<a:pathLst>";
strXmlPPTX += pFormulaConverter.m_oPathRes.GetXmlString();
strXmlPPTX += _T("</a:pathLst>");
strXmlPPTX += L"</a:pathLst>";
}
else
{
return _T("<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>");
return L"<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>";
}
strXmlPPTX += _T("</a:custGeom>");
strXmlPPTX += L"</a:custGeom>";
return strXmlPPTX;
}
@ -604,12 +604,12 @@ namespace PPT
int CTableElement::GetWidth()const
{
double multip = m_bAnchorEnabled ? 1587.5 : 1;
return round(m_rcAnchor.GetWidth() * multip);
return round(m_rcAnchor.GetWidth() * multip);
}
int CTableElement::GetHeight()const
{
double multip = m_bAnchorEnabled ? 1587.5 : 1;
return round(m_rcAnchor.GetHeight() * multip);
return round(m_rcAnchor.GetHeight() * multip);
}
std::wstring CTableElement::ConvertPPTShapeToPPTX(bool bIsNamespace)
{

View File

@ -32,7 +32,7 @@
#include "Layout.h"
void PPT::CorrectPlaceholderType(int &type)
void PPT::CorrectPlaceholderType(int& type)
{
switch (type)
{
@ -83,20 +83,20 @@ void PPT::CLayout::Clear()
m_arElements.clear();
m_mapPlaceholders.clear();
m_bIsTitleMaster = false;
m_bIsTitleMaster = false;
m_bHasDate = false;
m_bHasSlideNumber = false;
m_bHasFooter = false;
m_nFormatDate = 1;
m_bHasDate = false;
m_bHasSlideNumber = false;
m_bHasFooter = false;
m_nFormatDate = 1;
for (int i = 0 ; i < 3 ; i++)
for (int i = 0; i < 3; i++)
m_PlaceholdersReplaceString[i].clear();
m_bUseThemeColorScheme = true;
m_bShowMasterShapes = true;
m_strLayoutType = _T("obj");
m_bIsBackground = false;
m_bUseThemeColorScheme = true;
m_bShowMasterShapes = true;
m_strLayoutType = L"obj";
m_bIsBackground = false;
}
void PPT::CLayout::CreateDublicateElements()
@ -145,7 +145,7 @@ LONG PPT::CLayout::GetCountPlaceholderWithType(LONG lType)
return lFound;
}
ODRAW::CColor PPT::CLayout::GetColor(const LONG &lIndexScheme)
ODRAW::CColor PPT::CLayout::GetColor(const LONG& lIndexScheme)
{
if (lIndexScheme < (LONG)m_arColorScheme.size())
{
@ -154,14 +154,14 @@ ODRAW::CColor PPT::CLayout::GetColor(const LONG &lIndexScheme)
return ODRAW::CColor();
}
void PPT::CLayout::CheckPlaceholderStyle(std::wstring strStyleName, LONG &lType, LONG &lLevel, LONG &lTypeStyle)
void PPT::CLayout::CheckPlaceholderStyle(std::wstring strStyleName, LONG& lType, LONG& lLevel, LONG& lTypeStyle)
{
size_t nLen = strStyleName.length();
wchar_t* pData = (wchar_t*)strStyleName.c_str();
size_t nLen = strStyleName.length();
wchar_t* pData = (wchar_t*)strStyleName.c_str();
lType = 0;
lLevel = 0;
lTypeStyle = -1;
lType = 0;
lLevel = 0;
lTypeStyle = -1;
wchar_t* pDataEnd = pData + nLen;
wchar_t* pDataMem = pData + 1;

View File

@ -206,7 +206,7 @@ public:
virtual bool LoadFromXML(XmlUtils::CXmlNode& root)
{
if(_T("ooxml-shape") == root.GetName())
if(L"ooxml-shape" == root.GetName())
{
m_pShape = CBaseShapePtr(new CPPTXShape());
@ -214,7 +214,7 @@ public:
return pptx_shape ? pptx_shape->LoadFromXML(root) : false;
}
else if(_T("shape") == root.GetName())
else if(L"shape" == root.GetName())
{
m_pShape = CBaseShapePtr(new CPPTShape());
@ -264,23 +264,23 @@ public:
void SetPen(XmlUtils::CXmlNode& oNodePict)
{
XmlUtils::CXmlNode oNodeTemplate;
if (oNodePict.GetNode(_T("stroke"), oNodeTemplate))
if (oNodePict.GetNode(L"stroke", oNodeTemplate))
{
std::wstring strColor = oNodeTemplate.GetAttributeOrValue(_T("strokecolor"));
//if (strColor != _T(""))
std::wstring strColor = oNodeTemplate.GetAttributeOrValue(L"strokecolor");
//if (strColor != L""))
// m_oPen.Color.FromString(strColor);
//std::wstring strSize = oNodeTemplate.GetAttributeOrValue(_T("strokeweight"));
//if (strSize != _T(""))
//std::wstring strSize = oNodeTemplate.GetAttributeOrValue(L"strokeweight"));
//if (strSize != L""))
// m_oPen.Size = XmlUtils::GetDouble(strSize);
//std::wstring strStroke = oNodeTemplate.GetAttributeOrValue(_T("stroked"));
//if (strStroke != _T(""))
//std::wstring strStroke = oNodeTemplate.GetAttributeOrValue(L"stroked"));
//if (strStroke != L""))
// m_oPen.Alpha = 0;
}
if (oNodePict.GetNode(_T("v:stroke"), oNodeTemplate))
if (oNodePict.GetNode(L"v:stroke", oNodeTemplate))
{
std::wstring strColor = oNodeTemplate.GetAttributeOrValue(_T("dashstyle"));
//if (strColor != _T(""))
std::wstring strColor = oNodeTemplate.GetAttributeOrValue(L"dashstyle");
//if (strColor != L""))
// m_oPen.DashStyle = XmlUtils::GetInteger(strColor);
}
}
@ -288,22 +288,22 @@ public:
void SetBrush(XmlUtils::CXmlNode& oNodePict)
{
XmlUtils::CXmlNode oNodeTemplate;
if (oNodePict.GetNode(_T("fillcolor"), oNodeTemplate))
if (oNodePict.GetNode(L"fillcolor", oNodeTemplate))
{
std::wstring strColor = oNodeTemplate.GetAttributeOrValue(_T("val"));
//if (strColor != _T(""))
std::wstring strColor = oNodeTemplate.GetAttributeOrValue(L"val");
//if (strColor != L""))
// m_oBrush.Color1.FromString(strColor);
}
}
void SetCoordPos(XmlUtils::CXmlNode& oNodePict)
{
if (_T("shape") == oNodePict.GetName())
if (L"shape" == oNodePict.GetName())
{
XmlUtils::CXmlNode oNodeTemplate;
if (oNodePict.GetNode(_T("coordorigin"), oNodeTemplate))
if (oNodePict.GetNode(L"coordorigin", oNodeTemplate))
{
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(_T("val"));
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(L"val");
if (!strCoordSize.empty())
{
std::vector<std::wstring> oArray;
@ -315,8 +315,8 @@ public:
}
else
{
std::wstring id = oNodePict.GetAttributeOrValue(_T("type"));
if (id != _T(""))
std::wstring id = oNodePict.GetAttributeOrValue(L"type");
if (id != L"")
{
m_dXLogic = 0;
m_dYLogic = 0;
@ -324,9 +324,9 @@ public:
else
{
XmlUtils::CXmlNode oNodeTemplate;
if (oNodePict.GetNode(_T("template"), oNodeTemplate))
if (oNodePict.GetNode(L"template", oNodeTemplate))
{
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(_T("coordorigin"));
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(L"coordorigin");
if (!strCoordSize.empty())
{
std::vector<std::wstring> oArray;
@ -342,13 +342,13 @@ public:
}
void SetCoordSize(XmlUtils::CXmlNode& oNodePict)
{
if (_T("shape") == oNodePict.GetName())
if (L"shape" == oNodePict.GetName())
{
XmlUtils::CXmlNode oNodeTemplate;
if (oNodePict.GetNode(_T("coordsize"), oNodeTemplate))
if (oNodePict.GetNode(L"coordsize", oNodeTemplate))
{
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(_T("val"));
if (strCoordSize != _T(""))
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(L"val");
if (strCoordSize != L"")
{
std::vector<std::wstring> oArray;
boost::algorithm::split(oArray, strCoordSize, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
@ -359,8 +359,8 @@ public:
}
else
{
std::wstring id = oNodePict.GetAttributeOrValue(_T("type"));
if (id != _T(""))
std::wstring id = oNodePict.GetAttributeOrValue(L"type");
if (id != L"")
{
m_dWidthLogic = 21600;
m_dHeightLogic = 21600;
@ -368,10 +368,10 @@ public:
else
{
XmlUtils::CXmlNode oNodeTemplate;
if (oNodePict.GetNode(_T("template"), oNodeTemplate))
if (oNodePict.GetNode(L"template", oNodeTemplate))
{
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(_T("coordsize"));
if (strCoordSize != _T(""))
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(L"coordsize");
if (strCoordSize != L"")
{
std::vector<std::wstring> oArray;
boost::algorithm::split(oArray, strCoordSize, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);

View File

@ -46,53 +46,53 @@ if (oSrc.##EXIST_PARAM) \
PARAM = oSrc.##PARAM; \
}
std::wstring ToNode(const NSCommon::nullable_base<WORD> &prop, const std::wstring &strName)
std::wstring ToNode(const NSCommon::nullable_base<WORD>& prop, const std::wstring& strName)
{
if (!prop.is_init()) return L"";
return _T("<") + strName + _T(">") + std::to_wstring( (int)prop.get() ) + _T("</") + strName + _T(">");
return L"<" + strName + L">" + std::to_wstring((int)prop.get()) + L"</" + strName + L">";
}
std::wstring ToNode(const NSCommon::nullable_base<LONG> &prop, const std::wstring &strName)
std::wstring ToNode(const NSCommon::nullable_base<LONG>& prop, const std::wstring& strName)
{
if (!prop.is_init()) return L"";
return _T("<") + strName + _T(">") + std::to_wstring( (int)prop.get() ) + _T("</") + strName + _T(">");
return L"<" + strName + L">" + std::to_wstring((int)prop.get()) + L"</" + strName + L">";
}
std::wstring ToNode(const NSCommon::nullable_base<_UINT32> &prop, const std::wstring &strName)
std::wstring ToNode(const NSCommon::nullable_base<_UINT32>& prop, const std::wstring& strName)
{
if (!prop.is_init()) return L"";
return _T("<") + strName + _T(">") + std::to_wstring((int)prop.get()) + _T("</") + strName + _T(">");
return L"<" + strName + L">" + std::to_wstring((int)prop.get()) + L"</" + strName + L">";
}
std::wstring ToNode(const NSCommon::nullable_base<double> &prop, const std::wstring &strName)
std::wstring ToNode(const NSCommon::nullable_base<double>& prop, const std::wstring& strName)
{
if (!prop.is_init()) return L"";
return _T("<") + strName + _T(">") + XmlUtils::ToString(prop.get()) + _T("</") + strName + _T(">");
return L"<" + strName + L">" + XmlUtils::ToString(prop.get()) + L"</" + strName + L">";
}
std::wstring ToNode(const NSCommon::nullable_base<ODRAW::CColor> &prop, const std::wstring &strName)
std::wstring ToNode(const NSCommon::nullable_base<ODRAW::CColor>& prop, const std::wstring& strName)
{
if (!prop.is_init()) return L"";
return _T("<") + strName + _T(">") + std::to_wstring((unsigned int)prop->GetLONG()) + _T("</") + strName + _T(">");
return L"<" + strName + L">" + std::to_wstring((unsigned int)prop->GetLONG()) + L"</" + strName + L">";
}
PPT::CFontProperty::CFontProperty() : PitchFamily(0), Charset(0) {}
PPT::CFontProperty::CFontProperty(const CFontProperty &oSrc)
PPT::CFontProperty::CFontProperty(const CFontProperty& oSrc)
{
*this = oSrc;
}
PPT::CFontProperty &PPT::CFontProperty::operator=(const CFontProperty &oSrc)
PPT::CFontProperty& PPT::CFontProperty::operator=(const CFontProperty& oSrc)
{
Name = oSrc.Name;
PitchFamily = oSrc.PitchFamily;
Charset = oSrc.Charset;
Name = oSrc.Name;
PitchFamily = oSrc.PitchFamily;
Charset = oSrc.Charset;
return *this;
}
@ -113,7 +113,7 @@ bool PPT::CFontProperty::IsValidCharset(int value)
if (value <= 0 || value > 255)
return false;
std::set<int> BLCharset = {128, 136, 129};
std::set<int> BLCharset = { 128, 136, 129 };
return BLCharset.find(value) == BLCharset.end();
}
@ -122,28 +122,28 @@ bool PPT::CFontProperty::IsValidPitchFamily(int value)
if (value <= 0 || value > 255)
return false;
std::set<int> BLPitchFamily = { 0x00, 0x01, 0x02, 0x10, 0x11, 0x12, 0x20, 0x21, 0x22, 0x30, 0x31, 0x32, 0x40, 0x41, 0x42, 0x50, 0x51, 0x52};
std::set<int> BLPitchFamily = { 0x00, 0x01, 0x02, 0x10, 0x11, 0x12, 0x20, 0x21, 0x22, 0x30, 0x31, 0x32, 0x40, 0x41, 0x42, 0x50, 0x51, 0x52 };
return BLPitchFamily.find(value) != BLPitchFamily.end();
}
bool PPT::CBulletAutoNum::isDefault() const
{
return type.get_value_or(L"arabicPeriod") == L"arabicPeriod" &&
(startAt.is_init() ? *startAt == 1 : true);
(startAt.is_init() ? *startAt == 1 : true);
}
PPT::CFontProperties::CFontProperties()
{
}
PPT::CFontProperties::CFontProperties(const CFontProperties &oSrc)
PPT::CFontProperties::CFontProperties(const CFontProperties& oSrc)
{
*this = oSrc;
}
PPT::CFontProperties &PPT::CFontProperties::operator=(const CFontProperties &oSrc)
PPT::CFontProperties& PPT::CFontProperties::operator=(const CFontProperties& oSrc)
{
font = oSrc.font;
ansi = oSrc.ansi;
ea = oSrc.ea;
sym = oSrc.sym;
font = oSrc.font;
ansi = oSrc.ansi;
ea = oSrc.ea;
sym = oSrc.sym;
return *this;
}
@ -152,37 +152,37 @@ PPT::CTextCFRun::CTextCFRun()
{
}
PPT::CTextCFRun::CTextCFRun(const CTextCFRun &oSrc)
PPT::CTextCFRun::CTextCFRun(const CTextCFRun& oSrc)
{
*this = oSrc;
}
PPT::CTextCFRun &PPT::CTextCFRun::operator=(const CTextCFRun &oSrc)
PPT::CTextCFRun& PPT::CTextCFRun::operator=(const CTextCFRun& oSrc)
{
FontBold = oSrc.FontBold;
FontItalic = oSrc.FontItalic;
FontUnderline = oSrc.FontUnderline;
FontStrikeout = oSrc.FontStrikeout;
FontShadow = oSrc.FontShadow;
FontBold = oSrc.FontBold;
FontItalic = oSrc.FontItalic;
FontUnderline = oSrc.FontUnderline;
FontStrikeout = oSrc.FontStrikeout;
FontShadow = oSrc.FontShadow;
fontRef = oSrc.fontRef;
eaFontRef = oSrc.eaFontRef;
ansiFontRef = oSrc.ansiFontRef;
symbolFontRef = oSrc.symbolFontRef;
pp9rt = oSrc.pp9rt;
BaseLineOffset = oSrc.BaseLineOffset;
fontRef = oSrc.fontRef;
eaFontRef = oSrc.eaFontRef;
ansiFontRef = oSrc.ansiFontRef;
symbolFontRef = oSrc.symbolFontRef;
pp9rt = oSrc.pp9rt;
BaseLineOffset = oSrc.BaseLineOffset;
Color = oSrc.Color;
Size = oSrc.Size;
Color = oSrc.Color;
Size = oSrc.Size;
font = oSrc.font;
font.ea = oSrc.font.ea;
font.ansi = oSrc.font.ansi;
font.sym = oSrc.font.sym;
font = oSrc.font;
font.ea = oSrc.font.ea;
font.ansi = oSrc.font.ansi;
font.sym = oSrc.font.sym;
Cap = oSrc.Cap;
Cap = oSrc.Cap;
Language = oSrc.Language;
Language = oSrc.Language;
return *this;
}
@ -190,7 +190,7 @@ PPT::CTextCFRun::~CTextCFRun()
{
}
void PPT::CTextCFRun::ApplyBefore(const CTextCFRun &oSrc)
void PPT::CTextCFRun::ApplyBefore(const CTextCFRun& oSrc)
{
if (!FontBold.is_init()) FontBold = oSrc.FontBold;
if (!FontItalic.is_init()) FontItalic = oSrc.FontItalic;
@ -208,15 +208,15 @@ void PPT::CTextCFRun::ApplyBefore(const CTextCFRun &oSrc)
if (!Size.is_init()) Size = oSrc.Size;
if (!Cap.is_init()) Cap = oSrc.Cap;
if (!font.font.is_init()) font.font = oSrc.font.font;
if (!font.ansi.is_init()) font.ansi = oSrc.font.ansi;
if (!font.ea.is_init()) font.ea = oSrc.font.ea;
if (!font.sym.is_init()) font.sym = oSrc.font.sym;
if (!font.font.is_init()) font.font = oSrc.font.font;
if (!font.ansi.is_init()) font.ansi = oSrc.font.ansi;
if (!font.ea.is_init()) font.ea = oSrc.font.ea;
if (!font.sym.is_init()) font.sym = oSrc.font.sym;
if (!Language.is_init()) Language = oSrc.Language;
}
void PPT::CTextCFRun::ApplyAfter(const CTextCFRun &oSrc)
void PPT::CTextCFRun::ApplyAfter(const CTextCFRun& oSrc)
{
if (oSrc.FontBold.is_init()) FontBold = oSrc.FontBold;
if (oSrc.FontItalic.is_init()) FontItalic = oSrc.FontItalic;
@ -258,59 +258,59 @@ PPT::CTextPFRun::CTextPFRun() : bIsOneLine(false)
{
}
PPT::CTextPFRun::CTextPFRun(const CTextPFRun &oSrc)
PPT::CTextPFRun::CTextPFRun(const CTextPFRun& oSrc)
{
*this = oSrc;
}
PPT::CTextPFRun &PPT::CTextPFRun::operator =(const CTextPFRun &oSrc)
PPT::CTextPFRun& PPT::CTextPFRun::operator =(const CTextPFRun& oSrc)
{
hasBullet = oSrc.hasBullet;
hasBullet = oSrc.hasBullet;
bulletFontRef = oSrc.bulletFontRef;
bulletSize = oSrc.bulletSize;
bulletChar = oSrc.bulletChar;
bulletColor = oSrc.bulletColor;
bulletFontRef = oSrc.bulletFontRef;
bulletSize = oSrc.bulletSize;
bulletChar = oSrc.bulletChar;
bulletColor = oSrc.bulletColor;
bulletFontProperties = oSrc.bulletFontProperties;
bulletAutoNum = oSrc.bulletAutoNum;
bulletAutoNum = oSrc.bulletAutoNum;
textAlignment = oSrc.textAlignment;
lineSpacing = oSrc.lineSpacing;
spaceBefore = oSrc.spaceBefore;
spaceAfter = oSrc.spaceAfter;
leftMargin = oSrc.leftMargin;
indent = oSrc.indent;
defaultTabSize = oSrc.defaultTabSize;
textAlignment = oSrc.textAlignment;
lineSpacing = oSrc.lineSpacing;
spaceBefore = oSrc.spaceBefore;
spaceAfter = oSrc.spaceAfter;
leftMargin = oSrc.leftMargin;
indent = oSrc.indent;
defaultTabSize = oSrc.defaultTabSize;
tabStops = oSrc.tabStops;
tabStops = oSrc.tabStops;
fontAlign = oSrc.fontAlign;
textDirection = oSrc.textDirection;
wrapFlags = oSrc.wrapFlags;
fontAlign = oSrc.fontAlign;
textDirection = oSrc.textDirection;
wrapFlags = oSrc.wrapFlags;
bIsOneLine = oSrc.bIsOneLine;
bIsOneLine = oSrc.bIsOneLine;
return *this;
}
void PPT::CTextPFRun::ApplyBefore(const CTextPFRun &oSrc)
void PPT::CTextPFRun::ApplyBefore(const CTextPFRun& oSrc)
{
if (!hasBullet.is_init())
{
hasBullet = oSrc.hasBullet;
hasBullet = oSrc.hasBullet;
}
if (!bulletSize.is_init())
{
bulletSize = oSrc.bulletSize;
bulletSize = oSrc.bulletSize;
}
if (!bulletChar.is_init())//master style (78).ppt
{
bulletChar = oSrc.bulletChar;
bulletFontRef = oSrc.bulletFontRef;
bulletChar = oSrc.bulletChar;
bulletFontRef = oSrc.bulletFontRef;
}
if (!bulletColor.is_init())
{
bulletColor = oSrc.bulletColor;
bulletColor = oSrc.bulletColor;
}
bulletFontProperties.reset();
bulletAutoNum.reset();
@ -333,34 +333,34 @@ void PPT::CTextPFRun::ApplyBefore(const CTextPFRun &oSrc)
}
}
void PPT::CTextPFRun::ApplyAfter(const CTextPFRun &oSrc)
void PPT::CTextPFRun::ApplyAfter(const CTextPFRun& oSrc)
{
if (oSrc.hasBullet.is_init())
{
hasBullet = oSrc.hasBullet;
bulletSize = oSrc.bulletSize;
bulletChar = oSrc.bulletChar;
bulletFontRef = oSrc.bulletFontRef;
bulletColor = oSrc.bulletColor;
bulletChar = oSrc.bulletChar;
bulletFontRef = oSrc.bulletFontRef;
bulletColor = oSrc.bulletColor;
bulletFontProperties.reset();
bulletAutoNum.reset();
}
if (oSrc.textAlignment.is_init()) textAlignment = oSrc.textAlignment;
if (oSrc.lineSpacing.is_init()) lineSpacing = oSrc.lineSpacing;
if (oSrc.spaceBefore.is_init()) spaceBefore = oSrc.spaceBefore;
if (oSrc.spaceAfter.is_init()) spaceAfter = oSrc.spaceAfter;
if (oSrc.leftMargin.is_init()) leftMargin = oSrc.leftMargin;
if (oSrc.indent.is_init()) indent = oSrc.indent;
if (oSrc.defaultTabSize.is_init()) defaultTabSize = oSrc.defaultTabSize;
if (oSrc.textAlignment.is_init()) textAlignment = oSrc.textAlignment;
if (oSrc.lineSpacing.is_init()) lineSpacing = oSrc.lineSpacing;
if (oSrc.spaceBefore.is_init()) spaceBefore = oSrc.spaceBefore;
if (oSrc.spaceAfter.is_init()) spaceAfter = oSrc.spaceAfter;
if (oSrc.leftMargin.is_init()) leftMargin = oSrc.leftMargin;
if (oSrc.indent.is_init()) indent = oSrc.indent;
if (oSrc.defaultTabSize.is_init()) defaultTabSize = oSrc.defaultTabSize;
if (oSrc.fontAlign.is_init()) fontAlign = oSrc.fontAlign;
if (oSrc.textDirection.is_init()) textDirection = oSrc.textDirection;
if (oSrc.wrapFlags.is_init()) wrapFlags = oSrc.wrapFlags;
if (oSrc.fontAlign.is_init()) fontAlign = oSrc.fontAlign;
if (oSrc.textDirection.is_init()) textDirection = oSrc.textDirection;
if (oSrc.wrapFlags.is_init()) wrapFlags = oSrc.wrapFlags;
if (!oSrc.tabStops.empty()) tabStops = oSrc.tabStops;
if (!oSrc.tabStops.empty()) tabStops = oSrc.tabStops;
}
std::wstring PPT::CTextPFRun::ToString(LONG lCount)
@ -372,16 +372,16 @@ PPT::CTextRuler::CTextRuler()
{
}
PPT::CTextRuler::CTextRuler(const CTextRuler &oSrc)
PPT::CTextRuler::CTextRuler(const CTextRuler& oSrc)
{
*this = oSrc;
}
PPT::CTextRuler &PPT::CTextRuler::operator =(const CTextRuler &oSrc)
PPT::CTextRuler& PPT::CTextRuler::operator =(const CTextRuler& oSrc)
{
DefaultTabSize = oSrc.DefaultTabSize;
CLevels = oSrc.CLevels;
TabStops = oSrc.TabStops;
DefaultTabSize = oSrc.DefaultTabSize;
CLevels = oSrc.CLevels;
TabStops = oSrc.TabStops;
LeftMargin1 = oSrc.LeftMargin1;
LeftMargin2 = oSrc.LeftMargin2;
@ -405,10 +405,10 @@ PPT::CTextRuler::~CTextRuler()
tabsStops.clear();
}
void PPT::CTextRuler::ApplyBefore(const CTextRuler &oSrc)
void PPT::CTextRuler::ApplyBefore(const CTextRuler& oSrc)
{
if (!DefaultTabSize.is_init()) DefaultTabSize = oSrc.DefaultTabSize;
if (!CLevels.is_init()) CLevels = oSrc.CLevels;
if (!CLevels.is_init()) CLevels = oSrc.CLevels;
if (!LeftMargin1.is_init()) LeftMargin1 = oSrc.LeftMargin1;
if (!LeftMargin2.is_init()) LeftMargin2 = oSrc.LeftMargin2;
@ -433,7 +433,7 @@ std::wstring PPT::CTextRuler::ToString()
PPT::CTextSIRun::CTextSIRun()
{
bIsExt = true;
lCount = 0;
lCount = 0;
bSpell = false;
bLang = false;
@ -453,39 +453,39 @@ PPT::CTextSIRun::CTextSIRun()
bGramma = false;
}
PPT::CTextSIRun::CTextSIRun(const CTextSIRun &oSrc)
PPT::CTextSIRun::CTextSIRun(const CTextSIRun& oSrc)
{
*this = oSrc;
}
PPT::CTextSIRun &PPT::CTextSIRun::operator =(const CTextSIRun &oSrc)
PPT::CTextSIRun& PPT::CTextSIRun::operator =(const CTextSIRun& oSrc)
{
bIsExt = oSrc.bIsExt;
lCount = oSrc.lCount;
bIsExt = oSrc.bIsExt;
lCount = oSrc.lCount;
bSpell = oSrc.bSpell;
bLang = oSrc.bLang;
bAltLang = oSrc.bAltLang;
bSpell = oSrc.bSpell;
bLang = oSrc.bLang;
bAltLang = oSrc.bAltLang;
bPp10ext = oSrc.bPp10ext;
bBidi = oSrc.bBidi;
bSmartTag = oSrc.bSmartTag;
bPp10ext = oSrc.bPp10ext;
bBidi = oSrc.bBidi;
bSmartTag = oSrc.bSmartTag;
Spell = oSrc.Spell;
Lang = oSrc.Lang;
AltLang = oSrc.AltLang;
Spell = oSrc.Spell;
Lang = oSrc.Lang;
AltLang = oSrc.AltLang;
Bidi = oSrc.Bidi;
pp10runid = oSrc.pp10runid;
Bidi = oSrc.Bidi;
pp10runid = oSrc.pp10runid;
bGramma = oSrc.bGramma;
bGramma = oSrc.bGramma;
arSmartTags = oSrc.arSmartTags;
return *this;
}
void PPT::CTextSIRun::ApplyBefore(const CTextSIRun &oSrc)
void PPT::CTextSIRun::ApplyBefore(const CTextSIRun& oSrc)
{
/*
* gcc 4.8 doesn't understand this construction:
@ -538,17 +538,17 @@ PPT::CSpan::CSpan() : m_bField(false), m_bBreak(false)
{
}
PPT::CSpan::CSpan(const CSpan &oSrc)
PPT::CSpan::CSpan(const CSpan& oSrc)
{
*this = oSrc;
}
PPT::CSpan &PPT::CSpan::operator=(const CSpan &oSrc)
PPT::CSpan& PPT::CSpan::operator=(const CSpan& oSrc)
{
m_oRun = oSrc.m_oRun;
m_strText = oSrc.m_strText;
m_bField = oSrc.m_bField;
m_bBreak = oSrc.m_bBreak;
m_oRun = oSrc.m_oRun;
m_strText = oSrc.m_strText;
m_bField = oSrc.m_bField;
m_bBreak = oSrc.m_bBreak;
m_arrInteractive = oSrc.m_arrInteractive;
return *this;
@ -562,26 +562,26 @@ PPT::CTextStyleLevel::CTextStyleLevel()
{
}
PPT::CTextStyleLevel::CTextStyleLevel(const CTextStyleLevel &oSrc)
PPT::CTextStyleLevel::CTextStyleLevel(const CTextStyleLevel& oSrc)
{
*this = oSrc;
}
PPT::CTextStyleLevel &PPT::CTextStyleLevel::operator=(const CTextStyleLevel &oSrc)
PPT::CTextStyleLevel& PPT::CTextStyleLevel::operator=(const CTextStyleLevel& oSrc)
{
m_oPFRun = oSrc.m_oPFRun;
m_oCFRun = oSrc.m_oCFRun;
m_oPFRun = oSrc.m_oPFRun;
m_oCFRun = oSrc.m_oCFRun;
return *this;
}
void PPT::CTextStyleLevel::ApplyAfter(const CTextStyleLevel &oSrc)
void PPT::CTextStyleLevel::ApplyAfter(const CTextStyleLevel& oSrc)
{
m_oPFRun.ApplyAfter(oSrc.m_oPFRun);
m_oCFRun.ApplyAfter(oSrc.m_oCFRun);
}
void PPT::CTextStyleLevel::ApplyBefore(const CTextStyleLevel &oSrc)
void PPT::CTextStyleLevel::ApplyBefore(const CTextStyleLevel& oSrc)
{
m_oPFRun.ApplyBefore(oSrc.m_oPFRun);
m_oCFRun.ApplyBefore(oSrc.m_oCFRun);
@ -595,12 +595,12 @@ PPT::CTextStyles::CTextStyles()
}
}
PPT::CTextStyles::CTextStyles(const CTextStyles &oSrc)
PPT::CTextStyles::CTextStyles(const CTextStyles& oSrc)
{
*this = oSrc;
}
PPT::CTextStyles &PPT::CTextStyles::operator=(const CTextStyles &oSrc)
PPT::CTextStyles& PPT::CTextStyles::operator=(const CTextStyles& oSrc)
{
for (int i = 0; i < 10; ++i)
{
@ -609,7 +609,7 @@ PPT::CTextStyles &PPT::CTextStyles::operator=(const CTextStyles &oSrc)
return *this;
}
void PPT::CTextStyles::SetStyles(CTextStyles *pStyles)
void PPT::CTextStyles::SetStyles(CTextStyles* pStyles)
{
for (int i = 0; i < 10; ++i)
{
@ -617,7 +617,7 @@ void PPT::CTextStyles::SetStyles(CTextStyles *pStyles)
}
}
void PPT::CTextStyles::SetLanguage(nullable<WORD> &language)
void PPT::CTextStyles::SetLanguage(nullable<WORD>& language)
{
if (!language.is_init()) return;
@ -630,7 +630,7 @@ void PPT::CTextStyles::SetLanguage(nullable<WORD> &language)
}
}
void PPT::CTextStyles::ApplyAfter(const CTextStyles &oSrc)
void PPT::CTextStyles::ApplyAfter(const CTextStyles& oSrc)
{
for (int i = 0; i < 10; ++i)
{
@ -646,7 +646,7 @@ void PPT::CTextStyles::ApplyAfter(const CTextStyles &oSrc)
}
}
void PPT::CTextStyles::ApplyBefore(const CTextStyles &oSrc)
void PPT::CTextStyles::ApplyBefore(const CTextStyles& oSrc)
{
for (int i = 0; i < 10; ++i)
{
@ -664,25 +664,25 @@ void PPT::CTextStyles::ApplyBefore(const CTextStyles &oSrc)
PPT::CParagraph::CParagraph()
{
m_lTextType = -1;
m_lTextLevel = 0;
m_lStyleThemeIndex = -1;
m_lTextType = -1;
m_lTextLevel = 0;
m_lStyleThemeIndex = -1;
}
PPT::CParagraph::CParagraph(const CParagraph &oSrc)
PPT::CParagraph::CParagraph(const CParagraph& oSrc)
{
*this = oSrc;
}
PPT::CParagraph &PPT::CParagraph::operator=(const CParagraph &oSrc)
PPT::CParagraph& PPT::CParagraph::operator=(const CParagraph& oSrc)
{
m_lTextLevel = oSrc.m_lTextLevel;
m_lTextType = oSrc.m_lTextType;
m_lStyleThemeIndex = oSrc.m_lStyleThemeIndex;
m_lTextLevel = oSrc.m_lTextLevel;
m_lTextType = oSrc.m_lTextType;
m_lStyleThemeIndex = oSrc.m_lStyleThemeIndex;
m_oPFRun = oSrc.m_oPFRun;
m_oPFRun = oSrc.m_oPFRun;
m_arSpans = oSrc.m_arSpans;
m_arSpans = oSrc.m_arSpans;
return *this;
}
@ -701,7 +701,7 @@ void PPT::CParagraph::CheckErrors()
size_t nCountS = m_arSpans.size();
for (size_t i = 0; i < nCountS; ++i)
{
std::replace( m_arSpans[i].m_strText.begin(), m_arSpans[i].m_strText.end(), (wchar_t)(11), (wchar_t)(13));
std::replace(m_arSpans[i].m_strText.begin(), m_arSpans[i].m_strText.end(), (wchar_t)(11), (wchar_t)(13));
}
}

File diff suppressed because it is too large Load Diff

View File

@ -31,16 +31,14 @@
*/
#include "ImageManager.h"
#include <boost/algorithm/string.hpp>
#include "../../../OOXML/SystemUtility/SystemUtility.h"
CMediaManager::CMediaManager() : m_lIndexNextImage(0), m_lIndexNextAudio(0), m_lIndexNextVideo(0)
{
}
CMediaManager::~CMediaManager()
{
}
void CMediaManager::Clear()
{
m_mapMedia.clear();
@ -59,12 +57,15 @@ std::wstring CMediaManager::FindMedia(const std::wstring &strInput)
}
return L"";
}
void CMediaManager::SetDstMedia(const std::wstring &strDst)
{
m_strDstMedia = strDst;
}
void CMediaManager::SetTempMedia(const std::wstring& strSrc)
{
OOX::CPath pathSrc(strSrc);
m_strTempMedia = pathSrc.GetPath();
}
std::wstring CMediaManager::GenerateVideo(const std::wstring &strInput)
{
return GenerateMedia(strInput, L"video", m_lIndexNextVideo, L".avi");
@ -112,20 +113,26 @@ std::wstring CMediaManager::GenerateMedia(const std::wstring &strInput, const st
if (-1 != nIndexExt)
strExts = strInput.substr(nIndexExt);
if (strExts == _T(".video") || strExts == _T(".audio"))
if (strExts == L".video" || strExts == L".audio")
{
std::wstring strInput1 = strInput.substr(0, nIndexExt);
nIndexExt = strInput1.rfind(wchar_t('.'));
strExts = nIndexExt < 0 ? L"" : strInput1.substr(nIndexExt);
}
if (strExts == _T(".tmp") || strExts.empty()) strExts = strDefaultExt;
if (strExts == L".tmp" || strExts.empty()) strExts = strDefaultExt;
std::wstring strMediaName = Template + std::to_wstring(++Indexer);
std::wstring strOutput = m_strDstMedia + strMediaName + strExts;
strMediaName = _T("../media/") + strMediaName + strExts;
strMediaName = L"../media/" + strMediaName + strExts;
// теперь нужно скопировать
OOX::CPath pathInput(strInput);
std::wstring strPathInput = pathInput.GetPath();
if (std::wstring::npos == strPathInput.find(m_strTempMedia))
{
return L"";
}
if (strOutput != strInput)
{
if (NSFile::CFileBinary::Copy(strInput, strOutput) == false)
@ -145,7 +152,6 @@ void CMediaManager::WriteAudioCollection(const std::vector<PPT::CExFilesInfo> &a
{
auto pathAudio = GenerateAudio(audio.m_strFilePath);
}
}
bool CMediaManager::IsNeedDownload(const std::wstring &strFile)
@ -167,11 +173,11 @@ std::wstring CorrectXmlString3(const std::wstring &str)
{
switch(str[pos])
{
case '&': buffer.append(_T("&amp;")); break;
case '\"': buffer.append(_T("&quot;")); break;
case '\'': buffer.append(_T("&apos;")); break;
case '<': buffer.append(_T("&lt;")); break;
case '>': buffer.append(_T("&gt;")); break;
case '&': buffer.append(L"&amp;"); break;
case '\"': buffer.append(L"&quot;"); break;
case '\'': buffer.append(L"&apos;"); break;
case '<': buffer.append(L"&lt;"); break;
case '>': buffer.append(L"&gt;"); break;
default: buffer.append(&str[pos], 1); break;
}
}
@ -197,8 +203,8 @@ void CRelsGenerator::Clear()
void CRelsGenerator::StartMaster(int nIndexTheme, int nStartLayoutIndex, int nCountLayouts)
{
std::wstring str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
std::wstring str1 = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">";
m_oWriter.WriteString(str1);
@ -217,8 +223,8 @@ void CRelsGenerator::StartMaster(int nIndexTheme, int nStartLayoutIndex, int nCo
void CRelsGenerator::StartLayout(int nIndexTheme)
{
std::wstring str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
std::wstring str1 = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">";
m_oWriter.WriteString(str1);
@ -264,7 +270,7 @@ void CRelsGenerator::StartSlide(int nIndexLayout, int nIndexNotes)
void CRelsGenerator::CloseRels()
{
std::wstring str = _T("</Relationships>");
std::wstring str = L"</Relationships>";
m_oWriter.WriteString(str);
}

View File

@ -50,6 +50,7 @@ private:
long m_lIndexNextImage;
std::wstring m_strDstMedia;
std::wstring m_strTempMedia;
public:
CMediaManager();
@ -57,6 +58,7 @@ public:
void Clear();
std::wstring FindMedia(const std::wstring& strInput);
void SetDstMedia(const std::wstring& strDst);
void SetTempMedia(const std::wstring& strSrc);
std::wstring GenerateVideo(const std::wstring& strInput);
std::wstring GenerateAudio(const std::wstring& strInput);
std::wstring GenerateImage(const std::wstring& strInput);

View File

@ -55,7 +55,7 @@ void CStylesWriter::ConvertStyleLevel(PPT::CTextStyleLevel& oLevel, PPT::CString
{//дублирование CTextPFRun и CTextCFRun с ShapeWriter - todooo - вынести отдельно
std::wstring str1;
if (nLevel == 9)
str1 = _T("<a:defPPr");
str1 = L"<a:defPPr";
else
{
str1 = L"<a:lvl" + std::to_wstring(nLevel + 1) + L"pPr";
@ -83,7 +83,7 @@ void CStylesWriter::ConvertStyleLevel(PPT::CTextStyleLevel& oLevel, PPT::CString
std::wstring str_lang = m_lcidConverter.get_wstring(pCF->Language.get());
if (str_lang.length() > 0)
oWriter.WriteString(std::wstring(L" lang=\"") + str_lang + _T("\""));
oWriter.WriteString(std::wstring(L" lang=\"") + str_lang + L"\"");
}
if (pCF->Size.is_init())
{
@ -387,7 +387,7 @@ std::wstring PPT::CShapeWriter::ConvertShadow(CShadow & shadow)
std::wstring Preset;
bool Inner = false;
if (shadow.Visible == false) return _T("");
if (shadow.Visible == false) return L"";
double dist = sqrt(shadow.DistanceY * shadow.DistanceY + shadow.DistanceX * shadow.DistanceX);
double dir = 0;
@ -649,7 +649,7 @@ void PPT::CShapeWriter::WriteImageInfo()
m_oWriter.WriteString(std::wstring(L"</p:nvPr>"));
std::wstring str2 = _T("</p:nvPicPr>");
std::wstring str2 = L"</p:nvPicPr>";
m_oWriter.WriteString(str2);
}
void PPT::CShapeWriter::WriteGroupInfo()
@ -701,7 +701,7 @@ void PPT::CShapeWriter::WriteGroupInfo()
m_oWriter.WriteString(std::wstring(L"<p:nvPr/>"));
std::wstring str2 = _T("</p:nvGrpSpPr>");
std::wstring str2 = L"</p:nvGrpSpPr>";
m_oWriter.WriteString(str2);
}
@ -754,7 +754,7 @@ void PPT::CShapeWriter::WriteTableInfo()
m_oWriter.WriteString(std::wstring(L"<p:nvPr/>"));
std::wstring str2 = _T("</p:nvGraphicFramePr>");
std::wstring str2 = L"</p:nvGraphicFramePr>";
m_oWriter.WriteString(str2);
}
@ -822,7 +822,7 @@ void PPT::CShapeWriter::WriteShapeInfo()
m_oWriter.WriteString(std::wstring(L"<p:nvPr><p:ph"));
if (pShapeElement->m_lPlaceholderType > 0 && pShapeElement->m_lPlaceholderType != PT_Body_Empty)
m_oWriter.WriteString(std::wstring(L" type=\"") + GetPhType(pShapeElement->m_lPlaceholderType) + _T("\""));
m_oWriter.WriteString(std::wstring(L" type=\"") + GetPhType(pShapeElement->m_lPlaceholderType) + L"\"");
else if (pShapeElement->m_lPlaceholderID == -1)
m_oWriter.WriteString(std::wstring(L" type=\"obj\""));
@ -853,7 +853,7 @@ void PPT::CShapeWriter::WriteShapeInfo()
m_oWriter.WriteString(std::wstring(L"<p:nvPr/>"));
}
std::wstring str2 = _T("</p:nvSpPr>");
std::wstring str2 = L"</p:nvSpPr>";
m_oWriter.WriteString(str2);
}
void PPT::CShapeWriter::Write3dShape()
@ -1118,7 +1118,7 @@ void PPT::CShapeWriter::WriteTextInfo(PPT::CTextCFRun* pLastCF)
{
std::wstring prstTxWarp = oox::Spt2WordArtShapeType((oox::MSOSPT)pShapeElement->m_lShapeType);
m_oWriter.WriteString(std::wstring(L"<a:prstTxWarp"));
m_oWriter.WriteString(std::wstring(L" prst=\"") + prstTxWarp + _T("\">"));
m_oWriter.WriteString(std::wstring(L" prst=\"") + prstTxWarp + L"\">");
m_oWriter.WriteString(std::wstring(L"<a:avLst>"));//модификаторы
CPPTShape *pPPTShape = dynamic_cast<CPPTShape *>(pShapeElement->m_pShape->getBaseShape().get());
@ -1198,7 +1198,7 @@ void PPT::CShapeWriter::WriteTextInfo(PPT::CTextCFRun* pLastCF)
{
if (true)
{
if ((nSpan == (nCountSpans - 1)) && (_T("\n") == pParagraph->m_arSpans[nSpan].m_strText || pParagraph->m_arSpans[nSpan].m_strText.empty()) )
if ((nSpan == (nCountSpans - 1)) && (L"\n" == pParagraph->m_arSpans[nSpan].m_strText || pParagraph->m_arSpans[nSpan].m_strText.empty()))
{
PPT::CTextCFRun* pCF = &pParagraph->m_arSpans[nSpan].m_oRun;
if ((pCF->Size.is_init()) && (pCF->Size.get() > 0) && (pCF->Size.get() < 4001))
@ -1250,7 +1250,7 @@ void PPT::CShapeWriter::WriteTextInfo(PPT::CTextCFRun* pLastCF)
std::wstring str_lang = m_lcidConverter.get_wstring(pCF->Language.get());
if (str_lang.length() > 0)
m_oWriter.WriteString(std::wstring(L" lang=\"") + str_lang + _T("\""));
m_oWriter.WriteString(std::wstring(L" lang=\"") + str_lang + L"\"");
}
if ((pCF->Size.is_init()) && (pCF->Size.get() > 0) && (pCF->Size.get() < 4001))
{
@ -1300,7 +1300,7 @@ void PPT::CShapeWriter::WriteTextInfo(PPT::CTextCFRun* pLastCF)
{
if (pCF->Color->m_lSchemeIndex != -1)
{
std::wstring strProp = _T("<a:solidFill><a:schemeClr val=\"") + CStylesWriter::GetColorInScheme(pCF->Color->m_lSchemeIndex) + _T("\"/></a:solidFill>");
std::wstring strProp = L"<a:solidFill><a:schemeClr val=\"" + CStylesWriter::GetColorInScheme(pCF->Color->m_lSchemeIndex) + L"\"/></a:solidFill>";
m_oWriter.WriteString(strProp);
}
else
@ -1365,7 +1365,7 @@ void PPT::CShapeWriter::WriteTextInfo(PPT::CTextCFRun* pLastCF)
}
else
{
std::wstring strT1 = _T("<a:t>");
std::wstring strT1 = L"<a:t>";
m_oWriter.WriteString(strT1);
std::wstring strT = pParagraph->m_arSpans[nSpan].m_strText;
@ -1374,7 +1374,7 @@ void PPT::CShapeWriter::WriteTextInfo(PPT::CTextCFRun* pLastCF)
m_oWriter.WriteString(strT);
std::wstring strT2 = _T("</a:t>");
std::wstring strT2 = L"</a:t>";
m_oWriter.WriteString(strT2);
if ((pShapeElement->m_lPlaceholderType == PT_MasterSlideNumber ||
@ -1387,11 +1387,11 @@ void PPT::CShapeWriter::WriteTextInfo(PPT::CTextCFRun* pLastCF)
}
}
std::wstring strEndPar = _T("</a:p>");
std::wstring strEndPar = L"</a:p>";
m_oWriter.WriteString(strEndPar);
}
std::wstring str5 = _T("</p:txBody>");
std::wstring str5 = L"</p:txBody>";
m_oWriter.WriteString(str5);
}
@ -1805,7 +1805,7 @@ std::wstring PPT::CShapeWriter::ConvertShape()
if (pImageElement) return ConvertImage();
if (pGroupElement) return ConvertGroup();
if (pShapeElement == NULL) return _T("");
if (pShapeElement == NULL) return L"";
std::wstring prstTxWarp;
std::wstring prstGeom = oox::Spt2ShapeType_mini((oox::MSOSPT)pShapeElement->m_lShapeType);
@ -2011,7 +2011,7 @@ std::wstring PPT::CShapeWriter::ConvertImage()
if (pImageElement->m_bImagePresent == false)
{
if (pImageElement->m_sName.empty()) return _T("");
if (pImageElement->m_sName.empty()) return L"";
//ppt_presentation.ppt - ссылка на файл на диске
pImageElement->m_strImageFileName.clear();
@ -2027,7 +2027,7 @@ std::wstring PPT::CShapeWriter::ConvertImage()
strRid = m_pRels->WriteHyperlinkImage(CorrectXmlString3(pImageElement->m_sImageName));
}
if (strRid.empty()) return _T("");
if (strRid.empty()) return L"";
m_oWriter.WriteString(std::wstring(L"<p:pic>"));
@ -2047,7 +2047,7 @@ std::wstring PPT::CShapeWriter::ConvertImage()
m_oWriter.WriteString(std::wstring(L"<p:blipFill>"));
std::wstring strWrite = _T("<a:blip r:embed=\"") + strRid + _T("\"");
std::wstring strWrite = L"<a:blip r:embed=\"" + strRid + L"\"";
m_oWriter.WriteString(strWrite);
if (pImageElement->m_lpictureBrightness != 0 || pImageElement->m_lpictureContrast != 0x10000)
{

View File

@ -110,26 +110,26 @@ namespace PPT
switch (TypePPTX)
{
case 0: return _T("body");
case 100: return _T("body"); // для master pages
case 1: return _T("chart");
case 2: return _T("clipArt");
case 3: return _T("ctrTitle");
case 4: return _T("dgm");
case 5: return _T("dt");
case 6: return _T("ftr");
case 7: return _T("hdr");
case 8: return _T("media");
case 9: return _T("obj");
case 10: return _T("pic");
case 11: return _T("sldImg");
case 12: return _T("sldNum");
case 13: return _T("subTitle");
case 14: return _T("tbl");
case 15: return _T("title");
case 0: return L"body";
case 100: return L"body"; // для master pages
case 1: return L"chart";
case 2: return L"clipArt";
case 3: return L"ctrTitle";
case 4: return L"dgm";
case 5: return L"dt";
case 6: return L"ftr";
case 7: return L"hdr";
case 8: return L"media";
case 9: return L"obj";
case 10: return L"pic";
case 11: return L"sldImg";
case 12: return L"sldNum";
case 13: return L"subTitle";
case 14: return L"tbl";
case 15: return L"title";
default: break;
}
return _T("body");
return L"body";
}
class CShapeWriter
@ -360,7 +360,7 @@ namespace PPT
m_pFontManager->SetStringGID(m_oFont.StringGID);
if (_T("") == m_oFont.Path)
if (L"" == m_oFont.Path)
{
m_pFontManager->LoadFontByName(m_oFont.Name, m_oFont.Size, m_oFont.GetStyle(), m_dDpiX, m_dDpiY);
}
@ -444,7 +444,7 @@ namespace PPT
}
void Close()
{
std::wstring str = _T("<a:close/>");
std::wstring str = L"<a:close/>";
m_oWriterPath.WriteString(str);
}

File diff suppressed because it is too large Load Diff

View File

@ -104,7 +104,7 @@ std::wstring CSlideInfo::GetFileNamePicture(_UINT32 lIndex)
{
return pic->second;
}
return _T("");
return L"";
}
int CSlideInfo::GetIndexPicture(int lIndex)

View File

@ -46,8 +46,8 @@ namespace PPT
//std::wstring SSlidePersist::ToString()
//{
// std::wstring str = _T("");
// str.Format(_T("<SlideInfo PsrRef='%d' SlideID='%d' />"), m_nPsrRef, m_nSlideID);
// std::wstring str = L"");
// str.Format(L"<SlideInfo PsrRef='%d' SlideID='%d' />"), m_nPsrRef, m_nSlideID);
// return str;
//}

View File

@ -152,7 +152,7 @@ void CRecordOfficeArtBlip::ReadFromStream(SRecordHeader & oHeader, POLE::Stream*
StreamUtils::StreamSkip(lOffset, pStream);
sExt = _T(".jpg");
sExt = L".jpg";
break;
}
case RECORD_TYPE_ESCHER_BLIP_PNG:
@ -162,7 +162,7 @@ void CRecordOfficeArtBlip::ReadFromStream(SRecordHeader & oHeader, POLE::Stream*
StreamUtils::StreamSkip(lOffset, pStream);
sExt = _T(".png");
sExt = L".png";
break;
}
case RECORD_TYPE_ESCHER_BLIP_DIB:
@ -172,7 +172,7 @@ void CRecordOfficeArtBlip::ReadFromStream(SRecordHeader & oHeader, POLE::Stream*
StreamUtils::StreamSkip(lOffset, pStream);
sExt = _T(".bmp");
sExt = L".bmp";
break;
}
case RECORD_TYPE_ESCHER_BLIP_TIFF:
@ -182,7 +182,7 @@ void CRecordOfficeArtBlip::ReadFromStream(SRecordHeader & oHeader, POLE::Stream*
StreamUtils::StreamSkip(lOffset, pStream);
sExt = _T(".tif");
sExt = L".tif";
break;
}
default:

View File

@ -2508,7 +2508,7 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme
}
}
if ((_T("") != strText) && 0 == pTextSettings->m_arParagraphs.size())
if ((L"" != strText) && 0 == pTextSettings->m_arParagraphs.size())
{
// значит никаких своих настроек нету. Значит просто пустые свои настройки
std::vector<CTextPFRunRecord> oArrayPF;