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

PPTFormat нумерация, даты, колонтитулы

правка багов

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@65445 954022d7-b5bf-4e40-9824-e11837661b57
parent 8d465218
...@@ -251,5 +251,6 @@ public: ...@@ -251,5 +251,6 @@ public:
void AddAnimation (DWORD dwSlideID, double Width, double Height, IElement* pElement); void AddAnimation (DWORD dwSlideID, double Width, double Height, IElement* pElement);
void AddAudioTransition (DWORD dwSlideID, CTransition* pTransition, const std::wstring& strFilePath); void AddAudioTransition (DWORD dwSlideID, CTransition* pTransition, const std::wstring& strFilePath);
int AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayoutAtom* layoutRecord, std::vector<CTextFullSettings> & text, bool addShapes = true); int AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayoutAtom* layoutRecord, std::vector<CTextFullSettings> & text,
CRecordHeadersFootersAtom* headers_footers = NULL, bool addShapes = true);
}; };
This diff is collapsed.
...@@ -1858,7 +1858,7 @@ protected: ...@@ -1858,7 +1858,7 @@ protected:
int ph_type = pShape->m_lPlaceholderType; int ph_type = pShape->m_lPlaceholderType;
int ph_pos = pShape->m_lPlaceholderID; int ph_pos = pShape->m_lPlaceholderID;
pTextSettings->m_lPlaceholderType = ph_type; pTextSettings->m_lPlaceholderType = pShape->m_lPlaceholderType;
size_t lElemsCount = 0; size_t lElemsCount = 0;
...@@ -2156,7 +2156,7 @@ protected: ...@@ -2156,7 +2156,7 @@ protected:
if (RECORD_TYPE_TEXTSPECINFO_ATOM == oHeader.RecType) if (RECORD_TYPE_TEXTSPECINFO_ATOM == oHeader.RecType)
{ {
CRecordTextSpecInfoAtom* pSpecInfo = new CRecordTextSpecInfoAtom(); CRecordTextSpecInfoAtom* pSpecInfo = new CRecordTextSpecInfoAtom();
pSpecInfo->m_lCount = strText.length(); pSpecInfo->m_lCount = -1;
pSpecInfo->ReadFromStream(oHeader, oElemInfo.m_pStream); pSpecInfo->ReadFromStream(oHeader, oElemInfo.m_pStream);
pSpecInfo->ApplyProperties(&(pShape->m_oShape.m_oText)); pSpecInfo->ApplyProperties(&(pShape->m_oShape.m_oText));
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
class CRecordHeadersFootersAtom : public CUnknownRecord class CRecordHeadersFootersAtom : public CUnknownRecord
{ {
public:
WORD m_nFormatID; WORD m_nFormatID;
bool m_bHasDate; bool m_bHasDate;
...@@ -12,8 +13,6 @@ class CRecordHeadersFootersAtom : public CUnknownRecord ...@@ -12,8 +13,6 @@ class CRecordHeadersFootersAtom : public CUnknownRecord
bool m_bHasHeader; bool m_bHasHeader;
bool m_bHasFooter; bool m_bHasFooter;
public:
CRecordHeadersFootersAtom() CRecordHeadersFootersAtom()
{ {
} }
...@@ -38,34 +37,14 @@ public: ...@@ -38,34 +37,14 @@ public:
} }
virtual CString ToString() virtual CString ToString()
{ {
XmlUtils::CXmlWriter oWriter; return L"";
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("FormatID"), (DWORD)m_nFormatID, &oWriter);
CDirectory::WriteValueToNode(_T("HasDate"), m_bHasDate, &oWriter);
CDirectory::WriteValueToNode(_T("HasTodayDate"), m_bHasTodayDate, &oWriter);
CDirectory::WriteValueToNode(_T("HasUserDate"), m_bHasUserDate, &oWriter);
CDirectory::WriteValueToNode(_T("HasSlideNumber"), m_bHasSlideNumber, &oWriter);
CDirectory::WriteValueToNode(_T("HasHeader"), m_bHasHeader, &oWriter);
CDirectory::WriteValueToNode(_T("HasFooter"), m_bHasFooter, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
} }
}; };
class CRecordRoundTripHeaderFooterDefaults12Atom : public CUnknownRecord class CRecordRoundTripHeaderFooterDefaults12Atom : public CUnknownRecord
{ {
public:
WORD m_nFormatID; WORD m_nFormatID;
bool m_bIncludeDate; bool m_bIncludeDate;
...@@ -73,8 +52,6 @@ class CRecordRoundTripHeaderFooterDefaults12Atom : public CUnknownRecord ...@@ -73,8 +52,6 @@ class CRecordRoundTripHeaderFooterDefaults12Atom : public CUnknownRecord
bool m_bIncludeHeader; bool m_bIncludeHeader;
bool m_bIncludeSlideNumber; bool m_bIncludeSlideNumber;
public:
CRecordRoundTripHeaderFooterDefaults12Atom() CRecordRoundTripHeaderFooterDefaults12Atom()
{ {
} }
......
...@@ -28,29 +28,24 @@ public: ...@@ -28,29 +28,24 @@ public:
m_oHeader = oHeader; m_oHeader = oHeader;
StreamUtils::StreamPosition(m_lOffsetInStream, pStream); StreamUtils::StreamPosition(m_lOffsetInStream, pStream);
if (0 == m_lCount)
{
StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream);
return;
}
DWORD lMemCount = 0; DWORD lMemCount = 0;
DWORD lCountItems = 0; while (true)
while (lMemCount < m_lCount + 1)
{ {
NSPresentationEditor::CTextSIRun elm; NSPresentationEditor::CTextSIRun elm;
m_arrSIs.push_back(elm); m_arrSIs.push_back(elm);
NSStreamReader::Read(pStream, m_arrSIs[lCountItems]); NSStreamReader::Read(pStream, m_arrSIs.back());
lMemCount += m_arrSIs[lCountItems].lCount; lMemCount += m_arrSIs.back().lCount;
int sz = pStream->tell() - m_lOffsetInStream;
++lCountItems; if (sz >= m_oHeader.RecLen)
break;
} }
// ... // ...
// (.. - placeholder ) - // (.. - placeholder ) -
// m_lCount... // m_lCount... m_lCount .. si
StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream); StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream);
} }
...@@ -62,7 +57,7 @@ public: ...@@ -62,7 +57,7 @@ public:
int ind = 0; int ind = 0;
for (int i = 0; i < pText->m_arParagraphs.size(); i++) for (int i = 0; i < pText->m_arParagraphs.size(); i++)
{ {
if (ind > m_arrSIs.size()) break; if (ind >= m_arrSIs.size()) break;
for (int j = 0 ; j < pText->m_arParagraphs[i].m_arSpans.size(); j++) for (int j = 0 ; j < pText->m_arParagraphs[i].m_arSpans.size(); j++)
{ {
...@@ -71,7 +66,7 @@ public: ...@@ -71,7 +66,7 @@ public:
pos_si += m_arrSIs[ind].lCount; pos_si += m_arrSIs[ind].lCount;
ind++; ind++;
} }
if (ind > m_arrSIs.size()) break; if (ind >= m_arrSIs.size()) break;
if (m_arrSIs[ind].bLang) if (m_arrSIs[ind].bLang)
pText->m_arParagraphs[i].m_arSpans[j].m_oRun.Language = m_arrSIs[ind].Lang; pText->m_arParagraphs[i].m_arSpans[j].m_oRun.Language = m_arrSIs[ind].Lang;
pos_text += pText->m_arParagraphs[i].m_arSpans[j].m_strText.length() ; pos_text += pText->m_arParagraphs[i].m_arSpans[j].m_strText.length() ;
......
...@@ -470,6 +470,10 @@ ...@@ -470,6 +470,10 @@
RelativePath="..\Reader\PPTFileReader.h" RelativePath="..\Reader\PPTFileReader.h"
> >
</File> </File>
<File
RelativePath="..\Reader\ReadStructures.cpp"
>
</File>
<File <File
RelativePath="..\Reader\ReadStructures.h" RelativePath="..\Reader\ReadStructures.h"
> >
...@@ -926,14 +930,6 @@ ...@@ -926,14 +930,6 @@
RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\Attributes.h" RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\Attributes.h"
> >
</File> </File>
<File
RelativePath="..\..\..\ASCPresentationEditor\PPTXWriter\Converter.cpp"
>
</File>
<File
RelativePath="..\..\..\ASCPresentationEditor\PPTXWriter\Converter.h"
>
</File>
<File <File
RelativePath="..\..\..\ASCPresentationEditor\PPTXWriter\CSS.h" RelativePath="..\..\..\ASCPresentationEditor\PPTXWriter\CSS.h"
> >
...@@ -1078,6 +1074,14 @@ ...@@ -1078,6 +1074,14 @@
RelativePath="..\..\..\ASCOfficeDocxFile2\BinReader\ContentTypesWriter.h" RelativePath="..\..\..\ASCOfficeDocxFile2\BinReader\ContentTypesWriter.h"
> >
</File> </File>
<File
RelativePath="..\..\..\ASCPresentationEditor\PPTXWriter\Converter.cpp"
>
</File>
<File
RelativePath="..\..\..\ASCPresentationEditor\PPTXWriter\Converter.h"
>
</File>
<File <File
RelativePath="..\..\..\ASCOfficeDocxFile2\BinReader\DefaultThemeWriterWin.h" RelativePath="..\..\..\ASCOfficeDocxFile2\BinReader\DefaultThemeWriterWin.h"
> >
......
This diff is collapsed.
...@@ -25,6 +25,7 @@ namespace NSPresentationEditor ...@@ -25,6 +25,7 @@ namespace NSPresentationEditor
ElementType m_etType; ElementType m_etType;
CDoubleRect m_rcBounds; CDoubleRect m_rcBounds;
CDoubleRect m_rcBoundsOriginal; CDoubleRect m_rcBoundsOriginal;
bool m_bBoundsEnabled;
double m_dStartTime; double m_dStartTime;
double m_dEndTime; double m_dEndTime;
...@@ -109,6 +110,8 @@ namespace NSPresentationEditor ...@@ -109,6 +110,8 @@ namespace NSPresentationEditor
m_etType = etPicture; m_etType = etPicture;
m_bBoundsEnabled = true;
m_rcBounds.left = 0; m_rcBounds.left = 0;
m_rcBounds.top = 0; m_rcBounds.top = 0;
m_rcBounds.right = 1; m_rcBounds.right = 1;
...@@ -160,6 +163,8 @@ namespace NSPresentationEditor ...@@ -160,6 +163,8 @@ namespace NSPresentationEditor
if (NULL == pDublicate) if (NULL == pDublicate)
return; return;
pDublicate->m_bBoundsEnabled = m_bBoundsEnabled;
pDublicate->m_bIsBackground = m_bIsBackground; pDublicate->m_bIsBackground = m_bIsBackground;
pDublicate->m_bHaveAnchor = m_bHaveAnchor; pDublicate->m_bHaveAnchor = m_bHaveAnchor;
......
...@@ -9,6 +9,8 @@ namespace NSPresentationEditor ...@@ -9,6 +9,8 @@ namespace NSPresentationEditor
std::vector<IElement*> m_arElements; std::vector<IElement*> m_arElements;
std::vector<CColor> m_arColorScheme; std::vector<CColor> m_arColorScheme;
std::map<int,int> m_pPlaceholders;
bool m_bUseThemeColorScheme; bool m_bUseThemeColorScheme;
// ""( ), // ""( ),
......
...@@ -27,6 +27,7 @@ namespace NSPresentationEditor ...@@ -27,6 +27,7 @@ namespace NSPresentationEditor
std::vector<IElement*> m_arElements; std::vector<IElement*> m_arElements;
std::map<int,int> m_pPlaceholders;
CMetricInfo m_oInfo; CMetricInfo m_oInfo;
std::wstring m_sThemeName; std::wstring m_sThemeName;
...@@ -35,12 +36,22 @@ namespace NSPresentationEditor ...@@ -35,12 +36,22 @@ namespace NSPresentationEditor
long m_lOriginalWidth; long m_lOriginalWidth;
long m_lOriginalHeight; long m_lOriginalHeight;
bool m_bHasDate;
bool m_bHasSlideNumber;
bool m_bHasHeader;
bool m_bHasFooter;
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
CTheme() : m_arColorScheme(), m_arFonts(), m_arBrushes(), CTheme() : m_arColorScheme(), m_arFonts(), m_arBrushes(),
m_arPens(), m_arEffects(), m_arLayouts() m_arPens(), m_arEffects(), m_arLayouts()
{ {
m_sThemeName = L"Default"; m_sThemeName = L"Default";
m_lOriginalWidth = m_lOriginalHeight = 0; m_lOriginalWidth = m_lOriginalHeight = 0;
m_bHasDate = false;
m_bHasSlideNumber = false;
m_bHasHeader = false;
m_bHasFooter = false;
} }
CTheme(const CTheme& oSrc) CTheme(const CTheme& oSrc)
...@@ -61,6 +72,10 @@ namespace NSPresentationEditor ...@@ -61,6 +72,10 @@ namespace NSPresentationEditor
m_lOriginalWidth = oSrc.m_lOriginalWidth ; m_lOriginalWidth = oSrc.m_lOriginalWidth ;
m_lOriginalHeight = oSrc.m_lOriginalHeight; m_lOriginalHeight = oSrc.m_lOriginalHeight;
m_bHasDate = oSrc.m_bHasDate;
m_bHasSlideNumber = oSrc.m_bHasSlideNumber;
m_bHasHeader = oSrc.m_bHasHeader;
m_bHasFooter = oSrc.m_bHasFooter;
for (int i = 0; i < oSrc.m_arExtraColorScheme.size(); ++i) for (int i = 0; i < oSrc.m_arExtraColorScheme.size(); ++i)
{ {
...@@ -129,6 +144,11 @@ namespace NSPresentationEditor ...@@ -129,6 +144,11 @@ namespace NSPresentationEditor
m_lOriginalWidth = m_lOriginalHeight = 0; m_lOriginalWidth = m_lOriginalHeight = 0;
m_sThemeName = L"Default"; m_sThemeName = L"Default";
m_bHasDate = false;
m_bHasSlideNumber = false;
m_bHasHeader = false;
m_bHasFooter = false;
} }
~CTheme() ~CTheme()
......
...@@ -766,7 +766,7 @@ void NSPresentationEditor::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRe ...@@ -766,7 +766,7 @@ void NSPresentationEditor::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRe
if (bIsEqualTransform) if (bIsEqualTransform)
{ {
if (pElement->m_rcBounds.IsEqual(pElLayout->m_rcBounds, 0.5)) if (pElement->m_rcBounds.IsEqual(pElLayout->m_rcBounds, 0.5))
m_pShapeWriter->SetIsWriteGeom(false); pElement->m_bBoundsEnabled = false;
} }
break; break;
......
...@@ -250,8 +250,6 @@ NSPresentationEditor::CShapeWriter::CShapeWriter() ...@@ -250,8 +250,6 @@ NSPresentationEditor::CShapeWriter::CShapeWriter()
m_pRels = NULL; m_pRels = NULL;
m_lNextShapeID = 1000; m_lNextShapeID = 1000;
m_bIsWriteGeom = true;
m_bWordArt = false; m_bWordArt = false;
m_bTextBox = false; m_bTextBox = false;
...@@ -956,30 +954,6 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo() ...@@ -956,30 +954,6 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
{ {
std::wstring str_lang = msLCID2wstring(pCF->Language.get()); std::wstring str_lang = msLCID2wstring(pCF->Language.get());
//#if defined(_WIN32) || defined(_WIN64)
// wchar_t buf[29] = {};
//
// int ccBuf = GetLocaleInfo(pCF->Language.get(), LOCALE_SISO639LANGNAME, buf, 29);
//
// if (ccBuf > 0)
// {
// str_lang.append(buf);
// str_lang.append(_T("-"));
// }
//
// ccBuf = GetLocaleInfo(pCF->Language.get(), LOCALE_SISO3166CTRYNAME, buf, 29);
//
// if (ccBuf > 0) str_lang.append(buf);
//#else
// for (int i = 0; i < 136; i++)
// {
// if (LCID_ms_convert[i].LCID_int == pCF->Language.get())
// {
// str_lang = LCID_ms_convert[i].LCID_string;
// break;
// }
// }
//#endif
if (str_lang.length() > 0) if (str_lang.length() > 0)
m_oWriter.WriteString(std::wstring(L" lang=\"") + str_lang + _T("\"")); m_oWriter.WriteString(std::wstring(L" lang=\"") + str_lang + _T("\""));
} }
...@@ -1105,7 +1079,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape() ...@@ -1105,7 +1079,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
m_oWriter.WriteString(std::wstring(L"<p:spPr>")); m_oWriter.WriteString(std::wstring(L"<p:spPr>"));
if (m_bIsWriteGeom) if (m_pShapeElement->m_bBoundsEnabled)
{ {
CString str; CString str;
...@@ -1237,7 +1211,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertImage() ...@@ -1237,7 +1211,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertImage()
m_oWriter.WriteString(std::wstring(L"<p:spPr>")); m_oWriter.WriteString(std::wstring(L"<p:spPr>"));
if (m_bIsWriteGeom) if (m_pImageElement->m_bBoundsEnabled)
{ {
CString str; CString str;
......
...@@ -48,7 +48,6 @@ namespace NSPresentationEditor ...@@ -48,7 +48,6 @@ namespace NSPresentationEditor
NSPresentationEditor::CRelsGenerator* m_pRels; NSPresentationEditor::CRelsGenerator* m_pRels;
LONG m_lNextShapeID; LONG m_lNextShapeID;
bool m_bIsWriteGeom;
bool m_bWordArt; bool m_bWordArt;
bool m_bTextBox; bool m_bTextBox;
...@@ -75,7 +74,6 @@ namespace NSPresentationEditor ...@@ -75,7 +74,6 @@ namespace NSPresentationEditor
m_oBounds = m_pImageElement->m_rcBounds; m_oBounds = m_pImageElement->m_rcBounds;
m_oTextRect = m_oBounds; m_oTextRect = m_oBounds;
m_bIsWriteGeom = true;
m_bWordArt = false; m_bWordArt = false;
m_bTextBox = false; m_bTextBox = false;
...@@ -93,7 +91,6 @@ namespace NSPresentationEditor ...@@ -93,7 +91,6 @@ namespace NSPresentationEditor
m_oBounds = m_pShapeElement->m_rcBounds; m_oBounds = m_pShapeElement->m_rcBounds;
m_oTextRect = m_oBounds; m_oTextRect = m_oBounds;
m_bIsWriteGeom = true;
m_bWordArt = false; m_bWordArt = false;
m_bTextBox = false; m_bTextBox = false;
...@@ -106,10 +103,6 @@ namespace NSPresentationEditor ...@@ -106,10 +103,6 @@ namespace NSPresentationEditor
m_oWriterPath.ClearNoAttack(); m_oWriterPath.ClearNoAttack();
m_oWriterVML.ClearNoAttack(); m_oWriterVML.ClearNoAttack();
} }
AVSINLINE void SetIsWriteGeom(bool bIsWrite)
{
m_bIsWriteGeom = bIsWrite;
}
//-------------------------------------------------------------------- //--------------------------------------------------------------------
CString ConvertShape (); CString ConvertShape ();
CString ConvertImage (); CString ConvertImage ();
......
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