Commit 6e06584d authored by ElenaSubbotina's avatar ElenaSubbotina Committed by Alexander Trofimov

PptFormat - Тікбұрышты үшбұрыштарды.ppt - угол заливки градиента,...

PptFormat - Тікбұрышты үшбұрыштарды.ppt - угол заливки градиента, NotchedCircularArrow (кривой), подстройчные и надстрочные буквы, ...
parent d2abe171
#include "ShapeWriter.h"
#include "ShapeWriter.h"
#include "StylesWriter.h"
#include "../../../ASCOfficeXlsFile2/source/XlsXlsxConverter/ShapeType.h"
......@@ -10,7 +10,7 @@
void CStylesWriter::ConvertStyleLevel(NSPresentationEditor::CTextStyleLevel& oLevel, NSPresentationEditor::CMetricInfo& oMetricInfo,
NSPresentationEditor::CStringWriter& oWriter, const int& nLevel)
{// CTextPFRun CTextCFRun ShapeWriter - todooo -
{//дублирование CTextPFRun и CTextCFRun с ShapeWriter - todooo - вынести отдельно
CString str1;
if (nLevel == 9)
str1 = _T("<a:defPPr");
......@@ -305,6 +305,12 @@ CString NSPresentationEditor::CShapeWriter::ConvertBrush(CBrush & brush)
NSPresentationEditor::CStringWriter brush_writer;
if (brush.Type == c_BrushTypeTexture)
{
if (m_pImageElement)//фон для картинки с празрачностью
{
brush_writer.WriteString(std::wstring(L"<a:noFill/>"));
}
else
{
CString strRid = m_pRels->WriteImage(brush.TexturePath);
......@@ -317,6 +323,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertBrush(CBrush & brush)
brush_writer.WriteString(std::wstring(L"</a:blipFill>"));
}
}
else if ( brush.Type == c_BrushTypeNoFill)
{
brush_writer.WriteString(std::wstring(L"<a:noFill/>"));
......@@ -350,11 +357,23 @@ CString NSPresentationEditor::CShapeWriter::ConvertBrush(CBrush & brush)
brush_writer.WriteString(std::wstring(L"</a:gs>"));
}
brush_writer.WriteString(std::wstring(L"</a:gsLst>"));
brush_writer.WriteString(std::wstring(L"<a:lin ang=\"5400000\" scaled=\"1\"/>"));
brush_writer.WriteString(std::wstring(L"<a:lin ang=\""));
{
if (brush.LinearAngle < -180) brush.LinearAngle += 180;
if (brush.LinearAngle > 180) brush.LinearAngle -= 180;
int val = (90 - brush.LinearAngle) ;
if (val < 0) val = 0;
if (val > 360) val -= 360;
CString str; str.Format(_T("%d"), val * 60000);
brush_writer.WriteString(str);
}
brush_writer.WriteString(std::wstring(L"\" scaled=\"1\"/>"));
brush_writer.WriteString(std::wstring(L"</a:gradFill>"));
}
else if(brush.Type == c_BrushTypePattern)
{// - -
{//типов нету в ппт - вместо них шаблон-картинка
brush_writer.WriteString(std::wstring(L"<a:pattFill prst=\"pct80\">"));
brush_writer.WriteString(std::wstring(L"<a:fgClr>"));
brush_writer.WriteString(ConvertColor(brush.Color1, brush.Alpha1));
......@@ -545,7 +564,7 @@ void NSPresentationEditor::CShapeWriter::WriteImageInfo()
m_oWriter.WriteString(std::wstring(L"\""));
//if (!m_pImageElement->m_sDescription.empty())
//{//
//{//бывает всякая разная бяка сохранена
// m_oWriter.WriteString(std::wstring(L" descr=\""));
// m_oWriter.WriteStringXML(m_pImageElement->m_sDescription);
// m_oWriter.WriteString(std::wstring(L"\""));
......@@ -707,7 +726,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
std::wstring prstTxWarp = oox::Spt2WordArtShapeType((oox::MSOSPT)m_pShapeElement->m_lShapeType);
m_oWriter.WriteString(std::wstring(L"<a:prstTxWarp"));
m_oWriter.WriteString(std::wstring(L" prst=\"") + prstTxWarp + _T("\">"));
m_oWriter.WriteString(std::wstring(L"<a:avLst>"));//
m_oWriter.WriteString(std::wstring(L"<a:avLst>"));//модификаторы
CPPTShape *pPPTShape = dynamic_cast<CPPTShape *>(m_pShapeElement->m_oShape.m_pShape);
CString strVal;
......@@ -718,7 +737,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
{
case oox::msosptTextFadeUp:
{
double kf = 4.63; //""
double kf = 4.63; //"волшебный"
strVal.Format(L"%d", (int)(kf * pPPTShape->m_arAdjustments[i]));
m_oWriter.WriteString(std::wstring(L"<a:gd name=\"adj\" fmla=\"val "));
m_oWriter.WriteString(strVal + _T("\"/>"));
......@@ -806,7 +825,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
CString _str2 = _T(">");
m_oWriter.WriteString(_str2);
double dKoef1 = 3.52777778; // :-) ...
double dKoef1 = 3.52777778; // :-) чё это не понятно ...
if (pPF->lineSpacing.is_init())
{
LONG val = pPF->lineSpacing.get();
......@@ -979,8 +998,12 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
if ((pCF->Size.is_init()) && (pCF->Size.get() > 0) && (pCF->Size.get() < 4001))
{
CString strProp = _T("");
strProp.Format(_T(" sz=\"%d\""), (int)(100 * pCF->Size.get()));
CString strProp; strProp.Format(_T(" sz=\"%d\""), (int)(100 * pCF->Size.get()));
m_oWriter.WriteString(strProp);
}
if (pCF->BaseLineOffset.is_init())
{
CString strProp; strProp.Format(_T(" baseline=\"%d\""), (int)(1000 * pCF->BaseLineOffset.get()));
m_oWriter.WriteString(strProp);
}
if (pCF->FontBold.is_init())
......@@ -1015,7 +1038,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
m_oWriter.WriteString(std::wstring(L">"));
if (m_bWordArt)
{// - , , !!!
{//порядок важен - линия, заливка, тень !!!
if (m_pShapeElement->m_bLine)
{
m_oWriter.WriteString(ConvertLine(m_pShapeElement->m_oPen));
......@@ -1156,6 +1179,9 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
m_oWriter.WriteString(std::wstring(L"<a:xfrm"));
if (0 != m_pShapeElement->m_dRotate)
{
if (m_pShapeElement->m_bFlipH && m_pShapeElement->m_dRotate < 180)
m_pShapeElement->m_dRotate += 180; //Тікбұрышты үшбұрыштарды.ppt slide-7
str.Format(L" rot=\"%d\"", (int)(m_pShapeElement->m_dRotate * 60000));
m_oWriter.WriteString(str);
}
......@@ -1182,12 +1208,12 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
m_oWriter.WriteString(std::wstring(L"</a:xfrm>"));
}
if (m_pShapeElement->m_oShape.m_lDrawType & c_ShapeDrawType_Graphic)
if (m_pShapeElement->m_oShape.m_lDrawType & c_ShapeDrawType_Graphic || m_pShapeElement->m_oShape.m_pShape->m_bCustomShape)
{
m_pShapeElement->m_oShape.ToRenderer(dynamic_cast<IRenderer*>(this), oInfo, m_oMetricInfo, 0.0, 1.0);
}
if ((prstGeom.empty() == false || m_pShapeElement->m_bShapePreset) && prstTxWarp.empty())
if ((prstGeom.empty() == false || m_pShapeElement->m_bShapePreset) && prstTxWarp.empty() && !m_pShapeElement->m_oShape.m_pShape->m_bCustomShape)
{
if (prstGeom.empty()) prstGeom = L"rect";
m_oWriter.WriteString(std::wstring(L"<a:prstGeom"));
......@@ -1235,7 +1261,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertImage()
if (m_pImageElement->m_bImagePresent == false)
{
if (m_pImageElement->m_sName.empty()) return _T("");
//ppt_presentation.ppt -
//ppt_presentation.ppt - ссылка на файл на диске
m_pImageElement->m_strImageFileName.clear();
m_pImageElement->m_bImagePresent = true;
......@@ -1355,7 +1381,7 @@ HRESULT NSPresentationEditor::CShapeWriter::get_Type(LONG* lType)
*lType = c_nSVGConverter;
return S_OK;
}
//-------- --------------------------------------------------
//-------- Функции для работы со страницей --------------------------------------------------
HRESULT NSPresentationEditor::CShapeWriter::NewPage()
{
return S_OK;
......@@ -1840,7 +1866,7 @@ HRESULT NSPresentationEditor::CShapeWriter::put_EdgeDist(double val)
m_oEdge.Dist = val;
return S_OK;
}
//-------- --------------------------------------------------------
//-------- Функции для вывода текста --------------------------------------------------------
HRESULT NSPresentationEditor::CShapeWriter::CommandDrawText(const std::wstring& bsText, const double& x, const double& y, const double& w, const double& h)
{
if (c_nHyperlinkType == m_lCurrentCommandType)
......@@ -1909,7 +1935,7 @@ HRESULT NSPresentationEditor::CShapeWriter::CommandDrawTextEx(const std::wstring
}
return S_OK;
}
//-------- ---------------------------------------------------------------
//-------- Маркеры для команд ---------------------------------------------------------------
HRESULT NSPresentationEditor::CShapeWriter::BeginCommand(const DWORD& lType)
{
if (c_nPathType == lType)
......@@ -1926,7 +1952,7 @@ HRESULT NSPresentationEditor::CShapeWriter::EndCommand(const DWORD& lType)
m_lCurrentCommandType = -1;
return S_OK;
}
//-------- Graphics Path -----------------------------------------------
//-------- Функции для работы с Graphics Path -----------------------------------------------
HRESULT NSPresentationEditor::CShapeWriter::PathCommandMoveTo(const double& x, const double& y)
{
if (c_nSimpleGraphicType == m_lCurrentCommandType)
......@@ -2080,7 +2106,7 @@ HRESULT NSPresentationEditor::CShapeWriter::PathCommandTextEx(const std::wstring
m_oFont.StringGID = bGid;
return S_OK;
}
//-------- ---------------------------------------------------
//-------- Функции для вывода изображений ---------------------------------------------------
HRESULT NSPresentationEditor::CShapeWriter::DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h)
{
return S_OK;
......
#pragma once
#pragma once
#include "Shape.h"
#include "ShapeProperties.h"
......@@ -28,7 +28,6 @@
#define EMU_MM 36000.0
#endif
#define FIXED_POINT(val) (double)((short)(val >> 16) + ((short)(val) / 65536.0))
#define FIXED_POINT_unsigned(val) (double)((WORD)(val >> 16) + ((WORD)(val) / 65536.0))
using namespace NSOfficeDrawing;
......@@ -37,6 +36,13 @@ using namespace NSPresentationEditor;
class CPPTElement
{
public:
double FixedPointToDouble(unsigned int op)
{
short Integral = op >> 16;
unsigned short Fractional = op - (Integral << 16);
return Integral + (Fractional / 65536.0);
}
bool ChangeBlack2ColorImage(std::wstring image_path, int rgbColor1, int rgbColor2)
{
......@@ -111,7 +117,7 @@ public:
if (color.m_lSchemeIndex != -1)
{
// (
//вытащить цвет (
color = pTheme->m_arColorScheme[color.m_lSchemeIndex];
}
......@@ -274,7 +280,7 @@ public:
}break;
case rotation:
{
pElement->m_dRotate = FIXED_POINT(pProperty->m_lValue);
pElement->m_dRotate = FixedPointToDouble(pProperty->m_lValue);
}break;
case fFlipH:
{
......@@ -415,13 +421,15 @@ public:
case fillOpacity:
{
pElement->m_oBrush.Alpha1 = (BYTE)(std::min)(255, (int)CDirectory::NormFixedPoint(pProperty->m_lValue, 255));
break;
}
}break;
case fillBackOpacity:
{
pElement->m_oBrush.Alpha2 = (BYTE)(std::min)(255, (int)CDirectory::NormFixedPoint(pProperty->m_lValue, 255));
break;
}
}break;
case fillAngle:
{
pElement->m_oBrush.LinearAngle = FixedPointToDouble(pProperty->m_lValue);
}break;
case fillRectLeft:
{
pElement->m_oBrush.Rect.X = pProperty->m_lValue;
......@@ -455,9 +463,6 @@ public:
bool bShadeBand = GETBIT(pProperty->m_lValue, 28);
bool bShadeOneColor = GETBIT(pProperty->m_lValue, 27);
}break;
case fillAngle:
{
}break;
case fillFocus://relative position of the last color in the shaded fill
{
......@@ -529,7 +534,7 @@ public:
bool bUseShadowOk = (0x20 == (0x20 & flag3));
//if (bUseLineOk)
// pElement->m_bLine = bLineOk;//?? todooo - ! 1 (82).ppt
// pElement->m_bLine = bLineOk;//?? todooo проверить - не сраюатывает ! 1 (82).ppt
if (bUseFillOk)
bIsFilled = bFillOk;
......@@ -716,11 +721,11 @@ public:
}break;
case shadowOriginX://in emu, relative from center shape
{
pElement->m_oShadow.OriginX = FIXED_POINT(pProperty->m_lValue);
pElement->m_oShadow.OriginX = FixedPointToDouble(pProperty->m_lValue);
}break;
case shadowOriginY:
{
pElement->m_oShadow.OriginY = FIXED_POINT(pProperty->m_lValue);
pElement->m_oShadow.OriginY = FixedPointToDouble(pProperty->m_lValue);
}break;
case shadowColor:
{
......@@ -742,7 +747,7 @@ public:
}break;
case shadowHighlight:
{
//
//оттенок двойной тени
}break;
case shadowOffsetX:
{
......@@ -754,19 +759,19 @@ public:
}break;
case shadowScaleXToX:
{
pElement->m_oShadow.ScaleXToX = FIXED_POINT(pProperty->m_lValue);
pElement->m_oShadow.ScaleXToX = FixedPointToDouble(pProperty->m_lValue);
}break;
case shadowScaleYToX:
{
pElement->m_oShadow.ScaleYToX = FIXED_POINT(pProperty->m_lValue);
pElement->m_oShadow.ScaleYToX = FixedPointToDouble(pProperty->m_lValue);
}break;
case shadowScaleXToY:
{
pElement->m_oShadow.ScaleXToY = FIXED_POINT(pProperty->m_lValue);
pElement->m_oShadow.ScaleXToY = FixedPointToDouble(pProperty->m_lValue);
}break;
case shadowScaleYToY:
{
pElement->m_oShadow.ScaleYToY = FIXED_POINT(pProperty->m_lValue);
pElement->m_oShadow.ScaleYToY = FixedPointToDouble(pProperty->m_lValue);
}break;
case shadowPerspectiveX:
{
......@@ -788,7 +793,7 @@ public:
if (!fUsefShadow && fUsefshadowObscured)
{
//
//контурная
pElement->m_oShadow.Visible = fshadowObscured;
}
}break;
......@@ -871,7 +876,7 @@ public:
case pibName:
{
pElement->m_sImageName = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue /2-1);
// TextMining05.ppt, 20 - ( - todooo
// TextMining05.ppt, слайд 20 - некорректное имя ( - todooo потом подчистить его
}break;
case cropFromTop:
{
......@@ -912,12 +917,12 @@ public:
switch (pProperty->m_ePID)
{
// ...
// здесь просто применяем проперти...
// geometry ----------------------------------------------------
// top, left, right, bottom logic
case NSOfficeDrawing::metroBlob:
{
// oox
//альтернатива в формате oox
//NSFile::CFileBinary f;
//f.CreateFileW(L"d:\\test.zip");
//f.WriteFile(pProperty->m_pOptions, pProperty->m_lValue);
......@@ -937,6 +942,7 @@ public:
case NSOfficeDrawing::shapePath:
{
pShape->m_oCustomVML.SetPath((RulesType)pProperty->m_lValue);
pShape->m_bCustomShape = true;
}break;
// segmentsInfo
case NSOfficeDrawing::pSegmentInfo:
......@@ -944,6 +950,7 @@ public:
if (pProperty->m_bComplex)
{
pShape->m_oCustomVML.LoadSegments(pProperty);
pShape->m_bCustomShape = true;
}
}break;
// verticesInfo
......@@ -952,12 +959,13 @@ public:
if (pProperty->m_bComplex)
{
pShape->m_oCustomVML.LoadVertices(pProperty);
pShape->m_bCustomShape = true;
}
}break;
case NSOfficeDrawing::pGuides:
{
if (pProperty->m_bComplex)
{
if (pProperty->m_bComplex && pShape->m_eType != sptNotchedCircularArrow)
{//Тікбұрышты үшбұрыштарды.ppt - slide 25
pShape->m_oCustomVML.LoadGuides(pProperty);
}
}break;
......@@ -1128,7 +1136,7 @@ public:
}
case NSOfficeDrawing::gtextBoolean:
{
// -
// вот здесь - нужно единицы перевести в пикселы
BYTE flag1 = (BYTE)(pProperty->m_lValue);
BYTE flag2 = (BYTE)(pProperty->m_lValue >> 8);
BYTE flag3 = (BYTE)(pProperty->m_lValue >> 16);
......@@ -1320,7 +1328,7 @@ public:
{
if (pLayout->m_arElements[nIndex]->m_bPlaceholderSet == false)
{
pElementLayout = pLayout->m_arElements[nIndex]; //
pElementLayout = pLayout->m_arElements[nIndex]; //для переноса настроек
pElementLayout->m_lID = lMasterID;
if (placeholder_id >= 0 && pLayout->m_arElements[nIndex]->m_lPlaceholderID < 0 )
......@@ -1345,8 +1353,8 @@ public:
}
}
}
// - .
// placeholder (type & id)
// раньше искался шейп - и делался дубликат. Теперь думаю это не нужно
// нужно ориентироваться на placeholder (type & id)
IElement* pElem = *ppElement;
if (NULL == pElem)
......@@ -1363,7 +1371,7 @@ public:
CExFilesInfo oInfo;
CExFilesInfo oInfoDefault;
// ( )
// по умолчанию картинка (или оле объект)
CExFilesInfo::ExFilesType exType = CExFilesInfo::eftNone;
CExFilesInfo* pInfo = pMapIDs->Lock(0xFFFFFFFF, exType);
if (NULL != pInfo)
......@@ -1443,7 +1451,7 @@ public:
pElem->m_lID = oArrayShape[0]->m_nID;
pElem->m_lLayoutID = lMasterID;
//---------
//---------внешние ссылки
{
CExFilesInfo::ExFilesType exType = CExFilesInfo::eftNone;
CExFilesInfo * pTextureInfo = pMapIDs->Lock(0xFFFFFFFF, exType);
......@@ -1470,7 +1478,7 @@ public:
// placeholders
if (0 < oArrayPlaceHolder.size())
{
pElem->m_bLine = false; //
pElem->m_bLine = false; //по умолчанию у них нет линий
pElem->m_lPlaceholderID = oArrayPlaceHolder[0]->m_nPosition;
pElem->m_lPlaceholderType = oArrayPlaceHolder[0]->m_nPlacementID;
pElem->m_lPlaceholderSizePreset = oArrayPlaceHolder[0]->m_nSize;
......@@ -1522,7 +1530,7 @@ public:
if (format_data)
{
pElem->m_nFormatDate = 1;
//todooo
//todooo сделать форматированый вывод
}
else
{
......@@ -1530,7 +1538,7 @@ public:
pElem->m_nFormatDate = 2;
}
}
//------------- ---------------------------------------------------------------------------------
//------------- привязки ---------------------------------------------------------------------------------
std::vector<CRecordClientAnchor*> oArrayAnchor;
this->GetRecordsByType(&oArrayAnchor, true, true);
......@@ -1567,7 +1575,7 @@ public:
{
if (oArrayShape[0]->m_bBackground)
{
// background
// здесь background
pElem->m_rcBoundsOriginal.left = 0;
pElem->m_rcBoundsOriginal.top = 0;
pElem->m_rcBoundsOriginal.right = lSlideWidth;
......@@ -1575,7 +1583,7 @@ public:
}
else
{
// ...
// не понятно...
pElem->m_rcBoundsOriginal.left = 0;
pElem->m_rcBoundsOriginal.top = 0;
pElem->m_rcBoundsOriginal.right = 0;
......@@ -1601,7 +1609,7 @@ public:
pElementLayout->m_bPlaceholderSet = true;
pElementLayout->m_bBoundsEnabled = true;
}
//--------- --------------------------------------------------------------------------
//--------- наличие текста --------------------------------------------------------------------------
CShapeElement* pShapeElem = dynamic_cast<CShapeElement*>(pElem);
if (NULL != pShapeElem)
{
......@@ -1612,7 +1620,7 @@ public:
pShapeElem->m_oShape.m_dWidthLogic = ShapeSizeVML;
pShapeElem->m_oShape.m_dHeightLogic = ShapeSizeVML;
// textheader present
// проверка на textheader present
std::vector<CRecordTextHeaderAtom*> oArrayTextHeader;
GetRecordsByType(&oArrayTextHeader, true, true);
......@@ -1629,7 +1637,7 @@ public:
oElementInfo.m_lMasterTextType = NSOfficePPT::NoPresent;
}
//
// проверка на ссылку в персист
std::vector<CRecordOutlineTextRefAtom*> oArrayTextRefs;
GetRecordsByType(&oArrayTextRefs, true, true);
......@@ -1638,7 +1646,7 @@ public:
oElementInfo.m_lPersistIndex = oArrayTextRefs[0]->m_nIndex;
}
// ...
// сам текст...
std::vector<CRecordTextBytesAtom*> oArrayTextBytes;
GetRecordsByType(&oArrayTextBytes, true, true);
if (0 < oArrayTextBytes.size() && strShapeText.empty())
......@@ -1788,7 +1796,7 @@ public:
return;
}
// ,
// здесь переводим координаты, чтобы они не зависили от группы
long lWidthClient = m_pGroupClientAnchor->right - m_pGroupClientAnchor->left;
long lHeightClient = m_pGroupClientAnchor->bottom - m_pGroupClientAnchor->top;
......@@ -1865,17 +1873,17 @@ protected:
}
void SetUpTextStyle(std::wstring& strText, CTheme* pTheme, CLayout* pLayout, IElement* pElem, CSlideInfo* pThemeWrapper, CSlideInfo* pSlideWrapper, CSlide* pSlide, CRecordMasterTextPropAtom* master_levels)
{
// shape
// -
// сначала проверяем на shape
// затем применяем все настройки по-очереди
// 1) master + TextMasterStyles
// 2) persist + TextMasterStyles
// 3) + TextMasterStyles
// " " - " "
// ( ) -
// .
// - ,
// , .cpp -
// (.. )
// 3) свои настройки + TextMasterStyles
// причем "свои настройки" - это чисто "продвинутые настройки"
// потому что все общие ( через проперти ) - уже установлены
// тут важно выставить правильный порядок.
// словом - важная очень функция для текста,
// и, чтобы убрать всякие лишние .cpp файлы - здесь же будем учитывать
// настройки слайда (т.е. структуры не будут работать со слайдами)
if (NULL == pElem)
return;
......@@ -1889,10 +1897,10 @@ protected:
CTextAttributesEx* pTextSettings = &(pShape->m_oShape.m_oText);
// masterstyle ( )
// - (.. )
// - - .. -
//
// сначала применим ссылки на masterstyle (для шаблонного элемента)
// как узнать - просто есть ли массивы (т.к. они могли появиться пока только оттуда)
// - теперь этого делать не нужно - т.к. в мастере тоже вызывается эта функция -
// и там все это должно уже примениться
bool bIsPersistPresentSettings = false;
bool bIsOwnPresentSettings = false;
......@@ -1902,7 +1910,7 @@ protected:
CShapeElement* pElementLayoutPH = NULL;
//
// выставим тип мастера
if (NULL != pSlide)
{
int ph_type = pShape->m_lPlaceholderType;
......@@ -1962,7 +1970,7 @@ protected:
if (NULL != oElemInfo.m_pStream && -1 != oElemInfo.m_lOffsetTextStyle)
{
// .
// теперь нужно загрузить стили текста из стрима.
LONG lPosition = 0; StreamUtils::StreamPosition(lPosition, oElemInfo.m_pStream);
StreamUtils::StreamSeek(oElemInfo.m_lOffsetTextStyle - 8, oElemInfo.m_pStream);
......@@ -1988,7 +1996,7 @@ protected:
// ------------------------------------------------------------------------------
// ()
// теперь выставляем все настройки текста (стили)
if (NULL == pSlide)
{
int nTextMasterType = (int)eTypeMaster;
......@@ -2079,7 +2087,7 @@ protected:
//}
}
// (persist own) - m_oStyles
// теперь смотрим все остальные стили (persist и own) - просто применяем их к m_oStyles
if (eTypePersist != NSOfficePPT::NoPresent && eTypePersist != eTypeMaster)
{
int nIndexType = (int)eTypePersist;
......@@ -2148,7 +2156,7 @@ protected:
pTextSettings->m_lStyleThemeIndex = -1;
}
// (persist own) - m_oStyles
// теперь смотрим все остальные стили (persist и own) - просто применяем их к m_oStyles
if (eTypePersist != NSOfficePPT::NoPresent && eTypePersist != eTypeMaster)
{
int nIndexType = (int)eTypePersist;
......@@ -2181,7 +2189,7 @@ protected:
if ((_T("") != strText) && 0 == pTextSettings->m_arParagraphs.size())
{
// .
// значит никаких своих настроек нету. Значит просто пустые свои настройки
std::vector<CTextPFRun_ppt> oArrayPF;
CTextPFRun_ppt elm;
......@@ -2203,7 +2211,7 @@ protected:
if (NULL != oElemInfo.m_pStream && -1 != oElemInfo.m_lOffsetTextProp)
{
//
//языковые настройки текта
LONG lPosition = 0; StreamUtils::StreamPosition(lPosition, oElemInfo.m_pStream);
StreamUtils::StreamSeek(oElemInfo.m_lOffsetTextProp - 8, oElemInfo.m_pStream);
......@@ -2229,7 +2237,7 @@ protected:
if (pShape->m_oActions.m_bPresent)
{
//todooo - 1-(34).ppt
//todooo разобраться нужно ли менять цвет на гиперлинк - 1-(34).ppt
NSPresentationEditor::CColor oColor;
if ((NULL != pSlide) && !pSlide->m_bUseLayoutColorScheme) oColor = pSlide->GetColor(11);
else if ((NULL != pLayout) && (!pLayout->m_bUseThemeColorScheme)) oColor = pLayout->GetColor(11);
......@@ -2241,7 +2249,7 @@ protected:
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShape->m_oShape.m_pShape);
if (NULL != pPPTShape) // wordart
if (NULL != pPPTShape) // проверка на wordart
{
switch (pPPTShape->m_eType)
{
......
......@@ -40,11 +40,11 @@ namespace NSPresentationEditor
{
public:
std::vector<long> m_arAdjustments;
std::vector<double> Guides;
std::vector<double> m_arGuides;
public:
LONG m_eJoin;
bool m_bConcentricFill;
bool m_bCustomShape;
std::vector<SimpleTypes::CPoint> m_arConnectors;
std::vector<LONG> m_arConnectorAngles;
......@@ -61,9 +61,11 @@ namespace NSPresentationEditor
LONG m_lLimoY;
CPath m_oPath;
public:
CBaseShape()
{
m_bCustomShape = false;
}
virtual bool LoadFromXML(const CString& xml) = 0;
......@@ -112,9 +114,9 @@ namespace NSPresentationEditor
for(int i = 0; i < Shape->m_arAdjustments.size(); i++)
m_arAdjustments.push_back(Shape->m_arAdjustments[i]);
Guides.clear();
for(int i = 0; i < Shape->Guides.size(); i++)
Guides.push_back(Shape->Guides[i]);
m_arGuides.clear();
for(int i = 0; i < Shape->m_arGuides.size(); i++)
m_arGuides.push_back(Shape->m_arGuides[i]);
m_eJoin = Shape->m_eJoin;
m_bConcentricFill = Shape->m_bConcentricFill;
......@@ -154,9 +156,9 @@ namespace NSPresentationEditor
for(int i = 0; i < m_arAdjustments.size(); i++)
Shape->m_arAdjustments.push_back(m_arAdjustments[i]);
Shape->Guides.clear();
for(int i = 0; i < Guides.size(); i++)
Shape->Guides.push_back(Guides[i]);
Shape->m_arGuides.clear();
for(int i = 0; i < m_arGuides.size(); i++)
Shape->m_arGuides.push_back(m_arGuides[i]);
Shape->m_eJoin = m_eJoin;
Shape->m_bConcentricFill = m_bConcentricFill;
......
......@@ -21,6 +21,7 @@ CPPTShape* CPPTShape::CreateByType(PPTShapes::ShapeType type)
case sptNotchedCircularArrow:
case sptHostControl:
{ pShape = new CPPTShape(); pShape->m_eType = type; break; }
case 0: { pShape = new CRectangleType(); break; }
//CREATE_BY_SPT(sptMin, CLineType)
......
......@@ -2435,6 +2435,7 @@ namespace NSGuidesVML
switch (eParamType)
{
case ptFormula:
if (bExtShape || lParam < m_arIndexDst.size())
{
oWriter.m_oWriter.AddCharNoCheck((WCHAR)'g');
oWriter.m_oWriter.AddCharNoCheck((WCHAR)'d');
......
......@@ -250,7 +250,7 @@ public:
NSGuidesOOXML::CFormulaManager FManager;
public:
CPPTXShape() : CBaseShape(), FManager(m_arAdjustments, Guides)
CPPTXShape() : CBaseShape(), FManager(m_arAdjustments, m_arGuides)
{
m_eType = OOXMLShapes::sptMin;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment