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:
void AddAnimation (DWORD dwSlideID, double Width, double Height, IElement* pElement);
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:
int ph_type = pShape->m_lPlaceholderType;
int ph_pos = pShape->m_lPlaceholderID;
pTextSettings->m_lPlaceholderType = ph_type;
pTextSettings->m_lPlaceholderType = pShape->m_lPlaceholderType;
size_t lElemsCount = 0;
......@@ -2156,7 +2156,7 @@ protected:
if (RECORD_TYPE_TEXTSPECINFO_ATOM == oHeader.RecType)
{
CRecordTextSpecInfoAtom* pSpecInfo = new CRecordTextSpecInfoAtom();
pSpecInfo->m_lCount = strText.length();
pSpecInfo->m_lCount = -1;
pSpecInfo->ReadFromStream(oHeader, oElemInfo.m_pStream);
pSpecInfo->ApplyProperties(&(pShape->m_oShape.m_oText));
......
......@@ -3,6 +3,7 @@
class CRecordHeadersFootersAtom : public CUnknownRecord
{
public:
WORD m_nFormatID;
bool m_bHasDate;
......@@ -12,8 +13,6 @@ class CRecordHeadersFootersAtom : public CUnknownRecord
bool m_bHasHeader;
bool m_bHasFooter;
public:
CRecordHeadersFootersAtom()
{
}
......@@ -38,34 +37,14 @@ public:
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
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();
return L"";
}
};
class CRecordRoundTripHeaderFooterDefaults12Atom : public CUnknownRecord
{
public:
WORD m_nFormatID;
bool m_bIncludeDate;
......@@ -73,8 +52,6 @@ class CRecordRoundTripHeaderFooterDefaults12Atom : public CUnknownRecord
bool m_bIncludeHeader;
bool m_bIncludeSlideNumber;
public:
CRecordRoundTripHeaderFooterDefaults12Atom()
{
}
......
......@@ -28,29 +28,24 @@ public:
m_oHeader = oHeader;
StreamUtils::StreamPosition(m_lOffsetInStream, pStream);
if (0 == m_lCount)
{
StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream);
return;
}
DWORD lMemCount = 0;
DWORD lCountItems = 0;
while (lMemCount < m_lCount + 1)
while (true)
{
NSPresentationEditor::CTextSIRun elm;
m_arrSIs.push_back(elm);
NSStreamReader::Read(pStream, m_arrSIs[lCountItems]);
lMemCount += m_arrSIs[lCountItems].lCount;
NSStreamReader::Read(pStream, m_arrSIs.back());
lMemCount += m_arrSIs.back().lCount;
int sz = pStream->tell() - m_lOffsetInStream;
++lCountItems;
if (sz >= m_oHeader.RecLen)
break;
}
// ...
// (.. - placeholder ) -
// m_lCount...
// m_lCount... m_lCount .. si
StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream);
}
......@@ -62,7 +57,7 @@ public:
int ind = 0;
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++)
{
......@@ -71,7 +66,7 @@ public:
pos_si += m_arrSIs[ind].lCount;
ind++;
}
if (ind > m_arrSIs.size()) break;
if (ind >= m_arrSIs.size()) break;
if (m_arrSIs[ind].bLang)
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() ;
......
......@@ -470,6 +470,10 @@
RelativePath="..\Reader\PPTFileReader.h"
>
</File>
<File
RelativePath="..\Reader\ReadStructures.cpp"
>
</File>
<File
RelativePath="..\Reader\ReadStructures.h"
>
......@@ -926,14 +930,6 @@
RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\Attributes.h"
>
</File>
<File
RelativePath="..\..\..\ASCPresentationEditor\PPTXWriter\Converter.cpp"
>
</File>
<File
RelativePath="..\..\..\ASCPresentationEditor\PPTXWriter\Converter.h"
>
</File>
<File
RelativePath="..\..\..\ASCPresentationEditor\PPTXWriter\CSS.h"
>
......@@ -1078,6 +1074,14 @@
RelativePath="..\..\..\ASCOfficeDocxFile2\BinReader\ContentTypesWriter.h"
>
</File>
<File
RelativePath="..\..\..\ASCPresentationEditor\PPTXWriter\Converter.cpp"
>
</File>
<File
RelativePath="..\..\..\ASCPresentationEditor\PPTXWriter\Converter.h"
>
</File>
<File
RelativePath="..\..\..\ASCOfficeDocxFile2\BinReader\DefaultThemeWriterWin.h"
>
......
This diff is collapsed.
......@@ -25,6 +25,7 @@ namespace NSPresentationEditor
ElementType m_etType;
CDoubleRect m_rcBounds;
CDoubleRect m_rcBoundsOriginal;
bool m_bBoundsEnabled;
double m_dStartTime;
double m_dEndTime;
......@@ -109,6 +110,8 @@ namespace NSPresentationEditor
m_etType = etPicture;
m_bBoundsEnabled = true;
m_rcBounds.left = 0;
m_rcBounds.top = 0;
m_rcBounds.right = 1;
......@@ -160,6 +163,8 @@ namespace NSPresentationEditor
if (NULL == pDublicate)
return;
pDublicate->m_bBoundsEnabled = m_bBoundsEnabled;
pDublicate->m_bIsBackground = m_bIsBackground;
pDublicate->m_bHaveAnchor = m_bHaveAnchor;
......
......@@ -9,6 +9,8 @@ namespace NSPresentationEditor
std::vector<IElement*> m_arElements;
std::vector<CColor> m_arColorScheme;
std::map<int,int> m_pPlaceholders;
bool m_bUseThemeColorScheme;
// ""( ),
......
......@@ -27,6 +27,7 @@ namespace NSPresentationEditor
std::vector<IElement*> m_arElements;
std::map<int,int> m_pPlaceholders;
CMetricInfo m_oInfo;
std::wstring m_sThemeName;
......@@ -35,12 +36,22 @@ namespace NSPresentationEditor
long m_lOriginalWidth;
long m_lOriginalHeight;
bool m_bHasDate;
bool m_bHasSlideNumber;
bool m_bHasHeader;
bool m_bHasFooter;
//------------------------------------------------------------------------------------
CTheme() : m_arColorScheme(), m_arFonts(), m_arBrushes(),
m_arPens(), m_arEffects(), m_arLayouts()
{
m_sThemeName = L"Default";
m_lOriginalWidth = m_lOriginalHeight = 0;
m_bHasDate = false;
m_bHasSlideNumber = false;
m_bHasHeader = false;
m_bHasFooter = false;
}
CTheme(const CTheme& oSrc)
......@@ -61,6 +72,10 @@ namespace NSPresentationEditor
m_lOriginalWidth = oSrc.m_lOriginalWidth ;
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)
{
......@@ -129,6 +144,11 @@ namespace NSPresentationEditor
m_lOriginalWidth = m_lOriginalHeight = 0;
m_sThemeName = L"Default";
m_bHasDate = false;
m_bHasSlideNumber = false;
m_bHasHeader = false;
m_bHasFooter = false;
}
~CTheme()
......
......@@ -766,7 +766,7 @@ void NSPresentationEditor::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRe
if (bIsEqualTransform)
{
if (pElement->m_rcBounds.IsEqual(pElLayout->m_rcBounds, 0.5))
m_pShapeWriter->SetIsWriteGeom(false);
pElement->m_bBoundsEnabled = false;
}
break;
......
......@@ -250,8 +250,6 @@ NSPresentationEditor::CShapeWriter::CShapeWriter()
m_pRels = NULL;
m_lNextShapeID = 1000;
m_bIsWriteGeom = true;
m_bWordArt = false;
m_bTextBox = false;
......@@ -956,30 +954,6 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
{
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)
m_oWriter.WriteString(std::wstring(L" lang=\"") + str_lang + _T("\""));
}
......@@ -1105,7 +1079,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
m_oWriter.WriteString(std::wstring(L"<p:spPr>"));
if (m_bIsWriteGeom)
if (m_pShapeElement->m_bBoundsEnabled)
{
CString str;
......@@ -1237,7 +1211,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertImage()
m_oWriter.WriteString(std::wstring(L"<p:spPr>"));
if (m_bIsWriteGeom)
if (m_pImageElement->m_bBoundsEnabled)
{
CString str;
......
......@@ -48,7 +48,6 @@ namespace NSPresentationEditor
NSPresentationEditor::CRelsGenerator* m_pRels;
LONG m_lNextShapeID;
bool m_bIsWriteGeom;
bool m_bWordArt;
bool m_bTextBox;
......@@ -75,7 +74,6 @@ namespace NSPresentationEditor
m_oBounds = m_pImageElement->m_rcBounds;
m_oTextRect = m_oBounds;
m_bIsWriteGeom = true;
m_bWordArt = false;
m_bTextBox = false;
......@@ -93,7 +91,6 @@ namespace NSPresentationEditor
m_oBounds = m_pShapeElement->m_rcBounds;
m_oTextRect = m_oBounds;
m_bIsWriteGeom = true;
m_bWordArt = false;
m_bTextBox = false;
......@@ -106,10 +103,6 @@ namespace NSPresentationEditor
m_oWriterPath.ClearNoAttack();
m_oWriterVML.ClearNoAttack();
}
AVSINLINE void SetIsWriteGeom(bool bIsWrite)
{
m_bIsWriteGeom = bIsWrite;
}
//--------------------------------------------------------------------
CString ConvertShape ();
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