Commit 8dc067b2 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

(1.2.0.2): ASCOfficeOdfFileW

(1.0.1.189): ASCOfficeOdfFile

исправлена обратная конвертация типов данных
расширение конвертации формат-кодов при прямой конвертации

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55349 954022d7-b5bf-4e40-9824-e11837661b57
parent 3022af4b
......@@ -367,6 +367,30 @@
<File
RelativePath=".\ASCOfficeOdfFile.rc"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCResourceCompilerTool"
Culture="1033"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCResourceCompilerTool"
Culture="1033"
/>
</FileConfiguration>
<FileConfiguration
Name="Release ASC|Win32"
>
<Tool
Name="VCResourceCompilerTool"
Culture="1033"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\ASCOfficeOdfFile.rgs"
......
......@@ -2,6 +2,6 @@
//1
//0
//1
//188
#define INTVER 1,0,1,188
#define STRVER "1,0,1,188\0"
//189
#define INTVER 1,0,1,189
#define STRVER "1,0,1,189\0"
......@@ -96,7 +96,16 @@ size_t xlsx_fills::fillId(const odf::text_format_properties_content * textProp,
if (i != impl_->fills_.end())
{
//const unsigned int dbgId = i - impl_->fills_.begin();
const std::size_t dbgId = i->index;
if (default_set && i->bDefault != default_set)
{
fill.index = i->index;
impl_->fills_.insert(i,fill);
is_default = default_set;
return fill.index;
}
is_default = i->bDefault;
return dbgId;
......
......@@ -95,21 +95,24 @@ xlsx_style_manager::~xlsx_style_manager()
xlsx_style_manager::Impl::Impl() : next_index_(0)
{
{
xlsx_xf xfRecord;
xfRecord.xfId = 0;
xfRecord.borderId = 0;
xfRecord.numFmtId = 0;
xfRecord.fillId = 0;
xfRecord.fontId = 0;
insert(xfRecord);
//cellXfs_.insert(xfRecord);
//cellXfs_.push_back(xfRecord); // default
}
//{
// xlsx_xf xfRecord;
// xfRecord.xfId = 0;
// xfRecord.borderId = 0;
// xfRecord.numFmtId = 0;
// xfRecord.fillId = 0;
// xfRecord.fontId = 0;
// insert(xfRecord);
// //cellXfs_.insert(xfRecord);
// //cellXfs_.push_back(xfRecord); // default
//}
{
xlsx_xf xfRecord;
cellStyleXfs_.insert(xfRecord);
xfRecord.applyNumberForm = true;
xfRecord.numFmtId = 0;
cellStyleXfs_.insert(xfRecord);
//cellStyleXfs_.push_back(xfRecord);
}
}
......@@ -133,8 +136,8 @@ size_t xlsx_style_manager::Impl::xfId(const odf::text_format_properties_content
bool default_fill = false;
const size_t fillId = fills_.fillId(textProp, parProp, cellProp, default_set,default_fill);
if (!default_border || !default_fill)
if (!default_border || !default_fill/* || (fillId >2 && default_set!=default_fill)*/)
is_visible = true;
xlsx_alignment alignment = OdfProperties2XlsxAlignment(textProp, parProp, cellProp);
......
......@@ -253,10 +253,13 @@ void xlsx_conversion_context::end_table()
{
CP_XML_NODE(L"col")
{
CP_XML_ATTR(L"min", cMin);
//CP_XML_ATTR(L"collapsed", L"false");
//CP_XML_ATTR(L"hidden", L"false");
CP_XML_ATTR(L"max", cMax);
CP_XML_ATTR(L"min", cMin);
//CP_XML_ATTR(L"style", 0);
CP_XML_ATTR(L"width", lastWidht);
CP_XML_ATTR(L"customWidth", 1);
CP_XML_ATTR(L"customWidth", 0);
}
}
}
......
......@@ -355,8 +355,6 @@ void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context)
{
CP_XML_NODE(L"col")
{
CP_XML_ATTR(L"min", (cMin+1));
CP_XML_ATTR(L"max", cMax);
const bool collapsed = table_table_column_attlist_.table_visibility_.get_type() == table_visibility::Collapse;
......@@ -364,10 +362,14 @@ void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context)
{
CP_XML_ATTR(L"hidden", L"true");
}
//else
//{
// CP_XML_ATTR(L"hidden", L"false");
//}
else
{
//
//CP_XML_ATTR(L"collapsed", L"false");
//CP_XML_ATTR(L"hidden", L"false");
}
CP_XML_ATTR(L"max", cMax);
CP_XML_ATTR(L"min", (cMin+1));
if (table_table_column_attlist_.table_style_name_)
{
......@@ -379,23 +381,19 @@ void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context)
{
if (const style_table_cell_properties * prop = inst->content()->get_style_table_cell_properties())
{// ,
//fo:background-color
//if (prop->common_background_color_attlist_.fo_background_color)
{
//oox::xlsx_cell_format cellFormat;
//
//cellFormat.set_cell_type(XlsxCellType::s);
//cellFormat.set_num_format(oox::odf_string_to_build_in(L""));
odf::style_table_cell_properties_attlist cellFormatProperties = calc_table_cell_properties(inst);
size_t style_ = Context.get_style_manager().xfId(NULL,NULL, &cellFormatProperties, NULL, L"",true);
if (style_>0)
CP_XML_ATTR(L"style", style_ );
}
odf::style_table_cell_properties_attlist cellFormatProperties = calc_table_cell_properties(inst);
bool set_default = false;
if (columnsRepeated > 100) set_default = true;
size_t style_ = Context.get_style_manager().xfId(NULL,NULL, &cellFormatProperties, NULL, L"", set_default);
//if (style_>=0)
CP_XML_ATTR(L"style", style_ );
}
}
}
_CP_OPT(double) width;
const std::wstring colStyleName = table_table_column_attlist_.table_style_name_->style_name();
if (style_instance * inst = Context.root()->odf_context().styleContainer().style_by_name(colStyleName, style_family::TableColumn,false))
{
......@@ -415,24 +413,26 @@ void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context)
}
const double pixDpi = in_width * getDefaultDpi();
const double width = pixToSize(pixDpi, Context.getMaxDigitSize().first);
width = pixToSize(pixDpi, Context.getMaxDigitSize().first);
//const double width = cmToChars(prop->style_table_column_properties_attlist_.style_column_width_->get_value_unit(length::cm));
// see ECMA-376 page 1768
CP_XML_ATTR(L"width", width);
CP_XML_ATTR(L"width", *width);
CP_XML_ATTR(L"customWidth", true);
Context.table_column_last_width(width);
}
else
{
CP_XML_ATTR(L"customWidth", 0);
Context.table_column_last_width(0.0);
Context.table_column_last_width(*width);
}
}
}
}
}
if (!width)//??? default set
{
width = 11.52;
CP_XML_ATTR(L"width", *width);
CP_XML_ATTR(L"customWidth", false);
Context.table_column_last_width(*width);
}
}
} // col
} // CP_XML_WRITER
......@@ -727,7 +727,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
if (sharedStringId >= 0 || !formula.empty() ||
(t_val == XlsxCellType::n && !number_val.empty()) ||
(t_val == XlsxCellType::b && bool_val) ||
(t_val == XlsxCellType::str && str_val))is_data_visible = true;
((t_val == XlsxCellType::str || XlsxCellType::inlineStr) && str_val))is_data_visible = true;
// .
if ( is_data_visible || (cellStyle && is_style_visible))
......@@ -762,9 +762,12 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
CP_XML_CONTENT(sharedStringId);
}
}
else if (t_val == XlsxCellType::s || str_val)
{
CP_XML_CONTENT(str_val.get());
else if ((t_val == XlsxCellType::str || t_val == XlsxCellType::inlineStr) && str_val)
{
CP_XML_NODE(L"v")
{
CP_XML_CONTENT(str_val.get());
}
}
else if (t_val == XlsxCellType::n && !number_val.empty())
{
......
......@@ -4,7 +4,7 @@
/* File created by MIDL compiler version 7.00.0555 */
/* at Fri Apr 04 18:34:18 2014
/* at Mon Apr 07 14:29:55 2014
*/
/* Compiler settings for .\ASCOfficeOdfFileW.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555
......
......@@ -2,6 +2,10 @@
//
#include "resource.h"
#define COMPONENT_NAME "OfficeOdfFileW"
#include "..\..\Common\FileInfo.h"
#include "version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
......@@ -12,15 +16,6 @@
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Russian resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
#ifdef _WIN32
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
......@@ -52,8 +47,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEVERSION INTVER
PRODUCTVERSION INTVER
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
......@@ -66,21 +61,22 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "TODO: <Company name>"
VALUE "FileDescription", "TODO: <File description>"
VALUE "FileVersion", "1.0.0.1"
VALUE "LegalCopyright", "TODO: (c) <Company name>. All rights reserved."
VALUE "InternalName", "ASCOfficeOdfFileW.dll"
VALUE "OriginalFilename", "ASCOfficeOdfFileW.dll"
VALUE "ProductName", "TODO: <Product name>"
VALUE "ProductVersion", "1.0.0.1"
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", FILE_DESCRIPTION_ACTIVEX
VALUE "FileVersion", STRVER
VALUE "InternalName", COMPONENT_FILE_NAME_DLL
VALUE "LegalCopyright", LEGAL_COPYRIGHT
VALUE "LegalTrademarks", LEGAL_COPYRIGHT
VALUE "OriginalFilename", COMPONENT_FILE_NAME_DLL
VALUE "ProductName", FILE_DESCRIPTION_ACTIVEX
VALUE "ProductVersion", STRVER
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
VALUE "Translation", 0x409, 1200
END
END
......@@ -102,11 +98,6 @@ BEGIN
IDS_PROJNAME "ASCOfficeOdfFileW"
END
#endif // Russian resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
......
......@@ -3,9 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeOdfFileW", "ASCOfficeOdfFileW.vcproj", "{6258296E-ABCE-4BC6-9F4A-8522CD615603}"
ProjectSection(ProjectDependencies) = postProject
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD} = {E5A67556-44DA-4481-8F87-0A3AEDBD20DD}
{BEE01B53-244A-44E6-8947-ED9342D9247E} = {BEE01B53-244A-44E6-8947-ED9342D9247E}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\Common\DocxFormat\Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}"
......@@ -20,9 +18,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Oox2OdfConverter", "source\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeOdfFileWTest", "ASCOfficeOdfFileWTest\ASCOfficeOdfFileWTest.vcproj", "{FBA8446A-150F-4A10-B4DA-1022048D6473}"
ProjectSection(ProjectDependencies) = postProject
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{BEE01B53-244A-44E6-8947-ED9342D9247E} = {BEE01B53-244A-44E6-8947-ED9342D9247E}
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD} = {E5A67556-44DA-4481-8F87-0A3AEDBD20DD}
{6258296E-ABCE-4BC6-9F4A-8522CD615603} = {6258296E-ABCE-4BC6-9F4A-8522CD615603}
EndProjectSection
EndProject
......
......@@ -290,6 +290,8 @@ void ods_conversion_context::end_columns()
// add_column(current_table().current_column()+1,1024,0,true);
//else
int repeat = current_table().dimension_columns - current_table().current_column();
if (repeat < 0) repeat = 1;
add_column(current_table().current_column()+1,repeat,0,true);
}
void ods_conversion_context::start_rows()
......@@ -298,7 +300,8 @@ void ods_conversion_context::start_rows()
void ods_conversion_context::end_rows()
{
//add default last row
int repeat = current_table().dimension_row - current_table().current_row();
int repeat = std::max(current_table().dimension_row,1024) - current_table().current_row();
if (repeat < 0) repeat = 1;
start_row(current_table().current_row()+1,repeat,0,true);
end_row();
......
......@@ -803,7 +803,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CXfs * xfc_style, int oox_id, bool
if (table_cell_properties)
{//default
table_cell_properties->style_table_cell_properties_attlist_.fo_wrap_option_ = odf::wrap_option(odf::wrap_option::Wrap);
//table_cell_properties->style_table_cell_properties_attlist_.fo_wrap_option_ = odf::wrap_option(odf::wrap_option::Wrap);
//table_cell_properties->style_table_cell_properties_attlist_.style_text_align_source_ = odf::text_align_source(odf::text_align_source::Fix);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
......
#pragma once
//1
//0
//2
//24
#define INTVER 1,0,2,24
#define STRVER "1,0,2,24\0"
//0
//3
#define INTVER 1,2,0,3
#define STRVER "1,2,0,3\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