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
2c46ec31
Commit
2c46ec31
authored
Oct 20, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatWriter, RtfFormatWriter
parent
9de7b943
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
290 additions
and
208 deletions
+290
-208
ASCOfficeOdfFileW/source/OdfFormat/odf_chart_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_chart_context.cpp
+43
-16
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
+34
-23
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.h
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.h
+1
-0
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.cpp
+48
-38
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.h
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.h
+46
-48
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.cpp
...fficeOdfFileW/source/OdfFormat/odt_conversion_context.cpp
+26
-17
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
+43
-27
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
...le/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
+19
-13
ASCOfficeXlsFile2/ASCOfficeXlsFileTest/ASCOfficeXlsFileTest.vcproj
...XlsFile2/ASCOfficeXlsFileTest/ASCOfficeXlsFileTest.vcproj
+9
-8
ASCOfficeXlsFile2/win32/ASCOfficeXlsFile2.sln
ASCOfficeXlsFile2/win32/ASCOfficeXlsFile2.sln
+21
-18
No files found.
ASCOfficeOdfFileW/source/OdfFormat/odf_chart_context.cpp
View file @
2c46ec31
...
...
@@ -1528,9 +1528,6 @@ void odf_chart_context::set_cash(std::wstring format, std::vector<std::wstring>
if
(
refs
.
size
()
<
1
)
return
;
utils
::
parsing_ref
(
refs
[
0
],
col1
,
row1
);
int
count_cols
=
col2
-
col1
;
int
count_rows
=
row2
-
row1
;
if
(
refs
.
size
()
>
1
)
{
utils
::
parsing_ref
(
refs
[
1
],
col2
,
row2
);
...
...
@@ -1539,11 +1536,14 @@ void odf_chart_context::set_cash(std::wstring format, std::vector<std::wstring>
{
col2
=
col1
;
row2
=
row1
;
}
int
count_cols
=
col2
-
col1
;
int
count_rows
=
row2
-
row1
;
if
(
count_cols
==
0
)
{
start_col
=
col2
;
start_row
=
row1
;
count_cash_values
=
count_rows
;
count_cash_values
=
count_rows
+
1
;
}
else
{
...
...
@@ -1551,7 +1551,7 @@ void odf_chart_context::set_cash(std::wstring format, std::vector<std::wstring>
start_row
=
row2
;
by_row
=
false
;
count_cash_values
=
count_cols
;
count_cash_values
=
count_cols
+
1
;
}
if
(
data_str
.
empty
())
{
...
...
@@ -1611,13 +1611,13 @@ struct _sort_cells
bool
operator
()
(
_cell_cash
i
,
_cell_cash
j
)
{
if
(
i
.
row
==
j
.
row
)
return
(
i
.
col
<
j
.
col
);
return
(
i
.
col
<
j
.
col
);
else
return
(
i
.
row
<
j
.
row
);
return
(
i
.
row
<
j
.
row
);
}
}
sort_cells
;
int
odf_chart_context
::
Impl
::
create_local_table_rows
(
int
curr_row
,
ods_table_state
*
table_state
,
std
::
vector
<
_cell_cash
>
&
cells
,
bool
header
)
int
odf_chart_context
::
Impl
::
create_local_table_rows
(
int
curr_row
,
ods_table_state
*
table_state
,
std
::
vector
<
_cell_cash
>
&
cells
,
bool
header
)
{
int
curr_cell
=
0
;
...
...
@@ -1631,6 +1631,7 @@ int odf_chart_context::Impl::create_local_table_rows(int curr_row, ods_table_sta
continue
;
add
=
false
;
if
(
cells
[
i
].
row
>
curr_row
+
1
&&
!
header
)
{
office_element_ptr
row_elm
;
...
...
@@ -1645,17 +1646,13 @@ int odf_chart_context::Impl::create_local_table_rows(int curr_row, ods_table_sta
curr_row
=
cells
[
i
].
row
-
1
;
add
=
true
;
}
if
(
cells
[
i
].
row
==
curr_row
+
1
)
{
if
(
!
add
)
while
(
cells
[
i
].
row
>=
curr_row
+
1
)
{
office_element_ptr
row_elm
;
create_element
(
L"table"
,
L"table-row"
,
row_elm
,
odf_context_
);
table_state
->
add_row
(
row_elm
,
1
,
style_null
);
}
curr_row
++
;
curr_cell
=
0
;
}
...
...
@@ -1824,6 +1821,36 @@ void odf_chart_context::Impl::create_local_table()
int
current_row
=
0
;
if
(
cells_cash_label
.
size
()
>
0
||
cells_cash
.
size
()
>
0
)
{
int
min_row
=
1
,
r1
=
1
,
r2
=
1
;
int
min_col
=
1
,
c1
=
1
,
c2
=
1
;
if
(
cells_cash_label
.
size
()
>
0
)
{
r1
=
cells_cash_label
[
0
].
row
;
c1
=
cells_cash_label
[
0
].
col
;
}
if
(
cells_cash
.
size
()
>
0
)
{
r2
=
cells_cash
[
0
].
row
;
c2
=
cells_cash
[
0
].
col
;
}
if
((
std
::
min
)(
r1
,
r2
)
>
min_row
)
min_row
=
(
std
::
min
)(
r1
,
r2
);
if
((
std
::
min
)(
c1
,
c2
)
>
min_col
)
min_col
=
(
std
::
min
)(
c1
,
c2
);
for
(
int
i
=
0
;
i
<
cells_cash_label
.
size
();
i
++
)
{
cells_cash_label
[
i
].
row
-=
min_row
-
1
;
cells_cash_label
[
i
].
col
-=
min_col
-
1
;
}
for
(
int
i
=
0
;
i
<
cells_cash
.
size
();
i
++
)
{
cells_cash
[
i
].
row
-=
min_row
-
1
;
cells_cash
[
i
].
col
-=
min_col
-
1
;
}
}
if
(
cells_cash_label
.
size
()
>
0
||
cells_cash
.
size
()
>
0
)
{
if
(
cells_cash_label
.
size
()
>
0
&&
row_header
)
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
View file @
2c46ec31
...
...
@@ -189,6 +189,7 @@ struct odf_drawing_state
oox_shape_preset
=
-
1
;
in_group
=
false
;
text_box_tableframe
=
false
;
flipH
=
flipV
=
false
;
...
...
@@ -217,6 +218,7 @@ struct odf_drawing_state
///////////////////////
int
oox_shape_preset
;
bool
in_group
;
bool
text_box_tableframe
;
};
class
odf_drawing_context
::
Impl
...
...
@@ -683,8 +685,9 @@ void odf_drawing_context::start_shape(int type)
bool
odf_drawing_context
::
change_text_box_2_wordart
()
{
if
(
impl_
->
current_drawing_state_
.
oox_shape_preset
>
2000
&&
impl_
->
current_drawing_state_
.
oox_shape_preset
<
3000
)
return
tru
e
;
return
fals
e
;
if
(
impl_
->
current_drawing_state_
.
text_box_tableframe
)
return
false
;
if
(
impl_
->
current_drawing_state_
.
elements_
.
empty
())
return
false
;
draw_text_box
*
t
=
dynamic_cast
<
draw_text_box
*>
(
impl_
->
current_drawing_state_
.
elements_
.
back
().
elm
.
get
());
...
...
@@ -693,7 +696,7 @@ bool odf_drawing_context::change_text_box_2_wordart()
office_element_ptr
draw_elm
=
impl_
->
create_draw_element
(
7
);
draw_base
*
draw
=
dynamic_cast
<
draw_base
*>
(
draw_elm
.
get
());
if
(
draw
==
NULL
)
return
false
;
if
(
draw
==
NULL
)
return
false
;
int
sz
=
impl_
->
current_level_
.
size
();
if
(
sz
<
2
)
return
false
;
...
...
@@ -1938,7 +1941,13 @@ void odf_drawing_context::set_text_box_min_size(double w_pt, double h_pt)
}
}
void
odf_drawing_context
::
set_text_box_tableframe
(
bool
val
)
{
if
(
impl_
->
current_drawing_state_
.
elements_
.
empty
())
return
;
impl_
->
current_drawing_state_
.
text_box_tableframe
=
val
;
}
void
odf_drawing_context
::
set_text_box_parent_style
(
std
::
wstring
style_name
)
{
if
(
impl_
->
current_drawing_state_
.
elements_
.
empty
())
return
;
...
...
@@ -1973,6 +1982,8 @@ void odf_drawing_context::end_text_box()
draw_text_box
*
draw
=
dynamic_cast
<
draw_text_box
*>
(
impl_
->
current_drawing_state_
.
elements_
.
back
().
elm
.
get
());
if
(
!
draw
)
return
;
if
(
!
draw
->
draw_text_box_attlist_
.
fo_min_height_
)
{
draw
->
draw_text_box_attlist_
.
fo_min_height_
=
impl_
->
current_drawing_state_
.
svg_height_
;
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.h
View file @
2c46ec31
...
...
@@ -122,6 +122,7 @@ public:
void
set_text_box_min_size
(
bool
val
);
void
set_text_box_min_size
(
double
w_pt
,
double
h_pt
);
void
set_text_box_parent_style
(
std
::
wstring
style_name
);
void
set_text_box_tableframe
(
bool
val
);
void
end_text_box
();
void
start_object
(
std
::
wstring
name
);
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.cpp
View file @
2c46ec31
...
...
@@ -66,9 +66,7 @@ odf_text_context::odf_text_context(odf_conversion_context *odf_context)
current_outline_
=
0
;
in_field_
=
false
;
keep_next_paragraph_
=
false
;
list_state_
.
started_list
=
false
;
}
odf_text_context
::~
odf_text_context
()
...
...
@@ -98,9 +96,9 @@ odf_style_context* odf_text_context::get_styles_context()
{
return
styles_context_
;
}
void
odf_text_context
::
set_single_object
(
bool
val
,
style_paragraph_properties
*
para_props
,
style_text_properties
*
text_props
)
void
odf_text_context
::
set_single_object
(
bool
bSingle
,
style_paragraph_properties
*
para_props
,
style_text_properties
*
text_props
)
{
single_paragraph_
=
val
;
single_paragraph_
=
bSingle
;
paragraph_properties_
=
para_props
;
text_properties_
=
text_props
;
...
...
@@ -198,14 +196,14 @@ void odf_text_context::start_paragraph(bool styled)
office_element_ptr
paragr_elm
;
if
(
current_outline_
>
0
)
{
create_element
(
L"text"
,
L"h"
,
paragr_elm
,
odf_context_
);
create_element
(
L"text"
,
L"h"
,
paragr_elm
,
odf_context_
);
text_h
*
h
=
dynamic_cast
<
text_h
*>
(
paragr_elm
.
get
());
if
(
h
)
h
->
text_outline_level_
=
current_outline_
+
1
;
if
(
h
)
h
->
text_outline_level_
=
current_outline_
+
1
;
}
else
{
create_element
(
L"text"
,
L"p"
,
paragr_elm
,
odf_context_
);
create_element
(
L"text"
,
L"p"
,
paragr_elm
,
odf_context_
);
}
current_outline_
=
0
;
...
...
@@ -216,7 +214,7 @@ void odf_text_context::start_paragraph(office_element_ptr & elm, bool styled)
{
int
level
=
current_level_
.
size
();
if
(
single_paragraph_
&&
level
>
0
)
if
(
single_paragraph_
&&
level
>
0
)
{
std
::
wstring
str_enter
(
L"
\n
"
);
add_text_content
(
str_enter
);
...
...
@@ -237,10 +235,10 @@ void odf_text_context::start_paragraph(office_element_ptr & elm, bool styled)
}
text_p
*
p
=
dynamic_cast
<
text_p
*>
(
elm
.
get
());
if
(
p
)
p
->
paragraph_
.
paragraph_attrs_
.
text_style_name_
=
style_ref
(
style_name
);
if
(
p
)
p
->
paragraph_
.
paragraph_attrs_
.
text_style_name_
=
style_ref
(
style_name
);
text_h
*
h
=
dynamic_cast
<
text_h
*>
(
elm
.
get
());
if
(
h
)
h
->
paragraph_
.
paragraph_attrs_
.
text_style_name_
=
style_ref
(
style_name
);
if
(
h
)
h
->
paragraph_
.
paragraph_attrs_
.
text_style_name_
=
style_ref
(
style_name
);
style
*
style_
=
dynamic_cast
<
style
*>
(
style_elm
.
get
());
if
(
style_
)
...
...
@@ -344,7 +342,7 @@ void odf_text_context::start_span(bool styled)
}
}
odf_element_state
state
=
{
span_elm
,
style_name
,
style_elm
,
level
};
odf_element_state
state
=
{
span_elm
,
style_name
,
style_elm
,
level
};
text_elements_list_
.
push_back
(
state
);
...
...
@@ -595,6 +593,18 @@ void odf_text_context::set_type_break(int type, int clear)
}
bool
odf_text_context
::
set_master_page_name
(
std
::
wstring
&
master_page_name
)
{
if
(
current_level_
.
empty
())
return
false
;
style
*
style_
=
dynamic_cast
<
style
*>
(
current_level_
.
back
().
style_elm
.
get
());
if
(
!
style_
)
return
false
;
style_
->
style_master_page_name_
=
master_page_name
;
return
true
;
}
void
odf_text_context
::
set_parent_paragraph_style
(
std
::
wstring
&
style_name
)
{
parent_paragraph_style_
=
style_name
;
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.h
View file @
2c46ec31
...
...
@@ -35,9 +35,6 @@
#include <vector>
#include "odf_page_layout_state.h"
//#include "ods_drawing_context.h"
//#include "ods_comments_context.h"
//#include "ods_hyperlinks.h"
#include "office_elements_create.h"
...
...
@@ -59,65 +56,67 @@ public:
odf_text_context
(
odf_conversion_context
*
odf_context
);
~
odf_text_context
();
public:
void
clear_params
();
void
set_styles_context
(
odf_style_context
*
styles_context
);
//для embedded
odf_style_context
*
get_styles_context
();
//для embedded
void
set_styles_context
(
odf_style_context
*
styles_context
);
//для embedded
void
clear_params
();
void
add_text_style
(
office_element_ptr
&
style_elm
,
std
::
wstring
style_name
);
void
add_text_style
(
office_element_ptr
&
style_elm
,
std
::
wstring
style_name
);
void
set_single_object
(
bool
val
,
style_paragraph_properties
*
para_props
,
style_text_properties
*
text_props
);
void
set_single_object
(
bool
bSingle
,
style_paragraph_properties
*
para_props
,
style_text_properties
*
text_props
);
void
add_text_content
(
const
std
::
wstring
&
text
);
void
add_text_space
(
int
count
);
void
add_text_content
(
const
std
::
wstring
&
text
);
void
add_text_space
(
int
count
);
void
set_symbol_font
(
const
std
::
wstring
&
font
);
void
set_symbol_text
(
int
sym
);
void
set_symbol_font
(
const
std
::
wstring
&
font
);
void
set_symbol_text
(
int
sym
);
void
start_paragraph
(
bool
styled
=
false
);
void
start_paragraph
(
office_element_ptr
&
elm
,
bool
styled
=
false
);
void
end_paragraph
();
void
start_paragraph
(
bool
styled
=
false
);
void
start_paragraph
(
office_element_ptr
&
elm
,
bool
styled
=
false
);
void
end_paragraph
();
void
start_element
(
office_element_ptr
&
elm
,
office_element_ptr
style_elm
=
office_element_ptr
(),
std
::
wstring
style_name
=
L""
);
void
end_element
();
void
start_element
(
office_element_ptr
&
elm
,
office_element_ptr
style_elm
=
office_element_ptr
(),
std
::
wstring
style_name
=
L""
);
void
end_element
();
void
start_field
(
int
type
);
void
end_field
();
void
start_field
(
int
type
);
void
end_field
();
void
start_span
(
bool
styled
=
false
);
void
end_span
();
void
end_span
();
void
start_list_item
();
void
end_list_item
();
void
start_list_item
();
void
end_list_item
();
void
start_list
(
std
::
wstring
style_name
);
void
end_list
();
void
start_list
(
std
::
wstring
style_name
);
void
end_list
();
bool
is_need_break
(){
return
bool
(
need_break_
);}
void
set_type_break
(
int
type
,
int
clear
);
bool
is_need_break
(){
return
bool
(
need_break_
);}
void
set_type_break
(
int
type
,
int
clear
);
void
save_property_break
();
void
add_tab
();
int
current_outline_
;
bool
in_field_
;
std
::
vector
<
odf_element_state
>
current_level_
;
//постоянно меняющийся список уровней наследования
std
::
vector
<
odf_element_state
>
text_elements_list_
;
//параграфы, списки , ...
void
set_parent_paragraph_style
(
std
::
wstring
&
style_name
);
void
set_parent_span_style
(
std
::
wstring
&
style_name
);
style_text_properties
*
get_text_properties
(){
return
text_properties_
;}
style_paragraph_properties
*
get_paragraph_properties
(){
return
paragraph_properties_
;}
bool
set_master_page_name
(
std
::
wstring
&
master_page_name
);
style_text_properties
*
get_text_properties
()
{
return
text_properties_
;}
style_paragraph_properties
*
get_paragraph_properties
()
{
return
paragraph_properties_
;}
void
set_outline_level
(
int
level
);
void
set_outline_level
(
int
level
);
bool
get_KeepNextParagraph
()
{
return
keep_next_paragraph_
;}
void
set_KeepNextParagraph
(
bool
val
)
{
keep_next_paragraph_
=
val
;}
bool
get_KeepNextParagraph
()
{
return
keep_next_paragraph_
;}
void
set_KeepNextParagraph
(
bool
val
)
{
keep_next_paragraph_
=
val
;}
bool
get_list_item_state
()
{
return
list_state_
.
levels
.
size
()
>
0
?
list_state_
.
levels
.
back
()
:
false
;}
bool
get_list_item_state
()
{
return
list_state_
.
levels
.
size
()
>
0
?
list_state_
.
levels
.
back
()
:
false
;}
//------------------------------------------------------------------------------------
int
current_outline_
;
bool
in_field_
;
std
::
vector
<
odf_element_state
>
current_level_
;
//постоянно меняющийся список уровней наследования
std
::
vector
<
odf_element_state
>
text_elements_list_
;
//параграфы, списки , ...
struct
_list_state
{
bool
started_list
;
...
...
@@ -126,15 +125,14 @@ public:
}
list_state_
;
private:
bool
keep_next_paragraph_
;
bool
single_paragraph_
;
_CP_OPT
(
odf_types
::
fo_break
)
need_break_
;
bool
single_paragraph_
;
style_paragraph_properties
*
paragraph_properties_
;
//хранилка-опознавалка что свойства приписаны другому, не текстовому, объекту
style_text_properties
*
text_properties_
;
//хранилка-опознавалка что свойства приписаны другому, не текстовому, объекту
style_paragraph_properties
*
paragraph_properties_
;
//хранилка-опознавалка что свойства приписаны другому, не текстовому, объекту
style_text_properties
*
text_properties_
;
//хранилка-опознавалка что свойства приписаны другому, не текстовому, объекту
odf_style_context
*
styles_context_
;
odf_style_context
*
styles_context_
;
odf_conversion_context
*
odf_context_
;
std
::
wstring
parent_span_style_
;
...
...
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.cpp
View file @
2c46ec31
...
...
@@ -272,6 +272,12 @@ void odt_conversion_context::end_drawings()
}
void
odt_conversion_context
::
start_paragraph
(
bool
styled
)
{
if
(
is_paragraph_in_current_section_
&&
!
styled
)
{
styles_context
()
->
create_style
(
L""
,
odf_types
::
style_family
::
Paragraph
,
true
,
false
,
-
1
);
styled
=
true
;
}
text_context
()
->
start_paragraph
(
styled
);
add_to_root
();
...
...
@@ -281,7 +287,7 @@ void odt_conversion_context::add_page_break()
office_element_ptr
elm
;
create_element
(
L"text"
,
L"soft-page-break"
,
elm
,
this
);
if
(
current_root_elements_
.
size
()
>
0
/* && text_context()->is_need_break()*/
)
if
(
current_root_elements_
.
size
()
>
0
/* && text_context()->is_need_break()*/
)
{
text_p
*
para
=
NULL
;
style
*
style_
=
NULL
;
...
...
@@ -424,15 +430,17 @@ void odt_conversion_context::set_master_page_name(std::wstring master_name)
}
style
*
style_
=
dynamic_cast
<
style
*>
(
current_root_elements_
.
back
().
style_elm
.
get
());
if
(
!
style_
)
{
//генерация
}
if
(
style_
)
{
is_paragraph_in_current_section_
=
false
;
style_
->
style_master_page_name_
=
master_name
;
}
else
{
if
(
text_context
()
->
set_master_page_name
(
master_name
))
is_paragraph_in_current_section_
=
false
;
}
}
int
odt_conversion_context
::
get_current_section_columns
()
{
...
...
@@ -443,12 +451,13 @@ int odt_conversion_context::get_current_section_columns()
void
odt_conversion_context
::
add_section
(
bool
continuous
)
{
odt_section_state
state
;
state
.
empty
=
true
;
state
.
continuous
=
continuous
;
//----------------------------------------------------------------
styles_context
()
->
create_style
(
L""
,
odf_types
::
style_family
::
Section
,
true
,
false
,
-
1
);
styles_context
()
->
create_style
(
L""
,
odf_types
::
style_family
::
Section
,
true
,
false
,
-
1
);
create_element
(
L"text"
,
L"section"
,
state
.
elm
,
this
);
create_element
(
L"text"
,
L"section"
,
state
.
elm
,
this
);
state
.
style_elm
=
styles_context
()
->
last_state
()
->
get_office_element
();
state
.
style_name
=
styles_context
()
->
last_state
()
->
get_name
();
...
...
@@ -457,7 +466,7 @@ void odt_conversion_context::add_section(bool continuous)
sections_
.
push_back
(
state
);
}
void
odt_conversion_context
::
add_section_columns
(
int
count
,
double
space_pt
,
bool
separator
)
void
odt_conversion_context
::
add_section_columns
(
int
count
,
double
space_pt
,
bool
separator
)
{
if
(
sections_
.
size
()
<
1
||
count
<
1
)
return
;
...
...
@@ -624,7 +633,7 @@ void odt_conversion_context::flush_section()
{
for
(
long
i
=
0
;
i
<
current_root_elements_
.
size
();
i
++
)
{
if
((
sections_
.
back
().
continuous
&&
i
<
2
)
||
!
sections_
.
back
().
continuous
)
if
((
sections_
.
back
().
continuous
&&
i
<
2
)
||
!
sections_
.
back
().
continuous
)
// при вставлении параграфа возможен искусственный разрыв в параграфах - см add_page_break
{
text_soft_page_break
*
break_
=
dynamic_cast
<
text_soft_page_break
*>
(
current_root_elements_
[
i
].
elm
.
get
());
...
...
@@ -647,7 +656,7 @@ void odt_conversion_context::flush_section()
}
current_root_elements_
.
clear
();
sections_
.
back
().
empty
=
false
;
//
sections_.back().empty = false;
}
}
void
odt_conversion_context
::
start_run
(
bool
styled
)
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
View file @
2c46ec31
...
...
@@ -230,7 +230,6 @@ void DocxConverter::convert_document()
for
(
int
sect
=
0
;
sect
<
sections
.
size
();
sect
++
)
{
current_section_properties
=
&
sections
[
sect
];
//convert(sections[sect].props, sections[sect].root);
for
(
long
i
=
sections
[
sect
].
start_para
;
i
<
sections
[
sect
].
end_para
;
i
++
)
{
...
...
@@ -456,7 +455,7 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph)
{
paragraph_properties
=
state
->
get_paragraph_properties
();
if
(
oox_paragraph
->
m_oParagraphProperty
->
m_oPStyle
.
IsInit
()
&&
oox_paragraph
->
m_oParagraphProperty
->
m_oPStyle
->
m_sVal
.
IsInit
())
if
(
oox_paragraph
->
m_oParagraphProperty
&&
oox_paragraph
->
m_oParagraphProperty
->
m_oPStyle
.
IsInit
()
&&
oox_paragraph
->
m_oParagraphProperty
->
m_oPStyle
->
m_sVal
.
IsInit
())
{
//перезатираем все свойства ... наложение не катит -- ваще то надо чистить после буквицы (Nadpis.docx) .. проверить надобность с остальными случами
paragraph_properties
->
content
().
clear
();
...
...
@@ -492,8 +491,6 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph)
if
(
bStartNewParagraph
)
{
if
(
odt_context
->
is_paragraph_in_current_section_
)
bStyled
=
true
;
odt_context
->
start_paragraph
(
bStyled
);
if
(
odt_context
->
is_paragraph_in_current_section_
)
...
...
@@ -532,15 +529,16 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph)
void
DocxConverter
::
convert
(
OOX
::
Logic
::
CRun
*
oox_run
)
//wordprocessing 22.1.2.87 math 17.3.2.25
{
if
(
oox_run
==
NULL
)
return
;
//test for break - 2 first element ЭТОТ элемент НУЖНО вытащить отдельно !!!
for
(
unsigned
int
i
=
0
;
i
<
(
std
::
min
)
(
(
size_t
)
2
,
oox_run
->
m_arrItems
.
size
());
++
i
)
{
if
(
oox_run
->
m_arrItems
[
i
]
->
getType
()
==
OOX
::
et_w_lastRenderedPageBreak
)
{
odt_context
->
add_page_break
();
}
}
//хм разобраться а нужен ли он ... частенько бывает в неправильном месте!!! - A GRUBU.docx
//https://forums.asp.net/t/1951556.aspx?Facing+problem+finding+out+page+end+in+Ms+Word+Open+XML+SDK+Asp+net+c+We+can+t+get+a+lastRenderedPageBreak
////test for break - 2 first element ЭТОТ элемент НУЖНО вытащить отдельно !!!
//for(unsigned int i = 0; i < (std::min) ( (size_t)2, oox_run->m_arrItems.size()); ++i)
//{
// if (oox_run->m_arrItems[i]->getType() == OOX::et_w_lastRenderedPageBreak)
// {
// odt_context->add_page_break();
// }
//}
bool
styled
=
false
;
if
(
oox_run
->
m_oRunProperty
)
{
...
...
@@ -867,7 +865,7 @@ void DocxConverter::convert(OOX::Logic::CParagraphProperty *oox_paragraph_pr, cp
if
(
current_section_properties
)
{
if
((
current_section_properties
->
props
->
m_oPgNumType
.
IsInit
())
&&
(
current_section_properties
->
props
->
m_oPgNumType
->
m_oStart
.
IsInit
()))
if
((
current_section_properties
->
props
)
&&
(
current_section_properties
->
props
->
m_oPgNumType
.
IsInit
())
&&
(
current_section_properties
->
props
->
m_oPgNumType
->
m_oStart
.
IsInit
()))
{
paragraph_properties
->
content
().
style_page_number_
=
current_section_properties
->
props
->
m_oPgNumType
->
m_oStart
->
GetValue
();
}
...
...
@@ -1195,7 +1193,6 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
//--------------------------------------------------------------------------------------------------------------------------------------------
// то что относится собственно к секциям-разделам
//if (!root)odt_context->add_section(continuous);
//nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oBidi;
//nullable<ComplexTypes::Word::CDocGrid > m_oDocGrid;
...
...
@@ -1223,6 +1220,7 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
if
(
/*num_columns != odt_context->get_current_section_columns() || */
num_columns
>=
1
)
//колонки
{
if
(
!
root
||
num_columns
>
1
)
odt_context
->
add_section
(
continuous
);
if
(
oox_section_pr
->
m_oCols
.
IsInit
())
...
...
@@ -1256,8 +1254,6 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
//}
odt_context
->
add_section_column
(
width_space
);
}
if
(
root
)
odt_context
->
flush_section
();
}
}
void
DocxConverter
::
convert
(
OOX
::
Logic
::
CBackground
*
oox_background
,
int
type
)
...
...
@@ -1654,17 +1650,27 @@ void DocxConverter::convert(OOX::Logic::CRunProperty *oox_run_pr, odf_writer::st
text_properties
->
content
().
fo_font_weight_
=
odf_types
::
font_weight
(
odf_types
::
font_weight
::
WNormal
);
}
bool
set_color
=
false
;
if
(
oox_run_pr
->
m_oGradFill
.
IsInit
())
{
bool
res
=
odf_context
()
->
drawing_context
()
->
change_text_box_2_wordart
();
odf_writer
::
odf_drawing_context
*
drawing_context
=
odf_context
()
->
drawing_context
();
if
(
drawing_context
)
{
if
(
odf_context
()
->
drawing_context
()
->
change_text_box_2_wordart
())
{
odf_context
()
->
drawing_context
()
->
start_area_properties
();
{
OoxConverter
::
convert
(
oox_run_pr
->
m_oGradFill
.
GetPointer
(),
NULL
);
}
odf_context
()
->
drawing_context
()
->
end_area_properties
();
set_color
=
true
;
}
}
else
if
(
oox_run_pr
->
m_oColor
.
IsInit
())
else
{}
//обычный текст .. градиент по телу абзаца (
}
if
(
!
set_color
&&
oox_run_pr
->
m_oColor
.
IsInit
())
{
if
(
oox_run_pr
->
m_oColor
->
m_oVal
.
IsInit
()
&&
oox_run_pr
->
m_oColor
->
m_oVal
->
GetValue
()
==
SimpleTypes
::
hexcolorAuto
)
text_properties
->
content
().
fo_color_
=
odf_types
::
color
(
L"#000000"
);
...
...
@@ -3506,7 +3512,16 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
if
(
in_frame
)
{
if
(
current_section_properties
)
convert
(
current_section_properties
->
props
,
current_section_properties
->
root
);
odt_context
->
start_paragraph
();
if
(
odt_context
->
is_paragraph_in_current_section_
)
{
odt_context
->
set_master_page_name
(
odt_context
->
page_layout_context
()
->
last_master
()
?
odt_context
->
page_layout_context
()
->
last_master
()
->
get_name
()
:
L""
);
}
odt_context
->
start_drawings
();
_CP_OPT
(
double
)
width
,
height
,
x
,
y
;
...
...
@@ -3566,6 +3581,7 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
odt_context
->
drawing_context
()
->
start_drawing
();
odt_context
->
drawing_context
()
->
start_text_box
();
odt_context
->
drawing_context
()
->
set_text_box_tableframe
(
true
);
odt_context
->
drawing_context
()
->
set_text_box_min_size
(
0
,
1.
);
odt_context
->
drawing_context
()
->
set_z_order
(
0x7fffffff
-
1
);
odt_context
->
drawing_context
()
->
set_text_box_parent_style
(
L"Frame"
);
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
View file @
2c46ec31
...
...
@@ -78,21 +78,27 @@ bool OOXPictureGraphicReader::Parse( ReaderParameter oParam , RtfShape& oOutput)
}
}
}
if
(
!
bTryPicture
)
{
//return false;
//рисуем крест (todooo получать с редактора реплейсмент картинку)
oOutput
.
m_nShapeType
=
1
;
oOutput
.
m_nFillColor
=
0x967bdf
;
}
}
else
if
(
!
bTryPicture
)
{
//return false;
//convertDrawingML2Vml();
//рисуем "крест" (todooo получать с редактора реплейсмент картинку)
oOutput
.
m_nShapeType
=
1
;
oOutput
.
m_nFillColor
=
0x967bdf
;
oOutput
.
m_bFilled
=
0
;
oOutput
.
m_bLine
=
1
;
oOutput
.
m_aTextItems
=
TextItemContainerPtr
(
new
TextItemContainer
()
);
RtfParagraphPtr
oParagraph
(
new
RtfParagraph
()
);
oParagraph
->
m_oProperty
=
oParam
.
oRtf
->
m_oDefaultParagraphProp
;
oParagraph
->
m_oProperty
.
m_oCharProperty
=
oParam
.
oRtf
->
m_oDefaultCharProp
;
oParagraph
->
m_oProperty
.
m_nItap
=
0
;
RtfCharPtr
oChar
(
new
RtfChar
()
);
oChar
->
m_oProperty
=
oParam
.
oRtf
->
m_oDefaultCharProp
;
oChar
->
setText
(
L"The element is not supported in RTF format."
);
oParagraph
->
AddItem
(
oChar
);
oOutput
.
m_aTextItems
->
AddItem
(
oParagraph
);
}
return
true
;
}
...
...
ASCOfficeXlsFile2/ASCOfficeXlsFileTest/ASCOfficeXlsFileTest.vcproj
View file @
2c46ec31
...
...
@@ -48,6 +48,7 @@
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"3"
UsePrecompiledHeader=
"0"
ProgramDataBaseFileName=
"$(IntDir)\XlsFileTestD.pdb"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"true"
DebugInformationFormat=
"4"
...
...
@@ -353,14 +354,6 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=
"..\..\Common\3dParty\icu\win_32\lib\icudt.lib"
>
</File>
<File
RelativePath=
"..\..\Common\3dParty\icu\win_32\lib\icuuc.lib"
>
</File>
<File
RelativePath=
"..\..\UnicodeConverter\UnicodeConverter.cpp"
>
...
...
@@ -374,6 +367,14 @@
</FileConfiguration>
</File>
</Filter>
<File
RelativePath=
"..\..\build\bin\icu\win_32\icudt.lib"
>
</File>
<File
RelativePath=
"..\..\build\bin\icu\win_32\icuuc.lib"
>
</File>
</Files>
<Globals>
</Globals>
...
...
ASCOfficeXlsFile2/win32/ASCOfficeXlsFile2.sln
View file @
2c46ec31
...
...
@@ -7,43 +7,46 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsFormat", "..\source\win3
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsXlsxConverter", "..\source\win32\XlsXlsxConverter.vcproj", "{CBEDD0D1-10A8-45C1-AF81-8492F40964CA}"
ProjectSection(ProjectDependencies) = postProject
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF} = {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C} = {C27E9A9F-3A17-4482-9C5F-BF15C01E747C}
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} = {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeXlsFileTest", "..\ASCOfficeXlsFileTest\ASCOfficeXlsFileTest.vcproj", "{C2882DDD-07E6-4314-AD4B-48F43F38D722}"
ProjectSection(ProjectDependencies) = postProject
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} = {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}
{CBEDD0D1-10A8-45C1-AF81-8492F40964CA} = {CBEDD0D1-10A8-45C1-AF81-8492F40964CA}
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}"
ProjectSection(ProjectDependencies) = postProject
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raster", "..\..\DesktopEditor\raster\raster_vs2005.vcproj", "{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}"
ProjectSection(ProjectDependencies) = postProject
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cximage", "..\..\DesktopEditor\cximage\CxImage\cximage_vs2005.vcproj", "{BC52A07C-A797-423D-8C4F-8678805BBB36}"
ProjectSection(ProjectDependencies) = postProject
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\DesktopEditor\cximage\tiff\Tiff_vs2005.vcproj", "{0588563C-F05C-428C-B21A-DD74756628B3}"
...
...
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