Commit 47ff766e authored by ElenaSubbotina's avatar ElenaSubbotina

.

parent 50cbc671
......@@ -1087,12 +1087,6 @@ PPTX::Logic::SpTreeElem CDrawingConverter::ObjectFromXml(const std::wstring& sXm
std::wstring strVMLShapeXml = GetVMLShapeXml(oElem);
#endif
}
if (strCurrentRelsPath != m_strCurrentRelsPath)
{
m_strCurrentRelsPath = strCurrentRelsPath;
SetCurrentRelsPath();
}
}
}
}
......
......@@ -118,6 +118,13 @@ OOX::Logic::CDrawing* OOXDrawingGraphicConverter::Convert( ReaderParameter oPara
if (sXml.empty())return NULL;
OOX::CPath pathDrawingRels(drawingConverter.m_strCurrentRelsPath);
if (m_ooxGraphicRels)
{
m_ooxGraphicRels->Read(pathDrawingRels, pathDrawingRels);
}
std::wstring sBegin (L"<main xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:p=\"urn:schemas-microsoft-com:office:powerpoint\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:a14=\"http://schemas.microsoft.com/office/drawing/2010/main\" xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\" xmlns:xdr=\"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing\">");
std::wstring sEnd (L"</main>");
......
......@@ -46,9 +46,18 @@ private:
std::wstring m_sXml;
public:
OOX::IFileContainer *m_ooxGraphicRels;
OOXDrawingGraphicConverter(std::wstring sXml)
{
m_sXml = sXml;
m_sXml = sXml;
m_ooxGraphicRels = new OOX::IFileContainer();
}
virtual ~OOXDrawingGraphicConverter()
{
if (m_ooxGraphicRels)
delete m_ooxGraphicRels;
m_ooxGraphicRels = NULL;
}
//OOX::Logic::CPicture* Parse( ReaderParameter oParam , RtfShapePtr pOutput);
OOX::Logic::CDrawing* Convert( ReaderParameter oParam, RtfShapePtr pOutput);
......
......@@ -93,12 +93,13 @@ public:
class OOXFontReader2
{
private:
ComplexTypes::Word::CFonts * m_ooxFont;
ComplexTypes::Word::CFonts *m_ooxFont;
public:
OOXFontReader2(ComplexTypes::Word::CFonts * ooxFont)
{
m_ooxFont = ooxFont;
m_ooxFont = ooxFont;
}
bool Parse( ReaderParameter oParam, int& nFont)
{
if (!m_ooxFont) return false;
......@@ -169,3 +170,90 @@ private:
return sFont;
}
};
class OOXFontReader3
{
private:
OOX::Drawing::CTextFont *m_asciiFont;
OOX::Drawing::CTextFont *m_csFont;
OOX::Drawing::CTextFont *m_asianFont;
public:
OOXFontReader3(OOX::Drawing::CTextFont * asciiFont, OOX::Drawing::CTextFont * asianFont, OOX::Drawing::CTextFont * csFont)
{
m_asciiFont = asciiFont;
m_asianFont = asianFont;
m_csFont = csFont;
}
bool Parse( ReaderParameter oParam, int& nFont)
{
if (!m_asciiFont && !m_csFont && !m_asianFont) return false;
std::wstring sAscii, sCs, sEastAsia;
if ((m_asciiFont) && (m_asciiFont->m_oTypeFace.IsInit())) sAscii = m_asciiFont->m_oTypeFace->GetValue();
if ((m_csFont) && (m_csFont->m_oTypeFace.IsInit())) sCs = m_csFont->m_oTypeFace->GetValue();
if ((m_asianFont) && (m_asianFont->m_oTypeFace.IsInit())) sEastAsia = m_asianFont->m_oTypeFace->GetValue();
std::wstring sFont;
std::wstring sTempFont;
if( !sAscii.empty() ) sFont = sAscii;
else if( !sCs.empty() ) sFont = sCs;
else if( !sEastAsia.empty() ) sFont = sEastAsia;
if( !sFont.empty() )
{
RtfFont oCurFont;
if( true == oParam.oRtf->m_oFontTable.GetFont( sFont, oCurFont ) )
nFont = oCurFont.m_nID;
else
{
nFont = oParam.oRtf->m_oFontTable.GetCount() + 1;
oCurFont.m_nID = nFont;
oCurFont.m_sName = sFont;
if( !sAscii.empty() )
{
if (m_asciiFont->m_oPanose.IsInit())
oCurFont.m_sPanose = m_asciiFont->m_oPanose->GetValue();
oCurFont.m_nCharset = m_asciiFont->m_oCharset.GetValue();
oCurFont.m_nPitch = m_asciiFont->m_oPitchFamily.GetValue();
}
else if( !sCs.empty() )
{
if (m_csFont->m_oPanose.IsInit())
oCurFont.m_sPanose = m_csFont->m_oPanose->GetValue();
oCurFont.m_nCharset = m_csFont->m_oCharset.GetValue();
oCurFont.m_nPitch = m_csFont->m_oPitchFamily.GetValue();
}
else if( !sEastAsia.empty() )
{
if (m_asianFont->m_oPanose.IsInit())
oCurFont.m_sPanose = m_asianFont->m_oPanose->GetValue();
oCurFont.m_nCharset = m_asianFont->m_oCharset.GetValue();
oCurFont.m_nPitch = m_asianFont->m_oPitchFamily.GetValue();
}
oParam.oRtf->m_oFontTable.AddItem( oCurFont );
}
}
return true;
}
private:
std::wstring GetThemeFont( std::wstring sTheme, OOXReader & oReader )
{
std::wstring sFont;
if ( L"majorAscii" == sTheme ) sFont = oReader.m_smajorAscii;
else if ( L"majorBidi" == sTheme ) sFont = oReader.m_smajorBidi;
else if ( L"majorEastAsia" == sTheme ) sFont = oReader.m_smajorEastAsia;
else if ( L"majorHAnsi" == sTheme ) sFont = oReader.m_smajorHAnsi;
else if ( L"minorAscii" == sTheme ) sFont = oReader.m_sminorAscii;
else if ( L"minorBidi" == sTheme ) sFont = oReader.m_sminorBidi;
else if ( L"minorEastAsia" == sTheme ) sFont = oReader.m_sminorEastAsia;
else if ( L"minorHAnsi" == sTheme ) sFont = oReader.m_sminorHAnsi;
return sFont;
}
};
......@@ -738,16 +738,20 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
}
else if (result == 2 && ooxDrawing->m_sXml.IsInit())
{
OOX::IFileContainer* store_container = oParam.oReader->m_currentContainer;
OOXDrawingGraphicConverter oGraphicConverter(*ooxDrawing->m_sXml);
OOX::Logic::CDrawing* ooxNewDrawing = oGraphicConverter.Convert( oParam, pNewDrawing );
//OOX::Logic::CPicture *ooxPicture = oGraphiceReader.Parse( oParam, pNewDrawing );
oParam.oReader->m_currentContainer = oGraphicConverter.m_ooxGraphicRels;
if (Parse(oParam , oOutputParagraph, poStyle, oNewProperty, ooxNewDrawing/*ooxPicture*/))
{
bAddDrawing = true;
}
//if (ooxPicture)delete ooxPicture;
if (ooxNewDrawing) delete ooxNewDrawing;
oParam.oReader->m_currentContainer = store_container;
}
if (!bAddDrawing)
{
......@@ -1685,37 +1689,35 @@ bool OOXpPrReader::ParseDrawing( ReaderParameter oParam, RtfParagraphProperty& o
&& m_drawingParaProps->m_oAfterSpacing->m_oLineSpacingPoints.IsInit()
&& m_drawingParaProps->m_oAfterSpacing->m_oLineSpacingPoints->m_oVal.IsInit())
oOutputProperty.m_nSpaceAfter = m_drawingParaProps->m_oAfterSpacing->m_oLineSpacingPoints->m_oVal->GetValue();
//
//if (m_drawingParaProps->m_oSpacing->m_oBeforeAutospacing.IsInit())
// oOutputProperty.m_nSpaceBeforeAuto = m_drawingParaProps->m_oSpacing->m_oBeforeAutospacing->ToBool();
//if (m_drawingParaProps->m_oSpacing->m_oAfterAutospacing.IsInit())
// oOutputProperty.m_nSpaceAfterAuto = m_drawingParaProps->m_oSpacing->m_oAfterAutospacing->ToBool();
//if (m_drawingParaProps->m_oSpacing->m_oBeforeLines.IsInit())
// oOutputProperty.m_nSpaceBeforeLine = m_drawingParaProps->m_oSpacing->m_oBeforeLines->GetValue();
//if (m_drawingParaProps->m_oSpacing->m_oAfterLines.IsInit())
// oOutputProperty.m_nSpaceAfterLine = m_drawingParaProps->m_oSpacing->m_oAfterLines->GetValue();
//if( m_drawingParaProps->m_oLineSpacing.IsInit())
//{
// if ( m_drawingParaProps->m_oSpacing->m_oLineRule.IsInit())
// {
// if (m_drawingParaProps->m_oSpacing->m_oLineRule->GetValue() == SimpleTypes::linespacingruleExact)
// {
// oOutputProperty.m_nSpaceBetween = - m_drawingParaProps->m_oSpacing->m_oLine->ToTwips();//twips ??? todooo
// oOutputProperty.m_nSpaceMultiLine = 0;
// }
// else if (m_drawingParaProps->m_oSpacing->m_oLineRule->GetValue() == SimpleTypes::linespacingruleAtLeast)
// {
// oOutputProperty.m_nSpaceBetween = m_drawingParaProps->m_oSpacing->m_oLine->ToTwips();
// oOutputProperty.m_nSpaceMultiLine = 0;
// }
// else //auto
// {
// oOutputProperty.m_nSpaceBetween = m_drawingParaProps->m_oSpacing->m_oLine->ToTwips();
// oOutputProperty.m_nSpaceMultiLine = 1;
// }
// }
//}
if (m_drawingParaProps->m_oBuChar.IsInit() || m_drawingParaProps->m_oBuAutoNum.IsInit())
{
oOutputProperty.m_nListLevel = 0;
oOutputProperty.m_nListId = oParam.oRtf->m_oListTable.GetCount() + 1;
RtfListProperty oNewList;
oNewList.m_nID = oOutputProperty.m_nListId;
oNewList.m_nListSimple = 1;
RtfListLevelProperty oNewLevel;
if (m_drawingParaProps->m_oBuChar.IsInit() && m_drawingParaProps->m_oBuChar->m_sChar.IsInit())
{
oNewLevel.m_sText = m_drawingParaProps->m_oBuChar->m_sChar.get();
oNewLevel.m_nNumberType = 23;
}
else if ( m_drawingParaProps->m_oBuAutoNum.IsInit() )
{
if (m_drawingParaProps->m_oBuAutoNum->m_sType.IsInit())
oNewLevel.m_nNumberType = oNewLevel.GetFormat( m_drawingParaProps->m_oBuAutoNum->m_sType.get());
else
oNewLevel.m_nNumberType = 0;
if (m_drawingParaProps->m_oBuAutoNum->m_nStartAt.IsInit())
oNewLevel.m_nStart = m_drawingParaProps->m_oBuAutoNum->m_nStartAt->GetValue();
}
oNewList.AddItem( oNewLevel );
oParam.oRtf->m_oListTable.AddItem( oNewList ); }
if (m_drawingParaProps->m_oRtl.IsInit())
oOutputProperty.m_bRtl = m_drawingParaProps->m_oRtl->ToBool() ? 1 : 0;
......@@ -1745,9 +1747,12 @@ bool OOXrPrReader::ParseDrawing( ReaderParameter oParam, RtfCharProperty& oOutpu
if (m_drawingRunProps->m_oItalic.IsInit())
oOutputProperty.m_bItalic = m_drawingRunProps->m_oItalic->ToBool() ? 1 : 0;
if( m_drawingRunProps->m_oLatinFont.IsInit() && m_drawingRunProps->m_oLatinFont->m_oTypeFace.IsInit())
if( m_drawingRunProps->m_oLatinFont.IsInit() || m_drawingRunProps->m_oComplexFont.IsInit() || m_drawingRunProps->m_oAsianFont.IsInit())
{
std::wstring font = m_drawingRunProps->m_oLatinFont->m_oTypeFace->GetValue();
OOXFontReader3 oFontReader3(m_drawingRunProps->m_oLatinFont.GetPointer(),
m_drawingRunProps->m_oAsianFont.GetPointer(),
m_drawingRunProps->m_oComplexFont.GetPointer());
oFontReader3.Parse( oParam, oOutputProperty.m_nFont);
}
//if (m_drawingRunProps->m_oComplexFont.IsInit() && m_drawingRunProps->m_oComplexFont->m_oTypeFace.IsInit())
// oOutputProperty.m_nComplexScript = m_drawingRunProps->m_oCs->m_oVal.ToBool() ? 1 : 0;;
......
......@@ -44,11 +44,12 @@ class OOXGraphicReader
{
private:
OOX::Drawing::CGraphic *m_ooxGraphic;
public:
OOXGraphicReader(OOX::Drawing::CGraphic *ooxGraphic)
{
m_ooxGraphic = ooxGraphic;
m_ooxGraphic = ooxGraphic;
}
int Parse( ReaderParameter oParam, RtfShapePtr & pOutput);
};
......@@ -1104,8 +1104,8 @@ bool OOXShapeReader::Parse( ReaderParameter oParam, RtfShapePtr& pOutput)
{
if (m_ooxShape->m_oSpPr->m_oXfrm->m_oOff.IsInit())
{
pOutput->m_nRelLeft = m_ooxShape->m_oSpPr->m_oXfrm->m_oOff->m_oX.ToEmu();
pOutput->m_nRelTop = m_ooxShape->m_oSpPr->m_oXfrm->m_oOff->m_oY.ToEmu();
pOutput->m_nRelLeft = (int)m_ooxShape->m_oSpPr->m_oXfrm->m_oOff->m_oX.ToEmu();
pOutput->m_nRelTop = (int)m_ooxShape->m_oSpPr->m_oXfrm->m_oOff->m_oY.ToEmu();
}
else
{
......@@ -1114,8 +1114,8 @@ bool OOXShapeReader::Parse( ReaderParameter oParam, RtfShapePtr& pOutput)
}
if (m_ooxShape->m_oSpPr->m_oXfrm->m_oExt.IsInit())
{
pOutput->m_nRelRight = pOutput->m_nRelLeft + m_ooxShape->m_oSpPr->m_oXfrm->m_oExt->m_oCx.GetValue();
pOutput->m_nRelBottom = pOutput->m_nRelTop + m_ooxShape->m_oSpPr->m_oXfrm->m_oExt->m_oCy.GetValue();
pOutput->m_nRelRight = (int)pOutput->m_nRelLeft + m_ooxShape->m_oSpPr->m_oXfrm->m_oExt->m_oCx.GetValue();
pOutput->m_nRelBottom = (int)pOutput->m_nRelTop + m_ooxShape->m_oSpPr->m_oXfrm->m_oExt->m_oCy.GetValue();
}
else
{
......@@ -1341,7 +1341,7 @@ bool OOXShapeReader::ParseVml( ReaderParameter oParam , RtfShapePtr& pOutput)
pOutput->m_nLineColor = (m_vmlElement->m_oStrokeColor->Get_B() << 16) + (m_vmlElement->m_oStrokeColor->Get_G() << 8) + m_vmlElement->m_oStrokeColor->Get_R();
if( m_vmlElement->m_oStrokeWeight.IsInit())
pOutput->m_nLineWidth = m_vmlElement->m_oStrokeWeight->ToEmu();
pOutput->m_nLineWidth = (int)m_vmlElement->m_oStrokeWeight->ToEmu();
if (m_vmlElement->m_oConnectorType.IsInit())
{
......@@ -1515,7 +1515,7 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapePtr& pOutput)
{
double rot = m_ooxGroup->m_oGroupSpPr->m_oXfrm->m_oRot.GetAngle();
if (rot > 0.01)
pOutput->m_nRotation = rot * 65535;
pOutput->m_nRotation = (int)(rot * 65535);
if (m_ooxGroup->m_oGroupSpPr->m_oXfrm->m_oFlipH.ToBool()) pOutput->m_bFlipH = 1;
if (m_ooxGroup->m_oGroupSpPr->m_oXfrm->m_oFlipV.ToBool()) pOutput->m_bFlipV = 1;
......@@ -1534,8 +1534,8 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapePtr& pOutput)
{
if (m_ooxGroup->m_oGroupSpPr->m_oXfrm->m_oOff.IsInit())
{
pOutput->m_nRelLeft = m_ooxGroup->m_oGroupSpPr->m_oXfrm->m_oOff->m_oX.ToEmu();
pOutput->m_nRelTop = m_ooxGroup->m_oGroupSpPr->m_oXfrm->m_oOff->m_oY.ToEmu();
pOutput->m_nRelLeft = (int)m_ooxGroup->m_oGroupSpPr->m_oXfrm->m_oOff->m_oX.ToEmu();
pOutput->m_nRelTop = (int)m_ooxGroup->m_oGroupSpPr->m_oXfrm->m_oOff->m_oY.ToEmu();
}
else
{
......@@ -1544,8 +1544,8 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapePtr& pOutput)
}
if (m_ooxGroup->m_oGroupSpPr->m_oXfrm->m_oExt.IsInit())
{
pOutput->m_nRelRight = pOutput->m_nRelLeft + m_ooxGroup->m_oGroupSpPr->m_oXfrm->m_oExt->m_oCx.GetValue();
pOutput->m_nRelBottom = pOutput->m_nRelTop + m_ooxGroup->m_oGroupSpPr->m_oXfrm->m_oExt->m_oCy.GetValue();
pOutput->m_nRelRight = (int)pOutput->m_nRelLeft + m_ooxGroup->m_oGroupSpPr->m_oXfrm->m_oExt->m_oCx.GetValue();
pOutput->m_nRelBottom = (int)pOutput->m_nRelTop + m_ooxGroup->m_oGroupSpPr->m_oXfrm->m_oExt->m_oCy.GetValue();
}
else
{
......@@ -1700,7 +1700,7 @@ bool OOXBackgroundReader::Parse( ReaderParameter oParam , RtfShapePtr& pOutput)
unsigned char opacity = m_ooxBackground->m_oColor->Get_A();
if (opacity != 0xff)
pOutput->m_nFillOpacity = opacity / 255. * 100;
pOutput->m_nFillOpacity = (int)(opacity / 255. * 100);
}
if (m_ooxBackground->m_oColor->GetValue() == SimpleTypes::colormodeAuto)
rtfColor.m_bAuto = true;
......@@ -1837,8 +1837,8 @@ bool OOXShapeReader::WriteDataToPicture( std::wstring sPath, RtfPicture& pOutput
meta.GetBounds(&dX, &dY, &dW, &dH);
meta.Close();
pOutput.m_nWidthGoal = dW * 15; //pixels to twip
pOutput.m_nHeightGoal = dH * 15; //pixels to twip;
pOutput.m_nWidthGoal = (int)(dW * 15); //pixels to twip
pOutput.m_nHeightGoal = (int)(dH * 15); //pixels to twip;
}
//Запоминаем только имя
pOutput.m_sPicFilename = sPath;
......
......@@ -443,29 +443,29 @@ namespace OOX
// HLinks
// TitlesOfParts
nullable<std::wstring> m_sApplication;
nullable<std::wstring> m_sAppVersion;
nullable<int> m_nCharacters;
nullable<int> m_nCharactersWithSpaces;
nullable<std::wstring> m_sCompany;
nullable<int> m_nDocSecurity;
nullable<int> m_nHiddenSlides;
nullable<std::wstring> m_sHyperlinkBase;
nullable<bool> m_bHyperlinksChanged;
nullable<int> m_nLines;
nullable<bool> m_bLinksUpToDate;
nullable<std::wstring> m_sManager;
nullable<int> m_nMMClips;
nullable<int> m_nNotes;
nullable<int> m_nPages;
nullable<int> m_nParagraphs;
nullable<std::wstring> m_sPresentationForm;
nullable<bool> m_bScaleCrop;
nullable<bool> m_bSharedDoc;
nullable<int> m_nSlides;
nullable<std::wstring> m_sTemplate;
nullable<int> m_nTotalTime;
nullable<int> m_nWords;
nullable<std::wstring> m_sApplication;
nullable<std::wstring> m_sAppVersion;
nullable<int> m_nCharacters;
nullable<int> m_nCharactersWithSpaces;
nullable<std::wstring> m_sCompany;
nullable<int> m_nDocSecurity;
nullable<int> m_nHiddenSlides;
nullable<std::wstring> m_sHyperlinkBase;
nullable<bool> m_bHyperlinksChanged;
nullable<int> m_nLines;
nullable<bool> m_bLinksUpToDate;
nullable<std::wstring> m_sManager;
nullable<int> m_nMMClips;
nullable<int> m_nNotes;
nullable<int> m_nPages;
nullable<int> m_nParagraphs;
nullable<std::wstring> m_sPresentationForm;
nullable<bool> m_bScaleCrop;
nullable<bool> m_bSharedDoc;
nullable<int> m_nSlides;
nullable<std::wstring> m_sTemplate;
nullable<int> m_nTotalTime;
nullable<int> m_nWords;
};
} // namespace OOX
......
......@@ -329,11 +329,11 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -389,10 +389,10 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -408,7 +408,7 @@ namespace OOX
m_oRunProperty = oReader;
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
return _T("");
}
......@@ -429,6 +429,98 @@ namespace OOX
nullable<CRunProperty> m_oRunProperty;
};
//--------------------------------------------------------------------------------
class CBulletAutoNum : public WritingElement
{
public:
WritingElement_AdditionConstructors(CBulletAutoNum)
CBulletAutoNum()
{
}
virtual ~CBulletAutoNum()
{
}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
}
virtual std::wstring toXML() const
{
return _T("");
}
virtual EElementType getType() const
{
return et_a_buChar;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start ( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"startAt", m_nStartAt)
WritingElement_ReadAttributes_Read_else_if( oReader, L"type", m_sType)
WritingElement_ReadAttributes_End ( oReader )
}
public:
nullable<SimpleTypes::CDecimalNumber<>> m_nStartAt;
nullable<std::wstring> m_sType; //временно .. потом на тип переделать
};
class CBulletChar : public WritingElement
{
public:
WritingElement_AdditionConstructors(CBulletChar)
CBulletChar()
{
}
virtual ~CBulletChar()
{
}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
}
virtual std::wstring toXML() const
{
return _T("");
}
virtual EElementType getType() const
{
return et_a_buAutoNum;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle ( oReader, L"char", m_sChar)
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<std::wstring> m_sChar;
};
// 21.1.2.2.7 pPr (Text Paragraph Properties)
//--------------------------------------------------------------------------------
class CParagraphProperty : public WritingElement
......@@ -444,12 +536,12 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -471,6 +563,16 @@ namespace OOX
m_oAfterSpacing = oReader;
else if ( _T("a:spcBef") == sName )
m_oBeforeSpacing = oReader;
else if ( _T("a:buBlip") == sName )
m_oBuBlip = oReader;
else if ( _T("a:buChar") == sName )
m_oBuChar = oReader;
else if ( _T("a:buAutoNum") == sName )
m_oBuAutoNum = oReader;
else if ( _T("a:buClr") == sName )
m_oBuClr = oReader;
else if ( _T("a:buFont") == sName )
m_oBuFont = oReader;
}
}
virtual std::wstring toXML() const
......@@ -518,12 +620,12 @@ namespace OOX
nullable<CLineSpacing> m_oBeforeSpacing;
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
//buAutoNum //(Auto-Numbered Bullet) §21.1.2.4.1
//buBlip //(Picture Bullet) §21.1.2.4.2
//buChar //(Character Bullet) §21.1.2.4.3
//buClr //(Color Specified) §21.1.2.4.4
nullable<OOX::Drawing::CBlipFillProperties> m_oBuBlip;
nullable<OOX::Drawing::CBulletChar> m_oBuChar;
nullable<OOX::Drawing::CBulletAutoNum> m_oBuAutoNum;
nullable<OOX::Drawing::CSolidColorFillProperties> m_oBuClr;
nullable<OOX::Drawing::CTextFont> m_oBuFont;
//buClrTx //(Follow Text) §21.1.2.4.5
//buFont //(Specified) §21.1.2.4.6
//buFontTx //(Follow text) §21.1.2.4.7
//buNone //(No Bullet) §21.1.2.4.8
//buSzPct //(Bullet Size Percentage) §21.1.2.4.9
......@@ -548,12 +650,12 @@ namespace OOX
}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......
......@@ -56,10 +56,10 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -109,10 +109,10 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......
......@@ -60,12 +60,12 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
m_eType = et_Unknown;
// TO DO: Реализовать CTextFont::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
m_eType = et_Unknown;
std::wstring sName = oReader.GetName();
......@@ -85,7 +85,7 @@ namespace OOX
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult;
......
......@@ -188,14 +188,14 @@ namespace OOX
public:
std::wstring m_sName;
std::wstring m_sName;
nullable<SimpleTypes::CFontCharset<SimpleTypes::fontcharsetANSI>> m_oCharset;
nullable<SimpleTypes::CFontFamily<SimpleTypes::fontfamilyAuto>> m_oFamily;
nullable<SimpleTypes::CPitch<SimpleTypes::pitchDefault>> m_oPitch;
nullable<std::wstring > m_oAltName;
nullable<SimpleTypes::COnOff<> > m_oNotTrueType;
nullable<SimpleTypes::CPanose > m_oPanose;
nullable<std::wstring> m_oAltName;
nullable<SimpleTypes::COnOff<>> m_oNotTrueType;
nullable<SimpleTypes::CPanose > m_oPanose;
nullable<SimpleTypes::CLongHexNumber<>> m_oCsb0;
nullable<SimpleTypes::CLongHexNumber<>> m_oCsb1;
......
......@@ -64,16 +64,16 @@ namespace OOX
std::map<std::wstring, smart_ptr<OOX::File>> m_mContainer;
size_t m_lMaxRid;
void Read (const OOX::CPath& oRootPath, const OOX::CPath& oPath);
void Read (const OOX::CRels& oRels, const OOX::CPath& oRootPath, const CPath& oPath);
void Write(const OOX::CPath& oFileName, const CPath& oDir, OOX::CContentTypes& oContent) const;
void Write(OOX::CRels& oRels, const CPath& oCurrent, const CPath& oDir, OOX::CContentTypes& oContent) const;
void Write (const OOX::CPath& oFileName, const CPath& oDir, OOX::CContentTypes& oContent) const;
void Write (OOX::CRels& oRels, const CPath& oCurrent, const CPath& oDir, OOX::CContentTypes& oContent) const;
void Commit (const CPath& oPath);
void Commit (const CPath& oPath);
void Finalize(const CPath& oFilefilename, const CPath& oDir, OOX::CContentTypes& oContent);
void Finalize(OOX::CRels& oRels, const CPath& oCurrent, const CPath& oDir, OOX::CContentTypes& oContent);
public:
void Read (const OOX::CPath& oRootPath, const OOX::CPath& oPath);
void ExtractPictures(const OOX::CPath& oPath) const;
virtual smart_ptr<Image> GetImage (const RId& rId) const;
......
......@@ -153,8 +153,8 @@ namespace ComplexTypes
public:
nullable<SimpleTypes::COnOff<> > m_oNull;
nullable<std::wstring > m_sVal;
nullable< SimpleTypes::COnOff<> > m_oNull;
nullable< std::wstring > m_sVal;
};
//--------------------------------------------------------------------------------
......
......@@ -361,6 +361,8 @@ namespace OOX
et_a_spcAft, // <a:spcAft>
et_a_spcBef, // <a:spcBef>
et_a_lnSpc, // <a:lnSpc>
et_a_buChar,
et_a_buAutoNum,
et_ds_schemaRef, // <ds:shemeRef>
et_ds_schemaRefs, // <ds:schemaRefs>
......
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