Commit 053e1d1d authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

(1.0.1.105): ASCOfficeOdtFile

поправлены косяки перехода с AVS на ASC

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@53610 954022d7-b5bf-4e40-9824-e11837661b57
parent 6138139c
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;STANDALONE_USE 1" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;STANDALONE_USE 0" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
WarningLevel="3" WarningLevel="3"
......
...@@ -6,18 +6,18 @@ ...@@ -6,18 +6,18 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
#import "libid:E2A541D8-4CC7-40C6-AA18-A033006D8E5A" rename_namespace("AVSOfficeOdtFile"), raw_interfaces_only #import "..\..\Redist\ASCOfficeOdtFile.dll" rename_namespace("ASCOfficeOdtFile") raw_interfaces_only
#define HR_RET(HR) if FAILED(hr = (HR)) { _ASSERTE(false); return -1; } #define HR_RET(HR) if FAILED(hr = (HR)) { _ASSERTE(false); return -1; }
int ConvertSingle(int argc, _TCHAR* argv[]) int ConvertSingle(int argc, _TCHAR* argv[])
{ {
ATL::CComPtr<AVSOfficeOdtFile::IAVSOfficeFileTemplate> officeOdtFile; ATL::CComPtr<ASCOfficeOdtFile::IAVSOfficeFileTemplate> officeOdtFile;
HRESULT hr; HRESULT hr;
HR_RET(officeOdtFile.CoCreateInstance(__uuidof(AVSOfficeOdtFile::COdtFile))); HR_RET(officeOdtFile.CoCreateInstance(__uuidof(ASCOfficeOdtFile::COdtFile)));
boost::timer t1; boost::timer t1;
officeOdtFile->SaveToFile(ATL::CComBSTR(argv[1]), ATL::CComBSTR(argv[2]), NULL); officeOdtFile->SaveToFile(ATL::CComBSTR(argv[2]), ATL::CComBSTR(argv[1]), NULL);
std::cout << "\n\nTime : " << t1.elapsed() << "\n"; std::cout << "\n\nTime : " << t1.elapsed() << "\n";
return 0; return 0;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#endif #endif
#import "libid:9AEF1F19-91CE-46C0-A380-06A7F56CE4AE" rename_namespace("AVSOfficeOdfFile"), raw_interfaces_only #import "../Redist/ASCOfficeOdfFile.dll" rename_namespace("ASCOfficeOdfFile"), raw_interfaces_only
// : 1 , xlsx docx // : 1 , xlsx docx
// 0 , package // 0 , package
...@@ -66,7 +66,8 @@ COdtFile::COdtFile() ...@@ -66,7 +66,8 @@ COdtFile::COdtFile()
HRESULT COdtFile::FinalConstruct() HRESULT COdtFile::FinalConstruct()
{ {
m_pOfficeUtils = NULL; m_pOfficeUtils = NULL;
HRESULT hr = odfFile_.CoCreateInstance(__uuidof(AVSOfficeOdfFile::COfficeOdfFile)); HRESULT hr = odfFile_.CoCreateInstance(__uuidof(ASCOfficeOdfFile::COfficeOdfFile));
hr = CoCreateInstance(__uuidof(ASCOfficeUtils::COfficeUtils), hr = CoCreateInstance(__uuidof(ASCOfficeUtils::COfficeUtils),
NULL, NULL,
CLSCTX_INPROC_SERVER, CLSCTX_INPROC_SERVER,
...@@ -108,7 +109,7 @@ STDMETHODIMP COdtFile::LoadFromFile(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLO ...@@ -108,7 +109,7 @@ STDMETHODIMP COdtFile::LoadFromFile(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLO
} }
HRESULT COdtFile::convert(const std::wstring & srcPath, const std::wstring & dstPath) HRESULT COdtFile::convert(const std::wstring & srcPath, const std::wstring & dstPath)
{ {
const boost::filesystem::wpath origin = boost::filesystem::wpath(srcPath) / L"Origin";// odt const boost::filesystem::wpath origin = boost::filesystem::wpath(dstPath) / L"Origin";// odt
createOriginOdt(origin); createOriginOdt(origin);
try try
...@@ -137,11 +138,6 @@ HRESULT COdtFile::SaveToFileImpl(const std::wstring & srcPath, ...@@ -137,11 +138,6 @@ HRESULT COdtFile::SaveToFileImpl(const std::wstring & srcPath,
{ {
HRESULT hr = E_FAIL; HRESULT hr = E_FAIL;
//#ifdef BOOST_FILESYSTEM_LEGACY
// const std::wstring ext = boost::algorithm::to_lower_copy(boost::filesystem::wpath(dstFileName).extension());
//#else
// const std::wstring ext = boost::algorithm::to_lower_copy(boost::filesystem::wpath(dstFileName).extension().string<std::wstring>());
//#endif
// ( ) // ( )
#if defined(STANDALONE_USE) && (STANDALONE_USE == 1) #if defined(STANDALONE_USE) && (STANDALONE_USE == 1)
...@@ -248,7 +244,7 @@ void COdtFile::createOriginOdt(const boost::filesystem::wpath& path) const ...@@ -248,7 +244,7 @@ void COdtFile::createOriginOdt(const boost::filesystem::wpath& path) const
const boost::filesystem::wpath odtFile = path / L"origin.odt"; const boost::filesystem::wpath odtFile = path / L"origin.odt";
boost::filesystem::create_directories(path); boost::filesystem::create_directories(path);
LoadFromResource(MAKEINTRESOURCE(IDR_DOCUMENT2), L"Document", _bstr_t(odtFile.string().c_str())); DWORD err = LoadFromResource(MAKEINTRESOURCE(IDR_DOCUMENT2), L"Document", _bstr_t(odtFile.string().c_str()));
m_pOfficeUtils->ExtractToDirectory(_bstr_t(odtFile.string().c_str()), _bstr_t(path.string().c_str()), NULL, 0); m_pOfficeUtils->ExtractToDirectory(_bstr_t(odtFile.string().c_str()), _bstr_t(path.string().c_str()), NULL, 0);
boost::filesystem::remove(odtFile); boost::filesystem::remove(odtFile);
...@@ -257,7 +253,7 @@ void COdtFile::createOriginOdt(const boost::filesystem::wpath& path) const ...@@ -257,7 +253,7 @@ void COdtFile::createOriginOdt(const boost::filesystem::wpath& path) const
const unsigned long COdtFile::LoadFromResource(LPCWSTR lpResName, LPCWSTR lpResType, LPCWSTR fileName) const const unsigned long COdtFile::LoadFromResource(LPCWSTR lpResName, LPCWSTR lpResType, LPCWSTR fileName) const
{ {
HMODULE hMod = GetModuleHandle(_T("AVSOfficeOdtFile.dll")); HMODULE hMod = GetModuleHandle(_T("ASCOfficeOdtFile.dll"));
if (hMod) if (hMod)
{ {
HRSRC hRes = FindResource(hMod, lpResName, lpResType); HRSRC hRes = FindResource(hMod, lpResName, lpResType);
......
...@@ -51,9 +51,9 @@ namespace OOX ...@@ -51,9 +51,9 @@ namespace OOX
boost::filesystem::copy_file(m_filename, newFilePath/newFilename); boost::filesystem::copy_file(m_filename, newFilePath/newFilename);
} }
} }
if (m_filename.extension() == L".svm") //if (m_filename.extension() == L".svm")
content.Default->add(replace_extension(newFilePath/newFilename, L"png")); // content.Default->add(replace_extension(newFilePath/newFilename, L"png"));
else //else
content.Default->add(newFilePath/newFilename); content.Default->add(newFilePath/newFilename);
} }
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//1 //1
//0 //0
//1 //1
//104 //106
#define INTVER 1,0,1,104 #define INTVER 1,0,1,106
#define STRVER "1,0,1,104\0" #define STRVER "1,0,1,106\0"
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