mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-18 13:56:00 +08:00
Compare commits
78 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 64c7b7a3fd | |||
| d286b8459b | |||
| ff93f1e8b3 | |||
| 4471940b92 | |||
| 6df0cf26f3 | |||
| 720d66ad74 | |||
| e6522c6ce4 | |||
| 9b3c2291d8 | |||
| e7cfb67962 | |||
| 8725be55f0 | |||
| 37ae77d0d2 | |||
| 4c6ded76a1 | |||
| 2d8701cd4f | |||
| d5c321d47d | |||
| 324f7b3933 | |||
| edef6a83c8 | |||
| e7c21fb2cd | |||
| be8ba62c3f | |||
| fda8c8e445 | |||
| d9ebae1724 | |||
| f4867bd9f9 | |||
| 9b9da90dcc | |||
| cba4bc8085 | |||
| 325c2d3000 | |||
| 3187913c8e | |||
| 8958d13b56 | |||
| 9d13526724 | |||
| 93f70176bc | |||
| e2ad965d7c | |||
| d535aa64ef | |||
| c155a4c53a | |||
| 97cbd8dcc7 | |||
| 28a91a1519 | |||
| 0e48e65ef1 | |||
| 68f2f0760d | |||
| 873b2b9351 | |||
| d5ecb00472 | |||
| 2ac6801afa | |||
| 213c65fe54 | |||
| 1813e09e1f | |||
| 86d8c7bfa3 | |||
| a3e1efb75b | |||
| e1f7feb5c1 | |||
| e820a9c936 | |||
| fc422bb2e7 | |||
| f359f180bb | |||
| 83745da5f3 | |||
| b64b31a972 | |||
| ef9f25aa4d | |||
| 0c2a5eac1b | |||
| 31f274fbc4 | |||
| 6e696daa15 | |||
| c4708222c6 | |||
| ead20d7bfe | |||
| 116ec89cd2 | |||
| 8133e3f7b7 | |||
| 3081d02c9c | |||
| 91afd3d340 | |||
| b616ce6fd7 | |||
| 048eebc613 | |||
| 578118380e | |||
| 59f376908c | |||
| 5d6caf8a93 | |||
| 6283a68841 | |||
| 527cc5f89f | |||
| 50ae7db2f0 | |||
| dd17cb7243 | |||
| b3988b002f | |||
| bb3091b6f1 | |||
| 482810712e | |||
| ea338db68a | |||
| 76f3afc6c0 | |||
| 9c12c0b30a | |||
| e232fc779d | |||
| 981df3fce7 | |||
| c3b3a1b5ef | |||
| 85d98daedd | |||
| dd00be6dce |
@ -1194,7 +1194,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// RASTER
|
||||
if (true)
|
||||
if (false)
|
||||
{
|
||||
int i = nTestPage;
|
||||
//for (int i = 0; i < nPagesCount; ++i)
|
||||
@ -1364,7 +1364,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// INTERACTIVE FORMS
|
||||
if (true)
|
||||
if (false)
|
||||
{
|
||||
ReadInteractiveFormsFonts(pGrFile, 1);
|
||||
ReadInteractiveFormsFonts(pGrFile, 2);
|
||||
@ -1483,7 +1483,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// ANNOTS
|
||||
if (true)
|
||||
if (false)
|
||||
{
|
||||
BYTE* pAnnots = GetAnnotationsInfo(pGrFile, -1);
|
||||
nLength = READ_INT(pAnnots);
|
||||
@ -2254,7 +2254,6 @@ int main(int argc, char* argv[])
|
||||
// SCAN PAGE Fonts
|
||||
if (true)
|
||||
{
|
||||
//ScanPage(pGrFile, nTestPage, 2);
|
||||
SetScanPageFonts(pGrFile, nTestPage);
|
||||
|
||||
ReadInteractiveFormsFonts(pGrFile, 1);
|
||||
|
||||
@ -358,7 +358,7 @@ namespace SVG
|
||||
|
||||
bool CRenderedObject::ApplyStroke(IRenderer *pRenderer, const TStroke *pStroke, bool bUseDefault, const CRenderedObject* pContextObject) const
|
||||
{
|
||||
if (NULL == pRenderer || NULL == pStroke || NSCSS::NSProperties::EColorType::ColorNone == pStroke->m_oColor.GetType() || (!bUseDefault && ((pStroke->m_oWidth.Empty() || pStroke->m_oWidth.Zero()) && pStroke->m_oColor.Empty())))
|
||||
if (NULL == pRenderer || NULL == pStroke || pStroke->m_oColor.None() || (!bUseDefault && ((pStroke->m_oWidth.Empty() || pStroke->m_oWidth.Zero()) && pStroke->m_oColor.Empty())))
|
||||
{
|
||||
pRenderer->put_PenSize(0);
|
||||
return false;
|
||||
@ -401,7 +401,7 @@ namespace SVG
|
||||
|
||||
bool CRenderedObject::ApplyFill(IRenderer *pRenderer, const NSCSS::NSProperties::CColor *pFill, const CSvgFile *pFile, bool bUseDefault, const CRenderedObject* pContextObject) const
|
||||
{
|
||||
if (NULL == pRenderer || NULL == pFill || NSCSS::NSProperties::EColorType::ColorNone == pFill->GetType() || (!bUseDefault && pFill->Empty()))
|
||||
if (NULL == pRenderer || NULL == pFill || pFill->None() || (!bUseDefault && pFill->Empty()))
|
||||
{
|
||||
pRenderer->put_BrushType(c_BrushTypeNoFill);
|
||||
return false;
|
||||
|
||||
@ -165,7 +165,10 @@ NSWasm::CData CDocxRenderer::ScanPageBin(IOfficeDrawingFile* pFile, size_t nPage
|
||||
m_pInternal->m_oDocument.m_oCurrentPage.m_bUseDefaultFont = true;
|
||||
m_pInternal->m_oDocument.m_oCurrentPage.m_bWriteStyleRaw = true;
|
||||
m_pInternal->m_oDocument.m_oCurrentPage.m_bCollectMetaInfo = true;
|
||||
m_pInternal->m_oDocument.m_bIsRecord = false;
|
||||
m_pInternal->m_bIsSupportShapeCommands = true;
|
||||
m_pInternal->m_oDocument.m_oFontStyleManager.Clear();
|
||||
m_pInternal->m_oDocument.m_oFontSelector.ClearCache();
|
||||
|
||||
DrawPage(pFile, nPage);
|
||||
|
||||
|
||||
@ -70,6 +70,8 @@ namespace NSDocxRenderer
|
||||
m_oContBuilder.Clear();
|
||||
m_arCompleteObjectsXml.clear();
|
||||
m_arLuminosityShapes.clear();
|
||||
|
||||
m_bFontSubstitution = false;
|
||||
}
|
||||
|
||||
CPage::~CPage()
|
||||
@ -331,8 +333,8 @@ namespace NSDocxRenderer
|
||||
m_oManagers.pFontManager->MeasureStringGids(pUnicodes, nCount, dTextX, dTextY, _x, _y, _w, _h, CFontManager::mtPosition);
|
||||
}
|
||||
_h = m_oManagers.pFontManager->GetFontHeight();
|
||||
|
||||
double baseline = dTextY + fBaseLineOffset;
|
||||
|
||||
double top = baseline - _h;
|
||||
double left = dTextX;
|
||||
double right = dTextR;
|
||||
@ -760,6 +762,19 @@ namespace NSDocxRenderer
|
||||
if (line && line->m_arConts.empty())
|
||||
line = nullptr;
|
||||
|
||||
for (auto& line : m_arTextLines)
|
||||
if (line)
|
||||
{
|
||||
bool is_remove = true;
|
||||
for(auto& cont : line->m_arConts)
|
||||
if (cont && !cont->IsOnlySpaces())
|
||||
is_remove = false;
|
||||
|
||||
if (is_remove)
|
||||
line = nullptr;
|
||||
}
|
||||
|
||||
|
||||
auto right = MoveNullptr(m_arTextLines.begin(), m_arTextLines.end());
|
||||
m_arTextLines.erase(right, m_arTextLines.end());
|
||||
|
||||
@ -1345,6 +1360,21 @@ namespace NSDocxRenderer
|
||||
|
||||
return IsHorizontalLineTrough(dummy_cont);
|
||||
}
|
||||
bool CPage::IsTextLineBetween(text_line_ptr_t pFirst, text_line_ptr_t pSecond) const noexcept
|
||||
{
|
||||
double left = std::min(pFirst->m_dLeft, pSecond->m_dLeft);
|
||||
double right = std::max(pFirst->m_dRight, pSecond->m_dRight);
|
||||
double top = std::min(pFirst->m_dBotWithMaxDescent, pSecond->m_dBotWithMaxDescent);
|
||||
double bot = std::max(pFirst->m_dTopWithMaxAscent, pSecond->m_dTopWithMaxAscent);
|
||||
|
||||
auto dummy_cont = std::make_shared<CContText>();
|
||||
dummy_cont->m_dLeft = left - c_dGRAPHICS_ERROR_MM;
|
||||
dummy_cont->m_dRight = right + c_dGRAPHICS_ERROR_MM;
|
||||
dummy_cont->m_dTop = top - c_dGRAPHICS_ERROR_MM;
|
||||
dummy_cont->m_dBot = bot + c_dGRAPHICS_ERROR_MM;
|
||||
|
||||
return IsTextLineTrough(dummy_cont);
|
||||
}
|
||||
|
||||
bool CPage::IsVerticalLineTrough(base_item_ptr_t pFirst) const noexcept
|
||||
{
|
||||
@ -1372,6 +1402,20 @@ namespace NSDocxRenderer
|
||||
|
||||
return false;
|
||||
}
|
||||
bool CPage::IsTextLineTrough(base_item_ptr_t pFirst) const noexcept
|
||||
{
|
||||
const auto width = pFirst->m_dRight - pFirst->m_dLeft;
|
||||
const auto center = pFirst->m_dLeft + width / 2;
|
||||
|
||||
for (const auto& text_line : m_arShapes)
|
||||
if (text_line && text_line->m_eType == CShape::eShapeType::stTextBox && text_line->m_dBot > pFirst->m_dTop &&
|
||||
text_line->m_dBot < pFirst->m_dBot &&
|
||||
text_line->m_dLeft <= center &&
|
||||
text_line->m_dRight >= center)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CPage::SplitLines()
|
||||
{
|
||||
@ -1441,7 +1485,7 @@ namespace NSDocxRenderer
|
||||
|
||||
for (const auto& line : m_arTextLines)
|
||||
{
|
||||
if (fabs(line->m_dBotWithMaxDescent - curr_bot) < 4 * c_dTHE_SAME_STRING_Y_PRECISION_MM)
|
||||
if (fabs(line->m_dBot - curr_bot) < 4 * c_dTHE_SAME_STRING_Y_PRECISION_MM)
|
||||
{
|
||||
bot_aligned_text_lines.back().push_back(line);
|
||||
}
|
||||
@ -1449,7 +1493,7 @@ namespace NSDocxRenderer
|
||||
{
|
||||
bot_aligned_text_lines.push_back({});
|
||||
bot_aligned_text_lines.back().push_back(line);
|
||||
curr_bot = line->m_dBotWithMaxDescent;
|
||||
curr_bot = line->m_dBot;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1604,9 +1648,9 @@ namespace NSDocxRenderer
|
||||
// lamda to setup and add paragpraph
|
||||
auto add_paragraph = [this, &max_right, &min_left, &ar_paragraphs] (paragraph_ptr_t& paragraph) {
|
||||
|
||||
double additional_bottom = paragraph->m_arTextLines.front()->m_dTopWithMaxAscent - paragraph->m_arTextLines.front()->m_dTop;
|
||||
paragraph->m_dBot = paragraph->m_arTextLines.back()->m_dBot + additional_bottom;
|
||||
paragraph->m_dTop = paragraph->m_arTextLines.front()->m_dTopWithMaxAscent;
|
||||
std::shared_ptr<CTextLine>& firstLine = paragraph->m_arTextLines.front();
|
||||
paragraph->m_dBot = paragraph->m_arTextLines.back()->m_dBotWithMaxDescent;
|
||||
paragraph->m_dTop = firstLine->m_dTopWithMaxAscent;
|
||||
paragraph->m_dRight = max_right;
|
||||
paragraph->m_dLeft = min_left;
|
||||
|
||||
@ -1623,6 +1667,23 @@ namespace NSDocxRenderer
|
||||
|
||||
paragraph->MergeLines();
|
||||
|
||||
// Correct first line position
|
||||
double firstLine_height = firstLine->m_dBotWithMaxDescent - firstLine->m_dTopWithMaxAscent;
|
||||
if (paragraph->m_dLineHeight > firstLine_height)
|
||||
{
|
||||
double offset = paragraph->m_dLineHeight - firstLine_height;
|
||||
paragraph->m_dTop -= offset;
|
||||
paragraph->m_dBot -= offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
double ascent = firstLine->m_dBot - firstLine->m_dTopWithMaxAscent;
|
||||
double newAscent = ascent * paragraph->m_dLineHeight / firstLine_height;
|
||||
double offset = ascent - newAscent;
|
||||
paragraph->m_dTop += offset;
|
||||
paragraph->m_dBot += offset;
|
||||
}
|
||||
|
||||
// setting TextAlignmentType
|
||||
if (paragraph->m_arTextLines.size() > 1)
|
||||
{
|
||||
@ -1920,6 +1981,8 @@ namespace NSDocxRenderer
|
||||
{
|
||||
if (IsHorizontalLineBetween(text_lines[index], text_lines[index + 1]))
|
||||
ar_delims[index] = true;
|
||||
if (IsTextLineBetween(text_lines[index], text_lines[index + 1]))
|
||||
ar_delims[index] = true;
|
||||
}
|
||||
|
||||
// на основе ar_delims разбиваем на параграфы
|
||||
@ -2553,9 +2616,9 @@ namespace NSDocxRenderer
|
||||
pParagraph->m_arTextLines.push_back(pLine);
|
||||
pParagraph->m_dLeft = pLine->m_dLeft;
|
||||
pParagraph->m_dTop = pLine->m_dTopWithMaxAscent;
|
||||
pParagraph->m_dBot = pLine->m_dBot + (pLine->m_dTopWithMaxAscent - pLine->m_dTop);
|
||||
pParagraph->m_dWidth = pLine->m_dWidth * 1.05;
|
||||
pParagraph->m_dHeight = pLine->m_dHeight;
|
||||
pParagraph->m_dBot = pLine->m_dBotWithMaxDescent;
|
||||
pParagraph->m_dWidth = pLine->m_dWidth;
|
||||
pParagraph->m_dHeight = pLine->m_dBotWithMaxDescent - pLine->m_dTopWithMaxAscent;
|
||||
pParagraph->m_dRight = pLine->m_dRight;
|
||||
pParagraph->m_dLineHeight = pParagraph->m_dHeight;
|
||||
pParagraph->m_nOrder = pLine->m_nOrder;
|
||||
@ -2572,11 +2635,11 @@ namespace NSDocxRenderer
|
||||
pShape->m_eType = CShape::eShapeType::stTextBox;
|
||||
|
||||
pShape->m_dLeft = pParagraph->m_dLeft;
|
||||
pShape->m_dRight = pParagraph->m_dRight * 1.025;
|
||||
pShape->m_dTop = pParagraph->m_dTop;
|
||||
pShape->m_dBot = pParagraph->m_dBot;
|
||||
pShape->m_dWidth = pParagraph->m_dWidth;
|
||||
pShape->m_dWidth = pShape->m_dRight - pShape->m_dLeft;
|
||||
pShape->m_dHeight = pParagraph->m_dHeight;
|
||||
pShape->m_dRight = pParagraph->m_dRight;
|
||||
pShape->m_nOrder = pParagraph->m_nOrder;
|
||||
pShape->m_bIsBehindDoc = false;
|
||||
|
||||
@ -2588,11 +2651,12 @@ namespace NSDocxRenderer
|
||||
auto pShape = std::make_shared<CShape>();
|
||||
|
||||
pShape->m_dLeft = pParagraph->m_dLeft;
|
||||
pShape->m_dTop = pParagraph->m_dTop;
|
||||
pShape->m_dRight = pParagraph->m_dRight;
|
||||
if (pParagraph->m_arTextLines.size() == 1) pShape->m_dRight *= 1.025;
|
||||
pShape->m_dTop = pParagraph->m_dTop;
|
||||
pShape->m_dBot = pParagraph->m_dBot;
|
||||
pShape->m_dHeight = pParagraph->m_dHeight;
|
||||
pShape->m_dWidth = pParagraph->m_dWidth;
|
||||
pShape->m_dWidth = pShape->m_dRight - pShape->m_dLeft;
|
||||
pShape->m_nOrder = pParagraph->m_nOrder;
|
||||
|
||||
if (pParagraph->m_bIsNeedFirstLineIndent && pParagraph->m_dFirstLine < 0)
|
||||
|
||||
@ -194,9 +194,11 @@ namespace NSDocxRenderer
|
||||
|
||||
bool IsVerticalLineBetween(text_line_ptr_t pFirst, text_line_ptr_t pSecond) const noexcept;
|
||||
bool IsHorizontalLineBetween(text_line_ptr_t pFirst, text_line_ptr_t pSecond) const noexcept;
|
||||
bool IsTextLineBetween(text_line_ptr_t pFirst, text_line_ptr_t pSecond) const noexcept;
|
||||
|
||||
bool IsVerticalLineTrough(base_item_ptr_t pFirst) const noexcept;
|
||||
bool IsHorizontalLineTrough(base_item_ptr_t pFirst) const noexcept;
|
||||
bool IsTextLineTrough(base_item_ptr_t pFirst) const noexcept;
|
||||
|
||||
void ToXml(NSStringUtils::CStringBuilder& oWriter) const noexcept;
|
||||
void WriteSectionToFile(bool bLastPage, NSStringUtils::CStringBuilder& oWriter) const noexcept;
|
||||
|
||||
@ -208,34 +208,34 @@ namespace NSDocxRenderer
|
||||
return eVerticalCrossingType::vctCurrentInsideNext;
|
||||
|
||||
else if (this_top < other_top && this_bot > other_bot)
|
||||
return eVerticalCrossingType::vctCurrentOutsideNext;
|
||||
return eVerticalCrossingType::vctCurrentOutsideNext;
|
||||
|
||||
else if (this_top < other_top && this_bot < other_bot &&
|
||||
(this_bot >= other_top || fabs(this_bot - other_top) < c_dTHE_SAME_STRING_Y_PRECISION_MM))
|
||||
return eVerticalCrossingType::vctCurrentAboveNext;
|
||||
else if (this_top < other_top && this_bot < other_bot && this_bot > other_top &&
|
||||
this_bot - other_top > c_dOVERLAP_TEXT_LINE_ERROR_MM)
|
||||
return eVerticalCrossingType::vctCurrentAboveNext;
|
||||
|
||||
else if (this_top > other_top && this_bot > other_bot &&
|
||||
(this_top <= other_bot || fabs(this_top - other_bot) < c_dTHE_SAME_STRING_Y_PRECISION_MM))
|
||||
return eVerticalCrossingType::vctCurrentBelowNext;
|
||||
else if (this_top > other_top && this_bot > other_bot && this_top < other_bot &&
|
||||
other_bot - this_top > c_dOVERLAP_TEXT_LINE_ERROR_MM)
|
||||
return eVerticalCrossingType::vctCurrentBelowNext;
|
||||
|
||||
else if (this_top == other_top && this_bot == other_bot)
|
||||
return eVerticalCrossingType::vctDublicate;
|
||||
|
||||
else if (fabs(this_top - other_top) < c_dTHE_SAME_STRING_Y_PRECISION_MM &&
|
||||
fabs(this_bot - other_bot) < c_dTHE_SAME_STRING_Y_PRECISION_MM)
|
||||
return eVerticalCrossingType::vctTopAndBottomBordersMatch;
|
||||
return eVerticalCrossingType::vctTopAndBottomBordersMatch;
|
||||
|
||||
else if (fabs(this_top - other_top) < c_dTHE_SAME_STRING_Y_PRECISION_MM)
|
||||
return eVerticalCrossingType::vctTopBorderMatch;
|
||||
return eVerticalCrossingType::vctTopBorderMatch;
|
||||
|
||||
else if (fabs(this_bot - other_bot) < c_dTHE_SAME_STRING_Y_PRECISION_MM)
|
||||
return eVerticalCrossingType::vctBottomBorderMatch;
|
||||
return eVerticalCrossingType::vctBottomBorderMatch;
|
||||
|
||||
else if (this_bot < other_top)
|
||||
return eVerticalCrossingType::vctNoCrossingCurrentAboveNext;
|
||||
else if (other_top - this_bot > -c_dOVERLAP_TEXT_LINE_ERROR_MM)
|
||||
return eVerticalCrossingType::vctNoCrossingCurrentAboveNext;
|
||||
|
||||
else if (this_top > other_bot)
|
||||
return eVerticalCrossingType::vctNoCrossingCurrentBelowNext;
|
||||
else if (this_top - other_bot > -c_dOVERLAP_TEXT_LINE_ERROR_MM)
|
||||
return eVerticalCrossingType::vctNoCrossingCurrentBelowNext;
|
||||
|
||||
else
|
||||
return eVerticalCrossingType::vctUnknown;
|
||||
@ -555,6 +555,9 @@ namespace NSDocxRenderer
|
||||
std::wstring origin_lefts{};
|
||||
for (auto& l : m_arOriginLefts)
|
||||
origin_lefts += std::to_wstring(static_cast<int>(l * c_dMMToEMU)) + L";";
|
||||
// add offset for last symbol
|
||||
if (!m_arSymWidths.empty())
|
||||
origin_lefts += std::to_wstring(static_cast<int>((m_arOriginLefts.back() + m_arSymWidths.back()) * c_dMMToEMU)) + L";";
|
||||
|
||||
oWriter.WriteBYTE(5); oWriter.WriteStringUtf16(origin_lefts); // Origin lefts
|
||||
oWriter.WriteBYTE(6); oWriter.WriteBool(m_bFontSubstitution); // Font Substitution (just pass from pdf)
|
||||
@ -895,12 +898,12 @@ namespace NSDocxRenderer
|
||||
eHorizontalCrossingType eHType)
|
||||
{
|
||||
//Условие пересечения по вертикали
|
||||
bool bIf1 = eVType == eVerticalCrossingType::vctCurrentAboveNext; //текущий cont выше
|
||||
bool bIf2 = eVType == eVerticalCrossingType::vctCurrentBelowNext; //текущий cont ниже
|
||||
bool bIf1 = eVType == eVerticalCrossingType::vctCurrentAboveNext;
|
||||
bool bIf2 = eVType == eVerticalCrossingType::vctCurrentBelowNext;
|
||||
|
||||
//Условие пересечения по горизонтали
|
||||
bool bIf3 = eHType == eHorizontalCrossingType::hctCurrentLeftOfNext; //текущий cont левее
|
||||
bool bIf4 = eHType == eHorizontalCrossingType::hctCurrentRightOfNext; //текущий cont правее
|
||||
bool bIf3 = eHType == eHorizontalCrossingType::hctCurrentLeftOfNext;
|
||||
bool bIf4 = eHType == eHorizontalCrossingType::hctCurrentRightOfNext;
|
||||
|
||||
//Размеры шрифта и текст должны бать одинаковыми
|
||||
bool bIf5 = pFirstCont->m_pFontStyle->dFontSize == pSecondCont->m_pFontStyle->dFontSize;
|
||||
@ -916,9 +919,7 @@ namespace NSDocxRenderer
|
||||
bool bIf11 = pFirstCont->m_pFontStyle->oBrush.Color1 == c_iGreyColor2;
|
||||
bool bIf12 = pSecondCont->m_pFontStyle->oBrush.Color1 == c_iGreyColor2;
|
||||
|
||||
//note Каждый символ с Emboss или Engrave разбиваются на 3 символа с разными цветами
|
||||
//note Логика подобрана для конкретного примера - возможно нужно будет ее обобщить.
|
||||
//todo существует проблема неправильного определением FontEffects с физически пересекаемыми строчками - файл generaltest.pdf p.14
|
||||
// каждый символ с Emboss или Engrave разбиваются на 3 символа с разными цветами
|
||||
if (bIf5 && bIf6)
|
||||
{
|
||||
if (bIf12 && pFirstCont->m_bIsEmbossPresent)
|
||||
@ -978,8 +979,10 @@ namespace NSDocxRenderer
|
||||
eHorizontalCrossingType eHType)
|
||||
{
|
||||
|
||||
double first_height = pFirstCont->m_dBotWithDescent - pFirstCont->m_dTopWithAscent;
|
||||
bool bIf1 = eVType == eVerticalCrossingType::vctCurrentAboveNext ||
|
||||
eVType == eVerticalCrossingType::vctCurrentInsideNext;
|
||||
eVType == eVerticalCrossingType::vctCurrentInsideNext &&
|
||||
pSecondCont->m_dBot - pFirstCont->m_dBot > first_height * 0.2;
|
||||
|
||||
bool bIf2 = eVType == eVerticalCrossingType::vctCurrentBelowNext;
|
||||
|
||||
@ -1259,12 +1262,11 @@ namespace NSDocxRenderer
|
||||
pCont->m_dWidth = dWidth;
|
||||
pCont->m_dRight = dRight;
|
||||
|
||||
double font_size = oFont.Size;
|
||||
double em_height = oMetrics.dEmHeight;
|
||||
double ratio = font_size / em_height * c_dPtToMM;
|
||||
double ascent = pFontManager->GetFontAscent();
|
||||
double descent = pFontManager->GetFontDescent();
|
||||
|
||||
pCont->m_dTopWithAscent = pCont->m_dBot - (oMetrics.dAscent * ratio);
|
||||
pCont->m_dBotWithDescent = pCont->m_dBot + (oMetrics.dDescent * ratio);
|
||||
pCont->m_dTopWithAscent = pCont->m_dBot - ascent;
|
||||
pCont->m_dBotWithDescent = pCont->m_dBot + fabs(descent);
|
||||
pCont->m_dSpaceWidthMM = pFontManager->GetSpaceWidthMM();
|
||||
|
||||
pCont->m_wsOriginFontName = oFont.Name;
|
||||
|
||||
@ -1343,7 +1343,7 @@ namespace NSDocxRenderer
|
||||
// WriteRecord WriteBodyPr
|
||||
oWriter.StartRecord(0);
|
||||
oWriter.WriteBYTE(kBin_g_nodeAttributeStart);
|
||||
oWriter.WriteBYTE(1); oWriter.WriteBYTE(1); // anchor
|
||||
oWriter.WriteBYTE(1); oWriter.WriteBYTE(4); // anchor
|
||||
oWriter.WriteBYTE(2); oWriter.WriteBool(false); // anchorCtr
|
||||
oWriter.WriteBYTE(3); oWriter.AddInt(0); // bIns
|
||||
oWriter.WriteBYTE(4); oWriter.WriteBool(true); // compatLnSpc
|
||||
|
||||
@ -66,6 +66,8 @@ namespace NSDocxRenderer
|
||||
std::sort(m_arConts.begin(), m_arConts.end(), [] (const cont_ptr_t& a, const cont_ptr_t& b) {
|
||||
if (!a) return false;
|
||||
if (!b) return true;
|
||||
if (fabs(a->m_dLeft - b->m_dLeft) < c_dTHE_SAME_STRING_X_PRECISION_MM)
|
||||
return a->m_dRight < b->m_dRight;
|
||||
return a->m_dLeft < b->m_dLeft;
|
||||
});
|
||||
|
||||
@ -243,15 +245,15 @@ namespace NSDocxRenderer
|
||||
return eVerticalCrossingType::vctCurrentInsideNext;
|
||||
|
||||
else if (this_top < other_top && this_bot > other_bot)
|
||||
return eVerticalCrossingType::vctCurrentOutsideNext;
|
||||
return eVerticalCrossingType::vctCurrentOutsideNext;
|
||||
|
||||
else if (this_top < other_top && this_bot < other_bot &&
|
||||
(this_bot >= other_top || fabs(this_bot - other_top) < c_dTHE_SAME_STRING_Y_PRECISION_MM))
|
||||
return eVerticalCrossingType::vctCurrentAboveNext;
|
||||
else if (this_top < other_top && this_bot < other_bot && this_bot > other_top &&
|
||||
this_bot - other_top > c_dOVERLAP_TEXT_LINE_ERROR_MM)
|
||||
return eVerticalCrossingType::vctCurrentAboveNext;
|
||||
|
||||
else if (this_top > other_top && this_bot > other_bot &&
|
||||
(this_top <= other_bot || fabs(this_top - other_bot) < c_dTHE_SAME_STRING_Y_PRECISION_MM))
|
||||
return eVerticalCrossingType::vctCurrentBelowNext;
|
||||
else if (this_top > other_top && this_bot > other_bot && this_top < other_bot &&
|
||||
other_bot - this_top > c_dOVERLAP_TEXT_LINE_ERROR_MM)
|
||||
return eVerticalCrossingType::vctCurrentBelowNext;
|
||||
|
||||
else if (this_top == other_top && this_bot == other_bot &&
|
||||
m_dLeft == pLine->m_dLeft && m_dRight == pLine->m_dRight)
|
||||
@ -259,31 +261,33 @@ namespace NSDocxRenderer
|
||||
|
||||
else if (fabs(this_top - other_top) < c_dTHE_SAME_STRING_Y_PRECISION_MM &&
|
||||
fabs(this_bot - other_bot) < c_dTHE_SAME_STRING_Y_PRECISION_MM)
|
||||
return eVerticalCrossingType::vctTopAndBottomBordersMatch;
|
||||
return eVerticalCrossingType::vctTopAndBottomBordersMatch;
|
||||
|
||||
else if (fabs(this_top - other_top) < c_dTHE_SAME_STRING_Y_PRECISION_MM)
|
||||
return eVerticalCrossingType::vctTopBorderMatch;
|
||||
return eVerticalCrossingType::vctTopBorderMatch;
|
||||
|
||||
else if (fabs(this_bot - other_bot) < c_dTHE_SAME_STRING_Y_PRECISION_MM)
|
||||
return eVerticalCrossingType::vctBottomBorderMatch;
|
||||
return eVerticalCrossingType::vctBottomBorderMatch;
|
||||
|
||||
else if (this_bot < other_top)
|
||||
return eVerticalCrossingType::vctNoCrossingCurrentAboveNext;
|
||||
else if (other_top - this_bot > -c_dOVERLAP_TEXT_LINE_ERROR_MM)
|
||||
return eVerticalCrossingType::vctNoCrossingCurrentAboveNext;
|
||||
|
||||
else if (this_top > other_bot)
|
||||
return eVerticalCrossingType::vctNoCrossingCurrentBelowNext;
|
||||
else if (this_top - other_bot > -c_dOVERLAP_TEXT_LINE_ERROR_MM)
|
||||
return eVerticalCrossingType::vctNoCrossingCurrentBelowNext;
|
||||
|
||||
else
|
||||
return eVerticalCrossingType::vctUnknown;
|
||||
return eVerticalCrossingType::vctUnknown;
|
||||
}
|
||||
|
||||
void CTextLine::RecalcWithNewItem(const CContText* pCont)
|
||||
{
|
||||
CBaseItem::RecalcWithNewItem(pCont);
|
||||
if (m_dTopWithMaxAscent == 0.0) m_dTopWithMaxAscent = pCont->m_dTopWithAscent;
|
||||
else m_dTopWithMaxAscent = std::min(m_dTopWithMaxAscent, pCont->m_dTopWithAscent);
|
||||
|
||||
m_dBotWithMaxDescent = std::max(m_dBotWithMaxDescent, pCont->m_dBotWithDescent);
|
||||
if (!pCont->IsOnlySpaces())
|
||||
{
|
||||
if (m_dTopWithMaxAscent == 0.0) m_dTopWithMaxAscent = pCont->m_dTopWithAscent;
|
||||
else m_dTopWithMaxAscent = std::min(m_dTopWithMaxAscent, pCont->m_dTopWithAscent);
|
||||
m_dBotWithMaxDescent = std::max(m_dBotWithMaxDescent, pCont->m_dBotWithDescent);
|
||||
}
|
||||
}
|
||||
|
||||
void CTextLine::SetVertAlignType(const eVertAlignType& oType)
|
||||
|
||||
@ -581,6 +581,16 @@ namespace NSDocxRenderer
|
||||
{
|
||||
return c_dPtToMM * (m_oFontMetrics.dLineSpacing * m_oFont.Size) / m_oFontMetrics.dEmHeight;
|
||||
}
|
||||
double CFontManager::GetFontAscent() const
|
||||
{
|
||||
//double tmp = m_oFontMetrics.dAscent;
|
||||
double tmp = m_oFontMetrics.dLineSpacing - fabs(m_oFontMetrics.dDescent);
|
||||
return c_dPtToMM * (tmp * m_oFont.Size) / m_oFontMetrics.dEmHeight;
|
||||
}
|
||||
double CFontManager::GetFontDescent() const
|
||||
{
|
||||
return c_dPtToMM * (m_oFontMetrics.dDescent * m_oFont.Size) / m_oFontMetrics.dEmHeight;
|
||||
}
|
||||
double CFontManager::GetSpaceWidthMM() const
|
||||
{
|
||||
double dSpaceWidthMM = 0.0;
|
||||
|
||||
@ -124,6 +124,9 @@ namespace NSDocxRenderer
|
||||
const CFontMetrics& GetFontMetrics() const noexcept;
|
||||
|
||||
double GetFontHeight() const;
|
||||
double GetFontAscent() const;
|
||||
double GetFontDescent() const;
|
||||
|
||||
double GetSpaceWidthMM() const;
|
||||
|
||||
void SetStringGid(const LONG& lGid);
|
||||
|
||||
@ -24,10 +24,11 @@ constexpr double c_dPtToEMU = 12700.0;
|
||||
constexpr double c_dDegreeToAngle = 60000.0;
|
||||
|
||||
const double c_dSTANDART_STRING_HEIGHT_MM = 4.2333333333333334;
|
||||
const double c_dTHE_SAME_STRING_Y_PRECISION_MM = 0.03;
|
||||
const double c_dTHE_SAME_STRING_Y_PRECISION_MM = 0.015;
|
||||
const double c_dTHE_SAME_STRING_X_PRECISION_MM = 0.03;
|
||||
const double c_dTHE_SAME_SPACING_ERROR = 0.1;
|
||||
const double c_dLINE_DISTANCE_ERROR_MM = 0.3;
|
||||
const double c_dOVERLAP_TEXT_LINE_ERROR_MM = 0.5;
|
||||
const double c_dERROR_OF_PARAGRAPH_BORDERS_MM = 1.0;
|
||||
const double c_dCENTER_POSITION_ERROR_MM = 1.5;
|
||||
const double c_dTHE_STRING_X_PRECISION_MM = 0.5;
|
||||
|
||||
@ -270,6 +270,7 @@ namespace DocFileFormat
|
||||
int cp = initialCp;
|
||||
int fc = m_document->FindFileCharPos(cp);
|
||||
int fcEnd = m_document->FindFileCharPos(cpEnd);
|
||||
bool PBookmark = false;
|
||||
|
||||
ParagraphPropertyExceptions* papx = findValidPapx(fc);
|
||||
|
||||
@ -406,13 +407,17 @@ namespace DocFileFormat
|
||||
{
|
||||
for (std::vector<std::vector<wchar_t> >::iterator iter = runs->begin(); iter != runs->end(); ++iter)
|
||||
{
|
||||
if (writeBookmarks(cp))
|
||||
if (writeBookmarks(cp, PBookmark))
|
||||
{
|
||||
cp = writeRun(&(*iter), chpxs->at(it), cp);
|
||||
}
|
||||
PBookmark = true;
|
||||
if (cp == m_document->FIB->m_RgLw97.ccpText - 1)
|
||||
writeBookmarks(cp, PBookmark);
|
||||
}
|
||||
|
||||
RELEASEOBJECT(runs);
|
||||
PBookmark = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1971,22 +1976,77 @@ namespace DocFileFormat
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool DocumentMapping::writeBookmarks(int cp)
|
||||
bool DocumentMapping::writeBookmarks(int cp, bool para)
|
||||
{
|
||||
bool result = true;
|
||||
static std::vector<int> openedInThisPara;
|
||||
static std::set<int> allClosedIds;
|
||||
static int nextIdForSequence = 0;
|
||||
|
||||
for (size_t b = 0; b < m_document->BookmarkStartEndCPs.size(); ++b)
|
||||
{
|
||||
if (m_document->BookmarkStartEndCPs[b].start == cp)
|
||||
{
|
||||
result = writeBookmarkStart(b);
|
||||
}
|
||||
for (size_t b = 0; b < m_document->BookmarkStartEndCPs.size(); ++b)
|
||||
{
|
||||
if (m_document->BookmarkStartEndCPs[b].start == cp)
|
||||
{
|
||||
int xmlId = b;
|
||||
|
||||
if (m_document->BookmarkStartEndCPs[b].end == cp)
|
||||
{
|
||||
result = writeBookmarkEnd(b);
|
||||
}
|
||||
}
|
||||
result = writeBookmarkStart(xmlId);
|
||||
openedInThisPara.push_back(xmlId);
|
||||
}
|
||||
}
|
||||
|
||||
bool hasPositionClosings = false;
|
||||
int positionClosingCount = 0;
|
||||
|
||||
for (size_t b = 0; b < m_document->BookmarkStartEndCPs.size(); ++b)
|
||||
{
|
||||
if (m_document->BookmarkStartEndCPs[b].end == cp)
|
||||
{
|
||||
hasPositionClosings = true;
|
||||
positionClosingCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasPositionClosings)
|
||||
{
|
||||
|
||||
for (int i = 0; i < positionClosingCount; i++)
|
||||
{
|
||||
if (!openedInThisPara.empty())
|
||||
{
|
||||
int idToClose = openedInThisPara[0];
|
||||
result = writeBookmarkEnd(idToClose);
|
||||
allClosedIds.insert(idToClose);
|
||||
openedInThisPara.erase(openedInThisPara.begin());
|
||||
}
|
||||
else
|
||||
{
|
||||
while (allClosedIds.find(nextIdForSequence) != allClosedIds.end())
|
||||
{
|
||||
nextIdForSequence++;
|
||||
}
|
||||
|
||||
result = writeBookmarkEnd(nextIdForSequence);
|
||||
allClosedIds.insert(nextIdForSequence);
|
||||
nextIdForSequence++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (para)
|
||||
{
|
||||
while (allClosedIds.find(nextIdForSequence) != allClosedIds.end())
|
||||
{
|
||||
nextIdForSequence++;
|
||||
}
|
||||
|
||||
result = writeBookmarkEnd(nextIdForSequence);
|
||||
allClosedIds.insert(nextIdForSequence);
|
||||
nextIdForSequence++;
|
||||
}
|
||||
|
||||
if (para)
|
||||
{
|
||||
openedInThisPara.clear();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ namespace DocFileFormat
|
||||
std::vector<int> searchAnnotation(std::vector<wchar_t>* chars, int initialCp);
|
||||
std::vector<int> searchPermission(std::vector<wchar_t>* chars, int initialCp);
|
||||
|
||||
bool writeBookmarks ( int cp );
|
||||
bool writeBookmarks ( int cp, bool para );
|
||||
bool writeBookmarkStart ( short id );
|
||||
bool writeBookmarkEnd ( short id );
|
||||
|
||||
|
||||
@ -74,9 +74,11 @@ namespace DocFileFormat
|
||||
{
|
||||
n = totalSize / elementSize;
|
||||
|
||||
if (totalSize % elementSize != 0)
|
||||
if (totalSize % elementSize != 0 && structureLength == 6)
|
||||
{
|
||||
n += 1;
|
||||
structureLength = 4;
|
||||
elementSize = structureLength + CP_LENGTH;
|
||||
n = totalSize/elementSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -218,6 +218,25 @@ namespace DocFileFormat
|
||||
m_oXmlWriter.WriteNodeBegin( L"w:noPunctuationKerning", TRUE );
|
||||
m_oXmlWriter.WriteNodeEnd( L"", TRUE );
|
||||
}
|
||||
if (dop->doptypography->iJustification != 0)
|
||||
{
|
||||
m_oXmlWriter.WriteNodeBegin(L"w:characterSpacingControl", TRUE);
|
||||
|
||||
const wchar_t* spacingValue = L"doNotCompress";
|
||||
|
||||
switch(dop->doptypography->iJustification)
|
||||
{
|
||||
case 1:
|
||||
spacingValue = L"compressPunctuation";
|
||||
break;
|
||||
case 2:
|
||||
spacingValue = L"compressPunctuationAndJapaneseKana";
|
||||
break;
|
||||
}
|
||||
|
||||
m_oXmlWriter.WriteAttribute(L"w:val", spacingValue);
|
||||
m_oXmlWriter.WriteNodeEnd(L"", TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
//footnote properties
|
||||
|
||||
@ -2544,10 +2544,13 @@ void XlsConverter::convert(XLS::Obj * obj)
|
||||
std::wstring objectId_bin = xlsx_context->get_mediaitems().add_control_activeX(target_bin);
|
||||
|
||||
NSFile::CFileBinary file;
|
||||
if ( file.CreateFileW(xlsx_context->get_mediaitems().activeX_path() + target_bin) )
|
||||
{
|
||||
file.WriteFile(xls_global_info->controls_data.first.get() + obj->pictFmla.lPosInCtlStm, obj->pictFmla.cbBufInCtlStm);
|
||||
file.CloseFile();
|
||||
if(xls_global_info->controls_data.second >= obj->pictFmla.lPosInCtlStm + obj->pictFmla.cbBufInCtlStm)
|
||||
{
|
||||
if ( file.CreateFileW(xlsx_context->get_mediaitems().activeX_path() + target_bin) )
|
||||
{
|
||||
file.WriteFile(xls_global_info->controls_data.first.get() + obj->pictFmla.lPosInCtlStm, obj->pictFmla.cbBufInCtlStm);
|
||||
file.CloseFile();
|
||||
}
|
||||
}
|
||||
std::wstring objectId_xml = xlsx_context->start_activeX();
|
||||
xlsx_context->get_drawing_context().set_control_activeX(objectId_xml);
|
||||
|
||||
@ -37,6 +37,9 @@ namespace XLS
|
||||
|
||||
AreaFormat::AreaFormat()
|
||||
{
|
||||
rgbFore.red = 0xFF;
|
||||
rgbFore.green = 0xFF;
|
||||
rgbFore.blue = 0xFF;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -62,11 +62,11 @@ public:
|
||||
|
||||
_UINT16 fls = 0;
|
||||
|
||||
bool fAuto = false;
|
||||
bool fAuto = true;
|
||||
bool fInvertNeg = false;
|
||||
|
||||
IcvChart icvFore = 0;
|
||||
IcvChart icvBack = 0;
|
||||
IcvChart icvFore = 0x004D;
|
||||
IcvChart icvBack = 0x0009;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -69,7 +69,7 @@ void AxcExt::readFields(CFRecord& record)
|
||||
|
||||
void AxcExt::writeFields(CFRecord& record)
|
||||
{
|
||||
unsigned char flags = 0;
|
||||
unsigned short flags = 0;
|
||||
SETBIT(flags, 0, fAutoMin)
|
||||
SETBIT(flags, 1, fAutoMax)
|
||||
SETBIT(flags, 2, fAutoMajor)
|
||||
|
||||
@ -50,7 +50,7 @@ public:
|
||||
|
||||
static const ElementType type = typeDataFormat;
|
||||
|
||||
_UINT16 xi = 0;
|
||||
_UINT16 xi = 0xFFFF;
|
||||
_UINT16 yi = 0;
|
||||
_UINT16 iss = 0;
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ public:
|
||||
//-----------------------------
|
||||
_UINT16 frt = 0;
|
||||
bool fAutoSize = false;
|
||||
bool fAutoPosition = false;
|
||||
bool fAutoPosition = true;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -53,5 +53,15 @@ void FrtFontList::readFields(CFRecord& record)
|
||||
}
|
||||
}
|
||||
|
||||
void FrtFontList::writeFields(CFRecord& record)
|
||||
{
|
||||
frtHeaderOld.rt = 0x085A;
|
||||
record << frtHeaderOld << verExcel;
|
||||
record.reserveNunBytes(1);
|
||||
record << cFont;
|
||||
for(auto i : rgFrtFontInfo)
|
||||
record << i;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -49,6 +49,7 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeFrtFontList;
|
||||
|
||||
|
||||
@ -71,6 +71,7 @@ void Legend::writeFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags = 0;
|
||||
SETBIT(flags, 0, fAutoPosition)
|
||||
SETBIT(flags, 1, 1) //reserved
|
||||
SETBIT(flags, 2, fAutoPosX)
|
||||
SETBIT(flags, 3, fAutoPosY)
|
||||
SETBIT(flags, 4, fVert)
|
||||
|
||||
@ -57,7 +57,7 @@ public:
|
||||
_UINT32 y = 0;
|
||||
_UINT32 dx = 0;
|
||||
_UINT32 dy = 0;
|
||||
unsigned char wSpace = 0;
|
||||
unsigned char wSpace = 1;
|
||||
|
||||
bool fAutoPosition = false;
|
||||
bool fAutoPosX = false;
|
||||
|
||||
@ -54,12 +54,12 @@ public:
|
||||
int serialize(std::wostream & _stream);
|
||||
//-----------------------------
|
||||
LongRGB rgb;
|
||||
_UINT16 lns = 0;
|
||||
_UINT16 we = 0;
|
||||
_UINT16 lns = 5;
|
||||
_UINT16 we = 0xFFFF;
|
||||
bool fAuto = false;
|
||||
bool fAxisOn = false;
|
||||
bool fAutoCo = false;
|
||||
IcvChart icv = 0;
|
||||
IcvChart icv = 0x004D;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -179,6 +179,36 @@ void MsoDrawing::prepareComment(const unsigned int CommentId)
|
||||
}
|
||||
}
|
||||
|
||||
void MsoDrawing::prepareChart(const unsigned int chartId, const unsigned int xPos, const unsigned int xOffset,
|
||||
const unsigned int yPos, const unsigned int yOffset)
|
||||
{
|
||||
|
||||
auto fdgPtr = new ODRAW::OfficeArtFDG;
|
||||
fdgPtr->rh_own.recInstance = chartId;
|
||||
fdgPtr->csp = 1;
|
||||
fdgPtr->spidCur = chartId;
|
||||
rgChildRec.m_OfficeArtFDG = ODRAW::OfficeArtRecordPtr(fdgPtr);
|
||||
|
||||
auto spgrContainer = new ODRAW::OfficeArtSpgrContainer(ODRAW::OfficeArtRecord::CA_Chart);
|
||||
rgChildRec.m_OfficeArtSpgrContainer = ODRAW::OfficeArtRecordPtr(spgrContainer);
|
||||
|
||||
auto SpContainer = new ODRAW::OfficeArtSpContainer(ODRAW::OfficeArtRecord::CA_Chart);
|
||||
spgrContainer->m_OfficeArtSpgrContainerFileBlock.push_back(ODRAW::OfficeArtContainerPtr(SpContainer));
|
||||
auto groupFSPGR = new ODRAW::OfficeArtFSPGR;
|
||||
groupFSPGR->xLeft = xPos;
|
||||
groupFSPGR->xRight = xOffset;
|
||||
groupFSPGR->yTop = yPos;
|
||||
groupFSPGR->yBottom = yOffset;
|
||||
SpContainer->m_OfficeArtFSPGR = ODRAW::OfficeArtRecordPtr(groupFSPGR);
|
||||
|
||||
auto fsprPtr = new ODRAW::OfficeArtFSP;
|
||||
SpContainer->m_OfficeArtFSP = ODRAW::OfficeArtRecordPtr(fsprPtr);
|
||||
fsprPtr->shape_id = 0;
|
||||
fsprPtr->spid = chartId;
|
||||
fsprPtr->fGroup = true;
|
||||
fsprPtr->fPatriarch = true;
|
||||
}
|
||||
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -62,6 +62,8 @@ public:
|
||||
virtual void useContinueRecords (CFRecord& record);
|
||||
|
||||
void prepareComment (const unsigned int CommentId);
|
||||
void prepareChart (const unsigned int chartId, const unsigned int xPos, const unsigned int xOffset,
|
||||
const unsigned int yPos, const unsigned int yOffset );
|
||||
|
||||
//-----------------------------
|
||||
ODRAW::OfficeArtDgContainer rgChildRec;
|
||||
|
||||
@ -37,6 +37,8 @@ namespace XLS
|
||||
|
||||
PlotGrowth::PlotGrowth()
|
||||
{
|
||||
dxPlotGrowth = 1;
|
||||
dyPlotGrowth = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -57,8 +57,8 @@ public:
|
||||
|
||||
static const ElementType type = typePos;
|
||||
|
||||
_UINT16 mdTopLt = 0;
|
||||
_UINT16 mdBotRt = 0;
|
||||
_UINT16 mdTopLt = 2;
|
||||
_UINT16 mdBotRt = 2;
|
||||
|
||||
_INT16 x1 = 0;
|
||||
_INT16 y1 = 0;
|
||||
|
||||
@ -54,8 +54,8 @@ public:
|
||||
int serialize(std::wostream & _stream);
|
||||
|
||||
//-----------------------------
|
||||
_UINT16 pcBubbleSizeRatio = 0;
|
||||
_UINT16 wBubbleSize = 0;
|
||||
_UINT16 pcBubbleSizeRatio = 100;
|
||||
_UINT16 wBubbleSize = 1;
|
||||
bool fBubbles = false;
|
||||
bool fShowNegBubbles = false;
|
||||
bool fHasShadow = false;
|
||||
|
||||
@ -55,8 +55,8 @@ public:
|
||||
static const ElementType type = typeScl;
|
||||
|
||||
//-----------------------------
|
||||
_INT16 nscl = 0;
|
||||
_INT16 dscl = 1;
|
||||
_INT16 nscl = 117;
|
||||
_INT16 dscl = 100;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -55,9 +55,9 @@ public:
|
||||
static const ElementType type = typeSeries;
|
||||
|
||||
//-----------------------------
|
||||
_UINT16 sdtX = 0;
|
||||
_UINT16 sdtY = 0;
|
||||
_UINT16 sdtBSize = 0;
|
||||
_UINT16 sdtX = 1;
|
||||
_UINT16 sdtY = 0x0001;
|
||||
_UINT16 sdtBSize = 0x0001;
|
||||
|
||||
_UINT16 cValx = 0;
|
||||
_UINT16 cValy = 0;
|
||||
|
||||
@ -56,8 +56,8 @@ public:
|
||||
|
||||
//-----------------------------
|
||||
bool fManSerAlloc = false;
|
||||
bool fManPlotArea = false;
|
||||
bool fPlotVisOnly = false;
|
||||
bool fManPlotArea = false;
|
||||
bool fPlotVisOnly = true;
|
||||
bool fNotSizeWith = false;
|
||||
bool fAlwaysAutoPlotArea = false;
|
||||
unsigned char mdBlank = 0;
|
||||
|
||||
@ -57,7 +57,7 @@ public:
|
||||
int serialize(std::wostream & _stream);
|
||||
|
||||
//-----------------------------
|
||||
bool fFillSurface = false;
|
||||
bool fFillSurface = true;
|
||||
bool f3DPhongShade = false;
|
||||
};
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ Text::Text()
|
||||
is_area = false;
|
||||
dlp = false;
|
||||
iReadingOrder = 0;
|
||||
icvText = 0xff;
|
||||
icvText = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -56,10 +56,10 @@ public:
|
||||
|
||||
int serialize(std::wostream & _stream);
|
||||
|
||||
unsigned char at = 0;
|
||||
unsigned char vat = 0;
|
||||
unsigned char at = 2;
|
||||
unsigned char vat = 2;
|
||||
|
||||
_UINT16 wBkgMode = 0;
|
||||
_UINT16 wBkgMode = 1;
|
||||
LongRGB rgbText;
|
||||
|
||||
_INT32 x = 0;
|
||||
@ -73,7 +73,7 @@ public:
|
||||
bool fAutoText = false;
|
||||
bool fGenerated = false;
|
||||
bool fDeleted = false;
|
||||
bool fAutoMode = false;
|
||||
bool fAutoMode = true;
|
||||
bool fShowLabelAndPerc = false;
|
||||
bool fShowPercent = false;
|
||||
bool fShowBubbleSizes = false;
|
||||
|
||||
@ -47,6 +47,13 @@ void FrtFontInfo::load(CFRecord& record)
|
||||
fScaled = GETBIT(flags, 0);
|
||||
}
|
||||
|
||||
void FrtFontInfo::save(CFRecord& record)
|
||||
{
|
||||
unsigned short flags = 0;
|
||||
SETBIT(flags, 0, fScaled);
|
||||
record << flags << ifnt;
|
||||
}
|
||||
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,9 +48,10 @@ public:
|
||||
static const ElementType type = typeFontInfo;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
virtual void save(CFRecord& record);
|
||||
|
||||
bool fScaled;
|
||||
bool fScaled = false;
|
||||
FontIndex ifnt;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
} // namespace XLS
|
||||
|
||||
@ -145,7 +145,7 @@ std::wstring HyperlinkObject::loadHyperlinkString(XLS::CFRecord& record)
|
||||
_INT32 size = 0;
|
||||
record >> size;
|
||||
|
||||
if (size < 1) return L"";
|
||||
if (size < 1 || record.getRdPtr() + size > record.getDataSize()) return L"";
|
||||
|
||||
_INT32 size_record = record.getDataSize() - record.getRdPtr();
|
||||
if (size > size_record)
|
||||
|
||||
@ -77,8 +77,6 @@ void RC4EncryptionHeader::load(XLS::CFRecord& record)
|
||||
_UINT32 Reserved1; record >> Reserved1;
|
||||
_UINT32 Reserved2; record >> Reserved2;
|
||||
|
||||
int pos = record.getRdPtr();
|
||||
int size = record.getDataSize();
|
||||
|
||||
std::wstring providerName;
|
||||
record >> providerName;
|
||||
@ -86,7 +84,11 @@ void RC4EncryptionHeader::load(XLS::CFRecord& record)
|
||||
//EncryptionVerifier
|
||||
|
||||
record >> crypt_data_aes.saltSize;
|
||||
|
||||
|
||||
int pos = record.getRdPtr();
|
||||
int size = record.getDataSize();
|
||||
if(pos + crypt_data_aes.saltSize > size)
|
||||
return;
|
||||
unsigned char *pDataRead = new unsigned char[crypt_data_aes.saltSize];
|
||||
memcpy(pDataRead, record.getCurData<unsigned char>(), crypt_data_aes.saltSize);
|
||||
record.skipNunBytes(crypt_data_aes.saltSize);
|
||||
|
||||
@ -102,11 +102,14 @@ const bool AXISPARENT::loadContent(BinProcessor& proc)
|
||||
const bool AXISPARENT::saveContent(BinProcessor& proc)
|
||||
{
|
||||
if(m_AxisParent == nullptr)
|
||||
return false;
|
||||
proc.mandatory(*m_AxisParent);
|
||||
proc.mandatory<AxisParent>();
|
||||
else
|
||||
proc.mandatory(*m_AxisParent);
|
||||
proc.mandatory<Begin>();
|
||||
if(m_Pos != nullptr)
|
||||
proc.mandatory(*m_Pos);
|
||||
else
|
||||
proc.mandatory<Pos>();
|
||||
if(m_AXES != nullptr)
|
||||
proc.mandatory(*m_AXES);
|
||||
for(auto i: m_arCRT)
|
||||
|
||||
@ -294,6 +294,10 @@ const bool CHARTFORMATS::saveContent(BinProcessor& proc)
|
||||
return false;
|
||||
proc.mandatory(*m_ChartRect);
|
||||
proc.mandatory<Begin>();
|
||||
for(auto i : m_arFONTLIST)
|
||||
{
|
||||
proc.mandatory(*i);
|
||||
}
|
||||
if(m_Scl != nullptr)
|
||||
proc.mandatory(*m_Scl);
|
||||
else
|
||||
|
||||
@ -95,5 +95,24 @@ const bool FONTLIST::loadContent(BinProcessor& proc)
|
||||
return true;
|
||||
}
|
||||
|
||||
const bool FONTLIST::saveContent(BinProcessor& proc)
|
||||
{
|
||||
if(m_fontList == nullptr)
|
||||
return false;
|
||||
proc.mandatory(*m_fontList);
|
||||
if(m_startObject != nullptr)
|
||||
proc.mandatory(*m_startObject);
|
||||
for(auto i : m_fonts)
|
||||
{
|
||||
if(i.first != nullptr)
|
||||
proc.mandatory(*i.first);
|
||||
if(i.second != nullptr)
|
||||
proc.mandatory(*i.second);
|
||||
}
|
||||
if(m_endObject != nullptr)
|
||||
proc.mandatory(*m_endObject);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,7 +48,12 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
virtual const bool saveContent(BinProcessor& proc);
|
||||
|
||||
BaseObjectPtr m_fontList;
|
||||
BaseObjectPtr m_startObject;
|
||||
std::vector<std::pair<BaseObjectPtr,BaseObjectPtr>> m_fonts;
|
||||
BaseObjectPtr m_endObject;
|
||||
static const ElementType type = typeFONTLIST;
|
||||
};
|
||||
|
||||
|
||||
@ -106,9 +106,10 @@ const bool FRAME::loadContent(BinProcessor& proc)
|
||||
|
||||
const bool FRAME::saveContent(BinProcessor& proc)
|
||||
{
|
||||
if(m_Frame == nullptr)
|
||||
return false;
|
||||
proc.mandatory(*m_Frame);
|
||||
if(m_Frame != nullptr)
|
||||
proc.mandatory(*m_Frame);
|
||||
else
|
||||
proc.mandatory<Frame>();
|
||||
proc.mandatory<Begin>();
|
||||
if(m_LineFormat != nullptr)
|
||||
proc.mandatory(*m_LineFormat);
|
||||
|
||||
@ -407,11 +407,15 @@ const bool ChartSheetSubstream::loadContent(BinProcessor& proc)
|
||||
|
||||
const bool ChartSheetSubstream::saveContent(BinProcessor& proc)
|
||||
{
|
||||
{
|
||||
BOF bof;
|
||||
bof.dt= 0x0020;
|
||||
proc.mandatory(bof);
|
||||
}
|
||||
auto globInfo = proc.getGlobalWorkbookInfo();
|
||||
{
|
||||
if(globInfo->sheets_info.size() > globInfo->current_sheet)
|
||||
globInfo->sheets_info.at(globInfo->current_sheet).StreamPos = proc.GetRecordPosition();
|
||||
|
||||
BOF bof;
|
||||
bof.dt= 0x0020;
|
||||
proc.mandatory(bof);
|
||||
}
|
||||
if(m_WriteProtect != nullptr)
|
||||
proc.mandatory(*m_WriteProtect);
|
||||
if(m_SheetExt != nullptr)
|
||||
@ -423,6 +427,8 @@ const bool ChartSheetSubstream::saveContent(BinProcessor& proc)
|
||||
proc.mandatory(*m_PAGESETUP);
|
||||
if(m_PrintSize != nullptr)
|
||||
proc.mandatory(*m_PrintSize);
|
||||
else
|
||||
proc.mandatory<PrintSize>();
|
||||
if(!m_arRECORD12.empty())
|
||||
if(m_arRECORD12[0] != nullptr)
|
||||
proc.mandatory(*m_arRECORD12[0]);
|
||||
@ -441,6 +447,8 @@ const bool ChartSheetSubstream::saveContent(BinProcessor& proc)
|
||||
proc.mandatory(*m_PivotChartBits);
|
||||
if(m_SBaseRef != nullptr)
|
||||
proc.mandatory(*m_SBaseRef);
|
||||
if(m_OBJECTS != nullptr)
|
||||
proc.mandatory(*m_OBJECTS);
|
||||
proc.mandatory<Units>();
|
||||
if(m_CHARTFORMATS != nullptr)
|
||||
proc.mandatory(*m_CHARTFORMATS);
|
||||
|
||||
@ -91,7 +91,9 @@ namespace NSBinPptxRW
|
||||
SlideNotesRels = 45,
|
||||
NotesRels = 46,
|
||||
NotesMastersRels= 47,
|
||||
CustomProperties= 48
|
||||
CustomProperties= 48,
|
||||
HandoutMastersRels = 49
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1581,6 +1581,16 @@ namespace NSBinPptxRW
|
||||
std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
|
||||
m_pWriter->WriteString(s);
|
||||
}
|
||||
void CRelsGenerator::StartThemeHandoutMaster(int nIndexTheme)
|
||||
{
|
||||
m_pWriter->WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
|
||||
m_pWriter->WriteString(L"<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
|
||||
|
||||
std::wstring s = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme" +
|
||||
std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
|
||||
m_pWriter->WriteString(s);
|
||||
}
|
||||
void CRelsGenerator::StartLayout(int nIndexTheme)
|
||||
{
|
||||
m_pWriter->WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
|
||||
@ -1653,13 +1663,18 @@ namespace NSBinPptxRW
|
||||
|
||||
return rid;
|
||||
}
|
||||
|
||||
void CRelsGenerator::WriteNotesMaster()
|
||||
{
|
||||
std::wstring strRels0 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/>";
|
||||
m_pWriter->WriteString(strRels0);
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/>";
|
||||
m_pWriter->WriteString(strRels0);
|
||||
}
|
||||
void CRelsGenerator::WriteHandoutMaster()
|
||||
{
|
||||
std::wstring strRels0 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/handoutMaster\" Target=\"handoutMasters/handoutMaster1.xml\"/>";
|
||||
m_pWriter->WriteString(strRels0);
|
||||
}
|
||||
std::wstring CRelsGenerator::WriteCustom(const std::wstring & file_name)
|
||||
{
|
||||
std::wstring rid = L"rId" + std::to_wstring(m_lNextRelsID++);
|
||||
|
||||
@ -162,12 +162,14 @@ namespace NSBinPptxRW
|
||||
std::map<size_t, LONG> layouts;
|
||||
std::map<size_t, LONG> notes;
|
||||
std::map<size_t, LONG> notesMasters;
|
||||
std::map<size_t, LONG> handoutMasters;
|
||||
|
||||
std::vector<_masterSlideInfo> m_oRels;
|
||||
std::vector<LONG> m_oSlide_Layout_Rels;
|
||||
std::vector<LONG> m_oSlide_Notes_Rels;
|
||||
std::vector<LONG> m_oNote_Rels;
|
||||
std::vector<LONG> m_oNotesMasters_Rels;
|
||||
std::vector<LONG> m_oHandoutMasters_Rels;
|
||||
|
||||
NSShapeImageGen::CMediaManager* m_pMediaManager;
|
||||
|
||||
@ -488,10 +490,13 @@ namespace NSBinPptxRW
|
||||
void StartLayout (int nIndexTheme);
|
||||
void StartSlide (int nIndexSlide, int nIndexLayout, int nIndexNotes);
|
||||
void StartNotes (int nIndexSlide);
|
||||
void StartThemeNotesMaster(int nIndexTheme);
|
||||
|
||||
|
||||
void WriteThemes (int nCount);
|
||||
void WriteNotesMaster();
|
||||
void WriteHandoutMaster();
|
||||
|
||||
void StartThemeNotesMaster(int nIndexTheme);
|
||||
void StartThemeHandoutMaster(int nIndexTheme);
|
||||
|
||||
std::wstring WriteCustom(const std::wstring& file_name);
|
||||
std::wstring WriteMaster(int nIndex);
|
||||
|
||||
@ -33,12 +33,12 @@
|
||||
#include "Converter.h"
|
||||
#include "../../PPTXFormat/Presentation/PresentationChildElements.h"
|
||||
#include "../../PPTXFormat/NotesSlide.h"
|
||||
#include "../../PPTXFormat/HandoutMaster.h"
|
||||
|
||||
namespace PPTX2EditorAdvanced
|
||||
{
|
||||
DWORD Convert(NSBinPptxRW::CBinaryFileWriter& oBinaryWriter, PPTX::Document& oFolder, const std::wstring& strSourceDirectory, const std::wstring& strDstFile, bool bIsNoBase64)
|
||||
{
|
||||
// сначала соберем все объекты для конвертации и сформируем main-таблицы
|
||||
NSBinPptxRW::CCommonWriter* pCommon = oBinaryWriter.m_pCommon;
|
||||
|
||||
std::vector<smart_ptr<PPTX::Theme>> _themes;
|
||||
@ -47,6 +47,7 @@ namespace PPTX2EditorAdvanced
|
||||
std::vector<smart_ptr<PPTX::SlideLayout>> _layouts;
|
||||
std::vector<smart_ptr<PPTX::NotesSlide>> _notes;
|
||||
std::vector<smart_ptr<PPTX::NotesMaster>> _notesMasters;
|
||||
std::vector<smart_ptr<PPTX::HandoutMaster>> _handoutMasters;
|
||||
|
||||
smart_ptr<PPTX::Presentation> presentation = oFolder.Get(OOX::Presentation::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
|
||||
@ -55,7 +56,6 @@ namespace PPTX2EditorAdvanced
|
||||
int cy = presentation->sldSz->cy;
|
||||
#endif
|
||||
|
||||
// записываем все темы
|
||||
size_t nCountMasters = presentation->sldMasterIdLst.size();
|
||||
for (size_t nMaster = 0; nMaster < nCountMasters; ++nMaster)
|
||||
{
|
||||
@ -167,6 +167,47 @@ namespace PPTX2EditorAdvanced
|
||||
oBinaryWriter.m_pCommon->m_oNotesMasters_Rels.push_back(nNotesMastersRelsIndex);
|
||||
}
|
||||
|
||||
// записываем все handoutMasters
|
||||
size_t nCountHandoutMasters = presentation->handoutMasterIdLst.size();
|
||||
for (size_t nHandout = 0; nHandout < nCountHandoutMasters; ++nHandout)
|
||||
{
|
||||
smart_ptr<PPTX::HandoutMaster> handoutMaster = ((*presentation)[presentation->handoutMasterIdLst[nHandout].rid.get()]).smart_dynamic_cast<PPTX::HandoutMaster>();
|
||||
if (false == handoutMaster.IsInit())
|
||||
{
|
||||
// такого быть не должно
|
||||
continue;
|
||||
}
|
||||
size_t pPointerNM = (size_t)(handoutMaster.operator ->());
|
||||
|
||||
std::map<size_t, LONG>::const_iterator pSearchNM = pCommon->handoutMasters.find(pPointerNM);
|
||||
if (pSearchNM != pCommon->handoutMasters.end())
|
||||
{
|
||||
// такого быть не должно
|
||||
continue;
|
||||
}
|
||||
|
||||
// записываем mainMaster
|
||||
LONG lCountNM = (LONG)_handoutMasters.size();
|
||||
pCommon->handoutMasters[pPointerNM] = lCountNM;
|
||||
_handoutMasters.push_back(handoutMaster);
|
||||
|
||||
// проверяем theme
|
||||
size_t pPointerTh = (size_t)(handoutMaster->theme_.operator ->());
|
||||
LONG nHandoutMastersRelsIndex = -1;
|
||||
std::map<size_t, LONG>::const_iterator pSearchTh = pCommon->themes.find(pPointerTh);
|
||||
if (pSearchTh == pCommon->themes.end())
|
||||
{
|
||||
LONG lCountTh = (LONG)_themes.size();
|
||||
pCommon->themes[pPointerTh] = lCountTh;
|
||||
_themes.push_back(handoutMaster->theme_);
|
||||
nHandoutMastersRelsIndex = lCountTh;
|
||||
}
|
||||
else {
|
||||
nHandoutMastersRelsIndex = pSearchTh->second;
|
||||
}
|
||||
oBinaryWriter.m_pCommon->m_oHandoutMasters_Rels.push_back(nHandoutMastersRelsIndex);
|
||||
}
|
||||
|
||||
// записываем все слайды
|
||||
for (size_t i = 0; i < presentation->sldIdLst.size(); ++i)
|
||||
{
|
||||
@ -407,6 +448,14 @@ namespace PPTX2EditorAdvanced
|
||||
{
|
||||
_notesMasters[i]->toPPTY(&oBinaryWriter);
|
||||
}
|
||||
// handoutmasters
|
||||
oBinaryWriter.StartMainRecord(NSBinPptxRW::NSMainTables::HandoutMasters);
|
||||
ULONG nCountHM = (ULONG)_handoutMasters.size();
|
||||
oBinaryWriter.WriteULONG(nCountHM);
|
||||
for (ULONG i = 0; i < nCountHM; ++i)
|
||||
{
|
||||
_handoutMasters[i]->toPPTY(&oBinaryWriter);
|
||||
}
|
||||
// ImageMap ---------------------------------------
|
||||
oBinaryWriter.StartMainRecord(NSBinPptxRW::NSMainTables::ImageMap);
|
||||
oBinaryWriter.StartRecord(NSBinPptxRW::NSMainTables::ImageMap);
|
||||
@ -529,13 +578,25 @@ namespace PPTX2EditorAdvanced
|
||||
|
||||
oBinaryWriter.WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
oBinaryWriter.EndRecord();
|
||||
// HandoutMastersRels --------------------------------------
|
||||
oBinaryWriter.StartMainRecord(NSBinPptxRW::NSMainTables::HandoutMastersRels);
|
||||
oBinaryWriter.StartRecord(NSBinPptxRW::NSMainTables::HandoutMastersRels);
|
||||
oBinaryWriter.WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
|
||||
_s_rels = oBinaryWriter.m_pCommon->m_oHandoutMasters_Rels.size();
|
||||
for (size_t i = 0; i < _s_rels; ++i)
|
||||
{
|
||||
oBinaryWriter.WriteInt1(0, oBinaryWriter.m_pCommon->m_oHandoutMasters_Rels[i]);
|
||||
}
|
||||
|
||||
oBinaryWriter.WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
oBinaryWriter.EndRecord();
|
||||
|
||||
oBinaryWriter.EndRecord();
|
||||
// ------------------------------------------------
|
||||
oBinaryWriter.WriteEmbeddedFonts();
|
||||
oBinaryWriter.WriteMainPart(nStartPos);
|
||||
|
||||
// все записалось нормально. осталось скинуть на диск
|
||||
BYTE* pbBinBuffer = oBinaryWriter.GetBuffer();
|
||||
int nBinBufferLen = (int)oBinaryWriter.GetPosition();
|
||||
if (bIsNoBase64)
|
||||
|
||||
@ -39,9 +39,9 @@ namespace Writers
|
||||
}
|
||||
void DefaultNotesMasterWriter::Write(std::wstring fileName)
|
||||
{
|
||||
std::wstring s_Common = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
|
||||
std::wstring s_Common = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
|
||||
|
||||
s_Common += _T("<p:notesMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\
|
||||
s_Common += L"<p:notesMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\
|
||||
<p:cSld>\
|
||||
<p:bg>\
|
||||
<p:bgPr>\
|
||||
@ -224,7 +224,54 @@ namespace Writers
|
||||
</a:defRPr>\
|
||||
</a:lvl9pPr>\
|
||||
</p:notesStyle>\
|
||||
</p:notesMaster>");
|
||||
</p:notesMaster>";
|
||||
|
||||
OOX::CPath pathFile = fileName;
|
||||
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFile(pathFile.GetPath());
|
||||
oFile.WriteStringUTF8(s_Common);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
DefaultHandoutMasterWriter::DefaultHandoutMasterWriter()
|
||||
{
|
||||
}
|
||||
void DefaultHandoutMasterWriter::Write(std::wstring fileName)
|
||||
{
|
||||
std::wstring s_Common = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
|
||||
|
||||
s_Common += L"<p:handoutMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
|
||||
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
|
||||
xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\
|
||||
<p:cSld><p:bg><p:bgRef idx=\"1001\"><a:schemeClr val=\"bg1\"/></p:bgRef></p:bg><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=""/>\
|
||||
<p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/>\
|
||||
</a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"2\" name=\"Header Placeholder 1\"><a:extLst><a:ext uri=\"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}\">\
|
||||
<a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" id=\"{F67C4017-3E03-D994-D007-4D4D5EBE9CE9}\"/></a:ext></a:extLst>\
|
||||
</p:cNvPr><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"hdr\" sz=\"quarter\"/></p:nvPr></p:nvSpPr><p:spPr>\
|
||||
<a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"2971800\" cy=\"458788\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr>\
|
||||
<p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\"/><a:lstStyle><a:lvl1pPr algn=\"l\"><a:defRPr sz=\"1200\"/>\
|
||||
</a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"3\" name=\"Date Placeholder 2\">\
|
||||
<a:extLst><a:ext uri=\"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}\"><a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" \
|
||||
id=\"{749FF9CD-FA8A-BCBD-7746-C502D224F9D4}\"/></a:ext></a:extLst></p:cNvPr><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"dt\" sz=\"quarter\" \
|
||||
idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"3884613\" y=\"0\"/><a:ext cx=\"2971800\" cy=\"458788\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/>\
|
||||
</a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\"/><a:lstStyle><a:lvl1pPr algn=\"r\">\
|
||||
<a:defRPr sz=\"1200\"/></a:lvl1pPr></a:lstStyle><a:p><a:fld id=\"{DBDFD766-57CE-4B91-8DD2-37F0838B984D}\" type=\"datetimeFigureOut\"><a:rPr smtClean=\"0\"/>\
|
||||
<a:t></a:t></a:fld><a:endParaRPr/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id=\"4\" name=\"Footer Placeholder 3\"><a:extLst>\
|
||||
<a:ext uri=\"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}\"><a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" \
|
||||
id=\"{942A17DF-8C78-FA66-4CE3-783B1C5D3A5A}\"/></a:ext></a:extLst></p:cNvPr><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr>\
|
||||
<p:ph type=\"ftr\" sz=\"quarter\" idx=\"2\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x=\"0\" y=\"8685213\"/><a:ext cx=\"2971800\" cy=\"458787\"/>\
|
||||
</a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\" \
|
||||
anchor=\"b\"/><a:lstStyle><a:lvl1pPr algn=\"l\"><a:defRPr sz=\"1200\"/></a:lvl1pPr></a:lstStyle><a:p><a:endParaRPr/></a:p></p:txBody></p:sp><p:sp><p:nvSpPr>\
|
||||
<p:cNvPr id=\"5\" name=\"Slide Number Placeholder 4\"><a:extLst><a:ext uri=\"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}\">\
|
||||
<a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" id=\"{54E6FC8D-4D60-9D7A-1320-C69919607B49}\"/></a:ext></a:extLst>\
|
||||
</p:cNvPr><p:cNvSpPr><a:spLocks noGrp=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"sldNum\" sz=\"quarter\" idx=\"3\"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm>\
|
||||
<a:off x=\"3884613\" y=\"8685213\"/><a:ext cx=\"2971800\" cy=\"458787\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></p:spPr><p:txBody>\
|
||||
<a:bodyPr vert=\"horz\" lIns=\"91440\" tIns=\"45720\" rIns=\"91440\" bIns=\"45720\" rtlCol=\"0\" anchor=\"b\"/><a:lstStyle><a:lvl1pPr algn=\"r\"><a:defRPr sz=\"1200\"/>\
|
||||
</a:lvl1pPr></a:lstStyle><a:p><a:fld id=\"{D7F4AEF4-93E6-4B70-916A-B30E3EBEE0F3}\" type=\"slidenum\"><a:rPr smtClean=\"0\"/><a:t><3E>#<23></a:t></a:fld><a:endParaRPr/>\
|
||||
</a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri=\"{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}\">\
|
||||
<p14:creationId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"2429687043\"/></p:ext></p:extLst></p:cSld>\
|
||||
<p:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" \
|
||||
hlink=\"hlink\" folHlink=\"folHlink\"/></p:handoutMaster>";
|
||||
|
||||
OOX::CPath pathFile = fileName;
|
||||
|
||||
|
||||
@ -42,5 +42,11 @@ namespace Writers
|
||||
DefaultNotesMasterWriter();
|
||||
void Write(std::wstring fileName);
|
||||
};
|
||||
class DefaultHandoutMasterWriter
|
||||
{
|
||||
public:
|
||||
DefaultHandoutMasterWriter();
|
||||
void Write(std::wstring fileName);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -66,8 +66,8 @@ namespace NSBinPptxRW
|
||||
{
|
||||
m_strDstFolder = strFolder;
|
||||
|
||||
OOX::CPath pathPPT = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt");
|
||||
OOX::CPath pathDocProps = m_strDstFolder + FILE_SEPARATOR_STR + _T("docProps");
|
||||
OOX::CPath pathPPT = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt";
|
||||
OOX::CPath pathDocProps = m_strDstFolder + FILE_SEPARATOR_STR + L"docProps";
|
||||
|
||||
NSDirectory::CreateDirectory(m_strDstFolder);
|
||||
NSDirectory::CreateDirectory(pathDocProps.GetPath());
|
||||
@ -77,19 +77,19 @@ namespace NSBinPptxRW
|
||||
|
||||
m_oImageManager.SetDstFolder(pathPPT.GetPath());
|
||||
|
||||
OOX::CPath pathMedia = pathPPT / _T("media");
|
||||
OOX::CPath pathMedia = pathPPT / L"media";
|
||||
m_oImageManager.SetDstMedia(pathMedia.GetPath());
|
||||
NSDirectory::CreateDirectory(pathMedia.GetPath());
|
||||
|
||||
OOX::CPath pathCharts = pathPPT / _T("charts");
|
||||
OOX::CPath pathCharts = pathPPT / L"charts";
|
||||
m_oImageManager.SetDstCharts(pathCharts.GetPath());
|
||||
|
||||
OOX::CPath pathEmbeddings = pathPPT / _T("embeddings");
|
||||
OOX::CPath pathEmbeddings = pathPPT / L"embeddings";
|
||||
m_oImageManager.SetDstEmbed(pathEmbeddings.GetPath());
|
||||
|
||||
m_oReader.m_pRels->m_pManager = &m_oImageManager;
|
||||
|
||||
OOX::CPath pathTheme = pathPPT / _T("theme");
|
||||
OOX::CPath pathTheme = pathPPT / L"theme";
|
||||
NSDirectory::CreateDirectory(pathTheme.GetPath());
|
||||
|
||||
m_oReader.m_strFolderThemes = pathTheme.GetPath();
|
||||
@ -186,6 +186,7 @@ namespace NSBinPptxRW
|
||||
LONG nCountLayouts = 0;
|
||||
LONG nCountSlides = 0;
|
||||
bool bNotesMasterPresent = false;
|
||||
bool bHandoutMasterPresent = false;
|
||||
|
||||
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::Themes);
|
||||
if (m_mainTables.end() != pPair)
|
||||
@ -317,6 +318,23 @@ namespace NSBinPptxRW
|
||||
m_arNotesMasters_Theme.push_back(m_oReader.GetULong());
|
||||
}
|
||||
}
|
||||
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::HandoutMastersRels);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
m_oReader.Skip(6); // type + len + start attr
|
||||
|
||||
size_t index = 0;
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = m_oReader.GetUChar_TypeNode();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
m_arHandoutMasters_Theme.push_back(m_oReader.GetULong());
|
||||
}
|
||||
}
|
||||
|
||||
// теперь нужно удалить все themes, которые не ведут на мастерслайды
|
||||
std::vector<LONG> arThemes;
|
||||
std::vector<LONG> arThemesDst;
|
||||
@ -336,7 +354,6 @@ namespace NSBinPptxRW
|
||||
arThemesSave[ind] = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_arNotesMasters_Theme.size(); i++)
|
||||
{
|
||||
int index = m_arNotesMasters_Theme[i];
|
||||
@ -345,6 +362,14 @@ namespace NSBinPptxRW
|
||||
arThemesSave[index] = true;
|
||||
}
|
||||
}
|
||||
for (size_t i = 0; i < m_arHandoutMasters_Theme.size(); i++)
|
||||
{
|
||||
int index = m_arHandoutMasters_Theme[i];
|
||||
if (index >= 0 && index < (int)arThemesSave.size())
|
||||
{
|
||||
arThemesSave[index] = true;
|
||||
}
|
||||
}
|
||||
LONG lCurrectTheme = 0;
|
||||
for (LONG i = 0; i < nCountMasters && i < arThemesSave.size(); ++i)
|
||||
{
|
||||
@ -363,7 +388,7 @@ namespace NSBinPptxRW
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
OOX::CPath pathFolder = m_oReader.m_strFolderThemes;
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + L"_rels";
|
||||
|
||||
NSDirectory::CreateDirectory(pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory(pathFolderRels.GetPath());
|
||||
@ -402,7 +427,7 @@ namespace NSBinPptxRW
|
||||
OOX::CPath pathFile = pathFolder + FILE_SEPARATOR_STR + strMasterXml;
|
||||
oXmlWriter.SaveToFile(pathFile.GetPath());
|
||||
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + _T(".rels");
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + L".rels";
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
@ -410,8 +435,8 @@ namespace NSBinPptxRW
|
||||
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::SlideMasters);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("slideMasters");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"slideMasters";
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + L"_rels";
|
||||
|
||||
NSDirectory::CreateDirectory(pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory(pathFolderRels.GetPath());
|
||||
@ -459,7 +484,7 @@ namespace NSBinPptxRW
|
||||
OOX::CPath pathFile = pathFolder + FILE_SEPARATOR_STR + strMasterXml;
|
||||
oXmlWriter.SaveToFile(pathFile.GetPath());
|
||||
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + _T(".rels");
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + L".rels";
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
@ -467,8 +492,8 @@ namespace NSBinPptxRW
|
||||
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::SlideLayouts);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("slideLayouts");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"slideLayouts";
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + L"_rels";
|
||||
|
||||
NSDirectory::CreateDirectory(pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory(pathFolderRels.GetPath());
|
||||
@ -501,7 +526,7 @@ namespace NSBinPptxRW
|
||||
OOX::CPath pathFile = pathFolder + FILE_SEPARATOR_STR + strMasterXml;
|
||||
oXmlWriter.SaveToFile(pathFile.GetPath());
|
||||
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + _T(".rels");
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + L".rels";
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
@ -514,8 +539,8 @@ namespace NSBinPptxRW
|
||||
|
||||
if (lCount > 0)
|
||||
{
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("notesSlides");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"notesSlides";
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + L"_rels";
|
||||
|
||||
NSDirectory::CreateDirectory(pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory(pathFolderRels.GetPath());
|
||||
@ -555,7 +580,7 @@ namespace NSBinPptxRW
|
||||
OOX::CPath pathFile = pathFolder + FILE_SEPARATOR_STR + strNotesXml;
|
||||
oXmlWriter.SaveToFile(pathFile.GetPath());
|
||||
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strNotesXml + _T(".rels");
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strNotesXml + L".rels";
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
@ -569,8 +594,8 @@ namespace NSBinPptxRW
|
||||
|
||||
if (lCount > 0 || m_arNotesSlides.size() > 0)//один элемент
|
||||
{
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("notesMasters");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"notesMasters";
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + L"_rels";
|
||||
|
||||
NSDirectory::CreateDirectory(pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory(pathFolderRels.GetPath());
|
||||
@ -579,7 +604,7 @@ namespace NSBinPptxRW
|
||||
m_arNotesMasters.push_back(elm);
|
||||
|
||||
m_oReader.m_pRels->Clear();
|
||||
m_oReader.m_pRels->StartThemeNotesMaster((int)m_arSlideMasters_Theme.size());
|
||||
m_oReader.m_pRels->StartThemeNotesMaster(m_arNotesMasters_Theme[0]);
|
||||
|
||||
bNotesMasterPresent = true;
|
||||
if (lCount > 0)
|
||||
@ -601,22 +626,73 @@ namespace NSBinPptxRW
|
||||
OOX::CPath pathFile = pathFolder + FILE_SEPARATOR_STR + strMasterNotesXml;
|
||||
oXmlWriter.SaveToFile(pathFile.GetPath());
|
||||
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterNotesXml + _T(".rels");
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterNotesXml + L".rels";
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateDefaultNotesMasters((int)m_arSlideMasters_Theme.size());
|
||||
CreateDefaultNotesMasters(m_arNotesMasters_Theme[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// handoutMasters
|
||||
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::HandoutMasters);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
LONG lCount = m_oReader.GetLong();
|
||||
|
||||
if (lCount > 0)
|
||||
{
|
||||
bHandoutMasterPresent = true;
|
||||
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"handoutMasters";
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + L"_rels";
|
||||
|
||||
NSDirectory::CreateDirectory(pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory(pathFolderRels.GetPath());
|
||||
|
||||
PPTX::HandoutMaster elm(&m_oDocument);
|
||||
m_arHandoutMasters.push_back(elm);
|
||||
|
||||
m_oReader.m_pRels->Clear();
|
||||
m_oReader.m_pRels->StartThemeHandoutMaster(m_arHandoutMasters_Theme[0]);
|
||||
|
||||
if (lCount > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
m_arHandoutMasters.back().fromPPTY(&m_oReader);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
m_oReader.m_pRels->CloseRels();
|
||||
|
||||
std::wstring strMasterHandoutXml = L"handoutMaster1.xml";
|
||||
oXmlWriter.ClearNoAttack();
|
||||
|
||||
m_arHandoutMasters.back().toXmlWriter(&oXmlWriter);
|
||||
|
||||
OOX::CPath pathFile = pathFolder + FILE_SEPARATOR_STR + strMasterHandoutXml;
|
||||
oXmlWriter.SaveToFile(pathFile.GetPath());
|
||||
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterHandoutXml + L".rels";
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateDefaultHandoutMasters(m_arHandoutMasters_Theme[0]);
|
||||
}
|
||||
}
|
||||
// slides
|
||||
int nComment = 1;
|
||||
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::Slides);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("slides");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"slides";
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + L"_rels";
|
||||
|
||||
NSDirectory::CreateDirectory(pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory(pathFolderRels.GetPath());
|
||||
@ -642,7 +718,7 @@ namespace NSBinPptxRW
|
||||
|
||||
if (m_arSlides[i].comments.is_init())
|
||||
{
|
||||
OOX::CPath pathFolderCommentDir = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("comments");
|
||||
OOX::CPath pathFolderCommentDir = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"comments";
|
||||
if (1 == nComment)
|
||||
{
|
||||
NSDirectory::CreateDirectory(pathFolderCommentDir.GetPath());
|
||||
@ -679,7 +755,7 @@ namespace NSBinPptxRW
|
||||
OOX::CPath pathFile = pathFolder + FILE_SEPARATOR_STR + strMasterXml;
|
||||
oXmlWriter.SaveToFile(pathFile.GetPath());
|
||||
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + _T(".rels");
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + L".rels";
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
@ -770,28 +846,28 @@ namespace NSBinPptxRW
|
||||
oXmlWriter.ClearNoAttack();
|
||||
m_oApp.toXmlWriter(&oXmlWriter);
|
||||
|
||||
OOX::CPath pathApp = m_strDstFolder + FILE_SEPARATOR_STR + _T("docProps") + FILE_SEPARATOR_STR + _T("app.xml");
|
||||
OOX::CPath pathApp = m_strDstFolder + FILE_SEPARATOR_STR + L"docProps" + FILE_SEPARATOR_STR + L"app.xml";
|
||||
oXmlWriter.SaveToFile(pathApp.GetPath());
|
||||
|
||||
// core
|
||||
oXmlWriter.ClearNoAttack();
|
||||
m_oCore.toXmlWriter(&oXmlWriter);
|
||||
|
||||
OOX::CPath pathCore = m_strDstFolder + FILE_SEPARATOR_STR + _T("docProps") + FILE_SEPARATOR_STR + _T("core.xml");
|
||||
OOX::CPath pathCore = m_strDstFolder + FILE_SEPARATOR_STR + L"docProps" + FILE_SEPARATOR_STR + L"core.xml";
|
||||
oXmlWriter.SaveToFile(pathCore.GetPath());
|
||||
|
||||
// presProps
|
||||
oXmlWriter.ClearNoAttack();
|
||||
m_oPresProps.toXmlWriter(&oXmlWriter);
|
||||
|
||||
OOX::CPath pathPresProps = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("presProps.xml");
|
||||
OOX::CPath pathPresProps = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"presProps.xml";
|
||||
oXmlWriter.SaveToFile(pathPresProps.GetPath());
|
||||
|
||||
// viewProps
|
||||
oXmlWriter.ClearNoAttack();
|
||||
m_oViewProps.toXmlWriter(&oXmlWriter);
|
||||
|
||||
OOX::CPath pathViewProps = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("viewProps.xml");
|
||||
OOX::CPath pathViewProps = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"viewProps.xml";
|
||||
oXmlWriter.SaveToFile(pathViewProps.GetPath());
|
||||
|
||||
m_oReader.m_pRels->Clear();
|
||||
@ -816,15 +892,15 @@ namespace NSBinPptxRW
|
||||
oXmlWriter.ClearNoAttack();
|
||||
m_oCustomProperties->toXmlWriter(&oXmlWriter);
|
||||
|
||||
OOX::CPath pathCore = m_strDstFolder + FILE_SEPARATOR_STR + _T("docProps") + FILE_SEPARATOR_STR + OOX::FileTypes::CustomProperties.DefaultFileName().GetPath();
|
||||
OOX::CPath pathCore = m_strDstFolder + FILE_SEPARATOR_STR + L"docProps" + FILE_SEPARATOR_STR + OOX::FileTypes::CustomProperties.DefaultFileName().GetPath();
|
||||
oXmlWriter.SaveToFile(pathCore.GetPath());
|
||||
}
|
||||
// customs
|
||||
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::Customs);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("customXml");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + L"customXml";
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + L"_rels";
|
||||
|
||||
NSDirectory::CreateDirectory(pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory(pathFolderRels.GetPath());
|
||||
@ -849,15 +925,15 @@ namespace NSBinPptxRW
|
||||
oXmlWriter.ClearNoAttack();
|
||||
m_oTableStyles.toXmlWriter(&oXmlWriter);
|
||||
|
||||
OOX::CPath pathTableStyles = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("tableStyles.xml");
|
||||
OOX::CPath pathTableStyles = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"tableStyles.xml";
|
||||
oXmlWriter.SaveToFile(pathTableStyles.GetPath());
|
||||
|
||||
// presentation
|
||||
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::Presentation);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt";
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + L"_rels";
|
||||
|
||||
NSDirectory::CreateDirectory(pathFolderRels.GetPath());
|
||||
|
||||
@ -904,9 +980,16 @@ namespace NSBinPptxRW
|
||||
m_oPresentation.notesMasterIdLst[0].rid = m_oReader.m_pRels->m_lNextRelsID;
|
||||
m_oReader.m_pRels->WriteNotesMaster();
|
||||
}
|
||||
if (bHandoutMasterPresent)
|
||||
{
|
||||
m_oPresentation.handoutMasterIdLst.push_back(PPTX::Logic::XmlId(L"p:handoutMasterId"));
|
||||
|
||||
m_oPresentation.handoutMasterIdLst[0].rid = m_oReader.m_pRels->m_lNextRelsID;
|
||||
m_oReader.m_pRels->WriteHandoutMaster();
|
||||
}
|
||||
if (m_oPresentation.comments.is_init())
|
||||
{
|
||||
OOX::CPath pathFolderCommentDir = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("comments");
|
||||
OOX::CPath pathFolderCommentDir = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"comments";
|
||||
if (1 == nComment)
|
||||
{
|
||||
NSDirectory::CreateDirectory(pathFolderCommentDir.GetPath());
|
||||
@ -989,7 +1072,11 @@ namespace NSBinPptxRW
|
||||
{
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml", L"/ppt/notesMasters", L"notesMaster1.xml");
|
||||
}
|
||||
|
||||
// handout master
|
||||
if (!m_arHandoutMasters.empty())
|
||||
{
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml", L"/ppt/handoutMasters", L"handoutMaster1.xml");
|
||||
}
|
||||
// masters
|
||||
for (LONG i = 0; i < nCountMasters; ++i)
|
||||
{
|
||||
@ -1017,21 +1104,21 @@ namespace NSBinPptxRW
|
||||
pContentTypes->Write(m_strDstFolder);
|
||||
|
||||
|
||||
std::wstring strRELS = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
std::wstring strRELS = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\
|
||||
<Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"docProps/core.xml\"/>\
|
||||
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"ppt/presentation.xml\"/>\
|
||||
<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>");
|
||||
<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>";
|
||||
if (m_oCustomProperties.IsInit())
|
||||
{
|
||||
strRELS += L"<Relationship Id=\"rId4\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties\" Target=\"docProps/custom.xml\"/>";
|
||||
}
|
||||
strRELS += L"</Relationships>";
|
||||
|
||||
OOX::CPath filePathRels = m_strDstFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
OOX::CPath filePathRels = m_strDstFolder + FILE_SEPARATOR_STR + L"_rels";
|
||||
NSDirectory::CreateDirectory(filePathRels.GetPath());
|
||||
|
||||
filePathRels = filePathRels + FILE_SEPARATOR_STR + _T(".rels");
|
||||
filePathRels = filePathRels + FILE_SEPARATOR_STR + L".rels";
|
||||
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(filePathRels.GetPath());
|
||||
@ -1131,16 +1218,16 @@ namespace NSBinPptxRW
|
||||
int nCountSlides = (int)m_arSlides.size();
|
||||
|
||||
m_oApp.HeadingPairs.push_back(PPTX::Logic::HeadingVariant());
|
||||
m_oApp.HeadingPairs[0].m_type = _T("lpstr");
|
||||
m_oApp.HeadingPairs[0].m_strContent = _T("Theme");
|
||||
m_oApp.HeadingPairs[0].m_type = L"lpstr";
|
||||
m_oApp.HeadingPairs[0].m_strContent = L"Theme";
|
||||
m_oApp.HeadingPairs.push_back(PPTX::Logic::HeadingVariant());
|
||||
m_oApp.HeadingPairs[1].m_type = _T("i4");
|
||||
m_oApp.HeadingPairs[1].m_type = L"i4";
|
||||
m_oApp.HeadingPairs[1].m_iContent = nCountThemes;
|
||||
m_oApp.HeadingPairs.push_back(PPTX::Logic::HeadingVariant());
|
||||
m_oApp.HeadingPairs[2].m_type = _T("lpstr");
|
||||
m_oApp.HeadingPairs[2].m_strContent = _T("Slide Titles");
|
||||
m_oApp.HeadingPairs[2].m_type = L"lpstr";
|
||||
m_oApp.HeadingPairs[2].m_strContent = L"Slide Titles";
|
||||
m_oApp.HeadingPairs.push_back(PPTX::Logic::HeadingVariant());
|
||||
m_oApp.HeadingPairs[3].m_type = _T("i4");
|
||||
m_oApp.HeadingPairs[3].m_type = L"i4";
|
||||
m_oApp.HeadingPairs[3].m_iContent = nCountSlides;
|
||||
|
||||
for (int i = 0; i < nCountThemes; ++i)
|
||||
@ -1184,8 +1271,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
void CPPTXWriter::CreateDefaultCore()
|
||||
{
|
||||
// m_oCore.creator = _T("");
|
||||
m_oCore.m_sLastModifiedBy = _T("");
|
||||
m_oCore.m_sLastModifiedBy = L"";
|
||||
}
|
||||
void CPPTXWriter::CreateDefaultViewProps()
|
||||
{
|
||||
@ -1203,7 +1289,7 @@ namespace NSBinPptxRW
|
||||
m_oViewProps.SlideViewPr->CSldViewPr.CViewPr.Origin.y = -90;
|
||||
|
||||
m_oViewProps.SlideViewPr->CSldViewPr.GuideLst.push_back(PPTX::nsViewProps::Guide());
|
||||
m_oViewProps.SlideViewPr->CSldViewPr.GuideLst[0].orient = _T("horz");
|
||||
m_oViewProps.SlideViewPr->CSldViewPr.GuideLst[0].orient = L"horz";
|
||||
m_oViewProps.SlideViewPr->CSldViewPr.GuideLst[0].pos = 2160;
|
||||
m_oViewProps.SlideViewPr->CSldViewPr.GuideLst.push_back(PPTX::nsViewProps::Guide());
|
||||
m_oViewProps.SlideViewPr->CSldViewPr.GuideLst[1].pos = 2880;
|
||||
@ -1222,7 +1308,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
void CPPTXWriter::CreateDefaultTableStyles()
|
||||
{
|
||||
m_oTableStyles.def = _T("{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}");
|
||||
m_oTableStyles.def = L"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}";
|
||||
}
|
||||
void CPPTXWriter::CreateDefaultPresProps()
|
||||
{
|
||||
@ -1230,38 +1316,65 @@ namespace NSBinPptxRW
|
||||
}
|
||||
void CPPTXWriter::CreateDefaultNotesMasters(int nIndexTheme)
|
||||
{
|
||||
std::wstring strThemeNotes = L"theme" + std::to_wstring( nIndexTheme ) + L".xml";
|
||||
std::wstring strThemeNotes = L"theme" + std::to_wstring(nIndexTheme) + L".xml";
|
||||
|
||||
OOX::CPath pathNotesTheme = m_oReader.m_strFolderThemes + FILE_SEPARATOR_STR + strThemeNotes;
|
||||
Writers::DefaultNotesThemeWriter notesTheme;
|
||||
notesTheme.Write(pathNotesTheme.GetPath());
|
||||
/////////////////////
|
||||
OOX::CPath pathNotesMasters = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("notesMasters");
|
||||
/////////////////////
|
||||
OOX::CPath pathNotesMasters = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"notesMasters";
|
||||
NSDirectory::CreateDirectory(pathNotesMasters.GetPath());
|
||||
|
||||
OOX::CPath pathNotesMaster1 = pathNotesMasters / _T("notesMaster1.xml");
|
||||
OOX::CPath pathNotesMaster1 = pathNotesMasters / L"notesMaster1.xml";
|
||||
Writers::DefaultNotesMasterWriter notesMaster;
|
||||
notesMaster.Write(pathNotesMaster1.GetPath());
|
||||
|
||||
OOX::CPath pathNotesMasterRels = pathNotesMasters / _T("_rels");
|
||||
OOX::CPath pathNotesMasterRels = pathNotesMasters / L"_rels";
|
||||
NSDirectory::CreateDirectory(pathNotesMasterRels.GetPath());
|
||||
|
||||
std::wstring strThemeNotesNum = std::to_wstring(nIndexTheme);
|
||||
|
||||
std::wstring strVal = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
std::wstring strVal = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\
|
||||
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme") + strThemeNotesNum + _T(".xml\"/></Relationships>");
|
||||
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme" + strThemeNotesNum + L".xml\"/></Relationships>";
|
||||
NSFile::CFileBinary oFileRels;
|
||||
oFileRels.CreateFile(pathNotesMasterRels.GetPath() + FILE_SEPARATOR_STR + _T("notesMaster1.xml.rels"));
|
||||
oFileRels.CreateFile(pathNotesMasterRels.GetPath() + FILE_SEPARATOR_STR + L"notesMaster1.xml.rels");
|
||||
oFileRels.WriteStringUTF8(strVal);
|
||||
oFileRels.CloseFile();
|
||||
|
||||
}
|
||||
void CPPTXWriter::CreateDefaultHandoutMasters(int nIndexTheme)
|
||||
{
|
||||
std::wstring strThemeNotes = L"theme" + std::to_wstring(nIndexTheme) + L".xml";
|
||||
|
||||
OOX::CPath pathNotesTheme = m_oReader.m_strFolderThemes + FILE_SEPARATOR_STR + strThemeNotes;
|
||||
Writers::DefaultNotesThemeWriter notesTheme;
|
||||
notesTheme.Write(pathNotesTheme.GetPath());
|
||||
/////////////////////
|
||||
OOX::CPath pathHandoutMasters = m_strDstFolder + FILE_SEPARATOR_STR + L"ppt" + FILE_SEPARATOR_STR + L"handoutMasters";
|
||||
NSDirectory::CreateDirectory(pathHandoutMasters.GetPath());
|
||||
|
||||
OOX::CPath pathNotesMaster1 = pathHandoutMasters / L"handoutMaster1.xml";
|
||||
Writers::DefaultHandoutMasterWriter handoutMaster;
|
||||
handoutMaster.Write(pathHandoutMasters.GetPath());
|
||||
|
||||
OOX::CPath pathHandoutMasterRels = pathHandoutMasters / L"_rels";
|
||||
NSDirectory::CreateDirectory(pathHandoutMasterRels.GetPath());
|
||||
|
||||
std::wstring strThemeHandoutNum = std::to_wstring(nIndexTheme);
|
||||
|
||||
std::wstring strVal = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\
|
||||
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme" + strThemeHandoutNum + L".xml\"/></Relationships>";
|
||||
NSFile::CFileBinary oFileRels;
|
||||
oFileRels.CreateFile(pathHandoutMasterRels.GetPath() + FILE_SEPARATOR_STR + L"handoutMaster1.xml.rels");
|
||||
oFileRels.WriteStringUTF8(strVal);
|
||||
oFileRels.CloseFile();
|
||||
}
|
||||
void CPPTXWriter::CreateDefaultNote()
|
||||
{
|
||||
PPTX::Logic::NvGrpSpPr& nvGrpSpPr = m_oDefaultNote.cSld.spTree.nvGrpSpPr;
|
||||
nvGrpSpPr.cNvPr.id = 1;
|
||||
nvGrpSpPr.cNvPr.name = _T("");
|
||||
nvGrpSpPr.cNvPr.name = L"";
|
||||
|
||||
PPTX::Logic::Xfrm* xfrm = new PPTX::Logic::Xfrm();
|
||||
xfrm->offX = 0;
|
||||
@ -1278,22 +1391,22 @@ namespace NSBinPptxRW
|
||||
// shape comment !!! (TODO:)
|
||||
PPTX::Logic::Shape* pShape = new PPTX::Logic::Shape();
|
||||
pShape->nvSpPr.cNvPr.id = 100000;
|
||||
pShape->nvSpPr.cNvPr.name = _T("");
|
||||
pShape->nvSpPr.cNvPr.name = L"";
|
||||
|
||||
pShape->nvSpPr.cNvSpPr.noGrp = true;
|
||||
pShape->nvSpPr.cNvSpPr.noChangeArrowheads = true;
|
||||
|
||||
pShape->nvSpPr.nvPr.ph = new PPTX::Logic::Ph();
|
||||
pShape->nvSpPr.nvPr.ph->type = _T("body");
|
||||
pShape->nvSpPr.nvPr.ph->idx = _T("1");
|
||||
pShape->nvSpPr.nvPr.ph->type = L"body";
|
||||
pShape->nvSpPr.nvPr.ph->idx = L"1";
|
||||
|
||||
PPTX::Logic::TxBody* pTxBody = new PPTX::Logic::TxBody();
|
||||
pTxBody->Paragrs.push_back(PPTX::Logic::Paragraph());
|
||||
|
||||
PPTX::Logic::Run* pTxRun = new PPTX::Logic::Run();
|
||||
PPTX::Logic::Run* pTxRun = new PPTX::Logic::Run();
|
||||
pTxRun->rPr = new PPTX::Logic::RunProperties();
|
||||
pTxRun->rPr->smtClean = false;
|
||||
pTxRun->SetText(_T("")); // enter simple comment here
|
||||
pTxRun->SetText(L""); // enter simple comment here
|
||||
|
||||
pShape->txBody = pTxBody;
|
||||
if (pShape->txBody.IsInit())
|
||||
|
||||
@ -39,6 +39,7 @@
|
||||
|
||||
#include "../../PPTXFormat/NotesSlide.h"
|
||||
#include "../../DocxFormat/VmlDrawing.h"
|
||||
#include "../../PPTXFormat/HandoutMaster.h"
|
||||
|
||||
namespace NSBinPptxRW
|
||||
{
|
||||
@ -68,6 +69,10 @@ namespace NSBinPptxRW
|
||||
std::vector<LONG> m_arNotesSlides_Master;
|
||||
std::vector<LONG> m_arNotesMasters_Theme;
|
||||
|
||||
std::vector<PPTX::HandoutMaster> m_arHandoutMasters;
|
||||
std::vector<LONG> m_arHandoutSlides_Master;
|
||||
std::vector<LONG> m_arHandoutMasters_Theme;
|
||||
|
||||
PPTX::Document m_oDocument;
|
||||
PPTX::Presentation m_oPresentation;
|
||||
PPTX::TableStyles m_oTableStyles;
|
||||
@ -100,6 +105,7 @@ namespace NSBinPptxRW
|
||||
void CreateDefaultTableStyles();
|
||||
void CreateDefaultPresProps();
|
||||
void CreateDefaultNotesMasters(int nIndexTheme);
|
||||
void CreateDefaultHandoutMasters(int nIndexTheme);
|
||||
void CreateDefaultNote();
|
||||
};
|
||||
}
|
||||
|
||||
@ -264,11 +264,12 @@ namespace SimpleTypes
|
||||
return true;
|
||||
}
|
||||
|
||||
std::wstring CGuid::ToString () const
|
||||
std::wstring CGuid::ToString (bool braces) const
|
||||
{
|
||||
std::wstringstream sstream;
|
||||
sstream << boost::wformat( L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}" ) % m_oGUID.a % m_oGUID.b % m_oGUID.c % m_oGUID.d % m_oGUID.e % m_oGUID.f % m_oGUID.g % m_oGUID.h % m_oGUID.i % m_oGUID.j % m_oGUID.k;
|
||||
return sstream.str();
|
||||
sstream << boost::wformat( L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x" ) % m_oGUID.a % m_oGUID.b % m_oGUID.c % m_oGUID.d % m_oGUID.e % m_oGUID.f % m_oGUID.g % m_oGUID.h % m_oGUID.i % m_oGUID.j % m_oGUID.k;
|
||||
std::wstring res = (braces ? L"{" : L"") + sstream.str() + (braces ? L"}" : L"");
|
||||
return res;
|
||||
}
|
||||
|
||||
bool CGuid::IsZero()
|
||||
|
||||
@ -107,7 +107,7 @@ namespace SimpleTypes
|
||||
CGuid();
|
||||
|
||||
bool FromString(const std::wstring &sValue);
|
||||
std::wstring ToString () const;
|
||||
std::wstring ToString (bool braces = true) const;
|
||||
|
||||
SimpleTypes_DefaultString(CGuid)
|
||||
|
||||
|
||||
@ -191,12 +191,15 @@ namespace OOX
|
||||
}
|
||||
std::wstring CCustomXMLProps::toXML() const
|
||||
{
|
||||
std::wstring guid = m_oItemID.ToString();
|
||||
std::wstring sXml = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><ds:datastoreItem ds:itemID=\"";
|
||||
sXml += m_oItemID.ToString();
|
||||
sXml += m_oItemID.ToString(false);
|
||||
sXml += L"\" xmlns:ds=\"http://schemas.openxmlformats.org/officeDocument/2006/customXml\">";
|
||||
|
||||
if (m_oShemaRefs.IsInit())
|
||||
sXml += m_oShemaRefs->toXML();
|
||||
else
|
||||
sXml += L"<ds:schemaRefs/>";
|
||||
|
||||
sXml += L"</ds:datastoreItem>";
|
||||
|
||||
|
||||
@ -1527,6 +1527,7 @@ namespace OOX
|
||||
|
||||
WritingElement_WriteNode_2(m_oRPr);
|
||||
WritingElement_WriteNode_1(L"<w:alias ", m_oAlias);
|
||||
WritingElement_WriteNode_1(L"<w:tag ", m_oTag);
|
||||
WritingElement_WriteNode_1(L"<w15:appearance ", m_oAppearance);
|
||||
WritingElement_WriteNode_1(L"<w15:color ", m_oColor);
|
||||
WritingElement_WriteNode_1(L"<w:id ", m_oId);
|
||||
@ -1551,7 +1552,6 @@ namespace OOX
|
||||
else if (m_oRepeatingSectionItem.IsInit()) sResult += L"<w15:repeatingSectionItem/>";
|
||||
|
||||
WritingElement_WriteNode_1(L"<w:temporary ", m_oTemporary);
|
||||
WritingElement_WriteNode_1(L"<w:tag ", m_oTag);
|
||||
|
||||
switch (m_eType)
|
||||
{
|
||||
|
||||
@ -43,6 +43,7 @@
|
||||
#include "Slide.h"
|
||||
#include "NotesMaster.h"
|
||||
#include "NotesSlide.h"
|
||||
#include "HandoutMaster.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
@ -152,6 +153,18 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
|
||||
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair)
|
||||
{
|
||||
const OOX::FileType& curType = pPair->second->type();
|
||||
|
||||
if (OOX::Presentation::FileTypes::HandoutMaster == curType)
|
||||
{
|
||||
smart_ptr<PPTX::HandoutMaster> pointer = pPair->second.smart_dynamic_cast<PPTX::HandoutMaster>();
|
||||
if (pointer.is_init())
|
||||
pointer->ApplyRels();
|
||||
}
|
||||
}
|
||||
|
||||
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair)
|
||||
{
|
||||
const OOX::FileType& curType = pPair->second->type();
|
||||
|
||||
@ -51,17 +51,90 @@ namespace PPTX
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNode.FromXmlFile(filename.m_strFilename);
|
||||
|
||||
cSld = oNode.ReadNode(_T("p:cSld"));
|
||||
cSld = oNode.ReadNode(L"p:cSld");
|
||||
cSld.SetParentFilePointer(this);
|
||||
|
||||
clrMap = oNode.ReadNode(_T("p:clrMap"));
|
||||
clrMap = oNode.ReadNode(L"p:clrMap");
|
||||
clrMap.SetParentFilePointer(this);
|
||||
|
||||
hf = oNode.ReadNode(_T("p:hf"));
|
||||
hf = oNode.ReadNode(L"p:hf");
|
||||
|
||||
if (hf.is_init())
|
||||
hf->SetParentFilePointer(this);
|
||||
}
|
||||
void HandoutMaster::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(NSBinPptxRW::NSMainTables::HandoutMasters);
|
||||
|
||||
pWriter->WriteRecord1(0, cSld);
|
||||
pWriter->WriteRecord1(1, clrMap);
|
||||
pWriter->WriteRecord2(2, hf);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
void HandoutMaster::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(L"p:handoutMaster");
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(L"xmlns:a", PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(L"xmlns:r", PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(L"xmlns:p", PPTX::g_Namespaces.p.m_strLink);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
cSld.toXmlWriter(pWriter);
|
||||
|
||||
clrMap.toXmlWriter(pWriter);
|
||||
pWriter->Write(hf);
|
||||
|
||||
pWriter->EndNode(L"p:handoutMaster");
|
||||
}
|
||||
void HandoutMaster::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
pReader->Skip(1); // type
|
||||
LONG end = pReader->GetPos() + pReader->GetRecordSize() + 4;
|
||||
|
||||
while (pReader->GetPos() < end)
|
||||
{
|
||||
BYTE _rec = pReader->GetUChar();
|
||||
|
||||
switch (_rec)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
cSld.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
clrMap.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
hf = new Logic::HF();
|
||||
hf->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
pReader->SkipRecord();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(end);
|
||||
}
|
||||
void HandoutMaster::ApplyRels()
|
||||
{
|
||||
theme_ = (FileContainer::Get(OOX::FileTypes::Theme)).smart_dynamic_cast<PPTX::Theme>();
|
||||
|
||||
if (theme_.IsInit())
|
||||
{
|
||||
theme_->SetColorMap(clrMap);
|
||||
}
|
||||
}
|
||||
void HandoutMaster::write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const
|
||||
{
|
||||
WrapperFile::write(filename, directory, content);
|
||||
|
||||
@ -52,19 +52,24 @@ namespace PPTX
|
||||
HandoutMaster(OOX::Document* pMain, const OOX::CPath& filename, FileMap& map);
|
||||
virtual ~HandoutMaster();
|
||||
|
||||
public:
|
||||
virtual void read(const OOX::CPath& filename, FileMap& map);
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content) const;
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const;
|
||||
|
||||
virtual const OOX::CPath DefaultDirectory() const;
|
||||
virtual const OOX::CPath DefaultFileName() const;
|
||||
|
||||
public:
|
||||
Logic::CSld cSld;
|
||||
Logic::ClrMap clrMap;
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
|
||||
void ApplyRels();
|
||||
|
||||
Logic::CSld cSld;
|
||||
Logic::ClrMap clrMap;
|
||||
nullable<Logic::HF> hf;
|
||||
|
||||
smart_ptr<Theme> theme_;
|
||||
};
|
||||
} // namespace PPTX
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
@ -32,6 +32,8 @@
|
||||
|
||||
#include "Ln.h"
|
||||
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/LineFormat.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
@ -316,6 +318,49 @@ namespace PPTX
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
XLS::BaseObjectPtr Ln::toXLS()
|
||||
{
|
||||
auto ptr = new XLS::LineFormat;
|
||||
if(w.IsInit())
|
||||
{
|
||||
switch(w.get())
|
||||
{
|
||||
case 3175: ptr->we = 0xFFFF; break; //Hairline
|
||||
case 12700: ptr->we = 0; break; //single
|
||||
case 25400: ptr->we = 1; break; //double
|
||||
case 38100: ptr->we = 2; break; //triple
|
||||
}
|
||||
}
|
||||
if(Fill.is_init())
|
||||
{
|
||||
if(Fill.m_type == UniFill::Type::noFill)
|
||||
ptr->lns = 5;
|
||||
else if(prstDash.IsInit() && prstDash->val.IsInit())
|
||||
{
|
||||
if(Fill.m_type == UniFill::Type::solidFill)
|
||||
{
|
||||
auto solid = dynamic_cast<PPTX::Logic::SolidFill*>(Fill.Fill.GetPointer());
|
||||
auto rgba = solid->Color.Color->GetRGBA(0);
|
||||
ptr->rgb.red = GETBITS(rgba, 0, 1);
|
||||
ptr->rgb.green = GETBITS(rgba, 2, 3);
|
||||
ptr->rgb.blue = GETBITS(rgba, 4, 5);
|
||||
}
|
||||
if(prstDash->val->get() == L"dash")
|
||||
ptr->lns = 1;
|
||||
else if(prstDash->val->get() == L"dot")
|
||||
ptr->lns = 2;
|
||||
else if(prstDash->val->get() == L"dashDot")
|
||||
ptr->lns = 3;
|
||||
else if(prstDash->val->get() == L"sysDashDotDot")
|
||||
ptr->lns = 4;
|
||||
else
|
||||
ptr->lns = 0;
|
||||
}
|
||||
else
|
||||
ptr->lns = 0;
|
||||
}
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
void Ln::Merge(nullable<Ln>& line)const
|
||||
{
|
||||
if(!line.IsInit())
|
||||
|
||||
@ -63,7 +63,7 @@ namespace PPTX
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
|
||||
XLS::BaseObjectPtr toXLS();
|
||||
virtual void Merge(nullable<Ln>& line) const;
|
||||
virtual void Merge(Ln& line) const;
|
||||
|
||||
|
||||
@ -35,6 +35,9 @@
|
||||
#include "PrstGeom.h"
|
||||
#include "CustGeom.h"
|
||||
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/FRAME.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Frame.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
@ -276,6 +279,15 @@ namespace PPTX
|
||||
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
XLS::BaseObjectPtr SpPr::toXLSFrame()const
|
||||
{
|
||||
auto Frame = new XLS::FRAME;
|
||||
if(ln.IsInit())
|
||||
Frame->m_LineFormat = ln->toXLS();
|
||||
if(Fill.is_init())
|
||||
Frame->m_AreaFormat = Fill.toXLS();
|
||||
return XLS::BaseObjectPtr(Frame);
|
||||
}
|
||||
OOX::EElementType SpPr::getType () const
|
||||
{
|
||||
return OOX::et_a_spPr;
|
||||
|
||||
@ -72,6 +72,7 @@ namespace PPTX
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
XLS::BaseObjectPtr toXLSFrame() const;
|
||||
|
||||
void Merge(SpPr& spPr)const;
|
||||
|
||||
|
||||
@ -34,6 +34,8 @@
|
||||
#include "../../../DesktopEditor/common/File.h"
|
||||
#include "../../../DesktopEditor/raster/ImageFileFormatChecker.h"
|
||||
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/AreaFormat.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
@ -280,6 +282,74 @@ namespace PPTX
|
||||
Fill->toXmlWriter(pWriter);
|
||||
}
|
||||
}
|
||||
XLS::BaseObjectPtr UniFill::toXLS() const
|
||||
{
|
||||
auto ptr = new XLS::AreaFormat;
|
||||
if (Fill.is_init())
|
||||
{
|
||||
if(m_type == UniFill::Type::noFill)
|
||||
ptr->fls = 0;
|
||||
else
|
||||
{
|
||||
if(m_type == UniFill::Type::solidFill)
|
||||
{
|
||||
ptr->fls = 1;
|
||||
auto solid = dynamic_cast<PPTX::Logic::SolidFill*>(Fill.GetPointer());
|
||||
auto rgba = solid->Color.Color->GetRGBA(0);
|
||||
ptr->rgbFore.red = GETBITS(rgba, 0, 1);
|
||||
ptr->rgbFore.green = GETBITS(rgba, 2, 3);
|
||||
ptr->rgbFore.blue = GETBITS(rgba, 4, 5);
|
||||
}
|
||||
else if(m_type == UniFill::Type::pattFill)
|
||||
{
|
||||
auto patt = dynamic_cast<PPTX::Logic::PattFill*>(Fill.GetPointer());
|
||||
|
||||
auto rgba = patt->fgClr.Color->GetRGBA(0);
|
||||
ptr->rgbFore.red = GETBITS(rgba, 0, 1);
|
||||
ptr->rgbFore.green = GETBITS(rgba, 2, 3);
|
||||
ptr->rgbFore.blue = GETBITS(rgba, 4, 5);
|
||||
|
||||
rgba = patt->bgClr.Color->GetRGBA(0);
|
||||
ptr->rgbBack.red = GETBITS(rgba, 0, 1);
|
||||
ptr->rgbBack.green = GETBITS(rgba, 2, 3);
|
||||
ptr->rgbBack.blue = GETBITS(rgba, 4, 5);
|
||||
if(patt->prst->get() == L"pct50")
|
||||
ptr->fls = 2;
|
||||
else if(patt->prst->get() == L"pct25")
|
||||
ptr->fls = 4;
|
||||
else if(patt->prst->get() == L"dkHorz")
|
||||
ptr->fls = 5;
|
||||
else if(patt->prst->get() == L"dkVert")
|
||||
ptr->fls = 6;
|
||||
else if(patt->prst->get() == L"dnDiag")
|
||||
ptr->fls = 7;
|
||||
else if(patt->prst->get() == L"upDiag")
|
||||
ptr->fls = 8;
|
||||
else if(patt->prst->get() == L"smGrid")
|
||||
ptr->fls = 9;
|
||||
else if(patt->prst->get() == L"trellis")
|
||||
ptr->fls = 0xA;
|
||||
else if(patt->prst->get() == L"narHorz")
|
||||
ptr->fls = 0xB;
|
||||
else if(patt->prst->get() == L"ltVert")
|
||||
ptr->fls = 0xC;
|
||||
else if(patt->prst->get() == L"dashDnDiag")
|
||||
ptr->fls = 0xD;
|
||||
else if(patt->prst->get() == L"dashUpDiag")
|
||||
ptr->fls = 0xE;
|
||||
else if(patt->prst->get() == L"horzBrick")
|
||||
ptr->fls = 0xF;
|
||||
else if(patt->prst->get() == L"pct30")
|
||||
ptr->fls = 0x10;
|
||||
else if(patt->prst->get() == L"dotDmnd")
|
||||
ptr->fls = 0x11;
|
||||
else if(patt->prst->get() == L"pct5")
|
||||
ptr->fls = 0x12;
|
||||
}
|
||||
}
|
||||
}
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
bool UniFill::is_init() const
|
||||
{
|
||||
return (Fill.IsInit());
|
||||
|
||||
@ -58,6 +58,7 @@ namespace PPTX
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
XLS::BaseObjectPtr toXLS() const;
|
||||
|
||||
virtual bool is_init() const;
|
||||
|
||||
|
||||
@ -56,17 +56,17 @@ namespace PPTX
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNode.FromXmlFile(filename.m_strFilename);
|
||||
|
||||
cSld = oNode.ReadNode(_T("p:cSld"));
|
||||
cSld = oNode.ReadNode(L"p:cSld");
|
||||
cSld.SetParentFilePointer(this);
|
||||
|
||||
clrMap = oNode.ReadNode(_T("p:clrMap"));
|
||||
clrMap = oNode.ReadNode(L"p:clrMap");
|
||||
clrMap.SetParentFilePointer(this);
|
||||
|
||||
hf = oNode.ReadNode(_T("p:hf"));
|
||||
hf = oNode.ReadNode(L"p:hf");
|
||||
if (hf.IsInit())
|
||||
hf->SetParentFilePointer(this);
|
||||
|
||||
notesStyle = oNode.ReadNode(_T("p:notesStyle"));
|
||||
notesStyle = oNode.ReadNode(L"p:notesStyle");
|
||||
if (notesStyle.is_init())
|
||||
notesStyle->SetParentFilePointer(this);
|
||||
}
|
||||
@ -111,12 +111,12 @@ namespace PPTX
|
||||
}
|
||||
void NotesMaster::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("p:notesMaster"));
|
||||
pWriter->StartNode(L"p:notesMaster");
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(L"xmlns:a", PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(L"xmlns:r", PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(L"xmlns:p", PPTX::g_Namespaces.p.m_strLink);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
cSld.toXmlWriter(pWriter);
|
||||
@ -125,7 +125,7 @@ namespace PPTX
|
||||
pWriter->Write(hf);
|
||||
pWriter->Write(notesStyle);
|
||||
|
||||
pWriter->EndNode(_T("p:notesMaster"));
|
||||
pWriter->EndNode(L"p:notesMaster");
|
||||
}
|
||||
void NotesMaster::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
@ -198,8 +198,8 @@ namespace PPTX
|
||||
{
|
||||
if (pMasterShape->nvSpPr.nvPr.ph.is_init())
|
||||
{
|
||||
std::wstring lIdx = pMasterShape->nvSpPr.nvPr.ph->idx.get_value_or(_T(""));
|
||||
std::wstring lType = pMasterShape->nvSpPr.nvPr.ph->type.get_value_or(_T("body"));
|
||||
std::wstring lIdx = pMasterShape->nvSpPr.nvPr.ph->idx.get_value_or(L"");
|
||||
std::wstring lType = pMasterShape->nvSpPr.nvPr.ph->type.get_value_or(L"body");
|
||||
|
||||
if (lType == L"ctrTitle") lType = L"title";
|
||||
|
||||
|
||||
@ -30,8 +30,6 @@
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef PPTX_SLIDES_NOTESSLIDE_INCLUDE_H_
|
||||
#define PPTX_SLIDES_NOTESSLIDE_INCLUDE_H_
|
||||
|
||||
#include "WrapperFile.h"
|
||||
#include "FileContainer.h"
|
||||
@ -79,5 +77,3 @@ namespace PPTX
|
||||
smart_ptr<Theme> theme_;
|
||||
};
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // PPTX_SLIDES_NOTESSLIDE_INCLUDE_H_
|
||||
|
||||
@ -34,6 +34,33 @@
|
||||
#include "ChartSerialize.h"
|
||||
#include "../../../DesktopEditor/common/StringExt.h"
|
||||
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SERIESFORMAT.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SS.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/IVAXIS.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/DVAXIS.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CRT.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CHARTFOMATS.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/LD.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Series.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/DataFormat.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/BRAI.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/SerToCrt.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Axis.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/CatSerRange.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/ValueRange.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/AxcExt.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/ChartFormat.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Bar.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Pie.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Line.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Area.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Surf.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Scatter.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Radar.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/RadarArea.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Chart3d.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Legend.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
@ -1787,6 +1814,16 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_Legend::toXLS()
|
||||
{
|
||||
auto ptr = new XLS::LD;
|
||||
auto legendPtr = new XLS::Legend;
|
||||
legendPtr->fAutoPosition = true;
|
||||
legendPtr->fAutoPosX = true;
|
||||
legendPtr->fAutoPosY = true;
|
||||
ptr->m_Legend = XLS::BaseObjectPtr(legendPtr);
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_Legend::getType() { return et_ct_Legend; }
|
||||
CT_Layout::CT_Layout()
|
||||
{
|
||||
@ -2920,6 +2957,32 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_CatAx::toXLS()
|
||||
{
|
||||
auto ivAxis = new XLS::IVAXIS;
|
||||
auto axis = new XLS::Axis;
|
||||
axis->wType = 0;
|
||||
ivAxis->m_Axis = XLS::BaseObjectPtr(axis);
|
||||
auto catSerRange = new XLS::CatSerRange;
|
||||
catSerRange->catCross = 1;
|
||||
catSerRange->catLabel = 1;
|
||||
catSerRange->catMark = 1;
|
||||
catSerRange->fBetween = true;
|
||||
ivAxis->m_CatSerRange = XLS::BaseObjectPtr(catSerRange);
|
||||
|
||||
auto axcExt = new XLS::AxcExt;
|
||||
axcExt->fAutoBase = true;
|
||||
axcExt->fAutoCross = true;
|
||||
axcExt->fAutoDate = true;
|
||||
axcExt->fAutoMajor = true;
|
||||
axcExt->fAutoMax = true;
|
||||
axcExt->fAutoMin = true;
|
||||
axcExt->fAutoMinor = true;
|
||||
axcExt->fDateAxis = true;
|
||||
ivAxis->m_AxcExt = XLS::BaseObjectPtr(axcExt);
|
||||
|
||||
return XLS::BaseObjectPtr(ivAxis);
|
||||
}
|
||||
EElementType CT_CatAx::getType() { return et_ct_catax; }
|
||||
CT_DispUnitsLbl::CT_DispUnitsLbl()
|
||||
{
|
||||
@ -3141,6 +3204,21 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_ValAx::toXLS()
|
||||
{
|
||||
auto dvAxis = new XLS::DVAXIS;
|
||||
auto axis = new XLS::Axis;
|
||||
axis->wType = 1;
|
||||
dvAxis->m_Axis = XLS::BaseObjectPtr(axis);
|
||||
auto valSerRange = new XLS::ValueRange;
|
||||
valSerRange->fAutoMin = true;
|
||||
valSerRange->fAutoMax = true;
|
||||
valSerRange->fAutoMajor = true;
|
||||
valSerRange->fAutoMinor = true;
|
||||
valSerRange->fAutoCross = true;
|
||||
dvAxis->m_ValueRange = XLS::BaseObjectPtr(valSerRange);
|
||||
return XLS::BaseObjectPtr(dvAxis);
|
||||
}
|
||||
EElementType CT_ValAx::getType() { return et_ct_valax; }
|
||||
|
||||
CBaseSer::CBaseSer()
|
||||
@ -5788,6 +5866,64 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_SurfaceSer::GetXLSFormat(const _UINT32 chartIndex)const
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_val != nullptr && m_val->m_numRef != nullptr)
|
||||
{
|
||||
if(m_val->m_numRef->m_numCache != nullptr)
|
||||
{
|
||||
series->cValx = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
series->cValy = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
}
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_val->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_val->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(m_idx.IsInit())
|
||||
dataFormat->yi = m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = m_spPr->ln->toXLS();
|
||||
if(m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = m_spPr->Fill.toXLS();
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_SurfaceSer::getType() { return et_ct_surfaceser; }
|
||||
|
||||
CT_BandFmt::CT_BandFmt()
|
||||
@ -5911,6 +6047,24 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_SurfaceChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Surf;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_SurfaceChart::getType() { return et_ct_surfacechart; }
|
||||
|
||||
ST_SplitType CSplitType::FromString(const std::wstring &sValue)
|
||||
@ -6210,6 +6364,64 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_PieSer::GetXLSFormat(unsigned int chartIndex)
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_val != nullptr && m_val->m_numRef != nullptr)
|
||||
{
|
||||
if(m_val->m_numRef->m_numCache != nullptr)
|
||||
{
|
||||
series->cValx = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
series->cValy = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
}
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_val->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_val->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(m_idx.IsInit())
|
||||
dataFormat->yi = m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = m_spPr->ln->toXLS();
|
||||
if(m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = m_spPr->Fill.toXLS();
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_PieSer::getType() { return et_ct_pieser; }
|
||||
|
||||
CT_Bar3DChart::CT_Bar3DChart()
|
||||
@ -6318,6 +6530,48 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_Bar3DChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Bar;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
if(m_barDir.IsInit() && m_barDir->m_eValue == 0)
|
||||
chartType->fTranspose = true;
|
||||
|
||||
if(m_gapWidth.IsInit())
|
||||
{
|
||||
_INT16 gapVal = 0;
|
||||
try
|
||||
{
|
||||
gapVal = stoi(m_gapWidth.get());
|
||||
}
|
||||
catch (std::exception)
|
||||
{}
|
||||
chartType->pcGap = gapVal;
|
||||
}
|
||||
auto chart3Dpart = new XLS::Chart3d;
|
||||
chart3Dpart->anRot = 20;
|
||||
chart3Dpart->anElev = 15;
|
||||
chart3Dpart->pcDist = 30;
|
||||
chart3Dpart->pcHeight3D = 63;
|
||||
chart3Dpart->pcDepth = 100;
|
||||
chart3Dpart->pcGap = 150;
|
||||
chart3Dpart->fNotPieChart = true;
|
||||
chart3Dpart->fCluster = true;
|
||||
ptr->m_Chart3d = XLS::BaseObjectPtr(chart3Dpart);
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_Bar3DChart::getType() { return et_ct_bar3dchart; }
|
||||
|
||||
ST_BarDir CBarDir::FromString(const std::wstring &sValue)
|
||||
@ -6493,6 +6747,64 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_BarSer::GetXLSFormat(const _UINT32 chartIndex) const
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_val != nullptr && m_val->m_numRef != nullptr)
|
||||
{
|
||||
if(m_val->m_numRef->m_numCache != nullptr)
|
||||
{
|
||||
series->cValx = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
series->cValy = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
}
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_val->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_val->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(m_idx.IsInit())
|
||||
dataFormat->yi = m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = m_spPr->ln->toXLS();
|
||||
if(m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = m_spPr->Fill.toXLS();
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_BarSer::getType() { return et_ct_barser; }
|
||||
|
||||
ST_Shape CShapeType::FromString(const std::wstring &sValue)
|
||||
@ -6627,6 +6939,49 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_BarChart::toXLS(unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Bar;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
if(m_overlap.IsInit())
|
||||
{
|
||||
_INT16 overlapVal = 0;
|
||||
try
|
||||
{
|
||||
overlapVal = stoi(m_overlap.get());
|
||||
}
|
||||
catch (std::exception)
|
||||
{}
|
||||
chartType->pcOverlap -= overlapVal;
|
||||
}
|
||||
if(m_barDir.IsInit() && m_barDir->m_eValue == 0)
|
||||
chartType->fTranspose = true;
|
||||
|
||||
if(m_gapWidth.IsInit())
|
||||
{
|
||||
_INT16 gapVal = 0;
|
||||
try
|
||||
{
|
||||
gapVal = stoi(m_gapWidth.get());
|
||||
}
|
||||
catch (std::exception)
|
||||
{}
|
||||
chartType->pcGap = gapVal;
|
||||
}
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_BarChart::getType() { return et_ct_barchart; }
|
||||
|
||||
CT_DoughnutChart::CT_DoughnutChart()
|
||||
@ -6783,6 +7138,33 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_Pie3DChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Pie;
|
||||
auto chart3Dpart = new XLS::Chart3d;
|
||||
chart3Dpart->anElev = 30;
|
||||
chart3Dpart->pcDist = 30;
|
||||
chart3Dpart->pcHeightPie = 100;
|
||||
chart3Dpart->pcDepth = 100;
|
||||
chart3Dpart->pcGap = 150;
|
||||
ptr->m_Chart3d = XLS::BaseObjectPtr(chart3Dpart);
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
|
||||
EElementType CT_Pie3DChart::getType() { return et_ct_pie3dchart; }
|
||||
|
||||
CT_PieChart::CT_PieChart()
|
||||
@ -6862,6 +7244,27 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_PieChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Pie;
|
||||
if(m_firstSliceAng.IsInit())
|
||||
chartType->anStart = m_firstSliceAng.get();
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_PieChart::getType() { return et_ct_piechart; }
|
||||
|
||||
CT_ScatterSer::CT_ScatterSer()
|
||||
@ -7020,6 +7423,63 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_ScatterSer::GetXLSFormat(const _UINT32 chartIndex)const
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_xVal != nullptr && m_xVal->m_numRef != nullptr)
|
||||
{
|
||||
if(m_xVal->m_numRef->m_numCache != nullptr)
|
||||
series->cValx = m_xVal->m_numRef->m_numCache->m_pt.size();
|
||||
if(m_yVal->m_numRef->m_numCache != nullptr)
|
||||
series->cValy = m_yVal->m_numRef->m_numCache->m_pt.size();
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_xVal->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_xVal->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(m_idx.IsInit())
|
||||
dataFormat->yi = m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = m_spPr->ln->toXLS();
|
||||
if(m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = m_spPr->Fill.toXLS();
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_ScatterSer::getType() { return et_ct_scatterser; }
|
||||
|
||||
ST_ScatterStyle CScatterStyle::FromString(const std::wstring &sValue)
|
||||
@ -7118,6 +7578,25 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_ScatterChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Scatter;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_ScatterChart::getType() { return et_ct_scatterchart; }
|
||||
CT_RadarSer::CT_RadarSer()
|
||||
{
|
||||
@ -7232,6 +7711,64 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_RadarSer::GetXLSFormat(const _UINT32 chartIndex)const
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_val != nullptr && m_val->m_numRef != nullptr)
|
||||
{
|
||||
if(m_val->m_numRef->m_numCache != nullptr)
|
||||
{
|
||||
series->cValx = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
series->cValy = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
}
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_val->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_val->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(m_idx.IsInit())
|
||||
dataFormat->yi = m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = m_spPr->ln->toXLS();
|
||||
if(m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = m_spPr->Fill.toXLS();
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_RadarSer::getType() { return et_ct_radarser; }
|
||||
|
||||
ST_RadarStyle CRadarStyle::FromString(const std::wstring &sValue)
|
||||
@ -7331,6 +7868,29 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_RadarChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
XLS::BaseObjectPtr chartType;
|
||||
if(m_radarStyle.IsInit() && m_radarStyle->m_eValue == 2)
|
||||
chartType = XLS::BaseObjectPtr(new XLS::RadarArea);
|
||||
else
|
||||
chartType = XLS::BaseObjectPtr(new XLS::Radar);
|
||||
ptr->m_ChartType = chartType;
|
||||
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_RadarChart::getType() { return et_ct_radarchart; }
|
||||
CT_StockChart::CT_StockChart()
|
||||
{
|
||||
@ -7600,6 +8160,67 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_LineSer::GetXLSFormat(unsigned int chartIndex)
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_val != nullptr && m_val->m_numRef != nullptr)
|
||||
{
|
||||
if(m_val->m_numRef->m_numCache != nullptr)
|
||||
{
|
||||
series->cValx = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
series->cValy = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
}
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_val->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_val->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
for(auto i : m_dPt)
|
||||
{
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(i->m_idx.IsInit())
|
||||
dataFormat->yi = i->m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(i->m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = i->m_spPr->ln->toXLS();
|
||||
if(i->m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = i->m_spPr->Fill.toXLS();
|
||||
}
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_LineSer::getType() { return et_ct_lineser; }
|
||||
CT_UpDownBars::CT_UpDownBars()
|
||||
{
|
||||
@ -7810,6 +8431,35 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_Line3DChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Line;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
auto chart3Dpart = new XLS::Chart3d;
|
||||
chart3Dpart->anRot = 20;
|
||||
chart3Dpart->anElev = 15;
|
||||
chart3Dpart->pcDist = 30;
|
||||
chart3Dpart->pcHeight3D = 63;
|
||||
chart3Dpart->pcDepth = 100;
|
||||
chart3Dpart->pcGap = 150;
|
||||
chart3Dpart->fNotPieChart = true;
|
||||
chart3Dpart->fCluster = true;
|
||||
ptr->m_Chart3d = XLS::BaseObjectPtr(chart3Dpart);
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_Line3DChart::getType() { return et_ct_line3dchart; }
|
||||
|
||||
ST_Grouping CGrouping::FromString(const std::wstring &sValue)
|
||||
@ -7958,6 +8608,26 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_LineChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Line;
|
||||
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_LineChart::getType() { return et_ct_linechart; }
|
||||
|
||||
CT_Area3DChart::CT_Area3DChart()
|
||||
@ -8063,6 +8733,38 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_Area3DChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Area;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
if(m_grouping.IsInit() && m_grouping->GetValue() == st_groupingSTACKED)
|
||||
chartType->fStacked = true;
|
||||
|
||||
auto chart3Dpart = new XLS::Chart3d;
|
||||
chart3Dpart->anRot = 20;
|
||||
chart3Dpart->anElev = 15;
|
||||
chart3Dpart->pcDist = 30;
|
||||
chart3Dpart->pcHeight3D = 63;
|
||||
chart3Dpart->pcDepth = 100;
|
||||
chart3Dpart->pcGap = 150;
|
||||
chart3Dpart->fNotPieChart = true;
|
||||
chart3Dpart->fCluster = true;
|
||||
ptr->m_Chart3d = XLS::BaseObjectPtr(chart3Dpart);
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_Area3DChart::getType() { return et_ct_area3dchart; }
|
||||
CT_AreaSer::CT_AreaSer()
|
||||
{
|
||||
@ -8215,6 +8917,64 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_AreaSer::GetXLSFormat(const _UINT32 chartIndex)const
|
||||
{
|
||||
auto seriesFormat = new XLS::SERIESFORMAT;
|
||||
{
|
||||
auto ai1 = new XLS::BRAI;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai1));
|
||||
}
|
||||
auto series = new XLS::Series;
|
||||
series->sdtX = 1;
|
||||
if(m_val != nullptr && m_val->m_numRef != nullptr)
|
||||
{
|
||||
if(m_val->m_numRef->m_numCache != nullptr)
|
||||
{
|
||||
series->cValx = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
series->cValy = m_val->m_numRef->m_numCache->m_pt.size();
|
||||
}
|
||||
{
|
||||
auto ai2 = new XLS::BRAI;
|
||||
ai2->id = 1;
|
||||
if(m_val->m_numRef->m_f.IsInit())
|
||||
{
|
||||
ai2->rt = 2;
|
||||
ai2->formula.parseStringFormula(m_val->m_numRef->m_f.get(), L"");
|
||||
}
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai2));
|
||||
auto ai3 = new XLS::BRAI;
|
||||
ai3->id = 2;
|
||||
auto ai4 = new XLS::BRAI;
|
||||
ai4->id = 3;
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai3));
|
||||
seriesFormat->m_arAI.push_back(XLS::BaseObjectPtr(ai4));
|
||||
}
|
||||
}
|
||||
auto SeriesStyle = new XLS::SS;
|
||||
seriesFormat->m_arPtSS.push_back(XLS::BaseObjectPtr(SeriesStyle));
|
||||
{
|
||||
auto dataFormat = new XLS::DataFormat;
|
||||
SeriesStyle->m_DataFormat = XLS::BaseObjectPtr(dataFormat);
|
||||
if(m_order.IsInit())
|
||||
dataFormat->iss = m_order.get();
|
||||
if(m_idx.IsInit())
|
||||
dataFormat->yi = m_idx.get();
|
||||
|
||||
}
|
||||
if(m_spPr.IsInit())
|
||||
{
|
||||
if(m_spPr->ln.IsInit())
|
||||
SeriesStyle->m_LineFormat = m_spPr->ln->toXLS();
|
||||
if(m_spPr->Fill.is_init())
|
||||
SeriesStyle->m_AreaFormat = m_spPr->Fill.toXLS();
|
||||
}
|
||||
seriesFormat->m_Series = XLS::BaseObjectPtr(series);
|
||||
auto ser2Crt = new XLS::SerToCrt;
|
||||
ser2Crt->id = chartIndex;
|
||||
seriesFormat->m_SerToCrt = XLS::BaseObjectPtr(ser2Crt);
|
||||
|
||||
return XLS::BaseObjectPtr(seriesFormat);
|
||||
}
|
||||
EElementType CT_AreaSer::getType() { return et_ct_areaser; }
|
||||
|
||||
CT_AreaChart::CT_AreaChart()
|
||||
@ -8314,6 +9074,27 @@ xmlns:c16r2=\"http://schemas.microsoft.com/office/drawing/2015/06/chart\"");
|
||||
writer.WriteString(sNodeName);
|
||||
writer.WriteString(L">");
|
||||
}
|
||||
XLS::BaseObjectPtr CT_AreaChart::toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats)
|
||||
{
|
||||
auto ChartFormatsPtr = static_cast<XLS::CHARTFORMATS*>(ChartFormats.get());
|
||||
for(auto ser : m_ser)
|
||||
{
|
||||
if(ser != nullptr)
|
||||
{
|
||||
ChartFormatsPtr->m_arSERIESFORMAT.push_back(ser->GetXLSFormat(chartIndex));
|
||||
}
|
||||
}
|
||||
auto ptr = new XLS::CRT;
|
||||
auto chartFormat = new XLS::ChartFormat;
|
||||
chartFormat->icrt = chartIndex;
|
||||
ptr->m_ChartFormat = XLS::BaseObjectPtr(chartFormat);
|
||||
auto chartType = new XLS::Area;
|
||||
if(m_grouping.IsInit() && m_grouping->GetValue() == st_groupingSTACKED)
|
||||
chartType->fStacked = true;
|
||||
ptr->m_ChartType = XLS::BaseObjectPtr(chartType);
|
||||
|
||||
return XLS::BaseObjectPtr(ptr);
|
||||
}
|
||||
EElementType CT_AreaChart::getType() { return et_ct_areachart; }
|
||||
CT_PlotArea::CT_PlotArea()
|
||||
{
|
||||
|
||||
@ -789,6 +789,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS();
|
||||
EElementType getType();
|
||||
};
|
||||
|
||||
@ -1012,6 +1013,8 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS();
|
||||
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_DispUnitsLbl
|
||||
@ -1057,6 +1060,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS();
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_SerTx
|
||||
@ -1454,6 +1458,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(const _UINT32 chartIndex)const;
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_Surface3DChart
|
||||
@ -1486,6 +1491,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_custSplit
|
||||
@ -1518,6 +1524,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(unsigned int chartIndex);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_OfPieChart
|
||||
@ -1564,6 +1571,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(const _UINT32 chartIndex)const;
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_Bar3DChart
|
||||
@ -1586,6 +1594,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_BarChart
|
||||
@ -1608,6 +1617,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_DoughnutChart
|
||||
@ -1642,6 +1652,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_PieChart
|
||||
@ -1659,6 +1670,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_ScatterSer : public CBaseSer
|
||||
@ -1682,6 +1694,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(const _UINT32 chartIndex)const;
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_ScatterChart
|
||||
@ -1698,6 +1711,7 @@ namespace OOX
|
||||
~CT_ScatterChart();
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_RadarSer : public CBaseSer
|
||||
@ -1718,6 +1732,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(const _UINT32 chartIndex)const;
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_RadarChart
|
||||
@ -1735,6 +1750,7 @@ namespace OOX
|
||||
~CT_RadarChart();
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_UpDownBar
|
||||
@ -1783,6 +1799,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(unsigned int chartIndex);
|
||||
EElementType getType();
|
||||
};
|
||||
|
||||
@ -1822,6 +1839,7 @@ namespace OOX
|
||||
~CT_Line3DChart();
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormats);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_LineChart
|
||||
@ -1845,6 +1863,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_AreaSer : public CBaseSer
|
||||
@ -1867,6 +1886,7 @@ namespace OOX
|
||||
{}
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr GetXLSFormat(const _UINT32 chartIndex)const;
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_Area3DChart
|
||||
@ -1887,6 +1907,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_AreaChart
|
||||
@ -1906,6 +1927,7 @@ namespace OOX
|
||||
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_PlotArea
|
||||
@ -1964,6 +1986,7 @@ namespace OOX
|
||||
~CT_View3D();
|
||||
void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
|
||||
XLS::BaseObjectPtr toXLS(const unsigned short chartIndex, XLS::BaseObjectPtr ChartFormatsPtr);
|
||||
EElementType getType();
|
||||
};
|
||||
class CT_PivotFmt
|
||||
|
||||
@ -85,6 +85,8 @@ namespace OOX
|
||||
virtual void read(const CPath& oRootPath, const CPath& oPath);
|
||||
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const;
|
||||
|
||||
void toXLSChart(XLS::BaseObjectPtr chartStreamPtr);
|
||||
|
||||
virtual const OOX::FileType type() const;
|
||||
|
||||
virtual const CPath DefaultDirectory() const;
|
||||
|
||||
@ -31,8 +31,26 @@
|
||||
*/
|
||||
|
||||
#include "Drawing.h"
|
||||
#include "Pos.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Binary/CFStreamCacheWriter.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/ChartSheetSubstream.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/OBJECTS.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CHARTFOMATS.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AXISPARENT.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AXES.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/ATTACHEDLABEL.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/AI.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CRT.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/MsoDrawing.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Chart.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/AxisParent.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Pos.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/Text.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/ObjectLink.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/BRAI.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/SeriesText.h"
|
||||
#include "../../PPTXFormat/Logic/Shape.h"
|
||||
#include "../Chart/Chart.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
@ -250,6 +268,142 @@ namespace OOX
|
||||
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
|
||||
IFileContainer::Write(oPath, oDirectory, oContent);
|
||||
}
|
||||
void CDrawing::toXLSChart(XLS::BaseObjectPtr chartStreamPtr)
|
||||
{
|
||||
auto ptr = static_cast<XLS::ChartSheetSubstream*>(chartStreamPtr.get());
|
||||
|
||||
auto ChartFormatsPtr = new XLS::CHARTFORMATS;
|
||||
ptr->m_CHARTFORMATS = XLS::BaseObjectPtr(ChartFormatsPtr);
|
||||
|
||||
for(auto anchor : m_arrItems)
|
||||
{
|
||||
if(anchor->m_oElement.IsInit())
|
||||
{
|
||||
auto anchorElem = anchor->m_oElement->GetElem();
|
||||
auto graphicFrame = static_cast<PPTX::Logic::GraphicFrame*>(anchorElem.GetPointer());
|
||||
{
|
||||
|
||||
auto chartRect = new XLS::Chart;
|
||||
if(anchor->m_oPos.IsInit() && anchor->m_oPos->m_oX.IsInit())
|
||||
chartRect->x.dVal = anchor->m_oPos->m_oX->GetValue();
|
||||
if(anchor->m_oPos.IsInit() && anchor->m_oPos->m_oY.IsInit())
|
||||
chartRect->y.dVal = anchor->m_oPos->m_oY->GetValue();
|
||||
if(anchor->m_oExt.IsInit() && anchor->m_oExt->m_oCx.IsInit())
|
||||
chartRect->dx.dVal = anchor->m_oExt->m_oCx->GetValue();
|
||||
if(anchor->m_oExt.IsInit() && anchor->m_oExt->m_oCy->GetValue())
|
||||
chartRect->dy.dVal = anchor->m_oExt->m_oCy->GetValue();
|
||||
ChartFormatsPtr->m_ChartRect = XLS::BaseObjectPtr(chartRect);
|
||||
}
|
||||
if(graphicFrame->chartRec.IsInit() && graphicFrame->chartRec->id_data.IsInit())
|
||||
{
|
||||
auto chartRid = graphicFrame->chartRec->id_data.get();
|
||||
auto castedChart = Get<OOX::File>(chartRid);
|
||||
auto ChartFile = static_cast<OOX::Spreadsheet::CChartFile*>(castedChart.GetPointer());
|
||||
if(ChartFile->m_oChartSpace.m_spPr.IsInit())
|
||||
{
|
||||
ChartFormatsPtr->m_FRAME = ChartFile->m_oChartSpace.m_spPr->toXLSFrame();
|
||||
}
|
||||
if(ChartFile->m_oChartSpace.m_chart != nullptr && ChartFile->m_oChartSpace.m_chart->m_plotArea != nullptr)
|
||||
{
|
||||
auto AxisParentUnion = new XLS::AXISPARENT;
|
||||
ChartFormatsPtr->m_arAXISPARENT.push_back(XLS::BaseObjectPtr(AxisParentUnion));
|
||||
|
||||
for(auto chartIndex = 0; chartIndex < ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.size(); chartIndex ++)
|
||||
{
|
||||
if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5BARCHART)
|
||||
{
|
||||
auto barChart = static_cast<CT_BarChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(barChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5BAR3DCHART)
|
||||
{
|
||||
auto barChart = static_cast<CT_Bar3DChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(barChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5PIECHART)
|
||||
{
|
||||
auto PieChart = static_cast<CT_PieChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(PieChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5PIE3DCHART)
|
||||
{
|
||||
auto PieChart = static_cast<CT_Pie3DChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(PieChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5LINECHART)
|
||||
{
|
||||
auto LineChart = static_cast<CT_LineChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(LineChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5LINE3DCHART)
|
||||
{
|
||||
auto LineChart = static_cast<CT_Line3DChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(LineChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5AREACHART)
|
||||
{
|
||||
auto AreaChart = static_cast<CT_AreaChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(AreaChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5AREA3DCHART)
|
||||
{
|
||||
auto AreaChart = static_cast<CT_Area3DChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(AreaChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5SURFACECHART)
|
||||
{
|
||||
auto SurfaceChart = static_cast<CT_SurfaceChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(SurfaceChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5SCATTERCHART)
|
||||
{
|
||||
auto ScatterChart = static_cast<CT_ScatterChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(ScatterChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
else if(*ChartFile->m_oChartSpace.m_chart->m_plotArea->m_ItemsElementName0.at(chartIndex) == OOX::Spreadsheet::itemschoicetype5RADARCHART)
|
||||
{
|
||||
auto ScatterChart = static_cast<CT_RadarChart*>(ChartFile->m_oChartSpace.m_chart->m_plotArea->m_Items.at(chartIndex));
|
||||
AxisParentUnion->m_arCRT.push_back(ScatterChart->toXLS(chartIndex, ptr->m_CHARTFORMATS));
|
||||
}
|
||||
|
||||
if(ChartFile->m_oChartSpace.m_chart->m_legend != nullptr && !AxisParentUnion->m_arCRT.empty())
|
||||
{
|
||||
auto crtPtr = static_cast<XLS::CRT*>(AxisParentUnion->m_arCRT.back().get());
|
||||
crtPtr->m_LD = ChartFile->m_oChartSpace.m_chart->m_legend->toXLS();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if(ChartFile->m_oChartSpace.m_chart->m_title != nullptr && ChartFile->m_oChartSpace.m_chart->m_title->m_tx != nullptr)
|
||||
{
|
||||
auto labelUnion = new XLS::ATTACHEDLABEL;
|
||||
auto textRecord = new XLS::Text;
|
||||
textRecord->wBkgMode = 1;
|
||||
textRecord->at = 2;
|
||||
textRecord->vat = 1;
|
||||
auto textPos = new XLS::Pos;
|
||||
textPos->mdBotRt = 2;
|
||||
textPos->mdTopLt = 2;
|
||||
labelUnion->m_Pos = XLS::BaseObjectPtr(textPos);
|
||||
auto objLink = new XLS::ObjectLink;
|
||||
objLink->wLinkObj = 1;
|
||||
auto seriesText = new XLS::SeriesText;
|
||||
seriesText->stText = ChartFile->m_oChartSpace.m_chart->m_title->m_tx->m_oRich->GetText();
|
||||
auto aiUnion = new XLS::AI;
|
||||
auto brai = new XLS::BRAI;
|
||||
brai->rt = 1;
|
||||
aiUnion->m_BRAI = XLS::BaseObjectPtr(brai);
|
||||
aiUnion->m_SeriesText = XLS::BaseObjectPtr(seriesText);
|
||||
labelUnion->m_AI = XLS::BaseObjectPtr(aiUnion);
|
||||
labelUnion->m_ObjectLink = XLS::BaseObjectPtr(objLink);
|
||||
labelUnion->m_TextProperties = XLS::BaseObjectPtr(textRecord);
|
||||
ChartFormatsPtr->m_arATTACHEDLABEL.push_back(XLS::BaseObjectPtr(labelUnion));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const OOX::FileType CDrawing::type() const
|
||||
{
|
||||
return OOX::Spreadsheet::FileTypes::Drawings;
|
||||
|
||||
@ -218,7 +218,7 @@ namespace OOX
|
||||
objectVector.push_back(i->toBin());
|
||||
return objectVector;
|
||||
}
|
||||
void CSheets::toXLS(XLS::BaseObjectPtr stream)
|
||||
void CSheets::toXLS(XLS::BaseObjectPtr stream, const std::vector<_UINT16> &SheetTypes)
|
||||
{
|
||||
auto streamPtr = static_cast<XLS::GlobalsSubstream*>(stream.get());
|
||||
auto tabIdArray = new XLS::RRTabId;
|
||||
@ -242,6 +242,8 @@ namespace OOX
|
||||
else
|
||||
tempSheet->name_ = std::wstring(L"sheet" + std::to_wstring(SheetNum));
|
||||
streamPtr->m_arBUNDLESHEET.push_back(XLS::BaseObjectPtr(tempSheetUnion));
|
||||
if(SheetTypes.size() > SheetNum-1)
|
||||
tempSheet->dt = SheetTypes.at(SheetNum-1);
|
||||
SheetNum++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ namespace OOX
|
||||
|
||||
void fromBin(std::vector<XLS::BaseObjectPtr>& obj);
|
||||
std::vector<XLS::BaseObjectPtr> toBin();
|
||||
void toXLS(XLS::BaseObjectPtr stream);
|
||||
void toXLS(XLS::BaseObjectPtr stream, const std::vector<_UINT16> &SheetTypes);
|
||||
virtual EElementType getType () const;
|
||||
static void AddSheetRef(const std::wstring& link, const _INT32& sheetIndex);
|
||||
private:
|
||||
|
||||
@ -467,7 +467,22 @@ namespace OOX
|
||||
auto globalsSubstream = new XLS::GlobalsSubstream(XLS::WorkbookStreamObject::DefaultCodePage);
|
||||
auto objectPtr = XLS::BaseObjectPtr(globalsSubstream);
|
||||
if(m_oSheets.IsInit())
|
||||
m_oSheets->toXLS(objectPtr);
|
||||
{
|
||||
std::vector<_UINT16> SheetTypes;
|
||||
for(auto i: m_oSheets->m_arrItems)
|
||||
{
|
||||
_UINT16 type = 0;
|
||||
if(i->m_oRid.IsInit())
|
||||
{
|
||||
RId rid(i->m_oRid->GetValue());
|
||||
auto sheetFile = Get<OOX::File>(rid);
|
||||
if(sheetFile->type() == OOX::Spreadsheet::FileTypes::Chartsheets)
|
||||
type = 2;
|
||||
}
|
||||
SheetTypes.push_back(type);
|
||||
}
|
||||
m_oSheets->toXLS(objectPtr, SheetTypes);
|
||||
}
|
||||
if(m_oDefinedNames.IsInit())
|
||||
m_oDefinedNames->toXLS(objectPtr);
|
||||
if(m_oBookViews.IsInit())
|
||||
|
||||
@ -53,6 +53,7 @@
|
||||
#include "../../Binary/XlsbFormat/FileTypes_SpreadsheetBin.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Binary/CFStreamCacheWriter.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/WorksheetSubstream.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/ChartSheetSubstream.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/PAGESETUP.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/SORTANDFILTER.h"
|
||||
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_unions/CONDFMTS.h"
|
||||
@ -372,6 +373,27 @@ namespace OOX
|
||||
}
|
||||
XLS::BaseObjectPtr CWorksheet::toXLS()
|
||||
{
|
||||
if(m_bIsChartSheet)
|
||||
{
|
||||
auto chartSheetPtr = new XLS::ChartSheetSubstream(0);
|
||||
XLS::BaseObjectPtr objPtr(chartSheetPtr);
|
||||
if(m_oPageSetup.IsInit())
|
||||
chartSheetPtr->m_PAGESETUP = m_oPageSetup->toXLS();
|
||||
else
|
||||
{
|
||||
auto pageSetup = new XLS::PAGESETUP;
|
||||
chartSheetPtr->m_PAGESETUP = XLS::BaseObjectPtr(pageSetup);
|
||||
}
|
||||
if(m_oDrawing.IsInit() && m_oDrawing->m_oId.IsInit())
|
||||
{
|
||||
RId drawingId = m_oDrawing->m_oId->GetValue();
|
||||
auto castedDrawing = Get<OOX::File>(drawingId);
|
||||
auto drawingPtr = static_cast<OOX::Spreadsheet::CDrawing*>(castedDrawing.GetPointer());
|
||||
drawingPtr->toXLSChart(objPtr);
|
||||
}
|
||||
return objPtr;
|
||||
|
||||
}
|
||||
auto worksheetPtr = new XLS::WorksheetSubstream(0);
|
||||
auto sheetPtr = XLS::BaseObjectPtr(worksheetPtr);
|
||||
if(m_oSortState.IsInit() || m_oAutofilter.IsInit())
|
||||
@ -462,8 +484,6 @@ namespace OOX
|
||||
worksheetPtr->m_arPIVOTVIEW.push_back(tempPivot->m_oPivotTableDefinition->toXLS());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return sheetPtr;
|
||||
}
|
||||
void CWorksheet::WriteBin(XLS::StreamCacheWriterPtr& writer) const
|
||||
|
||||
@ -146,11 +146,11 @@ public:
|
||||
bool use_image_replace;
|
||||
};
|
||||
|
||||
drawing_context() : objects_count_(0), current_shape_(NULL),shape_text_content_(L""),zero_string_(L""),current_level_(0),current_shape_id_ (0){}
|
||||
drawing_context() : objects_count_(0), current_shape_(NULL), current_level_(0), current_shape_id_ (0) {}
|
||||
|
||||
void start_frame(odf_reader::draw_frame * drawFrame)
|
||||
{
|
||||
current_object_name_ = L"";
|
||||
current_object_name_.clear();
|
||||
current_level_++;
|
||||
objects_count_++;
|
||||
|
||||
@ -163,26 +163,28 @@ public:
|
||||
current_level_++;
|
||||
objects_count_++;
|
||||
|
||||
current_shape_id_ = objects_count_;
|
||||
current_object_name_ = L"";
|
||||
current_shape_ = drawShape;
|
||||
current_object_name_.clear();
|
||||
|
||||
current_shape_id_ = objects_count_;
|
||||
current_shape_ = drawShape;
|
||||
}
|
||||
void start_control(odf_reader::draw_control * drawControl)
|
||||
{
|
||||
current_level_++;
|
||||
objects_count_++;
|
||||
|
||||
current_shape_id_ = objects_count_;
|
||||
current_object_name_ = L"";
|
||||
current_control_ = drawControl;
|
||||
current_object_name_.clear();
|
||||
|
||||
current_shape_id_ = objects_count_;
|
||||
current_control_ = drawControl;
|
||||
}
|
||||
void start_group()
|
||||
{
|
||||
current_level_++;
|
||||
objects_count_++;
|
||||
|
||||
current_shape_id_ = objects_count_;
|
||||
current_object_name_ = L"";
|
||||
current_shape_id_ = objects_count_;
|
||||
current_object_name_.clear();
|
||||
|
||||
groups_.push_back(_group());
|
||||
}
|
||||
@ -225,6 +227,7 @@ public:
|
||||
current_level_--;
|
||||
frames_.pop_back();
|
||||
caption_.clear();
|
||||
draw_hyperlinkRId.clear();
|
||||
}
|
||||
|
||||
std::wstring & get_text_stream_frame()
|
||||
@ -261,6 +264,7 @@ public:
|
||||
shape_text_content_.clear();
|
||||
current_shape_id_ = 0;
|
||||
caption_.clear();
|
||||
draw_hyperlinkRId.clear();
|
||||
}
|
||||
void stop_control()
|
||||
{
|
||||
@ -269,6 +273,7 @@ public:
|
||||
shape_text_content_.clear();
|
||||
current_shape_id_ = 0;
|
||||
caption_.clear();
|
||||
draw_hyperlinkRId.clear();
|
||||
}
|
||||
void stop_group()
|
||||
{
|
||||
@ -278,8 +283,8 @@ public:
|
||||
|
||||
int get_current_frame_id() const
|
||||
{
|
||||
if (false == frames_.empty()) return frames_.back().id;
|
||||
else return 0;
|
||||
if (false == frames_.empty()) return frames_.back().id;
|
||||
else return 0;
|
||||
}
|
||||
bool in_group() { return !groups_.empty(); }
|
||||
int get_current_level() const { return current_level_; }
|
||||
@ -299,25 +304,25 @@ public:
|
||||
caption_ = value;
|
||||
}
|
||||
|
||||
std::wstring draw_hyperlinkRId;
|
||||
private:
|
||||
std::wstring shape_text_content_;
|
||||
std::wstring shape_text_content_;
|
||||
|
||||
std::wstring current_object_name_;
|
||||
unsigned int objects_count_;
|
||||
std::wstring current_object_name_;
|
||||
unsigned int objects_count_;
|
||||
|
||||
int current_level_;
|
||||
int current_level_;
|
||||
|
||||
std::vector<_group> groups_;
|
||||
std::vector<_frame> frames_;
|
||||
std::vector<_group> groups_;
|
||||
std::vector<_frame> frames_;
|
||||
|
||||
odf_reader::draw_shape *current_shape_;
|
||||
size_t current_shape_id_;
|
||||
size_t current_shape_id_;
|
||||
|
||||
odf_reader::draw_control*current_control_;
|
||||
|
||||
std::wstring zero_string_;
|
||||
std::wstring caption_;
|
||||
|
||||
std::wstring zero_string_;
|
||||
std::wstring caption_;
|
||||
};
|
||||
|
||||
class section_context : boost::noncopyable
|
||||
|
||||
@ -427,6 +427,14 @@ void docx_serialize_common(std::wostream & strm, _docx_drawing & val)
|
||||
CP_XML_ATTR_OPT_ENCODE_STRING(L"descr", descr);
|
||||
|
||||
oox_serialize_action(CP_XML_STREAM(), val.action);
|
||||
|
||||
if (val.hyperlinkRId.empty() == false)
|
||||
{
|
||||
CP_XML_NODE(L"a:hlinkClick")
|
||||
{
|
||||
CP_XML_ATTR(L"r:id", val.hyperlinkRId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"wp:cNvGraphicFramePr")
|
||||
|
||||
@ -66,6 +66,8 @@ public:
|
||||
std::wstring relativeHeight;
|
||||
std::wstring behindDoc;
|
||||
|
||||
std::wstring hyperlinkRId;
|
||||
|
||||
int posOffsetV;
|
||||
int posOffsetH;
|
||||
|
||||
|
||||
@ -112,6 +112,7 @@ namespace oox
|
||||
std::wstring name;
|
||||
int sub_type; //odf
|
||||
|
||||
|
||||
_INT32 x, y;
|
||||
_INT32 cx, cy;
|
||||
|
||||
@ -125,6 +126,7 @@ namespace oox
|
||||
|
||||
_action_desc action;
|
||||
std::vector<_hlink_desc> hlinks;
|
||||
std::wstring hyperlink;
|
||||
|
||||
std::vector<odf_reader::_property> additional;
|
||||
|
||||
|
||||
@ -749,8 +749,8 @@ void draw_a::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
}
|
||||
void draw_a::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
std::wstring rId = Context.add_hyperlink(xlink_attlist_.href_.get_value_or(L""), L"");//гиперлинк с объекта, а не с текста ..
|
||||
|
||||
Context.get_drawing_context().draw_hyperlinkRId = Context.add_hyperlink(xlink_attlist_.href_.get_value_or(L""), L""); //гиперлинк с объекта, а не с текста ..
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->docx_convert(Context);
|
||||
|
||||
@ -1089,6 +1089,7 @@ void draw_shape::docx_convert(oox::docx_conversion_context & Context)
|
||||
drawing.inGroup = Context.get_drawing_context().in_group();
|
||||
drawing.lined = lined_shape_;
|
||||
drawing.connector = connector_;
|
||||
drawing.hyperlinkRId = Context.get_drawing_context().draw_hyperlinkRId;
|
||||
|
||||
drawing.sub_type = sub_type_;
|
||||
drawing.additional = additional_;//сюда могут добавиться свойства ...
|
||||
@ -1514,8 +1515,9 @@ void draw_g::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
Context.get_drawing_context().add_name_object(name.get_value_or(L"Group"));
|
||||
|
||||
drawing.id = Context.get_drawing_context().get_current_shape_id();
|
||||
drawing.name = Context.get_drawing_context().get_current_object_name();
|
||||
drawing.id = Context.get_drawing_context().get_current_shape_id();
|
||||
drawing.name = Context.get_drawing_context().get_current_object_name();
|
||||
drawing.hyperlinkRId = Context.get_drawing_context().draw_hyperlinkRId;
|
||||
|
||||
//--------------------------------------------------
|
||||
common_draw_docx_convert(Context, common_draw_attlists_, &drawing);
|
||||
@ -1628,9 +1630,10 @@ void draw_frame::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
oox::_docx_drawing* drawing = dynamic_cast<oox::_docx_drawing *>(oox_drawing_.get());
|
||||
|
||||
drawing->id = Context.get_drawing_context().get_current_frame_id();
|
||||
drawing->name = Context.get_drawing_context().get_current_object_name();
|
||||
drawing->inGroup = Context.get_drawing_context().in_group();
|
||||
drawing->id = Context.get_drawing_context().get_current_frame_id();
|
||||
drawing->name = Context.get_drawing_context().get_current_object_name();
|
||||
drawing->inGroup = Context.get_drawing_context().in_group();
|
||||
drawing->hyperlinkRId = Context.get_drawing_context().draw_hyperlinkRId;
|
||||
|
||||
if (svg_title_)
|
||||
svg_title_->docx_convert(Context);
|
||||
@ -1931,10 +1934,11 @@ void draw_control::docx_convert(oox::docx_conversion_context & Context)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
oox::_docx_drawing drawing = oox::_docx_drawing();
|
||||
|
||||
drawing.type = oox::typeShape;
|
||||
drawing.id = Context.get_drawing_context().get_current_shape_id();
|
||||
drawing.name = Context.get_drawing_context().get_current_object_name();
|
||||
drawing.inGroup = Context.get_drawing_context().in_group();
|
||||
drawing.type = oox::typeShape;
|
||||
drawing.id = Context.get_drawing_context().get_current_shape_id();
|
||||
drawing.name = Context.get_drawing_context().get_current_object_name();
|
||||
drawing.inGroup = Context.get_drawing_context().in_group();
|
||||
drawing.hyperlinkRId = Context.get_drawing_context().draw_hyperlinkRId;
|
||||
drawing.sub_type = 1;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -4354,7 +4354,7 @@ void CPdfEditor::ScanAndProcessFonts(PDFDoc* pPDFDocument, XRef* xref, Dict* pRe
|
||||
if (gfxFont->getEmbeddedFontID(&oEmbRef) || PdfReader::IsBaseFont(wsFontBaseName))
|
||||
{
|
||||
std::wstring wsFileName, wsFontName;
|
||||
PdfReader::RendererOutputDev::GetFont(xref, pFontManager, pFontList, gfxFont, wsFileName, wsFontName);
|
||||
PdfReader::RendererOutputDev::GetFont(xref, pFontManager, pFontList, gfxFont, wsFileName, wsFontName, false);
|
||||
|
||||
// Собираем информацию о встроенном шрифте
|
||||
if (gfxFont->getEmbeddedFontID(&oEmbRef) && !PdfReader::IsBaseFont(wsFontBaseName))
|
||||
@ -4375,7 +4375,11 @@ void CPdfEditor::ScanAndProcessFonts(PDFDoc* pPDFDocument, XRef* xref, Dict* pRe
|
||||
if (pFontEntry.pCodeToGID[nIndex])
|
||||
mCodeToGID[nIndex] = pFontEntry.pCodeToGID[nIndex];
|
||||
}
|
||||
m_pWriter->AddEmbeddedFontInfo(wsFontName, wsFileName, sFontKey, static_cast<PdfWriter::EFontType>(gfxFont->getType()), mCodeToWidth, mCodeToUnicode, mCodeToGID);
|
||||
bool bBold = false, bItalic = false;
|
||||
std::wstring wsCheckFontName = wsFontName;
|
||||
PdfReader::CheckFontStylePDF(wsCheckFontName, bBold, bItalic);
|
||||
m_pWriter->AddFont(L"Embedded: " + wsFontName, bBold, bItalic, wsFileName, 0);
|
||||
m_pWriter->GetDocument()->CreateFontEmbedded(wsFileName, 0, sFontKey, static_cast<PdfWriter::EFontType>(gfxFont->getType()), mCodeToWidth, mCodeToUnicode, mCodeToGID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1070,6 +1070,7 @@ HRESULT CPdfFile::put_FontName(const std::wstring& wsName)
|
||||
oFile.CloseFile();
|
||||
}
|
||||
}
|
||||
m_pInternal->pWriter->AddFont(wsFont, bBold, bItalic, wsFontPath, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1080,7 +1081,6 @@ HRESULT CPdfFile::put_FontName(const std::wstring& wsName)
|
||||
else
|
||||
wsFont = sSub;
|
||||
}
|
||||
m_pInternal->pWriter->AddFont(wsFont, bBold, bItalic, wsFontPath, 0);
|
||||
}
|
||||
return m_pInternal->pWriter->put_FontName(wsFont);
|
||||
}
|
||||
|
||||
@ -3614,12 +3614,6 @@ bool CPdfWriter::GetEmbeddedFont(const std::wstring& wsFontName)
|
||||
m_pFontEmbedded = m_pDocument->FindFontEmbedded(wsFontPath, lFaceIndex);
|
||||
return !!m_pFontEmbedded;
|
||||
}
|
||||
void CPdfWriter::AddEmbeddedFontInfo(const std::wstring& wsFontName, const std::wstring& wsFilePath, const std::string& sFontKey, PdfWriter::EFontType eFontType,
|
||||
const std::map<unsigned int, unsigned int>& mCodeToWidth, const std::map<unsigned int, unsigned int>& mCodeToUnicode, const std::map<unsigned int, unsigned int>& mCodeToGID)
|
||||
{
|
||||
AddFont(L"Embedded: " + wsFontName, false, false, wsFilePath, 0);
|
||||
m_pDocument->CreateFontEmbedded(wsFilePath, 0, sFontKey, eFontType, mCodeToWidth, mCodeToUnicode, mCodeToGID);
|
||||
}
|
||||
bool CPdfWriter::UpdateFont()
|
||||
{
|
||||
m_bNeedUpdateTextFont = false;
|
||||
|
||||
@ -233,8 +233,6 @@ public:
|
||||
void SetHeadings(CHeadings* pCommand);
|
||||
void SetNeedAddHelvetica(bool bNeedAddHelvetica);
|
||||
void SetSplit(bool bSplit) { m_bSplit = bSplit; }
|
||||
void AddEmbeddedFontInfo(const std::wstring& wsFontName, const std::wstring& wsFilePath, const std::string& sFontKey, PdfWriter::EFontType eFontType,
|
||||
const std::map<unsigned int, unsigned int>& mCodeToWidth, const std::map<unsigned int, unsigned int>& mCodeToUnicode, const std::map<unsigned int, unsigned int>& mCodeToGID);
|
||||
|
||||
private:
|
||||
PdfWriter::CAction* GetAction(CAnnotFieldInfo::CActionFieldPr* pAction, bool bDeferred = false);
|
||||
|
||||
@ -558,7 +558,7 @@ std::wstring GetFontData(PDFDoc* pdfDoc, NSFonts::IFontManager* pFontManager, CP
|
||||
if (gfxFont->getEmbeddedFontID(&oEmbRef) || IsBaseFont(wsFontBaseName))
|
||||
{
|
||||
std::wstring wsFontName;
|
||||
RendererOutputDev::GetFont(xref, pFontManager, pFontList, gfxFont, wsFileName, wsFontName);
|
||||
RendererOutputDev::GetFont(xref, pFontManager, pFontList, gfxFont, wsFileName, wsFontName, false);
|
||||
|
||||
sFontName = U_TO_UTF8(wsFontName);
|
||||
CheckFontStylePDF(wsFontName, bBold, bItalic);
|
||||
|
||||
@ -113,7 +113,6 @@ namespace PdfWriter
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned int CFontEmbedded::GetWidth(unsigned short ushCode)
|
||||
{
|
||||
// Возвращаем ширину из карты
|
||||
@ -123,7 +122,6 @@ namespace PdfWriter
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int CFontEmbedded::EncodeUnicode(const unsigned int& unGID, const unsigned int& unUnicode)
|
||||
{
|
||||
for (auto& pair : m_mCodeToUnicode)
|
||||
@ -135,7 +133,6 @@ namespace PdfWriter
|
||||
m_mCodeToUnicode.insert(std::pair<unsigned int, unsigned short>(ushCode, unUnicode));
|
||||
return ushCode;
|
||||
}
|
||||
|
||||
unsigned int CFontEmbedded::EncodeGID(const unsigned int& unGID)
|
||||
{
|
||||
for (auto& pair : m_mCodeToGID)
|
||||
|
||||
Reference in New Issue
Block a user