Commit 0a183f35 authored by ElenaSubbotina's avatar ElenaSubbotina

fix bug #33886

parent ac6cc1ec
......@@ -2,6 +2,9 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml_wrapper", "..\win32\cpxml.vcproj", "{41BED424-4EAF-4053-8A5F-1E2A387D53D1}"
ProjectSection(ProjectDependencies) = postProject
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfFormatReaderLib", "..\win32\cpodf.vcproj", "{50E20601-4A8D-4AFB-8870-63828D328429}"
ProjectSection(ProjectDependencies) = postProject
......@@ -21,7 +24,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfFormulasConvert", "..\wi
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfFileReaderTest", "OdfFileTest.vcproj", "{C2882DDD-07E6-4314-AD4B-48F43F38D722}"
ProjectSection(ProjectDependencies) = postProject
{41BED424-4EAF-4053-8A5F-1E2A387D53D1} = {41BED424-4EAF-4053-8A5F-1E2A387D53D1}
{50E20601-4A8D-4AFB-8870-63828D328429} = {50E20601-4A8D-4AFB-8870-63828D328429}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{94954A67-A853-43B1-A727-6EF2774C5A6A} = {94954A67-A853-43B1-A727-6EF2774C5A6A}
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
......@@ -30,7 +35,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfFileReaderTest", "OdfFil
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}"
......
......@@ -31,18 +31,23 @@
*/
// OdfFileTest.cpp
#include "../../../OfficeUtils/src/OfficeUtils.h"
#include <stdio.h>
#include <tchar.h>
#include "../../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "../../src/ConvertOO2OOX.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../src/ConvertOO2OOX.h"
#if defined(_WIN64)
#pragma comment(lib, "../../../build/bin/icu/win_64/icuuc.lib")
#pragma comment(lib, "../../build/bin/icu/win_64/icuuc.lib")
#elif defined (_WIN32)
#pragma comment(lib, "../../../build/bin/icu/win_32/icuuc.lib")
#pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib")
#endif
int _tmain(int argc, _TCHAR* argv[])
{
if (argc < 2) return 1;
......@@ -50,12 +55,12 @@ int _tmain(int argc, _TCHAR* argv[])
HRESULT hr = S_OK;
//////////////////////////////////////////////////////////////////////////
std::wstring srcFileName = argv[1];
std::wstring dstPath = argc > 2 ? argv[2] : sSrcDoc + L"-my.docx"; //xlsx pptx
std::wstring dstPath = argc > 2 ? argv[2] : srcFileName + L"-my.pptx"; //xlsx pptx
std::wstring outputDir = FileSystem::Directory::GetFolderPath(dstPath);
std::wstring outputDir = NSDirectory::GetFolderPath(dstPath);
std::wstring srcTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
std::wstring dstTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
std::wstring srcTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
// распаковываем исходник во временную директорию
COfficeUtils oCOfficeUtils(NULL);
......@@ -64,14 +69,14 @@ int _tmain(int argc, _TCHAR* argv[])
hr = ConvertOO2OOX(srcTempPath, dstTempPath, L"C:\\Windows\\Fonts", false, NULL);
FileSystem::Directory::DeleteDirectory(srcTempPath);
NSDirectory::DeleteDirectory(srcTempPath);
if (hr != S_OK) return hr;
if (S_OK != oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), dstPath.c_str(), -1))
return hr;
FileSystem::Directory::DeleteDirectory(dstTempPath);
NSDirectory::DeleteDirectory(dstTempPath);
////////////////////////////////////////////////////////////////////////
return 0;
......
......@@ -43,11 +43,11 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_UNICODE;UNICODE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
......@@ -63,7 +63,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="gdi32.lib"
AdditionalDependencies="gdi32.lib Rpcrt4.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
......@@ -369,6 +369,30 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\DesktopEditor\xml\src\xmldom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\DesktopEditor\xml\src\xmllight.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
</Filter>
</Files>
<Globals>
......
......@@ -58,7 +58,7 @@ bool is_internal(const std::wstring & uri, const std::wstring & packetRoot)
std::wstring resultPath = packetRoot + FILE_SEPARATOR_STR + mediaPath;
return NSDirectory::Exists(resultPath) || NSDirectory::Exists(mediaPath);
return NSFile::CFileBinary::Exists(resultPath) || NSDirectory::Exists(mediaPath);
}
mediaitems::item::item( std::wstring const & _href,
......
......@@ -236,6 +236,7 @@ void pptx_serialize_table(std::wostream & strm, _pptx_drawing & val)
if (strTableContent)
{
std::wstring ttt = strTableContent.get();
CP_XML_STREAM() << strTableContent.get();
}
}
......
......@@ -433,8 +433,6 @@ void pptx_slide_context::end_shape()
void pptx_slide_context::end_table()
{
impl_->objects_.push_back(impl_->object_description_);
default_set();
}
bool pptx_slide_context::empty() const
......
......@@ -376,7 +376,7 @@ void oox_serialize_tcPr(std::wostream & strm, std::vector<const odf_reader::styl
if (fill.bitmap)
{
bool isMediaInternal = false;
bool isMediaInternal = true;
std::wstring ref;
fill.bitmap->rId = Context.get_slide_context().get_mediaitems().add_or_find(fill.bitmap->xlink_href_, oox::typeImage, isMediaInternal, ref);
Context.get_slide_context().add_rels(isMediaInternal, fill.bitmap->rId, ref, oox::typeImage);
......
......@@ -71,14 +71,9 @@ namespace odf_reader {
void draw_g::pptx_convert(oox::pptx_conversion_context & Context)
{
int i=0;
int size = content_.size();
while(true)
{
if (i>=size)break;
office_element_ptr const & elm = content_[i];
elm->pptx_convert(Context);
i++;
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->pptx_convert(Context);
}
}
void draw_frame::pptx_convert_placeHolder(oox::pptx_conversion_context & Context)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment