x2t - fix after testing

This commit is contained in:
ElenaSubbotina
2019-09-05 12:30:22 +03:00
parent 72467589e2
commit e1237b99e2
7 changed files with 39 additions and 64 deletions

View File

@ -3236,7 +3236,8 @@ void BinaryDocumentTableWriter::WriteAltChunk(OOX::Media& oAltChunkFile)
{
switch(OfficeFileFormatChecker.nFileType)
{
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC:
#ifndef DONT_USED_EXTRA_LIBRARY
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC:
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC_FLAT:
{
#ifndef _IOS
@ -3257,6 +3258,7 @@ void BinaryDocumentTableWriter::WriteAltChunk(OOX::Media& oAltChunkFile)
result = (S_OK == rtfConvert.ConvertRtfToOOX(file_name_inp, sResultDocxDir));
}break;
#endif
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX:
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCM:
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX:

View File

@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../DesktopEditor/xml/libxml2/include;../../DesktopEditor/xml/build/vs2005;../../DesktopEditor/freetype-2.5.2/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;__WORDSIZE=32;DONT_WRITE_EMBEDDED_FONTS;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;__WORDSIZE=32;DONT_WRITE_EMBEDDED_FONTS;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_USED_EXTRA_LIBRARY"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"

View File

@ -150,11 +150,6 @@ void odf_settings_context::process_office_settings(office_element_ptr root )
views_elm->add_child_element(views_entry_elm);
}
for (size_t i = 0; i < views_[v].content.size(); i++)
{
views_entry_elm->add_child_element(views_[v].content[i]);
}
if (!views_[v].tables.empty())
{
office_element_ptr tables_elm;
@ -179,6 +174,11 @@ void odf_settings_context::process_office_settings(office_element_ptr root )
}
}
}
for (size_t i = 0; i < views_[v].content.size(); i++)
{
views_entry_elm->add_child_element(views_[v].content[i]);
}
}
}
if (!config_content_.empty())

View File

@ -1532,9 +1532,27 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetViews *oox_sheet_views)
{
ods_context->settings_context()->add_property(L"GridColor", L"int", sheet_view->m_oColorId->ToString());
}
bool bPaneX = false;
bool bPaneY = false;
int ActiveCellX = -1, ActiveCellY = -1;
int topLeftCellX = -1, topLeftCellY = -1;
if (sheet_view->m_oTopLeftCell.IsInit())
{
std::wstring ref(sheet_view->m_oTopLeftCell.get());
odf_writer::utils::parsing_ref (ref, topLeftCellX, topLeftCellY);
}
if (topLeftCellX > 0 && topLeftCellY > 0)
{
ods_context->settings_context()->add_property(L"PositionLeft", L"int", std::to_wstring(topLeftCellX - 1));
ods_context->settings_context()->add_property(L"PositionTop", L"int", std::to_wstring(topLeftCellY - 1));
}
else
{
ods_context->settings_context()->add_property(L"PositionLeft", L"int", std::to_wstring(0));
ods_context->settings_context()->add_property(L"PositionTop", L"int", std::to_wstring(0));
}
for (size_t j = 0; j < sheet_view->m_arrItems.size(); j++)
{
@ -1548,10 +1566,8 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetViews *oox_sheet_views)
if (ActiveCellX > 0 && ActiveCellY > 0)
{
ods_context->settings_context()->add_property(L"CursorPositionX", L"int", std::to_wstring(ActiveCellX - 1));
ods_context->settings_context()->add_property(L"CursorPositionY", L"int", std::to_wstring(ActiveCellY - 1));
ods_context->settings_context()->add_property(L"PositionLeft", L"int", std::to_wstring(0));
ods_context->settings_context()->add_property(L"CursorPositionY", L"int", std::to_wstring(ActiveCellY - 1));
ods_context->settings_context()->add_property(L"PositionRight", L"int", std::to_wstring(0));
ods_context->settings_context()->add_property(L"PositionTop", L"int", std::to_wstring(0));
ods_context->settings_context()->add_property(L"PositionBottom", L"int", std::to_wstring(ActiveCellY > 30 ? ActiveCellY - 2 : 0));
}
}
@ -1563,8 +1579,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetViews *oox_sheet_views)
break; // в OpenOffice нет множественного селекта
}
if (sheet_view->m_oPane.IsInit())
{
{
if (sheet_view->m_oPane->m_oXSplit.IsInit())
{
std::wstring sVal = std::to_wstring((int)sheet_view->m_oPane->m_oXSplit->GetValue());
@ -1626,7 +1641,6 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetViews *oox_sheet_views)
//nullable<SimpleTypes::COnOff<>> m_oDefaultGridColor;
//nullable<SimpleTypes::COnOff<>> m_oShowRuler;
//nullable<SimpleTypes::COnOff<>> m_oShowWhiteSpace;
//nullable<std::wstring> m_oTopLeftCell;
//nullable<SimpleTypes::Spreadsheet::CSheetViewType<>> m_oView;
//nullable<SimpleTypes::COnOff<>> m_oWindowProtection;
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oZoomScaleNormal;
@ -1725,7 +1739,6 @@ void XlsxConverter::convert(OOX::Spreadsheet::CPageMargins *oox_page)
void XlsxConverter::convert(OOX::Spreadsheet::CSheetFormatPr *oox_sheet_format_pr)
{
if (!oox_sheet_format_pr)return;
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oBaseColWidth;
//nullable<SimpleTypes::COnOff<>> m_oCustomHeight;
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oOutlineLevelCol;
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oOutlineLevelRow;
@ -1759,8 +1772,14 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetFormatPr *oox_sheet_format_p
if (oox_sheet_format_pr->m_oDefaultColWidth.IsInit())
{
width = oox_sheet_format_pr->m_oDefaultColWidth->GetValue();
width = ods_context->convert_symbol_width(width) + 5 * 3 / 4.;
//defaultColWidth = baseColumnWidth + {margin padding (2 pixels on each side, totalling 4 pixels)} + {gridline (1pixel)}
}
else if (oox_sheet_format_pr->m_oBaseColWidth.IsInit())
{
width = oox_sheet_format_pr->m_oBaseColWidth->GetValue();
width = ods_context->convert_symbol_width(width);
}
width = ods_context->convert_symbol_width(width);
ods_context->current_table().defaut_column_width_ = width;//pt
column_properties->style_table_column_properties_attlist_.style_column_width_ = odf_types::length(odf_types::length(width,odf_types::length::pt).get_value_unit(odf_types::length::cm),odf_types::length::cm);
}

View File

@ -12,8 +12,6 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsFormatTest", "XlsFormatTest.vcproj", "{C2882DDD-07E6-4314-AD4B-48F43F38D722}"
ProjectSection(ProjectDependencies) = postProject
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
{AF2D00A7-A351-4700-AE88-C1D9ADE29345} = {AF2D00A7-A351-4700-AE88-C1D9ADE29345}
{C5371405-338F-4B70-83BD-2A5CDF64F383} = {C5371405-338F-4B70-83BD-2A5CDF64F383}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{CBEDD0D1-10A8-45C1-AF81-8492F40964CA} = {CBEDD0D1-10A8-45C1-AF81-8492F40964CA}
EndProjectSection
@ -29,10 +27,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\..\Common\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptlib", "..\..\Common\3dParty\cryptopp\cryptlib.vcproj", "{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RtfFormatLib", "..\..\..\core\ASCOfficeRtfFile\RtfFormatLib\Win32\RtfFormatLib.vcproj", "{AF2D00A7-A351-4700-AE88-C1D9ADE29345}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatLib", "..\..\..\core\ASCOfficeDocFile\DocFormatLib\Win32\DocFormatLib.vcproj", "{C5371405-338F-4B70-83BD-2A5CDF64F383}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -179,44 +173,6 @@ Global
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.ReleaseOpenSource|Win32.ActiveCfg = Release|x64
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.ReleaseOpenSource|x64.ActiveCfg = Release|x64
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.ReleaseOpenSource|x64.Build.0 = Release|x64
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.Debug|Win32.ActiveCfg = Debug|Win32
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.Debug|Win32.Build.0 = Debug|Win32
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.Debug|x64.ActiveCfg = Debug|x64
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.Debug|x64.Build.0 = Debug|x64
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.DLL-Import Debug|x64.Build.0 = Debug|x64
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.DLL-Import Release|Win32.Build.0 = Release|Win32
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.DLL-Import Release|x64.ActiveCfg = Release|x64
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.DLL-Import Release|x64.Build.0 = Release|x64
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.Release|Win32.ActiveCfg = Release|Win32
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.Release|Win32.Build.0 = Release|Win32
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.Release|x64.ActiveCfg = Release|x64
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.Release|x64.Build.0 = Release|x64
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.ReleaseOpenSource|Win32.ActiveCfg = Release|x64
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.ReleaseOpenSource|x64.ActiveCfg = Release|x64
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.ReleaseOpenSource|x64.Build.0 = Release|x64
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Debug|Win32.ActiveCfg = Debug|Win32
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Debug|Win32.Build.0 = Debug|Win32
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Debug|x64.ActiveCfg = Debug|x64
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Debug|x64.Build.0 = Debug|x64
{C5371405-338F-4B70-83BD-2A5CDF64F383}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
{C5371405-338F-4B70-83BD-2A5CDF64F383}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
{C5371405-338F-4B70-83BD-2A5CDF64F383}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
{C5371405-338F-4B70-83BD-2A5CDF64F383}.DLL-Import Debug|x64.Build.0 = Debug|x64
{C5371405-338F-4B70-83BD-2A5CDF64F383}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
{C5371405-338F-4B70-83BD-2A5CDF64F383}.DLL-Import Release|Win32.Build.0 = Release|Win32
{C5371405-338F-4B70-83BD-2A5CDF64F383}.DLL-Import Release|x64.ActiveCfg = Release|x64
{C5371405-338F-4B70-83BD-2A5CDF64F383}.DLL-Import Release|x64.Build.0 = Release|x64
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Release|Win32.ActiveCfg = Release|Win32
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Release|Win32.Build.0 = Release|Win32
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Release|x64.ActiveCfg = Release|x64
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Release|x64.Build.0 = Release|x64
{C5371405-338F-4B70-83BD-2A5CDF64F383}.ReleaseOpenSource|Win32.ActiveCfg = Release|x64
{C5371405-338F-4B70-83BD-2A5CDF64F383}.ReleaseOpenSource|x64.ActiveCfg = Release|x64
{C5371405-338F-4B70-83BD-2A5CDF64F383}.ReleaseOpenSource|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../DesktopEditor/xml/libxml2/include;../../DesktopEditor/xml/build/vs2005;../../DesktopEditor/freetype-2.5.2/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;USE_LITE_READER;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;USE_LITE_READER;DONT_WRITE_EMBEDDED_FONTS;DONT_USED_EXTRA_LIBRARY"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -419,10 +419,6 @@
RelativePath="..\..\ASCOfficeDocxFile2\BinReader\Readers.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeOdfFile\src\odf\svg_parser.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\XlsxSerializer.cpp"
>

View File

@ -166,6 +166,8 @@ void SupBook::readFields(CFRecord& record)
{
if (bPath)
{
if (false == sResult.empty())
virtPath.push_back(L"");
virtPath.back() += L"/" + sResult;
}
else