Commit 80c4a651 authored by ElenaSubbotina's avatar ElenaSubbotina

PptxFormat- fix convert oox drawing to vml drawing

RtfFormatWriter - convert oox drawing, convert smart art objects
parent 4fda6101
......@@ -23,9 +23,9 @@ DEFINES += UNICODE \
_UNICODE \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
USE_ATL_CSTRING \
_USE_LIBXML2_READER_ \
LIBXML_READER_ENABLED
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS \
INCLUDEPATH += \
../../../DesktopEditor/freetype-2.5.2/include \
......
......@@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;USE_ATL_CSTRINGS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......
......@@ -16,15 +16,15 @@ include($$PWD/../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE \
_UNICODE \
NODOCX \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
USE_ATL_CSTRING \
USE_AVSOFFICESTUDIO_XMLUTILS \
SOLUTION_ASCOFFICEDOCXFILE2 \
#DISABLE_FILE_DOWNLOADER \
_USE_LIBXML2_READER_ \
LIBXML_READER_ENABLED
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS
INCLUDEPATH += \
../../DesktopEditor/freetype-2.5.2/include \
......
......@@ -24,7 +24,8 @@ DEFINES += UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
LIBXML_READER_ENABLED
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS
INCLUDEPATH += ../../DesktopEditor/freetype-2.5.2/include
INCLUDEPATH += ../../ASCOfficeOdfFile/include
......
......@@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../ASCOfficeOdfFile/include;../../../ASCOfficeOdfFile/src/odf/datatypes"
PreprocessorDefinitions="NDEBUG;_LIB;_USE_XMLLITE_READER_;USE_LITE_READER;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;BUILD_CONFIG_FULL_VERSION;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="NDEBUG;_LIB;_USE_XMLLITE_READER_;USE_LITE_READER;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......
......@@ -21,7 +21,6 @@ include($$PWD/../../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE \
_UNICODE \
USE_ATL_CSTRING \
PPTX_DEF \
PPT_DEF \
ENABLE_PPT_TO_PPTX_CONVERT \
......@@ -31,7 +30,6 @@ DEFINES += UNICODE \
_USE_XMLLITE_READER_ \
_PRESENTATION_WRITER_ \
_SVG_CONVERT_TO_IMAGE_ \
BUILD_CONFIG_FULL_VERSION \
DONT_WRITE_EMBEDDED_FONTS
#DISABLE_FILE_DOWNLOADER
......
......@@ -56,7 +56,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""../../../DesktopEditor/freetype-2.5.2/include""
PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......
......@@ -172,7 +172,6 @@ namespace NSBinPptxRW
PPTX::WrapperWritingElement* m_pElement;
CElementProps* m_pProps;
public:
CElement();
~CElement();
......@@ -207,35 +206,37 @@ namespace NSBinPptxRW
~CDrawingConverter();
HRESULT SetMainDocument (BinDocxRW::CDocxSerializer* pDocument);
HRESULT SetRelsPath (const std::wstring& bsRelsPath);
HRESULT SetRelsPath (const std::wstring& sRelsPath);
std::wstring GetRelsPath ();
HRESULT SetMediaDstPath (const std::wstring& bsMediaPath);
HRESULT SetEmbedDstPath (const std::wstring& bsEmbedPath);
HRESULT SetMediaDstPath (const std::wstring& sMediaPath);
HRESULT SetEmbedDstPath (const std::wstring& sEmbedPath);
HRESULT AddShapeType (const std::wstring& bsXml);
HRESULT AddObject (const std::wstring& bsXml, std::wstring** pMainProps);
HRESULT GetThemeBinary (BYTE** ppBinary, long& lBinarySize, const std::wstring& bsThemeFilePath);
HRESULT AddShapeType (const std::wstring& sXml);
HRESULT AddObject (const std::wstring& sXml, std::wstring** pMainProps);
HRESULT GetThemeBinary (BYTE** ppBinary, long& lBinarySize, const std::wstring& sThemeFilePath);
HRESULT SaveThemeXml (long lStart, long lLength, const std::wstring& bsThemePath);
HRESULT SaveObject (long lStart, long lLength, const std::wstring& bsMainProps, std::wstring & sXml);
HRESULT SaveObjectEx (long lStart, long lLength, const std::wstring& bsMainProps, long lDocType, std::wstring & sXml);
HRESULT SaveThemeXml (long lStart, long lLength, const std::wstring& sThemePath);
HRESULT SaveObject (long lStart, long lLength, const std::wstring& sMainProps, std::wstring & sXml);
HRESULT SaveObjectEx (long lStart, long lLength, const std::wstring& sMainProps, long lDocType, std::wstring & sXml);
void SaveObjectExWriterInit (NSBinPptxRW::CXmlWriter& oXmlWriter, LONG lDocType);
void SaveObjectExWriterRelease (NSBinPptxRW::CXmlWriter& oXmlWriter);
std::wstring ConvertObjectToVml (const std::wstring& sXml);
std::wstring SaveObjectBackground(LONG lStart, LONG lLength);
HRESULT GetRecordBinary (long lRecordType, const std::wstring& bsXml);
HRESULT GetRecordBinary (long lRecordType, const std::wstring& sXml);
HRESULT GetRecordXml (long lStart, long lLength, long lRecType, long lDocType, std::wstring & sXml);
HRESULT SetDstContentRels ();
HRESULT SaveDstContentRels (const std::wstring& bsRelsPath);
HRESULT WriteRels (const std::wstring& bsType, const std::wstring& bsTarget, const std::wstring& bsTargetMode, long* lId);
HRESULT LoadClrMap (const std::wstring& bsXml);
HRESULT SaveDstContentRels (const std::wstring& sRelsPath);
HRESULT WriteRels (const std::wstring& sType, const std::wstring& sTarget, const std::wstring& sTargetMode, long* lId);
HRESULT LoadClrMap (const std::wstring& sXml);
HRESULT(GetTxBodyBinary) (const std::wstring& bsXml);
HRESULT(GetTxBodyBinary) (const std::wstring& sXml);
HRESULT(GetTxBodyXml) (long lStart, std::wstring & Xml);
HRESULT(SetFontDir) (const std::wstring& bsFontDir);
HRESULT(SetFontDir) (const std::wstring& sFontDir);
HRESULT SetFontPicker (COfficeFontPicker* pFontPicker);
......@@ -274,10 +275,10 @@ namespace NSBinPptxRW
void LoadCoordSize (XmlUtils::CXmlNode& oNode, ::CShape* pShape);
std::wstring GetDrawingMainProps (XmlUtils::CXmlNode& oNode, PPTX::CCSS& oCssStyles, CSpTreeElemProps& oProps);
void ConvertMainPropsToVML (const std::wstring& bsMainProps, NSBinPptxRW::CXmlWriter& oWriter, PPTX::Logic::SpTreeElem& oElem);
void ConvertPicVML (PPTX::Logic::SpTreeElem& oElem, const std::wstring& bsMainProps, NSBinPptxRW::CXmlWriter& oWriter);
void ConvertShapeVML (PPTX::Logic::SpTreeElem& oShape, const std::wstring& bsMainProps, NSBinPptxRW::CXmlWriter& oWriter);
void ConvertGroupVML (PPTX::Logic::SpTreeElem& oGroup, const std::wstring& bsMainProps, NSBinPptxRW::CXmlWriter& oWriter);
void ConvertMainPropsToVML (const std::wstring& sMainProps, NSBinPptxRW::CXmlWriter& oWriter, PPTX::Logic::SpTreeElem& oElem);
void ConvertPicVML (PPTX::Logic::SpTreeElem& oElem, const std::wstring& sMainProps, NSBinPptxRW::CXmlWriter& oWriter);
void ConvertShapeVML (PPTX::Logic::SpTreeElem& oShape, const std::wstring& sMainProps, NSBinPptxRW::CXmlWriter& oWriter);
void ConvertGroupVML (PPTX::Logic::SpTreeElem& oGroup, const std::wstring& sMainProps, NSBinPptxRW::CXmlWriter& oWriter);
void ConvertTextVML (XmlUtils::CXmlNode &nodeTextBox, PPTX::Logic::Shape* pShape);
......
......@@ -53,10 +53,10 @@ namespace NSPresentationEditor
CHandle_& operator =(const CHandle_& oSrc)
{
position = oSrc.position;
xrange = oSrc.xrange;
yrange = oSrc.yrange;
xrange = oSrc.xrange;
yrange = oSrc.yrange;
switchHandle = oSrc.switchHandle;
polar = oSrc.polar;
polar = oSrc.polar;
radiusrange = oSrc.radiusrange;
return (*this);
}
......@@ -65,27 +65,27 @@ namespace NSPresentationEditor
class CBaseShape
{
public:
std::vector<long> m_arAdjustments;
std::vector<double> m_arGuides;
LONG m_eJoin;
bool m_bConcentricFill;
bool m_bCustomShape;
std::vector<long> m_arAdjustments;
std::vector<double> m_arGuides;
LONG m_eJoin;
bool m_bConcentricFill;
bool m_bCustomShape;
std::vector<SimpleTypes::CPoint> m_arConnectors;
std::vector<LONG> m_arConnectorAngles;
std::vector<LONG> m_arConnectorAngles;
std::vector<Aggplus::RECT> m_arTextRects;
std::vector<Aggplus::RECT> m_arTextRects;
std::vector<CHandle_> m_arHandles;
std::vector<CHandle_> m_arHandles;
std::wstring m_strTransformXml;
std::wstring m_strTransformXml;
std::wstring m_strPath;
std::wstring m_strRect;
std::wstring m_strPath;
std::wstring m_strRect;
LONG m_lLimoX;
LONG m_lLimoY;
LONG m_lLimoX;
LONG m_lLimoY;
CPath m_oPath;
CPath m_oPath;
CBaseShape()
{
......@@ -94,14 +94,14 @@ namespace NSPresentationEditor
virtual bool LoadFromXML(const std::wstring& xml) = 0;
virtual bool LoadFromXML(XmlUtils::CXmlNode& xmlNode) = 0;
virtual bool LoadAdjustValuesList(const std::wstring& xml) = 0;
virtual bool LoadAdjustValuesList(const std::wstring& xml) = 0;
virtual bool LoadGuidesList(const std::wstring& xml) = 0;
virtual bool LoadAdjustHandlesList(const std::wstring& xml) = 0;
virtual bool LoadConnectorsList(const std::wstring& xml) = 0;
virtual bool LoadTextRect(const std::wstring& xml) = 0;
virtual bool LoadPathList(const std::wstring& xml) = 0;
virtual bool SetAdjustment(long index, long value) = 0;
virtual void ReCalculate() = 0;
virtual bool LoadAdjustHandlesList(const std::wstring& xml) = 0;
virtual bool LoadConnectorsList(const std::wstring& xml) = 0;
virtual bool LoadTextRect(const std::wstring& xml) = 0;
virtual bool LoadPathList(const std::wstring& xml) = 0;
virtual bool SetAdjustment(long index, long value) = 0;
virtual void ReCalculate() = 0;
virtual std::wstring ToXML(CGeomShapeInfo& GeomInfo, CMetricInfo& MetricInfo, double StartTime, double EndTime, CBrush& Brush, CPen& Pen) = 0;
virtual void ToRenderer(IRenderer* pRenderer, CGeomShapeInfo& pGeomInfo, double dStartTime, double dEndTime, CPen& pPen, CBrush& pFore, CMetricInfo& pInfo)
......
......@@ -42,7 +42,7 @@
double NSGuidesOOXML::CFormula::Calculate(NSGuidesOOXML::CFormulaManager* pManager)
{
if ((0 == m_lIndex) || (-m_lIndex > pManager->Guides->size()) || (m_lIndex > pManager->Adjustments->size()))
if ((0 == m_lIndex) || (-m_lIndex > (int)pManager->Guides->size()) || (m_lIndex > (int)pManager->Adjustments->size()))
return 0.0;
if((m_lIndex < 0) && (dNonDefResult > (*pManager->Guides)[-m_lIndex-1]))
return (*pManager->Guides)[-m_lIndex-1];
......
......@@ -508,7 +508,8 @@ public:
}
static CPPTXShape* CreateByType(OOXMLShapes::ShapeType type);
virtual const ClassType GetClassType()const
virtual const ClassType GetClassType()const
{
return NSBaseShape::pptx;
}
......
......@@ -67,7 +67,6 @@ public:
CTextAttributesEx m_oText;
double m_dWidthLogic;
double m_dHeightLogic;
......@@ -81,7 +80,7 @@ public:
CBaseShape* m_pShape;
std::wstring m_strPPTXShape;
std::wstring m_strPPTXShape;
public:
CShape(NSBaseShape::ClassType ClassType, int ShapeType_) : m_rcBounds()
{
......
......@@ -175,7 +175,7 @@ namespace NSFontCutter
template<typename T>
void WriteEmbeddedFonts(T* pWriter)
{
#if defined(BUILD_CONFIG_FULL_VERSION) && !defined(DONT_WRITE_EMBEDDED_FONTS)
#if !defined(DONT_WRITE_EMBEDDED_FONTS)
ULONG nCount = 0;
for(std::map<std::wstring, CEmbeddedFontInfo>::iterator pPair = m_mapFontsEmbeddded.begin(); pPair != m_mapFontsEmbeddded.end(); ++pPair)
......@@ -338,7 +338,7 @@ namespace NSFontCutter
delete [] pArrayUnicodes;
RELEASEINTERFACE(pFontConverter);
#endif // #if defined(BUILD_CONFIG_FULL_VERSION) && !defined(DONT_WRITE_EMBEDDED_FONTS)
#endif // #if !defined(DONT_WRITE_EMBEDDED_FONTS)
}
bool GenerateSafearray(USHORT **ppArray, size_t& nCount)
......@@ -373,7 +373,7 @@ namespace NSFontCutter
return true;
}
#if defined(BUILD_CONFIG_FULL_VERSION) && !defined(DONT_WRITE_EMBEDDED_FONTS)
#if !defined(DONT_WRITE_EMBEDDED_FONTS)
void WriteFont(std::wstring& strName, LONG& lFaceIndex, std::wstring& strFontPath, CFile* pFile, USHORT* pArrayUnicodes, size_t pArrayUnicodesLength, Fonts::IFontConverter* pFontConverter)
{
LONG lFontConverterFlag = 16; // truetype only
......@@ -415,7 +415,7 @@ namespace NSFontCutter
RELEASEARRAY(pArrayData);
}
#endif // #if defined(BUILD_CONFIG_FULL_VERSION) && !defined(DONT_WRITE_EMBEDDED_FONTS)
#endif // #if !defined(DONT_WRITE_EMBEDDED_FONTS)
};
}
......
......@@ -40,12 +40,12 @@ namespace PPTX
{
void Geometry::ConvertToCustomVML(IRenderer* pOOXToVMLRenderer, std::wstring& strPath, std::wstring& strRect, LONG& lWidth, LONG& lHeight)
{
#ifdef AVS_USE_CONVERT_PPTX_TOCUSTOM_VML
if (!pOOXToVMLRenderer) return;
NSPresentationEditor::CShapeElement* lpShapeElement = NULL;
if (this->is<PPTX::Logic::PrstGeom>())
{
const PPTX::Logic::PrstGeom lpGeom = this->as<PPTX::Logic::PrstGeom>();
const PPTX::Logic::PrstGeom & lpGeom = this->as<PPTX::Logic::PrstGeom>();
OOXMLShapes::ShapeType _lspt = PPTX2EditorAdvanced::GetShapeTypeFromStr(lpGeom.prst.get());
if(_lspt == OOXMLShapes::sptNil)
......@@ -57,7 +57,7 @@ namespace PPTX
}
else if (this->is<PPTX::Logic::CustGeom>())
{
const PPTX::Logic::CustGeom lpGeom = this->as<PPTX::Logic::CustGeom>();
const PPTX::Logic::CustGeom & lpGeom = this->as<PPTX::Logic::CustGeom>();
std::wstring strShape = lpGeom.GetODString();
lpShapeElement = new NSPresentationEditor::CShapeElement(strShape);
}
......@@ -130,7 +130,6 @@ namespace PPTX
std::to_wstring((int)(dkoefX * txRect.right)) + L"," +
std::to_wstring((int)(dkoefY * txRect.bottom));
}
#endif
}
}
}
......
......@@ -577,20 +577,20 @@ namespace PPTX
if (spPr.xfrm.is_init())
{
if (spPr.xfrm->offX.is_init())
dL = (*spPr.xfrm->offX);
dL = (*spPr.xfrm->offX) / 12700.;
if (spPr.xfrm->offY.is_init())
dT = (*spPr.xfrm->offY);
dT = (*spPr.xfrm->offY) / 12700.;
if (spPr.xfrm->extX.is_init())
dW = (*spPr.xfrm->extX);
dW = (*spPr.xfrm->extX) / 12700.;
if (spPr.xfrm->extY.is_init())
dH = (*spPr.xfrm->extY);
dH = (*spPr.xfrm->extY) / 12700.;
}
oStylesWriter.WriteAttributeCSS (_T("position"), _T("absolute"));
oStylesWriter.WriteAttributeCSS_int (_T("left"), dL);
oStylesWriter.WriteAttributeCSS_int (_T("top"), dT);
oStylesWriter.WriteAttributeCSS_int (_T("width"), dW);
oStylesWriter.WriteAttributeCSS_int (_T("height"), dH);
oStylesWriter.WriteAttributeCSS (_T("position"), _T("absolute"));
oStylesWriter.WriteAttributeCSS_int_pt (_T("left"), dL);
oStylesWriter.WriteAttributeCSS_int_pt (_T("top"), dT);
oStylesWriter.WriteAttributeCSS_int_pt (_T("width"), dW);
oStylesWriter.WriteAttributeCSS_int_pt (_T("height"), dH);
}
if (spPr.xfrm.is_init())
......@@ -629,9 +629,7 @@ namespace PPTX
lH = spPr.xfrm->extY.get_value_or(43200);
}
#ifdef AVS_USE_CONVERT_PPTX_TOCUSTOM_VML
spPr.Geometry.ConvertToCustomVML(pWriter->m_pOOXToVMLRenderer, strPath, strTextRect, lW, lH);
#endif
pWriter->StartNode(_T("v:shape"));
......
......@@ -57,7 +57,8 @@ namespace PPTX
pWriter->WriteAttribute(L"o:spid", strSpid);
NSBinPptxRW::CXmlWriter oStylesWriter;
if (_T("") != pWriter->m_strStyleMain)
if (!pWriter->m_strStyleMain.empty())
{
if (grpSpPr.xfrm.is_init())
{
......@@ -101,21 +102,21 @@ namespace PPTX
if (grpSpPr.xfrm.is_init())
{
if (grpSpPr.xfrm->offX.is_init())
dL = (*grpSpPr.xfrm->offX);
dL = (*grpSpPr.xfrm->offX) / 12700.;
if (grpSpPr.xfrm->offY.is_init())
dT = (*grpSpPr.xfrm->offY);
dT = (*grpSpPr.xfrm->offY) / 12700.;
if (grpSpPr.xfrm->extX.is_init())
dW = (*grpSpPr.xfrm->extX);
dW = (*grpSpPr.xfrm->extX) / 12700.;
if (grpSpPr.xfrm->extY.is_init())
dH = (*grpSpPr.xfrm->extY);
dH = (*grpSpPr.xfrm->extY) / 12700.;
}
oStylesWriter.ClearNoAttack();
oStylesWriter.WriteAttributeCSS(_T("position"), _T("absolute"));
oStylesWriter.WriteAttributeCSS_int(_T("left"), dL);
oStylesWriter.WriteAttributeCSS_int(_T("top"), dT);
oStylesWriter.WriteAttributeCSS_int(_T("width"), dW);
oStylesWriter.WriteAttributeCSS_int(_T("height"), dH);
oStylesWriter.WriteAttributeCSS(L"position", L"absolute");
oStylesWriter.WriteAttributeCSS_int_pt(L"left", dL);
oStylesWriter.WriteAttributeCSS_int_pt(L"top", dT);
oStylesWriter.WriteAttributeCSS_int_pt(L"width", dW);
oStylesWriter.WriteAttributeCSS_int_pt(L"height", dH);
if (grpSpPr.xfrm.is_init())
{
......@@ -156,13 +157,13 @@ namespace PPTX
if (grpSpPr.xfrm.is_init())
{
if (grpSpPr.xfrm->chOffX.is_init())
dL = (*grpSpPr.xfrm->chOffX);
dL = (*grpSpPr.xfrm->chOffX) / 12700.;
if (grpSpPr.xfrm->chOffY.is_init())
dT = (*grpSpPr.xfrm->chOffY);
dT = (*grpSpPr.xfrm->chOffY) / 12700.;
if (grpSpPr.xfrm->chExtX.is_init())
dW = (*grpSpPr.xfrm->chExtX);
dW = (*grpSpPr.xfrm->chExtX) / 12700.;
if (grpSpPr.xfrm->chExtY.is_init())
dH = (*grpSpPr.xfrm->chExtY);
dH = (*grpSpPr.xfrm->chExtY) / 12700.;
}
oStylesWriter.ClearNoAttack();
oStylesWriter.m_oWriter.AddSize(30);
......
......@@ -135,7 +135,7 @@ namespace PPTX
BYTE A = (BYTE)((ARGB >> 24) & 0xFF);
if (A != 255)
{
int fopacity = (int)(((double)A / 255.0) * 65536);
int fopacity = 100 - (int)(((double)A / 255.0) * 65536);
strNode = _T("<v:fill opacity=\"") + std::to_wstring(fopacity) + _T("f\" />");
}
}
......@@ -150,7 +150,7 @@ namespace PPTX
BYTE A = (BYTE)((ARGB >> 24) & 0xFF);
if (A != 255)
{
int fopacity = (int)(((double)A / 255.0) * 65536);
int fopacity = 100 - (int)(((double)A / 255.0) * 65536);
strNode = _T("<v:fill opacity=\"") + std::to_wstring(fopacity) + _T("f\" />");
}
}
......
......@@ -32,10 +32,8 @@ DEFINES += UNICODE \
PPT_DEF\
ENABLE_PPT_TO_PPTX_CONVERT \
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML \
NODOCX \
#DISABLE_FILE_DOWNLOADER \
CXIMAGE_DONT_DECLARE_TCHAR \
BUILD_CONFIG_FULL_VERSION \
DONT_WRITE_EMBEDDED_FONTS \
CXIMAGE_DONT_DECLARE_TCHAR \
LIBXML_READER_ENABLED
......
......@@ -45,7 +45,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\Common\ASCDocxFormat\Source\Utility;..\..\Common\ASCDocxFormat\Source\XML;..\..\Common\ASCDocxFormat\Source\;.\;..\..\Common\DocxFormat\Source\XML\libxml2\XML\include;&quot;../../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_MATH_DEFINES;NODOCX;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;_AVS_PPT_SHAPE_INCLUDE_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;BUILD_CONFIG_FULL_VERSION;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_MATH_DEFINES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......@@ -663,26 +663,6 @@
RelativePath="..\..\Common\DocxFormat\Source\SystemUtility\SystemUtility.h"
>
</File>
<Filter
Name="System"
>
<File
RelativePath="..\.\Directory.h"
>
</File>
<File
RelativePath="..\.\File.cpp"
>
</File>
<File
RelativePath="..\.\File.h"
>
</File>
<File
RelativePath="..\.\Settings.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="ContentTypes"
......@@ -715,6 +695,22 @@
<Filter
Name="Core"
>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\baseshape.h"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTShape\pptshape.h"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTXShape\PPTXShape.h"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\shape.h"
>
</File>
</Filter>
<Filter
Name="HandoutMasters"
......
......@@ -19,7 +19,15 @@ include(../../../Common/base.pri)
#BOOST
include($$PWD/../../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE _UNICODE _USE_LIBXML2_READER_ _USE_XMLLITE_READER_ USE_LITE_READER LIBXML_READER_ENABLED PPT_DEF
DEFINES += UNICODE _UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
LIBXML_READER_ENABLED \
PPTX_DEF\
PPT_DEF\
DONT_WRITE_EMBEDDED_FONTS \
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML
INCLUDEPATH += \
......
......@@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;PPT_DEF;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......@@ -368,6 +368,10 @@
RelativePath="..\source\Reader\OOXDrawingGraphicReader.cpp"
>
</File>
<File
RelativePath="..\source\Reader\OOXDrawingGraphicReader.h"
>
</File>
<File
RelativePath="..\source\Reader\OOXPictureAnchorReader.h"
>
......
......@@ -1284,7 +1284,7 @@ public:
}
else
{
strProp = boost::lexical_cast<std::wstring>( parameter);
strProp = std::to_wstring( parameter);
}
return strProp;
......
......@@ -73,12 +73,12 @@ public:
std::wstring Generate_rId()
{
return L"rId" + boost::lexical_cast<std::wstring>(m_nrIdCount++);
return L"rId" + std::to_wstring(m_nrIdCount++);
}
std::wstring Generate_FitTextId()
{
return boost::lexical_cast<std::wstring>(m_nFitTextIdCount++);
return std::to_wstring(m_nFitTextIdCount++);
}
int Generate_ImageIndex()
......@@ -124,7 +124,7 @@ public:
std::wstring Generate_OleId()
{
std::wstring sId = boost::lexical_cast<std::wstring>(m_nOleId++);
std::wstring sId = std::to_wstring(m_nOleId++);
std::wstring sResult = L"_1330071130";
sResult = sResult.substr(0, sResult.length() - sId.length() );
......
......@@ -31,6 +31,9 @@
*/
#include "OOXPictureGraphicReader.h"
#include "OOXDrawingGraphicReader.h"
#include "../../../../ASCOfficePPTXFile/ASCOfficeDrawingConverter.h"
bool OOXPictureGraphicReader::Parse( ReaderParameter oParam , RtfShape& oOutput)
{
......@@ -79,27 +82,51 @@ bool OOXPictureGraphicReader::Parse( ReaderParameter oParam , RtfShape& oOutput)
}
}
}
if (!bTryPicture)
{
//рисуем "крест" (todooo получать с редактора реплейсмент картинку)
oOutput.m_nShapeType = 1;
oOutput.m_bFilled = 0;
oOutput.m_bLine = 1;
oOutput.m_aTextItems = TextItemContainerPtr( new TextItemContainer() );
RtfParagraphPtr oParagraph ( new RtfParagraph() );
return bTryPicture;
}
OOX::Logic::CPicture * OOXDrawingGraphicReader::Parse( ReaderParameter oParam , RtfShape& oOutput)
{
NSBinPptxRW::CDrawingConverter drawingConverter;
drawingConverter.SetRelsPath(oParam.oDocx->m_pDocument->m_oReadPath.GetPath());
std::wstring sVmlXml = drawingConverter.ConvertObjectToVml(m_sXml);
if (sVmlXml.empty())return NULL;
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>");
oParagraph->m_oProperty = oParam.oRtf->m_oDefaultParagraphProp;
oParagraph->m_oProperty.m_oCharProperty = oParam.oRtf->m_oDefaultCharProp;
oParagraph->m_oProperty.m_nItap = 0;
RtfCharPtr oChar ( new RtfChar() );
oChar->m_oProperty = oParam.oRtf->m_oDefaultCharProp;
oChar->setText( L"The element is not supported in RTF format." );
oParagraph->AddItem( oChar );
oOutput.m_aTextItems->AddItem( oParagraph );
std::wstring strXml = sBegin + sVmlXml + sEnd;
//XmlUtils::CXmlNode oMainNode;
//if (!oMainNode.FromXmlString(strXml))
// return NULL;
//XmlUtils::CXmlNode pictNode = oMainNode.ReadNodeNoNS(L"pict");
//if (pictNode.IsValid())
// return new OOX::Logic::CPicture(pictNode);
//else
// return NULL;
XmlUtils::CXmlLiteReader oSubReader;
if (oSubReader.FromString(strXml) == false) return NULL;
oSubReader.ReadNextNode();
OOX::Logic::CPicture *pPict = NULL;
int nStylesDepth1 = oSubReader.GetDepth();
while ( oSubReader.ReadNextSiblingNode( nStylesDepth1 ) )
{
std::wstring sName = oSubReader.GetName();
if (sName == L"w:pict")
{
pPict= new OOX::Logic::CPicture(oSubReader);
break;
}
}
return true;
return pPict;
}
......@@ -457,7 +457,7 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
rtfMath->m_bIsVal = true;
RtfCharPtr oChar = RtfCharPtr(new RtfChar);
oChar->setText( boost::lexical_cast<std::wstring>(oFont.m_nID) );
oChar->setText( std::to_wstring(oFont.m_nID) );
rtfMath->m_oVal.AddItem( oChar );
}
}
......
......@@ -697,14 +697,33 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
}break;
case OOX::et_w_drawing:
{
bool bAddDrawing = false;
OOX::Logic::CDrawing* ooxDrawing = dynamic_cast<OOX::Logic::CDrawing*>(ooxItem);
RtfShapePtr pNewPicture ( new RtfShape() );
pNewPicture->m_oCharProperty = oNewProperty;
RtfShapePtr pNewDrawing ( new RtfShape() );
pNewDrawing->m_oCharProperty = oNewProperty;
OOXPictureReader oPictureReader(ooxDrawing);
if( true == oPictureReader.Parse( oParam, (*pNewPicture) ) )
OOXDrawingReader oDrawingReader(ooxDrawing);
if( true == oDrawingReader.Parse( oParam, (*pNewDrawing) ) )
{
oOutputParagraph.AddItem( pNewDrawing );
bAddDrawing = true;
}
if (!bAddDrawing && ooxDrawing->m_sXml.IsInit())
{
OOXDrawingGraphicReader oGraphiceReader(*ooxDrawing->m_sXml);
OOX::Logic::CPicture *ooxPicture = oGraphiceReader.Parse( oParam, (*pNewDrawing) );
if (Parse(oParam , oOutputParagraph, poStyle, oNewProperty, ooxPicture))
{
bAddDrawing = true;
}
if (ooxPicture)delete ooxPicture;
}
if (!bAddDrawing)
{
oOutputParagraph.AddItem( pNewPicture );
pNewDrawing->SetNotSupportShape();
oOutputParagraph.AddItem( pNewDrawing );
}
}break;
case OOX::et_w_pict:
......@@ -896,9 +915,9 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
nFontSize = oNewProperty.m_nFontSize / 2;
sFieldText = L"SYMBOL";
sFieldText += boost::lexical_cast<std::wstring>( nChar );
sFieldText += std::to_wstring( nChar );
sFieldText += L" \\\\f \"" + sFont + L"\" \\\\s ";
sFieldText += boost::lexical_cast<std::wstring>( nFontSize );
sFieldText += std::to_wstring( nFontSize );
pNewChar->setText( sFieldText );
......
......@@ -30,15 +30,16 @@
*
*/
#pragma once
#include "OOXDrawingGraphicReader.h"
#include "OOXPictureGraphicReader.h"
#include "OOXReaderBasic.h"
class OOXPictureAnchorReader
class OOXDrawingAnchorReader
{
private:
OOX::Drawing::CAnchor *m_ooxAnchor;
OOX::Drawing::CAnchor * m_ooxAnchor;
public:
OOXPictureAnchorReader(OOX::Drawing::CAnchor *ooxAnchor)
OOXDrawingAnchorReader(OOX::Drawing::CAnchor *ooxAnchor)
{
m_ooxAnchor = ooxAnchor;
}
......@@ -94,57 +95,57 @@ public:
{
switch(m_ooxAnchor->m_oPositionH->m_oRelativeFrom->GetValue())
{
case SimpleTypes::relfromhCharacter:
{
oOutput.m_nPositionHRelative = 3;
oOutput.m_eXAnchor = RtfShape::ax_margin;
}break;
case SimpleTypes::relfromhColumn:
{
oOutput.m_nPositionHRelative = 2;
oOutput.m_eXAnchor = RtfShape::ax_column;
}break;
case SimpleTypes::relfromhInsideMargin:
{
oOutput.m_nPositionHRelative = 6;
oOutput.m_eXAnchor = RtfShape::ax_margin;
}break;
case SimpleTypes::relfromhLeftMargin:
{
oOutput.m_nPositionHRelative = 4;
oOutput.m_eXAnchor = RtfShape::ax_margin;
}break;
case SimpleTypes::relfromhMargin:
{
oOutput.m_nPositionHRelative = 0;
oOutput.m_eXAnchor = RtfShape::ax_margin;
}break;
case SimpleTypes::relfromhOutsideMargin:
{
oOutput.m_nPositionHRelative = 7;
oOutput.m_eXAnchor = RtfShape::ax_margin;
}break;
case SimpleTypes::relfromhPage :
{
oOutput.m_nPositionHRelative = 1;
oOutput.m_eXAnchor = RtfShape::ax_page;
}break;
case SimpleTypes::relfromhRightMargin :
{
oOutput.m_nPositionHRelative = 5;
oOutput.m_eXAnchor = RtfShape::ax_margin;
}break;
case SimpleTypes::relfromhCharacter:
{
oOutput.m_nPositionHRelative = 3;
oOutput.m_eXAnchor = RtfShape::ax_margin;
}break;
case SimpleTypes::relfromhColumn:
{
oOutput.m_nPositionHRelative = 2;
oOutput.m_eXAnchor = RtfShape::ax_column;
}break;
case SimpleTypes::relfromhInsideMargin:
{
oOutput.m_nPositionHRelative = 6;
oOutput.m_eXAnchor = RtfShape::ax_margin;
}break;
case SimpleTypes::relfromhLeftMargin:
{
oOutput.m_nPositionHRelative = 4;
oOutput.m_eXAnchor = RtfShape::ax_margin;
}break;
case SimpleTypes::relfromhMargin:
{
oOutput.m_nPositionHRelative = 0;
oOutput.m_eXAnchor = RtfShape::ax_margin;
}break;
case SimpleTypes::relfromhOutsideMargin:
{
oOutput.m_nPositionHRelative = 7;
oOutput.m_eXAnchor = RtfShape::ax_margin;
}break;
case SimpleTypes::relfromhPage :
{
oOutput.m_nPositionHRelative = 1;
oOutput.m_eXAnchor = RtfShape::ax_page;
}break;
case SimpleTypes::relfromhRightMargin :
{
oOutput.m_nPositionHRelative = 5;
oOutput.m_eXAnchor = RtfShape::ax_margin;
}break;
}
}
if (m_ooxAnchor->m_oPositionH->m_oAlign.IsInit())
{
switch(m_ooxAnchor->m_oPositionH->m_oAlign->GetValue())
{
case SimpleTypes::alignhCenter : oOutput.m_nPositionH = 2; break;
case SimpleTypes::alignhInside : oOutput.m_nPositionH = 4; break;
case SimpleTypes::alignhLeft : oOutput.m_nPositionH = 1; break;
case SimpleTypes::alignhOutside : oOutput.m_nPositionH = 5; break;
case SimpleTypes::alignhRight : oOutput.m_nPositionH = 3; break;
case SimpleTypes::alignhCenter : oOutput.m_nPositionH = 2; break;
case SimpleTypes::alignhInside : oOutput.m_nPositionH = 4; break;
case SimpleTypes::alignhLeft : oOutput.m_nPositionH = 1; break;
case SimpleTypes::alignhOutside : oOutput.m_nPositionH = 5; break;
case SimpleTypes::alignhRight : oOutput.m_nPositionH = 3; break;
}
}
if (m_ooxAnchor->m_oPositionH->m_oPosOffset.IsInit())
......@@ -157,45 +158,45 @@ public:
switch(m_ooxAnchor->m_oPositionV->m_oRelativeFrom->GetValue())
{
case SimpleTypes::relfromvBottomMargin :
{
oOutput.m_nPositionVRelative = 5;
oOutput.m_eYAnchor = RtfShape::ay_margin;
}break;
{
oOutput.m_nPositionVRelative = 5;
oOutput.m_eYAnchor = RtfShape::ay_margin;
}break;
case SimpleTypes::relfromvInsideMargin :
{
oOutput.m_nPositionVRelative = 6;
oOutput.m_eYAnchor = RtfShape::ay_margin;
}break;
case SimpleTypes::relfromvLine :
{
oOutput.m_nPositionVRelative = 3;
oOutput.m_eYAnchor = RtfShape::ay_Para;
}break;
case SimpleTypes::relfromvMargin :
{
oOutput.m_nPositionVRelative = 0;
oOutput.m_eYAnchor = RtfShape::ay_margin;
}break;
{
oOutput.m_nPositionVRelative = 6;
oOutput.m_eYAnchor = RtfShape::ay_margin;
}break;
case SimpleTypes::relfromvLine :
{
oOutput.m_nPositionVRelative = 3;
oOutput.m_eYAnchor = RtfShape::ay_Para;
}break;
case SimpleTypes::relfromvMargin :
{
oOutput.m_nPositionVRelative = 0;
oOutput.m_eYAnchor = RtfShape::ay_margin;
}break;
case SimpleTypes::relfromvOutsideMargin :
{
oOutput.m_nPositionVRelative = 7;
oOutput.m_eYAnchor = RtfShape::ay_margin;
}break;
{
oOutput.m_nPositionVRelative = 7;
oOutput.m_eYAnchor = RtfShape::ay_margin;
}break;
case SimpleTypes::relfromvPage :
{
oOutput.m_nPositionVRelative = 1;
oOutput.m_eYAnchor = RtfShape::ay_page;
}break;
{
oOutput.m_nPositionVRelative = 1;
oOutput.m_eYAnchor = RtfShape::ay_page;
}break;
case SimpleTypes::relfromvParagraph :
{
oOutput.m_nPositionVRelative = 2;
oOutput.m_eYAnchor = RtfShape::ay_Para;
}break;
{
oOutput.m_nPositionVRelative = 2;
oOutput.m_eYAnchor = RtfShape::ay_Para;
}break;
case SimpleTypes::relfromvTopMargin :
{
oOutput.m_nPositionVRelative = 4;
oOutput.m_eYAnchor = RtfShape::ay_margin;
}break;
{
oOutput.m_nPositionVRelative = 4;
oOutput.m_eYAnchor = RtfShape::ay_margin;
}break;
}
}
if(m_ooxAnchor->m_oPositionV->m_oAlign.IsInit())
......@@ -300,9 +301,12 @@ public:
if( m_ooxAnchor->m_oGraphic.IsInit() )
{
OOXPictureGraphicReader oGraphicReader(m_ooxAnchor->m_oGraphic.GetPointer());
OOXPictureGraphicReader oPictureReader(m_ooxAnchor->m_oGraphic.GetPointer());
oGraphicReader.Parse( oParam, oOutput );
if (oPictureReader.Parse( oParam, oOutput) == false)
{
return false;
}
}
//изменяем scale в соответсявии с выходным размером
if( PROP_DEF != nWidth && PROP_DEF != oOutput.m_oPicture->m_nWidthGoal )
......
......@@ -48,7 +48,7 @@ private:
public:
OOXPictureGraphicReader(OOX::Drawing::CGraphic *ooxGraphic)
{
m_ooxGraphic = ooxGraphic;
m_ooxGraphic = ooxGraphic;
}
bool Parse( ReaderParameter oParam , RtfShape& oOutput);
static bool WriteDataToPicture( std::wstring sPath, RtfPicture& oOutput, std::wstring sTempPath )
......
......@@ -32,12 +32,12 @@
#pragma once
#include "OOXPictureGraphicReader.h"
class OOXPictureInlineReader
class OOXDrawingInlineReader
{
private:
OOX::Drawing::CInline *m_ooxInline;
OOX::Drawing::CInline * m_ooxInline;
public:
OOXPictureInlineReader(OOX::Drawing::CInline *ooxInline)
OOXDrawingInlineReader(OOX::Drawing::CInline *ooxInline)
{
m_ooxInline = ooxInline;
}
......@@ -83,8 +83,11 @@ public:
if(m_ooxInline->m_oGraphic.IsInit())
{
OOXPictureGraphicReader oGraphicReader(m_ooxInline->m_oGraphic.GetPointer());
oGraphicReader.Parse( oParam, oOutput);
OOXPictureGraphicReader oPictureReader(m_ooxInline->m_oGraphic.GetPointer());
if (oPictureReader.Parse( oParam, oOutput) == false)
{
return false;
}
}
//изменяем scale в соответсявии с выходным размером
if( PROP_DEF != nWidth && PROP_DEF != oOutput.m_oPicture->m_nWidthGoal )
......
......@@ -36,32 +36,32 @@
#include "../../../../Common/DocxFormat/Source/DocxFormat/Drawing/Drawing.h"
class OOXPictureReader
class OOXDrawingReader
{
private:
OOX::Logic::CDrawing* m_ooxDrawing;
public:
OOXPictureReader(OOX::Logic::CDrawing* ooxDrawing)
OOXDrawingReader(OOX::Logic::CDrawing* ooxDrawing)
{
m_ooxDrawing = ooxDrawing;
m_ooxDrawing = ooxDrawing;
}
bool Parse( ReaderParameter oParam , RtfShape& oOutput)
{
if (m_ooxDrawing == NULL) return false;
//if( oParam.oReader->m_nCurItap != 0 )
// oOutput.m_bLayoutInCell = 1;
std::wstring sXml = m_ooxDrawing->m_sXml.IsInit() ? *m_ooxDrawing->m_sXml : L"";
if (m_ooxDrawing->m_oInline.IsInit())
{
OOXPictureInlineReader oPictureInlineReader(m_ooxDrawing->m_oInline.GetPointer());
return oPictureInlineReader.Parse( oParam, oOutput );
OOXDrawingInlineReader oDrawingInlineReader(m_ooxDrawing->m_oInline.GetPointer());
return oDrawingInlineReader.Parse( oParam, oOutput );
}
if (m_ooxDrawing->m_oAnchor.IsInit())
{
OOXPictureAnchorReader oPictureAnchorReader(m_ooxDrawing->m_oAnchor.GetPointer());
return oPictureAnchorReader.Parse( oParam, oOutput );
OOXDrawingAnchorReader oDrawingAnchorReader(m_ooxDrawing->m_oAnchor.GetPointer());
return oDrawingAnchorReader.Parse( oParam, oOutput );
}
return false;
......
......@@ -630,6 +630,7 @@ bool OOXShapeReader::Parse( ReaderParameter oParam , RtfShapePtr& oOutput)
if (oOutput->m_nShapeType == NSOfficeDrawing::sptNotPrimitive && custom_path)
{
//
oOutput->m_nShapeType = sptRectangle;
}
//-------------------------------------------------------------------------------------------------------------
if (m_vmlElement->m_oFilled.IsInit())
......
......@@ -43,9 +43,9 @@ std::wstring RtfBookmarkStart::RenderToRtf(RenderParameter oRenderParameter)
sResult += L"{\\*\\bkmkstart";
if( PROP_DEF != nFirstColumn )
sResult += L"\\bkmkcolf" + boost::lexical_cast<std::wstring>( nFirstColumn);
sResult += L"\\bkmkcolf" + std::to_wstring( nFirstColumn);
if( PROP_DEF != nLastColumn )
sResult += L"\\bkmkcoll" + boost::lexical_cast<std::wstring>( nLastColumn);
sResult += L"\\bkmkcoll" + std::to_wstring( nLastColumn);
sResult += L" ";
RtfCharProperty* pCharProperty = NULL;
......@@ -72,11 +72,11 @@ std::wstring RtfBookmarkStart::RenderToOOX(RenderParameter oRenderParameter)
nID = poDocument->m_oIdGenerator.Generate_BookmarkNumber();
poOOXWriter->m_aBookmarksId[m_sName] = nID;
}
sResult += L" w:id =\"" + boost::lexical_cast<std::wstring>(nID) + L"\"";
sResult += L" w:id =\"" + std::to_wstring(nID) + L"\"";
if( PROP_DEF != nFirstColumn )
sResult += L" w:colFirst =\"" + boost::lexical_cast<std::wstring>(nID) + L"\"";
sResult += L" w:colFirst =\"" + std::to_wstring(nID) + L"\"";
if( PROP_DEF != nLastColumn )
sResult += L" w:colLast =\"" + boost::lexical_cast<std::wstring>(nID) + L"\"";
sResult += L" w:colLast =\"" + std::to_wstring(nID) + L"\"";
sResult += L" w:name =\"" + XmlUtils::EncodeXmlString( m_sName ) + L"\"";
sResult += L"/>";
......@@ -114,7 +114,7 @@ std::wstring RtfBookmarkEnd::RenderToOOX(RenderParameter oRenderParameter)
nID = poDocument->m_oIdGenerator.Generate_BookmarkNumber();
poOOXWriter->m_aBookmarksId[m_sName] = nID;
}
sResult += L" w:id =\"" + boost::lexical_cast<std::wstring>(nID) + L"\"";
sResult += L" w:id =\"" + std::to_wstring(nID) + L"\"";
sResult += L"/>";
return sResult;
}
......@@ -161,7 +161,7 @@ std::wstring RtfFootnote::RenderToOOX(RenderParameter oRenderParameter)
sResult += srPr;
sResult += L"</w:rPr>";
}
sResult += L"<w:endnoteReference w:id=\"" + boost::lexical_cast<std::wstring>(nID) + L"\"/>";
sResult += L"<w:endnoteReference w:id=\"" + std::to_wstring(nID) + L"\"/>";
sResult += L"</w:r>";
}
else
......@@ -184,7 +184,7 @@ std::wstring RtfFootnote::RenderToOOX(RenderParameter oRenderParameter)
sResult += srPr;
sResult += L"</w:rPr>";
}
sResult += L"<w:footnoteReference w:id=\"" + boost::lexical_cast<std::wstring>(nID) + L"\"/>";
sResult += L"<w:footnoteReference w:id=\"" + std::to_wstring(nID) + L"\"/>";
sResult += L"</w:r>";
}
......
......@@ -52,7 +52,7 @@ std::wstring RtfChar::RenderToOOX(RenderParameter oRenderParameter)
std::wstring sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauth);
std::wstring sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + boost::lexical_cast<std::wstring>(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
m_oProperty.m_nRevised = PROP_DEF;
}
if (m_oProperty.m_nDeleted != PROP_DEF)
......@@ -62,7 +62,7 @@ std::wstring RtfChar::RenderToOOX(RenderParameter oRenderParameter)
std::wstring sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauthDel);
std::wstring sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + boost::lexical_cast<std::wstring>(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
m_oProperty.m_nDeleted = PROP_DEF;
}
sResult += L"<w:r>";
......@@ -92,7 +92,7 @@ std::wstring RtfChar::RenderToOOX(RenderParameter oRenderParameter)
std::wstring sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauth);
std::wstring sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + boost::lexical_cast<std::wstring>(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
m_oProperty.m_nRevised = PROP_DEF;
}
if (m_oProperty.m_nDeleted != PROP_DEF)
......@@ -102,7 +102,7 @@ std::wstring RtfChar::RenderToOOX(RenderParameter oRenderParameter)
std::wstring sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauthDel);
std::wstring sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + boost::lexical_cast<std::wstring>(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
m_oProperty.m_nDeleted = PROP_DEF;
}
sResult += m_oProperty.RenderToOOX(oRenderParameter);//w:rPr внутри
......@@ -250,9 +250,9 @@ std::wstring RtfChar::renderRtfText( std::wstring& sText, void* poDocument, int
if (0 < nUnicode && nUnicode <= 0x8000)
{
sResult += L"\\u" + boost::lexical_cast<std::wstring>(nUnicode) + L"*";
sResult += L"\\u" + std::to_wstring(nUnicode) + L"*";
} else if (0x8000 < nUnicode && nUnicode <= 0xffff) {
sResult += L"\\u" + boost::lexical_cast<std::wstring>(nUnicode - 0x10000) + L"*"; //??? font alt name china ALL FONTS NEW.docx (Mekanik LET)
sResult += L"\\u" + std::to_wstring(nUnicode - 0x10000) + L"*"; //??? font alt name china ALL FONTS NEW.docx (Mekanik LET)
} else {
sResult += L"\\u9633*";
}
......@@ -359,7 +359,7 @@ std::wstring RtfCharSpecial::RenderToOOX(RenderParameter oRenderParameter)
std::wstring sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauth);
std::wstring sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + boost::lexical_cast<std::wstring>(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
m_oProperty.m_nRevised = PROP_DEF;
}
if (m_oProperty.m_nDeleted != PROP_DEF)
......@@ -369,7 +369,7 @@ std::wstring RtfCharSpecial::RenderToOOX(RenderParameter oRenderParameter)
std::wstring sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_oProperty.m_nRevauthDel);
std::wstring sDate(RtfUtility::convertDateTime(m_oProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + boost::lexical_cast<std::wstring>(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
m_oProperty.m_nDeleted = PROP_DEF;
}
sResult += L"<w:r>";
......@@ -436,7 +436,7 @@ std::wstring RtfCharSpecial::RenderToRtf(RenderParameter oRenderParameter)
//}
if( PROP_DEF != m_nSoftHeight )
{
sResult += L"\\softlheight" + boost::lexical_cast<std::wstring>( m_nSoftHeight );
sResult += L"\\softlheight" + std::to_wstring( m_nSoftHeight );
}
sResult += L"}";
return sResult;
......
......@@ -168,7 +168,7 @@ std::wstring RtfField::RenderToOOX(RenderParameter oRenderParameter)
sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_pInsert->m_oCharProperty.m_nRevauth);
sDate = std::wstring(RtfUtility::convertDateTime(m_pInsert->m_oCharProperty.m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + boost::lexical_cast<std::wstring>(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
m_pInsert->m_oCharProperty.m_nRevised = PROP_DEF;
}
if (m_pInsert->m_oCharProperty.m_nDeleted != PROP_DEF)
......@@ -178,7 +178,7 @@ std::wstring RtfField::RenderToOOX(RenderParameter oRenderParameter)
sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(m_pInsert->m_oCharProperty.m_nRevauthDel);
sDate = std::wstring(RtfUtility::convertDateTime(m_pInsert->m_oCharProperty.m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + boost::lexical_cast<std::wstring>(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
m_pInsert->m_oCharProperty.m_nDeleted = PROP_DEF;
}
//поверяем на наличие гиперссылки
......
......@@ -70,7 +70,7 @@ std::wstring RtfListTable::RenderToOOX(RenderParameter oRenderParameter)
oNewParam.nType = RENDER_TO_OOX_PARAM_SHAPE_WSHAPE;
for( int i = 0; i < (int)m_aPictureList.GetCount(); i++ )
{
sResult += L"<w:numPicBullet w:numPicBulletId=\"" + boost::lexical_cast<std::wstring>(i) + L"\">";
sResult += L"<w:numPicBullet w:numPicBulletId=\"" + std::to_wstring(i) + L"\">";
sResult += m_aPictureList[i]->RenderToOOX(oNewParam);
sResult += L"</w:numPicBullet>";
}
......
......@@ -53,7 +53,7 @@ std::wstring RtfOldList::RenderToOOX(RenderParameter oRenderParameter)
oNewParameter.nType = RENDER_TO_OOX_PARAM_PLAIN;
std::wstring sText = m_oLevelText->RenderToOOX( oNewParameter );
sResult += L"<w:abstractNum w:abstractNumId=\"" + boost::lexical_cast<std::wstring>(m_nLs) + L"\">";
sResult += L"<w:abstractNum w:abstractNumId=\"" + std::to_wstring(m_nLs) + L"\">";
sResult += L"<w:multiLevelType w:val=\"singleLevel\" />";
sResult += L"<w:lvl w:ilvl=\"0\">";
sResult += L"<w:numFmt w:val=\"bullet\"/>";
......@@ -89,13 +89,13 @@ std::wstring RtfOldList::RenderToOOX(RenderParameter oRenderParameter)
sResult += L"</w:abstractNum>";
}
else if( RENDER_TO_OOX_PARAM_OLDLIST_OVR == oRenderParameter.nType )
sResult += L"<w:num w:numId=\"" + boost::lexical_cast<std::wstring>(m_nLs) +
L"\"><w:abstractNumId w:val=\"" + boost::lexical_cast<std::wstring>(m_nLs) + L"\"/></w:num>";
sResult += L"<w:num w:numId=\"" + std::to_wstring(m_nLs) +
L"\"><w:abstractNumId w:val=\"" + std::to_wstring(m_nLs) + L"\"/></w:num>";
else
{
if( PROP_DEF != m_nLs && PROP_DEF != m_nIlvl )
sResult += L"<w:numPr><w:ilvl w:val=\"" + boost::lexical_cast<std::wstring>(m_nLs) +
L"\"/><w:numId w:val=\"%" + boost::lexical_cast<std::wstring>(m_nLs) + L"\"/></w:numPr>";
sResult += L"<w:numPr><w:ilvl w:val=\"" + std::to_wstring(m_nLs) +
L"\"/><w:numId w:val=\"%" + std::to_wstring(m_nLs) + L"\"/></w:numPr>";
}
}
return sResult;
......
......@@ -63,7 +63,7 @@ std::wstring RtfOle::RenderToOOX(RenderParameter oRenderParameter)
std::wstring sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(pCharProps->m_nRevauth);
std::wstring sDate(RtfUtility::convertDateTime(pCharProps->m_nRevdttm).c_str());
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + boost::lexical_cast<std::wstring>(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
sResult += L"<w:ins w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
pCharProps->m_nRevised = PROP_DEF;
}
if (pCharProps->m_nDeleted != PROP_DEF)
......@@ -73,7 +73,7 @@ std::wstring RtfOle::RenderToOOX(RenderParameter oRenderParameter)
std::wstring sAuthor = poRtfDocument->m_oRevisionTable.GetAuthor(pCharProps->m_nRevauthDel);
std::wstring sDate(RtfUtility::convertDateTime(pCharProps->m_nRevdttmDel).c_str());
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + boost::lexical_cast<std::wstring>(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
sResult += L"<w:del w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
pCharProps->m_nDeleted = PROP_DEF;
}
//----------
......@@ -88,8 +88,8 @@ std::wstring RtfOle::RenderToOOX(RenderParameter oRenderParameter)
sResult += L"</w:rPr>";
}
sResult += L"<w:object w:dxaOrig=\"" + boost::lexical_cast<std::wstring>(m_nWidth) +
L"\" w:dyaOrig=\"" + boost::lexical_cast<std::wstring>(m_nHeight) + L"\">";
sResult += L"<w:object w:dxaOrig=\"" + std::to_wstring(m_nWidth) +
L"\" w:dyaOrig=\"" + std::to_wstring(m_nHeight) + L"\">";
RenderParameter oNewRenderParameter = oRenderParameter;
oNewRenderParameter.nType = RENDER_TO_OOX_PARAM_SHAPE_WSHAPE2;
......@@ -122,7 +122,7 @@ std::wstring RtfOle::RenderToOOXOnlyOle(RenderParameter oRenderParameter)
default: sResult += L" Type=\"Embed\""; break;
}
sResult += L" ProgID=\"" + m_sOleClass + L"\"";
sResult += L" ShapeID=\"_x0000_s" + boost::lexical_cast<std::wstring>(poDocument->GetShapeId( oRenderParameter.nValue )) + L"\"";
sResult += L" ShapeID=\"_x0000_s" + std::to_wstring(poDocument->GetShapeId( oRenderParameter.nValue )) + L"\"";
sResult += L" DrawAspect=\"Content\"";
sResult += L" ObjectID=\"" + poDocument->m_oIdGenerator.Generate_OleId() + L"\"";
......@@ -130,7 +130,7 @@ std::wstring RtfOle::RenderToOOXOnlyOle(RenderParameter oRenderParameter)
std::wstring sMime = L"application/vnd.openxmlformats-officedocument.oleObject";
std::wstring sFilenameRels;
sFilenameRels += L"oleObject" + boost::lexical_cast<std::wstring>(poDocument->m_oIdGenerator.Generate_OleIndex()) + L".";
sFilenameRels += L"oleObject" + std::to_wstring(poDocument->m_oIdGenerator.Generate_OleIndex()) + L".";
sFilenameRels += sExtension;
std::wstring sFilenameFull = poOOXWriter->m_sTargetFolder + FILE_SEPARATOR_STR + L"word" + FILE_SEPARATOR_STR + L"embeddings";
......
......@@ -134,7 +134,7 @@ std::wstring RtfPicture::RenderToOOX(RenderParameter oRenderParameter)
case dt_macpict:sExtension = L"pct"; sMime = L"image/x-pict"; break;
}
std::wstring sFilenameRels = L"Image" + boost::lexical_cast<std::wstring>(poRtfDocument->m_oIdGenerator.Generate_ImageIndex()) + L".";
std::wstring sFilenameRels = L"Image" + std::to_wstring(poRtfDocument->m_oIdGenerator.Generate_ImageIndex()) + L".";
sFilenameRels += sExtension;
std::wstring sFilenameFull = poOOXWriter->m_sTargetFolder + FILE_SEPARATOR_STR + L"word" + FILE_SEPARATOR_STR +L"media";
......
......@@ -75,14 +75,14 @@
{\
sResult += L"<";\
sResult += sName;\
sResult += L" w:val=\"" + boost::lexical_cast<std::wstring>(prop) + L"\"/>";\
sResult += L" w:val=\"" + std::to_wstring(prop) + L"\"/>";\
}
#define RENDER_OOX_INT_ATTRIBUTE( prop, sResult, sName)\
if ( PROP_DEF != prop )\
{\
sResult += L" ";\
sResult += sName;\
sResult += L"=\"" + boost::lexical_cast<std::wstring>(prop) + L"\"";\
sResult += L"=\"" + std::to_wstring(prop) + L"\"";\
}
#define RENDER_OOX_BOOL_ATTRIBUTE( prop, sResult, sName)\
if ( 0 == prop )\
......@@ -116,11 +116,11 @@
{\
sResult += L"\\";\
sResult += sName;\
sResult += boost::lexical_cast<std::wstring>( prop );\
sResult += std::to_wstring( prop );\
}
#define RENDER_RTF_SHAPE_PROP( sName, sResult, prop)\
if ( PROP_DEF != prop )\
sResult += L"{\\sp{\\sn " + std::wstring(sName) + L"}{\\sv " + boost::lexical_cast<std::wstring>( prop ) + L"}}";
sResult += L"{\\sp{\\sn " + std::wstring(sName) + L"}{\\sv " + std::to_wstring( prop ) + L"}}";
class RtfSection;
typedef boost::shared_ptr<RtfSection> RtfSectionPtr;
......@@ -629,8 +629,8 @@ private:
if ( true == GetStringByTheme( sTheme, m_eTheme ) )
{
sResult += L"theme" + sParam + L"Color=\"" + sTheme +L"\"";
sResult += L" theme" + sParam + L"Shade=\"" + boost::lexical_cast<std::wstring>(m_byteShade) + L"\"";
sResult += L" theme" + sParam + L"Tint=\"" + boost::lexical_cast<std::wstring>(m_byteTint) + L"\"";
sResult += L" theme" + sParam + L"Shade=\"" + std::to_wstring(m_byteShade) + L"\"";
sResult += L" theme" + sParam + L"Tint=\"" + std::to_wstring(m_byteTint) + L"\"";
}
}
return sResult;
......@@ -1415,7 +1415,7 @@ public:
nReplaceNumber++;
nLevel = sResult[ nReplaceNumber];
}
std::wstring sExt = L"%" + boost::lexical_cast<std::wstring>(nLevel);
std::wstring sExt = L"%" + std::to_wstring(nLevel);
sResult.erase( nReplaceNumber, 1 );
sResult.insert(sResult.begin() + nReplaceNumber, sExt.begin(), sExt.end());
......@@ -1529,7 +1529,7 @@ public:
for( int i = 0; i < nOverrideCount; i++ )
if ( PROP_DEF == m_aOverrideLevels[i].m_nLevelIndex )
nOverrideCount--;
sResult += L"\\listoverridecount" + boost::lexical_cast<std::wstring>( nOverrideCount );
sResult += L"\\listoverridecount" + std::to_wstring( nOverrideCount );
for( int i = 0; i < nOverrideCount; i++ )
{
if ( PROP_DEF != m_aOverrideLevels[i].m_nLevelIndex )
......@@ -1537,9 +1537,9 @@ public:
sResult += L"{\\lfolevel";
if ( PROP_DEF != m_aOverrideLevels[i].m_nLevelIndex )
sResult += L"\\listoverrideformat" + boost::lexical_cast<std::wstring>( m_aOverrideLevels[i].m_nLevelIndex );
sResult += L"\\listoverrideformat" + std::to_wstring( m_aOverrideLevels[i].m_nLevelIndex );
if ( PROP_DEF != m_aOverrideLevels[i].m_nStart )
sResult += L"\\listoverridestartat" + boost::lexical_cast<std::wstring>( m_aOverrideLevels[i].m_nStart );
sResult += L"\\listoverridestartat" + std::to_wstring( m_aOverrideLevels[i].m_nStart );
sResult += m_aOverrideLevels[i].m_oLevel.RenderToRtf(oRenderParameter);
sResult += L"}";
......@@ -1555,9 +1555,9 @@ public:
ListOverrideLevel& OverrideLevel = m_aOverrideLevels[i];
if ( PROP_DEF != OverrideLevel.m_nLevelIndex )
{
sResult += L"<w:lvlOverride w:ilvl=\"" + boost::lexical_cast<std::wstring>(OverrideLevel.m_nLevelIndex) + L"\">";
sResult += L"<w:lvlOverride w:ilvl=\"" + std::to_wstring(OverrideLevel.m_nLevelIndex) + L"\">";
if ( PROP_DEF != OverrideLevel.m_nStart )
sResult += L"<w:startOverride w:val=\"" + boost::lexical_cast<std::wstring>(OverrideLevel.m_nStart) + L"\"/>";
sResult += L"<w:startOverride w:val=\"" + std::to_wstring(OverrideLevel.m_nStart) + L"\"/>";
sResult += OverrideLevel.m_oLevel.RenderToOOX2(oRenderParameter, OverrideLevel.m_nLevelIndex);
sResult += L"</w:lvlOverride>";
}
......@@ -1699,10 +1699,10 @@ public:
std::wstring sResult;
switch( m_eType )
{
case stParagraph : sResult += L"{\\s" + boost::lexical_cast<std::wstring>( m_nID); break;
case stCharacter : sResult += L"{\\*\\cs" + boost::lexical_cast<std::wstring>( m_nID); break;
case stSection : sResult += L"{\\*\\ds" + boost::lexical_cast<std::wstring>( m_nID); break;
case stTable : sResult += L"{\\*\\ts" + boost::lexical_cast<std::wstring>( m_nID) + L"\\tsrowd"; break;
case stParagraph : sResult += L"{\\s" + std::to_wstring( m_nID); break;
case stCharacter : sResult += L"{\\*\\cs" + std::to_wstring( m_nID); break;
case stSection : sResult += L"{\\*\\ds" + std::to_wstring( m_nID); break;
case stTable : sResult += L"{\\*\\ts" + std::to_wstring( m_nID) + L"\\tsrowd"; break;
}
return sResult;
}
......
......@@ -41,7 +41,7 @@ std::wstring RtfDocumentProperty::RenderToRtf(RenderParameter oRenderParameter)
{
sResult += L"\\ansi";
if( PROP_DEF != m_nAnsiCodePage )
sResult += L"\\ansicpg" + boost::lexical_cast<std::wstring>( m_nAnsiCodePage );
sResult += L"\\ansicpg" + std::to_wstring( m_nAnsiCodePage );
break;
}
......@@ -158,7 +158,7 @@ std::wstring RtfDocumentProperty::RenderToOOX(RenderParameter oRenderParameter)
RENDER_OOX_INT( m_nTabWidth, sResult, L"w:defaultTabStop" )
if( PROP_DEF != m_nZoom )
sResult += L"<w:zoom w:percent=\"" + boost::lexical_cast<std::wstring>(m_nZoom) + L"\" />";
sResult += L"<w:zoom w:percent=\"" + std::to_wstring(m_nZoom) + L"\" />";
//Page Borders
if( PROP_DEF != m_bDorderSurroundHeader )
{
......@@ -188,7 +188,7 @@ std::wstring RtfDocumentProperty::RenderToOOX(RenderParameter oRenderParameter)
std::wstring sFootnoteProp;
for( int i = 0; i < m_aSpecialFootnotes.size(); i++ )
{
sFootnoteProp += L"<w:footnote w:id=\"" + boost::lexical_cast<std::wstring>(m_aSpecialFootnotes[i]) + L"\" />";
sFootnoteProp += L"<w:footnote w:id=\"" + std::to_wstring(m_aSpecialFootnotes[i]) + L"\" />";
}
if( PROP_DEF != m_nFootnoteNumberingFormat )
......@@ -225,7 +225,7 @@ std::wstring RtfDocumentProperty::RenderToOOX(RenderParameter oRenderParameter)
//todooo проверить id
for( int i = 0; i < m_aSpecialEndnotes.size(); i++ )
{
sEndnoteProp += L"<w:endnote w:id=\"" + boost::lexical_cast<std::wstring>(m_aSpecialEndnotes[i]) + L"\"/>";
sEndnoteProp += L"<w:endnote w:id=\"" + std::to_wstring(m_aSpecialEndnotes[i]) + L"\"/>";
}
if( PROP_DEF != m_nFootnoteNumberingFormat )
{
......@@ -313,7 +313,7 @@ std::wstring RtfSectionProperty::RenderToRtf(RenderParameter oRenderParameter)
{
for( int i = 0; i < nCollFormCount; i++ )
{
sResult += L"\\colno" + boost::lexical_cast<std::wstring>( i + 1 );
sResult += L"\\colno" + std::to_wstring( i + 1 );
RENDER_RTF_INT( m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnSpaceToRightOfCol, sResult, L"colsr" )
RENDER_RTF_INT( m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnWidth, sResult, L"colw" )
}
......@@ -536,9 +536,9 @@ std::wstring RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
std::wstring sPaperSource;
if( PROP_DEF != m_nPaperSourceFirst )
sPaperSource += L" w:first=\"" + boost::lexical_cast<std::wstring>(m_nPaperSourceFirst) + L"\"";
sPaperSource += L" w:first=\"" + std::to_wstring(m_nPaperSourceFirst) + L"\"";
if( PROP_DEF != m_nPaperSourceFirst )
sPaperSource += L" w:other=\"" + boost::lexical_cast<std::wstring>(m_nPaperSourceOther) + L"\"";
sPaperSource += L" w:other=\"" + std::to_wstring(m_nPaperSourceOther) + L"\"";
if( !sPaperSource.empty() )
sResult += L"<w:paperSrc " + sPaperSource + L"/>";
......@@ -572,9 +572,9 @@ std::wstring RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
bEqualWidth = true;
break;
}
sCollumnFormating += L"<w:cols w:num=\"" + boost::lexical_cast<std::wstring>(m_nColumnNumber) + L"\"";
sCollumnFormating += L"<w:cols w:num=\"" + std::to_wstring(m_nColumnNumber) + L"\"";
if( PROP_DEF != m_nColumnSpace )
sCollumnFormating += L" w:space=\"" + boost::lexical_cast<std::wstring>(m_nColumnSpace) + L"\"";
sCollumnFormating += L" w:space=\"" + std::to_wstring(m_nColumnSpace) + L"\"";
if( true == bEqualWidth )
sCollumnFormating += L" w:equalWidth=\"true\"/>";
else
......@@ -584,9 +584,9 @@ std::wstring RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
{
sCollumnFormating += L"<w:col";
if( PROP_DEF != m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnWidth )
sCollumnFormating += L" w:w=\"" + boost::lexical_cast<std::wstring>(m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnWidth) + L"\"";
sCollumnFormating += L" w:w=\"" + std::to_wstring(m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnWidth) + L"\"";
if( PROP_DEF != m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnSpaceToRightOfCol )
sCollumnFormating += L" w:space=\"" + boost::lexical_cast<std::wstring>(m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnSpaceToRightOfCol ) + L"\"";
sCollumnFormating += L" w:space=\"" + std::to_wstring(m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnSpaceToRightOfCol ) + L"\"";
sCollumnFormating += L"/>";
}
sCollumnFormating += L"</w:cols>";
......@@ -674,11 +674,11 @@ std::wstring RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
//Line Numbering
std::wstring sLineNumbering;
if( PROP_DEF != m_nLineModulus )
sLineNumbering += L" w:countBy=\"" + boost::lexical_cast<std::wstring>(m_nLineModulus) + L"\"";
sLineNumbering += L" w:countBy=\"" + std::to_wstring(m_nLineModulus) + L"\"";
if( PROP_DEF != m_nLineX && 0 != m_nLineX)
sLineNumbering += L" w:distance=\"" + boost::lexical_cast<std::wstring>(m_nLineX) + L"\"";
sLineNumbering += L" w:distance=\"" + std::to_wstring(m_nLineX) + L"\"";
if( PROP_DEF != m_nLineStart )
sLineNumbering += L" w:start=\"" + boost::lexical_cast<std::wstring>(m_nLineStart) + L"\"";
sLineNumbering += L" w:start=\"" + std::to_wstring(m_nLineStart) + L"\"";
switch( m_eLineNumberRestart )
{
case lnr_linerestart: sLineNumbering += L" w:restart=\"newSection\""; break;
......@@ -691,9 +691,9 @@ std::wstring RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
//Page Information
std::wstring sPageSize;
if( PROP_DEF != m_nPageWidth )
sPageSize += L" w:w=\"" + boost::lexical_cast<std::wstring>(m_nPageWidth) + L"\"";
sPageSize += L" w:w=\"" + std::to_wstring(m_nPageWidth) + L"\"";
if( PROP_DEF != m_nPageHeight )
sPageSize += L" w:h=\"" + boost::lexical_cast<std::wstring>(m_nPageHeight) + L"\"";
sPageSize += L" w:h=\"" + std::to_wstring(m_nPageHeight) + L"\"";
if( 1 == m_bLandscapeFormat )
sPageSize += L" w:orient=\"landscape\"";
if( false == sPageSize.empty() )
......@@ -701,19 +701,19 @@ std::wstring RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
std::wstring sMargin;
if( PROP_DEF != m_nMarginLeft )
sMargin += L" w:left=\"" + boost::lexical_cast<std::wstring>(m_nMarginLeft) + L"\"";
sMargin += L" w:left=\"" + std::to_wstring(m_nMarginLeft) + L"\"";
if( PROP_DEF != m_nMarginRight )
sMargin += L" w:right=\"" + boost::lexical_cast<std::wstring>(m_nMarginRight) + L"\"";
sMargin += L" w:right=\"" + std::to_wstring(m_nMarginRight) + L"\"";
if( PROP_DEF != m_nMarginTop )
sMargin += L" w:top=\"" + boost::lexical_cast<std::wstring>(m_nMarginTop) + L"\"";
sMargin += L" w:top=\"" + std::to_wstring(m_nMarginTop) + L"\"";
if( PROP_DEF != m_nMarginBottom )
sMargin += L" w:bottom=\"" + boost::lexical_cast<std::wstring>(m_nMarginBottom) + L"\"";
sMargin += L" w:bottom=\"" + std::to_wstring(m_nMarginBottom) + L"\"";
if( PROP_DEF != m_nGutterMarginWidth )
sMargin += L" w:gutter=\"" + boost::lexical_cast<std::wstring>(m_nGutterMarginWidth) + L"\"";
sMargin += L" w:gutter=\"" + std::to_wstring(m_nGutterMarginWidth) + L"\"";
if( PROP_DEF != m_nHeaderTop )
sMargin += L" w:header=\"" + boost::lexical_cast<std::wstring>(m_nHeaderTop) + L"\"";
sMargin += L" w:header=\"" + std::to_wstring(m_nHeaderTop) + L"\"";
if( PROP_DEF != m_nFooterBottom )
sMargin += L" w:footer=\"" + boost::lexical_cast<std::wstring>(m_nFooterBottom) + L"\"";
sMargin += L" w:footer=\"" + std::to_wstring(m_nFooterBottom) + L"\"";
if( false == sMargin.empty() )
sResult += L"<w:pgMar " + sMargin + L"/>";
if( 1 == m_bTitlePage )
......@@ -722,7 +722,7 @@ std::wstring RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
//Page Numbers
std::wstring sPageNumber;
if( PROP_DEF != m_nPageNumberStart )
sPageNumber += L" w:start=\"" + boost::lexical_cast<std::wstring>(m_nPageNumberStart) + L"\"";
sPageNumber += L" w:start=\"" + std::to_wstring(m_nPageNumberStart) + L"\"";
if( false == sPageNumber.empty() )
sResult += L"<w:pgNumType " + sPageNumber + L"/>";
//Vertical Alignment
......@@ -829,7 +829,7 @@ std::wstring RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
RenderParameter oRenderParameterNew = oRenderParameter;
oRenderParameterNew.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
sResult += L"<w:sectPrChange w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + boost::lexical_cast<std::wstring>(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
sResult += L"<w:sectPrChange w:date=\"" + sDate + L"\" w:author=\"" + sAuthor + L"\" w:id=\"" + std::to_wstring(poOOXWriter->m_nCurTrackChangesId++).c_str() + L"\">";
sResult += m_pOldSectionProp->RenderToOOX(oRenderParameterNew);
sResult += L"</w:sectPrChange>";
}
......@@ -843,9 +843,9 @@ std::wstring RtfSectionProperty::SaveFile( TextItemContainerPtr oTarget, RenderP
std::wstring sFilename;
if( true == bHeader )
sFilename += L"header" + boost::lexical_cast<std::wstring>(poRtfDocument->m_oIdGenerator.Generate_HeaderNumber()) + L".xml";
sFilename += L"header" + std::to_wstring(poRtfDocument->m_oIdGenerator.Generate_HeaderNumber()) + L".xml";
else
sFilename += L"footer" + boost::lexical_cast<std::wstring>(poRtfDocument->m_oIdGenerator.Generate_FooterNumber()) + L".xml";
sFilename += L"footer" + std::to_wstring(poRtfDocument->m_oIdGenerator.Generate_FooterNumber()) + L".xml";
std::wstring sContent;
std::wstring sRootName;
......
......@@ -180,17 +180,17 @@ public:
int m_nLineDashing;
//WordArt
std::wstring m_sGtextUNICODE;
std::wstring m_sGtextFont;
int m_nGtextSize;
int m_bGtext;
int m_bGtextFVertical;
int m_bGtextFKern;
int m_bGtextFStretch;
int m_bGtextFShrinkFit;
int m_bGtextFBestFit;
std::wstring m_sGtextUNICODE;
std::wstring m_sGtextFont;
int m_nGtextSize;
int m_bGtext;
int m_bGtextFVertical;
int m_bGtextFKern;
int m_bGtextFStretch;
int m_bGtextFShrinkFit;
int m_bGtextFBestFit;
RtfCharProperty m_oCharProperty; // тут могут быть track changes ....
RtfCharProperty m_oCharProperty; // тут могут быть track changes ....
//pWrapPolygonVertices Points of the text wrap polygon.
std::vector< std::pair<int, int> > m_aWrapPoints;
......@@ -217,11 +217,13 @@ public:
}
void SetDefault();
void SetNotSupportShape();
std::wstring RenderToRtf (RenderParameter oRenderParameter);
std::wstring RenderToOOX (RenderParameter oRenderParameter);
std::wstring RenderToOOXBegin(RenderParameter oRenderParameter);
std::wstring RenderToOOXEnd (RenderParameter oRenderParameter);
std::wstring RenderToOOXBegin (RenderParameter oRenderParameter);
std::wstring RenderToOOXEnd (RenderParameter oRenderParameter);
void ToRtfRotation( int nAngel , int &nLeft, int &nTop, int& nRight, int& nBottom )
{
......@@ -258,6 +260,9 @@ typedef boost::shared_ptr<RtfShape> RtfShapePtr;
class RtfShapeGroup : public RtfShape, public ItemContainer<RtfShapePtr>
{
public:
RtfShapeGroup() {}
RtfShapeGroup(const RtfShape & shape) : RtfShape(shape) {}
std::wstring RenderToRtf(RenderParameter oRenderParameter);
std::wstring RenderToOOX(RenderParameter oRenderParameter);
bool IsValid()
......
......@@ -65,7 +65,7 @@ public:
for( int i = 0; i < (int)m_aTableGrid.size(); i++ )
{
sResult += L"<w:gridCol w:w=\"" + boost::lexical_cast<std::wstring>(m_aTableGrid[i]) + L"\"/>";
sResult += L"<w:gridCol w:w=\"" + std::to_wstring(m_aTableGrid[i]) + L"\"/>";
}
sResult += L"</w:tblGrid>";
......
......@@ -119,12 +119,6 @@ namespace Strings
nG = 16 * ToDigit(color[4]) + ToDigit(color[5]);
nB = 16 * ToDigit(color[6]) + ToDigit(color[7]);
}
static bool ToBoolean(const std::wstring& strValue)
{
std::wstring s = boost::algorithm::to_lower_copy(strValue);
return (s == L"true");
}
static int ToInteger(const std::wstring& strValue)
{
return _ttoi(strValue.c_str());
......@@ -139,27 +133,7 @@ namespace Strings
#endif
return d;
}
static std::wstring FromInteger(int Value, int Base = 10)
{
std::wstring str = boost::lexical_cast<std::wstring>(Value);
return str;
}
static std::wstring FromDouble(double Value)
{
std::wstring str = boost::lexical_cast<std::wstring>(Value);
return str;
}
static std::wstring FromBoolean(bool Value)
{
if (Value)
return L"true";
return L"false";
}
}
class Convert
......@@ -167,7 +141,7 @@ class Convert
public:
static std::wstring ToString(int i)
{
return boost::lexical_cast<std::wstring>( i );
return std::to_wstring( i );
}
static std::wstring ToStringHex( int i, int nLen )
{
......@@ -394,15 +368,11 @@ public:
int Year = GETBITS(dt, 20, 28) + 1900;
//to 1899-12-31T05:37:46.66569 - iso_extended_string
std::wstring date_str = boost::lexical_cast<std::wstring>(Year)
+ L"-"
+ (Month < 10 ? L"0": L"") + boost::lexical_cast<std::wstring>(Month)
+ L"-"
+ (Day < 10 ? L"0": L"") + boost::lexical_cast<std::wstring>(Day)
+ L"T"
+ (Hour < 10 ? L"0": L"") + boost::lexical_cast<std::wstring>(Hour)
+ L":"
+ (Min < 10 ? L"0": L"") + boost::lexical_cast<std::wstring>(Min)
std::wstring date_str = std::to_wstring(Year)
+ L"-" + (Month < 10 ? L"0": L"") + std::to_wstring(Month)
+ L"-" + (Day < 10 ? L"0": L"") + std::to_wstring(Day)
+ L"T" + (Hour < 10 ? L"0": L"") + std::to_wstring(Hour)
+ L":" + (Min < 10 ? L"0": L"") + std::to_wstring(Min)
+ L":00Z";
return date_str;
......
......@@ -54,7 +54,7 @@ public:
}
if( PROP_DEF != nID )
sFootnote += L" w:id=\"" + boost::lexical_cast<std::wstring>(nID) + L"\"";
sFootnote += L" w:id=\"" + std::to_wstring(nID) + L"\"";
sFootnote += _T(">");
sFootnote += sText;
sFootnote += _T("</w:footnote>");
......@@ -71,7 +71,7 @@ public:
m_sFootnotes += _T("\"");
}
if( PROP_DEF != nID )
m_sFootnotes += L" w:id=\"" + boost::lexical_cast<std::wstring>(nID) + L"\"";
m_sFootnotes += L" w:id=\"" + std::to_wstring(nID) + L"\"";
m_sFootnotes += _T(">");
m_sFootnotes += sText;
m_sFootnotes += _T("</w:footnote>");
......@@ -133,7 +133,7 @@ public:
sEndnote += _T("\"");
}
if( -2 != nID )
sEndnote += L" w:id=\"" + boost::lexical_cast<std::wstring>(nID) + L"\"";
sEndnote += L" w:id=\"" + std::to_wstring(nID) + L"\"";
sEndnote += _T(">");
sEndnote += sText;
sEndnote += _T("</w:endnote>");
......@@ -151,7 +151,7 @@ public:
}
if( -2 != nID )
m_sEndnotes += L" w:id=\"" + boost::lexical_cast<std::wstring>(nID) + L"\"";
m_sEndnotes += L" w:id=\"" + std::to_wstring(nID) + L"\"";
m_sEndnotes += _T(">");
m_sEndnotes += sText;
m_sEndnotes += _T("</w:endnote>");
......
......@@ -42,16 +42,19 @@
int _tmain(int argc, _TCHAR* argv[])
{
if (argc < 2) return 1;
std::wstring srcFileName = argv[1];
int n1 = srcFileName.rfind(_T('.'));
std::wstring ext_1 = n1 >= 0 ? srcFileName.substr(n1+1, srcFileName.length() - n1) : _T(""); //ext_1.MakeLower();
std::wstring ext_1 = n1 >= 0 ? srcFileName.substr(n1+1, srcFileName.length() - n1) : _T("");
std::transform(ext_1.begin(), ext_1.end(), ext_1.begin(), ::tolower);
std::wstring dstFileName = argc > 2 ? argv[2] : srcFileName + L"_my." + (ext_1 == L"rtf" ? L"docx" : L"rtf");
std::wstring outputDir = NSDirectory::GetFolderPath(dstFileName);
std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
std::transform(ext_1.begin(), ext_1.end(), ext_1.begin(), ::tolower);
RtfConvertationManager rtfConvert;
......
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="8,00"
Name="RtfFormatTest"
ProjectGUID="{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
RootNamespace="RtfFormatTest"
......@@ -45,7 +45,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\Common\OfficeDrawing;&quot;..\..\DesktopEditor\freetype-2.5.2\include&quot;;..\..\..\..\..\Common\OfficeDrawing\Shapes"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ATL_CSTRINGS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="false"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......@@ -395,10 +395,6 @@
RelativePath="..\..\Common\3dParty\pole\pole.cpp"
>
</File>
<File
RelativePath="RtfFormatTest.cpp"
>
</File>
<File
RelativePath="..\..\UnicodeConverter\UnicodeConverter.cpp"
>
......@@ -430,6 +426,10 @@
RelativePath="..\..\build\bin\icu\win_32\icuuc.lib"
>
</File>
<File
RelativePath="RtfFormatTest.cpp"
>
</File>
</Files>
<Globals>
</Globals>
......
......@@ -21,7 +21,6 @@ DEFINES += UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
BUILD_CONFIG_FULL_VERSION \
DONT_WRITE_EMBEDDED_FONTS \
LIBXML_READER_ENABLED
......
......@@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\Common\DocxFormat\Source\DocxFormat;&quot;D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\DesktopEditor\freetype-2.5.2\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......
......@@ -16,7 +16,12 @@ PWD_ROOT_DIR = $$PWD
CONFIG += core_x2t
include(../../../Common/base.pri)
DEFINES += UNICODE _UNICODE _USE_LIBXML2_READER_ _USE_XMLLITE_READER_ USE_LITE_READER LIBXML_READER_ENABLED
DEFINES += UNICODE _UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS
INCLUDEPATH += \
../../../DesktopEditor/freetype-2.5.2/include \
......
......@@ -70,7 +70,7 @@ namespace OOX
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const
{
return m_eType;
......@@ -117,7 +117,7 @@ namespace OOX
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual void toXML(XmlUtils::CStringWriter& writer) const;
virtual EElementType getType() const
{
......@@ -171,11 +171,11 @@ 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 );
......@@ -190,7 +190,7 @@ namespace OOX
m_oExtLst = oReader;
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<a:graphicFrameLocks xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" ");
if (m_oNoChangeAspect.IsInit())
......@@ -308,18 +308,18 @@ namespace OOX
EElementType m_eType;
// Attributes
nullable<std::wstring > m_sAction;
nullable<SimpleTypes::COnOff<> > m_oEndSnd;
nullable<SimpleTypes::COnOff<> > m_oHighlightClick;
nullable<SimpleTypes::COnOff<SimpleTypes::onoffTrue> > m_oHistory;
nullable<SimpleTypes::CRelationshipId > m_oId;
nullable<std::wstring > m_sInvalidUrl;
nullable<std::wstring > m_sTgtFrame;
nullable<std::wstring > m_sTooltip;
nullable<std::wstring > m_sAction;
nullable<SimpleTypes::COnOff<> > m_oEndSnd;
nullable<SimpleTypes::COnOff<> > m_oHighlightClick;
nullable<SimpleTypes::COnOff<SimpleTypes::onoffTrue>> m_oHistory;
nullable<SimpleTypes::CRelationshipId > m_oId;
nullable<std::wstring > m_sInvalidUrl;
nullable<std::wstring > m_sTgtFrame;
nullable<std::wstring > m_sTooltip;
// Childs
nullable<OOX::Drawing::COfficeArtExtensionList > m_oExtLst;
nullable<OOX::Drawing::CEmbeddedWAVAudioFile > m_oSnd;
nullable<OOX::Drawing::COfficeArtExtensionList > m_oExtLst;
nullable<OOX::Drawing::CEmbeddedWAVAudioFile > m_oSnd;
};
//-----------------------------------------------------------------------
// CLineProperties 20.1.2.2.24
......@@ -341,7 +341,7 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
m_eType = et_Unknown;
m_eFillType = filltypeUnknown;
......@@ -350,7 +350,7 @@ namespace OOX
// TO DO: Реализовать CLineProperties::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
m_eType = et_Unknown;
m_eFillType = filltypeUnknown;
......@@ -617,11 +617,11 @@ 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 );
......@@ -637,7 +637,7 @@ namespace OOX
m_oExtLst = oReader;
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<a:picLocks ");
......@@ -746,12 +746,12 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
oNode.ReadAttributeBase( _T("r:embed"), m_oEmbed );
oNode.ReadAttributeBase( _T("name"), m_sName );
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -817,7 +817,7 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
m_eType = et_Unknown;
m_eFillType = filltypeUnknown;
......@@ -826,7 +826,7 @@ namespace OOX
// TO DO: Реализовать CShapeProperties::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
m_eType = et_Unknown;
m_eFillType = filltypeUnknown;
......@@ -1127,14 +1127,14 @@ namespace OOX
}
public:
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
return _T("");
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
m_eType = et_Unknown;
m_eFillType = filltypeUnknown;
......@@ -1142,7 +1142,7 @@ namespace OOX
// TO DO: Реализовать CShapeProperties::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
m_eType = et_Unknown;
m_eFillType = filltypeUnknown;
......@@ -1274,11 +1274,11 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CShapeStyle::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
......
......@@ -133,11 +133,11 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CPicture::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
......@@ -154,7 +154,7 @@ namespace OOX
m_oSpPr = oReader;
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<pic:pic>");
sResult += m_oNvPicPr.toXML();
......
......@@ -58,17 +58,17 @@ namespace OOX
virtual ~CGroupShapeNonVisual()
{
}
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
return _T("");
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -186,14 +186,14 @@ namespace OOX
{
}
public:
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
return _T("");
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -258,10 +258,10 @@ namespace OOX
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlNode& node)
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -326,17 +326,17 @@ namespace OOX
}
public:
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
return _T("");
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlNode& node)
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -406,7 +406,7 @@ namespace OOX
}
public:
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
return _T("");
}
......
......@@ -1313,11 +1313,11 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CPresetGeometry2D::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -1384,11 +1384,11 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CPresetTextShape::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -1405,7 +1405,7 @@ namespace OOX
m_oAvLst = oReader;
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = (L"<a:prstTxWarp prst=\"") + m_oPrst.ToString() + (L"\">");
......@@ -1455,18 +1455,18 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CGeomRect::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = (L"<a:rect l=\"") + m_oL.ToString()
+ (L"\" t=\"") + m_oT.ToString()
......@@ -1517,11 +1517,11 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CCustomGeometry2D::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
......
......@@ -42,8 +42,6 @@
#include "FileTypes.h"
#include "../XlsxFormat/FileFactory_Spreadsheet.h"
//BOOL XmlUtils::CStringWriter::m_bInitTable = false;
//BYTE XmlUtils::CStringWriter::m_arTableUnicodes[65536];
namespace OOX
{
......@@ -197,7 +195,6 @@ namespace OOX
}
}
void IFileContainer::ExtractPictures(const OOX::CPath& oPath) const
{
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator it = m_mContainer.begin(); it != m_mContainer.end(); ++it)
......@@ -294,7 +291,14 @@ namespace OOX
return smart_ptr<OOX::File>(new UnknowTypeFile( Unknown ));
}
void IFileContainer::Get(const FileType& oType, std::vector<smart_ptr<OOX::File>> & files)
{
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mContainer.begin(); pPair != m_mContainer.end(); ++pPair)
{
if ( oType == pPair->second->type() )
files.push_back(pPair->second);
}
}
const RId IFileContainer::Add(smart_ptr<OOX::File>& pFile)
{
const RId rId = GetMaxRId().next();
......
......@@ -61,7 +61,6 @@ namespace OOX
m_lMaxRid = 0;
}
protected:
std::map<std::wstring, smart_ptr<OOX::File>> m_mContainer;
size_t m_lMaxRid;
......@@ -75,7 +74,6 @@ namespace OOX
void Finalize(OOX::CRels& oRels, const CPath& oCurrent, const CPath& oDir, OOX::CContentTypes& oContent);
public:
void ExtractPictures(const OOX::CPath& oPath) const;
virtual smart_ptr<Image> GetImage (const RId& rId) const;
......@@ -88,7 +86,9 @@ namespace OOX
const bool IsExist(const OOX::RId& rId) const;
const bool IsExternal(const OOX::RId& rId) const;
smart_ptr<OOX::File> Get(const FileType& oType);
smart_ptr<OOX::File> Get(const FileType& oType);
void Get(const FileType& oType, std::vector<smart_ptr<OOX::File>> & files);
const RId Add(smart_ptr<OOX::File>& pFile);
void Add(const OOX::RId& rId, const smart_ptr<OOX::File>& pFile);
......@@ -99,14 +99,11 @@ namespace OOX
smart_ptr<OOX::File> operator [](const OOX::RId rId);
smart_ptr<OOX::File> operator [](const FileType& oType);
protected:
static UnknowTypeFile Unknown;
private:
const RId GetMaxRId();
};
......
......@@ -87,11 +87,11 @@ namespace OOX
}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const
{
return _T("");
}
......
......@@ -46,11 +46,9 @@ DEFINES += UNICODE \
PPTX_DEF\
PPT_DEF\
ENABLE_PPT_TO_PPTX_CONVERT\
NODOCX \
#DISABLE_FILE_DOWNLOADER \
FILTER_FLATE_DECODE_ENABLED \
CXIMAGE_DONT_DECLARE_TCHAR \
BUILD_CONFIG_FULL_VERSION \
DONT_WRITE_EMBEDDED_FONTS \
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML \
LIBXML_READER_ENABLED
......
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="8,00"
Name="X2tTest"
ProjectGUID="{355A22F4-1394-4B82-B2F1-FF0ECFB9E3EF}"
RootNamespace="X2tTest"
......@@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;../../../DesktopEditor/agg-2.4/include&quot;;&quot;C:\__Work\core\DesktopEditor\agg-2.4\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;__WORDSIZE=32;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......
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