Commit 4f6e3642 authored by ElenaSubbotina's avatar ElenaSubbotina

.

parent 26c02c57
......@@ -86,7 +86,7 @@ void _mediaitems::add_or_find(const std::wstring & oox_ref, Type type, std::wst
std::wstring input_path = oox_ref;
#if defined (_WIN32) || defined(_WIN64) // + mac???
#if defined (_WIN32) || defined(_WIN64)
boost::to_lower(input_path);
#endif
......@@ -100,7 +100,7 @@ void _mediaitems::add_or_find(const std::wstring & oox_ref, Type type, std::wst
break;
}
}
if (output_path.length() < 1)
if (output_path.empty())
{
output_path = ( output_sub_path + output_fileName) ;
if ( type == typeImage)
......
......@@ -68,8 +68,8 @@ std::wstring create_file_name(const std::wstring & uri, _mediaitems::Type type,
{
std::wstring sExt;
if (type == _mediaitems::typeOleObject &&
type == _mediaitems::typeObjectReplacement)
//if (type == _mediaitems::typeOleObject &&
// type == _mediaitems::typeObjectReplacement)
{
int n = uri.rfind(L".");
if (n >= 0) sExt = uri.substr(n);
......
......@@ -39,7 +39,7 @@
#include "../../../DesktopEditor/common/File.h"
#include "../../../DesktopEditor/common/Directory.h"
#include "../../../Common/DocxFormat/Source/Base/Base.h"
#include "../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h"
namespace cpdoccore
{
......@@ -180,8 +180,8 @@ namespace odf_writer
void media::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + (folder_.empty() ? L"" : FILE_SEPARATOR_STR) + folder_;
NSDirectory::CreateDirectory(path);
OOX::CPath path (RootPath + (folder_.empty() ? L"" : FILE_SEPARATOR_STR) + folder_);
NSDirectory::CreateDirectory(path.GetPath());
std::vector< _mediaitems::item > & items = mediaitems_.items();
......@@ -189,9 +189,10 @@ namespace odf_writer
{
if (items[i].type == type_)
{
std::wstring file_name_out = RootPath + FILE_SEPARATOR_STR + items[i].odf_ref;
OOX::CPath file_name_inp ( items[i].oox_ref);
OOX::CPath file_name_out ( RootPath + FILE_SEPARATOR_STR + items[i].odf_ref); //ref содержит уже folder_
NSFile::CFileBinary::Copy(items[i].oox_ref, file_name_out);
NSFile::CFileBinary::Copy(file_name_inp.GetPath(), file_name_out.GetPath());
}
}
......@@ -206,7 +207,7 @@ namespace odf_writer
{
if (mediaitems.count_image > 0)
{
pictures_ = element_ptr( new media(mediaitems, L"Picture", 1) );
pictures_ = element_ptr( new media(mediaitems, L"Pictures", 1) );
}
if (mediaitems.count_media > 0)
{
......
......@@ -2415,8 +2415,8 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
odf_context()->drawing_context()->set_name(std::wstring (L"Custom") + std::to_wstring(sptType));
odf_context()->drawing_context()->start_shape(OOX::VmlShapeType2PrstShape(sptType));
OoxConverter::convert(oox_pic->m_oShape.GetPointer());
OoxConverter::convert(oox_pic->m_oShapeType.GetPointer());
OoxConverter::convert(oox_pic->m_oShape.GetPointer());
odf_context()->drawing_context()->end_shape();
}
......
......@@ -247,11 +247,14 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
convert(oox_sheet->m_oSheetPr.GetPointer());
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Предобработка
if (oox_sheet->m_oHyperlinks.IsInit())
{
for (std::list<OOX::Spreadsheet::CHyperlink*>::iterator it = oox_sheet->m_oHyperlinks->m_arrItems.begin();
it != oox_sheet->m_oHyperlinks->m_arrItems.end(); it++)
{
convert(*it, oox_sheet);
}
}
//комментарии
std::map<std::wstring, OOX::Spreadsheet::CCommentItem*>::iterator pos = oox_sheet->m_mapComments.begin();
while ( oox_sheet->m_mapComments.end() != pos )
......@@ -262,6 +265,8 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
//todooo для оптимизации - перенести мержи в начало
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//колонки
if (oox_sheet->m_oCols.IsInit())
{
ods_context->start_columns();
for (std::list<OOX::Spreadsheet::CCol*>::iterator it = oox_sheet->m_oCols->m_arrItems.begin();
it != oox_sheet->m_oCols->m_arrItems.end(); it++)
......@@ -269,6 +274,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
convert(*it);
}
ods_context->end_columns();
}
if (oox_sheet->m_oSheetData.IsInit() )
{
......@@ -287,6 +293,8 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
oox_sheet->m_oSheetData.reset();
}
if (oox_sheet->m_oMergeCells.IsInit())
{
for (std::list<OOX::Spreadsheet::CMergeCell*>::iterator it = oox_sheet->m_oMergeCells->m_arrItems.begin();
it != oox_sheet->m_oMergeCells->m_arrItems.end(); it++)
{
......@@ -295,7 +303,8 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
ods_context->add_merge_cells((*it)->m_oRef.get());
}
}
if (oox_sheet->m_oDrawing.IsInit() && oox_sheet->m_oDrawing->m_oId.IsInit())
}
if ((oox_sheet->m_oDrawing.IsInit()) && (oox_sheet->m_oDrawing->m_oId.IsInit()))
{
smart_ptr<OOX::File> oFile = oox_sheet->Find(oox_sheet->m_oDrawing->m_oId->GetValue());
if (oFile.IsInit() && OOX::Spreadsheet::FileTypes::Drawings == oFile->type())
......
......@@ -862,6 +862,8 @@ namespace NSFile
int nFileSize = (int)oFile.GetFileSize();
if (nFileSize < nLenBuffer)
nLenBuffer = nFileSize;
oFile.CloseFile();
}
char* pBuffer_in = NULL;
......@@ -895,6 +897,7 @@ namespace NSFile
#endif
bool bRet = false;
if (src.is_open() && dst.is_open())
{
dst << src.rdbuf();
......
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