Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
0c0f2cf9
Commit
0c0f2cf9
authored
Apr 04, 2016
by
ElenaSubbotina
Committed by
Alexander Trofimov
May 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormat - высота строк в табличках
parent
77d6ebdd
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
206 additions
and
238 deletions
+206
-238
ASCOfficeOdfFile/src/docx/xlsx_table_state.cpp
ASCOfficeOdfFile/src/docx/xlsx_table_state.cpp
+37
-36
ASCOfficeOdfFile/src/docx/xlsx_table_state.h
ASCOfficeOdfFile/src/docx/xlsx_table_state.h
+40
-34
ASCOfficeOdfFile/src/docx/xlsx_tablecontext.cpp
ASCOfficeOdfFile/src/docx/xlsx_tablecontext.cpp
+35
-34
ASCOfficeOdfFile/src/docx/xlsx_tablecontext.h
ASCOfficeOdfFile/src/docx/xlsx_tablecontext.h
+7
-7
ASCOfficeOdfFile/src/docx/xlsxconversioncontext.cpp
ASCOfficeOdfFile/src/docx/xlsxconversioncontext.cpp
+2
-2
ASCOfficeOdfFile/src/docx/xlsxconversioncontext.h
ASCOfficeOdfFile/src/docx/xlsxconversioncontext.h
+5
-6
ASCOfficeOdfFile/src/odf/odfcontext.cpp
ASCOfficeOdfFile/src/odf/odfcontext.cpp
+1
-28
ASCOfficeOdfFile/src/odf/odfcontext.h
ASCOfficeOdfFile/src/odf/odfcontext.h
+43
-46
ASCOfficeOdfFile/src/odf/style_table_properties.h
ASCOfficeOdfFile/src/odf/style_table_properties.h
+11
-11
ASCOfficeOdfFile/src/odf/table_xlsx.cpp
ASCOfficeOdfFile/src/odf/table_xlsx.cpp
+24
-34
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CF12.cpp
...ficeXlsFile2/source/XlsFormat/Logic/Biff_records/CF12.cpp
+1
-0
No files found.
ASCOfficeOdfFile/src/docx/xlsx_table_state.cpp
View file @
0c0f2cf9
#include "xlsx_table_state.h"
#include <cpdoccore/odf/odf_document.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "logging.h"
#include "logging.h"
#include "xlsx_table_state.h"
#include "xlsxconversioncontext.h"
#include "xlsxconversioncontext.h"
#include <cpdoccore/xml/simple_xml_writer.h>
#include "../odf/odfcontext.h"
#include "../odf/style_table_properties.h"
#include "../odf/datatypes/stylefamily.h"
namespace
cpdoccore
{
namespace
cpdoccore
{
namespace
oox
{
namespace
oox
{
xlsx_table_state
::
xlsx_table_state
(
xlsx_conversion_context
&
Context
,
const
std
::
wstring
&
StyleName
,
const
std
::
wstring
&
tableName
)
xlsx_table_state
::
xlsx_table_state
(
xlsx_conversion_context
*
Context
,
std
::
wstring
styleName
,
std
::
wstring
tableName
)
:
context_
(
Context
),
:
context_
(
Context
),
table_style_
(
S
tyleName
),
table_style_
(
s
tyleName
),
tableName_
(
tableName
),
tableName_
(
tableName
),
current_table_column_
(
-
1
),
current_table_column_
(
-
1
),
current_table_row_
(
-
1
),
current_table_row_
(
-
1
),
columns_spanned_num_
(
0
),
columns_spanned_num_
(
0
),
columns_count_
(
0
),
columns_count_
(
0
),
xlsx_drawing_context_
(
Context
.
get_drawing_context_handle
()),
xlsx_drawing_context_
(
Context
->
get_drawing_context_handle
()),
xlsx_comments_context_
(
Context
.
get_comments_context_handle
()),
xlsx_comments_context_
(
Context
->
get_comments_context_handle
()),
table_column_last_width_
(
0.0
)
table_column_last_width_
(
0.0
)
{
{
memset
(
&
group_row_
,
0
,
sizeof
(
_group_row
));
memset
(
&
group_row_
,
0
,
sizeof
(
_group_row
));
...
@@ -225,6 +231,7 @@ double charsToSize(unsigned int charsCount, double maxDigitSize)
...
@@ -225,6 +231,7 @@ double charsToSize(unsigned int charsCount, double maxDigitSize)
void
xlsx_table_state
::
serialize_table_format
(
std
::
wostream
&
_Wostream
)
void
xlsx_table_state
::
serialize_table_format
(
std
::
wostream
&
_Wostream
)
{
{
odf_reader
::
odf_read_context
&
odfContext
=
context_
->
root
()
->
odf_context
();
CP_XML_WRITER
(
_Wostream
)
CP_XML_WRITER
(
_Wostream
)
{
{
CP_XML_NODE
(
L"sheetView"
)
CP_XML_NODE
(
L"sheetView"
)
...
@@ -234,32 +241,26 @@ void xlsx_table_state::serialize_table_format(std::wostream & _Wostream)
...
@@ -234,32 +241,26 @@ void xlsx_table_state::serialize_table_format(std::wostream & _Wostream)
// -rightToLeft
// -rightToLeft
// -zoomScale
// -zoomScale
}
}
CP_XML_NODE
(
L"sheetFormatPr"
)
double
default_height
=
(
2
*
context_
->
getMaxDigitSize
().
second
*
72.
/
96.
*
100.
)
/
100.
;
//in point size.
odf_reader
::
style_instance
*
rowDefStyle
=
odfContext
.
styleContainer
().
style_default_by_type
(
odf_types
::
style_family
::
TableRow
);
if
((
rowDefStyle
)
&&
(
rowDefStyle
->
content
()))
{
{
double
default_height
=
(
context_
.
getMaxDigitSize
().
second
*
72.
/
96.
*
100.
)
/
100.
;
//in point size.
const
odf_reader
::
style_table_row_properties
*
prop
=
rowDefStyle
->
content
()
->
get_style_table_row_properties
();
//odf::style_instance * rowStyle = odfContext.styleContainer().style_by_name(styleName, odf_types::style_family::TableRow,false/*false*/);
if
(
(
prop
)
&&
(
prop
->
style_table_row_properties_attlist_
.
style_row_height_
))
//if (!rowStyle)
{
// break;
default_height
=
prop
->
style_table_row_properties_attlist_
.
style_row_height_
->
get_value_unit
(
odf_types
::
length
::
pt
);
}
//if (!rowStyle->content())
std
::
wstringstream
ht_s
;
// break;
ht_s
.
precision
(
3
);
ht_s
<<
std
::
fixed
<<
default_height
;
//const odf_reader::style_table_row_properties * prop = rowStyle->content()->get_style_table_row_properties();
//if (!prop)
// break;
//if (const _CP_OPT(odf_types::length) & height = prop->style_table_row_properties_attlist_.style_row_height_)
//{
// row_height = height->get_value_unit(odf_types::length::pt);
// std::wstringstream ht_s;
// ht_s.precision(3);
// ht_s << std::fixed << row_height;
// ht = ht_s.str();
//}
//CP_XML_ATTR(L"defaultColWidth", merges_.size());
CP_XML_ATTR
(
L"defaultRowHeight"
,
default_height
);
CP_XML_NODE
(
L"sheetFormatPr"
)
{
CP_XML_ATTR
(
L"defaultRowHeight"
,
ht_s
.
str
());
}
}
}
}
}
...
...
ASCOfficeOdfFile/src/docx/xlsx_table_state.h
View file @
0c0f2cf9
...
@@ -13,12 +13,15 @@ namespace cpdoccore {
...
@@ -13,12 +13,15 @@ namespace cpdoccore {
namespace
oox
{
namespace
oox
{
class
xlsx_conversion_context
;
class
xlsx_conversion_context
;
class
xlsx_table_state
;
typedef
_CP_PTR
(
xlsx_table_state
)
xlsx_table_state_ptr
;
class
xlsx_table_state
class
xlsx_table_state
{
{
public:
public:
xlsx_table_state
(
xlsx_conversion_context
&
Context
,
const
std
::
wstring
&
StyleName
,
const
std
::
wstring
&
tableName
);
xlsx_table_state
(
xlsx_conversion_context
*
Context
,
std
::
wstring
styleName
,
std
::
wstring
tableName
);
std
::
wstring
current_style
()
const
{
return
table_style_
;
}
std
::
wstring
current_style
()
const
{
return
table_style_
;
}
void
start_column
(
unsigned
int
repeated
,
const
std
::
wstring
&
defaultCellStyleName
);
void
start_column
(
unsigned
int
repeated
,
const
std
::
wstring
&
defaultCellStyleName
);
void
start_row
(
const
std
::
wstring
&
StyleName
,
const
std
::
wstring
&
defaultCellStyleName
);
void
start_row
(
const
std
::
wstring
&
StyleName
,
const
std
::
wstring
&
defaultCellStyleName
);
void
non_empty_row
();
void
non_empty_row
();
...
@@ -45,20 +48,20 @@ public:
...
@@ -45,20 +48,20 @@ public:
unsigned
int
current_rows_spanned
(
unsigned
int
Column
)
const
;
unsigned
int
current_rows_spanned
(
unsigned
int
Column
)
const
;
unsigned
int
columns_count
()
const
;
unsigned
int
columns_count
()
const
;
xlsx_table_metrics
&
get_table_metrics
()
{
return
xlsx_table_metrics_
;
}
xlsx_table_metrics
&
get_table_metrics
()
{
return
xlsx_table_metrics_
;
}
xlsx_drawing_context
&
get_drawing_context
()
{
return
xlsx_drawing_context_
;
}
xlsx_drawing_context
&
get_drawing_context
()
{
return
xlsx_drawing_context_
;
}
xlsx_comments_context
&
get_comments_context
()
{
return
xlsx_comments_context_
;
}
xlsx_comments_context
&
get_comments_context
()
{
return
xlsx_comments_context_
;
}
void
table_column_last_width
(
double
w
)
{
table_column_last_width_
=
w
;
}
void
table_column_last_width
(
double
w
)
{
table_column_last_width_
=
w
;
}
double
table_column_last_width
()
const
{
return
table_column_last_width_
;
};
double
table_column_last_width
()
const
{
return
table_column_last_width_
;
};
void
start_hyperlink
();
void
start_hyperlink
();
std
::
wstring
end_hyperlink
(
std
::
wstring
const
&
ref
,
std
::
wstring
const
&
href
,
std
::
wstring
const
&
display
);
std
::
wstring
end_hyperlink
(
std
::
wstring
const
&
ref
,
std
::
wstring
const
&
href
,
std
::
wstring
const
&
display
);
void
serialize_table_format
(
std
::
wostream
&
_Wostream
);
void
serialize_table_format
(
std
::
wostream
&
_Wostream
);
void
serialize_merge_cells
(
std
::
wostream
&
_Wostream
);
void
serialize_merge_cells
(
std
::
wostream
&
_Wostream
);
void
serialize_hyperlinks
(
std
::
wostream
&
_Wostream
);
void
serialize_hyperlinks
(
std
::
wostream
&
_Wostream
);
void
dump_rels_hyperlinks
(
rels
&
Rels
);
void
dump_rels_hyperlinks
(
rels
&
Rels
);
std
::
wstring
get_current_table_name
()
const
{
return
tableName_
;
}
std
::
wstring
get_current_table_name
()
const
{
return
tableName_
;
}
...
@@ -70,29 +73,32 @@ public:
...
@@ -70,29 +73,32 @@ public:
bool
collapsed
;
bool
collapsed
;
}
group_row_
;
}
group_row_
;
private:
private:
xlsx_conversion_context
&
context_
;
xlsx_conversion_context
*
context_
;
std
::
wstring
table_style_
;
std
::
wstring
tableName_
;
std
::
wstring
tableName_
;
std
::
wstring
table_row_style_
;
std
::
wstring
table_style_
;
std
::
vector
<
std
::
wstring
>
column_default_cell_style_name_
;
std
::
wstring
table_row_style_
;
std
::
wstring
row_default_cell_style_name_
;
std
::
wstring
cell_style_
;
std
::
wstring
cell_style_
;
std
::
vector
<
std
::
wstring
>
column_default_cell_style_name_
;
int
current_table_column_
;
std
::
wstring
row_default_cell_style_name_
;
int
current_table_row_
;
unsigned
int
columns_spanned_num_
;
int
current_table_column_
;
std
::
wstring
columns_spanned_style_
;
int
current_table_row_
;
std
::
vector
<
xlsx_row_spanned
>
rows_spanned_
;
bool
empty_row_
;
std
::
vector
<
unsigned
int
>
columns_
;
unsigned
int
columns_count_
;
unsigned
int
columns_spanned_num_
;
xlsx_merge_cells
merge_cells_
;
std
::
wstring
columns_spanned_style_
;
xlsx_table_metrics
xlsx_table_metrics_
;
xlsx_drawing_context
xlsx_drawing_context_
;
std
::
vector
<
xlsx_row_spanned
>
rows_spanned_
;
xlsx_comments_context
xlsx_comments_context_
;
std
::
vector
<
unsigned
int
>
columns_
;
unsigned
int
columns_count_
;
double
table_column_last_width_
;
bool
empty_row_
;
double
table_column_last_width_
;
xlsx_merge_cells
merge_cells_
;
xlsx_hyperlinks
xlsx_hyperlinks_
;
xlsx_table_metrics
xlsx_table_metrics_
;
xlsx_drawing_context
xlsx_drawing_context_
;
xlsx_comments_context
xlsx_comments_context_
;
xlsx_hyperlinks
xlsx_hyperlinks_
;
};
};
...
...
ASCOfficeOdfFile/src/docx/xlsx_tablecontext.cpp
View file @
0c0f2cf9
...
@@ -18,25 +18,26 @@ namespace oox {
...
@@ -18,25 +18,26 @@ namespace oox {
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
xlsx_table_state
&
xlsx_table_context
::
state
()
xlsx_table_state
_ptr
&
xlsx_table_context
::
state
()
{
{
return
table_state_stack_
.
back
();
return
table_state_stack_
.
back
();
}
}
const
xlsx_table_state
&
xlsx_table_context
::
state
()
const
const
xlsx_table_state
_ptr
&
xlsx_table_context
::
state
()
const
{
{
return
table_state_stack_
.
back
();
return
table_state_stack_
.
back
();
}
}
xlsx_table_context
::
xlsx_table_context
::
xlsx_table_context
(
xlsx_conversion_context
&
Context
,
xlsx_text_context
&
textContext
)
:
context_
(
Context
),
xlsx_table_context
(
xlsx_conversion_context
*
Context
,
xlsx_text_context
&
textContext
)
:
context_
(
Context
),
xlsx_text_context_
(
textContext
)
xlsx_text_context_
(
textContext
)
{
{
}
}
void
xlsx_table_context
::
start_table
(
const
std
::
wstring
&
tableName
,
const
std
::
wstring
&
tableStyleName
)
void
xlsx_table_context
::
start_table
(
std
::
wstring
tableName
,
std
::
wstring
tableStyleName
)
{
{
table_state_stack_
.
push_back
(
xlsx_table_state
(
context_
,
tableStyleName
,
tableName
)
);
xlsx_table_state_ptr
state
=
boost
::
make_shared
<
xlsx_table_state
>
(
context_
,
tableStyleName
,
tableName
);
table_state_stack_
.
push_back
(
state
);
}
}
void
xlsx_table_context
::
end_table
()
void
xlsx_table_context
::
end_table
()
...
@@ -46,27 +47,27 @@ void xlsx_table_context::end_table()
...
@@ -46,27 +47,27 @@ void xlsx_table_context::end_table()
std
::
wstring
xlsx_table_context
::
get_current_table_name
()
const
std
::
wstring
xlsx_table_context
::
get_current_table_name
()
const
{
{
return
state
()
.
get_current_table_name
();
return
state
()
->
get_current_table_name
();
}
}
void
xlsx_table_context
::
start_cell
(
const
std
::
wstring
&
formula
,
size_t
columnsSpanned
,
size_t
rowsSpanned
)
void
xlsx_table_context
::
start_cell
(
const
std
::
wstring
&
formula
,
size_t
columnsSpanned
,
size_t
rowsSpanned
)
{
{
state
()
.
start_cell
(
columnsSpanned
,
rowsSpanned
);
state
()
->
start_cell
(
columnsSpanned
,
rowsSpanned
);
}
}
void
xlsx_table_context
::
end_cell
()
void
xlsx_table_context
::
end_cell
()
{
{
state
()
.
end_cell
();
state
()
->
end_cell
();
}
}
void
xlsx_table_context
::
set_current_cell_style_id
(
unsigned
int
xfId
)
void
xlsx_table_context
::
set_current_cell_style_id
(
unsigned
int
xfId
)
{
{
return
state
()
.
set_current_cell_style_id
(
xfId
);
return
state
()
->
set_current_cell_style_id
(
xfId
);
}
}
int
xlsx_table_context
::
get_current_cell_style_id
()
int
xlsx_table_context
::
get_current_cell_style_id
()
{
{
return
state
()
.
get_current_cell_style_id
();
return
state
()
->
get_current_cell_style_id
();
}
}
void
xlsx_table_context
::
start_cell_content
()
void
xlsx_table_context
::
start_cell_content
()
...
@@ -81,116 +82,116 @@ int xlsx_table_context::end_cell_content()
...
@@ -81,116 +82,116 @@ int xlsx_table_context::end_cell_content()
void
xlsx_table_context
::
start_covered_cell
()
void
xlsx_table_context
::
start_covered_cell
()
{
{
return
state
()
.
start_covered_cell
();
return
state
()
->
start_covered_cell
();
}
}
void
xlsx_table_context
::
end_covered_cell
()
void
xlsx_table_context
::
end_covered_cell
()
{
{
return
state
()
.
end_covered_cell
();
return
state
()
->
end_covered_cell
();
}
}
void
xlsx_table_context
::
set_table_row_group
(
int
count
,
bool
collapsed
,
int
level
)
void
xlsx_table_context
::
set_table_row_group
(
int
count
,
bool
collapsed
,
int
level
)
{
{
return
state
()
.
set_table_row_group
(
count
,
collapsed
,
level
);
return
state
()
->
set_table_row_group
(
count
,
collapsed
,
level
);
}
}
void
xlsx_table_context
::
start_row
(
const
std
::
wstring
&
StyleName
,
const
std
::
wstring
&
defaultCellStyleName
)
void
xlsx_table_context
::
start_row
(
const
std
::
wstring
&
StyleName
,
const
std
::
wstring
&
defaultCellStyleName
)
{
{
return
state
()
.
start_row
(
StyleName
,
defaultCellStyleName
);
return
state
()
->
start_row
(
StyleName
,
defaultCellStyleName
);
}
}
void
xlsx_table_context
::
non_empty_row
()
void
xlsx_table_context
::
non_empty_row
()
{
{
return
table_state_stack_
.
back
().
non_empty_row
();
return
state
()
->
non_empty_row
();
}
}
bool
xlsx_table_context
::
is_empty_row
()
const
bool
xlsx_table_context
::
is_empty_row
()
const
{
{
return
state
()
.
is_empty_row
();
return
state
()
->
is_empty_row
();
}
}
void
xlsx_table_context
::
end_row
()
void
xlsx_table_context
::
end_row
()
{
{
return
state
()
.
end_row
();
return
state
()
->
end_row
();
}
}
void
xlsx_table_context
::
start_column
(
unsigned
int
repeated
,
const
std
::
wstring
&
defaultCellStyleName
)
void
xlsx_table_context
::
start_column
(
unsigned
int
repeated
,
const
std
::
wstring
&
defaultCellStyleName
)
{
{
return
state
()
.
start_column
(
repeated
,
defaultCellStyleName
);
return
state
()
->
start_column
(
repeated
,
defaultCellStyleName
);
}
}
unsigned
int
xlsx_table_context
::
columns_count
()
unsigned
int
xlsx_table_context
::
columns_count
()
{
{
return
table_state_stack_
.
back
().
columns_count
();
return
state
()
->
columns_count
();
}
}
std
::
wstring
xlsx_table_context
::
default_row_cell_style
()
const
std
::
wstring
xlsx_table_context
::
default_row_cell_style
()
const
{
{
return
state
()
.
default_row_cell_style
();
return
state
()
->
default_row_cell_style
();
}
}
std
::
wstring
xlsx_table_context
::
default_column_cell_style
()
const
std
::
wstring
xlsx_table_context
::
default_column_cell_style
()
const
{
{
return
state
()
.
default_column_cell_style
();
return
state
()
->
default_column_cell_style
();
}
}
int
xlsx_table_context
::
current_column
()
const
int
xlsx_table_context
::
current_column
()
const
{
{
return
state
()
.
current_column
();
return
state
()
->
current_column
();
}
}
int
xlsx_table_context
::
current_row
()
const
int
xlsx_table_context
::
current_row
()
const
{
{
return
state
()
.
current_row
();
return
state
()
->
current_row
();
}
}
void
xlsx_table_context
::
serialize_merge_cells
(
std
::
wostream
&
_Wostream
)
void
xlsx_table_context
::
serialize_merge_cells
(
std
::
wostream
&
_Wostream
)
{
{
return
state
()
.
serialize_merge_cells
(
_Wostream
);
return
state
()
->
serialize_merge_cells
(
_Wostream
);
}
}
void
xlsx_table_context
::
serialize_table_format
(
std
::
wostream
&
_Wostream
)
void
xlsx_table_context
::
serialize_table_format
(
std
::
wostream
&
_Wostream
)
{
{
return
state
()
.
serialize_table_format
(
_Wostream
);
return
state
()
->
serialize_table_format
(
_Wostream
);
}
}
void
xlsx_table_context
::
serialize_hyperlinks
(
std
::
wostream
&
_Wostream
)
void
xlsx_table_context
::
serialize_hyperlinks
(
std
::
wostream
&
_Wostream
)
{
{
return
state
()
.
serialize_hyperlinks
(
_Wostream
);
return
state
()
->
serialize_hyperlinks
(
_Wostream
);
}
}
void
xlsx_table_context
::
dump_rels_hyperlinks
(
rels
&
Rels
)
void
xlsx_table_context
::
dump_rels_hyperlinks
(
rels
&
Rels
)
{
{
return
state
()
.
dump_rels_hyperlinks
(
Rels
);
return
state
()
->
dump_rels_hyperlinks
(
Rels
);
}
}
xlsx_table_metrics
&
xlsx_table_context
::
get_table_metrics
()
xlsx_table_metrics
&
xlsx_table_context
::
get_table_metrics
()
{
{
return
state
()
.
get_table_metrics
();
return
state
()
->
get_table_metrics
();
}
}
xlsx_drawing_context
&
xlsx_table_context
::
get_drawing_context
()
xlsx_drawing_context
&
xlsx_table_context
::
get_drawing_context
()
{
{
return
state
()
.
get_drawing_context
();
return
state
()
->
get_drawing_context
();
}
}
xlsx_comments_context
&
xlsx_table_context
::
get_comments_context
()
xlsx_comments_context
&
xlsx_table_context
::
get_comments_context
()
{
{
return
state
()
.
get_comments_context
();
return
state
()
->
get_comments_context
();
}
}
void
xlsx_table_context
::
table_column_last_width
(
double
w
)
void
xlsx_table_context
::
table_column_last_width
(
double
w
)
{
{
return
state
()
.
table_column_last_width
(
w
);
return
state
()
->
table_column_last_width
(
w
);
}
}
double
xlsx_table_context
::
table_column_last_width
()
const
double
xlsx_table_context
::
table_column_last_width
()
const
{
{
return
state
()
.
table_column_last_width
();
return
state
()
->
table_column_last_width
();
}
}
void
xlsx_table_context
::
start_hyperlink
()
void
xlsx_table_context
::
start_hyperlink
()
{
{
return
state
()
.
start_hyperlink
();
return
state
()
->
start_hyperlink
();
}
}
std
::
wstring
xlsx_table_context
::
end_hyperlink
(
std
::
wstring
const
&
ref
,
std
::
wstring
const
&
href
,
std
::
wstring
const
&
display
)
std
::
wstring
xlsx_table_context
::
end_hyperlink
(
std
::
wstring
const
&
ref
,
std
::
wstring
const
&
href
,
std
::
wstring
const
&
display
)
{
{
return
state
()
.
end_hyperlink
(
ref
,
href
,
display
);
return
state
()
->
end_hyperlink
(
ref
,
href
,
display
);
}
}
...
...
ASCOfficeOdfFile/src/docx/xlsx_tablecontext.h
View file @
0c0f2cf9
...
@@ -16,10 +16,10 @@ class xlsx_text_context;
...
@@ -16,10 +16,10 @@ class xlsx_text_context;
class
xlsx_table_context
class
xlsx_table_context
{
{
public:
public:
xlsx_table_context
(
xlsx_conversion_context
&
Context
,
xlsx_text_context
&
textCotnext
);
xlsx_table_context
(
xlsx_conversion_context
*
Context
,
xlsx_text_context
&
textCotnext
);
public:
public:
void
start_table
(
const
std
::
wstring
&
tableName
,
const
std
::
wstring
&
tableStyleName
);
void
start_table
(
std
::
wstring
tableName
,
std
::
wstring
tableStyleName
);
void
end_table
();
void
end_table
();
std
::
wstring
get_current_table_name
()
const
;
std
::
wstring
get_current_table_name
()
const
;
...
@@ -70,8 +70,8 @@ public:
...
@@ -70,8 +70,8 @@ public:
void
table_column_last_width
(
double
w
);
void
table_column_last_width
(
double
w
);
double
table_column_last_width
()
const
;
double
table_column_last_width
()
const
;
xlsx_table_state
&
state
();
xlsx_table_state
_ptr
&
state
();
const
xlsx_table_state
&
state
()
const
;
const
xlsx_table_state
_ptr
&
state
()
const
;
void
start_hyperlink
();
void
start_hyperlink
();
std
::
wstring
end_hyperlink
(
std
::
wstring
const
&
ref
,
std
::
wstring
const
&
href
,
std
::
wstring
const
&
display
);
std
::
wstring
end_hyperlink
(
std
::
wstring
const
&
ref
,
std
::
wstring
const
&
href
,
std
::
wstring
const
&
display
);
...
@@ -80,9 +80,9 @@ public:
...
@@ -80,9 +80,9 @@ public:
void
serialize_hyperlinks
(
std
::
wostream
&
_Wostream
);
void
serialize_hyperlinks
(
std
::
wostream
&
_Wostream
);
private:
private:
xlsx_conversion_context
&
context_
;
xlsx_conversion_context
*
context_
;
xlsx_text_context
&
xlsx_text_context_
;
xlsx_text_context
&
xlsx_text_context_
;
std
::
list
<
xlsx_table_state
>
table_state_stack_
;
std
::
list
<
xlsx_table_state
_ptr
>
table_state_stack_
;
};
};
...
...
ASCOfficeOdfFile/src/docx/xlsxconversioncontext.cpp
View file @
0c0f2cf9
...
@@ -34,7 +34,7 @@ xlsx_conversion_context(::cpdoccore::oox::package::xlsx_document * outputDocumen
...
@@ -34,7 +34,7 @@ xlsx_conversion_context(::cpdoccore::oox::package::xlsx_document * outputDocumen
::
cpdoccore
::
odf_reader
::
odf_document
*
odfDocument
)
:
output_document_
(
outputDocument
),
::
cpdoccore
::
odf_reader
::
odf_document
*
odfDocument
)
:
output_document_
(
outputDocument
),
odf_document_
(
odfDocument
),
odf_document_
(
odfDocument
),
xlsx_text_context_
(
odf_document_
->
odf_context
().
styleContainer
()),
xlsx_text_context_
(
odf_document_
->
odf_context
().
styleContainer
()),
xlsx_table_context_
(
*
this
,
xlsx_text_context_
),
xlsx_table_context_
(
this
,
xlsx_text_context_
),
maxDigitSize_
(
std
::
pair
<
float
,
float
>
(
-
1.0
,
-
1.0
)
),
maxDigitSize_
(
std
::
pair
<
float
,
float
>
(
-
1.0
,
-
1.0
)
),
default_style_
(
(
std
::
numeric_limits
<
size_t
>::
max
)()
),
default_style_
(
(
std
::
numeric_limits
<
size_t
>::
max
)()
),
...
@@ -244,7 +244,7 @@ void xlsx_conversion_context::create_new_sheet(std::wstring const & name)
...
@@ -244,7 +244,7 @@ void xlsx_conversion_context::create_new_sheet(std::wstring const & name)
{
{
sheets_
.
push_back
(
xlsx_xml_worksheet
::
create
(
name
));
sheets_
.
push_back
(
xlsx_xml_worksheet
::
create
(
name
));
}
}
bool
xlsx_conversion_context
::
start_table
(
const
std
::
wstring
&
tableName
,
const
std
::
wstring
&
tableStyleName
)
bool
xlsx_conversion_context
::
start_table
(
std
::
wstring
tableName
,
std
::
wstring
tableStyleName
)
{
{
// TODO : nested tables forbidden
// TODO : nested tables forbidden
if
(
get_table_context
().
depth
()
>
0
)
if
(
get_table_context
().
depth
()
>
0
)
...
...
ASCOfficeOdfFile/src/docx/xlsxconversioncontext.h
View file @
0c0f2cf9
...
@@ -66,14 +66,13 @@ public:
...
@@ -66,14 +66,13 @@ public:
void
start_span
(
const
std
::
wstring
&
styleName
);
void
start_span
(
const
std
::
wstring
&
styleName
);
void
end_span
();
void
end_span
();
bool
start_table
(
const
std
::
wstring
&
tableName
,
const
std
::
wstring
&
tableStyleName
);
bool
start_table
(
std
::
wstring
tableName
,
std
::
wstring
tableStyleName
);
void
end_table
();
void
end_table
();
void
start_table_column
(
unsigned
int
repeated
,
const
std
::
wstring
&
defaultCellStyleName
,
int
&
cMin
,
int
&
cMax
);
void
start_table_column
(
unsigned
int
repeated
,
const
std
::
wstring
&
defaultCellStyleName
,
int
&
cMin
,
int
&
cMax
);
void
table_column_last_width
(
double
w
);
void
table_column_last_width
(
double
w
);
double
table_column_last_width
()
const
;
double
table_column_last_width
()
const
;
void
end_table_column
();
void
end_table_column
();
void
set_table_row_group
(
int
count
,
bool
collapsed
,
int
level
);
void
set_table_row_group
(
int
count
,
bool
collapsed
,
int
level
);
void
start_table_row
(
const
std
::
wstring
&
styleName
,
const
std
::
wstring
&
defaultCellStyleName
);
void
start_table_row
(
const
std
::
wstring
&
styleName
,
const
std
::
wstring
&
defaultCellStyleName
);
...
...
ASCOfficeOdfFile/src/odf/odfcontext.cpp
View file @
0c0f2cf9
...
@@ -37,34 +37,7 @@ style_instance::style_instance(
...
@@ -37,34 +37,7 @@ style_instance::style_instance(
parent_
=
Container
->
style_by_name
(
parent_name_
,
style_type_
,
false
);
parent_
=
Container
->
style_by_name
(
parent_name_
,
style_type_
,
false
);
}
}
std
::
wostream
&
style_instance
::
dbg_dump
(
std
::
wostream
&
_Wostream
)
{
_Wostream
<<
L"[STYLE]
\n
"
;
_Wostream
<<
L"
\t
name: '"
<<
name
()
<<
L"'
\n
"
;
_Wostream
<<
L"
\t
type: '"
<<
style_family
(
type
())
<<
L"'
\n
"
;
_Wostream
<<
L"
\t
content: '"
<<
content
()
<<
L"'
\n
"
;
_Wostream
<<
L"
\t
parent: '"
<<
parent
()
<<
L"'
\n
"
;
_Wostream
<<
L"
\t
parent_name: '"
<<
parent_name
()
<<
L"'
\n
"
;
_Wostream
<<
L"
\t
next: '"
<<
next
()
<<
L"'
\n
"
;
_Wostream
<<
L"
\t
next_name: '"
<<
next_name
()
<<
L"'
\n
"
;
_Wostream
<<
L"
\t
auto: '"
<<
is_automatic
()
<<
L"'
\n
"
;
_Wostream
<<
L"
\t
default: '"
<<
is_default
()
<<
L"'
\n
"
;
_Wostream
<<
L"
\n
"
;
return
_Wostream
;
}
std
::
wostream
&
styles_container
::
dbg_dump
(
std
::
wostream
&
_Wostream
)
{
BOOST_FOREACH
(
style_instance_ptr
&
elm
,
instances_
)
{
elm
->
dbg_dump
(
_Wostream
);
}
return
_Wostream
;
}
style_instance
*
styles_container
::
hyperlink_style
()
style_instance
*
styles_container
::
hyperlink_style
()
{
{
if
(
hyperlink_style_pos_
>
0
)
if
(
hyperlink_style_pos_
>
0
)
...
...
ASCOfficeOdfFile/src/odf/odfcontext.h
View file @
0c0f2cf9
...
@@ -18,53 +18,52 @@ namespace odf_reader {
...
@@ -18,53 +18,52 @@ namespace odf_reader {
class
styles_container
;
class
styles_container
;
class
style_instance
;
class
style_instance
;
typedef
boost
::
shared_ptr
<
style_instance
>
style_instance_ptr
;
typedef
boost
::
shared_ptr
<
style_instance
>
style_instance_ptr
;
typedef
boost
::
shared_ptr
<
styles_container
>
styles_container_ptr
;
typedef
boost
::
shared_ptr
<
styles_container
>
styles_container_ptr
;
class
style_instance
class
style_instance
{
{
public:
public:
style_instance
(
style_instance
(
styles_container
*
Container
,
styles_container
*
Container
,
const
std
::
wstring
&
Name
,
const
std
::
wstring
&
Name
,
odf_types
::
style_family
::
type
Type
,
odf_types
::
style_family
::
type
Type
,
style_content
*
Content
,
style_content
*
Content
,
bool
IsAutomatic
,
bool
IsAutomatic
,
bool
IsDefault
,
bool
IsDefault
,
const
std
::
wstring
&
ParentStyleName
,
const
std
::
wstring
&
ParentStyleName
,
const
std
::
wstring
&
NextStyleName
,
const
std
::
wstring
&
NextStyleName
,
const
std
::
wstring
&
DataStyleName
const
std
::
wstring
&
DataStyleName
);
);
const
std
::
wstring
&
name
()
const
;
const
std
::
wstring
&
name
()
const
;
odf_types
::
style_family
::
type
type
()
const
;
odf_types
::
style_family
::
type
type
()
const
;
style_content
*
content
()
const
;
style_content
*
content
()
const
;
style_instance
*
parent
()
const
;
style_instance
*
parent
()
const
;
const
std
::
wstring
&
parent_name
()
const
;
const
std
::
wstring
&
parent_name
()
const
;
style_instance
*
next
()
const
;
style_instance
*
next
()
const
;
const
std
::
wstring
&
next_name
()
const
;
const
std
::
wstring
&
next_name
()
const
;
bool
is_automatic
()
const
;
const
styles_container
*
container
()
const
{
return
container_
;
}
bool
is_default
()
const
;
const
std
::
wstring
&
data_style_name
()
const
;
const
styles_container
*
container
()
const
{
return
container_
;
}
const
std
::
wstring
&
data_style_name
()
const
;
bool
is_automatic
()
const
;
bool
is_default
()
const
;
std
::
wostream
&
dbg_dump
(
std
::
wostream
&
_Wostream
);
private:
private:
styles_container
*
container_
;
styles_container
*
container_
;
std
::
wstring
name_
;
std
::
wstring
name_
;
odf_types
::
style_family
::
type
style_type_
;
odf_types
::
style_family
::
type
style_type_
;
style_content
*
content_
;
style_content
*
content_
;
bool
is_automatic_
;
bool
is_automatic_
;
bool
is_default_
;
bool
is_default_
;
std
::
wstring
parent_name_
;
std
::
wstring
parent_name_
;
std
::
wstring
next_name_
;
std
::
wstring
next_name_
;
mutable
style_instance
*
parent_
;
mutable
style_instance
*
parent_
;
mutable
style_instance
*
next_
;
mutable
style_instance
*
next_
;
std
::
wstring
data_style_name_
;
std
::
wstring
data_style_name_
;
};
};
class
presentation_layouts_instance
class
presentation_layouts_instance
...
@@ -107,14 +106,14 @@ public:
...
@@ -107,14 +106,14 @@ public:
typedef
std
::
vector
<
style_instance_ptr
>
instances_array
;
typedef
std
::
vector
<
style_instance_ptr
>
instances_array
;
void
add_style
(
const
std
::
wstring
&
Name
,
void
add_style
(
const
std
::
wstring
&
Name
,
odf_types
::
style_family
::
type
Type
,
odf_types
::
style_family
::
type
Type
,
style_content
*
Content
,
style_content
*
Content
,
bool
IsAutomatic
,
bool
IsAutomatic
,
bool
IsDefault
,
bool
IsDefault
,
const
std
::
wstring
&
ParentStyleName
,
const
std
::
wstring
&
ParentStyleName
,
const
std
::
wstring
&
NextStyleName
,
const
std
::
wstring
&
NextStyleName
,
const
std
::
wstring
&
DataStyleName
);
const
std
::
wstring
&
DataStyleName
);
void
add_master_page_name
(
const
std
::
wstring
&
StyleName
,
const
std
::
wstring
&
MasterPageName
);
void
add_master_page_name
(
const
std
::
wstring
&
StyleName
,
const
std
::
wstring
&
MasterPageName
);
...
@@ -126,8 +125,6 @@ public:
...
@@ -126,8 +125,6 @@ public:
instances_array
&
instances
()
{
return
instances_
;
}
instances_array
&
instances
()
{
return
instances_
;
}
std
::
wostream
&
dbg_dump
(
std
::
wostream
&
_Wostream
);
presentation_layouts_instance
&
presentation_layouts
()
{
return
presentation_layouts_
;
}
presentation_layouts_instance
&
presentation_layouts
()
{
return
presentation_layouts_
;
}
presentation_masters_instance
&
presentation_masters
()
{
return
presentation_masters_
;
}
presentation_masters_instance
&
presentation_masters
()
{
return
presentation_masters_
;
}
...
...
ASCOfficeOdfFile/src/odf/style_table_properties.h
View file @
0c0f2cf9
...
@@ -130,9 +130,9 @@ public:
...
@@ -130,9 +130,9 @@ public:
void
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
);
void
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
);
public:
public:
_CP_OPT
(
odf_types
::
length
)
style_column_width_
;
_CP_OPT
(
odf_types
::
length
)
style_column_width_
;
_CP_OPT
(
odf_types
::
length
)
style_rel_column_width_
;
_CP_OPT
(
odf_types
::
length
)
style_rel_column_width_
;
_CP_OPT
(
bool
)
style_use_optimal_column_width_
;
_CP_OPT
(
bool
)
style_use_optimal_column_width_
;
odf_types
::
common_break_attlist
common_break_attlist_
;
odf_types
::
common_break_attlist
common_break_attlist_
;
};
};
...
@@ -175,12 +175,12 @@ public:
...
@@ -175,12 +175,12 @@ public:
void
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
);
void
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
);
public:
public:
_CP_OPT
(
odf_types
::
length
)
style_row_height_
;
_CP_OPT
(
odf_types
::
length
)
style_row_height_
;
_CP_OPT
(
odf_types
::
length
)
style_min_row_height_
;
_CP_OPT
(
odf_types
::
length
)
style_min_row_height_
;
_CP_OPT
(
bool
)
style_use_optimal_row_height_
;
_CP_OPT
(
bool
)
style_use_optimal_row_height_
;
odf_types
::
common_background_color_attlist
common_background_color_attlist_
;
odf_types
::
common_background_color_attlist
common_background_color_attlist_
;
odf_types
::
common_break_attlist
common_break_attlist_
;
odf_types
::
common_break_attlist
common_break_attlist_
;
_CP_OPT
(
odf_types
::
keep_together
)
fo_keep_together_
;
_CP_OPT
(
odf_types
::
keep_together
)
fo_keep_together_
;
};
};
...
@@ -204,8 +204,8 @@ private:
...
@@ -204,8 +204,8 @@ private:
virtual
void
add_child_element
(
xml
::
sax
*
Reader
,
const
::
std
::
wstring
&
Ns
,
const
::
std
::
wstring
&
Name
);
virtual
void
add_child_element
(
xml
::
sax
*
Reader
,
const
::
std
::
wstring
&
Ns
,
const
::
std
::
wstring
&
Name
);
public:
public:
style_table_row_properties_attlist
style_table_row_properties_attlist_
;
style_table_row_properties_attlist
style_table_row_properties_attlist_
;
office_element_ptr
style_background_image_
;
office_element_ptr
style_background_image_
;
};
};
...
...
ASCOfficeOdfFile/src/odf/table_xlsx.cpp
View file @
0c0f2cf9
...
@@ -84,38 +84,28 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
...
@@ -84,38 +84,28 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
odf_read_context
&
odfContext
=
Context
.
root
()
->
odf_context
();
odf_read_context
&
odfContext
=
Context
.
root
()
->
odf_context
();
do
odf_reader
::
style_instance
*
rowStyle
=
odfContext
.
styleContainer
().
style_by_name
(
rowStyleName
,
odf_types
::
style_family
::
TableRow
,
false
/*false*/
);
{
if
((
rowStyle
)
&&
(
rowStyle
->
content
()))
odf_reader
::
style_instance
*
rowStyle
=
odfContext
.
styleContainer
().
style_by_name
(
rowStyleName
,
odf_types
::
style_family
::
TableRow
,
false
/*false*/
);
{
if
(
!
rowStyle
)
const
odf_reader
::
style_table_row_properties
*
prop
=
rowStyle
->
content
()
->
get_style_table_row_properties
();
break
;
if
((
prop
)
&&
(
prop
->
style_table_row_properties_attlist_
.
style_row_height_
))
{
if
(
!
rowStyle
->
content
())
row_height
=
prop
->
style_table_row_properties_attlist_
.
style_row_height_
->
get_value_unit
(
odf_types
::
length
::
pt
);
break
;
const
odf_reader
::
style_table_row_properties
*
prop
=
rowStyle
->
content
()
->
get_style_table_row_properties
();
if
(
!
prop
)
break
;
if
(
const
_CP_OPT
(
odf_types
::
length
)
&
height
=
prop
->
style_table_row_properties_attlist_
.
style_row_height_
)
{
row_height
=
height
->
get_value_unit
(
odf_types
::
length
::
pt
);
if
((
prop
->
style_table_row_properties_attlist_
.
style_use_optimal_row_height_
)
&&
if
((
prop
->
style_table_row_properties_attlist_
.
style_use_optimal_row_height_
)
&&
(
*
prop
->
style_table_row_properties_attlist_
.
style_use_optimal_row_height_
==
true
))
(
*
prop
->
style_table_row_properties_attlist_
.
style_use_optimal_row_height_
==
true
))
{
{
// .
// .
//
//todooo () - !!!
}
}
else
{
std
::
wstringstream
ht_s
;
std
::
wstringstream
ht_s
;
ht_s
.
precision
(
3
);
ht_s
.
precision
(
3
);
ht_s
<<
std
::
fixed
<<
row_height
;
ht_s
<<
std
::
fixed
<<
row_height
;
ht
=
ht_s
.
str
();
ht
=
ht_s
.
str
();
}
}
}
}
}
while
(
0
);
bool
hidden
=
table_table_row_attlist_
.
table_visibility_
.
get_type
()
==
table_visibility
::
Collapse
;
bool
hidden
=
table_table_row_attlist_
.
table_visibility_
.
get_type
()
==
table_visibility
::
Collapse
;
...
@@ -131,22 +121,22 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
...
@@ -131,22 +121,22 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
{
{
CP_XML_ATTR
(
L"r"
,
Context
.
current_table_row
()
+
1
);
CP_XML_ATTR
(
L"r"
,
Context
.
current_table_row
()
+
1
);
if
(
Context
.
get_table_context
().
state
()
.
group_row_
.
enabled
)
if
(
Context
.
get_table_context
().
state
()
->
group_row_
.
enabled
)
{
{
//std::wstring str_spans = boost::lexical_cast<std::wstring>(Context.get_table_context().state()
.
group_row_.count);
//std::wstring str_spans = boost::lexical_cast<std::wstring>(Context.get_table_context().state()
->
group_row_.count);
//str_spans = str_spans + L":";
//str_spans = str_spans + L":";
std
::
wstring
str_spans
=
L"1:"
+
boost
::
lexical_cast
<
std
::
wstring
>
(
Context
.
get_table_context
().
columns_count
());
std
::
wstring
str_spans
=
L"1:"
+
boost
::
lexical_cast
<
std
::
wstring
>
(
Context
.
get_table_context
().
columns_count
());
ht
=
L""
;
ht
=
L""
;
CP_XML_ATTR
(
L"collapsed"
,
Context
.
get_table_context
().
state
()
.
group_row_
.
collapsed
);
CP_XML_ATTR
(
L"collapsed"
,
Context
.
get_table_context
().
state
()
->
group_row_
.
collapsed
);
CP_XML_ATTR
(
L"outlineLevel"
,
Context
.
get_table_context
().
state
()
.
group_row_
.
level
);
CP_XML_ATTR
(
L"outlineLevel"
,
Context
.
get_table_context
().
state
()
->
group_row_
.
level
);
CP_XML_ATTR
(
L"spans"
,
str_spans
);
CP_XML_ATTR
(
L"spans"
,
str_spans
);
if
(
Context
.
get_table_context
().
state
()
.
group_row_
.
collapsed
)
hidden
=
false
;
if
(
Context
.
get_table_context
().
state
()
->
group_row_
.
collapsed
)
hidden
=
false
;
Context
.
get_table_context
().
state
()
.
group_row_
.
count
--
;
Context
.
get_table_context
().
state
()
->
group_row_
.
count
--
;
if
(
Context
.
get_table_context
().
state
()
.
group_row_
.
count
<
1
)
if
(
Context
.
get_table_context
().
state
()
->
group_row_
.
count
<
1
)
Context
.
get_table_context
().
state
()
.
group_row_
.
enabled
=
false
;
Context
.
get_table_context
().
state
()
->
group_row_
.
enabled
=
false
;
}
}
if
(
hidden
)
if
(
hidden
)
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CF12.cpp
View file @
0c0f2cf9
...
@@ -126,6 +126,7 @@ int CF12::serialize(std::wostream & stream)
...
@@ -126,6 +126,7 @@ int CF12::serialize(std::wostream & stream)
CP_XML_NODE
(
L"dataBar"
)
CP_XML_NODE
(
L"dataBar"
)
{
{
//todooo cfvo = num - db1 & db2
CP_XML_NODE
(
L"cfvo"
)
CP_XML_NODE
(
L"cfvo"
)
{
{
if
(
dataBar
->
iPercentMin
>
0
)
if
(
dataBar
->
iPercentMin
>
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment