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

PPTFormat

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@65404 954022d7-b5bf-4e40-9824-e11837661b57
parent fb9ac6f1
...@@ -816,15 +816,16 @@ namespace NSPresentationEditor ...@@ -816,15 +816,16 @@ namespace NSPresentationEditor
int nIndexLast = strText.GetLength(); int nIndexLast = strText.GetLength();
int nIndexText = 0; int nIndexText = 0;
for (int nIndexPF = 0; nIndexPF < nCountPFs; ++nIndexPF) for (int nIndexPF = 0; nIndexPF < nCountPFs; ++nIndexPF)
{ {
CParagraph elm; CParagraph elm;
oAttributes.m_arParagraphs.push_back(elm); oAttributes.m_arParagraphs.push_back(elm);
NSPresentationEditor::CParagraph* pPar = &oAttributes.m_arParagraphs[nIndexPF]; NSPresentationEditor::CParagraph* pPar = &oAttributes.m_arParagraphs[nIndexPF];
pPar->m_oPFRun = oArrayPF[nIndexPF].m_oRun; pPar->m_oPFRun = oArrayPF[nIndexPF].m_oRun;
pPar->m_lTextType = oAttributes.m_lTextType; pPar->m_lTextType = oAttributes.m_lTextType;
pPar->m_lTextLevel = oArrayPF[nIndexPF].m_lLevel; pPar->m_lTextLevel = oArrayPF[nIndexPF].m_lLevel;
int nCountInPF = oArrayPF[nIndexPF].m_lCount; int nCountInPF = oArrayPF[nIndexPF].m_lCount;
......
...@@ -2181,6 +2181,7 @@ protected: ...@@ -2181,6 +2181,7 @@ protected:
NSPresentationEditor::ConvertPPTTextToEditorStructure(oArrayPF, oArrayCF, strText, *pTextSettings); NSPresentationEditor::ConvertPPTTextToEditorStructure(oArrayPF, oArrayCF, strText, *pTextSettings);
} }
pShape->m_oShape.m_oText.RecalcParagraphsPPT(pTheme);
if (pShape->m_oActions.m_bPresent) if (pShape->m_oActions.m_bPresent)
{ {
......
...@@ -76,7 +76,7 @@ namespace NSPresentationEditor ...@@ -76,7 +76,7 @@ namespace NSPresentationEditor
#ifdef PPT_DEF #ifdef PPT_DEF
#ifndef PPTX_DEF #ifndef PPTX_DEF
CorrectRuler(&oPFRun, (WORD)lLevel); ApplyRuler(&oPFRun, (WORD)lLevel);
#endif #endif
#endif #endif
...@@ -285,6 +285,8 @@ namespace NSPresentationEditor ...@@ -285,6 +285,8 @@ namespace NSPresentationEditor
{ {
m_arParagraphs[i].CheckErrors(); m_arParagraphs[i].CheckErrors();
} }
ApplyRuler(pTheme);
} }
void CTextAttributesEx::RecalcParagraphs(CTheme* pTheme) void CTextAttributesEx::RecalcParagraphs(CTheme* pTheme)
...@@ -299,13 +301,45 @@ namespace NSPresentationEditor ...@@ -299,13 +301,45 @@ namespace NSPresentationEditor
} }
#endif #endif
} }
void CTextAttributesEx::NormalizeCoordsByMetric(const CMetricInfo & oMetric) void CTextAttributesEx::ApplyRuler(CTheme* pTheme)
{ {
if (m_oRuler.tabsStops.size() > 0 || m_oRuler.DefaultTabSize.is_init())//presentacio1.ppt 2
{
for (long i = 0; i < 9 ;i++)
{
if (m_oStyles.m_pLevels[i].is_init() == false)
{
m_oStyles.m_pLevels[i] = pTheme->m_pStyles[0].m_pLevels[i];
}
if (m_oRuler.tabsStops.size() > 0)
{
m_oStyles.m_pLevels[i]->m_oPFRun.tabStops = m_oRuler.tabsStops;
}
if (m_oRuler.DefaultTabSize.is_init())
{
m_oStyles.m_pLevels[i]->m_oPFRun.defaultTabSize = m_oRuler.DefaultTabSize;
}
}
}
size_t lCount = m_arParagraphs.size(); size_t lCount = m_arParagraphs.size();
for (size_t i = 0; i < lCount; ++i) for (size_t i = 0; i < lCount; ++i)
{ {
CTextPFRun* pPar = &m_arParagraphs[i].m_oPFRun; CTextPFRun* pPar = &m_arParagraphs[i].m_oPFRun;
if (m_oRuler.tabsStops.size() > 0)
{
pPar->tabStops = m_oRuler.tabsStops;
if (pPar->defaultTabSize.is_init() == false)
pPar->defaultTabSize = m_oRuler.tabsStops[0];
}
if (m_oRuler.DefaultTabSize.is_init())
{
pPar->defaultTabSize = m_oRuler.DefaultTabSize;
}
WORD lIndentLevel = (WORD)m_arParagraphs[i].m_lTextLevel; WORD lIndentLevel = (WORD)m_arParagraphs[i].m_lTextLevel;
switch (lIndentLevel) switch (lIndentLevel)
......
...@@ -64,8 +64,8 @@ namespace NSPresentationEditor ...@@ -64,8 +64,8 @@ namespace NSPresentationEditor
m_oBounds.right = 50; m_oBounds.right = 50;
m_oBounds.bottom = 50; m_oBounds.bottom = 50;
m_bVertical = false; m_bVertical = false;
m_bRightToLeft = false; m_bRightToLeft = false;
m_lWrapMode = 0; m_lWrapMode = 0;
m_lTextMasterType = -1; m_lTextMasterType = -1;
...@@ -117,90 +117,13 @@ namespace NSPresentationEditor ...@@ -117,90 +117,13 @@ namespace NSPresentationEditor
strText.Replace(_T("<"), _T("&lt;")); strText.Replace(_T("<"), _T("&lt;"));
strText.Replace(_T(">"), _T("&gt;")); strText.Replace(_T(">"), _T("&gt;"));
strText.Replace(_T("\""), _T("&quot;")); strText.Replace(_T("\""), _T("&quot;"));
//
//BSTR bsText = strText.AllocSysString();
//strText = (CString)bsText;
//SysFreeString(bsText);
} }
void RecalcParagraphs (CTheme* pTheme = NULL); void RecalcParagraphs (CTheme* pTheme = NULL);
void RecalcParagraphsPPT(CTheme* pTheme = NULL); void RecalcParagraphsPPT(CTheme* pTheme = NULL);
void NormalizeCoordsByMetric(const CMetricInfo & oMetric); void ApplyRuler (CTheme* pTheme);
void ApplyRuler (CTextPFRun* pPar, WORD lIndentLevel)
void CorrectRuler()
{
size_t lCount = m_arParagraphs.size();
for (size_t i = 0; i < lCount; ++i)
{
CTextPFRun* pPar = &m_arParagraphs[i].m_oPFRun;
WORD lIndentLevel = (WORD)m_arParagraphs[i].m_lTextLevel;
switch (lIndentLevel)
{
case 0:
{
if (m_oRuler.LeftMargin1.is_init())
pPar->leftMargin = (LONG)m_oRuler.LeftMargin1.get();
if (m_oRuler.Indent1.is_init())
pPar->indent = (LONG)m_oRuler.Indent1.get();
if (pPar->indent.is_init() && pPar->leftMargin.get())
pPar->indent.get() -= pPar->leftMargin.get();
break;
}
case 1:
{
if (m_oRuler.LeftMargin2.is_init())
pPar->leftMargin = (LONG)m_oRuler.LeftMargin2.get();
if (m_oRuler.Indent2.is_init())
pPar->indent = (LONG)m_oRuler.Indent2.get();
if (pPar->indent.is_init() && pPar->leftMargin.get())
pPar->indent.get() -= pPar->leftMargin.get();
break;
}
case 2:
{
if (m_oRuler.LeftMargin3.is_init())
pPar->leftMargin = (LONG)m_oRuler.LeftMargin3.get();
if (m_oRuler.Indent3.is_init())
pPar->indent = (LONG)m_oRuler.Indent3.get();
if (pPar->indent.is_init() && pPar->leftMargin.get())
pPar->indent.get() -= pPar->leftMargin.get();
break;
}
case 3:
{
if (m_oRuler.LeftMargin4.is_init())
pPar->leftMargin = (LONG)m_oRuler.LeftMargin4.get();
if (m_oRuler.Indent4.is_init())
pPar->indent = (LONG)m_oRuler.Indent4.get();
if (pPar->indent.is_init() && pPar->leftMargin.get())
pPar->indent.get() -= pPar->leftMargin.get();
break;
}
case 4:
{
if (m_oRuler.LeftMargin5.is_init())
pPar->leftMargin = (LONG)m_oRuler.LeftMargin5.get();
if (m_oRuler.Indent5.is_init())
pPar->indent = (LONG)m_oRuler.Indent5.get();
if (pPar->indent.is_init() && pPar->leftMargin.get())
pPar->indent.get() -= pPar->leftMargin.get();
break;
}
default:
break;
}
}
}
void CorrectRuler(CTextPFRun* pPar, WORD lIndentLevel)
{ {
switch (lIndentLevel) switch (lIndentLevel)
{ {
......
...@@ -174,53 +174,34 @@ namespace NSPresentationEditor ...@@ -174,53 +174,34 @@ namespace NSPresentationEditor
AVSINLINE void ApplyBefore(const CTextCFRun& oSrc) AVSINLINE void ApplyBefore(const CTextCFRun& oSrc)
{ {
if (!FontBold.is_init()) if (!FontBold.is_init()) FontBold = oSrc.FontBold;
FontBold = oSrc.FontBold; if (!FontItalic.is_init()) FontItalic = oSrc.FontItalic;
if (!FontItalic.is_init()) if (!FontUnderline.is_init()) FontUnderline = oSrc.FontUnderline;
FontItalic = oSrc.FontItalic; if (!FontStrikeout.is_init()) FontStrikeout = oSrc.FontStrikeout;
if (!FontUnderline.is_init()) if (!FontShadow.is_init()) FontShadow = oSrc.FontShadow;
FontUnderline = oSrc.FontUnderline;
if (!FontStrikeout.is_init())
FontStrikeout = oSrc.FontStrikeout;
if (!FontShadow.is_init())
FontShadow = oSrc.FontShadow;
if (!Typeface.is_init()) if (!Typeface.is_init()) Typeface = oSrc.Typeface;
Typeface = oSrc.Typeface; if (!EAFontRef.is_init()) EAFontRef = oSrc.EAFontRef;
if (!EAFontRef.is_init()) if (!AnsiFontRef.is_init()) AnsiFontRef = oSrc.AnsiFontRef;
EAFontRef = oSrc.EAFontRef; if (!SymbolFontRef.is_init()) SymbolFontRef = oSrc.SymbolFontRef;
if (!AnsiFontRef.is_init())
AnsiFontRef = oSrc.AnsiFontRef;
if (!SymbolFontRef.is_init())
SymbolFontRef = oSrc.SymbolFontRef;
if (!BaseLineOffset.is_init()) if (!BaseLineOffset.is_init()) BaseLineOffset = oSrc.BaseLineOffset;
BaseLineOffset = oSrc.BaseLineOffset;
if (!Color.is_init()) if (!Color.is_init()) Color = oSrc.Color;
Color = oSrc.Color;
if (!Size.is_init()) if (!Size.is_init()) Size = oSrc.Size;
Size = oSrc.Size;
if (!Cap.is_init()) if (!Cap.is_init()) Cap = oSrc.Cap;
Cap = oSrc.Cap;
if (!FontProperties.is_init()) if (!FontProperties.is_init()) FontProperties = oSrc.FontProperties;
FontProperties = oSrc.FontProperties;
} }
AVSINLINE void ApplyAfter(const CTextCFRun& oSrc) AVSINLINE void ApplyAfter(const CTextCFRun& oSrc)
{ {
if (oSrc.FontBold.is_init()) if (oSrc.FontBold.is_init()) FontBold = oSrc.FontBold;
FontBold = oSrc.FontBold; if (oSrc.FontItalic.is_init()) FontItalic = oSrc.FontItalic;
if (oSrc.FontItalic.is_init()) if (oSrc.FontUnderline.is_init()) FontUnderline = oSrc.FontUnderline;
FontItalic = oSrc.FontItalic; if (oSrc.FontStrikeout.is_init()) FontStrikeout = oSrc.FontStrikeout;
if (oSrc.FontUnderline.is_init()) if (oSrc.FontShadow.is_init()) FontShadow = oSrc.FontShadow;
FontUnderline = oSrc.FontUnderline;
if (oSrc.FontStrikeout.is_init())
FontStrikeout = oSrc.FontStrikeout;
if (oSrc.FontShadow.is_init())
FontShadow = oSrc.FontShadow;
bool bTypefaceSetUp = false; bool bTypefaceSetUp = false;
if (oSrc.Typeface.is_init()) if (oSrc.Typeface.is_init())
...@@ -228,24 +209,17 @@ namespace NSPresentationEditor ...@@ -228,24 +209,17 @@ namespace NSPresentationEditor
Typeface = oSrc.Typeface; Typeface = oSrc.Typeface;
bTypefaceSetUp = true; bTypefaceSetUp = true;
} }
if (oSrc.EAFontRef.is_init()) if (oSrc.EAFontRef.is_init()) EAFontRef = oSrc.EAFontRef;
EAFontRef = oSrc.EAFontRef; if (oSrc.AnsiFontRef.is_init()) AnsiFontRef = oSrc.AnsiFontRef;
if (oSrc.AnsiFontRef.is_init()) if (oSrc.SymbolFontRef.is_init()) SymbolFontRef = oSrc.SymbolFontRef;
AnsiFontRef = oSrc.AnsiFontRef;
if (oSrc.SymbolFontRef.is_init())
SymbolFontRef = oSrc.SymbolFontRef;
if (oSrc.BaseLineOffset.is_init()) if (oSrc.BaseLineOffset.is_init()) BaseLineOffset = oSrc.BaseLineOffset;
BaseLineOffset = oSrc.BaseLineOffset;
if (oSrc.Color.is_init()) if (oSrc.Color.is_init()) Color = oSrc.Color;
Color = oSrc.Color;
if (oSrc.Size.is_init()) if (oSrc.Size.is_init()) Size = oSrc.Size;
Size = oSrc.Size;
if (oSrc.Cap.is_init()) if (oSrc.Cap.is_init()) Cap = oSrc.Cap;
Cap = oSrc.Cap;
if (oSrc.FontProperties.is_init()) if (oSrc.FontProperties.is_init())
{ {
...@@ -355,7 +329,7 @@ namespace NSPresentationEditor ...@@ -355,7 +329,7 @@ namespace NSPresentationEditor
{ {
public: public:
NSCommon::nullable_base<bool> hasBullet; NSCommon::nullable_base<bool> hasBullet;
NSCommon::nullable_base<WORD> bulletFontRef; NSCommon::nullable_base<WORD> bulletFontRef;
NSCommon::nullable_base<WORD> bulletSize; NSCommon::nullable_base<WORD> bulletSize;
...@@ -462,39 +436,24 @@ namespace NSPresentationEditor ...@@ -462,39 +436,24 @@ namespace NSPresentationEditor
void ApplyAfter(const CTextPFRun& oSrc) void ApplyAfter(const CTextPFRun& oSrc)
{ {
if (oSrc.hasBullet.is_init()) if (oSrc.hasBullet.is_init()) hasBullet = oSrc.hasBullet;
hasBullet = oSrc.hasBullet;
if (oSrc.bulletFontRef.is_init()) if (oSrc.bulletFontRef.is_init()) bulletFontRef = oSrc.bulletFontRef;
bulletFontRef = oSrc.bulletFontRef; if (oSrc.bulletSize.is_init()) bulletSize = oSrc.bulletSize;
if (oSrc.bulletSize.is_init()) if (oSrc.bulletChar.is_init()) bulletChar = oSrc.bulletChar;
bulletSize = oSrc.bulletSize; if (oSrc.bulletColor.is_init()) bulletColor = oSrc.bulletColor;
if (oSrc.bulletChar.is_init())
bulletChar = oSrc.bulletChar;
if (oSrc.bulletColor.is_init())
bulletColor = oSrc.bulletColor;
if (oSrc.textAlignment.is_init()) if (oSrc.textAlignment.is_init()) textAlignment = oSrc.textAlignment;
textAlignment = oSrc.textAlignment; if (oSrc.lineSpacing.is_init()) lineSpacing = oSrc.lineSpacing;
if (oSrc.lineSpacing.is_init()) if (oSrc.spaceBefore.is_init()) spaceBefore = oSrc.spaceBefore;
lineSpacing = oSrc.lineSpacing; if (oSrc.spaceAfter.is_init()) spaceAfter = oSrc.spaceAfter;
if (oSrc.spaceBefore.is_init()) if (oSrc.leftMargin.is_init()) leftMargin = oSrc.leftMargin;
spaceBefore = oSrc.spaceBefore; if (oSrc.indent.is_init()) indent = oSrc.indent;
if (oSrc.spaceAfter.is_init()) if (oSrc.defaultTabSize.is_init()) defaultTabSize = oSrc.defaultTabSize;
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()) if (oSrc.fontAlign.is_init()) fontAlign = oSrc.fontAlign;
fontAlign = oSrc.fontAlign; if (oSrc.textDirection.is_init()) textDirection = oSrc.textDirection;
if (oSrc.textDirection.is_init()) if (oSrc.wrapFlags.is_init()) wrapFlags = oSrc.wrapFlags;
textDirection = oSrc.textDirection;
if (oSrc.wrapFlags.is_init())
wrapFlags = oSrc.wrapFlags;
if (0 != oSrc.tabStops.size()) if (0 != oSrc.tabStops.size())
{ {
...@@ -640,32 +599,20 @@ namespace NSPresentationEditor ...@@ -640,32 +599,20 @@ namespace NSPresentationEditor
void ApplyBefore(const CTextRuler& oSrc) void ApplyBefore(const CTextRuler& oSrc)
{ {
if (!DefaultTabSize.is_init()) if (!DefaultTabSize.is_init()) DefaultTabSize = oSrc.DefaultTabSize;
DefaultTabSize = oSrc.DefaultTabSize; if (!CLevels.is_init()) CLevels = oSrc.CLevels;
if (!CLevels.is_init())
CLevels = oSrc.CLevels;
if (!LeftMargin1.is_init()) if (!LeftMargin1.is_init()) LeftMargin1 = oSrc.LeftMargin1;
LeftMargin1 = oSrc.LeftMargin1; if (!LeftMargin2.is_init()) LeftMargin2 = oSrc.LeftMargin2;
if (!LeftMargin2.is_init()) if (!LeftMargin3.is_init()) LeftMargin3 = oSrc.LeftMargin3;
LeftMargin2 = oSrc.LeftMargin2; if (!LeftMargin4.is_init()) LeftMargin4 = oSrc.LeftMargin4;
if (!LeftMargin3.is_init()) if (!LeftMargin5.is_init()) LeftMargin5 = oSrc.LeftMargin5;
LeftMargin3 = oSrc.LeftMargin3;
if (!LeftMargin4.is_init()) if (!Indent1.is_init()) Indent1 = oSrc.Indent1;
LeftMargin4 = oSrc.LeftMargin4; if (!Indent2.is_init()) Indent2 = oSrc.Indent2;
if (!LeftMargin5.is_init()) if (!Indent3.is_init()) Indent3 = oSrc.Indent3;
LeftMargin5 = oSrc.LeftMargin5; if (!Indent4.is_init()) Indent4 = oSrc.Indent4;
if (!Indent5.is_init()) Indent5 = oSrc.Indent5;
if (!Indent1.is_init())
Indent1 = oSrc.Indent1;
if (!Indent2.is_init())
Indent2 = oSrc.Indent2;
if (!Indent3.is_init())
Indent3 = oSrc.Indent3;
if (!Indent4.is_init())
Indent4 = oSrc.Indent4;
if (!Indent5.is_init())
Indent5 = oSrc.Indent5;
tabsStops.insert(tabsStops.end(), oSrc.tabsStops.begin(), oSrc.tabsStops.end()); tabsStops.insert(tabsStops.end(), oSrc.tabsStops.begin(), oSrc.tabsStops.end());
} }
...@@ -743,7 +690,7 @@ namespace NSPresentationEditor ...@@ -743,7 +690,7 @@ namespace NSPresentationEditor
class CTextSIRun class CTextSIRun
{ {
public: public:
bool bIsExt; bool bIsExt;
DWORD lCount; DWORD lCount;
bool bSpell; bool bSpell;
...@@ -769,7 +716,7 @@ namespace NSPresentationEditor ...@@ -769,7 +716,7 @@ namespace NSPresentationEditor
CTextSIRun() CTextSIRun()
{ {
bIsExt = true; bIsExt = true;
lCount = 0; lCount = 0;
bSpell = false; bSpell = false;
...@@ -1006,7 +953,9 @@ namespace NSPresentationEditor ...@@ -1006,7 +953,9 @@ namespace NSPresentationEditor
CTextStyles() CTextStyles()
{ {
for (int i = 0; i < 10; ++i) for (int i = 0; i < 10; ++i)
{
m_pLevels[i] = NULL; m_pLevels[i] = NULL;
}
} }
CTextStyles(const CTextStyles& oSrc) CTextStyles(const CTextStyles& oSrc)
{ {
...@@ -1015,23 +964,30 @@ namespace NSPresentationEditor ...@@ -1015,23 +964,30 @@ namespace NSPresentationEditor
CTextStyles& operator=(const CTextStyles& oSrc) CTextStyles& operator=(const CTextStyles& oSrc)
{ {
for (int i = 0; i < 10; ++i) for (int i = 0; i < 10; ++i)
{
m_pLevels[i] = oSrc.m_pLevels[i]; m_pLevels[i] = oSrc.m_pLevels[i];
}
return *this; return *this;
} }
void SetStyles(CTextStyles* pStyles) void SetStyles(CTextStyles* pStyles)
{ {
for (int i = 0; i < 10; ++i) for (int i = 0; i < 10; ++i)
{
m_pLevels[i] = pStyles->m_pLevels[i]; m_pLevels[i] = pStyles->m_pLevels[i];
}
} }
void ApplyAfter(const CTextStyles& oSrc) void ApplyAfter(const CTextStyles& oSrc)
{ {
for (int i = 0; i < 10; ++i) for (int i = 0; i < 10; ++i)
{ {
if (!m_pLevels[i].is_init()) if (!m_pLevels[i].is_init())
{
m_pLevels[i] = oSrc.m_pLevels[i]; m_pLevels[i] = oSrc.m_pLevels[i];
}
else if (oSrc.m_pLevels[i].is_init()) else if (oSrc.m_pLevels[i].is_init())
{
m_pLevels[i]->ApplyAfter(oSrc.m_pLevels[i].get()); m_pLevels[i]->ApplyAfter(oSrc.m_pLevels[i].get());
}
} }
} }
...@@ -1040,9 +996,13 @@ namespace NSPresentationEditor ...@@ -1040,9 +996,13 @@ namespace NSPresentationEditor
for (int i = 0; i < 10; ++i) for (int i = 0; i < 10; ++i)
{ {
if (!m_pLevels[i].is_init()) if (!m_pLevels[i].is_init())
{
m_pLevels[i] = oSrc.m_pLevels[i]; m_pLevels[i] = oSrc.m_pLevels[i];
}
else if (oSrc.m_pLevels[i].is_init()) else if (oSrc.m_pLevels[i].is_init())
{
m_pLevels[i]->ApplyBefore(oSrc.m_pLevels[i].get()); m_pLevels[i]->ApplyBefore(oSrc.m_pLevels[i].get());
}
} }
} }
......
...@@ -742,9 +742,6 @@ void NSPresentationEditor::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRe ...@@ -742,9 +742,6 @@ void NSPresentationEditor::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRe
pShapeElem->m_oMetric = m_pDocument->m_oInfo; pShapeElem->m_oMetric = m_pDocument->m_oInfo;
pShapeElem->NormalizeCoordsByMetric(); pShapeElem->NormalizeCoordsByMetric();
pShapeElem->m_oShape.m_oText.RecalcParagraphsPPT(pShapeElem->m_pTheme);
pShapeElem->m_oShape.m_oText.NormalizeCoordsByMetric(m_pDocument->m_oInfo);
m_pShapeWriter->SetShape(pShapeElem); m_pShapeWriter->SetShape(pShapeElem);
} }
......
...@@ -589,7 +589,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo() ...@@ -589,7 +589,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
{ {
if (TRUE) if (TRUE)
{ {
if ((nSpan == (nCountSpans - 1)) && (_T("\n") == pParagraph->m_arSpans[nSpan].m_strText)) if ((nSpan == (nCountSpans - 1)) && (_T("\n") == pParagraph->m_arSpans[nSpan].m_strText || pParagraph->m_arSpans[nSpan].m_strText.IsEmpty()) )
{ {
NSPresentationEditor::CTextCFRun* pCF = &pParagraph->m_arSpans[nSpan].m_oRun; NSPresentationEditor::CTextCFRun* pCF = &pParagraph->m_arSpans[nSpan].m_oRun;
if (pCF->Size.is_init()) if (pCF->Size.is_init())
...@@ -658,6 +658,14 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo() ...@@ -658,6 +658,14 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
else else
m_oWriter.WriteString(std::wstring(L" i=\"0\"")); m_oWriter.WriteString(std::wstring(L" i=\"0\""));
} }
if (pCF->FontUnderline.is_init())
{
if (pCF->FontUnderline.get())
m_oWriter.WriteString(std::wstring(L" u=\"sng\""));
else
m_oWriter.WriteString(std::wstring(L" u=\"none\""));
}
m_oWriter.WriteString(std::wstring(L">")); m_oWriter.WriteString(std::wstring(L">"));
if (m_bWordArt) if (m_bWordArt)
......
...@@ -115,7 +115,7 @@ public: ...@@ -115,7 +115,7 @@ public:
static void ConvertStyleLevel(NSPresentationEditor::CTextStyleLevel& oLevel, NSPresentationEditor::CMetricInfo& oMetricInfo, static void ConvertStyleLevel(NSPresentationEditor::CTextStyleLevel& oLevel, NSPresentationEditor::CMetricInfo& oMetricInfo,
NSPresentationEditor::CStringWriter& oWriter, const int& nLevel) NSPresentationEditor::CStringWriter& oWriter, const int& nLevel)
{ {
CString str1 = _T(""); CString str1;
if (nLevel == 9) if (nLevel == 9)
str1 = _T("<a:defPPr"); str1 = _T("<a:defPPr");
else else
...@@ -132,7 +132,7 @@ public: ...@@ -132,7 +132,7 @@ public:
} }
if (pPF->leftMargin.is_init()) if (pPF->leftMargin.is_init())
{ {
CString strProp = _T(""); CString strProp;
strProp.Format(_T(" marL=\"%d\""), pPF->leftMargin.get()); strProp.Format(_T(" marL=\"%d\""), pPF->leftMargin.get());
oWriter.WriteString(strProp); oWriter.WriteString(strProp);
...@@ -141,8 +141,7 @@ public: ...@@ -141,8 +141,7 @@ public:
} }
if (pPF->indent.is_init()) if (pPF->indent.is_init())
{ {
int ind = pPF->indent.get(); CString strProp;
CString strProp = _T("");
strProp.Format(_T(" indent=\"%d\""), pPF->indent.get()); strProp.Format(_T(" indent=\"%d\""), pPF->indent.get());
oWriter.WriteString(strProp); oWriter.WriteString(strProp);
} }
...@@ -153,13 +152,25 @@ public: ...@@ -153,13 +152,25 @@ public:
//} //}
if (pPF->defaultTabSize.is_init()) if (pPF->defaultTabSize.is_init())
{ {
CString strProp = _T(""); CString strProp;
strProp.Format(_T(" defTabSz=\"%d\""), pPF->defaultTabSize.get()); strProp.Format(_T(" defTabSz=\"%d\""), pPF->defaultTabSize.get());
oWriter.WriteString(strProp); oWriter.WriteString(strProp);
} }
CString str2 = _T(">"); CString str2 = _T(">");
oWriter.WriteString(str2); oWriter.WriteString(str2);
if (pPF->tabStops.size() > 0)
{
oWriter.WriteString(std::wstring(L"<a:tabLst>"));
for (int t = 0 ; t < pPF->tabStops.size(); t++)
{
CString strTab;
strTab.Format(L"<a:tab pos=\"%d\" algn=\"l\"/>", pPF->tabStops[t]) ;
oWriter.WriteString(strTab);
}
oWriter.WriteString(std::wstring(L"</a:tabLst>"));
}
if (pPF->hasBullet.is_init()) if (pPF->hasBullet.is_init())
{ {
if (pPF->hasBullet.get()) if (pPF->hasBullet.get())
......
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