From 945d20bc48572396c27934fcac95f5071d45a2a7 Mon Sep 17 00:00:00 2001 From: "Sergey.Konovalov" Date: Mon, 10 Nov 2014 17:07:16 +0000 Subject: [PATCH] =?UTF-8?q?=D0=BE=D1=82=D0=BA=D0=B0=D1=82=D0=B8=D0=BB?= =?UTF-8?q?=D0=B8=D1=81=D1=8C=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=81=20crossplatform=20=D0=B4=D0=BE=20Revision?= =?UTF-8?q?:=2059486=20Date:=2018:53:47,=206=20=D0=BD=D0=BE=D1=8F=D0=B1?= =?UTF-8?q?=D1=80=D1=8F=202014=20=D0=B3.=20revert=20revisions=2059572,=205?= =?UTF-8?q?9565,=2059564,=2059563,=2059556,=2059550,=2059548,=2059547,=205?= =?UTF-8?q?9546,=2059545,=2059544,=2059543,=2059542,=2059541,=2059533,=205?= =?UTF-8?q?9531,=2059523,=2059519,=2059503,=2059499,=2059490.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@59588 954022d7-b5bf-4e40-9824-e11837661b57 --- .gitattributes | 1 - .gitignore | 1 - ASCHTMLRenderer/CASCSVGRenderer.cpp | 14 +- ASCHTMLRenderer/Writer/Const.h | 32 +- ASCHTMLRenderer/Writer/SVGWriter.h | 10 +- ASCHTMLRenderer/Writer/VMLWriter.h | 12 +- .../ASCGraphics/Objects/Image/Wmf/WmfFile.h | 8 +- ASCOfficeDocxFile2/ASCOfficeDocxFile2.rc | 6 + ASCOfficeDocxFile2/BinReader/ChartWriter.h | 4 +- ASCOfficeDocxFile2/BinReader/CommentsWriter.h | 16 +- .../BinReader/ContentTypesWriter.h | 6 +- .../BinReader/DefaultThemeWriterLinux.h | 315 ------------------ .../BinReader/DefaultThemeWriterWin.h | Bin 23946 -> 0 bytes .../BinReader/DocumentRelsWriter.h | 65 ++-- ASCOfficeDocxFile2/BinReader/DocumentWriter.h | 21 +- ASCOfficeDocxFile2/BinReader/FileWriter.h | 35 +- .../BinReader/HeaderFooterWriter.h | 7 +- ASCOfficeDocxFile2/BinReader/MediaWriter.h | 16 +- .../BinReader/NumberingWriter.h | 7 +- ASCOfficeDocxFile2/BinReader/ReaderClasses.h | 146 ++++---- ASCOfficeDocxFile2/BinReader/Readers.h | 102 +++--- ASCOfficeDocxFile2/BinReader/SettingWriter.h | 6 +- ASCOfficeDocxFile2/BinReader/StylesWriter.h | 7 +- .../BinReader/fontTableWriter.h | 7 +- .../BinReader/webSettingsWriter.h | 36 -- ASCOfficeDocxFile2/BinWriter/BinWriters.h | 6 +- .../DocWrapper/DocxSerializer.cpp | 89 +---- .../DocWrapper/DocxSerializer.h | 17 +- .../DocWrapper/XlsxSerializer.cpp | 66 +--- .../DocWrapper/XlsxSerializer.h | 5 - ASCOfficeDocxFile2/DocxFile2.h | 60 +++- .../Linux/ASCOfficeDocxFile2Lib.pro | 160 +++++---- ASCOfficeDocxFile2/PptxFile.h | 6 +- ASCOfficeDocxFile2/Resources/.rels | 1 + .../Resources/[Content_Types].xml | 1 + ASCOfficeDocxFile2/Resources/app.xml | 1 + ASCOfficeDocxFile2/Resources/core.xml | 1 + ASCOfficeDocxFile2/Resources/theme.xml | 1 + ASCOfficeDocxFile2/Resources/webSettings.xml | 1 + ASCOfficeDocxFile2/XlsxFile2.h | 50 ++- .../ASCOfficeDrawingConverter.cpp | 14 +- .../ASCOfficePPTXFileRealization.cpp | 15 +- .../Editor/BinaryFileReaderWriter.cpp | 255 +++----------- .../Editor/BinaryFileReaderWriter.h | 4 - ASCOfficePPTXFile/Editor/PPTXWriter.h | 182 ++++------ ASCOfficePPTXFile/Editor/imagemanager.h | 82 ++--- .../PPTXFormat/DocxFormat/Rels/File.h | 13 +- ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.h | 2 +- .../PPTXFormat/Logic/Fills/BlipFill.h | 26 +- .../PPTXFormat/Logic/Path2D/CubicBezTo.h | 12 +- .../PPTXFormat/Logic/Path2D/LineTo.h | 4 +- .../PPTXFormat/Logic/Path2D/MoveTo.h | 4 +- .../PPTXFormat/Logic/Path2D/QuadBezTo.h | 8 +- ASCOfficePPTXFile/PPTXFormat/Logic/UniFill.h | 11 +- .../OfficeDrawing/Layout.cpp | 4 +- Common/DocxFormat/Source/Base/ASCString.h | 14 +- .../DocxFormat/Source/DocxFormat/CustomXml.h | 4 +- .../DocxFormat/Source/DocxFormat/Document.h | 2 +- Common/DocxFormat/Source/DocxFormat/Docx.h | 2 +- .../Source/DocxFormat/Drawing/Drawing.h | 2 +- .../DocxFormat/Drawing/DrawingParagraph.h | 2 +- .../DocxFormat/Logic/AlternateContent.cpp | 2 +- .../Source/DocxFormat/Logic/Dir.cpp | 4 +- .../DocxFormat/Source/DocxFormat/Logic/Pict.h | 4 +- .../Source/DocxFormat/Logic/RunContent.h | 8 +- .../DocxFormat/Source/DocxFormat/Logic/Sdt.h | 8 +- .../Source/DocxFormat/Logic/Vml.cpp | 2 +- .../Source/DocxFormat/Math/oMathContent.h | 2 +- Common/DocxFormat/Source/DocxFormat/Rels.h | 17 +- Common/DocxFormat/Source/DocxFormat/Styles.h | 2 +- Common/DocxFormat/Source/SystemUtility/File.h | 6 +- .../SystemUtility/FileSystem/Directory.cpp | 15 +- .../FileSystem/DirectoryPosix.cpp | 2 +- .../Source/SystemUtility/SystemUtility.cpp | 2 +- .../Source/SystemUtility/SystemUtility.h | 4 +- Common/DocxFormat/Source/XML/xmlutils.h | 2 +- .../XlsxFormat/Chart/ChartSerialize.cpp | 244 +++++++------- .../Source/XlsxFormat/Comments/Comments.h | 10 +- .../Source/XlsxFormat/Drawing/CellAnchor.h | 2 +- .../Source/XlsxFormat/Drawing/Drawing.h | 2 +- .../Source/XlsxFormat/Drawing/FromTo.h | 4 +- .../Source/XlsxFormat/Drawing/GraphicFrame.h | 4 +- .../Source/XlsxFormat/Drawing/Pic.h | 2 +- .../Source/XlsxFormat/Styles/Borders.h | 6 +- .../Source/XlsxFormat/Styles/CellStyles.h | 2 +- .../Source/XlsxFormat/Styles/Fills.h | 2 +- .../Source/XlsxFormat/Styles/Fonts.h | 14 +- .../Source/XlsxFormat/Styles/NumFmts.h | 4 +- .../Source/XlsxFormat/Styles/TableStyles.h | 10 +- .../DocxFormat/Source/XlsxFormat/Styles/Xfs.h | 22 +- .../DocxFormat/Source/XlsxFormat/Styles/rPr.h | 20 +- .../Source/XlsxFormat/Table/Autofilter.h | 32 +- .../Source/XlsxFormat/Table/Table.h | 16 +- .../Source/XlsxFormat/Workbook/DefinedNames.h | 2 +- .../Source/XlsxFormat/Workbook/Sheets.h | 6 +- .../Source/XlsxFormat/Workbook/WorkbookPr.h | 4 +- .../Source/XlsxFormat/Worksheets/Cols.h | 12 +- .../Worksheets/ConditionalFormatting.h | 16 +- .../Source/XlsxFormat/Worksheets/Hyperlinks.h | 10 +- .../Source/XlsxFormat/Worksheets/MergeCells.h | 2 +- .../Source/XlsxFormat/Worksheets/SheetData.h | 44 +-- .../Worksheets/WorksheetChildOther.h | 68 ++-- Common/DocxFormat/Source/XlsxFormat/Xlsx.h | 4 +- XlsxSerializerCom/Common/Common.h | 9 +- XlsxSerializerCom/Reader/BinaryWriter.h | 6 +- XlsxSerializerCom/Reader/CSVReader.cpp | 1 - .../Reader/ChartFromToBinary.cpp | 10 +- XlsxSerializerCom/Resource/theme1.xml | 2 + XlsxSerializerCom/Writer/BinaryReader.h | 55 +-- 109 files changed, 1044 insertions(+), 1690 deletions(-) delete mode 100644 ASCOfficeDocxFile2/BinReader/DefaultThemeWriterLinux.h delete mode 100644 ASCOfficeDocxFile2/BinReader/DefaultThemeWriterWin.h delete mode 100644 ASCOfficeDocxFile2/BinReader/webSettingsWriter.h create mode 100644 ASCOfficeDocxFile2/Resources/.rels create mode 100644 ASCOfficeDocxFile2/Resources/[Content_Types].xml create mode 100644 ASCOfficeDocxFile2/Resources/app.xml create mode 100644 ASCOfficeDocxFile2/Resources/core.xml create mode 100644 ASCOfficeDocxFile2/Resources/theme.xml create mode 100644 ASCOfficeDocxFile2/Resources/webSettings.xml create mode 100644 XlsxSerializerCom/Resource/theme1.xml diff --git a/.gitattributes b/.gitattributes index a4ed49c330..2029edb1ca 100644 --- a/.gitattributes +++ b/.gitattributes @@ -179,7 +179,6 @@ ASCOfficeDocFile/Tests/DocFileTest/bin/Debug/DocFileTest.pdb svn_mime_002dtype=a ASCOfficeDocFile/Tests/DocFileTest/bin/Debug/Interop.ASCDocFile.dll svn_mime_002dtype=application%2Foctet-stream ASCOfficeDocFile/Tests/DocFileTest/bin/Debug/TestFile.docx svn_mime_002dtype=application%2Foctet-stream ASCOfficeDocFile/Tests/DocFileTest/bin/Debug/test.doc svn_mime_002dtype=application%2Foctet-stream -ASCOfficeDocxFile2/BinReader/DefaultThemeWriterWin.h svn_mime_002dtype=application%2Foctet-stream ASCOfficeEWSEditor/ASCOfficeEWSEditor/Editor/Charts svnc_bugtraq_003anumber=true ASCOfficeFB2File/ASCOfficeFB2File/Resource/DocxTemplate.docx svn_mime_002dtype=application%2Foctet-stream ASCOfficeFB2File/ASCOfficeFB2FileTest/ASCOfficeFB2FileTest/bin/Release/AVSOfficeFB2FileTest.exe svn_mime_002dtype=application%2Foctet-stream diff --git a/.gitignore b/.gitignore index 95ab4fbf68..64c81c5a1e 100644 --- a/.gitignore +++ b/.gitignore @@ -52,7 +52,6 @@ ASCImageStudio3/AVSImageRaw3/trunk/workingcopy/lcmslib/release ASCOfficeDocxFile2/AVSOfficeDocxFile2.ncb ASCOfficeDocxFile2/AVSOfficeDocxFile2.suo ASCOfficeDocxFile2/AVSOfficeDocxFile2.vcproj.AVSMEDIA.Dmitry.Davydov.user -ASCOfficeDocxFile2/BinReader/DefaultThemeWriter.h ASCOfficeDocxFile2/Debug ASCOfficeDocxFile2/DocWrapper/Debug ASCOfficeDocxFile2/DocWrapper/Release diff --git a/ASCHTMLRenderer/CASCSVGRenderer.cpp b/ASCHTMLRenderer/CASCSVGRenderer.cpp index 32bbe8041c..6e02486387 100644 --- a/ASCHTMLRenderer/CASCSVGRenderer.cpp +++ b/ASCHTMLRenderer/CASCSVGRenderer.cpp @@ -32,7 +32,7 @@ namespace NSHtmlRenderer static CString g_string_svgOpen = _T("\n"); static CString g_bstr_svgClose = L""; - static CString g_string_image = _T("\n"); + static CString g_string_image = _T("\n"); static CString g_bstr_graphicOpen = L"\n"; static CString g_bstr_graphicClose = L"\n"; @@ -48,12 +48,12 @@ namespace NSHtmlRenderer static CString g_bstr_nodeClose = L" />\n"; static CString g_string_vml_StyleStroke = _T("style=\"fill:none;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf\" "); static CString g_string_vml_StyleStroke_class = _T("class=\"stroke%d\" style=\"fill:none;stroke-width:%dpx;stroke-opacity:%.2lf\" "); - static CString g_string_vml_StyleFill = _T("style=\"fill:#%06x;fill-opacity:%.2lf;fill-rule:%ls;stroke:none\" "); - static CString g_string_vml_StyleFill_class = _T("class=\"fill%d\" style=\"fill-opacity:%.2lf;fill-rule:%ls;stroke:none\" "); - static CString g_string_vml_Style = _T("style=\"fill:#%06x;fill-opacity:%.2lf;fill-rule:%ls;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf\" "); - static CString g_string_vml_Style1 = _T("class=\"stroke%d\" style=\"fill:#%06x;fill-opacity:%.2lf;fill-rule:%ls;stroke-width:%dpx;stroke-opacity:%.2lf\" "); - static CString g_string_vml_Style2 = _T("class=\"fill%d\" style=\"fill-opacity:%.2lf;fill-rule:%ls;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf\" "); - static CString g_string_vml_Style3 = _T("class=\"stroke%d fill%d\" style=\"fill-opacity:%.2lf;fill-rule:%ls;stroke-width:%dpx;stroke-opacity:%.2lf\" "); + static CString g_string_vml_StyleFill = _T("style=\"fill:#%06x;fill-opacity:%.2lf;fill-rule:%s;stroke:none\" "); + static CString g_string_vml_StyleFill_class = _T("class=\"fill%d\" style=\"fill-opacity:%.2lf;fill-rule:%s;stroke:none\" "); + static CString g_string_vml_Style = _T("style=\"fill:#%06x;fill-opacity:%.2lf;fill-rule:%s;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf\" "); + static CString g_string_vml_Style1 = _T("class=\"stroke%d\" style=\"fill:#%06x;fill-opacity:%.2lf;fill-rule:%s;stroke-width:%dpx;stroke-opacity:%.2lf\" "); + static CString g_string_vml_Style2 = _T("class=\"fill%d\" style=\"fill-opacity:%.2lf;fill-rule:%s;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf\" "); + static CString g_string_vml_Style3 = _T("class=\"stroke%d fill%d\" style=\"fill-opacity:%.2lf;fill-rule:%s;stroke-width:%dpx;stroke-opacity:%.2lf\" "); CASCSVGRenderer::CASCSVGRenderer() { diff --git a/ASCHTMLRenderer/Writer/Const.h b/ASCHTMLRenderer/Writer/Const.h index bf83931e71..8d72b2121e 100644 --- a/ASCHTMLRenderer/Writer/Const.h +++ b/ASCHTMLRenderer/Writer/Const.h @@ -54,7 +54,7 @@ static CString g_string_vml_LineTo = _T("l%d,%d "); static CString g_string_vml_CurveTo = _T("c%d,%d,%d,%d,%d,%d "); // text (ïîòîì çàìåíèòü íà "óìíîå" ðàñïîëîæåíèå òåêñòà) -static CString g_string_text = _T("

%ls

\n"); +static CString g_string_text = _T("

%s

\n"); // image static CString g_string_image = _T("\n"; static CString g_string_shape = _T("\n"); -static CString g_string_shape_vml = _T("\n"); -static CString g_string_shape_vmlTexture = _T("\n"); -static CString g_string_shape_vmlAlpha = _T("\n"); +static CString g_string_shape_vml = _T("\n"); +static CString g_string_shape_vmlTexture = _T("\n"); +static CString g_string_shape_vmlAlpha = _T("\n"); static CString g_bstr_shape_closecanvas = L"\n"; -static CString g_string_rect = _T("
\n"); +static CString g_string_rect = _T("
\n"); // new static CString g_string_graphic_page = _T("\n"); @@ -76,20 +76,20 @@ static CString g_string_page_method = _T("function _tx%d(){\n"); static CString g_string_canvas_page_script2 = _T("function drawpage%d()\n{\nvar drawingCanvas = document.getElementById('page%d_2D');\nif(drawingCanvas && drawingCanvas.getContext)\n{\nvar c = drawingCanvas.getContext('2d');\n"); static CString g_bstr_paragraph1 = _T("

"); -static CString g_string_paragraph2 = _T("

"); -static CString g_string_paragraph3 = _T("

"); -static CString g_string_paragraph4 = _T("

"); -static CString g_string_paragraph5 = _T("

"); -static CString g_string_paragraph6 = _T("

"); +static CString g_string_paragraph2 = _T("

"); +static CString g_string_paragraph3 = _T("

"); +static CString g_string_paragraph4 = _T("

"); +static CString g_string_paragraph5 = _T("

"); +static CString g_string_paragraph6 = _T("

"); static CString g_string_paragraph_style = _T("

"); static CString g_string_paragraph_style_underline = _T("

"); static CString g_string_paragraph_style_strike = _T("

"); static CString g_string_paragraph_style_underline_strike = _T("

"); -static CString g_string_text_css = _T("font-family: %ls; font-size: %dpx; color:#%06x; font-style:normal; font-weight:normal;"); -static CString g_string_text_css_ib = _T("font-family: %ls; font-size: %dpx; color:#%06x; font-style:italic; font-weight:bold;"); -static CString g_string_text_css_i = _T("font-family: %ls; font-size: %dpx; color:#%06x; font-style:italic; font-weight:normal;"); -static CString g_string_text_css_b = _T("font-family: %ls; font-size: %dpx; color:#%06x; font-weight:bold; font-style:normal;"); +static CString g_string_text_css = _T("font-family: %s; font-size: %dpx; color:#%06x; font-style:normal; font-weight:normal;"); +static CString g_string_text_css_ib = _T("font-family: %s; font-size: %dpx; color:#%06x; font-style:italic; font-weight:bold;"); +static CString g_string_text_css_i = _T("font-family: %s; font-size: %dpx; color:#%06x; font-style:italic; font-weight:normal;"); +static CString g_string_text_css_b = _T("font-family: %s; font-size: %dpx; color:#%06x; font-weight:bold; font-style:normal;"); static CString g_string_style_name = _T(".s%d {"); static CString g_bstr_paragraph_end = _T("

\n"); @@ -102,8 +102,8 @@ static CString g_string_lineFunc = _T("mt(\"l%d\",%d);"); static CString g_bstr_lineMeasure = L"function mt(id,size){var el = document.getElementById(id);if (el.offsetWidth < size){el.className=\"pa\";el.style.width=size;}}\n"; static CString g_string_span1 = _T(""); -static CString g_string_span2 = _T(""); -static CString g_string_span3 = _T(""); +static CString g_string_span2 = _T(""); +static CString g_string_span3 = _T(""); static CString g_string_span_style = _T(""); static CString g_string_span_style_underline = _T(""); static CString g_string_span_style_strike = _T(""); diff --git a/ASCHTMLRenderer/Writer/SVGWriter.h b/ASCHTMLRenderer/Writer/SVGWriter.h index 2e182fdfea..9af9ce55d1 100644 --- a/ASCHTMLRenderer/Writer/SVGWriter.h +++ b/ASCHTMLRenderer/Writer/SVGWriter.h @@ -10,7 +10,7 @@ namespace NSHtmlRenderer static CString g_svg_string_svgOpen = _T("\n"); static CString g_svg_bstr_svgClose = L""; - static CString g_svg_string_image = _T("\n"); + static CString g_svg_string_image = _T("\n"); static CString g_svg_bstr_graphicOpen = L"\n"; static CString g_svg_bstr_graphicClose = L"\n"; @@ -33,8 +33,8 @@ namespace NSHtmlRenderer static CString g_svg_bstr_nodeClose = L" />\n"; static CString g_svg_string_vml_StyleStrokeDash = _T("style=\"fill:none;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf;stroke-dasharray: 2,2;\" "); static CString g_svg_string_vml_StyleStroke = _T("style=\"fill:none;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf;\" "); - static CString g_svg_string_vml_StyleFill = _T("style=\"fill:#%06x;fill-opacity:%.2lf;fill-rule:%ls;stroke:none\" "); - static CString g_svg_string_vml_Style = _T("style=\"fill:#%06x;fill-opacity:%.2lf;fill-rule:%ls;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf\" "); + static CString g_svg_string_vml_StyleFill = _T("style=\"fill:#%06x;fill-opacity:%.2lf;fill-rule:%s;stroke:none\" "); + static CString g_svg_string_vml_Style = _T("style=\"fill:#%06x;fill-opacity:%.2lf;fill-rule:%s;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf\" "); static CString g_svg_string_image_clip_jpg = _T(""); static CString g_svg_string_image_clip_jpg_rot = _T(""); @@ -70,8 +70,8 @@ namespace NSHtmlRenderer "); - static CString g_svg_string_vml_StyleFillTx = _T("style=\"fill:url(#pt%d);fill-opacity:%.2lf;fill-rule:%ls;stroke:none;\" "); - static CString g_svg_string_vml_StyleTx = _T("style=\"fill:url(#pt%d);fill-opacity:%.2lf;fill-rule:%ls;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf\" "); + static CString g_svg_string_vml_StyleFillTx = _T("style=\"fill:url(#pt%d);fill-opacity:%.2lf;fill-rule:%s;stroke:none;\" "); + static CString g_svg_string_vml_StyleTx = _T("style=\"fill:url(#pt%d);fill-opacity:%.2lf;fill-rule:%s;stroke:#%06x;stroke-width:%dpx;stroke-opacity:%.2lf\" "); static CString g_svg_object_start = _T(""); static CString g_svg_object_end = L""; diff --git a/ASCHTMLRenderer/Writer/VMLWriter.h b/ASCHTMLRenderer/Writer/VMLWriter.h index 4ffb3cbbc0..bac0e2d67d 100644 --- a/ASCHTMLRenderer/Writer/VMLWriter.h +++ b/ASCHTMLRenderer/Writer/VMLWriter.h @@ -11,14 +11,14 @@ namespace NSHtmlRenderer static CString g_vml_string_LineTo = _T("l%d,%d "); static CString g_vml_string_CurveTo = _T("c%d,%d,%d,%d,%d,%d "); - static CString g_vml_string_shape_vml = _T("\n"); - static CString g_vml_string_shape_vml_Dash = _T("\n"); + static CString g_vml_string_shape_vml = _T("\n"); + static CString g_vml_string_shape_vml_Dash = _T("\n"); - static CString g_vml_string_shape_vmlTextureJPG = _T("\n"); - static CString g_vml_string_shape_vmlTexturePNG = _T("\n"); + static CString g_vml_string_shape_vmlTextureJPG = _T("\n"); + static CString g_vml_string_shape_vmlTexturePNG = _T("\n"); - static CString g_vml_string_shape_vmlAlpha = _T("\n"); - static CString g_vml_string_shape_vmlAlphaDash = _T("\n"); + static CString g_vml_string_shape_vmlAlpha = _T("\n"); + static CString g_vml_string_shape_vmlAlphaDash = _T("\n"); static CString g_vml_string_shape_image_jpg = _T(""); static CString g_vml_string_shape_image_png = _T(""); diff --git a/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/WmfFile.h b/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/WmfFile.h index 55d011f7a7..d0a0f1030c 100644 --- a/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/WmfFile.h +++ b/ASCImageStudio3/ASCGraphics/Objects/Image/Wmf/WmfFile.h @@ -668,14 +668,14 @@ private: if ( 0 == sName ) return; - fprintf( pInfo->pFile, " <%s", sName ); + fprintf( pInfo->pFile, " <%s", sName ); if ( psAttrs ) { psAttr = psAttrs; while ( *psAttr ) { - fprintf( pInfo->pFile, " %s=\"", *psAttr++ ); + fprintf( pInfo->pFile, " %s=\"", *psAttr++ ); if ( *psAttr ) fputs ( *psAttr, pInfo->pFile ); fputs ( "\"", pInfo->pFile ); @@ -691,7 +691,7 @@ private: if ( sBuffer && ulLength ) WriteB64( sBuffer, ulLength ); - fprintf( pInfo->pFile, " \n", sName ); + fprintf( pInfo->pFile, " \n", sName ); } AVSINLINE void WriteBegin(const char *sFileName) @@ -4083,7 +4083,7 @@ private: USES_CONVERSION; ::SysFreeString( bsFontName ); CString sXml; - sXml.Format( _T(""), A2W(pFont->sFaceName), pFont->unCharSet, pFont->ushWeight); + sXml.Format( _T(""), A2W(pFont->sFaceName), pFont->unCharSet, pFont->ushWeight); BSTR bsXml = sXml.AllocSysString(); BSTR bsPath; LONG lIndex = 0; diff --git a/ASCOfficeDocxFile2/ASCOfficeDocxFile2.rc b/ASCOfficeDocxFile2/ASCOfficeDocxFile2.rc index 586bd36887..1f5b2ffc02 100644 --- a/ASCOfficeDocxFile2/ASCOfficeDocxFile2.rc +++ b/ASCOfficeDocxFile2/ASCOfficeDocxFile2.rc @@ -137,6 +137,12 @@ END // Generated from the TEXTINCLUDE 3 resource. // +IDB_DEFAULT_DOC_RELS DOCXWR "Resources\\.rels" +IDB_DEFAULT_DOC_APP DOCXWR "Resources\\app.xml" +IDB_DEFAULT_DOC_CORE DOCXWR "Resources\\core.xml" +IDB_DEFAULT_DOC_THEME DOCXWR "Resources\\theme.xml" +IDB_DEFAULT_DOC_WEBSETTINGS DOCXWR "Resources\\webSettings.xml" +IDB_DEFAULT_XLSX_THEME XLSXSER "..\\XlsxSerializerCom\\Resource\\theme1.xml" IDB_XML_NOTESTHEME PPTXW "..\\ASCOfficePPTXFile\\Editor\\ResourceFiles\\notesTheme.xml" IDB_XML_NOTESMASTER PPTXW "..\\ASCOfficePPTXFile\\Editor\\ResourceFiles\\notesMaster.xml" ///////////////////////////////////////////////////////////////////////////// diff --git a/ASCOfficeDocxFile2/BinReader/ChartWriter.h b/ASCOfficeDocxFile2/BinReader/ChartWriter.h index 90629a18a8..53d14634c6 100644 --- a/ASCOfficeDocxFile2/BinReader/ChartWriter.h +++ b/ASCOfficeDocxFile2/BinReader/ChartWriter.h @@ -47,10 +47,8 @@ namespace Writers CString sRelPath = _T("/word/charts/") + elem->filename; CString sAbsPath = m_sDir + sRelPath; - OOX::CPath filePath = sAbsPath; - CFile oFile; - oFile.CreateFile(filePath.GetPath()); + oFile.CreateFile(sAbsPath); oFile.WriteStringUTF8(CString(_T("\r\n"))); oFile.WriteStringUTF8(elem->content); oFile.CloseFile(); diff --git a/ASCOfficeDocxFile2/BinReader/CommentsWriter.h b/ASCOfficeDocxFile2/BinReader/CommentsWriter.h index a24327da13..07d145a707 100644 --- a/ASCOfficeDocxFile2/BinReader/CommentsWriter.h +++ b/ASCOfficeDocxFile2/BinReader/CommentsWriter.h @@ -34,13 +34,11 @@ namespace Writers { if(false == m_sComment.IsEmpty()) { - OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("comments.xml"); - CFile oFile; - oFile.CreateFile(filePath.GetPath()); - oFile.WriteStringUTF8(g_string_comment_Start); - oFile.WriteStringUTF8(m_sComment); - oFile.WriteStringUTF8(g_string_comment_End); + oFile.CreateFile(m_sDir + _T("\\word\\comments.xml")); + oFile.WriteStringUTF8(g_string_comment_Start); + oFile.WriteStringUTF8(m_sComment); + oFile.WriteStringUTF8(g_string_comment_End); oFile.CloseFile(); //Content_Types @@ -52,7 +50,7 @@ namespace Writers if(false == m_sCommentExt.IsEmpty()) { CFile oFile; - oFile.CreateFile(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("commentsExtended.xml")); + oFile.CreateFile(m_sDir + _T("\\word\\commentsExtended.xml")); oFile.WriteStringUTF8(g_string_commentExt_Start); oFile.WriteStringUTF8(m_sCommentExt); oFile.WriteStringUTF8(g_string_commentExt_End); @@ -64,7 +62,7 @@ namespace Writers if(false == m_sPeople.IsEmpty()) { CFile oFile; - oFile.CreateFile(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("people.xml")); + oFile.CreateFile(m_sDir + _T("\\word\\people.xml")); oFile.WriteStringUTF8(g_string_people_Start); oFile.WriteStringUTF8(m_sPeople); oFile.WriteStringUTF8(g_string_people_End); @@ -76,4 +74,4 @@ namespace Writers } }; } -#endif // #ifndef COMMENTS_WRITER +#endif // #ifndef COMMENTS_WRITER \ No newline at end of file diff --git a/ASCOfficeDocxFile2/BinReader/ContentTypesWriter.h b/ASCOfficeDocxFile2/BinReader/ContentTypesWriter.h index e6fa3265e4..a36265c6fa 100644 --- a/ASCOfficeDocxFile2/BinReader/ContentTypesWriter.h +++ b/ASCOfficeDocxFile2/BinReader/ContentTypesWriter.h @@ -27,17 +27,15 @@ namespace Writers m_oWriter.Write(m_oAdditional); m_oWriter.WriteString(g_string_ct_End); - OOX::CPath filePath = m_sDir + _T("/[Content_Types].xml"); - CFile oFile; - oFile.CreateFile(filePath.GetPath()); + oFile.CreateFile (m_sDir + _T("/[Content_Types].xml")); oFile.WriteStringUTF8(m_oWriter.GetData()); oFile.CloseFile(); } void AddOverride(const CString& PartName, const CString& ContentType) { - CString sOverride;sOverride.Format(_T(""),PartName , ContentType); + CString sOverride;sOverride.Format(_T(""),PartName , ContentType); m_oAdditional.WriteString(sOverride); } void AddOverrideRaw(const CString& sXml) diff --git a/ASCOfficeDocxFile2/BinReader/DefaultThemeWriterLinux.h b/ASCOfficeDocxFile2/BinReader/DefaultThemeWriterLinux.h deleted file mode 100644 index 8affd67433..0000000000 --- a/ASCOfficeDocxFile2/BinReader/DefaultThemeWriterLinux.h +++ /dev/null @@ -1,315 +0,0 @@ -#ifndef DEFAULTTHEMEWRITER_H -#define DEFAULTTHEMEWRITER_H - -#include "../../XlsxSerializerCom/Common/Common.h" - -namespace Writers -{ - class DefaultThemeWriter - { - XmlUtils::CStringWriter m_oWriter; - public: - DefaultThemeWriter() - { - } - void Write(CString sThemeFilePath) - { - CString s_Common; - - s_Common = _T(" \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - "); -s_Common += - _T(" \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - "); -s_Common += - _T(" \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ -"); - - m_oWriter.WriteString(s_Common); - - OOX::CPath fileName = sThemeFilePath; - - CFile oFile; - oFile.CreateFile(fileName.GetPath()); - oFile.WriteStringUTF8(m_oWriter.GetData()); - oFile.CloseFile(); - } - }; -} - -#endif // DEFAULTTHEMEWRITER_H diff --git a/ASCOfficeDocxFile2/BinReader/DefaultThemeWriterWin.h b/ASCOfficeDocxFile2/BinReader/DefaultThemeWriterWin.h deleted file mode 100644 index fbfa676c1eb618dc93c77f79de32b608157cc032..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23946 zcmeHP+io058LrzwV(+*_Y9%*DXnlws6Nl_Bjx$b{tk;q4B#T%n8r$PTJf5*;hJ=9f z1iS&yfCLvH#5EUOBk=${3E}(d@88uu-Cfl^-O0w@(a7#ORQ>1rPhDN_{&&-ynj_OU zho*~bWFDBd*);3ssrkz6nHTtbgm1R+_rg3kJLXG#)5i6O<_G3xJnIzmyA|ike9k;D zJ@Xq2DKaN#wzA_ZMVdP!QvFJXEDe7C@cH-G57%_%@-GwDC;Fp8g zR%l7{z;j{g6JCz+c?hm3NBMOKdKW;`5Z}Fy=_l6<<`(!{G^=>W@#KtLMYxJh3zyrl z(j)vTw(WGrv5phk+9Wq^U=hChmYVcvH-js62rE{;xaNy#$l@g=2kp?DL3deP=}{x| z2J+dkn5lniO!yTU9YT(;q2DevGLGfa!zk)lX31zuP+z2Mp#bwe{6by(s1y0o8#G0~ z=rfP*O<1nJ%FykjO6VqMw+gs-+8II9$M8FOl3xNvD`w673|^=VO+JiHmi1_ABPz8) zZ5ui%Llfmxgi&Z>l;B$8nkb{^VtK7VUUvZFeo1+i!JMVBh?{ac-N5R&jlY#CXe`2< zrE$5I-K{}_eBFlamC$vox;OqHz=6Wz9;mI*mn`g~k&^5XR86TJ&iwp>HlD!w^=Xjafkt8Fv#D(h~XN zwG4$}+!`CRc>tsM4P=9o*=6&&pCV>6-;>zxGCM|E;-!ymDz9LU^wMTmn=#~2j={Lg zOuY~K#>h9Ar!nKF_m}Kp1E0AU53k@@T5-xvS6_~*rPRQqr~f=rl~6H*ap|Nh4>{uP=3{^>`5YYLxc z^!Ysg;n%y{O<~duG#}Gnx{Gf=Ir`5Z>tkDoE<3PCpB(pK(Ngh7=4)8;Ye;+tD}w7o zv|f}0I~(@vvTIkwcS!@Q99Bd=8rH4FjV#w(ks^!wI%s1hodj@y4R6AVrQ`L$<>Y#xM3NeE8a+=K}I)CxE@S`r6#E(ERrE#I6p; z{|;o!YO9O)5pq*fGK7xLaP2lg&9A@}Up^UZ;djQ#0c15m4nRscFM_qv&opD@^vwH! zRh5!Qm`CqTe?q@fUqj+Q{dT`)o>~66=9;iYb}re+@pDgmph=A0*nzp3DCp7&)oMZ;2#IHkQYmI z9;3fc8(L|Xt!1TqK+n~OhKA@#NKM^L<;%4ywXct6m&IP6%J-9_A0LgSEicf{q7+mHhG-Yvh+F5@A%f>$63ohfEHO* zK0!p&s9vutGpl58AfugCvU%CZtdgBovg$GQ8jiZNO1Ai3#jKLm9a3sfdJWsvtdcEL z$u^l^YW3->L-OK=&MRNFhU-wRa5ZO3-u?Z&!oB3=K0&#ge2(fN39Zf^HSVYD;l-Vs zZ*c8mS1fyIp}LygV^+>fP_AM91~eox2VA(y+zvfHW*cgK)iNP21S!5I;7u^X?u_{g~*TN*|+nU;g> zG{%0SRIACIiQGpeuaKUUR=uhnurJI$8u#WVAunG-_V4LXczV^D?$(0z<#_+53-6@kLVnKCl#VXNnii^N z(MX;@P|Ga3s>L!k^KM=`YTU-&W2eC;SHhBU5h-K?N!ryO-tS5vMzy2KOhR`@er)k* zWb>=64%aRvT}94L0=&DMpHp029jaA-d|5@Y7FXWmO4O)S#X>&JN>nT#E+&QZV@Fe& zn53htRfHN_`;{xm9^!C>J)06?*O1HH!XGsop-N;0CchjZ5_4tiFWhIKad~88x%|S2 zeT>gC>i{$44s>w@PWp~&)ogNR^Ld{?)=^T`W1Ye*_L1^*jCz_fF;p$4YK(L9s!3gV zxPV^Sq2Qe*dZBbC;Q9d}AE8vx4vTHX*|)P*+NpRswaM#gtsxsw2|Afq=>>iFdR(^8 ztf|FcU$1jr^r-g66e`d9=;K1(FP=}pBELp4!d8T zl&QW%qm1?J6?2D3x_hWqPssZ#JYLnV(oY13Y0`OFefj6=yrgY~EF^D^v*luZz7{Qas=ZXpV`^O zC)x8%PZ-AKsFeGg5qvMJKf$7QDyPGwzZ-(KSE+HK3{r53=F;4S=@gl;JJ0>*V`Mmd z$9#lWp^Wk%RXmqRI|0c^Am4>?H6xRy%sqoD@|on+Pqlj4DwZY^_rY~KiMg2Hkby~lbg{^BLYhivrBbw`4re-^Ww9sHk(0YTd^2QsS^AD$s5>{?qnO>Jn6`qD zPPu0F6^_knM`C+rVXHM{<6N;lIGUP>%~#I@Yu}`rq$#zK7M*Xe2K&QkQL$V_4?O9a zL;g2CKD3%tGEIA5giuDfAF@G6HKAtM#PH7%x z&Ucj=a!M?thwP)@MbuP`Qqd;mo24rGWP&@tID2;UeBwl9*39hIa9`ydviS5_$9iU- zI~`Abn!9eBZJa1AXGlM}%pxTIcX6JT^vmSbWZ!Ac?%ZVuJN<4WuJpNsaB%rv=A}ov zPj1{iq{==NvzzYa>^bO#&p^Vg diff --git a/ASCOfficeDocxFile2/BinReader/DocumentRelsWriter.h b/ASCOfficeDocxFile2/BinReader/DocumentRelsWriter.h index 3cd2485999..cb53cc5b75 100644 --- a/ASCOfficeDocxFile2/BinReader/DocumentRelsWriter.h +++ b/ASCOfficeDocxFile2/BinReader/DocumentRelsWriter.h @@ -9,30 +9,57 @@ namespace Writers { XmlUtils::CStringWriter m_oWriter; CString m_sDir; + int m_nRid; + std::vector m_aRels; + bool bDocumentRels; public: - DocumentRelsWriter(CString sDir):m_sDir(sDir) + DocumentRelsWriter(CString sDir, bool bDocumentRels, int nRid = 1):m_sDir(sDir),bDocumentRels(bDocumentRels) { + m_nRid = nRid; } - void Write() + void Write(CString sFileName) { - CString s_Common; + CString s_dr_Start; + CString s_dr_End; + if(true == bDocumentRels) + { + s_dr_Start = _T(""); + s_dr_End = _T(""); + } + else + { + s_dr_Start = _T(""); + s_dr_End = _T(""); + } + if(m_nRid > 1) + { + m_oWriter.WriteString(s_dr_Start); + for(int i = 0, length = m_aRels.size(); i < length; ++i) + { + m_oWriter.WriteString(m_aRels[i]); + } + m_oWriter.WriteString(s_dr_End); - s_Common = _T(" \ - \ - \ - \ - \ -"); - - m_oWriter.WriteString(s_Common); - - OOX::CPath fileName = m_sDir + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR + _T(".rels"); - - CFile oFile; - oFile.CreateFile(fileName.GetPath()); - oFile.WriteStringUTF8(m_oWriter.GetData()); - oFile.CloseFile(); + CFile oFile; + oFile.CreateFile(m_sDir + _T("\\word\\_rels\\") + sFileName); + oFile.WriteStringUTF8(m_oWriter.GetData()); + oFile.CloseFile(); + } + } + CString AddRels(CString sType, CString sTarget, bool bExternal = false) + { + sType = XmlUtils::EncodeXmlString(sType); + sTarget = XmlUtils::EncodeXmlString(sTarget); + CString srId;srId.Format(_T("rId%d"), m_nRid); + CString sRels; + if(bExternal) + sRels.Format(_T(""), srId, sType, sTarget); + else + sRels.Format(_T(""), srId, sType, sTarget); + m_nRid++; + m_aRels.push_back(sRels); + return srId; } }; } -#endif // #ifndef DOCUMENT_RELS_WRITER +#endif // #ifndef DOCUMENT_RELS_WRITER \ No newline at end of file diff --git a/ASCOfficeDocxFile2/BinReader/DocumentWriter.h b/ASCOfficeDocxFile2/BinReader/DocumentWriter.h index eeccc5ecce..3eb150225a 100644 --- a/ASCOfficeDocxFile2/BinReader/DocumentWriter.h +++ b/ASCOfficeDocxFile2/BinReader/DocumentWriter.h @@ -3,7 +3,6 @@ #include "../../XlsxSerializerCom/Common/Common.h" #include "../BinWriter/BinReaderWriterDefines.h"; - namespace Writers { class DocumentWriter : public ContentWriter @@ -18,17 +17,15 @@ namespace Writers } void Write() { - OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + _T("word") +FILE_SEPARATOR_STR + _T("document.xml"); - CFile oFile; - oFile.CreateFile(filePath.GetPath()); - oFile.WriteStringUTF8(CString(_T(""))); - oFile.WriteStringUTF8(m_oContent.GetData()); - oFile.WriteStringUTF8(CString(_T(""))); - oFile.WriteStringUTF8(WriteSectPrHdrFtr()); - oFile.WriteStringUTF8(m_oSecPr.GetData()); - oFile.WriteStringUTF8(CString(_T(""))); - oFile.WriteStringUTF8(CString(_T(""))); + oFile.CreateFile(m_sDir + _T("\\word\\document.xml")); + oFile.WriteStringUTF8(CString(_T(""))); + oFile.WriteStringUTF8(m_oContent.GetData()); + oFile.WriteStringUTF8(CString(_T(""))); + oFile.WriteStringUTF8(WriteSectPrHdrFtr()); + oFile.WriteStringUTF8(m_oSecPr.GetData()); + oFile.WriteStringUTF8(CString(_T(""))); + oFile.WriteStringUTF8(CString(_T(""))); oFile.CloseFile(); } CString WriteSectPrHdrFtr() @@ -84,4 +81,4 @@ namespace Writers } }; } -#endif // #ifndef DOCUMENT_WRITER +#endif // #ifndef DOCUMENT_WRITER \ No newline at end of file diff --git a/ASCOfficeDocxFile2/BinReader/FileWriter.h b/ASCOfficeDocxFile2/BinReader/FileWriter.h index f98ebbaa77..96469389e1 100644 --- a/ASCOfficeDocxFile2/BinReader/FileWriter.h +++ b/ASCOfficeDocxFile2/BinReader/FileWriter.h @@ -10,15 +10,7 @@ #include "SettingWriter.h" #include "CommentsWriter.h" #include "ChartWriter.h" -#include "ChartWriter.h" -#include "DocumentRelsWriter.h" -#include "webSettingsWriter.h" -#ifdef _WIN32 - #include "DefaultThemeWriterWin.h" -#else - #include "DefaultThemeWriterLinux.h" -#endif namespace BinDocxRW { class CComments; } @@ -30,21 +22,16 @@ namespace Writers NSBinPptxRW::CDrawingConverter* m_pDrawingConverter; CString m_sThemePath; bool m_bSaveChartAsImg; - - ContentTypesWriter m_oContentTypesWriter; - FontTableWriter m_oFontTableWriter; - DocumentWriter m_oDocumentWriter; - MediaWriter m_oMediaWriter; - StylesWriter m_oStylesWriter; - NumberingWriter m_oNumberingWriter; - HeaderFooterWriter m_oHeaderFooterWriter; - SettingWriter m_oSettingWriter; - CommentsWriter m_oCommentsWriter; - ChartWriter m_oChartWriter; - DocumentRelsWriter m_oDocumentRelsWriter; - WebSettingsWriter m_oWebSettingsWriter; - DefaultThemeWriter m_oDefaultTheme; - + ContentTypesWriter m_oContentTypesWriter; + FontTableWriter m_oFontTableWriter; + DocumentWriter m_oDocumentWriter; + MediaWriter m_oMediaWriter; + StylesWriter m_oStylesWriter; + NumberingWriter m_oNumberingWriter; + HeaderFooterWriter m_oHeaderFooterWriter; + SettingWriter m_oSettingWriter; + CommentsWriter m_oCommentsWriter; + ChartWriter m_oChartWriter; int m_nDocPrIndex; BinDocxRW::CComments* m_pComments; public: @@ -59,8 +46,6 @@ namespace Writers m_oSettingWriter(sDirOutput, m_oHeaderFooterWriter), m_oCommentsWriter(sDirOutput, m_oContentTypesWriter), m_oChartWriter(sDirOutput, m_oContentTypesWriter), - m_oDocumentRelsWriter(sDirOutput), - m_oWebSettingsWriter(sDirOutput), m_nDocPrIndex(0), m_pComments(NULL) { diff --git a/ASCOfficeDocxFile2/BinReader/HeaderFooterWriter.h b/ASCOfficeDocxFile2/BinReader/HeaderFooterWriter.h index d79c60c492..9d5d2e06f6 100644 --- a/ASCOfficeDocxFile2/BinReader/HeaderFooterWriter.h +++ b/ASCOfficeDocxFile2/BinReader/HeaderFooterWriter.h @@ -68,11 +68,8 @@ namespace Writers } void WriteItem(CString sHeader, CString& sFilename, ContentWriter& m_oWriter, bool bHeader) { - OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + sFilename; - CFile oFile; - oFile.CreateFile(filePath.GetPath()); - + oFile.CreateFile(m_sDir + _T("\\word\\" + sFilename)); if(bHeader) oFile.WriteStringUTF8(g_string_hdr_Start); else @@ -92,4 +89,4 @@ namespace Writers } }; } -#endif // #ifndef HEADER_FOOTER_WRITER +#endif // #ifndef HEADER_FOOTER_WRITER \ No newline at end of file diff --git a/ASCOfficeDocxFile2/BinReader/MediaWriter.h b/ASCOfficeDocxFile2/BinReader/MediaWriter.h index 3bc9b13f48..fcb32810a8 100644 --- a/ASCOfficeDocxFile2/BinReader/MediaWriter.h +++ b/ASCOfficeDocxFile2/BinReader/MediaWriter.h @@ -17,17 +17,15 @@ namespace Writers MediaWriter(CString sDir):m_sDir(sDir) { nImageCount = 0; - - OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("media"); - - m_sMediaDir = filePath.GetPath(); + m_sMediaDir = m_sDir + _T("\\word\\media"); } CString AddImageGetNewPath() { - OOX::CSystemUtility::CreateDirectories(m_sMediaDir); + if( !NSDirectory::Exists(string2std_string(m_sMediaDir)) ) + OOX::CSystemUtility::CreateDirectories(m_sMediaDir); CString sNewImgName;sNewImgName.Format(_T("image%d.jpg"), (nImageCount + 1)); - CString sNewImg = m_sMediaDir + FILE_SEPARATOR_STR + sNewImgName; + CString sNewImg = m_sMediaDir + _T("/") + sNewImgName; nImageCount++; return sNewImg; } @@ -54,10 +52,10 @@ namespace Writers } void AddImage(const CString& sImg) { - OOX::CPath pathNewImg = AddImageGetNewPath(); + CString sNewImg = AddImageGetNewPath(); - NSFile::CFileBinary::Copy(string2std_string(sImg), string2std_string(pathNewImg.GetPath())); - CString sFilename = NSSystemPath::GetFileName(string2std_string(pathNewImg.GetPath())).c_str(); + NSFile::CFileBinary::Copy(string2std_string(sImg), string2std_string(sNewImg)); + CString sFilename = NSSystemPath::GetFileName(string2std_string(sNewImg)).c_str(); m_aImageNames.push_back(sFilename); } }; diff --git a/ASCOfficeDocxFile2/BinReader/NumberingWriter.h b/ASCOfficeDocxFile2/BinReader/NumberingWriter.h index 9834950439..2dd140b2c1 100644 --- a/ASCOfficeDocxFile2/BinReader/NumberingWriter.h +++ b/ASCOfficeDocxFile2/BinReader/NumberingWriter.h @@ -34,11 +34,8 @@ namespace Writers m_oWriter.Write(m_oNumList); m_oWriter.WriteString(g_string_n_End); - OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + _T("numbering.xml"); - CFile oFile; - oFile.CreateFile(filePath.GetPath()); - + oFile.CreateFile(m_sDir + _T("\\word\\numbering.xml")); oFile.WriteStringUTF8(m_oWriter.GetData()); oFile.CloseFile(); @@ -50,4 +47,4 @@ namespace Writers } }; } -#endif // #ifndef NUMBERING_WRITER +#endif // #ifndef NUMBERING_WRITER \ No newline at end of file diff --git a/ASCOfficeDocxFile2/BinReader/ReaderClasses.h b/ASCOfficeDocxFile2/BinReader/ReaderClasses.h index b6f7fef081..1b249a5c30 100644 --- a/ASCOfficeDocxFile2/BinReader/ReaderClasses.h +++ b/ASCOfficeDocxFile2/BinReader/ReaderClasses.h @@ -72,7 +72,7 @@ public: case 4: sType = _T("oddPage");break; default: sType = _T("nextPage");break; } - sRes.AppendFormat(_T(""), (const TCHAR *) sType); + sRes.AppendFormat(_T(""), (const TCHAR *) sType); } if(orientation_Portrait == cOrientation) sRes.AppendFormat(_T(""), nWidth, nHeight); @@ -238,17 +238,17 @@ public: { sShd.Append(_T("")); } @@ -398,7 +398,7 @@ public: pCStringWriter->WriteString(CString(_T(""))); if(bRStyle) { - CString sRStyle;sRStyle.Format(_T(""), RStyle); + CString sRStyle;sRStyle.Format(_T(""), RStyle); pCStringWriter->WriteString(sRStyle); } if(bFontAscii || bFontHAnsi || bFontAE || bFontCS || bFontHint) @@ -406,22 +406,22 @@ public: CString sFont = _T("")); pCStringWriter->WriteString(sColor); @@ -579,14 +579,14 @@ public: if(!sColor.IsEmpty()) { CString sHighLight; - sHighLight.Format(_T(""), sColor); + sHighLight.Format(_T(""), sColor); pCStringWriter->WriteString(sHighLight); } else if(g_nCurFormatVersion < 5) { //äîáàâëÿåì êàê shading CString sShd; - sShd.Format(_T(""), H.ToString()); + sShd.Format(_T(""), H.ToString()); pCStringWriter->WriteString(sShd); } } @@ -630,17 +630,17 @@ public: pCStringWriter->WriteString(CString(_T("WriteString(sLang); } if(bLangBidi) { - CString sLang;sLang.Format(_T(" w:bidi=\"%ls\""), LangBidi); + CString sLang;sLang.Format(_T(" w:bidi=\"%s\""), LangBidi); pCStringWriter->WriteString(sLang); } if(bLangEA) { - CString sLang;sLang.Format(_T(" w:eastAsia=\"%ls\""), LangEA); + CString sLang;sLang.Format(_T(" w:eastAsia=\"%s\""), LangEA); pCStringWriter->WriteString(sLang); } pCStringWriter->WriteString(CString(_T("/>"))); @@ -700,23 +700,23 @@ public: { CString sStyle; if(bDefault) - sStyle.Format(_T(""), sType, Id); + sStyle.Format(_T(""), sType, Id); else - sStyle.Format(_T(""), sType, Id); + sStyle.Format(_T(""), sType, Id); pCStringWriter->WriteString(CString(sStyle)); if(!Name.IsEmpty()) { - sStyle.Format(_T(""), Name); + sStyle.Format(_T(""), Name); pCStringWriter->WriteString(CString(sStyle)); } if(!BasedOn.IsEmpty()) { - sStyle.Format(_T(""), BasedOn); + sStyle.Format(_T(""), BasedOn); pCStringWriter->WriteString(CString(sStyle)); } if(!NextId.IsEmpty()) { - sStyle.Format(_T(""), NextId); + sStyle.Format(_T(""), NextId); pCStringWriter->WriteString(CString(sStyle)); } if(bqFormat) @@ -858,7 +858,7 @@ public: __int64 nWidth = (__int64)(g_dKoef_mm_to_emu * Width); __int64 nHeight = (__int64)(g_dKoef_mm_to_emu * Height); CString sDrawing; - sDrawing.Format(_T(""), nWidth, nHeight, m_nDocPr, srId, nWidth, nHeight); + sDrawing.Format(_T(""), nWidth, nHeight, m_nDocPr, srId, nWidth, nHeight); pCStringWriter->WriteString(sDrawing); } } @@ -886,7 +886,7 @@ public: nPaddingBottom = (__int64)(g_dKoef_mm_to_emu * Paddings.Bottom); } CString sDrawing; - sDrawing.Format(_T("%I64d%I64d"), nPaddingTop, nPaddingBottom, nPaddingLeft, nPaddingRight, nX, nY, nWidth, nHeight, m_nDocPr, srId, nWidth, nHeight); + sDrawing.Format(_T("%I64d%I64d"), nPaddingTop, nPaddingBottom, nPaddingLeft, nPaddingRight, nX, nY, nWidth, nHeight, m_nDocPr, srId, nWidth, nHeight); pCStringWriter->WriteString(sDrawing); } } @@ -946,7 +946,7 @@ public: } nVal = WDocx; } - sXml.Format(_T("<%ls w:w=\"%d\" w:type=\"%ls\"/>"), sName, nVal, sType ); + sXml.Format(_T("<%s w:w=\"%d\" w:type=\"%s\"/>"), sName, nVal, sType ); } return sXml; } @@ -985,7 +985,7 @@ public: pCStringWriter->WriteString(CString(_T(" w:val=\"none\""))); if(bColor) { - CString sColorAttr;sColorAttr.Format(_T(" w:color=\"%ls\""), Color.ToString()); + CString sColorAttr;sColorAttr.Format(_T(" w:color=\"%s\""), Color.ToString()); pCStringWriter->WriteString(sColorAttr); } if(bSize) @@ -1009,17 +1009,17 @@ public: } if(ThemeColor.bColor) { - CString sThemeColor;sThemeColor.Format(_T(" w:themeColor=\"%ls\""), ThemeColor.ToStringColor()); + CString sThemeColor;sThemeColor.Format(_T(" w:themeColor=\"%s\""), ThemeColor.ToStringColor()); pCStringWriter->WriteString(sThemeColor); } if(ThemeColor.bTint) { - CString sThemeTint;sThemeTint.Format(_T(" w:themeTint=\"%ls\""), ThemeColor.ToStringTint()); + CString sThemeTint;sThemeTint.Format(_T(" w:themeTint=\"%s\""), ThemeColor.ToStringTint()); pCStringWriter->WriteString(sThemeTint); } if(ThemeColor.bShade) { - CString sThemeShade;sThemeShade.Format(_T(" w:themeShade=\"%ls\""), ThemeColor.ToStringShade()); + CString sThemeShade;sThemeShade.Format(_T(" w:themeShade=\"%s\""), ThemeColor.ToStringShade()); pCStringWriter->WriteString(sThemeShade); } } @@ -1168,14 +1168,14 @@ public: } if(!sFormat.IsEmpty()) { - CString sFormatXml;sFormatXml.Format(_T(""), sFormat); + CString sFormatXml;sFormatXml.Format(_T(""), sFormat); oWriter.WriteString(sFormatXml); } } if(bPStyle) { CString sStyleName = XmlUtils::EncodeXmlString(PStyle); - CString sFormatXml;sFormatXml.Format(_T(""), sStyleName); + CString sFormatXml;sFormatXml.Format(_T(""), sStyleName); oWriter.WriteString(sFormatXml); } @@ -1192,7 +1192,7 @@ public: docLvlText* item = Text[i]; if(item->bText) { - sText.AppendFormat(_T("%ls"), (const TCHAR *) item->Text); + sText.AppendFormat(_T("%s"), (const TCHAR *) item->Text); } else if(item->bNumber) { @@ -1200,7 +1200,7 @@ public: } } sText = XmlUtils::EncodeXmlString(sText); - CString sTextXml;sTextXml.Format(_T(""), sText); + CString sTextXml;sTextXml.Format(_T(""), sText); oWriter.WriteString(sTextXml); } if(bJc) @@ -1215,7 +1215,7 @@ public: } if(!sJc.IsEmpty()) { - CString sJcXml;sJcXml.Format(_T(""), sJc); + CString sJcXml;sJcXml.Format(_T(""), sJc); oWriter.WriteString(sJcXml); } } @@ -1259,13 +1259,13 @@ public: if(!StyleLink.IsEmpty()) { CString sCorrectStyleLink = XmlUtils::EncodeXmlString(StyleLink); - CString sXml;sXml.Format(_T(""), sCorrectStyleLink); + CString sXml;sXml.Format(_T(""), sCorrectStyleLink); oWriterANum.WriteString(sXml); } if(!NumStyleLink.IsEmpty()) { CString sCorrectNumStyleLink = XmlUtils::EncodeXmlString(NumStyleLink); - CString sXml;sXml.Format(_T(""), sCorrectNumStyleLink); + CString sXml;sXml.Format(_T(""), sCorrectNumStyleLink); oWriterANum.WriteString(sXml); } for(int i = 0, length = Lvls.size(); i < length; ++i) @@ -1410,11 +1410,11 @@ public: CString sCorrect_tooltip = XmlUtils::EncodeXmlString(tooltip); CString sCorrect_anchor = XmlUtils::EncodeXmlString(anchor); CString sStart; - sStart.Format(_T("")); wr.WriteString(sStart); wr.Write(writer); @@ -1513,7 +1513,7 @@ public: pComment->IdFormat = pComment->m_oFormatIdCounter.getNextId(); } sRes.Append(sBefore); - sRes.AppendFormat(_T("<%ls w:id=\"%d\"/>"), (const TCHAR *) sRef, pComment->IdFormat); + sRes.AppendFormat(_T("<%s w:id=\"%d\"/>"), (const TCHAR *) sRef, pComment->IdFormat); sRes.Append(sAfter); return sRes; } @@ -1530,7 +1530,7 @@ public: bFirst = false; pComment->m_sParaId = sId; } - CString sFormat = _T("%ls"); + CString sFormat = _T("%s"); sRes.AppendFormat((const TCHAR *) sFormat, (const TCHAR *) sId, (const TCHAR *) sId, (const TCHAR *) sPart); return bFirst; } @@ -1547,7 +1547,7 @@ public: if(false == pComment->UserName.IsEmpty()) { CString sUserName = XmlUtils::EncodeXmlString(pComment->UserName); - sRes.AppendFormat(_T(" w:author=\"%ls\""), (const TCHAR *) sUserName); + sRes.AppendFormat(_T(" w:author=\"%s\""), (const TCHAR *) sUserName); //äåëàåì initials int nTokenPos = 0; CString strToken = pComment->UserName.Tokenize(_T(" "), nTokenPos); @@ -1562,12 +1562,12 @@ public: if(false == pComment->Date.IsEmpty()) { CString sDate = XmlUtils::EncodeXmlString(pComment->Date); - sRes.AppendFormat(_T(" w:date=\"%ls\""), (const TCHAR *) sDate); + sRes.AppendFormat(_T(" w:date=\"%s\""), (const TCHAR *) sDate); } if(false == sInitials.IsEmpty()) { sInitials = XmlUtils::EncodeXmlString(sInitials); - sRes.AppendFormat(_T(" w:initials=\"%ls\""), (const TCHAR *) sInitials); + sRes.AppendFormat(_T(" w:initials=\"%s\""), (const TCHAR *) sInitials); } sRes.Append(_T(">")); if(false == pComment->Text.IsEmpty()) @@ -1599,9 +1599,9 @@ public: if(pComment->bSolved && pComment->Solved) sDone = _T("1"); if(!pComment->m_sParaIdParent.IsEmpty()) - sRes.AppendFormat(_T(""), (const TCHAR *) pComment->m_sParaId, (const TCHAR *) pComment->m_sParaIdParent, (const TCHAR *) sDone); + sRes.AppendFormat(_T(""), (const TCHAR *) pComment->m_sParaId, (const TCHAR *) pComment->m_sParaIdParent, (const TCHAR *) sDone); else - sRes.AppendFormat(_T(""), (const TCHAR *) pComment->m_sParaId, (const TCHAR *) sDone); + sRes.AppendFormat(_T(""), (const TCHAR *) pComment->m_sParaId, (const TCHAR *) sDone); //ðàññòàâëÿåì paraIdParent for(int i = 0, length = pComment->replies.size(); i < length; i++) pComment->replies[i]->m_sParaIdParent = pComment->m_sParaId; @@ -1615,7 +1615,7 @@ public: { CString sUserName = XmlUtils::EncodeXmlString(pComment->UserName); CString sUserId = XmlUtils::EncodeXmlString(pComment->UserId); - sRes.AppendFormat(_T(""), (const TCHAR *) sUserName, (const TCHAR *) sUserId); + sRes.AppendFormat(_T(""), (const TCHAR *) sUserName, (const TCHAR *) sUserId); } return sRes; } @@ -1727,17 +1727,17 @@ public: // if(false == UserName.IsEmpty()) // { // CString sUserName = XmlUtils::EncodeXmlString(UserName); -// sRes.AppendFormat(_T(" w:author=\"%ls\""), sUserName); +// sRes.AppendFormat(_T(" w:author=\"%s\""), sUserName); // } // if(false == Date.IsEmpty()) // { // CString sDate = XmlUtils::EncodeXmlString(Date); -// sRes.AppendFormat(_T(" w:date=\"%ls\""), sDate); +// sRes.AppendFormat(_T(" w:date=\"%s\""), sDate); // } // if(false == Initials.IsEmpty()) // { // CString sInitials = XmlUtils::EncodeXmlString(Initials); -// sRes.AppendFormat(_T(" w:initials=\"%ls\""), sInitials); +// sRes.AppendFormat(_T(" w:initials=\"%s\""), sInitials); // } // sRes.Append(_T(">")); // @@ -1751,7 +1751,7 @@ public: // CString WriteCommentContent(CComment* pComment, bool bCheckLast) // { // CString sRes; -// CString sFormat = _T("%ls"); +// CString sFormat = _T("%s"); // CString sName = XmlUtils::EncodeXmlString(pComment->UserName + _T(":")); // sRes.AppendFormat(sFormat, sName); // if(false == pComment->Text.IsEmpty()) @@ -1921,7 +1921,7 @@ public: if(false == bChart) sXml.AppendFormat(_T(""), emuWidth, emuHeight, m_nDocPr); else - sXml.AppendFormat(_T(""), emuWidth, emuHeight, m_nDocPr, m_nDocPr, (const TCHAR *) sChartRels); + sXml.AppendFormat(_T(""), emuWidth, emuHeight, m_nDocPr, m_nDocPr, (const TCHAR *) sChartRels); } } else @@ -1996,7 +1996,7 @@ public: __int64 emuPosOffset = (__int64)(g_dKoef_mm_to_emu * PositionHPosOffset); sContent.Format(_T("%I64d"), emuPosOffset); } - sXml.AppendFormat(_T("%ls"), (const TCHAR *) sRelativeFrom, (const TCHAR *) sContent); + sXml.AppendFormat(_T("%s"), (const TCHAR *) sRelativeFrom, (const TCHAR *) sContent); } if(bPositionVRelativeFrom && (bPositionVAlign || bPositionVPosOffset)) { @@ -2029,7 +2029,7 @@ public: __int64 emuPosOffset = (__int64)(g_dKoef_mm_to_emu * PositionVPosOffset); sContent.Format(_T("%I64d"), emuPosOffset); } - sXml.AppendFormat(_T("%ls"), (const TCHAR *) sRelativeFrom, (const TCHAR *) sContent); + sXml.AppendFormat(_T("%s"), (const TCHAR *) sRelativeFrom, (const TCHAR *) sContent); } __int64 emuWidth = (__int64)(g_dKoef_mm_to_emu * Width); __int64 emuHeight = (__int64)(g_dKoef_mm_to_emu * Height); @@ -2056,9 +2056,9 @@ public: if(DrawingPropertyWrap.bStart || DrawingPropertyWrap.Points.size() > 0) { if(c_oSerImageType2::WrapSquare == DrawingPropertyWrap.WrappingType || c_oSerImageType2::WrapThrough == DrawingPropertyWrap.WrappingType || c_oSerImageType2::WrapTight == DrawingPropertyWrap.WrappingType) - sXml.AppendFormat(_T(""), (const TCHAR *) sTagName); + sXml.AppendFormat(_T(""), (const TCHAR *) sTagName); else - sXml.AppendFormat(_T(""), (const TCHAR *) sTagName); + sXml.AppendFormat(_T(""), (const TCHAR *) sTagName); int nEdited = 0; if(DrawingPropertyWrap.bEdited && DrawingPropertyWrap.Edited) @@ -2081,21 +2081,21 @@ public: } } sXml.Append(_T("")); - sXml.AppendFormat(_T(""), (const TCHAR *) sTagName); + sXml.AppendFormat(_T(""), (const TCHAR *) sTagName); } else { if(c_oSerImageType2::WrapSquare == DrawingPropertyWrap.WrappingType) - sXml.AppendFormat(_T(""), (const TCHAR *) sTagName); + sXml.AppendFormat(_T(""), (const TCHAR *) sTagName); else - sXml.AppendFormat(_T(""), (const TCHAR *) sTagName); + sXml.AppendFormat(_T(""), (const TCHAR *) sTagName); } } else sXml.Append(_T("")); if(bChart) - sXml.AppendFormat(_T(""), m_nDocPr, m_nDocPr, (const TCHAR *) sChartRels); + sXml.AppendFormat(_T(""), m_nDocPr, m_nDocPr, (const TCHAR *) sChartRels); else sXml.AppendFormat(_T(""), m_nDocPr); @@ -2226,7 +2226,7 @@ public: CFramePr() case 1: sDropCap = _T("drop");break; case 2: sDropCap = _T("margin");break; } - CString sXml;sXml.Format(_T(" w:dropCap=\"%ls\""), sDropCap); + CString sXml;sXml.Format(_T(" w:dropCap=\"%s\""), sDropCap); oStringWriter.WriteString(sXml); } if(bLines) @@ -2266,7 +2266,7 @@ public: CFramePr() case 4: sWrap = _T("through");break; case 5: sWrap = _T("tight");break; } - CString sXml;sXml.Format(_T(" w:wrap=\"%ls\""), sWrap); + CString sXml;sXml.Format(_T(" w:wrap=\"%s\""), sWrap); oStringWriter.WriteString(sXml); } if(bVAnchor) @@ -2278,7 +2278,7 @@ public: CFramePr() case 1: sVAnchor = _T("page");break; case 2: sVAnchor = _T("text");break; } - CString sXml;sXml.Format(_T(" w:vAnchor=\"%ls\""), sVAnchor); + CString sXml;sXml.Format(_T(" w:vAnchor=\"%s\""), sVAnchor); oStringWriter.WriteString(sXml); } if(bHAnchor) @@ -2290,7 +2290,7 @@ public: CFramePr() case 1: sHAnchor = _T("page");break; case 2: sHAnchor = _T("text");break; } - CString sXml;sXml.Format(_T(" w:hAnchor=\"%ls\""), sHAnchor); + CString sXml;sXml.Format(_T(" w:hAnchor=\"%s\""), sHAnchor); oStringWriter.WriteString(sXml); } if(bX) @@ -2309,7 +2309,7 @@ public: CFramePr() case 3: sXAlign = _T("outside");break; case 4: sXAlign = _T("right");break; } - CString sXml;sXml.Format(_T(" w:xAlign=\"%ls\""), sXAlign); + CString sXml;sXml.Format(_T(" w:xAlign=\"%s\""), sXAlign); oStringWriter.WriteString(sXml); } if(bY) @@ -2329,7 +2329,7 @@ public: CFramePr() case 4: sYAlign = _T("outside");break; case 5: sYAlign = _T("top");break; } - CString sXml;sXml.Format(_T(" w:yAlign=\"%ls\""), sYAlign); + CString sXml;sXml.Format(_T(" w:yAlign=\"%s\""), sYAlign); oStringWriter.WriteString(sXml); } if(bHRule) @@ -2341,7 +2341,7 @@ public: CFramePr() case 1: sHRule = _T("auto");break; case 2: sHRule = _T("exact");break; } - CString sXml;sXml.Format(_T(" w:hRule=\"%ls\""), sHRule); + CString sXml;sXml.Format(_T(" w:hRule=\"%s\""), sHRule); oStringWriter.WriteString(sXml); } oStringWriter.WriteString(CString(_T("/>"))); @@ -2372,11 +2372,11 @@ public: CString sCorrect_tooltip = XmlUtils::EncodeXmlString(sTooltip); CString sCorrect_anchor = XmlUtils::EncodeXmlString(sAnchor); CString sStart; - sStart.Format(_T("")); wr.WriteString(sStart); wr.Write(writer); @@ -2385,4 +2385,4 @@ public: } }; } -#endif // #ifndef READER_CLASSES +#endif // #ifndef READER_CLASSES \ No newline at end of file diff --git a/ASCOfficeDocxFile2/BinReader/Readers.h b/ASCOfficeDocxFile2/BinReader/Readers.h index 5a4c70a806..7c189e547c 100644 --- a/ASCOfficeDocxFile2/BinReader/Readers.h +++ b/ASCOfficeDocxFile2/BinReader/Readers.h @@ -650,7 +650,7 @@ public: default: sVal=_T("left");break; } CString sTab; - sTab.Format(_T(""), sVal, nTab); + sTab.Format(_T(""), sVal, nTab); pCStringWriter->WriteString(sTab); } pCStringWriter->WriteString(CString(_T(""))); @@ -661,7 +661,7 @@ public: { CString sStyleName(m_oBufferedStream.GetString3(length)); sStyleName = XmlUtils::EncodeXmlString(sStyleName); - CString sStyle;sStyle.Format(_T(""), sStyleName); + CString sStyle;sStyle.Format(_T(""), sStyleName); pCStringWriter->WriteString(sStyle); break; } @@ -1269,7 +1269,7 @@ public: { CString Name(m_oBufferedStream.GetString3(length)); Name = XmlUtils::EncodeXmlString(Name); - pWiterTblPr->Style.Format(_T(""), Name); + pWiterTblPr->Style.Format(_T(""), Name); } else if( c_oSerProp_tblPrType::Look == type ) { @@ -1293,7 +1293,7 @@ public: case 2: sLayout = _T("fixed");break; } if(false == sLayout.IsEmpty()) - pWiterTblPr->Layout.Format(_T(""), sLayout); + pWiterTblPr->Layout.Format(_T(""), sLayout); } else res = c_oSerConstants::ReadUnknown; @@ -2325,7 +2325,7 @@ public: else { //local - sFilePath = m_sFileInDir + _T("media") + FILE_SEPARATOR_STR + sImage; + sFilePath = m_sFileInDir + _T("media\\") + sImage; } //Ïðîâåðÿåì ÷òî ôàéë ñóùåñòâóåò @@ -2590,7 +2590,7 @@ public: case 2: sBrkBin = _T("repeat");break; } - CString sVal; sVal.Format(_T(""), sBrkBin); + CString sVal; sVal.Format(_T(""), sBrkBin); m_oFileWriter.m_oSettingWriter.AddSetting(sVal); } else @@ -2611,7 +2611,7 @@ public: case 1: sBrkBinSub = _T("-+");break; case 2: sBrkBinSub = _T("--");break; } - CString sVal; sVal.Format(_T(""), sBrkBinSub); + CString sVal; sVal.Format(_T(""), sBrkBinSub); m_oFileWriter.m_oSettingWriter.AddSetting(sVal); } else @@ -2633,7 +2633,7 @@ public: case 2: sDefJc = _T("left");break; case 3: sDefJc = _T("right");break; } - CString sVal; sVal.Format(_T(""), sDefJc); + CString sVal; sVal.Format(_T(""), sDefJc); m_oFileWriter.m_oSettingWriter.AddSetting(sVal); } else @@ -2684,7 +2684,7 @@ public: case 0: sIntLim = _T("subSup");break; case 1: sIntLim = _T("undOvr");break; } - CString sVal; sVal.Format(_T(""), sIntLim); + CString sVal; sVal.Format(_T(""), sIntLim); m_oFileWriter.m_oSettingWriter.AddSetting(sVal); } else @@ -2727,7 +2727,7 @@ public: CString sFontName(m_oBufferedStream.GetString3(length)); sFontName = XmlUtils::EncodeXmlString(sFontName); - CString sVal; sVal.Format(_T(""), sFontName); + CString sVal; sVal.Format(_T(""), sFontName); m_oFileWriter.m_oSettingWriter.AddSetting(sVal); } else @@ -2748,7 +2748,7 @@ public: case 0: sNaryLim = _T("subSup");break; case 1: sNaryLim = _T("undOvr");break; } - CString sVal; sVal.Format(_T(""), sNaryLim); + CString sVal; sVal.Format(_T(""), sNaryLim); m_oFileWriter.m_oSettingWriter.AddSetting(sVal); } else @@ -3359,7 +3359,7 @@ public: case 4: sBaseJc = _T("outside");break; case 5: sBaseJc = _T("top");break; } - CString sVal; sVal.Format(_T(""), sBaseJc); + CString sVal; sVal.Format(_T(""), sBaseJc); GetRunStringWriter().WriteString(sVal); } else @@ -3372,7 +3372,7 @@ public: if ( c_oSer_OMathBottomNodesValType::Val == type ) { CString sChr = GetMathText (length); - CString sVal; sVal.Format(_T(""), sChr); + CString sVal; sVal.Format(_T(""), sChr); GetRunStringWriter().WriteString(sVal); } else @@ -3570,7 +3570,7 @@ public: if ( c_oSer_OMathBottomNodesValType::Val == type ) { CString sChr = GetMathText (length); - CString sVal; sVal.Format(_T(""), sChr); + CString sVal; sVal.Format(_T(""), sChr); GetRunStringWriter().WriteString(sVal); } else @@ -3727,7 +3727,7 @@ public: if ( c_oSer_OMathBottomNodesValType::Val == type ) { CString sChr = GetMathText (length); - CString sVal; sVal.Format(_T(""), sChr); + CString sVal; sVal.Format(_T(""), sChr); GetRunStringWriter().WriteString(sVal); } else @@ -4015,7 +4015,7 @@ public: case 2: sMJc = _T("left");break; case 3: sMJc = _T("right");break; } - CString sVal; sVal.Format(_T(""), sMJc); + CString sVal; sVal.Format(_T(""), sMJc); GetRunStringWriter().WriteString(sVal); } else @@ -4035,7 +4035,7 @@ public: case 0: sLimLoc = _T("subSup");break; case 1: sLimLoc = _T("undOvr");break; } - CString sVal; sVal.Format(_T(""), sLimLoc); + CString sVal; sVal.Format(_T(""), sLimLoc); GetRunStringWriter().WriteString(sVal); } else @@ -4201,7 +4201,7 @@ public: case 3: sMcJc = _T("outside");break; case 4: sMcJc = _T("right");break; } - CString sVal; sVal.Format(_T(""), sMcJc); + CString sVal; sVal.Format(_T(""), sMcJc); GetRunStringWriter().WriteString(sVal); } else @@ -4550,7 +4550,7 @@ public: case 1: sPos = _T("top");break; } - CString sVal; sVal.Format(_T(""), sPos); + CString sVal; sVal.Format(_T(""), sPos); GetRunStringWriter().WriteString(sVal); } else @@ -4729,7 +4729,7 @@ public: case 4: sScr = _T("sans-serif");break; case 5: sScr = _T("script");break; } - CString sVal; sVal.Format(_T(""), sScr); + CString sVal; sVal.Format(_T(""), sScr); GetRunStringWriter().WriteString(sVal); } else @@ -4742,7 +4742,7 @@ public: if ( c_oSer_OMathBottomNodesValType::Val == type ) { CString sChr = GetMathText (length); - CString sVal; sVal.Format(_T(""), sChr); + CString sVal; sVal.Format(_T(""), sChr); GetRunStringWriter().WriteString(sVal); } else @@ -4779,7 +4779,7 @@ public: case 0: sShp = _T("centered");break; case 1: sShp = _T("match");break; } - CString sVal; sVal.Format(_T(""), sShp); + CString sVal; sVal.Format(_T(""), sShp); GetRunStringWriter().WriteString(sVal); } else @@ -5037,7 +5037,7 @@ public: case 2: sSty = _T("i");break; case 3: sSty = _T("p");break; } - CString sVal; sVal.Format(_T(""), sSty); + CString sVal; sVal.Format(_T(""), sSty); GetRunStringWriter().WriteString(sVal); } else @@ -5110,7 +5110,7 @@ public: case 2: sType = _T("noBar");break; case 3: sType = _T("skw");break; } - CString sVal; sVal.Format(_T(""), sType); + CString sVal; sVal.Format(_T(""), sType); GetRunStringWriter().WriteString(sVal); } else @@ -5130,7 +5130,7 @@ public: case 0: sVertJc = _T("bot");break; case 1: sVertJc = _T("top");break; } - CString sVal; sVal.Format(_T(""), sVertJc); + CString sVal; sVal.Format(_T(""), sVertJc); GetRunStringWriter().WriteString(sVal); } else @@ -5248,9 +5248,8 @@ public: if(odocImg.MediaId >= 0 && odocImg.MediaId < m_oMediaWriter.nImageCount) { CString sNewImgName = m_oMediaWriter.m_aImageNames[odocImg.MediaId]; - CString sNewImgRel = _T("media/") + sNewImgName; - - sNewImgRel = XmlUtils::EncodeXmlString(sNewImgRel); + CString sNewImgRel;sNewImgRel = _T("media/") + sNewImgName; + sNewImgRel = XmlUtils::EncodeXmlString(sNewImgRel); long rId; m_oFileWriter.m_pDrawingConverter->WriteRels(CString(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image")), sNewImgRel, CString(), &rId); odocImg.srId.Format(_T("rId%d"), rId); @@ -5550,38 +5549,37 @@ public: { if(false == m_oFileWriter.m_bSaveChartAsImg) { - OOX::CPath pathChartsDir = m_oFileWriter.m_oChartWriter.m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR +_T("charts"); - OOX::CSystemUtility::CreateDirectories(pathChartsDir.GetPath()); - - OOX::CPath pathChartsRelsDir = pathChartsDir.GetPath() + FILE_SEPARATOR_STR + _T("_rels"); - OOX::CSystemUtility::CreateDirectories(pathChartsRelsDir.GetPath()); - + //ñîçäàåì ïàïêó äëÿ rels + CString sChartsDir; + sChartsDir.Format(_T("%s\\word\\charts"), m_oFileWriter.m_oChartWriter.m_sDir); + if( !NSDirectory::Exists(string2std_string(sChartsDir)) ) + OOX::CSystemUtility::CreateDirectories(sChartsDir); + CString sRelsDir; + sRelsDir.Format(_T("%s\\_rels"), sChartsDir); + if( !NSDirectory::Exists(string2std_string(sRelsDir)) ) + OOX::CSystemUtility::CreateDirectories(sRelsDir); m_oFileWriter.m_pDrawingConverter->SetDstContentRels(); CString sThemeDir; - int nIndex = m_oFileWriter.m_sThemePath.ReverseFind(FILE_SEPARATOR_CHAR); + int nIndex = m_oFileWriter.m_sThemePath.ReverseFind('\\'); if(-1 != nIndex) sThemeDir = m_oFileWriter.m_sThemePath.Left(nIndex); - - BinXlsxRW::SaveParams oSaveParams(sThemeDir); - BinXlsxRW::BinaryChartReader oBinaryChartReader(m_oBufferedStream, oSaveParams, m_oFileWriter.m_pDrawingConverter); - + BinXlsxRW::SaveParams oSaveParams(sThemeDir); + BinXlsxRW::BinaryChartReader oBinaryChartReader(m_oBufferedStream, oSaveParams, m_oFileWriter.m_pDrawingConverter); OOX::Spreadsheet::CChartSpace* pChartSpace = new OOX::Spreadsheet::CChartSpace(); oBinaryChartReader.ReadCT_ChartSpace(length, &pChartSpace->m_oChartSpace); XmlUtils::CStringWriter sw; pChartSpace->toXML(sw); - CString sChartContent = sw.GetData(); CString sFilename; CString sRelsName; int nChartIndex; - m_oFileWriter.m_oChartWriter.AddChart(sChartContent, sRelsName, sFilename, nChartIndex); m_oFileWriter.m_oContentTypesWriter.AddOverrideRaw(oSaveParams.sAdditionalContentTypes); - OOX::CPath pathChartsRels = pathChartsRelsDir.GetPath() + FILE_SEPARATOR_STR + sFilename + _T(".rels"); - m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(pathChartsRels.GetPath()); + CString sRelsPath;sRelsPath.Format(_T("%s\\%s.rels"), sRelsDir, sFilename); + m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(sRelsPath); long rId; CString bstrChartRelType = OOX::Spreadsheet::FileTypes::Charts.RelationType(); @@ -5946,11 +5944,8 @@ int Binary_HdrFtrTableReader::ReadHdrFtrItem(BYTE type, long length, void* poRes Binary_DocumentTableReader oBinary_DocumentTableReader(m_oBufferedStream, m_oFileWriter, poHdrFtrItem->Header, m_pComments); res = Read1(length, &Binary_HdrFtrTableReader::ReadHdrFtrItemContent, this, &oBinary_DocumentTableReader); - OOX::CPath fileRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + FILE_SEPARATOR_STR + _T("word") + - FILE_SEPARATOR_STR + _T("_rels")+ - FILE_SEPARATOR_STR + poHdrFtrItem->m_sFilename + _T(".rels"); - - m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(fileRelsPath.GetPath()); + CString sRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + _T("\\word\\_rels\\") + poHdrFtrItem->m_sFilename + _T(".rels"); + m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(sRelsPath); } } else @@ -6138,12 +6133,9 @@ public: BinaryFileReader(CString& sFileInDir, NSBinPptxRW::CBinaryFileReader& oB } } res = Binary_DocumentTableReader(m_oBufferedStream, m_oFileWriter, m_oFileWriter.m_oDocumentWriter, &oBinary_CommentsTableReader.m_oComments).Read(); + CString sRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + _T("\\word\\_rels\\document.xml.rels"); - OOX::CPath fileRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + FILE_SEPARATOR_STR + _T("word") - + FILE_SEPARATOR_STR + _T("_rels") - + FILE_SEPARATOR_STR + _T("document.xml.rels"); - - CComments& oComments = oBinary_CommentsTableReader.m_oComments; + CComments& oComments = oBinary_CommentsTableReader.m_oComments; Writers::CommentsWriter& oCommentsWriter = m_oFileWriter.m_oCommentsWriter; CString sContent = oComments.writeContent(); CString sContentEx = oComments.writeContentExt();//âàæíî ÷òîáû writeContentExt âûçûâàëñÿ ïîñëå writeContent @@ -6165,7 +6157,7 @@ public: BinaryFileReader(CString& sFileInDir, NSBinPptxRW::CBinaryFileReader& oB m_oFileWriter.m_pDrawingConverter->WriteRels(CString(_T("http://schemas.microsoft.com/office/2011/relationships/people")), CString(_T("people.xml")), CString(), &rId); } - m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(fileRelsPath.GetPath()); + m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(sRelsPath); if(c_oSerConstants::ReadOk != res) return res; } @@ -6173,4 +6165,4 @@ public: BinaryFileReader(CString& sFileInDir, NSBinPptxRW::CBinaryFileReader& oB } }; } -#endif // #ifndef READERS +#endif // #ifndef READERS \ No newline at end of file diff --git a/ASCOfficeDocxFile2/BinReader/SettingWriter.h b/ASCOfficeDocxFile2/BinReader/SettingWriter.h index 789c8000c1..e1e8305306 100644 --- a/ASCOfficeDocxFile2/BinReader/SettingWriter.h +++ b/ASCOfficeDocxFile2/BinReader/SettingWriter.h @@ -21,10 +21,8 @@ namespace Writers void Write() { Prepare(); - OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + _T("settings.xml"); - CFile oFile; - oFile.CreateFile(filePath.GetPath()); + oFile.CreateFile(m_sDir + _T("\\word\\settings.xml")); oFile.WriteStringUTF8(g_string_set_Start); oFile.WriteStringUTF8(m_oSettingWriter.GetData()); oFile.WriteStringUTF8(g_string_set_Default); @@ -59,4 +57,4 @@ namespace Writers } }; } -#endif // #ifndef SETTING_WRITER +#endif // #ifndef SETTING_WRITER \ No newline at end of file diff --git a/ASCOfficeDocxFile2/BinReader/StylesWriter.h b/ASCOfficeDocxFile2/BinReader/StylesWriter.h index 8cd952a3b8..e13748eacd 100644 --- a/ASCOfficeDocxFile2/BinReader/StylesWriter.h +++ b/ASCOfficeDocxFile2/BinReader/StylesWriter.h @@ -48,14 +48,11 @@ namespace Writers m_oWriter.Write(m_Styles); m_oWriter.WriteString(g_string_st_End); - OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + _T("styles.xml"); - CFile oFile; - oFile.CreateFile(filePath.GetPath()); - + oFile.CreateFile(m_sDir + _T("\\word\\styles.xml")); oFile.WriteStringUTF8(m_oWriter.GetData()); oFile.CloseFile(); } }; } -#endif // #ifndef STYLES_WRITER +#endif // #ifndef STYLES_WRITER \ No newline at end of file diff --git a/ASCOfficeDocxFile2/BinReader/fontTableWriter.h b/ASCOfficeDocxFile2/BinReader/fontTableWriter.h index 01721d9d41..920a393959 100644 --- a/ASCOfficeDocxFile2/BinReader/fontTableWriter.h +++ b/ASCOfficeDocxFile2/BinReader/fontTableWriter.h @@ -65,11 +65,8 @@ namespace Writers m_oWriter.WriteString(g_string_ft_End); - OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + _T("fontTable.xml"); - CFile oFile; - oFile.CreateFile(filePath.GetPath()); - + oFile.CreateFile(m_sDir + _T("\\word\\fontTable.xml")); oFile.WriteStringUTF8(m_oWriter.GetData()); oFile.CloseFile(); } @@ -107,4 +104,4 @@ namespace Writers } }; } -#endif // #ifndef FONT_TABLE_WRITER +#endif // #ifndef FONT_TABLE_WRITER \ No newline at end of file diff --git a/ASCOfficeDocxFile2/BinReader/webSettingsWriter.h b/ASCOfficeDocxFile2/BinReader/webSettingsWriter.h deleted file mode 100644 index f75e612ad6..0000000000 --- a/ASCOfficeDocxFile2/BinReader/webSettingsWriter.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef WEB_SETTINGS_WRITER -#define WEB_SETTINGS_WRITER - -#include "../../XlsxSerializerCom/Common/Common.h" - -namespace Writers -{ - class WebSettingsWriter - { - XmlUtils::CStringWriter m_oWriter; - CString m_sDir; - public: - WebSettingsWriter(CString sDir):m_sDir(sDir) - { - } - void Write() - { - CString s_Common; - - s_Common = _T(" \ - \ - \ -"); - - m_oWriter.WriteString(s_Common); - - OOX::CPath fileName = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + _T("webSettings.xml"); - - CFile oFile; - oFile.CreateFile(fileName.GetPath()); - oFile.WriteStringUTF8(m_oWriter.GetData()); - oFile.CloseFile(); - } - }; -} -#endif // #ifndef WEB_SETTINGS_WRITER diff --git a/ASCOfficeDocxFile2/BinWriter/BinWriters.h b/ASCOfficeDocxFile2/BinWriter/BinWriters.h index 60538d2ac8..5c1856a97f 100644 --- a/ASCOfficeDocxFile2/BinWriter/BinWriters.h +++ b/ASCOfficeDocxFile2/BinWriter/BinWriters.h @@ -4794,7 +4794,7 @@ namespace BinDocxRW if(S_OK == hRes && NULL != bstrOutputXml) { CString sDrawingXml; - sDrawingXml.Format(_T("%ls"), *bstrOutputXml); + sDrawingXml.Format(_T("%s"), *bstrOutputXml); XmlUtils::CXmlLiteReader oReader; oReader.FromString(sDrawingXml); oReader.ReadNextNode();//root @@ -6153,7 +6153,7 @@ namespace BinDocxRW static CString WriteFileHeader(long nDataSize) { CString sHeader; - sHeader.Format(_T("%ls;v%d;%d;"), g_sFormatSignature, g_nFormatVersion, nDataSize); + sHeader.Format(_T("%s;v%d;%d;"), g_sFormatSignature, g_nFormatVersion, nDataSize); return sHeader; } void WriteMainTableStart() @@ -6329,4 +6329,4 @@ namespace BinDocxRW }; } -#endif // #ifndef BIN_WRITERS +#endif // #ifndef BIN_WRITERS \ No newline at end of file diff --git a/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.cpp b/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.cpp index 97031e42a6..3b77e314a0 100644 --- a/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.cpp +++ b/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.cpp @@ -35,13 +35,11 @@ bool BinDocxRW::CDocxSerializer::ConvertDocxToDoct(const CString& sSrcFileName, } bool BinDocxRW::CDocxSerializer::ConvertDoctToDocx(const CString& sSrcFileName, const CString& sDstFileName, const CString& sTmpDir, const CString& sXMLOptions, const CString& sThemePath, const CString& sMediaPath) { - std::wstring strDirSrc = NSSystemPath::Combine(string2std_string(sTmpDir), _T("from")); - std::wstring strEditorBin = NSSystemPath::Combine(strDirSrc, _T("Editor.bin")); - std::wstring strDirDst = NSSystemPath::Combine(string2std_string(sTmpDir), _T("to")); - + std::wstring strDirSrc = NSSystemPath::Combine(string2std_string(sTmpDir), _T("from")); + std::wstring strEditorBin = NSSystemPath::Combine(strDirSrc, _T("Editor.bin")); + std::wstring strDirDst = NSSystemPath::Combine(string2std_string(sTmpDir), _T("to")); NSDirectory::CreateDirectory(strDirSrc); NSDirectory::CreateDirectory(strDirDst); - CString sEditorBin = std_string2string(strEditorBin); CString sDirDst = std_string2string(strDirDst); COfficeUtils oCOfficeUtils(NULL); @@ -53,10 +51,10 @@ bool BinDocxRW::CDocxSerializer::ConvertDoctToDocx(const CString& sSrcFileName, } bool BinDocxRW::CDocxSerializer::saveToFile(const CString& sSrcFileName, const CString& sDstPath, const CString& sXMLOptions) { - OOX::CPath pathMain(sSrcFileName); - - OOX::CPath pathMedia = pathMain.GetDirectory() + FILE_SEPARATOR_STR + _T("media"); - NSDirectory::CreateDirectory(string2std_string(pathMedia.GetPath())); + //create mediadir + OOX::CPath path(sSrcFileName); + CString mediaDir = path.GetDirectory() + _T("media/"); + NSDirectory::CreateDirectory(string2std_string(mediaDir)); COfficeFontPicker* pFontPicker = new COfficeFontPicker(); pFontPicker->Init(m_sFontDir); @@ -88,10 +86,8 @@ bool BinDocxRW::CDocxSerializer::saveToFile(const CString& sSrcFileName, const C oDrawingConverter.SetFontDir(m_sFontDir); oDrawingConverter.SetFontPicker(pFontPicker); oDrawingConverter.SetMainDocument(this); - oDrawingConverter.SetMediaDstPath(pathMedia.GetPath()); - + oDrawingConverter.SetMediaDstPath(mediaDir); ParamsWriter oParamsWriter(&oBufferedStream, &fp, &oDrawingConverter, pEmbeddedFontsManager); - m_oBinaryFileWriter = new BinaryFileWriter(oParamsWriter); m_oBinaryFileWriter->intoBindoc(sDstPath); BYTE* pbBinBuffer = oBufferedStream.GetBuffer(); @@ -122,38 +118,9 @@ bool BinDocxRW::CDocxSerializer::saveToFile(const CString& sSrcFileName, const C RELEASEOBJECT(pFontPicker); return true; } -void BinDocxRW::CDocxSerializer::CreateDocxFolders(CString strDirectory, CString& sThemePath, CString& sMediaPath) -{ - // rels - OOX::CPath pathRels = strDirectory + FILE_SEPARATOR_STR + _T("_rels"); - FileSystem::Directory::CreateDirectory(pathRels.GetPath()); - - // word - OOX::CPath pathWord = strDirectory + FILE_SEPARATOR_STR + _T("word"); - FileSystem::Directory::CreateDirectory(pathWord.GetPath()); - - // documentRels - OOX::CPath pathWordRels = pathWord + FILE_SEPARATOR_STR + _T("_rels"); - FileSystem::Directory::CreateDirectory(pathWordRels.GetPath()); - - //media - OOX::CPath pathMedia = pathWord + FILE_SEPARATOR_STR + _T("media"); - sMediaPath = pathMedia.GetPath(); - - // theme - OOX::CPath pathTheme = pathWord + FILE_SEPARATOR_STR + _T("theme"); - FileSystem::Directory::CreateDirectory(pathTheme.GetPath()); - - OOX::CPath pathThemeRels = pathTheme + FILE_SEPARATOR_STR + _T("_rels"); - FileSystem::Directory::CreateDirectory(pathThemeRels.GetPath()); - - pathTheme = pathTheme + FILE_SEPARATOR_STR + _T("theme1.xml"); - sThemePath = pathTheme.GetPath(); -} bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const CString& sDstPath, const CString& sXMLOptions, const CString& sThemePath, const CString& sMediaPath) { bool bResultOk = false; - NSFile::CFileBinary oFile; if(oFile.OpenFile(string2std_string(sSrcFileName))) { @@ -187,6 +154,7 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const BYTE _c = pBase64Data[nIndex]; if (_c == ';') { + if(0 == nType) { nType = 1; @@ -203,10 +171,8 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const else dst_len.AppendChar(_c); } - int nDataSize = atoi(dst_len); BYTE* pData = new BYTE[nDataSize]; - if(FALSE != Base64::Base64Decode((LPCSTR)(pBase64Data + nIndex), nBase64DataSize - nIndex, pData, &nDataSize)) { NSBinPptxRW::CDrawingConverter oDrawingConverter; @@ -241,42 +207,10 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const var.bstrVal = sFileInDir.GetString(); oDrawingConverter.SetAdditionalParam(CString(L"SourceFileDir"), var); #endif - //default theme - m_pCurFileWriter->m_oDefaultTheme.Write(sThemePath); - + BinaryFileReader oBinaryFileReader(sFileInDir, oBufferedStream, *m_pCurFileWriter); oBinaryFileReader.ReadFile(); -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - OOX::CContentTypes oContentTypes; - //docProps - OOX::CPath pathDocProps = sDstPath + FILE_SEPARATOR_STR + _T("docProps"); - FileSystem::Directory::CreateDirectory(pathDocProps.GetPath()); - - OOX::CPath DocProps = CString(_T("docProps")); - OOX::CApp* pApp = new OOX::CApp(); - if (pApp) - { - pApp->SetApplication(_T("OnlyOffice")); - pApp->SetAppVersion(_T("3.0000")); - pApp->SetDocSecurity(0); - pApp->SetScaleCrop(false); - pApp->SetLinksUpToDate(false); - pApp->SetSharedDoc(false); - pApp->SetHyperlinksChanged(false); - - pApp->write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, oContentTypes); - delete pApp; - } - OOX::CCore* pCore = new OOX::CCore(); - if (pCore) - { - pCore->SetCreator(_T("")); - pCore->SetLastModifiedBy(_T("")); - pCore->write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, oContentTypes); - delete pCore; - } -///////////////////////////////////////////////////////////////////////////////////// VARIANT vt; oDrawingConverter.GetAdditionalParam(CString(_T("ContentTypes")), &vt); if(VT_BSTR == vt.vt) @@ -290,11 +224,10 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const m_pCurFileWriter->m_oHeaderFooterWriter.Write(); //Setting пишем поÑле HeaderFooter, чтобы заполнить evenAndOddHeaders m_pCurFileWriter->m_oSettingWriter.Write(); - m_pCurFileWriter->m_oWebSettingsWriter.Write(); //Document пишем поÑле HeaderFooter, чтобы заполнить sectPr m_pCurFileWriter->m_oDocumentWriter.Write(); //Rels и ContentTypes пишем в конце - m_pCurFileWriter->m_oDocumentRelsWriter.Write(); + //m_pCurFileWriter->m_oDocumentRelsWriter.Write(_T("document.xml.rels")); m_pCurFileWriter->m_oContentTypesWriter.Write(); //CSerializer oSerializer = CSerializer(); diff --git a/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.h b/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.h index c808fbac7a..163e93e8e1 100644 --- a/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.h +++ b/ASCOfficeDocxFile2/DocWrapper/DocxSerializer.h @@ -8,20 +8,16 @@ #include "../../Common/DocxFormat/Source/Base/ASCString.h" #endif -namespace Writers -{ +namespace Writers{ class FileWriter; } -namespace NSBinPptxRW -{ +namespace NSBinPptxRW{ class CBinaryFileReader; class CBinaryFileWriter; } -namespace BinDocxRW -{ +namespace BinDocxRW { class BinaryFileWriter; - class CDocxSerializer - { + class CDocxSerializer{ private: CString m_sFontDir; CString m_sEmbeddedFontsDir; @@ -33,15 +29,10 @@ namespace BinDocxRW CDocxSerializer(); bool ConvertDocxToDoct(const CString& sSrcFileName, const CString& sDstFileName, const CString& sTmpDir, const CString& sXMLOptions); bool ConvertDoctToDocx(const CString& sSrcFileName, const CString& sDstFileName, const CString& sTmpDir, const CString& sXMLOptions, const CString& sThemePath, const CString& sMediaPath); - bool loadFromFile(const CString& sSrcFileName, const CString& sDstPath, const CString& sXMLOptions, const CString& sThemePath, const CString& sMediaPath); bool saveToFile(const CString& sSrcFileName, const CString& sDstPath, const CString& sXMLOptions); - - void CreateDocxFolders(CString strDirectory, CString& sThemePath, CString& sMediaPath); - bool getXmlContent(NSBinPptxRW::CBinaryFileReader& oBufferedStream, long lLength, CString& sOutputXml); bool getBinaryContent(const CString& bsTxContent, NSBinPptxRW::CBinaryFileWriter& oBufferedStream, long& lDataSize); - void setFontDir(const CString& sFontDir); void setEmbeddedFontsDir(const CString& sEmbeddedFontsDir); void setIsNoBase64Save(bool bIsNoBase64Save); diff --git a/ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.cpp b/ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.cpp index 5fd314710f..1f0e3cf2d6 100644 --- a/ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.cpp +++ b/ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.cpp @@ -7,12 +7,6 @@ #include "../../XlsxSerializerCom/Writer/BinaryReader.h" #include "../../ASCOfficePPTXFile/Editor/FontPicker.h" -#ifdef _WIN32 - #include "../BinReader/DefaultThemeWriterWin.h" -#else - #include "../BinReader/DefaultThemeWriterLinux.h" -#endif - namespace BinXlsxRW{ int g_nCurFormatVersion = 0; @@ -23,41 +17,6 @@ namespace BinXlsxRW{ CXlsxSerializer::~CXlsxSerializer() { } - - void CXlsxSerializer::CreateXlsxFolders(CString& sXmlOptions, CString sDstPath, CString& sMediaPath) - { - OOX::CPath pathMediaDir = sDstPath + FILE_SEPARATOR_STR + _T("xl") + FILE_SEPARATOR_STR + _T("media"); - - // File Type (Ìîæíî ïàðñèòü íå äâà ðàçà, à îäèí, åñëè ïåðåäàâàòü â ReadFile íå îïöèè, à ïàðàìåòðû) - BYTE fileType; - UINT nCodePage; - WCHAR wcDelimiter; - SerializeCommon::ReadFileType(sXmlOptions, fileType, nCodePage, wcDelimiter); - - if (c_oFileTypes::CSV != fileType) - { - OOX::CPath pathXlDir = sDstPath + FILE_SEPARATOR_STR + _T("xl"); - - OOX::CPath pathThemeDir = pathXlDir + FILE_SEPARATOR_STR + OOX::FileTypes::Theme.DefaultDirectory().GetPath(); - - OOX::CPath pathThemeFile = pathThemeDir + FILE_SEPARATOR_STR + OOX::FileTypes::Theme.DefaultFileName().GetPath(); - - OOX::CPath pathThemeThemeRelsDir = pathThemeDir + FILE_SEPARATOR_STR + _T("_rels"); - - NSDirectory::CreateDirectory(string2std_string(pathXlDir.GetPath())); - NSDirectory::CreateDirectory(string2std_string(pathThemeDir.GetPath())); - NSDirectory::CreateDirectory(string2std_string(pathThemeThemeRelsDir.GetPath())); - NSDirectory::CreateDirectory(string2std_string(pathMediaDir.GetPath())); - - //Create Default Theme - { - Writers::DefaultThemeWriter oDefaultThemeWriter; - oDefaultThemeWriter.Write(pathThemeFile.GetPath()); - } - } - - sMediaPath = pathMediaDir.GetPath(); - } bool CXlsxSerializer::loadFromFile(CString& sSrcFileName, CString& sDstPath, CString& sXMLOptions, CString& sMediaDir) { NSBinPptxRW::CDrawingConverter oOfficeDrawingConverter; @@ -159,9 +118,8 @@ namespace BinXlsxRW{ //ïîëó÷àåì sThemePath èç bsFilename ïðåäïîëàãàÿ ÷òî ïàïêà theme íàõîäèòñÿ íà óðîâåíü âûøå bsFilename CString sThemePath; CString sFilenameReverse = sFilepath;sFilenameReverse.MakeReverse(); - - int nIndex = sFilenameReverse.Find(FILE_SEPARATOR_CHAR); - nIndex = sFilenameReverse.Find(FILE_SEPARATOR_CHAR, nIndex + 1); + int nIndex = sFilenameReverse.Find('\\'); + nIndex = sFilenameReverse.Find('\\', nIndex + 1); if(-1 != nIndex) sThemePath = sFilepath.Left(sFilepath.GetLength() - nIndex) + _T("theme"); @@ -173,26 +131,28 @@ namespace BinXlsxRW{ if(oChartSpace.isValid()) { - std::wstring strFilepath = string2std_string(sFilepath); - std::wstring strDir = NSSystemPath::GetDirectoryName(strFilepath); - std::wstring strFilename = NSSystemPath::GetFileName(strFilepath); + std::wstring strFilepath = string2std_string(sFilepath); + std::wstring strDir = NSSystemPath::GetDirectoryName(strFilepath); + std::wstring strFilename = NSSystemPath::GetFileName(strFilepath); CString sRelsDir = strDir.c_str(); CString sFilename = strFilename.c_str(); sRelsDir.Append(_T("_rels")); - - OOX::CSystemUtility::CreateDirectories(sRelsDir); + if( !NSDirectory::Exists(string2std_string(sRelsDir)) ) + OOX::CSystemUtility::CreateDirectories(sRelsDir); oChartSpace.write2(sFilepath); - OOX::CPath pathRelsPath = sRelsDir + FILE_SEPARATOR_STR + sFilename + _T(".rels"); - m_pExternalDrawingConverter->SaveDstContentRels(pathRelsPath.GetPath()); + CString sRelsPath; + sRelsPath.Format(_T("%s\\%s.rels"), sRelsDir, sFilename); + + m_pExternalDrawingConverter->SaveDstContentRels(sRelsPath); CString sContentType(sContentTypePath); sContentType.Append(sFilename); (*sContentTypeElement) = new CString(); - (*sContentTypeElement)->Format(_T(""), sContentType); + (*sContentTypeElement)->Format(_T(""), sContentType); (*sContentTypeElement)->Append(oSaveParams.sAdditionalContentTypes); bRes = true; @@ -212,4 +172,4 @@ namespace BinXlsxRW{ { m_pExternalDrawingConverter = pDrawingConverter; } -}; +}; \ No newline at end of file diff --git a/ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.h b/ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.h index 9345c7d91f..c7574461ee 100644 --- a/ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.h +++ b/ASCOfficeDocxFile2/DocWrapper/XlsxSerializer.h @@ -25,15 +25,10 @@ namespace BinXlsxRW { public: CXlsxSerializer(); ~CXlsxSerializer(); - - void CreateXlsxFolders(CString& sXmlOptions, CString sDstPath, CString& sMediaPath); - bool loadFromFile(CString& sSrcFileName, CString& sDstPath, CString& sXMLOptions, CString& sMediaDir); bool saveToFile(CString& sSrcFileName, CString& sDstPath, CString& sXMLOptions); - bool loadChart(CString& sChartPath, NSBinPptxRW::CBinaryFileWriter& oBufferedStream, long& lDataSize); bool saveChart(NSBinPptxRW::CBinaryFileReader& oBufferedStream, long lLength, CString& sFilename, CString& sContentTypePath, CString** sContentTypeElement); - void setFontDir(CString& sFontDir); void setEmbeddedFontsDir(CString& sEmbeddedFontsDir); void setDrawingConverter(NSBinPptxRW::CDrawingConverter* pDrawingConverter); diff --git a/ASCOfficeDocxFile2/DocxFile2.h b/ASCOfficeDocxFile2/DocxFile2.h index ca0a3f9b27..376dca2f7e 100644 --- a/ASCOfficeDocxFile2/DocxFile2.h +++ b/ASCOfficeDocxFile2/DocxFile2.h @@ -134,10 +134,8 @@ public: CString sDirectoryOut = bstrDirectoryOut; CString sThemePath; CString sMediaPath; - - m_oCDocxSerializer.CreateDocxFolders(sDirectoryOut, sThemePath, sMediaPath); + CreateDocument(sDirectoryOut, sThemePath, sMediaPath); bool bRes = m_oCDocxSerializer.loadFromFile(CString(bstrFileIn), CString(bstrDirectoryOut), CString(_T("")), CString(sThemePath.GetString()), CString(sMediaPath.GetString())); - return bRes ? S_OK : S_FALSE; } STDMETHOD(GetXmlContent)(SAFEARRAY* pBinaryObj, LONG lStart, LONG lLength, BSTR* bsXml) @@ -149,4 +147,60 @@ public: return bRes ? S_OK : S_FALSE; } private: + void CreateDocument(CString strDirectory, CString& sThemePath, CString& sMediaPath) + { + HINSTANCE hInst = _AtlBaseModule.GetModuleInstance(); + + // rels + CString strRels = strDirectory + _T("\\_rels"); + CreateDirectory(strRels, NULL); + + LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_DEFAULT_DOC_RELS), _T("DOCXWR"), strRels + _T("\\.rels")); + + + + // docProps + CString strDocProps = strDirectory + _T("\\docProps"); + CreateDirectory(strDocProps, NULL); + + LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_DEFAULT_DOC_APP), _T("DOCXWR"), strDocProps + _T("\\app.xml")); + LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_DEFAULT_DOC_CORE), _T("DOCXWR"), strDocProps + _T("\\core.xml")); + + // word + CString strWord = strDirectory + _T("\\word"); + CreateDirectory(strWord, NULL); + + sMediaPath = strWord + _T("\\media"); + + //LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_DEFAULT_DOC_SETTINGS), _T("DOCXWR"), strWord + _T("\\settings.xml")); + LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_DEFAULT_DOC_WEBSETTINGS), _T("DOCXWR"), strWord + _T("\\webSettings.xml")); + + // theme + CString strTheme = strWord + _T("\\theme"); + CreateDirectory(strTheme, NULL); + CString strThemeRels = strTheme + _T("\\_rels"); + CreateDirectory(strThemeRels, NULL); + sThemePath = strTheme + _T("\\theme1.xml"); + LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_DEFAULT_DOC_THEME), _T("DOCXWR"), sThemePath); + + // documentRels + CreateDirectory(strWord + _T("\\_rels"), NULL); + } + void LoadResourceFile(HINSTANCE hInst, LPCTSTR sResName, LPCTSTR sResType, const CString& strDstFile) + { + HRSRC hrRes = FindResource(hInst, sResName, sResType); + if (!hrRes) + return; + + HGLOBAL hGlobal = LoadResource(hInst, hrRes); + DWORD sz = SizeofResource(hInst, hrRes); + void* ptrRes = LockResource(hGlobal); + + CFile oFile; + oFile.CreateFile(strDstFile); + oFile.WriteFile(ptrRes, sz); + + UnlockResource(hGlobal); + FreeResource(hGlobal); + } }; \ No newline at end of file diff --git a/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro b/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro index 6152390125..6ea4ed5d85 100644 --- a/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro +++ b/ASCOfficeDocxFile2/Linux/ASCOfficeDocxFile2Lib.pro @@ -1,81 +1,79 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2014-10-10T14:24:04 -# -#------------------------------------------------- - -QT -= core gui - -TARGET = ASCOfficeDocxFile2Lib -TEMPLATE = lib -CONFIG += staticlib -QMAKE_CXXFLAGS += -std=c++0x -Wall -Wno-ignored-qualifiers -g -DEFINES += UNICODE \ - _UNICODE \ - LINUX \ - _LINUX_QT \ - NODOCX \ - _USE_XMLLITE_READER_ \ - USE_LITE_READER \ - USE_ATL_CSTRING \ - USE_AVSOFFICESTUDIO_XMLUTILS \ - SOLUTION_ASCOFFICEDOCXFILE2 \ - DISABLE_FILE_DOWNLOADER \ - _USE_LIBXML2_READER_ \ - LIBXML_READER_ENABLED - -INCLUDEPATH += \ - ../../DesktopEditor/freetype-2.5.2/include \ - ../../Common/DocxFormat/Source/XML/libxml2/XML/include - -INCLUDEPATH += \ - /usr/include/libxml2 - -LIBS += -lxml2 - -SOURCES += ../DocWrapper/DocxSerializer.cpp \ - ../DocWrapper/FontProcessor.cpp \ - ../DocWrapper/XlsxSerializer.cpp \ - ../../XlsxSerializerCom/Common/Common.cpp \ - ../../XlsxSerializerCom/Reader/ChartFromToBinary.cpp \ - ../../XlsxSerializerCom/Reader/CommonWriter.cpp \ - ../../XlsxSerializerCom/Reader/CSVReader.cpp \ - ../../XlsxSerializerCom/Writer/CSVWriter.cpp - -HEADERS += ../DocWrapper/DocxSerializer.h \ - ../DocWrapper/FontProcessor.h \ - ../DocWrapper/XlsxSerializer.h \ - ../BinReader/ChartWriter.h \ - ../BinReader/CommentsWriter.h \ - ../BinReader/ContentTypesWriter.h \ - ../BinReader/DocumentRelsWriter.h \ - ../BinReader/DocumentWriter.h \ - ../BinReader/FileWriter.h \ - ../BinReader/fontTableWriter.h \ - ../BinReader/HeaderFooterWriter.h \ - ../BinReader/MediaWriter.h \ - ../BinReader/NumberingWriter.h \ - ../BinReader/ReaderClasses.h \ - ../BinReader/Readers.h \ - ../BinReader/SettingWriter.h \ - ../BinReader/StylesWriter.h \ - ../BinWriter/BinEquationWriter.h \ - ../BinWriter/BinReaderWriterDefines.h \ - ../BinWriter/BinWriters.h \ - ../../XlsxSerializerCom/Common/BinReaderWriterDefines.h \ - ../../XlsxSerializerCom/Common/Common.h \ - ../../XlsxSerializerCom/Reader/BinaryWriter.h \ - ../../XlsxSerializerCom/Reader/ChartFromToBinary.h \ - ../../XlsxSerializerCom/Reader/CommonWriter.h \ - ../../XlsxSerializerCom/Reader/CSVReader.h \ - ../../XlsxSerializerCom/Writer/BinaryCommonReader.h \ - ../../XlsxSerializerCom/Writer/BinaryReader.h \ - ../../XlsxSerializerCom/Writer/CSVWriter.h \ - ../BinReader/webSettingsWriter.h \ - ../BinReader/DefaultThemeWriterLinux.h - -unix { - target.path = /usr/lib - INSTALLS += target -} - +#------------------------------------------------- +# +# Project created by QtCreator 2014-10-10T14:24:04 +# +#------------------------------------------------- + +QT -= core gui + +TARGET = ASCOfficeDocxFile2Lib +TEMPLATE = lib +CONFIG += staticlib +QMAKE_CXXFLAGS += -std=c++0x -Wall -Wno-ignored-qualifiers -g +DEFINES += UNICODE \ + _UNICODE \ + LINUX \ + _LINUX_QT \ + NODOCX \ + _USE_XMLLITE_READER_ \ + USE_LITE_READER \ + USE_ATL_CSTRING \ + USE_AVSOFFICESTUDIO_XMLUTILS \ + SOLUTION_ASCOFFICEDOCXFILE2 \ + DISABLE_FILE_DOWNLOADER \ + _USE_LIBXML2_READER_ \ + LIBXML_READER_ENABLED + +INCLUDEPATH += \ + ../../DesktopEditor/freetype-2.5.2/include \ + ../../Common/DocxFormat/Source/XML/libxml2/XML/include + +INCLUDEPATH += \ + /usr/include/libxml2 + +LIBS += -lxml2 + +SOURCES += ../DocWrapper/DocxSerializer.cpp \ + ../DocWrapper/FontProcessor.cpp \ + ../DocWrapper/XlsxSerializer.cpp \ + ../../XlsxSerializerCom/Common/Common.cpp \ + ../../XlsxSerializerCom/Reader/ChartFromToBinary.cpp \ + ../../XlsxSerializerCom/Reader/CommonWriter.cpp \ + ../../XlsxSerializerCom/Reader/CSVReader.cpp \ + ../../XlsxSerializerCom/Writer/CSVWriter.cpp + +HEADERS += ../DocWrapper/DocxSerializer.h \ + ../DocWrapper/FontProcessor.h \ + ../DocWrapper/XlsxSerializer.h \ + ../BinReader/ChartWriter.h \ + ../BinReader/CommentsWriter.h \ + ../BinReader/ContentTypesWriter.h \ + ../BinReader/DocumentRelsWriter.h \ + ../BinReader/DocumentWriter.h \ + ../BinReader/FileWriter.h \ + ../BinReader/fontTableWriter.h \ + ../BinReader/HeaderFooterWriter.h \ + ../BinReader/MediaWriter.h \ + ../BinReader/NumberingWriter.h \ + ../BinReader/ReaderClasses.h \ + ../BinReader/Readers.h \ + ../BinReader/SettingWriter.h \ + ../BinReader/StylesWriter.h \ + ../BinWriter/BinEquationWriter.h \ + ../BinWriter/BinReaderWriterDefines.h \ + ../BinWriter/BinWriters.h \ + ../../XlsxSerializerCom/Common/BinReaderWriterDefines.h \ + ../../XlsxSerializerCom/Common/Common.h \ + ../../XlsxSerializerCom/Reader/BinaryWriter.h \ + ../../XlsxSerializerCom/Reader/ChartFromToBinary.h \ + ../../XlsxSerializerCom/Reader/CommonWriter.h \ + ../../XlsxSerializerCom/Reader/CSVReader.h \ + ../../XlsxSerializerCom/Writer/BinaryCommonReader.h \ + ../../XlsxSerializerCom/Writer/BinaryReader.h \ + ../../XlsxSerializerCom/Writer/CSVWriter.h + +unix { + target.path = /usr/lib + INSTALLS += target +} + diff --git a/ASCOfficeDocxFile2/PptxFile.h b/ASCOfficeDocxFile2/PptxFile.h index 96c70fa535..1d074b190c 100644 --- a/ASCOfficeDocxFile2/PptxFile.h +++ b/ASCOfficeDocxFile2/PptxFile.h @@ -182,16 +182,14 @@ void comLoadTheme(void* pArg, int nIndex, CString& strDstFolder) CDirectory::CreateDirectory(strDstFolder + _T("\\ppt\\notesMasters")); pCAVSOfficePPTXFile->LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_XML_NOTESMASTER), _T("PPTXW"), strDstFolder + _T("\\ppt\\notesMasters\\notesMaster1.xml")); - OOX::CPath pathNotesMasterRels = strDstFolder + _T("\\ppt\\notesMasters\\_rels"); - CDirectory::CreateDirectory(pathNotesMasterRels.GetPath()); - + CDirectory::CreateDirectory(strDstFolder + _T("\\ppt\\notesMasters\\_rels")); CString strThemeNotesNum = _T(""); strThemeNotesNum.Format(_T("%d"), nIndex); CString strVal = _T("\ \ "); CFile oFileRels; - oFileRels.CreateFile(pathNotesMasterRels.GetPath() + FILE_SEPARATOR_STR + _T("notesMaster1.xml.rels")); + oFileRels.CreateFile(strDstFolder + _T("\\ppt\\notesMasters\\_rels\\notesMaster1.xml.rels")); oFileRels.WriteStringUTF8(strVal); oFileRels.CloseFile(); } diff --git a/ASCOfficeDocxFile2/Resources/.rels b/ASCOfficeDocxFile2/Resources/.rels new file mode 100644 index 0000000000..889dd8fe8d --- /dev/null +++ b/ASCOfficeDocxFile2/Resources/.rels @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ASCOfficeDocxFile2/Resources/[Content_Types].xml b/ASCOfficeDocxFile2/Resources/[Content_Types].xml new file mode 100644 index 0000000000..009dfcae67 --- /dev/null +++ b/ASCOfficeDocxFile2/Resources/[Content_Types].xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ASCOfficeDocxFile2/Resources/app.xml b/ASCOfficeDocxFile2/Resources/app.xml new file mode 100644 index 0000000000..c74ecd680f --- /dev/null +++ b/ASCOfficeDocxFile2/Resources/app.xml @@ -0,0 +1 @@ +1100OnlyOffice011falsefalse0falsefalse3.0000 diff --git a/ASCOfficeDocxFile2/Resources/core.xml b/ASCOfficeDocxFile2/Resources/core.xml new file mode 100644 index 0000000000..a033b145cf --- /dev/null +++ b/ASCOfficeDocxFile2/Resources/core.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ASCOfficeDocxFile2/Resources/theme.xml b/ASCOfficeDocxFile2/Resources/theme.xml new file mode 100644 index 0000000000..ec7f51395d --- /dev/null +++ b/ASCOfficeDocxFile2/Resources/theme.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ASCOfficeDocxFile2/Resources/webSettings.xml b/ASCOfficeDocxFile2/Resources/webSettings.xml new file mode 100644 index 0000000000..060c6417ca --- /dev/null +++ b/ASCOfficeDocxFile2/Resources/webSettings.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ASCOfficeDocxFile2/XlsxFile2.h b/ASCOfficeDocxFile2/XlsxFile2.h index 5de02128ab..ad2a4d9b8f 100644 --- a/ASCOfficeDocxFile2/XlsxFile2.h +++ b/ASCOfficeDocxFile2/XlsxFile2.h @@ -56,14 +56,31 @@ public: { } public: - STDMETHOD(LoadFromFile)(BSTR sSrcFileName, BSTR bstrDstPath, BSTR bstrXMLOptions) + STDMETHOD(LoadFromFile)(BSTR sSrcFileName, BSTR sDstPath, BSTR bstrXMLOptions) { - CString sDstPath = bstrDstPath; - CString sMediaPath; - - m_oXlsxSerializer.CreateXlsxFolders(CString(bstrXMLOptions), sDstPath, sMediaPath); + CString sMediaDir = sDstPath; + sMediaDir.Append(_T("\\xl\\media")); + // File Type (Ìîæíî ïàðñèòü íå äâà ðàçà, à îäèí, åñëè ïåðåäàâàòü â ReadFile íå îïöèè, à ïàðàìåòðû) + BYTE fileType; + UINT nCodePage; + WCHAR wcDelimiter; + SerializeCommon::ReadFileType(CString(bstrXMLOptions), fileType, nCodePage, wcDelimiter); - bool bRes = m_oXlsxSerializer.loadFromFile(CString(sSrcFileName), sDstPath, CString(bstrXMLOptions), sMediaPath); + if (BinXlsxRW::c_oFileTypes::CSV != fileType) + { + CString sXlDir;sXlDir.Format(_T("%s\\xl"), sDstPath); + CString sThemeDir;sThemeDir.Format(_T("%s\\xl\\%s"), sDstPath, OOX::FileTypes::Theme.DefaultDirectory().GetPath()); + CString sThemePath;sThemePath.Format(_T("%s\\%s"), sThemeDir, OOX::FileTypes::Theme.DefaultFileName().GetPath()); + CString sThemeRelsPath;sThemeRelsPath.Format(_T("%s\\_rels"), sThemeDir); + + NSDirectory::CreateDirectory(string2std_string(sXlDir)); + NSDirectory::CreateDirectory(string2std_string(sThemeDir)); + NSDirectory::CreateDirectory(string2std_string(sThemeRelsPath)); + NSDirectory::CreateDirectory(string2std_string(sMediaDir)); + + CreateTheme(sThemePath); + } + bool bRes = m_oXlsxSerializer.loadFromFile(CString(sSrcFileName), CString(sDstPath), CString(bstrXMLOptions), sMediaDir); return bRes ? S_OK : S_FALSE; } STDMETHOD(SaveToFile)(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions) @@ -127,5 +144,26 @@ public: return S_OK; } private: + void CreateTheme(CString sThemePath) + { + HINSTANCE hInst = _AtlBaseModule.GetModuleInstance(); + LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_DEFAULT_XLSX_THEME), _T("XLSXSER"), sThemePath); + } + void LoadResourceFile(HINSTANCE hInst, LPCTSTR sResName, LPCTSTR sResType, const CString& strDstFile) + { + HRSRC hrRes = FindResource(hInst, sResName, sResType); + if (!hrRes) + return; + HGLOBAL hGlobal = LoadResource(hInst, hrRes); + DWORD sz = SizeofResource(hInst, hrRes); + void* ptrRes = LockResource(hGlobal); + + CFile oFile; + oFile.CreateFile(strDstFile); + oFile.WriteFile(ptrRes, sz); + + UnlockResource(hGlobal); + FreeResource(hGlobal); + } }; \ No newline at end of file diff --git a/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp b/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp index c95e0c49d1..2c0ce77870 100644 --- a/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp +++ b/ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp @@ -3129,16 +3129,14 @@ HRESULT CDrawingConverter::SaveThemeXml(LONG lStart, LONG lLength, const CString m_pXmlWriter->SaveToFile(strThemePath); OOX::CPath filename = strThemePath; - CString strTemp = filename.GetDirectory() + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR; - + CString strTemp = filename.GetDirectory() + _T("\\_rels\\"); CString strFileName = filename.GetFilename(); + if (strFileName == _T("")) + strTemp += _T(".rels"); + else + strTemp += (strFileName + _T(".rels")); - if (strFileName == _T("")) strTemp += _T(".rels"); - else strTemp += (strFileName + _T(".rels")); - - filename = strTemp; - - SaveDstContentRels(filename.GetPath()); + SaveDstContentRels(strTemp); m_pXmlWriter->ClearNoAttack(); diff --git a/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp b/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp index fc5f8e21da..52499501d8 100644 --- a/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp +++ b/ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp @@ -26,7 +26,7 @@ CPPTXFile::CPPTXFile(load_from_resource fCallbackResource, extract_to_directory m_strTempDir = CStringW(buffer) + CStringW("_PPTX\\"); #else m_strTempDir = FileSystem::Directory::GetTempPath(); - m_strTempDir = FileSystem::Directory::GetLongPathNameW(m_strTempDir) + CString("_PPTX/"); + m_strTempDir = FileSystem::Directory::GetLongPathNameW(m_strTempDir) + CString("_PPTX\\"); #endif // m_strFontDirectory = _T(""); @@ -274,11 +274,7 @@ HRESULT CPPTXFile::OpenFileToPPTY(BSTR bsInput, BSTR bsOutput) m_strMediaDirectory = m_strMediaDirectory.Mid(0, nIndex); oBinaryWriter.m_strMainFolder = m_strMediaDirectory; - m_strMediaDirectory = m_strMediaDirectory + FILE_SEPARATOR_STR + _T("media"); - - OOX::CPath pathMedia = m_strMediaDirectory; - m_strMediaDirectory = pathMedia.GetPath(); - + m_strMediaDirectory = m_strMediaDirectory + _T("\\media"); oBinaryWriter.m_pCommon->m_pImageManager->m_strDstMedia = m_strMediaDirectory; FileSystem::Directory::CreateDirectory(m_strMediaDirectory); @@ -339,12 +335,9 @@ HRESULT CPPTXFile::OpenDirectoryToPPTY(BSTR bsInput, BSTR bsOutput) m_strMediaDirectory = m_strMediaDirectory.Mid(0, nIndex); oBinaryWriter.m_strMainFolder = m_strMediaDirectory; - m_strMediaDirectory = m_strMediaDirectory + FILE_SEPARATOR_STR + _T("media"); + m_strMediaDirectory = m_strMediaDirectory + _T("\\media"); + oBinaryWriter.m_pCommon->m_pImageManager->m_strDstMedia = m_strMediaDirectory; - OOX::CPath pathMedia = m_strMediaDirectory; - m_strMediaDirectory = pathMedia.GetPath(); - - oBinaryWriter.m_pCommon->m_pImageManager->m_strDstMedia = m_strMediaDirectory; FileSystem::Directory::CreateDirectory(m_strMediaDirectory); PPTX2EditorAdvanced::Convert(oBinaryWriter, *m_pFolder, m_strDirectory, sDstFileOutput); diff --git a/ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp b/ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp index 0880c852b0..bbba6f05e8 100644 --- a/ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp +++ b/ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp @@ -28,10 +28,6 @@ #define DOUBLE_MAIN 10000 -#ifdef _WIN32 - #include "../../Common/DocxFormat/Source/Base/unicode_util.h" -#endif - namespace NSBinPptxRW { inline LONG __strlen(const char* str) @@ -159,7 +155,7 @@ namespace NSBinPptxRW { strImage.Format(_T("image%d"), m_lIndexNextImage++); - OOX::CPath pathOutput = m_strDstMedia + FILE_SEPARATOR_STR + strImage + strExts; + CString strOutput = m_strDstMedia + _T("\\") + strImage + strExts; if (!m_bIsWord) strImage = _T("../media/") + strImage + strExts; @@ -173,9 +169,9 @@ namespace NSBinPptxRW // òåïåðü íóæíî ñêîïèðîâàòü êàðòèíêó if (_T("") != strMetafileImage) - CDirectory::CopyFile(strMetafileImage, pathOutput.GetPath(), NULL, NULL); - else if (pathOutput.GetPath() != strInput) - CDirectory::CopyFile(strInput, pathOutput.GetPath(), NULL, NULL); + CDirectory::CopyFile(strMetafileImage, strOutput, NULL, NULL); + else if (strOutput != strInput) + CDirectory::CopyFile(strInput, strOutput, NULL, NULL); } else { @@ -183,7 +179,7 @@ namespace NSBinPptxRW strExts = _T(".png"); strImage.Format(_T("image%d"), m_lIndexNextImage++); - OOX::CPath pathOutput = m_strDstMedia + FILE_SEPARATOR_STR + strImage + strExts; + CString strOutput = m_strDstMedia + _T("\\") + strImage + strExts; if (!m_bIsWord) strImage = _T("../media/") + strImage + strExts; @@ -195,7 +191,7 @@ namespace NSBinPptxRW else m_mapImages [strBase64Image] = strImage; - SaveImageAsPng(strInput, pathOutput.GetPath()); + SaveImageAsPng(strInput, strOutput); } return strImage; } @@ -410,56 +406,18 @@ namespace NSBinPptxRW void CBinaryFileWriter::WriteStringW(const WCHAR* sBuffer) { LONG lSize = __wstrlen(sBuffer); + LONG lSizeMem = lSize * sizeof(wchar_t); - LONG lSizeMem =0; + CheckBufferSize(ULONG_SIZEOF + lSizeMem); - if (sizeof(wchar_t) == 4) - { - lSizeMem = lSize * sizeof(UTF16); + *((ULONG*)m_pStreamCur) = lSizeMem; + m_lPosition += ULONG_SIZEOF; + m_pStreamCur += ULONG_SIZEOF; - CheckBufferSize(ULONG_SIZEOF + lSizeMem); - - *((ULONG*)m_pStreamCur) = lSizeMem; - - m_lPosition += ULONG_SIZEOF; - m_pStreamCur += ULONG_SIZEOF; - - UTF16* pStrUtf16 = (UTF16 *) m_pStreamCur; - UTF32 *pStrUtf32 = (UTF32 *) sBuffer; - - // this values will be modificated - UTF16 *pStrUtf16_Conv = pStrUtf16; - const UTF32 *pStrUtf32_Conv = pStrUtf32; - - ConversionResult eUnicodeConversionResult = - ConvertUTF32toUTF16 (&pStrUtf32_Conv - , &pStrUtf32[lSize] - , &pStrUtf16_Conv - , &pStrUtf16 [lSize] - , strictConversion); - - if (conversionOK != eUnicodeConversionResult) - { - return; - } - } - else - { - lSizeMem = lSize * sizeof(wchar_t); - - CheckBufferSize(ULONG_SIZEOF + lSizeMem); - - *((ULONG*)m_pStreamCur) = lSizeMem; - - m_lPosition += ULONG_SIZEOF; - m_pStreamCur += ULONG_SIZEOF; - - memcpy(m_pStreamCur, sBuffer, lSizeMem); - } - - m_lPosition += lSizeMem; - m_pStreamCur += lSizeMem; - } + memcpy(m_pStreamCur, sBuffer, lSizeMem); + m_lPosition += lSizeMem; + m_pStreamCur += lSizeMem; + } void CBinaryFileWriter::WriteBYTEArray(const BYTE* pBuffer, size_t len) { CheckBufferSize(len); @@ -492,34 +450,7 @@ namespace NSBinPptxRW WCHAR* pChars = sBuffer.GetBuffer(); WriteStringW(pChars); } - void CBinaryFileWriter::WriteStringW2(const WCHAR* sBuffer) - { - if (sizeof(wchar_t) == 4) - { - WriteStringW2_4(sBuffer); - }else - { - WriteStringW2_2(sBuffer); - } - } - void CBinaryFileWriter::WriteStringW2_2(const WCHAR* sBuffer) - { - LONG lSize = __wstrlen(sBuffer); - LONG lSizeMem = lSize * sizeof(UTF16); - - CheckBufferSize(ULONG_SIZEOF + lSizeMem); - - *((ULONG*)m_pStreamCur) = lSize; - m_lPosition += ULONG_SIZEOF; - m_pStreamCur += ULONG_SIZEOF; - - memcpy(m_pStreamCur, sBuffer, lSizeMem); - m_lPosition += lSizeMem; - m_pStreamCur += lSizeMem; - - } - - void CBinaryFileWriter::WriteStringW2_4(const WCHAR* sBuffer) + void CBinaryFileWriter::WriteStringW2(const WCHAR* sBuffer) { LONG lSize = __wstrlen(sBuffer); LONG lSizeMem = lSize * sizeof(wchar_t); @@ -530,25 +461,8 @@ namespace NSBinPptxRW m_lPosition += ULONG_SIZEOF; m_pStreamCur += ULONG_SIZEOF; - UTF16* pStrUtf16 = (UTF16 *) m_pStreamCur; - UTF32 *pStrUtf32 = (UTF32 *) sBuffer; - - // this values will be modificated - UTF16 *pStrUtf16_Conv = pStrUtf16; - const UTF32 *pStrUtf32_Conv = pStrUtf32; - - ConversionResult eUnicodeConversionResult = - ConvertUTF32toUTF16 (&pStrUtf32_Conv - , &pStrUtf32[lSize] - , &pStrUtf16_Conv - , &pStrUtf16 [lSize] - , strictConversion); - - if (conversionOK != eUnicodeConversionResult) - { - return; - } - m_lPosition += lSizeMem; + memcpy(m_pStreamCur, sBuffer, lSizeMem); + m_lPosition += lSizeMem; m_pStreamCur += lSizeMem; } void CBinaryFileWriter::WriteStringW2(CString& sBuffer) @@ -556,58 +470,17 @@ namespace NSBinPptxRW WriteStringW2(sBuffer.GetBuffer()); } void CBinaryFileWriter::WriteStringW3(const WCHAR* sBuffer) - { - if (sizeof(wchar_t) == 4) - { - WriteStringW3_4(sBuffer); - }else - { - WriteStringW3_2(sBuffer); - } + { + LONG lSize = __wstrlen(sBuffer); + LONG lSizeMem = lSize * sizeof(wchar_t); + + CheckBufferSize(lSizeMem); + + memcpy(m_pStreamCur, sBuffer, lSizeMem); + m_lPosition += lSizeMem; + m_pStreamCur += lSizeMem; } - void CBinaryFileWriter::WriteStringW3_2(const WCHAR* sBuffer) - { - LONG lSize = __wstrlen(sBuffer); - - LONG lSizeMem = lSize * sizeof(wchar_t); - - CheckBufferSize(lSizeMem); - - memcpy(m_pStreamCur, sBuffer, lSizeMem); - m_lPosition += lSizeMem; - m_pStreamCur += lSizeMem; - } - void CBinaryFileWriter::WriteStringW3_4(const WCHAR* sBuffer) - { - LONG lSize = __wstrlen(sBuffer); - - LONG lSizeMem = lSize * sizeof(UTF16); - - CheckBufferSize(lSizeMem); - - UTF16* pStrUtf16 = (UTF16 *) m_pStreamCur; - UTF32 *pStrUtf32 = (UTF32 *) sBuffer; - - // this values will be modificated - UTF16 *pStrUtf16_Conv = pStrUtf16; - const UTF32 *pStrUtf32_Conv = pStrUtf32; - - ConversionResult eUnicodeConversionResult = - ConvertUTF32toUTF16 (&pStrUtf32_Conv - , &pStrUtf32[lSize] - , &pStrUtf16_Conv - , &pStrUtf16 [lSize] - , strictConversion); - - if (conversionOK != eUnicodeConversionResult) - { - return; - } - - m_lPosition += lSizeMem; - m_pStreamCur += lSizeMem; - } - void CBinaryFileWriter::WriteStringW3(CString& sBuffer) + void CBinaryFileWriter::WriteStringW3(CString& sBuffer) { WriteStringW3(sBuffer.GetBuffer()); } @@ -680,41 +553,15 @@ namespace NSBinPptxRW BYTE bType = (BYTE)type; WriteBYTE(bType); - ULONG lSize = (ULONG)val.GetLength() , len = lSize; - WriteULONG(lSize); + ULONG len = (ULONG)val.GetLength(); + WriteULONG(len); len <<= 1; CString* s = const_cast(&val); CheckBufferSize(len); - WCHAR *buffer = s->GetBuffer(); - - if (sizeof(buffer[0]) == 4) - { - UTF16* pStrUtf16 = (UTF16 *) m_pStreamCur; - UTF32 *pStrUtf32 = (UTF32 *) buffer; - - // this values will be modificated - UTF16 *pStrUtf16_Conv = pStrUtf16; - const UTF32 *pStrUtf32_Conv = pStrUtf32; - - ConversionResult eUnicodeConversionResult = - ConvertUTF32toUTF16 (&pStrUtf32_Conv - , &pStrUtf32[lSize] - , &pStrUtf16_Conv - , &pStrUtf16 [lSize] - , strictConversion); - - if (conversionOK != eUnicodeConversionResult) - { - return; - } - }else - { - - memcpy(m_pStreamCur, s->GetBuffer(), len); - } + memcpy(m_pStreamCur, s->GetBuffer(), len); m_pStreamCur += len; m_lPosition += len; } @@ -725,41 +572,15 @@ namespace NSBinPptxRW } void CBinaryFileWriter::WriteString(const CString& val) { - ULONG lSize = (ULONG)val.GetLength() , len = lSize; - WriteULONG(len); + ULONG len = (ULONG)val.GetLength(); + WriteULONG(len); len <<= 1; CString* s = const_cast(&val); CheckBufferSize(len); - WCHAR *buffer = s->GetBuffer(); - - if (sizeof(buffer[0]) == 4) - { - UTF16* pStrUtf16 = (UTF16 *) m_pStreamCur; - UTF32 *pStrUtf32 = (UTF32 *) buffer; - - // this values will be modificated - UTF16 *pStrUtf16_Conv = pStrUtf16; - const UTF32 *pStrUtf32_Conv = pStrUtf32; - - ConversionResult eUnicodeConversionResult = - ConvertUTF32toUTF16 (&pStrUtf32_Conv - , &pStrUtf32[lSize] - , &pStrUtf16_Conv - , &pStrUtf16 [lSize] - , strictConversion); - - if (conversionOK != eUnicodeConversionResult) - { - return; - } - }else - { - - memcpy(m_pStreamCur, s->GetBuffer(), len); - } + memcpy(m_pStreamCur, s->GetBuffer(), len); m_pStreamCur += len; m_lPosition += len; } @@ -1128,7 +949,7 @@ namespace NSBinPptxRW strRid.Format(_T("rId%d"), m_lNextRelsID++); CString strRels = _T(""); - strRels.Format(_T(""), + strRels.Format(_T(""), strRid, strImage); m_pWriter->WriteString(strRels); @@ -1151,7 +972,7 @@ namespace NSBinPptxRW strRid.Format(_T("rId%d"), m_lNextRelsID++); CString strRels = _T(""); - strRels.Format(_T(""), + strRels.Format(_T(""), strRid, strChart); m_pWriter->WriteString(strRels); @@ -1200,12 +1021,12 @@ namespace NSBinPptxRW if (!bIsSlide) { - strRels.Format(_T(""), + strRels.Format(_T(""), strRid, sLink); } else { - strRels.Format(_T(""), + strRels.Format(_T(""), strRid ,sLink); } diff --git a/ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.h b/ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.h index d43df78712..b96d0e4db7 100644 --- a/ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.h +++ b/ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.h @@ -229,13 +229,9 @@ namespace NSBinPptxRW void WriteStringA(CStringA& sBuffer); void WriteStringW(CString& sBuffer); void WriteStringW2(const WCHAR* sBuffer); - void WriteStringW2_2(const WCHAR* sBuffer); - void WriteStringW2_4(const WCHAR* sBuffer); void WriteStringW2(CString& sBuffer); void WriteStringW3(const WCHAR* sBuffer); void WriteStringW3(CString& sBuffer); - void WriteStringW3_2(const WCHAR* sBuffer); - void WriteStringW3_4(const WCHAR* sBuffer); // -------------------------------------------------------- public: diff --git a/ASCOfficePPTXFile/Editor/PPTXWriter.h b/ASCOfficePPTXFile/Editor/PPTXWriter.h index 4e3286e8ad..6e956a5191 100644 --- a/ASCOfficePPTXFile/Editor/PPTXWriter.h +++ b/ASCOfficePPTXFile/Editor/PPTXWriter.h @@ -69,9 +69,7 @@ namespace NSBinPptxRW FileSystem::Directory::CreateDirectory(string2std_string(strPPT), _T("media")); m_oImageManager.Clear(); - - OOX::CPath pathMedia = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("media"); - m_oImageManager.SetDstMedia(pathMedia.GetPath()); + m_oImageManager.SetDstMedia(m_strDstFolder + _T("\\ppt\\media")); m_oReader.m_pRels->m_pManager = &m_oImageManager; } @@ -262,11 +260,11 @@ namespace NSBinPptxRW pPair = m_mainTables.find(NSMainTables::Themes); if (m_mainTables.end() != pPair) { - OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("theme"); - OOX::CPath pathFolderRels = pathFolder.GetPath() + FILE_SEPARATOR_STR + _T("_rels"); + CString strFolder = m_strDstFolder + _T("\\ppt\\theme"); + CString strFolderRels = strFolder + _T("\\_rels"); - FileSystem::Directory::CreateDirectory(pathFolder.GetPath()); - FileSystem::Directory::CreateDirectory(pathFolderRels.GetPath()); + FileSystem::Directory::CreateDirectory(strFolder); + FileSystem::Directory::CreateDirectory(strFolderRels); m_oReader.Seek(pPair->second); m_oReader.Skip(4); @@ -287,18 +285,14 @@ namespace NSBinPptxRW m_arThemes[i].fromPPTY(&m_oReader); CString strMasterXml = _T(""); - strMasterXml.Format(_T("theme%d.xml"), i + 1); + strMasterXml.Format(_T("\\theme%d.xml"), i + 1); oXmlWriter.ClearNoAttack(); m_oReader.m_pRels->CloseRels(); m_arThemes[i].toXmlWriter(&oXmlWriter); - - pathFolder = pathFolder + FILE_SEPARATOR_STR + strMasterXml; - oXmlWriter.SaveToFile(pathFolder.GetPath()); - - pathFolderRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + _T(".rels"); - m_oReader.m_pRels->SaveRels(pathFolderRels.GetPath()); + oXmlWriter.SaveToFile(strFolder + strMasterXml); + m_oReader.m_pRels->SaveRels(strFolderRels + strMasterXml + _T(".rels")); } } @@ -306,11 +300,11 @@ namespace NSBinPptxRW pPair = m_mainTables.find(NSMainTables::SlideMasters); if (m_mainTables.end() != pPair) { - OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("slideMasters"); - OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels"); + CString strFolder = m_strDstFolder + _T("\\ppt\\slideMasters"); + CString strFolderRels = strFolder + _T("\\_rels"); - FileSystem::Directory::CreateDirectory(pathFolder.GetPath()); - FileSystem::Directory::CreateDirectory(pathFolderRels.GetPath()); + FileSystem::Directory::CreateDirectory(strFolder); + FileSystem::Directory::CreateDirectory(strFolderRels); m_oReader.Seek(pPair->second); m_oReader.Skip(4); @@ -344,16 +338,13 @@ namespace NSBinPptxRW m_oReader.m_pRels->CloseRels(); CString strMasterXml = _T(""); - strMasterXml.Format(_T("slideMaster%d.xml"), i + 1); + strMasterXml.Format(_T("\\slideMaster%d.xml"), i + 1); oXmlWriter.ClearNoAttack(); m_arSlideMasters[i].toXmlWriter(&oXmlWriter); - pathFolder = pathFolder + FILE_SEPARATOR_STR + strMasterXml; - oXmlWriter.SaveToFile(pathFolder.GetPath()); - - pathFolderRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + _T(".rels"); - m_oReader.m_pRels->SaveRels(pathFolderRels.GetPath()); + oXmlWriter.SaveToFile(strFolder + strMasterXml); + m_oReader.m_pRels->SaveRels(strFolderRels + strMasterXml + _T(".rels")); } } @@ -361,11 +352,11 @@ namespace NSBinPptxRW pPair = m_mainTables.find(NSMainTables::SlideLayouts); if (m_mainTables.end() != pPair) { - OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR+ _T("ppt") + FILE_SEPARATOR_STR + _T("slideLayouts"); - OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels"); + CString strFolder = m_strDstFolder + _T("\\ppt\\slideLayouts"); + CString strFolderRels = strFolder + _T("\\_rels"); - FileSystem::Directory::CreateDirectory(pathFolder.GetPath()); - FileSystem::Directory::CreateDirectory(pathFolderRels.GetPath()); + FileSystem::Directory::CreateDirectory(strFolder); + FileSystem::Directory::CreateDirectory(strFolderRels); m_oReader.Seek(pPair->second); m_oReader.Skip(4); @@ -381,16 +372,13 @@ namespace NSBinPptxRW m_oReader.m_pRels->CloseRels(); CString strMasterXml = _T(""); - strMasterXml.Format(_T("slideLayout%d.xml"), i + 1); + strMasterXml.Format(_T("\\slideLayout%d.xml"), i + 1); oXmlWriter.ClearNoAttack(); m_arSlideLayouts[i].toXmlWriter(&oXmlWriter); - pathFolder = pathFolder + FILE_SEPARATOR_STR + strMasterXml; - oXmlWriter.SaveToFile(pathFolder.GetPath()); - - pathFolderRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + _T(".rels"); - m_oReader.m_pRels->SaveRels(pathFolderRels.GetPath()); + oXmlWriter.SaveToFile(strFolder + strMasterXml); + m_oReader.m_pRels->SaveRels(strFolderRels + strMasterXml + _T(".rels")); } } @@ -399,11 +387,11 @@ namespace NSBinPptxRW pPair = m_mainTables.find(NSMainTables::Slides); if (m_mainTables.end() != pPair) { - OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("slides"); - OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels"); + CString strFolder = m_strDstFolder + _T("\\ppt\\slides"); + CString strFolderRels = strFolder + _T("\\_rels"); - FileSystem::Directory::CreateDirectory (pathFolder.GetPath()); - FileSystem::Directory::CreateDirectory (pathFolderRels.GetPath()); + FileSystem::Directory::CreateDirectory (strFolder); + FileSystem::Directory::CreateDirectory (strFolderRels); m_oReader.Seek(pPair->second); m_oReader.Skip(4); @@ -419,20 +407,17 @@ namespace NSBinPptxRW if (m_arSlides[i].comments.is_init()) { - m_oReader.m_pRels->WriteSlideComments(nComment); - OOX::CPath pathFolderCommentDir = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("comments"); - if (1 == nComment) + m_oReader.m_pRels->WriteSlideComments(nComment); + if (1 == nComment) { - FileSystem::Directory::CreateDirectory (pathFolderCommentDir.GetPath()); + FileSystem::Directory::CreateDirectory (m_strDstFolder + _T("\\ppt\\comments")); } CString strCommentFile = _T(""); - strCommentFile.Format(_T("comment%d.xml"), nComment); + strCommentFile.Format(_T("\\ppt\\comments\\comment%d.xml"), nComment); oXmlWriter.ClearNoAttack(); m_arSlides[i].comments->toXmlWriter(&oXmlWriter); - - OOX::CPath pathComment = pathFolderCommentDir + strCommentFile; - oXmlWriter.SaveToFile(pathComment.GetPath()); + oXmlWriter.SaveToFile(m_strDstFolder + strCommentFile); ++nComment; } @@ -440,16 +425,13 @@ namespace NSBinPptxRW m_oReader.m_pRels->CloseRels(); CString strMasterXml = _T(""); - strMasterXml.Format(_T("slide%d.xml"), i + 1); + strMasterXml.Format(_T("\\slide%d.xml"), i + 1); oXmlWriter.ClearNoAttack(); m_arSlides[i].toXmlWriter(&oXmlWriter); - pathFolder = pathFolder + FILE_SEPARATOR_STR + strMasterXml; - oXmlWriter.SaveToFile(pathFolder.GetPath()); - - pathFolderRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + _T(".rels"); - m_oReader.m_pRels->SaveRels(pathFolderRels.GetPath()); + oXmlWriter.SaveToFile(strFolder + strMasterXml); + m_oReader.m_pRels->SaveRels(strFolderRels + strMasterXml + _T(".rels")); } } @@ -491,11 +473,11 @@ namespace NSBinPptxRW CreateDefaultNotesMasters((int)m_arThemes.size() + 1); CreateDefaultNote(); - OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("notesSlides"); - OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels"); + CString strFolder = m_strDstFolder + _T("\\ppt\\notesSlides"); + CString strFolderRels = strFolder + _T("\\_rels"); - FileSystem::Directory::CreateDirectory (pathFolder.GetPath()); - FileSystem::Directory::CreateDirectory (pathFolderRels.GetPath()); + FileSystem::Directory::CreateDirectory (strFolder); + FileSystem::Directory::CreateDirectory (strFolderRels); LONG lCount = (LONG)m_arSlides.size(); for (LONG i = 0; i < lCount; ++i) @@ -505,16 +487,13 @@ namespace NSBinPptxRW m_oReader.m_pRels->CloseRels(); CString strMasterXml = _T(""); - strMasterXml.Format(_T("notesSlide%d.xml"), i + 1); + strMasterXml.Format(_T("\\notesSlide%d.xml"), i + 1); oXmlWriter.ClearNoAttack(); m_oDefaultNote.toXmlWriter(&oXmlWriter); - pathFolder = pathFolder + FILE_SEPARATOR_STR + strMasterXml; - oXmlWriter.SaveToFile(pathFolder.GetPath()); - - pathFolderRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + _T(".rels"); - m_oReader.m_pRels->SaveRels(pathFolderRels.GetPath()); + oXmlWriter.SaveToFile(strFolder + strMasterXml); + m_oReader.m_pRels->SaveRels(strFolderRels + strMasterXml + _T(".rels")); } } @@ -579,30 +558,22 @@ namespace NSBinPptxRW // app oXmlWriter.ClearNoAttack(); m_oApp.toXmlWriter(&oXmlWriter); - - OOX::CPath pathApp = m_strDstFolder + FILE_SEPARATOR_STR + _T("docProps") + FILE_SEPARATOR_STR + _T("app.xml"); - oXmlWriter.SaveToFile(pathApp.GetPath()); + oXmlWriter.SaveToFile(m_strDstFolder + _T("\\docProps\\app.xml")); // core oXmlWriter.ClearNoAttack(); m_oCore.toXmlWriter(&oXmlWriter); - - OOX::CPath pathCore = m_strDstFolder + FILE_SEPARATOR_STR + _T("docProps") + FILE_SEPARATOR_STR + _T("core.xml"); - oXmlWriter.SaveToFile(pathCore.GetPath()); + oXmlWriter.SaveToFile(m_strDstFolder + _T("\\docProps\\core.xml")); // presProps oXmlWriter.ClearNoAttack(); m_oPresProps.toXmlWriter(&oXmlWriter); - - OOX::CPath pathPresProps = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("presProps.xml"); - oXmlWriter.SaveToFile(pathPresProps.GetPath()); + oXmlWriter.SaveToFile(m_strDstFolder + _T("\\ppt\\presProps.xml")); // viewProps oXmlWriter.ClearNoAttack(); m_oViewProps.toXmlWriter(&oXmlWriter); - - OOX::CPath pathViewProps = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("viewProps.xml"); - oXmlWriter.SaveToFile(pathViewProps.GetPath()); + oXmlWriter.SaveToFile(m_strDstFolder + _T("\\ppt\\viewProps.xml")); m_oReader.m_pRels->Clear(); m_oReader.m_pRels->StartRels(); @@ -610,19 +581,17 @@ namespace NSBinPptxRW // tablestyles oXmlWriter.ClearNoAttack(); m_oTableStyles.toXmlWriter(&oXmlWriter); - - OOX::CPath pathTableStyles = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("tableStyles.xml"); - oXmlWriter.SaveToFile(pathTableStyles.GetPath()); + oXmlWriter.SaveToFile(m_strDstFolder + _T("\\ppt\\tableStyles.xml")); // presentation bool bIsAuthors = false; pPair = m_mainTables.find(NSMainTables::Presentation); if (m_mainTables.end() != pPair) { - OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt"); - OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels"); + CString strFolder = m_strDstFolder + _T("\\ppt"); + CString strFolderRels = strFolder + _T("\\_rels"); - FileSystem::Directory::CreateDirectory (pathFolderRels.GetPath()); + FileSystem::Directory::CreateDirectory (strFolderRels); m_oReader.Seek(pPair->second); m_oPresentation.fromPPTY(&m_oReader); @@ -672,20 +641,15 @@ namespace NSBinPptxRW oXmlWriter.ClearNoAttack(); m_oPresentation.toXmlWriter(&oXmlWriter); - pathFolder = pathFolder + FILE_SEPARATOR_STR + _T("presentation.xml"); - oXmlWriter.SaveToFile(pathFolder.GetPath()); - - pathFolderRels = pathFolderRels + FILE_SEPARATOR_STR + _T("presentation.xml.rels"); - m_oReader.m_pRels->SaveRels(pathFolderRels.GetPath()); + oXmlWriter.SaveToFile(strFolder + _T("\\presentation.xml")); + m_oReader.m_pRels->SaveRels(strFolderRels + _T("\\presentation.xml.rels")); if (m_oPresentation.commentAuthors.is_init()) { oXmlWriter.ClearNoAttack(); m_oPresentation.commentAuthors->toXmlWriter(&oXmlWriter); - - OOX::CPath pathCommentAuthors = pathFolder + FILE_SEPARATOR_STR + _T("commentAuthors.xml"); - oXmlWriter.SaveToFile(pathCommentAuthors.GetPath()); + oXmlWriter.SaveToFile(strFolder + _T("\\commentAuthors.xml")); bIsAuthors = true; } } @@ -695,22 +659,22 @@ namespace NSBinPptxRW // content types CStringWriter oContentTypes; oContentTypes.WriteString(_T("\ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - ")); +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ +")); // themes for (LONG i = 0; i < (LONG)m_arThemes.size(); ++i) @@ -792,13 +756,9 @@ namespace NSBinPptxRW \ "); - OOX::CPath filePathRels = m_strDstFolder + FILE_SEPARATOR_STR + _T("_rels"); - FileSystem::Directory::CreateDirectory (filePathRels.GetPath()); - - filePathRels = filePathRels + FILE_SEPARATOR_STR + _T(".rels"); - - oFile.CreateFile(filePathRels.GetPath()); - oFile.WriteStringUTF8(strRELS); + FileSystem::Directory::CreateDirectory (m_strDstFolder + _T("\\_rels")); + oFile.CreateFile(m_strDstFolder + _T("\\_rels\\.rels")); + oFile.WriteStringUTF8(strRELS); oFile.CloseFile(); } diff --git a/ASCOfficePPTXFile/Editor/imagemanager.h b/ASCOfficePPTXFile/Editor/imagemanager.h index b7c5781094..bdc1337cd8 100644 --- a/ASCOfficePPTXFile/Editor/imagemanager.h +++ b/ASCOfficePPTXFile/Editor/imagemanager.h @@ -19,9 +19,8 @@ using namespace NSFontCutter; #include "../../DesktopEditor/raster/ImageFileFormatChecker.h" #include "../../DesktopEditor/raster/BgraFrame.h" #include "../../DesktopEditor/graphics/Image.h" - #include "../../Common/DocxFormat/Source/SystemUtility/File.h" -#include "../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h" + #include #ifndef min @@ -80,8 +79,8 @@ namespace NSShapeImageGen AVSINLINE CString GetPath(const CString& strMedia) { CString strExt = _T(""); - strExt.Format(_T("image%d.%ls"), m_lID, (itJPG == m_eType) ? _T("jpg") : _T("png")); - return strMedia + FILE_SEPARATOR_STR + strExt; + strExt.Format(_T("\\image%d.%s"), m_lID, (itJPG == m_eType) ? _T("jpg") : _T("png")); + return strMedia + strExt; } AVSINLINE CString GetPath2() @@ -103,7 +102,7 @@ namespace NSShapeImageGen } CString strExt = _T(""); - strExt.Format(_T("image%d.%ls"), m_lID, _strExt); + strExt.Format(_T("image%d.%s"), m_lID, _strExt); return strExt; } }; @@ -330,12 +329,9 @@ namespace NSShapeImageGen if ( (0xFF == pBuffer[0]) && (0xD8 == pBuffer[1]) && (0xFF == pBuffer[2]) ) { CString strSaveItem = _T(""); - strSaveItem.Format(_T("image%d.jpg"), oInfo.m_lID); - - OOX::CPath pathSaveItem = m_strDstMedia + FILE_SEPARATOR_STR + strSaveItem ; - CDirectory::CopyFile(strFileSrc, pathSaveItem.GetPath(), NULL, NULL); - - oInfo.m_eType = itJPG; + strSaveItem.Format(_T("\\image%d.jpg"), oInfo.m_lID); + CDirectory::CopyFile(strFileSrc, m_strDstMedia + strSaveItem , NULL, NULL); + oInfo.m_eType = itJPG; return true; } @@ -346,17 +342,13 @@ namespace NSShapeImageGen && (0x49 == pBuffer[12]) && (0x48 == pBuffer[13]) && (0x44 == pBuffer[14]) && (0x52 == pBuffer[15])) { CString strSaveItem = _T(""); - strSaveItem.Format(_T("image%d.png"), oInfo.m_lID); - - OOX::CPath pathSaveItem = m_strDstMedia + FILE_SEPARATOR_STR + strSaveItem ; - CDirectory::CopyFile(strFileSrc, pathSaveItem.GetPath(), NULL, NULL); - - oInfo.m_eType = itPNG; + strSaveItem.Format(_T("\\image%d.png"), oInfo.m_lID); + CDirectory::CopyFile(strFileSrc, m_strDstMedia + strSaveItem , NULL, NULL); + oInfo.m_eType = itPNG; return true; } return false; - } - + } void SaveImage(const CString& strFileSrc, CImageInfo& oInfo, LONG __width, LONG __height) { if (CheckImageSimpleCopy(strFileSrc, oInfo)) @@ -378,17 +370,14 @@ namespace NSShapeImageGen unsigned int nOutputFormat; if (itJPG == oInfo.m_eType) { - strSaveItem.Format(_T("image%d.jpg"), oInfo.m_lID); - strSaveItem = m_strDstMedia + FILE_SEPARATOR_STR + strSaveItem ; + strSaveItem.Format(_T("%s\\image%d.jpg"), m_strDstMedia, oInfo.m_lID); nOutputFormat = _CXIMAGE_FORMAT_JPG; } else { - strSaveItem.Format(_T("image%d.png"), oInfo.m_lID); - strSaveItem = m_strDstMedia + FILE_SEPARATOR_STR + strSaveItem ; - nOutputFormat = _CXIMAGE_FORMAT_PNG; + strSaveItem.Format(_T("%s\\image%d.png"), m_strDstMedia, oInfo.m_lID); + nOutputFormat = _CXIMAGE_FORMAT_PNG; } - OOX::CPath pathSaveItem = strSaveItem; LONG lMaxSize = (std::min)((std::max)(lWidth, lHeight), m_lMaxSizeImage); @@ -411,7 +400,7 @@ namespace NSShapeImageGen oBgraFrame.Resize(lW, lH); } - oBgraFrame.SaveFile(std::wstring(pathSaveItem.GetPath()), nOutputFormat); + oBgraFrame.SaveFile(std::wstring(strSaveItem.GetString()), nOutputFormat); } CImageInfo GenerateImageID(CBgraFrame& punkData, double dWidth, double dHeight) @@ -469,19 +458,21 @@ namespace NSShapeImageGen oInfo.m_eType = (1 == lImageType) ? itWMF : itEMF; CString strSaveItem = _T(""); - strSaveItem.Format(_T("image%d."), oInfo.m_lID); - strSaveItem = m_strDstMedia + FILE_SEPARATOR_STR + strSaveItem; + strSaveItem.Format(_T("\\image%d."), oInfo.m_lID); + strSaveItem = m_strDstMedia + strSaveItem; - double dKoef = 100 * 96 / 25.4; + double dKoef = 100 * 96 / 25.4; bool bIsSuccess = m_oExt.Convert(strFileName, LONG(dWidth * dKoef), LONG(dHeight * dKoef), strSaveItem + _T("svg")); if (bIsSuccess) { - if (itWMF == oInfo.m_eType) strSaveItem += _T("wmf"); - else strSaveItem += _T("emf"); - - OOX::CPath pathSaveItem = strSaveItem; - - CDirectory::CopyFile(strFileName, pathSaveItem.GetPath(), NULL, NULL); + if (itWMF == oInfo.m_eType) + { + CDirectory::CopyFile(strFileName, strSaveItem + _T("wmf"), NULL, NULL); + } + else + { + CDirectory::CopyFile(strFileName, strSaveItem + _T("emf"), NULL, NULL); + } m_mapImagesFile.insert(std::pair(strFileName, oInfo)); m_listImages.push_back(oInfo); @@ -551,21 +542,22 @@ namespace NSShapeImageGen oInfo.m_eType = (1 == lImageType) ? itWMF : itEMF; CString strSaveItem = _T(""); - strSaveItem.Format(_T("image%d."), oInfo.m_lID); - - strSaveItem = m_strDstMedia + FILE_SEPARATOR_STR + strSaveItem; + strSaveItem.Format(_T("\\image%d."), oInfo.m_lID); + strSaveItem = m_strDstMedia + strSaveItem; double dKoef = 100 * 96 / 25.4; bool bIsSuccess = m_oExt.Convert(strFileName, LONG(dWidth * dKoef), LONG(dHeight * dKoef), strSaveItem + _T("svg")); if (bIsSuccess) { - if (itWMF == oInfo.m_eType) strSaveItem += _T("wmf"); - else strSaveItem += _T("emf"); - - OOX::CPath pathSaveItem = strSaveItem; - CDirectory::CopyFile(strFileName, pathSaveItem.GetPath(), NULL, NULL); - - m_mapImagesFile.insert(std::pair(strFileName, oInfo)); + if (itWMF == oInfo.m_eType) + { + CDirectory::CopyFile(strFileName, strSaveItem + _T("wmf"), NULL, NULL); + } + else + { + CDirectory::CopyFile(strFileName, strSaveItem + _T("emf"), NULL, NULL); + } + m_mapImagesFile.insert(std::pair(strFileName, oInfo)); m_listImages.push_back(oInfo); return oInfo; } diff --git a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/File.h b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/File.h index 6fcd3fad25..ab63ec0e95 100644 --- a/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/File.h +++ b/ASCOfficePPTXFile/PPTXFormat/DocxFormat/Rels/File.h @@ -111,13 +111,12 @@ namespace PPTX private: const OOX::CPath createFileName(const OOX::CPath& filename) const { - CString strTemp = filename.GetDirectory() + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR; - - if (filename.GetFilename() == _T("")) strTemp += _T(".rels"); - else strTemp += (filename.GetFilename() + _T(".rels")); - - OOX::CPath pathTemp = strTemp; - return pathTemp.GetPath(); + CString strTemp = filename.GetDirectory() + _T("\\_rels\\"); + if (filename.GetFilename() == _T("")) + strTemp += _T(".rels"); + else + strTemp += (filename.GetFilename() + _T(".rels")); + return strTemp; } public: diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.h b/ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.h index 13d4f65214..1a49bbb712 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.h @@ -97,4 +97,4 @@ namespace PPTX } // namespace Logic } // namespace PPTX -#endif // PPTX_LOGIC_CXNSP_INCLUDE_H \ No newline at end of file +#endif // PPTX_LOGIC_CXNSP_INCLUDE_H diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h index 3339ee80bd..c4d3cfeb3b 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Fills/BlipFill.h @@ -263,15 +263,13 @@ namespace PPTX } case 3: { - //todoo ïðîâåðèòü ñ âðåìåííûì ôàéëîì íà ëèíóõå pReader->Skip(6); // len + start attributes + type // ------------------- CString strUrl = pReader->GetString2(); + CString strTempFile = _T(""); CString strOrigBase64 = _T(""); - CString strTempFile = _T(""); - if (0 == strUrl.Find(_T("data:"))) { strOrigBase64 = strUrl; @@ -286,16 +284,14 @@ namespace PPTX int dstLen = dstLenTemp; Base64::Base64Decode(__s.GetBuffer(), len, pDstBuffer, &dstLen); - OOX::CPath pathTempFile = pReader->m_strFolder + FILE_SEPARATOR_STR + _T("media") + FILE_SEPARATOR_STR + _T("temp.jpg"); - - strUrl = strTempFile = pathTempFile.GetPath(); - - CFile oTempFile; - oTempFile.CreateFile(strUrl); + strTempFile = pReader->m_strFolder + _T("\\media\\temp.jpg"); + CFile oTempFile; + oTempFile.CreateFile(strTempFile); oTempFile.WriteFile((void*)pDstBuffer, (DWORD)dstLen); oTempFile.CloseFile(); - RELEASEARRAYOBJECTS(pDstBuffer); + strUrl = strTempFile; + RELEASEARRAYOBJECTS(pDstBuffer); } else { @@ -306,19 +302,17 @@ namespace PPTX { if (0 == strUrl.Find(_T("theme"))) { - strUrl = pReader->m_strFolderThemes + FILE_SEPARATOR_STR + strUrl; + strUrl = pReader->m_strFolderThemes + _T("\\") + strUrl; } else { - strUrl = pReader->m_strFolder + FILE_SEPARATOR_STR + _T("media") + FILE_SEPARATOR_STR + strUrl; + strUrl = pReader->m_strFolder + _T("\\media\\") + strUrl; } } } // ------------------- - OOX::CPath pathUrl = strUrl; - strUrl = pathUrl.GetPath(); - - LONG lId = pReader->m_pRels->WriteImage(strUrl, strOrigBase64); + + LONG lId = pReader->m_pRels->WriteImage(strUrl, strOrigBase64); // ------------------- if (strTempFile != _T("")) diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/CubicBezTo.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/CubicBezTo.h index 91878abcd3..3304df1b06 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/CubicBezTo.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/CubicBezTo.h @@ -54,11 +54,11 @@ namespace PPTX virtual CString toXML() const { CString str1 = _T(""); - str1.Format(_T(""), x1, y1); + str1.Format(_T(""), x1, y1); CString str2 = _T(""); - str2.Format(_T(""), x2, y2); + str2.Format(_T(""), x2, y2); CString str3 = _T(""); - str3.Format(_T(""), x3, y3); + str3.Format(_T(""), x3, y3); return _T("") + str1 + str2 + str3 + _T(""); } @@ -122,11 +122,11 @@ namespace PPTX virtual CString GetODString()const { CString str1 = _T(""); - str1.Format(_T(""), x1, y1); + str1.Format(_T(""), x1, y1); CString str2 = _T(""); - str2.Format(_T(""), x2, y2); + str2.Format(_T(""), x2, y2); CString str3 = _T(""); - str3.Format(_T(""), x3, y3); + str3.Format(_T(""), x3, y3); return _T("") + str1 + str2 + str3 + _T(""); } diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/LineTo.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/LineTo.h index af4ce1222a..588c167e52 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/LineTo.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/LineTo.h @@ -38,7 +38,7 @@ namespace PPTX virtual CString toXML() const { CString str; - str.Format(_T(""), x, y); + str.Format(_T(""), x, y); return _T("") + str + _T(""); } @@ -79,7 +79,7 @@ namespace PPTX virtual CString GetODString()const { CString str; - str.Format(_T(""), x, y); + str.Format(_T(""), x, y); return _T("") + str + _T(""); } }; diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/MoveTo.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/MoveTo.h index c5f810e79c..d8b9f037e3 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/MoveTo.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/MoveTo.h @@ -38,7 +38,7 @@ namespace PPTX virtual CString toXML() const { CString str; - str.Format(_T(""), x, y); + str.Format(_T(""), x, y); return _T("") + str + _T(""); } virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const @@ -77,7 +77,7 @@ namespace PPTX virtual CString GetODString()const { CString str; - str.Format(_T(""), x, y); + str.Format(_T(""), x, y); return _T("") + str + _T(""); } }; diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/QuadBezTo.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/QuadBezTo.h index e0aacef8f2..4207d956cd 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/QuadBezTo.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Path2D/QuadBezTo.h @@ -47,9 +47,9 @@ namespace PPTX virtual CString toXML() const { CString str1 = _T(""); - str1.Format(_T(""), x1, y1); + str1.Format(_T(""), x1, y1); CString str2 = _T(""); - str2.Format(_T(""), x2, y2); + str2.Format(_T(""), x2, y2); return _T("") + str1 + str2 + _T(""); } @@ -101,9 +101,9 @@ namespace PPTX virtual CString GetODString()const { CString str1 = _T(""); - str1.Format(_T(""), x1, y1); + str1.Format(_T(""), x1, y1); CString str2 = _T(""); - str2.Format(_T(""), x2, y2); + str2.Format(_T(""), x2, y2); return _T("") + str1 + str2 + _T(""); } diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/UniFill.h b/ASCOfficePPTXFile/PPTXFormat/Logic/UniFill.h index 706603b49c..c919503d92 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/UniFill.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/UniFill.h @@ -271,10 +271,9 @@ namespace PPTX int dstLen = dstLenTemp; Base64::Base64Decode(__s.GetBuffer(), len, pDstBuffer, &dstLen); - OOX::CPath pathTemp = pReader->m_strFolder + FILE_SEPARATOR_STR + _T("media") + FILE_SEPARATOR_STR + _T("temp.jpg"); - - CFile oTempFile; - oTempFile.CreateFile(pathTemp.GetPath()); + strTempFile = pReader->m_strFolder + _T("\\media\\temp.jpg"); + CFile oTempFile; + oTempFile.CreateFile(strTempFile); oTempFile.WriteFile((void*)pDstBuffer, (DWORD)dstLen); oTempFile.CloseFile(); @@ -290,11 +289,11 @@ namespace PPTX { if (0 == strUrl.Find(_T("theme"))) { - strUrl = pReader->m_strFolderThemes + FILE_SEPARATOR_STR + strUrl; + strUrl = pReader->m_strFolderThemes + _T("\\") + strUrl; } else { - strUrl = pReader->m_strFolder + FILE_SEPARATOR_STR + _T("media") + FILE_SEPARATOR_STR + strUrl; + strUrl = pReader->m_strFolder + _T("\\media\\") + strUrl; } } } diff --git a/ASCPresentationEditor/OfficeDrawing/Layout.cpp b/ASCPresentationEditor/OfficeDrawing/Layout.cpp index 23a5804e3c..ee02257f0c 100644 --- a/ASCPresentationEditor/OfficeDrawing/Layout.cpp +++ b/ASCPresentationEditor/OfficeDrawing/Layout.cpp @@ -8,7 +8,7 @@ namespace NSPresentationEditor NSPresentationEditor::CStringWriter oWriter; CString strStart = _T(""); - strStart.Format(_T(""), m_bShowMasterShapes ? 1 : 0, m_strLayoutType); + strStart.Format(_T(""), m_bShowMasterShapes ? 1 : 0, m_strLayoutType); oWriter.WriteString(strStart); @@ -123,7 +123,7 @@ namespace NSPresentationEditor if ((0 <= lFontRef) && (lFontRef < (LONG)pTheme->m_arFonts.size())) { CString strRef = _T(""); - strRef.Format(_T("l_font%d { font-index:%d;font-family:%ls; }\n"), + strRef.Format(_T("l_font%d { font-index:%d;font-family:%s; }\n"), pTextElement->m_lPlaceholderType, lFontRef, pTheme->m_arFonts[lFontRef].Name); strFontRefs += strRef; } diff --git a/Common/DocxFormat/Source/Base/ASCString.h b/Common/DocxFormat/Source/Base/ASCString.h index 6ab2de8e04..f2d8555856 100644 --- a/Common/DocxFormat/Source/Base/ASCString.h +++ b/Common/DocxFormat/Source/Base/ASCString.h @@ -253,20 +253,20 @@ static std::wstring stringUtf8ToWString (const std::string& aSrc) // // CString sName("Joe"); // CString sTmp; -// sTmp.Format("My name is %ls", sName); // WORKS! +// sTmp.Format("My name is %s", sName); // WORKS! // // However if you were to try this with CStdString, your program would // crash. // // CStdString sName("Joe"); // CStdString sTmp; -// sTmp.Format("My name is %ls", sName); // CRASHES! +// sTmp.Format("My name is %s", sName); // CRASHES! // // You must explicitly call c_str() or cast the object to the proper type // -// sTmp.Format("My name is %ls", sName.c_str()); // WORKS! -// sTmp.Format("My name is %ls", static_cast(sName));// WORKS! -// sTmp.Format("My name is %ls", (PCSTR)sName); // WORKS! +// sTmp.Format("My name is %s", sName.c_str()); // WORKS! +// sTmp.Format("My name is %s", static_cast(sName));// WORKS! +// sTmp.Format("My name is %s", (PCSTR)sName); // WORKS! // // This is because it is illegal to pass anything but a POD type as a // variadic argument to a variadic function (i.e. as one of the "..." @@ -2519,7 +2519,7 @@ public: // Answer: One reason only - CString compatability. In short, by making // the Format() function a template this way, I can do strong typing // and allow people to pass CStdString arguments as fillers for - // "%ls" format specifiers without crashing their program! The downside + // "%s" format specifiers without crashing their program! The downside // is that I need to overload on the number of arguments. If you are // passing more arguments than I have listed below in any of my // overloads, just add another one. @@ -4218,7 +4218,7 @@ inline CStdStringW WUFormatW(PCWSTR szwFormat, ...) if ( 0 != ::FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError, dwLangId, szBuf, 511, NULL) ) - return WUFormatW(L"%ls (0x%X)", szBuf, dwError); + return WUFormatW(L"%s (0x%X)", szBuf, dwError); else return WUFormatW(L"Unknown error (0x%X)", dwError); } diff --git a/Common/DocxFormat/Source/DocxFormat/CustomXml.h b/Common/DocxFormat/Source/DocxFormat/CustomXml.h index 154190225b..e44cebfb7a 100644 --- a/Common/DocxFormat/Source/DocxFormat/CustomXml.h +++ b/Common/DocxFormat/Source/DocxFormat/CustomXml.h @@ -46,7 +46,7 @@ namespace OOX virtual CString toXML() const { CString sResult; - sResult.Format( _T(""), m_sUri ); + sResult.Format( _T(""), m_sUri ); return sResult; } virtual EElementType getType() const @@ -150,7 +150,7 @@ namespace OOX virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const { CString sXml; - sXml.Format( _T(""), m_oItemID.ToString() ); + sXml.Format( _T(""), m_oItemID.ToString() ); if ( m_oShemaRefs.IsInit() ) sXml += m_oShemaRefs->toXML(); diff --git a/Common/DocxFormat/Source/DocxFormat/Document.h b/Common/DocxFormat/Source/DocxFormat/Document.h index d4b8f64b4f..7cc7050a48 100644 --- a/Common/DocxFormat/Source/DocxFormat/Document.h +++ b/Common/DocxFormat/Source/DocxFormat/Document.h @@ -400,7 +400,7 @@ namespace OOX if ( SimpleTypes::conformanceclassTransitional != m_oConformance.GetValue() ) { - sXml.Format( _T(""), m_oConformance.ToString() ); + sXml.Format( _T(""), m_oConformance.ToString() ); } else { diff --git a/Common/DocxFormat/Source/DocxFormat/Docx.h b/Common/DocxFormat/Source/DocxFormat/Docx.h index c5bb3c646c..4a354784b7 100644 --- a/Common/DocxFormat/Source/DocxFormat/Docx.h +++ b/Common/DocxFormat/Source/DocxFormat/Docx.h @@ -78,7 +78,7 @@ namespace OOX // TO DO: Çàïèñü íàäî ïðàâèòü. Îíà ÍÅ ÐÀÁÎÒÀÅÒ!!!! Ïðîáëåìû â IFileContainer. - //return FALSE; + return FALSE; // Ñîçäàåì ïàïêó #ifdef _WIN32 diff --git a/Common/DocxFormat/Source/DocxFormat/Drawing/Drawing.h b/Common/DocxFormat/Source/DocxFormat/Drawing/Drawing.h index f10f518f12..1d1c8e1d78 100644 --- a/Common/DocxFormat/Source/DocxFormat/Drawing/Drawing.h +++ b/Common/DocxFormat/Source/DocxFormat/Drawing/Drawing.h @@ -1346,7 +1346,7 @@ namespace OOX m_sXml.Init(); m_sXml->Append(oReader.GetOuterXml()); CString sXml; - sXml.Format(_T("%ls"), m_sXml.get()); + sXml.Format(_T("%s"), m_sXml.get()); pReader = new XmlUtils::CXmlLiteReader(); pReader->FromString(sXml); pReader->ReadNextNode();//root diff --git a/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingParagraph.h b/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingParagraph.h index 24f4f1c132..a957f41a75 100644 --- a/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingParagraph.h +++ b/Common/DocxFormat/Source/DocxFormat/Drawing/DrawingParagraph.h @@ -44,7 +44,7 @@ namespace OOX CString sResult; if ( m_oSpace.IsInit() ) - sResult.Format( _T(""), m_oSpace->ToString() ); + sResult.Format( _T(""), m_oSpace->ToString() ); else sResult = _T(""); diff --git a/Common/DocxFormat/Source/DocxFormat/Logic/AlternateContent.cpp b/Common/DocxFormat/Source/DocxFormat/Logic/AlternateContent.cpp index 13ca690d8b..ff66a60614 100644 --- a/Common/DocxFormat/Source/DocxFormat/Logic/AlternateContent.cpp +++ b/Common/DocxFormat/Source/DocxFormat/Logic/AlternateContent.cpp @@ -13,7 +13,7 @@ namespace OOX m_sXml.Init(); m_sXml->Append(oReader.GetOuterXml()); CString sXml; - sXml.Format(_T("%ls"), m_sXml.get()); + sXml.Format(_T("%s"), m_sXml.get()); XmlUtils::CXmlLiteReader oSubReader; oSubReader.FromString(sXml); oSubReader.ReadNextNode();//root diff --git a/Common/DocxFormat/Source/DocxFormat/Logic/Dir.cpp b/Common/DocxFormat/Source/DocxFormat/Logic/Dir.cpp index 771f5d1a9a..fd94faaa58 100644 --- a/Common/DocxFormat/Source/DocxFormat/Logic/Dir.cpp +++ b/Common/DocxFormat/Source/DocxFormat/Logic/Dir.cpp @@ -122,9 +122,9 @@ namespace OOX if(m_oVal.IsInit()) { #ifdef _WIN32 - sResult.AppendFormat(_T(" val=\"%ls\""), m_oVal->ToString()); + sResult.AppendFormat(_T(" val=\"%s\""), m_oVal->ToString()); #else - sResult.AppendFormat(_T(" val=\"%ls\""), m_oVal->ToString().c_str()); + sResult.AppendFormat(_T(" val=\"%s\""), m_oVal->ToString().c_str()); #endif } sResult += _T(">"); diff --git a/Common/DocxFormat/Source/DocxFormat/Logic/Pict.h b/Common/DocxFormat/Source/DocxFormat/Logic/Pict.h index 7d4a4b6435..2389c6ea45 100644 --- a/Common/DocxFormat/Source/DocxFormat/Logic/Pict.h +++ b/Common/DocxFormat/Source/DocxFormat/Logic/Pict.h @@ -125,7 +125,7 @@ namespace OOX //àëüòåðíàòèâà pptx CString sXml; - sXml.Format(_T("%ls"), m_sXml.get()); + sXml.Format(_T("%s"), m_sXml.get()); XmlUtils::CXmlLiteReader oSubReader; oSubReader.FromString(sXml); @@ -420,7 +420,7 @@ namespace OOX //àëüòåðíàòèâà pptx CString sXml; //??? + ole íàâåðíî ÷òî òî (ëåíü ...) - sXml.Format(_T("%ls"), m_sXml.get()); + sXml.Format(_T("%s"), m_sXml.get()); XmlUtils::CXmlLiteReader oSubReader; oSubReader.FromString(sXml); diff --git a/Common/DocxFormat/Source/DocxFormat/Logic/RunContent.h b/Common/DocxFormat/Source/DocxFormat/Logic/RunContent.h index ff4a708d46..1cf9e3cf9c 100644 --- a/Common/DocxFormat/Source/DocxFormat/Logic/RunContent.h +++ b/Common/DocxFormat/Source/DocxFormat/Logic/RunContent.h @@ -302,7 +302,7 @@ namespace OOX CString sResult; if ( m_oSpace.IsInit() ) - sResult.Format( _T(""), m_oSpace->ToString() ); + sResult.Format( _T(""), m_oSpace->ToString() ); else sResult = _T(""); @@ -767,7 +767,7 @@ namespace OOX CString sResult; if ( m_oSpace.IsInit() ) - sResult.Format( _T(""), m_oSpace->ToString() ); + sResult.Format( _T(""), m_oSpace->ToString() ); else sResult = _T(""); @@ -1090,7 +1090,7 @@ namespace OOX CString sResult; if ( m_oSpace.IsInit() ) - sResult.Format( _T(""), m_oSpace->ToString() ); + sResult.Format( _T(""), m_oSpace->ToString() ); else sResult = _T(""); @@ -1392,7 +1392,7 @@ namespace OOX CString sResult; if ( m_oSpace.IsInit() ) - sResult.Format( _T(""), m_oSpace->ToString() ); + sResult.Format( _T(""), m_oSpace->ToString() ); else sResult = _T(""); diff --git a/Common/DocxFormat/Source/DocxFormat/Logic/Sdt.h b/Common/DocxFormat/Source/DocxFormat/Logic/Sdt.h index f22b14c3ff..8001b6469f 100644 --- a/Common/DocxFormat/Source/DocxFormat/Logic/Sdt.h +++ b/Common/DocxFormat/Source/DocxFormat/Logic/Sdt.h @@ -175,7 +175,7 @@ namespace ComplexTypes { CString sResult; - sResult.Format( _T("w:val=\"%ls\""), m_oVal.ToString() ); + sResult.Format( _T("w:val=\"%s\""), m_oVal.ToString() ); return sResult; } @@ -223,7 +223,7 @@ namespace ComplexTypes { CString sResult; - sResult.Format( _T("w:val=\"%ls\""), m_oVal.ToString() ); + sResult.Format( _T("w:val=\"%s\""), m_oVal.ToString() ); return sResult; } @@ -271,7 +271,7 @@ namespace ComplexTypes { CString sResult; - sResult.Format( _T("w:val=\"%ls\""), m_oVal.ToString() ); + sResult.Format( _T("w:val=\"%s\""), m_oVal.ToString() ); return sResult; } @@ -319,7 +319,7 @@ namespace ComplexTypes { CString sResult; - sResult.Format( _T("w:multiLine=\"%ls\""), m_oMultiLine.ToString() ); + sResult.Format( _T("w:multiLine=\"%s\""), m_oMultiLine.ToString() ); return sResult; } diff --git a/Common/DocxFormat/Source/DocxFormat/Logic/Vml.cpp b/Common/DocxFormat/Source/DocxFormat/Logic/Vml.cpp index 173c7c04ed..68779cd04a 100644 --- a/Common/DocxFormat/Source/DocxFormat/Logic/Vml.cpp +++ b/Common/DocxFormat/Source/DocxFormat/Logic/Vml.cpp @@ -987,7 +987,7 @@ namespace OOX sResult += _T(""); if(m_oAnchor.IsInit()) { - CString sAnchor;sAnchor.Format(_T("%ls"), m_oAnchor.get()); + CString sAnchor;sAnchor.Format(_T("%s"), m_oAnchor.get()); sResult += sAnchor; } if(m_oRow.IsInit()) diff --git a/Common/DocxFormat/Source/DocxFormat/Math/oMathContent.h b/Common/DocxFormat/Source/DocxFormat/Math/oMathContent.h index 66ee5645bf..e0c94670ce 100644 --- a/Common/DocxFormat/Source/DocxFormat/Math/oMathContent.h +++ b/Common/DocxFormat/Source/DocxFormat/Math/oMathContent.h @@ -2970,7 +2970,7 @@ namespace OOX CString sResult; if ( m_oSpace.IsInit() ) - sResult.Format( _T(""), m_oSpace->ToString() ); + sResult.Format( _T(""), m_oSpace->ToString() ); else sResult = _T(""); diff --git a/Common/DocxFormat/Source/DocxFormat/Rels.h b/Common/DocxFormat/Source/DocxFormat/Rels.h index dff9c1b36d..de4d2d268c 100644 --- a/Common/DocxFormat/Source/DocxFormat/Rels.h +++ b/Common/DocxFormat/Source/DocxFormat/Rels.h @@ -286,13 +286,18 @@ namespace OOX const CPath CreateFileName(const CPath& oFilePath) const { - CString strTemp = oFilePath.GetDirectory() + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR; + CString strTemp; +#ifdef _WIN32 + strTemp = oFilePath.GetDirectory() + _T("\\_rels\\"); +#else + strTemp = oFilePath.GetDirectory() + _T("/_rels/"); +#endif + if ( _T("") == oFilePath.GetFilename() ) + strTemp += _T(".rels"); + else + strTemp += ( oFilePath.GetFilename() + _T(".rels") ); - if ( _T("") == oFilePath.GetFilename() ) strTemp += _T(".rels"); - else strTemp += ( oFilePath.GetFilename() + _T(".rels") ); - - CPath pathTemp = strTemp; - return pathTemp.GetPath(); + return strTemp; } diff --git a/Common/DocxFormat/Source/DocxFormat/Styles.h b/Common/DocxFormat/Source/DocxFormat/Styles.h index 2a16e06002..1c7fe2177c 100644 --- a/Common/DocxFormat/Source/DocxFormat/Styles.h +++ b/Common/DocxFormat/Source/DocxFormat/Styles.h @@ -441,7 +441,7 @@ namespace OOX virtual CString toXML() const { CString sResult; - sResult.Format( _T(""), m_oCount.GetValue(), m_oDefLockedState.ToString(), m_oDefQFormat.ToString(), m_oDefSemiHidden.ToString(), m_oDefUiPriority.GetValue(), m_oDefUnhideWhenUsed.ToString() ); + sResult.Format( _T(""), m_oCount.GetValue(), m_oDefLockedState.ToString(), m_oDefQFormat.ToString(), m_oDefSemiHidden.ToString(), m_oDefUiPriority.GetValue(), m_oDefUnhideWhenUsed.ToString() ); for (unsigned int nIndex = 0; nIndex < m_arrLsdException.size(); nIndex++ ) { diff --git a/Common/DocxFormat/Source/SystemUtility/File.h b/Common/DocxFormat/Source/SystemUtility/File.h index 71696f3513..e390296c7d 100644 --- a/Common/DocxFormat/Source/SystemUtility/File.h +++ b/Common/DocxFormat/Source/SystemUtility/File.h @@ -291,17 +291,17 @@ namespace CDirectory } static BOOL OpenFile(CString strFolderPath, CString strFileName, CFile* pFile) { - CString strFile = strFolderPath + FILE_SEPARATOR_CHAR + strFileName; + CString strFile = strFolderPath + '\\' + strFileName; return (S_OK == pFile->OpenFile(strFile)); } static BOOL CreateFile(CString strFolderPath, CString strFileName, CFile* pFile) { - CString strFile = strFolderPath + FILE_SEPARATOR_CHAR + strFileName; + CString strFile = strFolderPath + '\\' + strFileName; return (S_OK == pFile->CreateFile(strFile)); } static BOOL CreateDirectory(CString strFolderPathRoot, CString strFolderName) { - CString strFolder = strFolderPathRoot + FILE_SEPARATOR_CHAR + strFolderName; + CString strFolder = strFolderPathRoot + '\\' + strFolderName; return ::CreateDirectory(strFolder, NULL); } static BOOL CreateDirectory(CString strFolderPath) diff --git a/Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.cpp b/Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.cpp index 00af9659ce..25b843f844 100644 --- a/Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.cpp +++ b/Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.cpp @@ -2,11 +2,6 @@ #include -#ifndef FILE_SEPARATOR - #define FILE_SEPARATOR - #define FILE_SEPARATOR_CHAR '\\' - #define FILE_SEPARATOR_STR _T("\\") -#endif namespace FileSystem { @@ -41,23 +36,17 @@ namespace FileSystem } bool Directory::CreateDirectory(const String& path) { - DWORD dwAttrib = ::GetFileAttributesW(path.c_str()); - if (dwAttrib != INVALID_FILE_ATTRIBUTES && 0 != (dwAttrib & FILE_ATTRIBUTE_DIRECTORY)) return true; - - return CreateDirectory(path.c_str()); + return CreateDirectory(path.c_str()); } bool Directory::CreateDirectory(String strFolderPathRoot, String strFolderName) { String strFolder = strFolderPathRoot; - strFolder += FILE_SEPARATOR_STR; + strFolder += _T("/"); strFolder += strFolderName; return CreateDirectory(strFolder); } bool Directory::CreateDirectories(LPCTSTR path) { - DWORD dwAttrib = ::GetFileAttributesW(path); - if (dwAttrib != INVALID_FILE_ATTRIBUTES && 0 != (dwAttrib & FILE_ATTRIBUTE_DIRECTORY)) return true; - int codeResult = ERROR_SUCCESS; codeResult = SHCreateDirectory(NULL, path); diff --git a/Common/DocxFormat/Source/SystemUtility/FileSystem/DirectoryPosix.cpp b/Common/DocxFormat/Source/SystemUtility/FileSystem/DirectoryPosix.cpp index 6b56c5a147..49222028db 100644 --- a/Common/DocxFormat/Source/SystemUtility/FileSystem/DirectoryPosix.cpp +++ b/Common/DocxFormat/Source/SystemUtility/FileSystem/DirectoryPosix.cpp @@ -85,7 +85,7 @@ namespace FileSystem { bool Directory::CreateDirectory (String strFolderPathRoot, String strFolderName) { String strFolder = strFolderPathRoot; - strFolder += FILE_SEPARATOR_STR ; + strFolder += _T("/"); strFolder += strFolderName; return CreateDirectory(strFolder); } diff --git a/Common/DocxFormat/Source/SystemUtility/SystemUtility.cpp b/Common/DocxFormat/Source/SystemUtility/SystemUtility.cpp index aed452f5c7..b834474413 100644 --- a/Common/DocxFormat/Source/SystemUtility/SystemUtility.cpp +++ b/Common/DocxFormat/Source/SystemUtility/SystemUtility.cpp @@ -167,7 +167,7 @@ namespace OOX bool CSystemUtility::CreateDirectories(const CPath& oPath) { - return FileSystem::Directory::CreateDirectory(oPath.GetPath()); + return FileSystem::Directory::CreateDirectories(oPath.m_strFilename); } void CSystemUtility::ReplaceExtention(CString& strName, CString& str1, CString& str2) diff --git a/Common/DocxFormat/Source/SystemUtility/SystemUtility.h b/Common/DocxFormat/Source/SystemUtility/SystemUtility.h index 40072fac06..e24284a38e 100644 --- a/Common/DocxFormat/Source/SystemUtility/SystemUtility.h +++ b/Common/DocxFormat/Source/SystemUtility/SystemUtility.h @@ -26,14 +26,14 @@ namespace OOX friend CPath operator/(const CPath& path1, const CPath& path2) { - CPath path(path1.m_strFilename + FILE_SEPARATOR_STR + path2.m_strFilename); + CPath path(path1.m_strFilename + _T("//") + path2.m_strFilename); path.Normalize(); return path; } friend CPath operator/(const CPath& path1, const CString& path2) { - CPath path(path1.m_strFilename + FILE_SEPARATOR_STR + path2); + CPath path(path1.m_strFilename + _T("//") + path2); path.Normalize(); return path; diff --git a/Common/DocxFormat/Source/XML/xmlutils.h b/Common/DocxFormat/Source/XML/xmlutils.h index 046b997898..2741c74412 100644 --- a/Common/DocxFormat/Source/XML/xmlutils.h +++ b/Common/DocxFormat/Source/XML/xmlutils.h @@ -2572,7 +2572,7 @@ namespace XmlUtils try { //CString strXPath; - //strXPath.Format( _T("*[local-name(.) = '%ls']"), strSubNodeName); + //strXPath.Format( _T("*[local-name(.) = '%s']"), strSubNodeName); _bstr_t bstrNode; bstrNode = strSubNodeName; //_bstr_t bstrNode; bstrNode = strXPath; diff --git a/Common/DocxFormat/Source/XlsxFormat/Chart/ChartSerialize.cpp b/Common/DocxFormat/Source/XlsxFormat/Chart/ChartSerialize.cpp index 2f9e1f6650..f16b786e68 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Chart/ChartSerialize.cpp +++ b/Common/DocxFormat/Source/XlsxFormat/Chart/ChartSerialize.cpp @@ -1272,7 +1272,7 @@ namespace OOX{ sVal = _T("1"); else sVal = _T("0"); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -1318,7 +1318,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_id); - sXml.Format(_T(" r:id=\"%ls\""), sVal); + sXml.Format(_T(" r:id=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T(" xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:c14=\"http://schemas.microsoft.com/office/drawing/2007/8/2/chart\""))); @@ -1444,7 +1444,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_paperSize); - sXml.Format(_T(" paperSize=\"%ls\""), sVal); + sXml.Format(_T(" paperSize=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_paperHeight) @@ -1452,7 +1452,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_paperHeight); - sXml.Format(_T(" paperHeight=\"%ls\""), sVal); + sXml.Format(_T(" paperHeight=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_paperWidth) @@ -1460,7 +1460,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_paperWidth); - sXml.Format(_T(" paperWidth=\"%ls\""), sVal); + sXml.Format(_T(" paperWidth=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_firstPageNumber) @@ -1468,7 +1468,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_firstPageNumber); - sXml.Format(_T(" firstPageNumber=\"%ls\""), sVal); + sXml.Format(_T(" firstPageNumber=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_orientation) @@ -1477,7 +1477,7 @@ namespace OOX{ if(ToXml_ST_PageSetupOrientation(*m_orientation, sEnumVal)) { CString sVal; - sVal.Format(_T(" orientation=\"%ls\""), sEnumVal); + sVal.Format(_T(" orientation=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -1489,7 +1489,7 @@ namespace OOX{ sVal = _T("1"); else sVal = _T("0"); - sXml.Format(_T(" blackAndWhite=\"%ls\""), sVal); + sXml.Format(_T(" blackAndWhite=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_draft) @@ -1500,7 +1500,7 @@ namespace OOX{ sVal = _T("1"); else sVal = _T("0"); - sXml.Format(_T(" draft=\"%ls\""), sVal); + sXml.Format(_T(" draft=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_useFirstPageNumber) @@ -1511,7 +1511,7 @@ namespace OOX{ sVal = _T("1"); else sVal = _T("0"); - sXml.Format(_T(" useFirstPageNumber=\"%ls\""), sVal); + sXml.Format(_T(" useFirstPageNumber=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_horizontalDpi) @@ -1519,7 +1519,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_horizontalDpi); - sXml.Format(_T(" horizontalDpi=\"%ls\""), sVal); + sXml.Format(_T(" horizontalDpi=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_verticalDpi) @@ -1527,7 +1527,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_verticalDpi); - sXml.Format(_T(" verticalDpi=\"%ls\""), sVal); + sXml.Format(_T(" verticalDpi=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_copies) @@ -1535,7 +1535,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_copies); - sXml.Format(_T(" copies=\"%ls\""), sVal); + sXml.Format(_T(" copies=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -1678,7 +1678,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = SpreadsheetCommon::WriteDouble(*m_l); - sXml.Format(_T(" l=\"%ls\""), sVal); + sXml.Format(_T(" l=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_r) @@ -1686,7 +1686,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = SpreadsheetCommon::WriteDouble(*m_r); - sXml.Format(_T(" r=\"%ls\""), sVal); + sXml.Format(_T(" r=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_t) @@ -1694,7 +1694,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = SpreadsheetCommon::WriteDouble(*m_t); - sXml.Format(_T(" t=\"%ls\""), sVal); + sXml.Format(_T(" t=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_b) @@ -1702,7 +1702,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = SpreadsheetCommon::WriteDouble(*m_b); - sXml.Format(_T(" b=\"%ls\""), sVal); + sXml.Format(_T(" b=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_header) @@ -1710,7 +1710,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = SpreadsheetCommon::WriteDouble(*m_header); - sXml.Format(_T(" header=\"%ls\""), sVal); + sXml.Format(_T(" header=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_footer) @@ -1718,7 +1718,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = SpreadsheetCommon::WriteDouble(*m_footer); - sXml.Format(_T(" footer=\"%ls\""), sVal); + sXml.Format(_T(" footer=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -1894,7 +1894,7 @@ namespace OOX{ sVal = _T("1"); else sVal = _T("0"); - sXml.Format(_T(" alignWithMargins=\"%ls\""), sVal); + sXml.Format(_T(" alignWithMargins=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_differentOddEven) @@ -1905,7 +1905,7 @@ namespace OOX{ sVal = _T("1"); else sVal = _T("0"); - sXml.Format(_T(" differentOddEven=\"%ls\""), sVal); + sXml.Format(_T(" differentOddEven=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_differentFirst) @@ -1916,7 +1916,7 @@ namespace OOX{ sVal = _T("1"); else sVal = _T("0"); - sXml.Format(_T(" differentFirst=\"%ls\""), sVal); + sXml.Format(_T(" differentFirst=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T(">"))); @@ -1926,9 +1926,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_oddHeader); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } if(NULL != m_oddFooter) @@ -1937,9 +1937,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_oddFooter); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } if(NULL != m_evenHeader) @@ -1948,9 +1948,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_evenHeader); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } if(NULL != m_evenFooter) @@ -1959,9 +1959,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_evenFooter); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } if(NULL != m_firstHeader) @@ -1970,9 +1970,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_firstHeader); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } if(NULL != m_firstFooter) @@ -1981,9 +1981,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_firstFooter); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T(""))); @@ -2187,7 +2187,7 @@ namespace OOX{ if(ToXml_ST_DispBlanksAs(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -2311,7 +2311,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -2366,7 +2366,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_uri); - sXml.Format(_T(" uri=\"%ls\""), sVal); + sXml.Format(_T(" uri=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T(">"))); @@ -2376,9 +2376,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_Any); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T(""))); @@ -3456,7 +3456,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = SpreadsheetCommon::WriteDouble(*m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -3499,7 +3499,7 @@ namespace OOX{ if(ToXml_ST_Orientation(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -3544,7 +3544,7 @@ namespace OOX{ if(ToXml_ST_AxPos(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -3842,9 +3842,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_f); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } if(NULL != m_strCache) @@ -3970,7 +3970,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_idx); - sXml.Format(_T(" idx=\"%ls\""), sVal); + sXml.Format(_T(" idx=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T(">"))); @@ -3980,9 +3980,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_v); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T(""))); @@ -4093,7 +4093,7 @@ namespace OOX{ if(ToXml_ST_TickMark(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -4140,7 +4140,7 @@ namespace OOX{ if(ToXml_ST_TickLblPos(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -4185,7 +4185,7 @@ namespace OOX{ if(ToXml_ST_Crosses(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -4228,7 +4228,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -4271,7 +4271,7 @@ namespace OOX{ if(ToXml_ST_TimeUnit(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -4681,7 +4681,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -4721,7 +4721,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = SpreadsheetCommon::WriteDouble(*m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -4762,7 +4762,7 @@ namespace OOX{ if(ToXml_ST_LblAlgn(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -5239,7 +5239,7 @@ namespace OOX{ if(ToXml_ST_BuiltInUnit(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -5363,7 +5363,7 @@ namespace OOX{ if(ToXml_ST_CrossBetween(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -5729,7 +5729,7 @@ namespace OOX{ if(ToXml_ST_SizeRepresents(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -5778,7 +5778,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -6077,9 +6077,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_v); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T(""))); @@ -6513,7 +6513,7 @@ namespace OOX{ if(ToXml_ST_PictureFormat(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -6556,7 +6556,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = SpreadsheetCommon::WriteDouble(*m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -6833,12 +6833,12 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*pTypeVal); if(true == bIsAttribute) - sXml.Format(_T(" c:separator=\"%ls\""), sVal); + sXml.Format(_T(" c:separator=\"%s\""), sVal); else if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } } @@ -7299,12 +7299,12 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*pTypeVal); if(true == bIsAttribute) - sXml.Format(_T(" c:separator=\"%ls\""), sVal); + sXml.Format(_T(" c:separator=\"%s\""), sVal); else if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } } @@ -7533,7 +7533,7 @@ namespace OOX{ if(ToXml_ST_DLblPos(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -7689,9 +7689,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_name); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } if(NULL != m_spPr) @@ -7779,7 +7779,7 @@ namespace OOX{ if(ToXml_ST_TrendlineType(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -7828,7 +7828,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -7873,7 +7873,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -8175,7 +8175,7 @@ namespace OOX{ if(ToXml_ST_ErrDir(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -8221,7 +8221,7 @@ namespace OOX{ if(ToXml_ST_ErrBarType(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -8267,7 +8267,7 @@ namespace OOX{ if(ToXml_ST_ErrValType(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -8401,9 +8401,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_formatCode); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } if(NULL != m_ptCount) @@ -8471,7 +8471,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_idx); - sXml.Format(_T(" idx=\"%ls\""), sVal); + sXml.Format(_T(" idx=\"%s\""), sVal); writer.WriteString(sXml); } if(NULL != m_formatCode) @@ -8479,7 +8479,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_formatCode); - sXml.Format(_T(" formatCode=\"%ls\""), sVal); + sXml.Format(_T(" formatCode=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T(">"))); @@ -8489,9 +8489,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_v); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } if(NULL != m_numCache) @@ -8737,9 +8737,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_f); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } if(NULL != m_multiLvlStrCache) @@ -9477,7 +9477,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -9520,7 +9520,7 @@ namespace OOX{ if(ToXml_ST_SplitType(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -9566,7 +9566,7 @@ namespace OOX{ if(ToXml_ST_OfPieType(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -10011,7 +10011,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -10226,7 +10226,7 @@ namespace OOX{ if(ToXml_ST_BarDir(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -10272,7 +10272,7 @@ namespace OOX{ if(ToXml_ST_BarGrouping(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -10547,7 +10547,7 @@ namespace OOX{ if(ToXml_ST_Shape(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -10595,7 +10595,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -10816,7 +10816,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -10973,7 +10973,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -11417,7 +11417,7 @@ namespace OOX{ if(ToXml_ST_ScatterStyle(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -11748,7 +11748,7 @@ namespace OOX{ if(ToXml_ST_RadarStyle(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -12518,7 +12518,7 @@ namespace OOX{ if(ToXml_ST_Grouping(*m_val, sEnumVal)) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), sEnumVal); + sVal.Format(_T(" val=\"%s\""), sEnumVal); writer.WriteString(sVal); } } @@ -13910,7 +13910,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -14036,7 +14036,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -14081,7 +14081,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -14126,7 +14126,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -14171,7 +14171,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -14216,7 +14216,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -14860,9 +14860,9 @@ namespace OOX{ CString sVal; sVal = XmlUtils::EncodeXmlString(*m_name); if(-1 != sVal.Find(' ') || -1 != sVal.Find('\n')) - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); else - sXml.Format(_T("%ls"), sVal); + sXml.Format(_T("%s"), sVal); writer.WriteString(sXml); } if(NULL != m_fmtId) @@ -14907,7 +14907,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -14947,7 +14947,7 @@ namespace OOX{ CString sXml; CString sVal; sVal.Format(_T("%d"), *m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -14987,7 +14987,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_val); - sXml.Format(_T(" val=\"%ls\""), sVal); + sXml.Format(_T(" val=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -15097,7 +15097,7 @@ namespace OOX{ CString sXml; CString sVal; sVal = XmlUtils::EncodeXmlString(*m_Requires); - sXml.Format(_T(" Requires=\"%ls\""), sVal); + sXml.Format(_T(" Requires=\"%s\""), sVal); writer.WriteString(sXml); } writer.WriteString(CString(_T(">"))); diff --git a/Common/DocxFormat/Source/XlsxFormat/Comments/Comments.h b/Common/DocxFormat/Source/XlsxFormat/Comments/Comments.h index 18d9ed0734..ab15bf748c 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Comments/Comments.h +++ b/Common/DocxFormat/Source/XlsxFormat/Comments/Comments.h @@ -63,7 +63,7 @@ namespace OOX writer.WriteString(CString("")); for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i) { - CString sAuthor;sAuthor.Format(_T("%ls"), XmlUtils::EncodeXmlString(*m_arrItems[i])); + CString sAuthor;sAuthor.Format(_T("%s"), XmlUtils::EncodeXmlString(*m_arrItems[i])); writer.WriteString(sAuthor); } writer.WriteString(CString("")); @@ -118,7 +118,7 @@ namespace OOX writer.WriteString(CString("GetValue())); + CString sRef;sRef.Format(_T(" ref=\"%s\""), XmlUtils::EncodeXmlString(m_oRef->GetValue())); writer.WriteString(sRef); } if(m_oAuthorId.IsInit()) @@ -338,7 +338,7 @@ namespace OOX { if(m_oId.IsInit()) { - CString sVal;sVal.Format(_T(""), m_oId->GetValue()); + CString sVal;sVal.Format(_T(""), m_oId->GetValue()); writer.WriteString(sVal); } @@ -482,8 +482,8 @@ namespace OOX sClientData.Append(_T("")); CString sGfxdata; if(comment->m_sGfxdata.IsInit()) - sGfxdata.Format(_T("o:gfxdata=\"%ls\""), comment->m_sGfxdata.get2()); - CString sShape;sShape.Format(_T(""), nIndex, sStyle, sGfxdata, sClientData); + sGfxdata.Format(_T("o:gfxdata=\"%s\""), comment->m_sGfxdata.get2()); + CString sShape;sShape.Format(_T(""), nIndex, sStyle, sGfxdata, sClientData); sXml.WriteString(sShape); nIndex++; } diff --git a/Common/DocxFormat/Source/XlsxFormat/Drawing/CellAnchor.h b/Common/DocxFormat/Source/XlsxFormat/Drawing/CellAnchor.h index 1ebef51b08..c3dcdde003 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Drawing/CellAnchor.h +++ b/Common/DocxFormat/Source/XlsxFormat/Drawing/CellAnchor.h @@ -38,7 +38,7 @@ namespace OOX CString sEnd; if(m_oFrom.IsInit() && m_oTo.IsInit()) { - sStart.Format(_T(""), m_oAnchorType.ToString()); + sStart.Format(_T(""), m_oAnchorType.ToString()); sEnd = _T(""); writer.WriteString(sStart); if(m_oFrom.IsInit()) diff --git a/Common/DocxFormat/Source/XlsxFormat/Drawing/Drawing.h b/Common/DocxFormat/Source/XlsxFormat/Drawing/Drawing.h index 74aa0f056d..c327db937e 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Drawing/Drawing.h +++ b/Common/DocxFormat/Source/XlsxFormat/Drawing/Drawing.h @@ -33,7 +33,7 @@ namespace OOX { if(m_oId.IsInit()) { - CString sVal;sVal.Format(_T(""), m_oId->GetValue()); + CString sVal;sVal.Format(_T(""), m_oId->GetValue()); writer.WriteString(sVal); } diff --git a/Common/DocxFormat/Source/XlsxFormat/Drawing/FromTo.h b/Common/DocxFormat/Source/XlsxFormat/Drawing/FromTo.h index 4579d37858..9c44e499c1 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Drawing/FromTo.h +++ b/Common/DocxFormat/Source/XlsxFormat/Drawing/FromTo.h @@ -29,7 +29,7 @@ namespace OOX } virtual void toXML2(XmlUtils::CStringWriter& writer, CString sName) const { - CString sStart;sStart.Format(_T("<%ls>"), sName); + CString sStart;sStart.Format(_T("<%s>"), sName); writer.WriteString(sStart); if(m_oCol.IsInit()) { @@ -51,7 +51,7 @@ namespace OOX CString sVal;sVal.Format(_T("%I64d"), m_oRowOff->ToEmu()); writer.WriteString(sVal); } - CString sEnd;sEnd.Format(_T(""), sName); + CString sEnd;sEnd.Format(_T(""), sName); writer.WriteString(sEnd); } virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) diff --git a/Common/DocxFormat/Source/XlsxFormat/Drawing/GraphicFrame.h b/Common/DocxFormat/Source/XlsxFormat/Drawing/GraphicFrame.h index 531a93311e..99fbaebc4b 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Drawing/GraphicFrame.h +++ b/Common/DocxFormat/Source/XlsxFormat/Drawing/GraphicFrame.h @@ -302,7 +302,7 @@ namespace OOX { CString sRes; if(m_oChartGraphic.IsInit() && m_oChartGraphic->m_oGraphicData.IsInit() && m_oChartGraphic->m_oGraphicData->m_oChart.IsInit() && m_oChartGraphic->m_oGraphicData->m_oChart->m_oRId.IsInit()) - sRes.Format(_T(""), m_oChartGraphic->m_oGraphicData->m_oChart->m_oRId->ToString()); + sRes.Format(_T(""), m_oChartGraphic->m_oGraphicData->m_oChart->m_oRId->ToString()); writer.WriteString(sRes); } virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) @@ -313,7 +313,7 @@ namespace OOX m_sXml.Init(); m_sXml->Append(oReader.GetOuterXml()); CString sXml; - sXml.Format(_T("%ls"), m_sXml.get()); + sXml.Format(_T("%s"), m_sXml.get()); XmlUtils::CXmlLiteReader oSubReader; oSubReader.FromString(sXml); oSubReader.ReadNextNode();//root diff --git a/Common/DocxFormat/Source/XlsxFormat/Drawing/Pic.h b/Common/DocxFormat/Source/XlsxFormat/Drawing/Pic.h index 968f2e9d9d..73daa1dcbe 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Drawing/Pic.h +++ b/Common/DocxFormat/Source/XlsxFormat/Drawing/Pic.h @@ -220,7 +220,7 @@ namespace OOX if(m_oBlipFill.IsInit() && m_oBlipFill->m_oBlip.IsInit()) { CString sRes; - sRes.Format(_T(""), m_oBlipFill->m_oBlip->m_oEmbed.GetValue()); + sRes.Format(_T(""), m_oBlipFill->m_oBlip->m_oEmbed.GetValue()); writer.WriteString(sRes); } } diff --git a/Common/DocxFormat/Source/XlsxFormat/Styles/Borders.h b/Common/DocxFormat/Source/XlsxFormat/Styles/Borders.h index 91f1c5b536..8154b523cc 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Styles/Borders.h +++ b/Common/DocxFormat/Source/XlsxFormat/Styles/Borders.h @@ -35,7 +35,7 @@ namespace OOX writer.WriteString(sName); if(m_oStyle.IsInit()) { - CString sVal;sVal.Format(_T(" style=\"%ls\""), m_oStyle->ToString()); + CString sVal;sVal.Format(_T(" style=\"%s\""), m_oStyle->ToString()); writer.WriteString(sVal); } writer.WriteString(_T(">")); @@ -107,12 +107,12 @@ namespace OOX writer.WriteString(_T("GetValue()) { - CString sVal;sVal.Format(_T(" diagonalDown=\"%ls\""), m_oDiagonalDown->ToString2( SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" diagonalDown=\"%s\""), m_oDiagonalDown->ToString2( SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oDiagonalUp.IsInit() && SimpleTypes::onoffTrue == m_oDiagonalUp->GetValue()) { - CString sVal;sVal.Format(_T(" diagonalUp=\"%ls\""), m_oDiagonalUp->ToString2( SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" diagonalUp=\"%s\""), m_oDiagonalUp->ToString2( SimpleTypes::onofftostring1)); writer.WriteString(sVal); } writer.WriteString(_T(">")); diff --git a/Common/DocxFormat/Source/XlsxFormat/Styles/CellStyles.h b/Common/DocxFormat/Source/XlsxFormat/Styles/CellStyles.h index 2157117936..9ad7b59d24 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Styles/CellStyles.h +++ b/Common/DocxFormat/Source/XlsxFormat/Styles/CellStyles.h @@ -31,7 +31,7 @@ namespace OOX writer.WriteString(_T("ToString()); + CString sVal;sVal.Format(_T(" patternType=\"%s\""), m_oPatternType->ToString()); writer.WriteString(sVal); } if(m_oBgColor.IsInit() || m_oFgColor.IsInit()) diff --git a/Common/DocxFormat/Source/XlsxFormat/Styles/Fonts.h b/Common/DocxFormat/Source/XlsxFormat/Styles/Fonts.h index 455145f32d..dd41380b03 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Styles/Fonts.h +++ b/Common/DocxFormat/Source/XlsxFormat/Styles/Fonts.h @@ -31,17 +31,17 @@ namespace OOX writer.WriteString(_T("")); if(m_oRFont.IsInit() && m_oRFont->m_sVal.IsInit()) { - CString sVal;sVal.Format(_T(""), XmlUtils::EncodeXmlString(m_oRFont->m_sVal.get())); + CString sVal;sVal.Format(_T(""), XmlUtils::EncodeXmlString(m_oRFont->m_sVal.get())); writer.WriteString(sVal); } if(m_oCharset.IsInit() && m_oCharset->m_oCharset.IsInit()) { - CString sVal;sVal.Format(_T(""), m_oCharset->m_oCharset->ToString()); + CString sVal;sVal.Format(_T(""), m_oCharset->m_oCharset->ToString()); writer.WriteString(sVal); } if(m_oFamily.IsInit() && m_oFamily->m_oFontFamily.IsInit()) { - CString sVal;sVal.Format(_T(""), m_oFamily->m_oFontFamily->ToString()); + CString sVal;sVal.Format(_T(""), m_oFamily->m_oFontFamily->ToString()); writer.WriteString(sVal); } if(m_oBold.IsInit()) @@ -97,26 +97,26 @@ namespace OOX m_oColor->toXML2(writer, _T("color")); if(m_oSz.IsInit() && m_oSz->m_oVal.IsInit()) { - CString sVal;sVal.Format(_T(""), SpreadsheetCommon::WriteDouble(m_oSz->m_oVal->GetValue())); + CString sVal;sVal.Format(_T(""), SpreadsheetCommon::WriteDouble(m_oSz->m_oVal->GetValue())); writer.WriteString(sVal); } if(m_oUnderline.IsInit() && m_oUnderline->m_oUnderline.IsInit()) { CString sVal; if( SimpleTypes::underlineSingle != m_oUnderline->m_oUnderline->GetValue()) - sVal.Format(_T(""), m_oUnderline->m_oUnderline->ToString()); + sVal.Format(_T(""), m_oUnderline->m_oUnderline->ToString()); else sVal.Format(_T(""), m_oUnderline->m_oUnderline->ToString()); writer.WriteString(sVal); } if(m_oVertAlign.IsInit() && m_oVertAlign->m_oVerticalAlign.IsInit()) { - CString sVal;sVal.Format(_T(""), m_oVertAlign->m_oVerticalAlign->ToString()); + CString sVal;sVal.Format(_T(""), m_oVertAlign->m_oVerticalAlign->ToString()); writer.WriteString(sVal); } if(m_oScheme.IsInit() && m_oScheme->m_oFontScheme.IsInit()) { - CString sVal;sVal.Format(_T(""), m_oScheme->m_oFontScheme->ToString()); + CString sVal;sVal.Format(_T(""), m_oScheme->m_oFontScheme->ToString()); writer.WriteString(sVal); } writer.WriteString(_T("")); diff --git a/Common/DocxFormat/Source/XlsxFormat/Styles/NumFmts.h b/Common/DocxFormat/Source/XlsxFormat/Styles/NumFmts.h index 367b1aded2..338fe6c580 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Styles/NumFmts.h +++ b/Common/DocxFormat/Source/XlsxFormat/Styles/NumFmts.h @@ -41,13 +41,13 @@ namespace OOX } if(m_oFormatCode.IsInit()) { - CString sVal;sVal.Format(_T(" formatCode=\"%ls\""), XmlUtils::EncodeXmlString(m_oFormatCode.get())); + CString sVal;sVal.Format(_T(" formatCode=\"%s\""), XmlUtils::EncodeXmlString(m_oFormatCode.get())); writer.WriteString(sVal); } if(m_oSourceLinked.IsInit()) { CString sVal; - sVal.Format(_T(" sourceLinked=\"%ls\""), m_oSourceLinked->ToString2(SimpleTypes::onofftostring1)); + sVal.Format(_T(" sourceLinked=\"%s\""), m_oSourceLinked->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } writer.WriteString(_T("/>")); diff --git a/Common/DocxFormat/Source/XlsxFormat/Styles/TableStyles.h b/Common/DocxFormat/Source/XlsxFormat/Styles/TableStyles.h index 6bfcf48250..5bc688622a 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Styles/TableStyles.h +++ b/Common/DocxFormat/Source/XlsxFormat/Styles/TableStyles.h @@ -32,9 +32,9 @@ namespace OOX { CString sXml; if(m_oSize.IsInit()) - sXml.Format(_T(""), m_oType->ToString(), m_oSize->GetValue(), m_oDxfId->GetValue()); + sXml.Format(_T(""), m_oType->ToString(), m_oSize->GetValue(), m_oDxfId->GetValue()); else - sXml.Format(_T(""), m_oType->ToString(), m_oDxfId->GetValue()); + sXml.Format(_T(""), m_oType->ToString(), m_oDxfId->GetValue()); writer.WriteString(sXml); } } @@ -92,7 +92,7 @@ namespace OOX if(m_oName.IsInit()) { CString sName; - sName.Format(_T(" name=\"%ls\""), XmlUtils::EncodeXmlString(m_oName.get2())); + sName.Format(_T(" name=\"%s\""), XmlUtils::EncodeXmlString(m_oName.get2())); writer.WriteString(sName); } if((m_oPivot.IsInit() && true == m_oPivot->ToBool()) || (m_oTable.IsInit() && false == m_oTable->ToBool())) @@ -181,12 +181,12 @@ namespace OOX } if(m_oDefaultTableStyle.IsInit()) { - CString sVal;sVal.Format(_T(" defaultTableStyle=\"%ls\""), XmlUtils::EncodeXmlString(m_oDefaultTableStyle.get())); + CString sVal;sVal.Format(_T(" defaultTableStyle=\"%s\""), XmlUtils::EncodeXmlString(m_oDefaultTableStyle.get())); writer.WriteString(sVal); } if(m_oDefaultPivotStyle.IsInit()) { - CString sVal;sVal.Format(_T(" defaultPivotStyle=\"%ls\""), XmlUtils::EncodeXmlString(m_oDefaultPivotStyle.get())); + CString sVal;sVal.Format(_T(" defaultPivotStyle=\"%s\""), XmlUtils::EncodeXmlString(m_oDefaultPivotStyle.get())); writer.WriteString(sVal); } if(m_arrItems.size() > 0) diff --git a/Common/DocxFormat/Source/XlsxFormat/Styles/Xfs.h b/Common/DocxFormat/Source/XlsxFormat/Styles/Xfs.h index 5db416e713..3460e21d1a 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Styles/Xfs.h +++ b/Common/DocxFormat/Source/XlsxFormat/Styles/Xfs.h @@ -29,7 +29,7 @@ namespace OOX writer.WriteString(_T("ToString()); + CString sVal;sVal.Format(_T(" horizontal=\"%s\""), m_oHorizontal->ToString()); writer.WriteString(sVal); } if(m_oIndent.IsInit()) @@ -39,7 +39,7 @@ namespace OOX } if(m_oJustifyLastLine.IsInit()) { - CString sVal;sVal.Format(_T(" justifyLastLine=\"%ls\""), m_oJustifyLastLine->ToString2(SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" justifyLastLine=\"%s\""), m_oJustifyLastLine->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oReadingOrder.IsInit()) @@ -54,7 +54,7 @@ namespace OOX } if(m_oShrinkToFit.IsInit()) { - CString sVal;sVal.Format(_T(" shrinkToFit=\"%ls\""), m_oShrinkToFit->ToString2(SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" shrinkToFit=\"%s\""), m_oShrinkToFit->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oTextRotation.IsInit()) @@ -64,12 +64,12 @@ namespace OOX } if(m_oVertical.IsInit()) { - CString sVal;sVal.Format(_T(" vertical=\"%ls\""), m_oVertical->ToString()); + CString sVal;sVal.Format(_T(" vertical=\"%s\""), m_oVertical->ToString()); writer.WriteString(sVal); } if(m_oWrapText.IsInit()) { - CString sVal;sVal.Format(_T(" wrapText=\"%ls\""), m_oWrapText->ToString2(SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" wrapText=\"%s\""), m_oWrapText->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } writer.WriteString(_T("/>")); @@ -215,32 +215,32 @@ namespace OOX } if(m_oApplyNumberFormat.IsInit()) { - CString sVal;sVal.Format(_T(" applyNumberFormat=\"%ls\""), m_oApplyNumberFormat->ToString2(SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" applyNumberFormat=\"%s\""), m_oApplyNumberFormat->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oApplyFont.IsInit()) { - CString sVal;sVal.Format(_T(" applyFont=\"%ls\""), m_oApplyFont->ToString2(SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" applyFont=\"%s\""), m_oApplyFont->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oApplyFill.IsInit()) { - CString sVal;sVal.Format(_T(" applyFill=\"%ls\""), m_oApplyFill->ToString2(SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" applyFill=\"%s\""), m_oApplyFill->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oApplyBorder.IsInit()) { - CString sVal;sVal.Format(_T(" applyBorder=\"%ls\""), m_oApplyBorder->ToString2(SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" applyBorder=\"%s\""), m_oApplyBorder->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oApplyAlignment.IsInit()) { - CString sVal;sVal.Format(_T(" applyAlignment=\"%ls\""), m_oApplyAlignment->ToString2(SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" applyAlignment=\"%s\""), m_oApplyAlignment->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oQuotePrefix.IsInit()) { - CString sVal;sVal.Format(_T(" quotePrefix=\"%ls\""), m_oQuotePrefix->ToString2(SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" quotePrefix=\"%s\""), m_oQuotePrefix->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oAligment.IsInit()) diff --git a/Common/DocxFormat/Source/XlsxFormat/Styles/rPr.h b/Common/DocxFormat/Source/XlsxFormat/Styles/rPr.h index eb6d7e0a0e..ff9fb5755e 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Styles/rPr.h +++ b/Common/DocxFormat/Source/XlsxFormat/Styles/rPr.h @@ -350,7 +350,7 @@ namespace OOX writer.WriteString(sName); if(m_oAuto.IsInit()) { - CString sVal;sVal.Format(_T(" auto=\"%ls\""), m_oAuto->ToString2(SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" auto=\"%s\""), m_oAuto->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oIndexed.IsInit()) @@ -363,7 +363,7 @@ namespace OOX int nIndex = OOX::Spreadsheet::CIndexedColors::GetDefaultIndexByRGBA(m_oRgb->Get_R(), m_oRgb->Get_G(), m_oRgb->Get_B(), m_oRgb->Get_A()); if(-1 == nIndex) { - CString sVal;sVal.Format(_T(" rgb=\"%ls\""), m_oRgb->ToString()); + CString sVal;sVal.Format(_T(" rgb=\"%s\""), m_oRgb->ToString()); writer.WriteString(sVal); } else @@ -379,7 +379,7 @@ namespace OOX } if(m_oTint.IsInit()) { - CString sVal;sVal.Format(_T(" tint=\"%ls\""), SpreadsheetCommon::WriteDouble(m_oTint->GetValue())); + CString sVal;sVal.Format(_T(" tint=\"%s\""), SpreadsheetCommon::WriteDouble(m_oTint->GetValue())); writer.WriteString(sVal); } @@ -648,7 +648,7 @@ namespace OOX } if(m_oCharset.IsInit() && m_oCharset->m_oCharset.IsInit()) { - CString sVal;sVal.Format(_T(""), m_oCharset->m_oCharset->ToString()); + CString sVal;sVal.Format(_T(""), m_oCharset->m_oCharset->ToString()); writer.WriteString(sVal); } if(m_oColor.IsInit()) @@ -669,7 +669,7 @@ namespace OOX } if(m_oFamily.IsInit() && m_oFamily->m_oFontFamily.IsInit()) { - CString sVal;sVal.Format(_T(""), m_oFamily->m_oFontFamily->ToString()); + CString sVal;sVal.Format(_T(""), m_oFamily->m_oFontFamily->ToString()); writer.WriteString(sVal); } if(m_oItalic.IsInit()) @@ -688,12 +688,12 @@ namespace OOX } if(m_oRFont.IsInit() && m_oRFont->m_sVal.IsInit()) { - CString sVal;sVal.Format(_T(""), XmlUtils::EncodeXmlString(m_oRFont->m_sVal.get())); + CString sVal;sVal.Format(_T(""), XmlUtils::EncodeXmlString(m_oRFont->m_sVal.get())); writer.WriteString(sVal); } if(m_oScheme.IsInit() && m_oScheme->m_oFontScheme.IsInit()) { - CString sVal;sVal.Format(_T(""), m_oScheme->m_oFontScheme->ToString()); + CString sVal;sVal.Format(_T(""), m_oScheme->m_oFontScheme->ToString()); writer.WriteString(sVal); } if(m_oShadow.IsInit()) @@ -712,21 +712,21 @@ namespace OOX } if(m_oSz.IsInit() && m_oSz->m_oVal.IsInit()) { - CString sVal;sVal.Format(_T(""), SpreadsheetCommon::WriteDouble(m_oSz->m_oVal->GetValue())); + CString sVal;sVal.Format(_T(""), SpreadsheetCommon::WriteDouble(m_oSz->m_oVal->GetValue())); writer.WriteString(sVal); } if(m_oUnderline.IsInit() && m_oUnderline->m_oUnderline.IsInit()) { CString sVal; if( SimpleTypes::underlineSingle != m_oUnderline->m_oUnderline->GetValue()) - sVal.Format(_T(""), m_oUnderline->m_oUnderline->ToString()); + sVal.Format(_T(""), m_oUnderline->m_oUnderline->ToString()); else sVal.Format(_T(""), m_oUnderline->m_oUnderline->ToString()); writer.WriteString(sVal); } if(m_oVertAlign.IsInit() && m_oVertAlign->m_oVerticalAlign.IsInit()) { - CString sVal;sVal.Format(_T(""), m_oVertAlign->m_oVerticalAlign->ToString()); + CString sVal;sVal.Format(_T(""), m_oVertAlign->m_oVerticalAlign->ToString()); writer.WriteString(sVal); } writer.WriteString(_T("")); diff --git a/Common/DocxFormat/Source/XlsxFormat/Table/Autofilter.h b/Common/DocxFormat/Source/XlsxFormat/Table/Autofilter.h index 41c1363ae5..2de6069da5 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Table/Autofilter.h +++ b/Common/DocxFormat/Source/XlsxFormat/Table/Autofilter.h @@ -33,19 +33,19 @@ namespace OOX if(m_oSortBy.IsInit()) { CString sXml; - sXml.Format(_T(" sortBy=\"%ls\""), m_oSortBy->ToString()); + sXml.Format(_T(" sortBy=\"%s\""), m_oSortBy->ToString()); writer.WriteString(sXml); } if(m_oDescending.IsInit()) { CString sXml; - sXml.Format(_T(" descending=\"%ls\""), m_oDescending->ToString2(SimpleTypes::onofftostring1)); + sXml.Format(_T(" descending=\"%s\""), m_oDescending->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sXml); } if(m_oRef.IsInit()) { CString sXml; - sXml.Format(_T(" ref=\"%ls\""), XmlUtils::EncodeXmlString(m_oRef->GetValue())); + sXml.Format(_T(" ref=\"%s\""), XmlUtils::EncodeXmlString(m_oRef->GetValue())); writer.WriteString(sXml); } if(m_oDxfId.IsInit()) @@ -110,9 +110,9 @@ namespace OOX if(m_oRef.IsInit() && m_arrItems.size() > 0) { CString sXml; - sXml.Format(_T("GetValue())); + sXml.Format(_T("GetValue())); if(m_oCaseSensitive.IsInit()) - sXml.AppendFormat(_T(" caseSensitive=\"%ls\""), (const TCHAR *) m_oCaseSensitive->ToString2(SimpleTypes::onofftostring1)); + sXml.AppendFormat(_T(" caseSensitive=\"%s\""), (const TCHAR *) m_oCaseSensitive->ToString2(SimpleTypes::onofftostring1)); sXml.Append(_T(">")); writer.WriteString(sXml); @@ -238,18 +238,18 @@ namespace OOX if(m_oType.IsInit()) { CString sXml; - sXml.Format(_T("ToString()); + sXml.Format(_T("ToString()); writer.WriteString(sXml); if(m_oVal.IsInit()) { CString sVal; - sVal.Format(_T(" val=\"%ls\""), OOX::Spreadsheet::SpreadsheetCommon::WriteDouble(m_oVal->GetValue())); + sVal.Format(_T(" val=\"%s\""), OOX::Spreadsheet::SpreadsheetCommon::WriteDouble(m_oVal->GetValue())); writer.WriteString(sVal); } if(m_oMaxVal.IsInit()) { CString sVal; - sVal.Format(_T(" maxVal=\"%ls\""), OOX::Spreadsheet::SpreadsheetCommon::WriteDouble(m_oMaxVal->GetValue())); + sVal.Format(_T(" maxVal=\"%s\""), OOX::Spreadsheet::SpreadsheetCommon::WriteDouble(m_oMaxVal->GetValue())); writer.WriteString(sVal); } writer.WriteString(CString(_T("/>"))); @@ -306,7 +306,7 @@ namespace OOX if(m_oOperator.IsInit() && m_oVal.IsInit()) { CString sXml; - sXml.Format(_T(""), m_oOperator->ToString(), m_oVal.get()); + sXml.Format(_T(""), m_oOperator->ToString(), m_oVal.get()); writer.WriteString(sXml); } } @@ -423,7 +423,7 @@ namespace OOX if(m_oVal.IsInit()) { CString sXml; - sXml.Format(_T(""), XmlUtils::EncodeXmlString(m_oVal.get())); + sXml.Format(_T(""), XmlUtils::EncodeXmlString(m_oVal.get())); writer.WriteString(sXml); } } @@ -513,7 +513,7 @@ namespace OOX if(m_oDateTimeGrouping.IsInit()) { CString sXml; - sXml.Format(_T(" dateTimeGrouping=\"%ls\""), m_oDateTimeGrouping->ToString()); + sXml.Format(_T(" dateTimeGrouping=\"%s\""), m_oDateTimeGrouping->ToString()); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -581,7 +581,7 @@ namespace OOX if(m_oBlank.IsInit()) { CString sXml; - sXml.Format(_T(" blank=\"%ls\""), m_oBlank->ToString2(SimpleTypes::onofftostring1)); + sXml.Format(_T(" blank=\"%s\""), m_oBlank->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sXml); } writer.WriteString(_T(">")); @@ -657,13 +657,13 @@ namespace OOX if(m_oVal.IsInit()) { CString sXml; - sXml.Format(_T(" val=\"%ls\""), OOX::Spreadsheet::SpreadsheetCommon::WriteDouble(m_oVal->GetValue())); + sXml.Format(_T(" val=\"%s\""), OOX::Spreadsheet::SpreadsheetCommon::WriteDouble(m_oVal->GetValue())); writer.WriteString(sXml); } if(m_oFilterVal.IsInit()) { CString sXml; - sXml.Format(_T(" filterVal=\"%ls\""), OOX::Spreadsheet::SpreadsheetCommon::WriteDouble(m_oFilterVal->GetValue())); + sXml.Format(_T(" filterVal=\"%s\""), OOX::Spreadsheet::SpreadsheetCommon::WriteDouble(m_oFilterVal->GetValue())); writer.WriteString(sXml); } writer.WriteString(CString(_T("/>"))); @@ -729,7 +729,7 @@ namespace OOX writer.WriteString(CString(_T(" showButton=\"0\""))); if(m_oHiddenButton.IsInit()) { - CString sXml;sXml.Format(_T(" hiddenButton=\"%ls\""), m_oHiddenButton->ToString2(SimpleTypes::onofftostring1)); + CString sXml;sXml.Format(_T(" hiddenButton=\"%s\""), m_oHiddenButton->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sXml); } writer.WriteString(CString(_T(">"))); @@ -820,7 +820,7 @@ namespace OOX if(m_oRef.IsInit()) { CString sXml; - sXml.Format(_T(""), XmlUtils::EncodeXmlString(m_oRef->GetValue())); + sXml.Format(_T(""), XmlUtils::EncodeXmlString(m_oRef->GetValue())); writer.WriteString(sXml); for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i) m_arrItems[i]->toXML(writer); diff --git a/Common/DocxFormat/Source/XlsxFormat/Table/Table.h b/Common/DocxFormat/Source/XlsxFormat/Table/Table.h index c1d8a3a33a..79360fc554 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Table/Table.h +++ b/Common/DocxFormat/Source/XlsxFormat/Table/Table.h @@ -44,7 +44,7 @@ namespace OOX nShowRowStripes = 1; CString sXml; - sXml.Format(_T(""), XmlUtils::EncodeXmlString(m_oName.get()), nShowFirstColumn, nShowLastColumn, nShowRowStripes, nShowColumnStripes); + sXml.Format(_T(""), XmlUtils::EncodeXmlString(m_oName.get()), nShowFirstColumn, nShowLastColumn, nShowRowStripes, nShowColumnStripes); writer.WriteString(sXml); } } @@ -111,20 +111,20 @@ namespace OOX if(m_oName.IsInit()) { CString sXml; - sXml.Format(_T(" name=\"%ls\""), XmlUtils::EncodeXmlString(m_oName.get())); + sXml.Format(_T(" name=\"%s\""), XmlUtils::EncodeXmlString(m_oName.get())); writer.WriteString(sXml); } if(m_oTotalsRowLabel.IsInit()) { CString sXml; - sXml.Format(_T(" totalsRowLabel=\"%ls\""), XmlUtils::EncodeXmlString(m_oTotalsRowLabel.get())); + sXml.Format(_T(" totalsRowLabel=\"%s\""), XmlUtils::EncodeXmlString(m_oTotalsRowLabel.get())); writer.WriteString(sXml); } //åñòü òàêîé áàã: ïðè ñîõðàíåíèèè "sum" è íàçâàíèÿ òàáëèöû "Table1" (ðóññêèé excel), âûäàåòñÿ îøèáêà â ôîðìóëàõ if(m_oTotalsRowFunction.IsInit()) { CString sXml; - sXml.Format(_T(" totalsRowFunction=\"%ls\""), m_oTotalsRowFunction->ToString()); + sXml.Format(_T(" totalsRowFunction=\"%s\""), m_oTotalsRowFunction->ToString()); writer.WriteString(sXml); } if(m_oDataDxfId.IsInit()) @@ -140,13 +140,13 @@ namespace OOX if(m_oTotalsRowFormula.IsInit()) { CString sXml; - sXml.Format(_T("%ls"), XmlUtils::EncodeXmlString(m_oTotalsRowFormula.get())); + sXml.Format(_T("%s"), XmlUtils::EncodeXmlString(m_oTotalsRowFormula.get())); writer.WriteString(sXml); } if(m_oCalculatedColumnFormula.IsInit()) { CString sXml; - sXml.Format(_T("%ls"), XmlUtils::EncodeXmlString(m_oCalculatedColumnFormula.get())); + sXml.Format(_T("%s"), XmlUtils::EncodeXmlString(m_oCalculatedColumnFormula.get())); writer.WriteString(sXml); } @@ -291,7 +291,7 @@ namespace OOX if(m_oRef.IsInit() && m_oDisplayName.IsInit()) { CString sRoot; - sRoot.Format(_T("GetValue()); + sRoot.Format(_T("
GetValue()); writer.WriteString(sRoot); if(m_oHeaderRowCount.IsInit() && 0 == m_oHeaderRowCount->GetValue()) writer.WriteString(CString(_T(" headerRowCount=\"0\""))); @@ -386,7 +386,7 @@ namespace OOX if(m_oRId.IsInit()) { CString sXml; - sXml.Format(_T(""), m_oRId->GetValue()); + sXml.Format(_T(""), m_oRId->GetValue()); writer.WriteString(sXml); } } diff --git a/Common/DocxFormat/Source/XlsxFormat/Workbook/DefinedNames.h b/Common/DocxFormat/Source/XlsxFormat/Workbook/DefinedNames.h index f2c17bd139..7900425cd7 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Workbook/DefinedNames.h +++ b/Common/DocxFormat/Source/XlsxFormat/Workbook/DefinedNames.h @@ -32,7 +32,7 @@ namespace OOX writer.WriteString(_T("ToString()); + CString sVal;sVal.Format(_T(" state=\"%s\""), m_oState->ToString()); writer.WriteString(sVal); } if(m_oRid.IsInit()) { - CString sVal;sVal.Format(_T(" r:id=\"%ls\""), m_oRid->GetValue()); + CString sVal;sVal.Format(_T(" r:id=\"%s\""), m_oRid->GetValue()); writer.WriteString(sVal); } writer.WriteString(_T("/>")); diff --git a/Common/DocxFormat/Source/XlsxFormat/Workbook/WorkbookPr.h b/Common/DocxFormat/Source/XlsxFormat/Workbook/WorkbookPr.h index 91c266dd97..4813bf9b6d 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Workbook/WorkbookPr.h +++ b/Common/DocxFormat/Source/XlsxFormat/Workbook/WorkbookPr.h @@ -37,12 +37,12 @@ namespace OOX } if(m_oDate1904.IsInit()) { - CString sVal;sVal.Format(_T(" date1904=\"%ls\""), m_oDate1904->ToString2(SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" date1904=\"%s\""), m_oDate1904->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oDateCompatibility.IsInit()) { - CString sVal;sVal.Format(_T(" dateCompatibility=\"%ls\""), m_oDateCompatibility->ToString2(SimpleTypes::onofftostring1)); + CString sVal;sVal.Format(_T(" dateCompatibility=\"%s\""), m_oDateCompatibility->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } writer.WriteString(_T("/>")); diff --git a/Common/DocxFormat/Source/XlsxFormat/Worksheets/Cols.h b/Common/DocxFormat/Source/XlsxFormat/Worksheets/Cols.h index 3c136a3582..1c491088a1 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Worksheets/Cols.h +++ b/Common/DocxFormat/Source/XlsxFormat/Worksheets/Cols.h @@ -32,22 +32,22 @@ namespace OOX writer.WriteString(_T("ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" bestFit=\"%s\""), m_oBestFit->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oCollapsed.IsInit()) { - CString sVal; sVal.Format(_T(" collapsed=\"%ls\""), m_oCollapsed->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" collapsed=\"%s\""), m_oCollapsed->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oCustomWidth.IsInit()) { - CString sVal; sVal.Format(_T(" customWidth=\"%ls\""), m_oCustomWidth->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" customWidth=\"%s\""), m_oCustomWidth->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oHidden.IsInit()) { - CString sVal; sVal.Format(_T(" hidden=\"%ls\""), m_oHidden->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" hidden=\"%s\""), m_oHidden->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oMin.IsInit()) @@ -67,7 +67,7 @@ namespace OOX } if(m_oPhonetic.IsInit()) { - CString sVal; sVal.Format(_T(" phonetic=\"%ls\""), m_oPhonetic->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" phonetic=\"%s\""), m_oPhonetic->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oStyle.IsInit()) @@ -77,7 +77,7 @@ namespace OOX } if(m_oWidth.IsInit()) { - CString sVal; sVal.Format(_T(" width=\"%ls\""), SpreadsheetCommon::WriteDouble(m_oWidth->GetValue())); + CString sVal; sVal.Format(_T(" width=\"%s\""), SpreadsheetCommon::WriteDouble(m_oWidth->GetValue())); writer.WriteString(sVal); } writer.WriteString(_T("/>")); diff --git a/Common/DocxFormat/Source/XlsxFormat/Worksheets/ConditionalFormatting.h b/Common/DocxFormat/Source/XlsxFormat/Worksheets/ConditionalFormatting.h index 88fdd6ad27..51390fc0f2 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Worksheets/ConditionalFormatting.h +++ b/Common/DocxFormat/Source/XlsxFormat/Worksheets/ConditionalFormatting.h @@ -33,13 +33,13 @@ namespace OOX { CString sValue; CString sRoot; - sRoot.Format(_T("ToBool()) writer.WriteString(_T (" gte=\"0\"")); if (m_oVal.IsInit()) { - sValue.Format(_T(" val=\"%ls\""), m_oVal.get()); + sValue.Format(_T(" val=\"%s\""), m_oVal.get()); writer.WriteString(sValue); } @@ -288,7 +288,7 @@ namespace OOX writer.WriteString(_T("ToBool()) @@ -379,7 +379,7 @@ namespace OOX { CString sValue; CString sRoot; - sRoot.Format(_T("GetValue()); + sRoot.Format(_T("GetValue()); writer.WriteString(sRoot); if (m_oAboveAverage.IsInit() && false == m_oAboveAverage->ToBool()) writer.WriteString(_T (" aboveAverage=\"0\"")); @@ -394,7 +394,7 @@ namespace OOX writer.WriteString(_T (" equalAverage=\"1\"")); if (m_oOperator.IsInit()) { - sValue.Format(_T(" text=\"%ls\""), (const TCHAR *) m_oOperator.get().ToString()); + sValue.Format(_T(" text=\"%s\""), (const TCHAR *) m_oOperator.get().ToString()); writer.WriteString(sValue); } if (m_oPercent.IsInit() && true == m_oPercent->ToBool()) @@ -413,12 +413,12 @@ namespace OOX writer.WriteString(_T (" stopIfTrue=\"1\"")); if (m_oText.IsInit()) { - sValue.Format(_T(" text=\"%ls\""), m_oText.get()); + sValue.Format(_T(" text=\"%s\""), m_oText.get()); writer.WriteString(sValue); } if (m_oTimePeriod.IsInit()) { - sValue.Format(_T(" timePeriod=\"%ls\""), m_oTimePeriod.get()); + sValue.Format(_T(" timePeriod=\"%s\""), m_oTimePeriod.get()); writer.WriteString(sValue); } @@ -520,7 +520,7 @@ namespace OOX if (m_oSqRef.IsInit() && 0 < m_arrItems.size()) { CString sRoot; - sRoot.Format(_T("GetValue()); + sRoot.Format(_T("GetValue()); writer.WriteString(sRoot); if (m_oPivot.IsInit() && true == m_oPivot->ToBool()) diff --git a/Common/DocxFormat/Source/XlsxFormat/Worksheets/Hyperlinks.h b/Common/DocxFormat/Source/XlsxFormat/Worksheets/Hyperlinks.h index 45848d9a29..335cef7d96 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Worksheets/Hyperlinks.h +++ b/Common/DocxFormat/Source/XlsxFormat/Worksheets/Hyperlinks.h @@ -32,27 +32,27 @@ namespace OOX writer.WriteString(_T("GetValue()); + CString sVal; sVal.Format(_T(" r:id=\"%s\""), m_oRid->GetValue()); writer.WriteString(sVal); } if(m_oLocation.IsInit()) { - CString sVal; sVal.Format(_T(" location=\"%ls\""), XmlUtils::EncodeXmlString(m_oLocation.get())); + CString sVal; sVal.Format(_T(" location=\"%s\""), XmlUtils::EncodeXmlString(m_oLocation.get())); writer.WriteString(sVal); } if(m_oRef.IsInit()) { - CString sVal; sVal.Format(_T(" ref=\"%ls\""), XmlUtils::EncodeXmlString(m_oRef.get())); + CString sVal; sVal.Format(_T(" ref=\"%s\""), XmlUtils::EncodeXmlString(m_oRef.get())); writer.WriteString(sVal); } if(m_oTooltip.IsInit()) { - CString sVal; sVal.Format(_T(" tooltip=\"%ls\""), XmlUtils::EncodeXmlString(m_oTooltip.get())); + CString sVal; sVal.Format(_T(" tooltip=\"%s\""), XmlUtils::EncodeXmlString(m_oTooltip.get())); writer.WriteString(sVal); } writer.WriteString(_T("/>")); diff --git a/Common/DocxFormat/Source/XlsxFormat/Worksheets/MergeCells.h b/Common/DocxFormat/Source/XlsxFormat/Worksheets/MergeCells.h index fda14bb5fa..8146fdf2d0 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Worksheets/MergeCells.h +++ b/Common/DocxFormat/Source/XlsxFormat/Worksheets/MergeCells.h @@ -32,7 +32,7 @@ namespace OOX writer.WriteString(_T("")); diff --git a/Common/DocxFormat/Source/XlsxFormat/Worksheets/SheetData.h b/Common/DocxFormat/Source/XlsxFormat/Worksheets/SheetData.h index 09ddfc3aa2..1e07125cdc 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Worksheets/SheetData.h +++ b/Common/DocxFormat/Source/XlsxFormat/Worksheets/SheetData.h @@ -31,52 +31,52 @@ namespace OOX writer.WriteString(_T("ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" aca=\"%s\""), m_oAca->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oBx.IsInit()) { - CString sVal; sVal.Format(_T(" bx=\"%ls\""), m_oBx->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" bx=\"%s\""), m_oBx->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oCa.IsInit()) { - CString sVal; sVal.Format(_T(" ca=\"%ls\""), m_oCa->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" ca=\"%s\""), m_oCa->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oDel1.IsInit()) { - CString sVal; sVal.Format(_T(" del1=\"%ls\""), m_oDel1->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" del1=\"%s\""), m_oDel1->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oDel2.IsInit()) { - CString sVal; sVal.Format(_T(" del2=\"%ls\""), m_oDel2->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" del2=\"%s\""), m_oDel2->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oDt2D.IsInit()) { - CString sVal; sVal.Format(_T(" dt2D=\"%ls\""), m_oDt2D->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" dt2D=\"%s\""), m_oDt2D->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oDtr.IsInit()) { - CString sVal; sVal.Format(_T(" dtr=\"%ls\""), m_oDtr->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" dtr=\"%s\""), m_oDtr->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oR1.IsInit()) { - CString sVal; sVal.Format(_T(" r1=\"%ls\""), m_oR1.get()); + CString sVal; sVal.Format(_T(" r1=\"%s\""), m_oR1.get()); writer.WriteString(sVal); } if(m_oR2.IsInit()) { - CString sVal; sVal.Format(_T(" r2=\"%ls\""), m_oR2.get()); + CString sVal; sVal.Format(_T(" r2=\"%s\""), m_oR2.get()); writer.WriteString(sVal); } if(m_oRef.IsInit()) { - CString sVal; sVal.Format(_T(" ref=\"%ls\""), m_oRef.get()); + CString sVal; sVal.Format(_T(" ref=\"%s\""), m_oRef.get()); writer.WriteString(sVal); } if(m_oSi.IsInit()) @@ -86,7 +86,7 @@ namespace OOX } if(m_oT.IsInit()) { - CString sVal; sVal.Format(_T(" t=\"%ls\""), m_oT->ToString()); + CString sVal; sVal.Format(_T(" t=\"%s\""), m_oT->ToString()); writer.WriteString(sVal); } writer.WriteString(_T(">")); @@ -174,12 +174,12 @@ namespace OOX } if(m_oShowPhonetic.IsInit()) { - CString sVal; sVal.Format(_T(" ph=\"%ls\""), m_oShowPhonetic->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" ph=\"%s\""), m_oShowPhonetic->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oRef.IsInit()) { - CString sVal; sVal.Format(_T(" r=\"%ls\""), m_oRef.get()); + CString sVal; sVal.Format(_T(" r=\"%s\""), m_oRef.get()); writer.WriteString(sVal); } if(m_oStyle.IsInit()) @@ -189,7 +189,7 @@ namespace OOX } if(m_oType.IsInit() && SimpleTypes::Spreadsheet::celltypeNumber != m_oType->GetValue()) { - CString sVal; sVal.Format(_T(" t=\"%ls\""), m_oType->ToString()); + CString sVal; sVal.Format(_T(" t=\"%s\""), m_oType->ToString()); writer.WriteString(sVal); } if(m_oValueMetadata.IsInit()) @@ -290,27 +290,27 @@ namespace OOX writer.WriteString(_T("ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" collapsed=\"%s\""), m_oCollapsed->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oCustomFormat.IsInit()) { - CString sVal; sVal.Format(_T(" customFormat=\"%ls\""), m_oCustomFormat->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" customFormat=\"%s\""), m_oCustomFormat->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oHt.IsInit()) { - CString sVal; sVal.Format(_T(" ht=\"%ls\""), SpreadsheetCommon::WriteDouble(m_oHt->GetValue())); + CString sVal; sVal.Format(_T(" ht=\"%s\""), SpreadsheetCommon::WriteDouble(m_oHt->GetValue())); writer.WriteString(sVal); } if(m_oCustomHeight.IsInit()) { - CString sVal; sVal.Format(_T(" customHeight=\"%ls\""), m_oCustomHeight->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" customHeight=\"%s\""), m_oCustomHeight->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oHidden.IsInit()) { - CString sVal; sVal.Format(_T(" hidden=\"%ls\""), m_oHidden->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" hidden=\"%s\""), m_oHidden->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } @@ -321,7 +321,7 @@ namespace OOX } if(m_oPh.IsInit()) { - CString sVal; sVal.Format(_T(" ph=\"%ls\""), m_oPh->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" ph=\"%s\""), m_oPh->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oR.IsInit()) @@ -336,12 +336,12 @@ namespace OOX } if(m_oThickBot.IsInit()) { - CString sVal; sVal.Format(_T(" thickBot=\"%ls\""), m_oThickBot->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" thickBot=\"%s\""), m_oThickBot->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oThickTop.IsInit()) { - CString sVal; sVal.Format(_T(" thickTop=\"%ls\""), m_oThickTop->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" thickTop=\"%s\""), m_oThickTop->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } writer.WriteString(_T(">")); diff --git a/Common/DocxFormat/Source/XlsxFormat/Worksheets/WorksheetChildOther.h b/Common/DocxFormat/Source/XlsxFormat/Worksheets/WorksheetChildOther.h index cea1856dc7..94e4c41b1b 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Worksheets/WorksheetChildOther.h +++ b/Common/DocxFormat/Source/XlsxFormat/Worksheets/WorksheetChildOther.h @@ -32,37 +32,37 @@ namespace OOX if(m_oLeft.IsInit()) { CString sLeft; - sLeft.Format(_T(" left=\"%ls\""), SpreadsheetCommon::WriteDouble(m_oLeft->ToInches())); + sLeft.Format(_T(" left=\"%s\""), SpreadsheetCommon::WriteDouble(m_oLeft->ToInches())); writer.WriteString(sLeft); } if(m_oRight.IsInit()) { CString sRight; - sRight.Format(_T(" right=\"%ls\""), SpreadsheetCommon::WriteDouble(m_oRight->ToInches())); + sRight.Format(_T(" right=\"%s\""), SpreadsheetCommon::WriteDouble(m_oRight->ToInches())); writer.WriteString(sRight); } if(m_oTop.IsInit()) { CString sTop; - sTop.Format(_T(" top=\"%ls\""), SpreadsheetCommon::WriteDouble(m_oTop->ToInches())); + sTop.Format(_T(" top=\"%s\""), SpreadsheetCommon::WriteDouble(m_oTop->ToInches())); writer.WriteString(sTop); } if(m_oBottom.IsInit()) { CString sBottom; - sBottom.Format(_T(" bottom=\"%ls\""), SpreadsheetCommon::WriteDouble(m_oBottom->ToInches())); + sBottom.Format(_T(" bottom=\"%s\""), SpreadsheetCommon::WriteDouble(m_oBottom->ToInches())); writer.WriteString(sBottom); } if(m_oHeader.IsInit()) { CString sHeader; - sHeader.Format(_T(" header=\"%ls\""), SpreadsheetCommon::WriteDouble(m_oHeader->ToInches())); + sHeader.Format(_T(" header=\"%s\""), SpreadsheetCommon::WriteDouble(m_oHeader->ToInches())); writer.WriteString(sHeader); } if(m_oFooter.IsInit()) { CString sFooter; - sFooter.Format(_T(" footer=\"%ls\""), SpreadsheetCommon::WriteDouble(m_oFooter->ToInches())); + sFooter.Format(_T(" footer=\"%s\""), SpreadsheetCommon::WriteDouble(m_oFooter->ToInches())); writer.WriteString(sFooter); } writer.WriteString(CString(_T("/>"))); @@ -130,13 +130,13 @@ namespace OOX if(m_oPaperSize.IsInit()) { CString sPaperSize; - sPaperSize.Format(_T(" paperSize=\"%ls\""), m_oPaperSize->ToString()); + sPaperSize.Format(_T(" paperSize=\"%s\""), m_oPaperSize->ToString()); writer.WriteString(sPaperSize); } if(m_oOrientation.IsInit()) { CString sOrientation; - sOrientation.Format(_T(" orientation=\"%ls\""), m_oOrientation->ToString()); + sOrientation.Format(_T(" orientation=\"%s\""), m_oOrientation->ToString()); writer.WriteString(sOrientation); } writer.WriteString(CString(_T("/>"))); @@ -196,19 +196,19 @@ namespace OOX if(m_oHeadings.IsInit()) { CString sHeadings; - sHeadings.Format(_T(" headings=\"%ls\""), m_oHeadings->ToString2(SimpleTypes::onofftostring1)); + sHeadings.Format(_T(" headings=\"%s\""), m_oHeadings->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sHeadings); } if(m_oGridLines.IsInit()) { CString sGridLines; - sGridLines.Format(_T(" gridLines=\"%ls\""), m_oGridLines->ToString2(SimpleTypes::onofftostring1)); + sGridLines.Format(_T(" gridLines=\"%s\""), m_oGridLines->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sGridLines); } if(m_oGridLinesSet.IsInit()) { CString sGridLinesSet; - sGridLinesSet.Format(_T(" gridLinesSet=\"%ls\""), m_oGridLinesSet->ToString2(SimpleTypes::onofftostring1)); + sGridLinesSet.Format(_T(" gridLinesSet=\"%s\""), m_oGridLinesSet->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sGridLinesSet); } writer.WriteString(CString(_T("/>"))); @@ -324,17 +324,17 @@ namespace OOX } if(m_oCustomHeight.IsInit()) { - CString sVal; sVal.Format(_T(" customHeight=\"%ls\""), m_oCustomHeight->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" customHeight=\"%s\""), m_oCustomHeight->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oDefaultColWidth.IsInit()) { - CString sVal; sVal.Format(_T(" defaultColWidth=\"%ls\""), SpreadsheetCommon::WriteDouble(m_oDefaultColWidth->GetValue())); + CString sVal; sVal.Format(_T(" defaultColWidth=\"%s\""), SpreadsheetCommon::WriteDouble(m_oDefaultColWidth->GetValue())); writer.WriteString(sVal); } if(m_oDefaultRowHeight.IsInit()) { - CString sVal; sVal.Format(_T(" defaultRowHeight=\"%ls\""), SpreadsheetCommon::WriteDouble(m_oDefaultRowHeight->GetValue())); + CString sVal; sVal.Format(_T(" defaultRowHeight=\"%s\""), SpreadsheetCommon::WriteDouble(m_oDefaultRowHeight->GetValue())); writer.WriteString(sVal); } if(m_oOutlineLevelCol.IsInit()) @@ -349,17 +349,17 @@ namespace OOX } if(m_oThickBottom.IsInit()) { - CString sVal; sVal.Format(_T(" thickBottom=\"%ls\""), m_oThickBottom->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" thickBottom=\"%s\""), m_oThickBottom->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oThickTop.IsInit()) { - CString sVal; sVal.Format(_T(" thickTop=\"%ls\""), m_oThickTop->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" thickTop=\"%s\""), m_oThickTop->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oZeroHeight.IsInit()) { - CString sVal; sVal.Format(_T(" zeroHeight=\"%ls\""), m_oZeroHeight->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" zeroHeight=\"%s\""), m_oZeroHeight->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } @@ -431,22 +431,22 @@ namespace OOX writer.WriteString(_T("GetValue())); + CString sVal; sVal.Format(_T(" xSplit=\"%s\""), SpreadsheetCommon::WriteDouble(m_oXSplit->GetValue())); writer.WriteString(sVal); } if (m_oYSplit.IsInit()) { - CString sVal; sVal.Format(_T(" ySplit=\"%ls\""), SpreadsheetCommon::WriteDouble(m_oYSplit->GetValue())); + CString sVal; sVal.Format(_T(" ySplit=\"%s\""), SpreadsheetCommon::WriteDouble(m_oYSplit->GetValue())); writer.WriteString(sVal); } writer.WriteString(_T("/>")); @@ -517,67 +517,67 @@ namespace OOX } if(m_oDefaultGridColor.IsInit()) { - CString sVal; sVal.Format(_T(" defaultGridColor=\"%ls\""), m_oDefaultGridColor->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" defaultGridColor=\"%s\""), m_oDefaultGridColor->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oRightToLeft.IsInit()) { - CString sVal; sVal.Format(_T(" rightToLeft=\"%ls\""), m_oRightToLeft->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" rightToLeft=\"%s\""), m_oRightToLeft->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oShowFormulas.IsInit()) { - CString sVal; sVal.Format(_T(" showFormulas=\"%ls\""), m_oShowFormulas->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" showFormulas=\"%s\""), m_oShowFormulas->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oShowGridLines.IsInit()) { - CString sVal; sVal.Format(_T(" showGridLines=\"%ls\""), m_oShowGridLines->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" showGridLines=\"%s\""), m_oShowGridLines->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oShowOutlineSymbols.IsInit()) { - CString sVal; sVal.Format(_T(" showOutlineSymbols=\"%ls\""), m_oShowOutlineSymbols->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" showOutlineSymbols=\"%s\""), m_oShowOutlineSymbols->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oShowRowColHeaders.IsInit()) { - CString sVal; sVal.Format(_T(" showRowColHeaders=\"%ls\""), m_oShowRowColHeaders->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" showRowColHeaders=\"%s\""), m_oShowRowColHeaders->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oShowRuler.IsInit()) { - CString sVal; sVal.Format(_T(" showRuler=\"%ls\""), m_oShowRuler->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" showRuler=\"%s\""), m_oShowRuler->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oShowWhiteSpace.IsInit()) { - CString sVal; sVal.Format(_T(" showWhiteSpace=\"%ls\""), m_oShowWhiteSpace->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" showWhiteSpace=\"%s\""), m_oShowWhiteSpace->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oShowZeros.IsInit()) { - CString sVal; sVal.Format(_T(" showZeros=\"%ls\""), m_oShowZeros->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" showZeros=\"%s\""), m_oShowZeros->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oTabSelected.IsInit()) { - CString sVal; sVal.Format(_T(" tabSelected=\"%ls\""), m_oTabSelected->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" tabSelected=\"%s\""), m_oTabSelected->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oTopLeftCell.IsInit()) { - CString sVal; sVal.Format(_T(" topLeftCell=\"%ls\""), m_oTopLeftCell.get()); + CString sVal; sVal.Format(_T(" topLeftCell=\"%s\""), m_oTopLeftCell.get()); writer.WriteString(sVal); } if(m_oView.IsInit()) { - CString sVal; sVal.Format(_T(" view=\"%ls\""), m_oView->ToString()); + CString sVal; sVal.Format(_T(" view=\"%s\""), m_oView->ToString()); writer.WriteString(sVal); } if(m_oWindowProtection.IsInit()) { - CString sVal; sVal.Format(_T(" windowProtection=\"%ls\""), m_oWindowProtection->ToString2(SimpleTypes::onofftostring1)); + CString sVal; sVal.Format(_T(" windowProtection=\"%s\""), m_oWindowProtection->ToString2(SimpleTypes::onofftostring1)); writer.WriteString(sVal); } if(m_oWorkbookViewId.IsInit()) diff --git a/Common/DocxFormat/Source/XlsxFormat/Xlsx.h b/Common/DocxFormat/Source/XlsxFormat/Xlsx.h index ea3cb40b06..4eed01ee34 100644 --- a/Common/DocxFormat/Source/XlsxFormat/Xlsx.h +++ b/Common/DocxFormat/Source/XlsxFormat/Xlsx.h @@ -154,11 +154,11 @@ namespace OOX CPath oXlPath = oDirPath / m_pWorkbook->DefaultDirectory(); WriteWorkbook(oXlPath); - IFileContainer::Write(oDirPath / FILE_SEPARATOR_STR , OOX::CPath(_T("")), oContentTypes); + IFileContainer::Write(oDirPath / _T("/"), OOX::CPath(_T("")), oContentTypes); if(!sAdditionalContentTypes.IsEmpty()) { CString sAdditionalContentTypesWrapped; - sAdditionalContentTypesWrapped.Format(_T("%ls"), sAdditionalContentTypes); + sAdditionalContentTypesWrapped.Format(_T("%s"), sAdditionalContentTypes); OOX::CContentTypes oTempContentTypes; oTempContentTypes.ReadFromString(sAdditionalContentTypesWrapped); diff --git a/XlsxSerializerCom/Common/Common.h b/XlsxSerializerCom/Common/Common.h index 45be20505f..30e3a2852a 100644 --- a/XlsxSerializerCom/Common/Common.h +++ b/XlsxSerializerCom/Common/Common.h @@ -2,14 +2,13 @@ #define SERIALIZER_COMMON #ifdef _WIN32 - #include - #include +#include +#include #else - #include "../../Common/DocxFormat/Source/Base/ASCString.h" +#include "../../Common/DocxFormat/Source/Base/ASCString.h" #endif #include "../../DesktopEditor/common/File.h" - #include #include @@ -50,4 +49,4 @@ namespace SerializeCommon void ReadFileType(CString& sXMLOptions, BYTE& result, UINT& nCodePage, WCHAR& wcDelimiter); } -#endif //SERIALIZER_COMMON +#endif //SERIALIZER_COMMON \ No newline at end of file diff --git a/XlsxSerializerCom/Reader/BinaryWriter.h b/XlsxSerializerCom/Reader/BinaryWriter.h index 591ee47e96..22350a587a 100644 --- a/XlsxSerializerCom/Reader/BinaryWriter.h +++ b/XlsxSerializerCom/Reader/BinaryWriter.h @@ -1655,10 +1655,8 @@ namespace BinXlsxRW { if (oFile.IsInit() && OOX::Spreadsheet::FileTypes::Drawings == oFile->type()) { OOX::Spreadsheet::CDrawing* pDrawing = (OOX::Spreadsheet::CDrawing*)oFile.operator->(); - CString sOldRelsPath = m_pOfficeDrawingConverter->GetRelsPath(); CString sDrawingRelsPath = pDrawing->GetReadPath().GetPath(); - m_pOfficeDrawingConverter->SetRelsPath(sDrawingRelsPath); nCurPos = m_oBcw.WriteItemStart(c_oSerWorksheetsTypes::Drawings); @@ -3330,7 +3328,7 @@ namespace BinXlsxRW { CString WriteFileHeader(int nDataSize) { CString sHeader; - sHeader.Format(_T("%ls;v%d;%d;"), g_sFormatSignature, g_nFormatVersion, nDataSize); + sHeader.Format(_T("%s;v%d;%d;"), g_sFormatSignature, g_nFormatVersion, nDataSize); return sHeader; } void WriteMainTableStart() @@ -3382,7 +3380,7 @@ namespace BinXlsxRW { CString WriteDefaultFileHeader(int nDataSize) { CString sHeader; - sHeader.Format(_T("%ls;;%d;"), g_sFormatSignature, nDataSize); + sHeader.Format(_T("%s;;%d;"), g_sFormatSignature, nDataSize); return sHeader; } void writeTheme(BYTE* pData, long nLength, CString& sFileOutput) diff --git a/XlsxSerializerCom/Reader/CSVReader.cpp b/XlsxSerializerCom/Reader/CSVReader.cpp index f75ec9ac76..54bb0ebcaf 100644 --- a/XlsxSerializerCom/Reader/CSVReader.cpp +++ b/XlsxSerializerCom/Reader/CSVReader.cpp @@ -1,7 +1,6 @@ #include "CSVReader.h" #include -#include "../../DesktopEditor/common/File.h" namespace CSVReader { diff --git a/XlsxSerializerCom/Reader/ChartFromToBinary.cpp b/XlsxSerializerCom/Reader/ChartFromToBinary.cpp index ba043fa2ff..2f08a168cb 100644 --- a/XlsxSerializerCom/Reader/ChartFromToBinary.cpp +++ b/XlsxSerializerCom/Reader/ChartFromToBinary.cpp @@ -949,8 +949,8 @@ namespace BinXlsxRW{ else if(c_oserct_chartspaceTHEMEOVERRIDE == type) { CString sThemeOverrideName;sThemeOverrideName.Format(_T("themeOverride%d.xml"), m_oSaveParams.nThemeOverrideCount++); - CString sThemeOverrideRelsPath;sThemeOverrideRelsPath.Format(_T("../theme/%ls"), sThemeOverrideName); - CString sThemeOverridePath;sThemeOverridePath.Format(_T("%ls/%ls"), m_oSaveParams.sThemePath, sThemeOverrideName); + CString sThemeOverrideRelsPath;sThemeOverrideRelsPath.Format(_T("../theme/%s"), sThemeOverrideName); + CString sThemeOverridePath;sThemeOverridePath.Format(_T("%s/%s"), m_oSaveParams.sThemePath, sThemeOverrideName); long nCurPos = m_oBufferedStream.GetPos(); m_pOfficeDrawingConverter->SaveThemeXml(nCurPos, length, sThemeOverridePath); @@ -961,13 +961,13 @@ namespace BinXlsxRW{ CString sThemePathReverse = m_oSaveParams.sThemePath;sThemePathReverse.MakeReverse(); CString sContentTypesPath; - int nIndex = sThemePathReverse.Find(FILE_SEPARATOR_CHAR); - nIndex = sThemePathReverse.Find(FILE_SEPARATOR_CHAR, nIndex + 1); + int nIndex = sThemePathReverse.Find('\\'); + nIndex = sThemePathReverse.Find('\\', nIndex + 1); if(-1 != nIndex) { CString sContentTypesPath = m_oSaveParams.sThemePath.Right(nIndex); sContentTypesPath.Replace('\\', '/'); - m_oSaveParams.sAdditionalContentTypes.AppendFormat(_T(""), (const TCHAR *) sContentTypesPath, (const TCHAR *) sThemeOverrideName); + m_oSaveParams.sAdditionalContentTypes.AppendFormat(_T(""), (const TCHAR *) sContentTypesPath, (const TCHAR *) sThemeOverrideName); } } else diff --git a/XlsxSerializerCom/Resource/theme1.xml b/XlsxSerializerCom/Resource/theme1.xml new file mode 100644 index 0000000000..012e24966b --- /dev/null +++ b/XlsxSerializerCom/Resource/theme1.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/XlsxSerializerCom/Writer/BinaryReader.h b/XlsxSerializerCom/Writer/BinaryReader.h index c404581f4f..3858bc7fe1 100644 --- a/XlsxSerializerCom/Writer/BinaryReader.h +++ b/XlsxSerializerCom/Writer/BinaryReader.h @@ -1838,11 +1838,14 @@ namespace BinXlsxRW { } else if(c_oSerWorksheetsTypes::Drawings == type) { - OOX::CPath pathDrawingsDir = m_sDestinationDir + FILE_SEPARATOR_STR + _T("xl") + FILE_SEPARATOR_STR + _T("drawings"); - OOX::CSystemUtility::CreateDirectories(pathDrawingsDir.GetPath()); - - OOX::CPath pathDrawingsRelsDir = pathDrawingsDir.GetPath() + FILE_SEPARATOR_STR + _T("_rels"); - OOX::CSystemUtility::CreateDirectories(pathDrawingsRelsDir.GetPath()); + CString sDrawingsDir; + sDrawingsDir.Format(_T("%s/xl/drawings"), m_sDestinationDir); + if( !NSDirectory::Exists(string2std_string(sDrawingsDir)) ) + OOX::CSystemUtility::CreateDirectories(sDrawingsDir); + CString sRelsDir; + sRelsDir.Format(_T("%s/_rels"), sDrawingsDir); + if( !NSDirectory::Exists(string2std_string(sRelsDir)) ) + OOX::CSystemUtility::CreateDirectories(sRelsDir); m_pOfficeDrawingConverter->SetDstContentRels(); m_pCurDrawing = new OOX::Spreadsheet::CDrawing(); @@ -1853,8 +1856,10 @@ namespace BinXlsxRW { m_pCurWorksheet->m_oDrawing->m_oId.Init(); m_pCurWorksheet->m_oDrawing->m_oId->SetValue(oRId.get()); - OOX::CPath pathDrawingsRels = pathDrawingsRelsDir.GetPath() + FILE_SEPARATOR_STR + m_pCurDrawing->m_sFilename + _T(".rels"); - m_pOfficeDrawingConverter->SaveDstContentRels(pathDrawingsRels.GetPath()); + CString sFilename = m_pCurDrawing->m_sFilename; + CString sRelsPath; + sRelsPath.Format(_T("%s/%s.rels"), sRelsDir, sFilename); + m_pOfficeDrawingConverter->SaveDstContentRels(sRelsPath); } else if(c_oSerWorksheetsTypes::SheetData == type) { @@ -2400,7 +2405,7 @@ namespace BinXlsxRW { if(S_OK == hRes && NULL != bstrXml) { pCellAnchor->m_oXml.Init(); - pCellAnchor->m_oXml->AppendFormat(_T("%ls"), (const TCHAR *) (*bstrXml)); + pCellAnchor->m_oXml->AppendFormat(_T("%s"), (const TCHAR *) (*bstrXml)); } RELEASEOBJECT(bstrXml); } @@ -2415,12 +2420,14 @@ namespace BinXlsxRW { if(c_oSer_DrawingType::Chart2 == type) { //ñîçäàåì ïàïêó äëÿ rels - OOX::CPath pathChartsDir = m_sDestinationDir + FILE_SEPARATOR_STR + _T("xl") + FILE_SEPARATOR_STR + _T("charts"); - OOX::CSystemUtility::CreateDirectories(pathChartsDir.GetPath()); - - OOX::CPath pathChartsRelsDir = pathChartsDir + FILE_SEPARATOR_STR + _T("_rels"); - OOX::CSystemUtility::CreateDirectories(pathChartsRelsDir.GetPath()); - + CString sChartsDir; + sChartsDir.Format(_T("%s/xl/charts"), m_sDestinationDir); + if( !NSDirectory::Exists(string2std_string(sChartsDir)) ) + OOX::CSystemUtility::CreateDirectories(sChartsDir); + CString sRelsDir; + sRelsDir.Format(_T("%s/_rels"), sChartsDir); + if( !NSDirectory::Exists(string2std_string(sRelsDir)) ) + OOX::CSystemUtility::CreateDirectories(sRelsDir); m_pOfficeDrawingConverter->SetDstContentRels(); OOX::Spreadsheet::CChartSpace* pChartSpace = new OOX::Spreadsheet::CChartSpace(); @@ -2430,12 +2437,12 @@ namespace BinXlsxRW { pChartFile->m_bDoNotAddRels = true; m_pCurDrawing->Add(pChartFile); - OOX::CPath pathChartsRels = pathChartsRelsDir.GetPath() + FILE_SEPARATOR_STR + pChartFile->m_sFilename + _T(".rels"); - m_pOfficeDrawingConverter->SaveDstContentRels(pathChartsRels.GetPath()); + CString sRelsPath;sRelsPath.Format(_T("%s/%s.rels"), sRelsDir, pChartFile->m_sFilename); + m_pOfficeDrawingConverter->SaveDstContentRels(sRelsPath); long rId; CString sNewImgRel; - sNewImgRel.Format(_T("../charts/%ls"), pChartFile->m_sFilename); + sNewImgRel.Format(_T("../charts/%s"), pChartFile->m_sFilename); m_pOfficeDrawingConverter->WriteRels(CString(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart")), sNewImgRel, CString(), &rId); CString sNewRid; sNewRid.Format(_T("rId%d"), rId); @@ -2539,7 +2546,7 @@ namespace BinXlsxRW { long rId; CString sNewImgRel; - sNewImgRel.Format(_T("../media/%ls"), sNewImageName.c_str()); + sNewImgRel.Format(_T("../media/%s"), sNewImageName.c_str()); m_pOfficeDrawingConverter->WriteRels(CString(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image")), sNewImgRel, CString(), &rId); sRId.Format(_T("rId%d"), rId); @@ -2548,7 +2555,7 @@ namespace BinXlsxRW { else sRId = pPair->second; pCellAnchor->m_oXml.Init(); - pCellAnchor->m_oXml->AppendFormat(_T(""), (const TCHAR *) sRId); + pCellAnchor->m_oXml->AppendFormat(_T(""), (const TCHAR *) sRId); } } else @@ -2695,7 +2702,7 @@ namespace BinXlsxRW { { double dValue = m_oBufferedStream.GetDoubleReal(); pCell->m_oValue.Init(); - pCell->m_oValue->m_sText.AppendFormat(_T("%ls"), (const TCHAR *) OOX::Spreadsheet::SpreadsheetCommon::WriteDouble(dValue)); + pCell->m_oValue->m_sText.AppendFormat(_T("%s"), (const TCHAR *) OOX::Spreadsheet::SpreadsheetCommon::WriteDouble(dValue)); } else res = c_oSerConstants::ReadUnknown; @@ -2827,7 +2834,7 @@ namespace BinXlsxRW { res = Read1(length, &BinaryOtherTableReader::ReadMediaContent, this, poResult); else if(c_oSer_OtherType::Theme == type) { - CString sThemePath;sThemePath.Format(_T("%ls/%ls"), m_oSaveParams.sThemePath, OOX::FileTypes::Theme.DefaultFileName().GetPath()); + CString sThemePath;sThemePath.Format(_T("%s/%s"), m_oSaveParams.sThemePath, OOX::FileTypes::Theme.DefaultFileName().GetPath()); long nCurPos = m_oBufferedStream.GetPos(); m_pOfficeDrawingConverter->SaveThemeXml(nCurPos, length, sThemePath); m_oBufferedStream.Seek(nCurPos + length); @@ -3094,10 +3101,8 @@ namespace BinXlsxRW { aOffBits.push_back(mtiOffBits); } } - OOX::CPath pathMedia = sOutDir + FILE_SEPARATOR_STR + _T("xl") + FILE_SEPARATOR_STR + _T("media"); - CString sMediaDir = pathMedia.GetPath(); - - std::map mapMedia; + CString sMediaDir = sOutDir + _T("/xl/media"); + std::map mapMedia; if(-1 != nOtherOffBits) { oBufferedStream.Seek(nOtherOffBits);