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
925bca71
Commit
925bca71
authored
Aug 09, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatWriter - small refactoring, fix chart size (from xls)
parent
c9f23151
Changes
42
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
372 additions
and
395 deletions
+372
-395
ASCOfficeOdfFileW/source/OdfFormat/abstract_xml.cpp
ASCOfficeOdfFileW/source/OdfFormat/abstract_xml.cpp
+0
-2
ASCOfficeOdfFileW/source/OdfFormat/calcext_elements.cpp
ASCOfficeOdfFileW/source/OdfFormat/calcext_elements.cpp
+10
-12
ASCOfficeOdfFileW/source/OdfFormat/draw_base.cpp
ASCOfficeOdfFileW/source/OdfFormat/draw_base.cpp
+3
-4
ASCOfficeOdfFileW/source/OdfFormat/draw_frame.cpp
ASCOfficeOdfFileW/source/OdfFormat/draw_frame.cpp
+6
-7
ASCOfficeOdfFileW/source/OdfFormat/draw_shapes.cpp
ASCOfficeOdfFileW/source/OdfFormat/draw_shapes.cpp
+4
-5
ASCOfficeOdfFileW/source/OdfFormat/list.cpp
ASCOfficeOdfFileW/source/OdfFormat/list.cpp
+4
-6
ASCOfficeOdfFileW/source/OdfFormat/mediaitems.cpp
ASCOfficeOdfFileW/source/OdfFormat/mediaitems.cpp
+7
-9
ASCOfficeOdfFileW/source/OdfFormat/mediaitems_utils.cpp
ASCOfficeOdfFileW/source/OdfFormat/mediaitems_utils.cpp
+0
-1
ASCOfficeOdfFileW/source/OdfFormat/number_style.cpp
ASCOfficeOdfFileW/source/OdfFormat/number_style.cpp
+19
-22
ASCOfficeOdfFileW/source/OdfFormat/object_package.cpp
ASCOfficeOdfFileW/source/OdfFormat/object_package.cpp
+17
-17
ASCOfficeOdfFileW/source/OdfFormat/odf_chart_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_chart_context.cpp
+0
-1
ASCOfficeOdfFileW/source/OdfFormat/odf_comment_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_comment_context.cpp
+0
-1
ASCOfficeOdfFileW/source/OdfFormat/odf_conversion_context.cpp
...fficeOdfFileW/source/OdfFormat/odf_conversion_context.cpp
+5
-8
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
+0
-1
ASCOfficeOdfFileW/source/OdfFormat/odf_notes_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_notes_context.cpp
+0
-1
ASCOfficeOdfFileW/source/OdfFormat/odf_page_layout_context.cpp
...ficeOdfFileW/source/OdfFormat/odf_page_layout_context.cpp
+0
-1
ASCOfficeOdfFileW/source/OdfFormat/odf_rels.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_rels.cpp
+3
-6
ASCOfficeOdfFileW/source/OdfFormat/odf_style_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_style_context.cpp
+4
-5
ASCOfficeOdfFileW/source/OdfFormat/odf_table_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_table_context.cpp
+0
-2
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.cpp
+0
-1
ASCOfficeOdfFileW/source/OdfFormat/ods_table_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/ods_table_context.cpp
+0
-1
ASCOfficeOdfFileW/source/OdfFormat/office_annotation.cpp
ASCOfficeOdfFileW/source/OdfFormat/office_annotation.cpp
+4
-6
ASCOfficeOdfFileW/source/OdfFormat/office_body.cpp
ASCOfficeOdfFileW/source/OdfFormat/office_body.cpp
+0
-2
ASCOfficeOdfFileW/source/OdfFormat/office_chart.cpp
ASCOfficeOdfFileW/source/OdfFormat/office_chart.cpp
+10
-13
ASCOfficeOdfFileW/source/OdfFormat/office_settings.cpp
ASCOfficeOdfFileW/source/OdfFormat/office_settings.cpp
+10
-12
ASCOfficeOdfFileW/source/OdfFormat/office_spreadsheet.cpp
ASCOfficeOdfFileW/source/OdfFormat/office_spreadsheet.cpp
+2
-4
ASCOfficeOdfFileW/source/OdfFormat/office_text.cpp
ASCOfficeOdfFileW/source/OdfFormat/office_text.cpp
+0
-3
ASCOfficeOdfFileW/source/OdfFormat/paragraph_elements.cpp
ASCOfficeOdfFileW/source/OdfFormat/paragraph_elements.cpp
+20
-21
ASCOfficeOdfFileW/source/OdfFormat/style_page_layout_properties.cpp
...dfFileW/source/OdfFormat/style_page_layout_properties.cpp
+0
-1
ASCOfficeOdfFileW/source/OdfFormat/style_paragraph_properties.cpp
...eOdfFileW/source/OdfFormat/style_paragraph_properties.cpp
+3
-6
ASCOfficeOdfFileW/source/OdfFormat/style_section_properties.cpp
...iceOdfFileW/source/OdfFormat/style_section_properties.cpp
+3
-4
ASCOfficeOdfFileW/source/OdfFormat/styles.cpp
ASCOfficeOdfFileW/source/OdfFormat/styles.cpp
+42
-45
ASCOfficeOdfFileW/source/OdfFormat/table.cpp
ASCOfficeOdfFileW/source/OdfFormat/table.cpp
+43
-44
ASCOfficeOdfFileW/source/OdfFormat/table.h
ASCOfficeOdfFileW/source/OdfFormat/table.h
+7
-7
ASCOfficeOdfFileW/source/OdfFormat/text_elements.cpp
ASCOfficeOdfFileW/source/OdfFormat/text_elements.cpp
+10
-14
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
+0
-2
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
+48
-51
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.h
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.h
+0
-1
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
+0
-2
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.h
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.h
+0
-1
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
+87
-42
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.h
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.h
+1
-1
No files found.
ASCOfficeOdfFileW/source/OdfFormat/abstract_xml.cpp
View file @
925bca71
...
...
@@ -32,8 +32,6 @@
#include "abstract_xml.h"
#include <boost/foreach.hpp>
namespace
cpdoccore
{
namespace
odf_writer
{
...
...
ASCOfficeOdfFileW/source/OdfFormat/calcext_elements.cpp
View file @
925bca71
...
...
@@ -31,8 +31,6 @@
*/
#include "calcext_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
...
...
@@ -86,9 +84,9 @@ void calcext_conditional_formats::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
const
office_element_ptr
&
item
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
item
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -115,9 +113,9 @@ void calcext_conditional_format::serialize(std::wostream & _Wostream)
{
CP_XML_ATTR_OPT
(
L"calcext:target-range-address"
,
calcext_target_range_address_
);
BOOST_REVERSE_FOREACH
(
const
office_element_ptr
&
item
,
content_
)
for
(
size_t
i
=
content_
.
size
()
-
1
;
i
>=
0
;
i
--
)
{
item
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -144,9 +142,9 @@ void calcext_data_bar::serialize(std::wostream & _Wostream)
{
calcext_data_bar_attr_
.
serialize
(
CP_GET_XML_NODE
());
BOOST_FOREACH
(
const
office_element_ptr
&
item
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
item
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -170,9 +168,9 @@ void calcext_color_scale::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
const
office_element_ptr
&
item
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
item
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -198,9 +196,9 @@ void calcext_icon_set::serialize(std::wostream & _Wostream)
{
calcext_icon_set_attr_
.
serialize
(
CP_GET_XML_NODE
());
BOOST_FOREACH
(
const
office_element_ptr
&
item
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
item
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/draw_base.cpp
View file @
925bca71
...
...
@@ -36,7 +36,6 @@
#include <sstream>
#include <string>
#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <cpdoccore/xml/xmlchar.h>
...
...
@@ -68,11 +67,11 @@ void draw_base::add_child_element( const office_element_ptr & child_element)
{
content_
.
push_back
(
child_element
);
}
void
draw_base
::
serialize
(
std
::
wostream
&
_Wostrea
m
)
void
draw_base
::
serialize
(
std
::
wostream
&
str
m
)
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
_Wostrea
m
);
content_
[
i
]
->
serialize
(
str
m
);
}
}
void
draw_base
::
serialize_attlist
(
CP_ATTR_NODE
)
...
...
ASCOfficeOdfFileW/source/OdfFormat/draw_frame.cpp
View file @
925bca71
...
...
@@ -36,7 +36,6 @@
#include <sstream>
#include <string>
#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/regex.h>
...
...
@@ -88,9 +87,9 @@ void draw_image::serialize(std::wostream & _Wostream)
if
(
office_binary_data_
)
office_binary_data_
->
serialize
(
CP_XML_STREAM
());
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -136,9 +135,9 @@ void draw_chart::serialize(std::wostream & _Wostream)
draw_chart_attlist_
.
serialize
(
CP_GET_XML_NODE
());
common_xlink_attlist_
.
serialize
(
CP_GET_XML_NODE
());
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -167,9 +166,9 @@ void draw_g::serialize(std::wostream & _Wostream)
{
common_draw_attlists_
.
serialize
(
CP_GET_XML_NODE
());
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/draw_shapes.cpp
View file @
925bca71
...
...
@@ -430,16 +430,15 @@ void draw_enhanced_geometry::serialize(std::wostream & _Wostream)
CP_XML_ATTR_OPT
(
L"svg:viewBox"
,
svg_viewbox_
);
draw_enhanced_geometry_attlist_
.
serialize
(
CP_GET_XML_NODE
());
BOOST_FOREACH
(
office_element_ptr
&
elm
,
draw_equation_
)
for
(
size_t
i
=
0
;
i
<
draw_equation_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
draw_equation_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
BOOST_FOREACH
(
office_element_ptr
&
elm
,
draw_handle_
)
for
(
size_t
i
=
0
;
i
<
draw_handle_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
draw_handle_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/list.cpp
View file @
925bca71
...
...
@@ -32,8 +32,6 @@
#include "list.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
...
...
@@ -80,9 +78,9 @@ void text_list_item::serialize(std::wostream & _Wostream)
{
if
(
text_number_
)
text_number_
->
serialize
(
CP_XML_STREAM
());
BOOST_FOREACH
(
const
office_element_ptr
&
parElement
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
parElement
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -129,9 +127,9 @@ void text_list_header::serialize(std::wostream & _Wostream)
{
if
(
text_number_
)
text_number_
->
serialize
(
CP_XML_STREAM
());
BOOST_FOREACH
(
const
office_element_ptr
&
parElement
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
parElement
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/mediaitems.cpp
View file @
925bca71
...
...
@@ -34,7 +34,6 @@
#include "odf_rels.h"
#include <boost/regex.h>
#include <boost/foreach.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <cpdoccore/xml/utils.h>
...
...
@@ -85,11 +84,11 @@ void _mediaitems::add_or_find(const std::wstring & oox_ref, Type type, std::wst
std
::
wstring
output_path
;
BOOST_FOREACH
(
item
const
&
elm
,
items_
)
for
(
size_t
i
=
0
;
i
<
items_
.
size
();
i
++
)
{
if
(
elm
.
oox_ref
==
input_path
)
if
(
items_
[
i
]
.
oox_ref
==
input_path
)
{
output_path
=
elm
.
odf_ref
;
output_path
=
items_
[
i
]
.
odf_ref
;
break
;
}
}
...
...
@@ -110,12 +109,11 @@ void _mediaitems::add_or_find(const std::wstring & oox_ref, Type type, std::wst
}
void
_mediaitems
::
dump_rels
(
rels
&
Rels
,
std
::
wstring
local_path
)
{
size_t
i
=
0
;
BOOST_FOREACH
(
item
&
elm
,
items_
)
for
(
size_t
i
=
0
;
i
<
items_
.
size
();
i
++
)
{
Rels
.
add
(
relationship
(
utils
::
media
::
get_rel_type
(
elm
.
type
),
local_path
+
elm
.
odf_ref
)
Rels
.
add
(
relationship
(
utils
::
media
::
get_rel_type
(
items_
[
i
]
.
type
),
local_path
+
items_
[
i
]
.
odf_ref
)
);
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/mediaitems_utils.cpp
View file @
925bca71
...
...
@@ -33,7 +33,6 @@
#include "mediaitems_utils.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
namespace
cpdoccore
{
...
...
ASCOfficeOdfFileW/source/OdfFormat/number_style.cpp
View file @
925bca71
...
...
@@ -30,9 +30,6 @@
*
*/
#include <boost/foreach.hpp>
#include <cpdoccore/xml/simple_xml_writer.h>
#include <cpdoccore/xml/xmlchar.h>
...
...
@@ -67,13 +64,13 @@ void number_style_base::serialize(std::wostream & strm)
if
(
style_text_properties_
)
style_text_properties_
->
serialize
(
strm
);
BOOST_FOREACH
(
office_element_ptr
&
elm
,
style_map_
)
{
elm
->
serialize
(
strm
);
for
(
size_t
i
=
0
;
i
<
style_map_
.
size
();
i
++
)
{
style_map_
[
i
]
->
serialize
(
strm
);
}
BOOST_FOREACH
(
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
strm
);
content_
[
i
]
->
serialize
(
strm
);
}
}
void
number_style_base
::
serialize
(
CP_ATTR_NODE
)
...
...
@@ -166,9 +163,9 @@ void number_text::serialize(std::wostream & strm)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
office_element_ptr
&
elm
,
text_
)
{
elm
->
serialize
(
CP_XML_STREAM
());
for
(
size_t
i
=
0
;
i
<
text_
.
size
();
i
++
)
{
text_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -194,10 +191,10 @@ void number_embedded_text::serialize(std::wostream & strm)
{
CP_XML_ATTR_OPT
(
L"number:position"
,
number_position_
);
BOOST_FOREACH
(
office_element_ptr
&
elm
,
text_
)
{
elm
->
serialize
(
CP_XML_STREAM
());
}
for
(
size_t
i
=
0
;
i
<
text_
.
size
();
i
++
)
{
text_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
}
...
...
@@ -228,10 +225,10 @@ void number_number::serialize(std::wostream & strm)
CP_XML_ATTR_OPT
(
L"number:min-integer-digits"
,
number_min_integer_digits_
);
CP_XML_ATTR_OPT
(
L"number:grouping"
,
number_grouping_
);
BOOST_FOREACH
(
office_element_ptr
&
elm
,
number_embedded_text_
)
{
elm
->
serialize
(
CP_XML_STREAM
());
for
(
size_t
i
=
0
;
i
<
number_embedded_text_
.
size
();
i
++
)
{
number_embedded_text_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -336,9 +333,9 @@ void number_text_content::serialize(std::wostream & strm)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
office_element_ptr
&
elm
,
text_
)
{
elm
->
serialize
(
CP_XML_STREAM
());
for
(
size_t
i
=
0
;
i
<
text_
.
size
();
i
++
)
{
text_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/object_package.cpp
View file @
925bca71
...
...
@@ -30,8 +30,6 @@
*
*/
#include <boost/foreach.hpp>
#include <cpdoccore/utf8cpp/utf8.h>
#include <cpdoccore/xml/simple_xml_writer.h>
...
...
@@ -92,9 +90,10 @@ namespace odf_writer
///////////////
void
manifect_file
::
add_rels
(
rels
&
r
)
{
BOOST_FOREACH
(
relationship
&
item
,
r
.
relationships
())
std
::
vector
<
relationship
>
&
rels
=
r
.
relationships
();
for
(
size_t
i
=
0
;
i
<
rels
.
size
();
i
++
)
{
rels_
.
add
(
item
);
rels_
.
add
(
rels
[
i
]
);
}
}
manifect_file
::
manifect_file
(
std
::
wstring
t
)
...
...
@@ -188,13 +187,14 @@ namespace odf_writer
std
::
wstring
path
=
RootPath
+
FILE_SEPARATOR_STR
+
L"Media"
;
NSDirectory
::
CreateDirectory
(
path
);
BOOST_FOREACH
(
_mediaitems
::
item
&
item
,
mediaitems_
.
items
()
)
std
::
vector
<
_mediaitems
::
item
>
&
items
=
mediaitems_
.
items
();
for
(
size_t
i
=
0
;
i
<
items
.
size
();
i
++
)
{
if
(
item
.
type
==
_mediaitems
::
typeMedia
)
if
(
item
s
[
i
]
.
type
==
_mediaitems
::
typeMedia
)
{
std
::
wstring
file_name_out
=
RootPath
+
FILE_SEPARATOR_STR
+
item
.
odf_ref
;
std
::
wstring
file_name_out
=
RootPath
+
FILE_SEPARATOR_STR
+
item
s
[
i
]
.
odf_ref
;
NSFile
::
CFileBinary
::
Copy
(
item
.
oox_ref
,
file_name_out
);
NSFile
::
CFileBinary
::
Copy
(
item
s
[
i
]
.
oox_ref
,
file_name_out
);
}
}
...
...
@@ -212,15 +212,16 @@ namespace odf_writer
std
::
wstring
path
=
RootPath
+
FILE_SEPARATOR_STR
+
L"Pictures"
;
NSDirectory
::
CreateDirectory
(
path
);
BOOST_FOREACH
(
_mediaitems
::
item
&
item
,
mediaitems_
.
items
()
)
std
::
vector
<
_mediaitems
::
item
>
&
items
=
mediaitems_
.
items
();
for
(
size_t
i
=
0
;
i
<
items
.
size
();
i
++
)
{
if
(
item
.
type
==
_mediaitems
::
typeImage
&&
item
.
oox_ref
.
length
()
>
0
)
if
(
item
s
[
i
].
type
==
_mediaitems
::
typeImage
&&
items
[
i
]
.
oox_ref
.
length
()
>
0
)
{
std
::
wstring
file_name_out
=
RootPath
+
FILE_SEPARATOR_STR
+
item
.
odf_ref
;
std
::
wstring
file_name_out
=
RootPath
+
FILE_SEPARATOR_STR
+
item
s
[
i
]
.
odf_ref
;
try
{
NSFile
::
CFileBinary
::
Copy
(
item
.
oox_ref
,
file_name_out
);
NSFile
::
CFileBinary
::
Copy
(
item
s
[
i
]
.
oox_ref
,
file_name_out
);
}
catch
(...)
{
}
...
...
@@ -289,13 +290,12 @@ namespace odf_writer
{
if
(
base_
)
base_
->
write
(
RootPath
);
long
count
=
0
;
BOOST_FOREACH
(
const
element_ptr
&
item
,
objects_
)
{
std
::
wstring
path
=
RootPath
+
FILE_SEPARATOR_STR
+
item
->
local_path
;
for
(
size_t
i
=
0
;
i
<
objects_
.
size
();
i
++
)
{
std
::
wstring
path
=
RootPath
+
FILE_SEPARATOR_STR
+
objects_
[
i
]
->
local_path
;
NSDirectory
::
CreateDirectory
(
path
);
item
->
write
(
path
);
objects_
[
i
]
->
write
(
path
);
}
if
(
manifest_
)
manifest_
->
write
(
RootPath
);
if
(
mimetype_
)
mimetype_
->
write
(
RootPath
);
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_chart_context.cpp
View file @
925bca71
...
...
@@ -32,7 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include "../../../ASCOfficeOdfFile/formulasconvert/formulasconvert.h"
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_comment_context.cpp
View file @
925bca71
...
...
@@ -32,7 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <iostream>
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_conversion_context.cpp
View file @
925bca71
...
...
@@ -30,8 +30,6 @@
*
*/
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include "office_spreadsheet.h"
...
...
@@ -134,16 +132,15 @@ void odf_conversion_context::end_document()
objects_
.
back
().
scripts
->
serialize
(
content_root_
->
styles
());
object
.
content
->
serialize
(
content_root_
->
content
());
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
object
.
content_styles
)
for
(
size_t
i
=
0
;
i
<
object
.
content_styles
.
size
();
i
++
)
{
elm
->
serialize
(
content_root_
->
styles
());
object
.
content_styles
[
i
]
->
serialize
(
content_root_
->
styles
());
}
package
::
content_simple_ptr
content_style_
=
package
::
content_simple
::
create
();
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
object
.
styles
)
for
(
size_t
i
=
0
;
i
<
object
.
styles
.
size
();
i
++
)
{
// мастер-пейджы, заданные заливки (градиенты, битмапы), дефолтные стили, колонтитулы, разметки, заметки,...
elm
->
serialize
(
content_style_
->
content
());
object
.
styles
[
i
]
->
serialize
(
content_style_
->
content
());
}
package
::
content_simple_ptr
content_settings_
=
package
::
content_simple
::
create
();
object
.
settings
->
serialize
(
content_settings_
->
content
());
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
View file @
925bca71
...
...
@@ -32,7 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_notes_context.cpp
View file @
925bca71
...
...
@@ -32,7 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <iostream>
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_page_layout_context.cpp
View file @
925bca71
...
...
@@ -32,7 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <iostream>
#include "odf_page_layout_context.h"
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_rels.cpp
View file @
925bca71
...
...
@@ -30,9 +30,6 @@
*
*/
#include <boost/foreach.hpp>
#include "odf_rels.h"
#include <cpdoccore/xml/attributes.h>
...
...
@@ -54,11 +51,11 @@ void relationship::serialize(std::wostream & _Wostream)
}
}
void
rels
::
serialize
(
std
::
wostream
&
_Wostrea
m
)
void
rels
::
serialize
(
std
::
wostream
&
str
m
)
{
BOOST_FOREACH
(
relationship
&
r
,
relationship_
)
for
(
size_t
i
=
0
;
i
<
relationship_
.
size
();
i
++
)
{
r
.
serialize
(
_Wostrea
m
);
r
elationship_
[
i
].
serialize
(
str
m
);
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_style_context.cpp
View file @
925bca71
...
...
@@ -40,7 +40,6 @@
#include "style_paragraph_properties.h"
#include <boost/foreach.hpp>
#include <iostream>
namespace
cpdoccore
{
...
...
@@ -56,10 +55,10 @@ void calc_paragraph_properties_content(std::vector<style_paragraph_properties*>
{
if
(
result
==
NULL
)
return
;
BOOST_REVERSE_FOREACH
(
style_paragraph_properties
*
v
,
parProps
)
for
(
size_t
i
=
parProps
.
size
()
-
1
;
i
>=
0
;
i
--
)
{
if
(
v
)
result
->
apply_from
(
v
->
content_
);
if
(
parProps
[
i
]
)
result
->
apply_from
(
parProps
[
i
]
->
content_
);
}
}
...
...
@@ -93,7 +92,7 @@ void odf_style_context::create_style(std::wstring oox_name, style_family::type f
{
std
::
wstring
odf_name
=
oox_name
;
if
(
odf_name
.
length
()
<
1
)
odf_name
=
find_free_name
(
family
);
if
(
odf_name
.
empty
())
odf_name
=
find_free_name
(
family
);
office_element_ptr
elm
;
create_element
(
L"style"
,
L"style"
,
elm
,
odf_context_
);
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_table_context.cpp
View file @
925bca71
...
...
@@ -32,8 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <iostream>
#include "odf_conversion_context.h"
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_text_context.cpp
View file @
925bca71
...
...
@@ -32,7 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <boost/regex.hpp>
#include <iostream>
...
...
ASCOfficeOdfFileW/source/OdfFormat/ods_table_context.cpp
View file @
925bca71
...
...
@@ -37,7 +37,6 @@
#include "ods_conversion_context.h"
#include "logging.h"
#include <boost/foreach.hpp>
#include <iostream>
#include "../../../ASCOfficeOdfFile/formulasconvert/formulasconvert.h"
...
...
ASCOfficeOdfFileW/source/OdfFormat/office_annotation.cpp
View file @
925bca71
...
...
@@ -32,8 +32,6 @@
#include "office_annotation.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
...
...
@@ -159,9 +157,9 @@ void office_annotation::serialize(std::wostream & _Wostream)
if
(
dc_creator_
)
dc_creator_
->
serialize
(
CP_XML_STREAM
());
if
(
dc_date_
)
dc_date_
->
serialize
(
CP_XML_STREAM
());
BOOST_FOREACH
(
const
office_element_ptr
&
item
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
item
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -210,9 +208,9 @@ void officeooo_annotation::serialize(std::wostream & _Wostream)
if
(
dc_creator_
)
dc_creator_
->
serialize
(
CP_XML_STREAM
());
if
(
dc_date_
)
dc_date_
->
serialize
(
CP_XML_STREAM
());
BOOST_FOREACH
(
const
office_element_ptr
&
item
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
item
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/office_body.cpp
View file @
925bca71
...
...
@@ -32,8 +32,6 @@
#include "office_body.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
...
...
ASCOfficeOdfFileW/source/OdfFormat/office_chart.cpp
View file @
925bca71
...
...
@@ -33,10 +33,7 @@
#include "office_chart.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
namespace
cpdoccore
{
...
...
@@ -61,9 +58,9 @@ void office_chart::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -101,9 +98,9 @@ void chart_chart::serialize(std::wostream & _Wostream)
{
chart_chart_attlist_
.
serialize
(
CP_GET_XML_NODE
());
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -271,9 +268,9 @@ void chart_plot_area::serialize(std::wostream & _Wostream)
{
chart_plot_area_attlist_
.
serialize
(
CP_GET_XML_NODE
());
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -349,9 +346,9 @@ void chart_axis::serialize(std::wostream & _Wostream)
{
chart_axis_attlist_
.
serialize
(
CP_GET_XML_NODE
());
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -427,9 +424,9 @@ void chart_series::serialize(std::wostream & _Wostream)
{
chart_series_attlist_
.
serialize
(
CP_GET_XML_NODE
());
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/office_settings.cpp
View file @
925bca71
...
...
@@ -32,8 +32,6 @@
#include "office_settings.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
...
...
@@ -56,9 +54,9 @@ void office_settings::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -88,9 +86,9 @@ void settings_config_item_set::serialize(std::wostream & _Wostream)
{
CP_XML_ATTR
(
L"config:name"
,
config_name_
);
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -145,9 +143,9 @@ void settings_config_item_map_indexed::serialize(std::wostream & _Wostream)
{
CP_XML_ATTR_OPT
(
L"config:name"
,
config_name_
);
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -174,9 +172,9 @@ void settings_config_item_map_named::serialize(std::wostream & _Wostream)
{
CP_XML_ATTR_OPT
(
L"config:name"
,
config_name_
);
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -203,9 +201,9 @@ void settings_config_item_map_entry::serialize(std::wostream & _Wostream)
{
CP_XML_ATTR_OPT
(
L"config:name"
,
config_name_
);
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/office_spreadsheet.cpp
View file @
925bca71
...
...
@@ -32,8 +32,6 @@
#include "office_spreadsheet.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
...
...
@@ -63,9 +61,9 @@ void office_spreadsheet::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/office_text.cpp
View file @
925bca71
...
...
@@ -32,10 +32,7 @@
#include "office_text.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
namespace
cpdoccore
{
...
...
ASCOfficeOdfFileW/source/OdfFormat/paragraph_elements.cpp
View file @
925bca71
...
...
@@ -35,7 +35,6 @@
#include <ostream>
#include <string>
#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <cpdoccore/xml/xmlchar.h>
...
...
@@ -250,9 +249,9 @@ void text_span::serialize(std::wostream & _Wostream)
{
CP_XML_ATTR_OPT
(
L"text:style-name"
,
text_style_name_
);
BOOST_FOREACH
(
const
office_element_ptr
&
parElement
,
paragraph_content_
)
for
(
size_t
i
=
0
;
i
<
paragraph_content_
.
size
();
i
++
)
{
if
(
parElement
)
parElement
->
serialize
(
CP_XML_STREAM
());
paragraph_content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -547,9 +546,9 @@ void text_placeholder::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -585,12 +584,12 @@ void text_page_number::serialize(std::wostream & _Wostream)
common_num_format_attlist_
.
serialize
(
CP_GET_XML_NODE
());
common_field_fixed_attlist_
.
serialize
(
CP_GET_XML_NODE
());
CP_XML_ATTR_OPT
(
L"text:page-adjust"
,
text_page_adjust_
);
CP_XML_ATTR_OPT
(
L"text:select-page"
,
text_select_page_
);
CP_XML_ATTR_OPT
(
L"text:page-adjust"
,
text_page_adjust_
);
CP_XML_ATTR_OPT
(
L"text:select-page"
,
text_select_page_
);
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
text_
)
for
(
size_t
i
=
0
;
i
<
text_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
text_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -625,9 +624,9 @@ void text_page_count::serialize(std::wostream & _Wostream)
{
common_field_fixed_attlist_
.
serialize
(
CP_GET_XML_NODE
());
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
text_
)
for
(
size_t
i
=
0
;
i
<
text_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
text_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -662,9 +661,9 @@ void text_date::serialize(std::wostream & _Wostream)
{
common_field_fixed_attlist_
.
serialize
(
CP_GET_XML_NODE
());
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
text_
)
for
(
size_t
i
=
0
;
i
<
text_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
text_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -701,9 +700,9 @@ void text_time::serialize(std::wostream & _Wostream)
CP_XML_ATTR_OPT
(
L"style:data-style-name"
,
style_data_style_name_
);
CP_XML_ATTR_OPT
(
L"text:time-value"
,
text_time_value_
);
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
text_
)
for
(
size_t
i
=
0
;
i
<
text_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
text_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -740,9 +739,9 @@ void text_file_name::serialize(std::wostream & _Wostream)
{
common_field_fixed_attlist_
.
serialize
(
CP_GET_XML_NODE
());
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
text_
)
for
(
size_t
i
=
0
;
i
<
text_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
text_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -776,9 +775,9 @@ void text_sequence::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
text_
)
for
(
size_t
i
=
0
;
i
<
text_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
text_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -823,9 +822,9 @@ void text_sheet_name::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
text_
)
for
(
size_t
i
=
0
;
i
<
text_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
text_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/style_page_layout_properties.cpp
View file @
925bca71
...
...
@@ -36,7 +36,6 @@
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include <iostream>
#include <boost/foreach.hpp>
#include "office_elements_create.h"
...
...
ASCOfficeOdfFileW/source/OdfFormat/style_paragraph_properties.cpp
View file @
925bca71
...
...
@@ -38,9 +38,6 @@
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/utils.h>
#include <boost/foreach.hpp>
#include "borderstyle.h"
namespace
cpdoccore
{
...
...
@@ -85,9 +82,9 @@ void style_tab_stops::serialize(std::wostream & strm)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
office_element_ptr
&
elm
,
style_tab_stops_
)
{
elm
->
serialize
(
CP_XML_STREAM
());
for
(
size_t
i
=
0
;
i
<
style_tab_stops_
.
size
();
i
++
)
{
style_tab_stops_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/style_section_properties.cpp
View file @
925bca71
...
...
@@ -36,7 +36,6 @@
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include <iostream>
#include <boost/foreach.hpp>
#include "office_elements_create.h"
...
...
@@ -91,9 +90,9 @@ void style_columns::serialize(std::wostream & strm)
if
(
style_column_sep_
)
style_column_sep_
->
serialize
(
CP_XML_STREAM
());
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
style_column_
)
{
elm
->
serialize
(
CP_XML_STREAM
());
for
(
size_t
i
=
0
;
i
<
style_column_
.
size
();
i
++
)
{
style_column_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/styles.cpp
View file @
925bca71
...
...
@@ -37,7 +37,6 @@
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include <iostream>
#include <boost/foreach.hpp>
#include "office_elements_create.h"
...
...
@@ -543,18 +542,18 @@ void styles::add_child_element( const office_element_ptr & child, odf_conversion
}
void
styles
::
serialize
(
std
::
wostream
&
strm
)
//content from different element
{
BOOST_FOREACH
(
office_element_ptr
&
elm
,
number_styles_
)
{
elm
->
serialize
(
strm
);
for
(
size_t
i
=
0
;
i
<
number_styles_
.
size
();
i
++
)
{
number_styles_
[
i
]
->
serialize
(
strm
);
}
BOOST_FOREACH
(
office_element_ptr
&
elm
,
style_style_
)
{
elm
->
serialize
(
strm
);
}
BOOST_FOREACH
(
office_element_ptr
&
elm
,
text_list_style_
)
{
elm
->
serialize
(
strm
);
for
(
size_t
i
=
0
;
i
<
style_style_
.
size
();
i
++
)
{
style_style_
[
i
]
->
serialize
(
strm
);
}
for
(
size_t
i
=
0
;
i
<
text_list_style_
.
size
();
i
++
)
{
text_list_style_
[
i
]
->
serialize
(
strm
);
}
}
void
templates
::
create_child_element
(
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
,
odf_conversion_context
*
Context
)
{
...
...
@@ -576,10 +575,10 @@ void templates::add_child_element( const office_element_ptr & child)
}
void
templates
::
serialize
(
std
::
wostream
&
strm
)
{
BOOST_FOREACH
(
office_element_ptr
&
elm
,
table_templates_
)
{
elm
->
serialize
(
strm
);
}
for
(
size_t
i
=
0
;
i
<
table_templates_
.
size
();
i
++
)
{
table_templates_
[
i
]
->
serialize
(
strm
);
}
}
void
draw_styles
::
create_child_element
(
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
,
odf_conversion_context
*
Context
)
{
...
...
@@ -632,29 +631,29 @@ void draw_styles::add_child_element( const office_element_ptr & child, odf_conve
void
draw_styles
::
serialize
(
std
::
wostream
&
strm
)
{
BOOST_FOREACH
(
office_element_ptr
&
elm
,
draw_fill_image_
)
{
elm
->
serialize
(
strm
);
for
(
size_t
i
=
0
;
i
<
draw_fill_image_
.
size
();
i
++
)
{
draw_fill_image_
[
i
]
->
serialize
(
strm
);
}
BOOST_FOREACH
(
office_element_ptr
&
elm
,
draw_hatch_
)
{
elm
->
serialize
(
strm
);
}
BOOST_FOREACH
(
office_element_ptr
&
elm
,
draw_gradient_
)
{
elm
->
serialize
(
strm
);
for
(
size_t
i
=
0
;
i
<
draw_hatch_
.
size
();
i
++
)
{
draw_hatch_
[
i
]
->
serialize
(
strm
);
}
BOOST_FOREACH
(
office_element_ptr
&
elm
,
draw_opacity_
)
{
elm
->
serialize
(
strm
);
}
BOOST_FOREACH
(
office_element_ptr
&
elm
,
draw_marker_
)
{
elm
->
serialize
(
strm
);
for
(
size_t
i
=
0
;
i
<
draw_gradient_
.
size
();
i
++
)
{
draw_gradient_
[
i
]
->
serialize
(
strm
);
}
BOOST_FOREACH
(
office_element_ptr
&
elm
,
draw_stroke_dash_
)
{
elm
->
serialize
(
strm
);
for
(
size_t
i
=
0
;
i
<
draw_opacity_
.
size
();
i
++
)
{
draw_opacity_
[
i
]
->
serialize
(
strm
);
}
for
(
size_t
i
=
0
;
i
<
draw_marker_
.
size
();
i
++
)
{
draw_marker_
[
i
]
->
serialize
(
strm
);
}
for
(
size_t
i
=
0
;
i
<
draw_stroke_dash_
.
size
();
i
++
)
{
draw_stroke_dash_
[
i
]
->
serialize
(
strm
);
}
}
// office:automatic-styles
...
...
@@ -696,11 +695,10 @@ void office_automatic_styles::serialize(std::wostream & strm)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
office_element_ptr
elm
,
style_page_layout_
)
{
elm
->
serialize
(
CP_XML_STREAM
());
}
for
(
size_t
i
=
0
;
i
<
style_page_layout_
.
size
();
i
++
)
{
style_page_layout_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
styles_
.
serialize
(
CP_XML_STREAM
());
}
}
...
...
@@ -762,11 +760,10 @@ void office_master_styles::serialize(std::wostream & strm)
if
(
draw_layer_set_
)
draw_layer_set_
->
serialize
(
CP_XML_STREAM
());
BOOST_FOREACH
(
office_element_ptr
elm
,
style_master_page_
)
{
elm
->
serialize
(
CP_XML_STREAM
());
}
for
(
size_t
i
=
0
;
i
<
style_master_page_
.
size
();
i
++
)
{
style_master_page_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
if
(
style_handout_master_
)
style_handout_master_
->
serialize
(
CP_XML_STREAM
());
...
...
ASCOfficeOdfFileW/source/OdfFormat/table.cpp
View file @
925bca71
...
...
@@ -33,7 +33,6 @@
#include "table.h"
#include <boost/make_shared.hpp>
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
...
...
@@ -272,7 +271,7 @@ void table_table_columns::create_child_element(const std::wstring & Ns, const st
{
if
CP_CHECK_NAME
(
L"table"
,
L"table-column"
)
{
CP_CREATE_ELEMENT
(
table_table_column
_
);
CP_CREATE_ELEMENT
(
content
_
);
}
else
CP_NOT_APPLICABLE_ELM
();
...
...
@@ -284,7 +283,7 @@ void table_table_columns::add_child_element( const office_element_ptr & child_el
ElementType
type
=
child_element
->
get_type
();
if
(
type
==
typeTableTableColumn
)
table_table_column
_
.
push_back
(
child_element
);
content
_
.
push_back
(
child_element
);
}
void
table_table_columns
::
serialize
(
std
::
wostream
&
_Wostream
)
{
...
...
@@ -292,9 +291,9 @@ void table_table_columns::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
table_table_column_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -309,7 +308,7 @@ void table_table_header_columns::create_child_element( const std::wstring & Ns,
{
if
CP_CHECK_NAME
(
L"table"
,
L"table-column"
)
{
CP_CREATE_ELEMENT
(
table_table_column
_
);
CP_CREATE_ELEMENT
(
content
_
);
}
else
CP_NOT_APPLICABLE_ELM
();
...
...
@@ -321,7 +320,7 @@ void table_table_header_columns::add_child_element( const office_element_ptr & c
ElementType
type
=
child_element
->
get_type
();
if
(
type
==
typeTableTableColumn
)
table_table_column
_
.
push_back
(
child_element
);
content
_
.
push_back
(
child_element
);
}
void
table_table_header_columns
::
serialize
(
std
::
wostream
&
_Wostream
)
{
...
...
@@ -329,9 +328,9 @@ void table_table_header_columns::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
table_table_column_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -347,7 +346,7 @@ void table_columns::create_child_element( const std::wstring & Ns, const std::ws
}
else
if
CP_CHECK_NAME
(
L"table"
,
L"table-column"
)
{
CP_CREATE_ELEMENT_SIMPLE
(
table_table_column
_
);
CP_CREATE_ELEMENT_SIMPLE
(
content
_
);
}
else
not_applicable_element
(
L"table-columns"
,
Ns
,
Name
);
...
...
@@ -367,15 +366,15 @@ void table_columns::add_child_element( const office_element_ptr & child_element)
table_table_columns_
=
child_element
;
}
else
if
(
type
==
typeTableTableColumn
)
table_table_column
_
.
push_back
(
child_element
);
content
_
.
push_back
(
child_element
);
}
void
table_columns
::
serialize
(
std
::
wostream
&
_Wostrea
m
)
void
table_columns
::
serialize
(
std
::
wostream
&
str
m
)
{
if
(
table_table_columns_
)
table_table_columns_
->
serialize
(
_Wostrea
m
);
if
(
table_table_columns_
)
table_table_columns_
->
serialize
(
str
m
);
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
table_table_column_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
_Wostrea
m
);
content_
[
i
]
->
serialize
(
str
m
);
}
}
// table-columns-no-group
...
...
@@ -521,11 +520,11 @@ void table_columns_and_groups::add_child_element( const office_element_ptr & chi
not_applicable_element
(
L"table-columns-and-groups"
,
L""
,
L""
);
}
}
void
table_columns_and_groups
::
serialize
(
std
::
wostream
&
_Wostrea
m
)
void
table_columns_and_groups
::
serialize
(
std
::
wostream
&
str
m
)
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
_Wostrea
m
);
content_
[
i
]
->
serialize
(
str
m
);
}
}
// table-table-cell-content
...
...
@@ -539,11 +538,11 @@ void table_table_cell_content::add_child_element( const office_element_ptr & chi
{
text_content_
.
push_back
(
child_element
);
}
void
table_table_cell_content
::
serialize
(
std
::
wostream
&
_Wostrea
m
)
void
table_table_cell_content
::
serialize
(
std
::
wostream
&
str
m
)
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
text_content_
)
for
(
size_t
i
=
0
;
i
<
text_content_
.
size
();
i
++
)
{
if
(
elm
)
elm
->
serialize
(
_Wostrea
m
);
text_content_
[
i
]
->
serialize
(
str
m
);
}
}
// table:table-cell
...
...
@@ -635,9 +634,9 @@ void table_table_row::serialize(std::wostream & _Wostream)
{
table_table_row_attlist_
.
serialize
(
CP_GET_XML_NODE
());
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -650,21 +649,21 @@ const wchar_t * table_table_rows::name = L"table-rows";
void
table_table_rows
::
create_child_element
(
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
)
{
CP_CREATE_ELEMENT
(
table_table_row
_
);
CP_CREATE_ELEMENT
(
content
_
);
}
void
table_table_rows
::
add_child_element
(
const
office_element_ptr
&
child_element
)
{
table_table_row
_
.
push_back
(
child_element
);
content
_
.
push_back
(
child_element
);
}
void
table_table_rows
::
serialize
(
std
::
wostream
&
_Wostrea
m
)
void
table_table_rows
::
serialize
(
std
::
wostream
&
str
m
)
{
CP_XML_WRITER
(
_Wostrea
m
)
CP_XML_WRITER
(
str
m
)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
table_table_row_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
()
);
content_
[
i
]
->
serialize
(
strm
);
}
}
}
...
...
@@ -679,7 +678,7 @@ void table_table_header_rows::create_child_element( const std::wstring & Ns, con
{
if
CP_CHECK_NAME
(
L"table"
,
L"table-row"
)
{
CP_CREATE_ELEMENT
(
table_table_row
_
);
CP_CREATE_ELEMENT
(
content
_
);
}
else
CP_NOT_APPLICABLE_ELM
();
...
...
@@ -691,7 +690,7 @@ void table_table_header_rows::add_child_element( const office_element_ptr & chil
ElementType
type
=
child_element
->
get_type
();
if
(
type
==
typeTableTableRow
)
table_table_row
_
.
push_back
(
child_element
);
content
_
.
push_back
(
child_element
);
}
void
table_table_header_rows
::
serialize
(
std
::
wostream
&
_Wostream
)
{
...
...
@@ -699,9 +698,9 @@ void table_table_header_rows::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
table_table_row_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -716,7 +715,7 @@ void table_rows::create_child_element(const std::wstring & Ns, const std::wstrin
}
else
if
CP_CHECK_NAME
(
L"table"
,
L"table-row"
)
{
CP_CREATE_ELEMENT_SIMPLE
(
table_table_row
_
);
CP_CREATE_ELEMENT_SIMPLE
(
content
_
);
}
else
{
...
...
@@ -733,16 +732,16 @@ void table_rows::add_child_element( const office_element_ptr & child_element)
table_table_rows_
=
child_element
;
else
if
(
type
==
typeTableTableRow
)
table_table_row
_
.
push_back
(
child_element
);
content
_
.
push_back
(
child_element
);
}
void
table_rows
::
serialize
(
std
::
wostream
&
_Wostrea
m
)
void
table_rows
::
serialize
(
std
::
wostream
&
str
m
)
{
if
(
table_table_rows_
)
table_table_rows_
->
serialize
(
_Wostrea
m
);
table_table_rows_
->
serialize
(
str
m
);
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
table_table_row_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
_Wostrea
m
);
content_
[
i
]
->
serialize
(
str
m
);
}
}
// table-rows-no-group
...
...
@@ -851,11 +850,11 @@ void table_rows_and_groups::add_child_element( const office_element_ptr & child_
content_
.
push_back
(
elm
);
}
}
void
table_rows_and_groups
::
serialize
(
std
::
wostream
&
_Wostrea
m
)
void
table_rows_and_groups
::
serialize
(
std
::
wostream
&
str
m
)
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
_Wostrea
m
);
content_
[
i
]
->
serialize
(
str
m
);
}
}
// table:table-row-group
...
...
@@ -911,9 +910,9 @@ void table_shapes::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE
()
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
serialize
(
CP_XML_STREAM
());
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/table.h
View file @
925bca71
...
...
@@ -186,8 +186,8 @@ public:
virtual
void
serialize
(
std
::
wostream
&
_Wostream
);
public:
office_element_ptr
table_table_columns_
;
office_element_ptr_array
table_table_column
_
;
office_element_ptr
table_table_columns_
;
office_element_ptr_array
content
_
;
};
...
...
@@ -296,7 +296,7 @@ public:
virtual
void
serialize
(
std
::
wostream
&
_Wostream
);
office_element_ptr_array
table_table_column
_
;
office_element_ptr_array
content
_
;
};
...
...
@@ -318,7 +318,7 @@ public:
virtual
void
serialize
(
std
::
wostream
&
_Wostream
);
office_element_ptr_array
table_table_column
_
;
office_element_ptr_array
content
_
;
};
...
...
@@ -472,7 +472,7 @@ public:
{
}
office_element_ptr_array
table_table_row
_
;
office_element_ptr_array
content
_
;
};
...
...
@@ -494,7 +494,7 @@ public:
virtual
void
serialize
(
std
::
wostream
&
_Wostream
);
office_element_ptr_array
table_table_row
_
;
office_element_ptr_array
content
_
;
};
...
...
@@ -509,7 +509,7 @@ public:
virtual
void
serialize
(
std
::
wostream
&
_Wostream
);
office_element_ptr
table_table_rows_
;
office_element_ptr_array
table_table_row
_
;
office_element_ptr_array
content
_
;
};
...
...
ASCOfficeOdfFileW/source/OdfFormat/text_elements.cpp
View file @
925bca71
...
...
@@ -32,10 +32,7 @@
#include "text_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include "paragraph_elements.h"
...
...
@@ -76,11 +73,11 @@ void paragraph::add_text(const std::wstring & Text)
office_element_ptr
elm
=
text_text
::
create
(
Text
)
;
paragraph_content_
.
push_back
(
elm
);
}
void
paragraph
::
serialize
(
std
::
wostream
&
_Wostrea
m
)
void
paragraph
::
serialize
(
std
::
wostream
&
str
m
)
{
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
paragraph_content_
)
{
elm
->
serialize
(
_Wostrea
m
);
for
(
size_t
i
=
0
;
i
<
paragraph_content_
.
size
();
i
++
)
{
paragraph_content_
[
i
]
->
serialize
(
str
m
);
}
}
void
paragraph
::
serialize_attr
(
CP_ATTR_NODE
)
...
...
@@ -95,11 +92,10 @@ void paragraph_attrs::serialize(CP_ATTR_NODE)
std
::
wstring
text_class_names_all
;
BOOST_FOREACH
(
const
std
::
wstring
&
elm
,
text_class_names_
)
{
text_class_names_all
=
elm
+
std
::
wstring
(
L" "
);
}
for
(
size_t
i
=
0
;
i
<
text_class_names_
.
size
();
i
++
)
{
text_class_names_all
=
text_class_names_
[
i
]
+
std
::
wstring
(
L" "
);
}
if
(
!
text_class_names_all
.
empty
())
CP_XML_ATTR
(
L"text:class-names"
,
text_class_names_all
);
}
...
...
@@ -186,9 +182,9 @@ void text_list::serialize(std::wostream & _Wostream)
if
(
text_list_header_
)
text_list_header_
->
serialize
(
CP_XML_STREAM
());
BOOST_FOREACH
(
const
office_element_ptr
&
listItem
,
text_list_items_
)
for
(
size_t
i
=
0
;
i
<
text_list_items_
.
size
();
i
++
)
{
listItem
->
serialize
(
CP_XML_STREAM
());
text_list_items_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
View file @
925bca71
...
...
@@ -36,8 +36,6 @@
#include "../utils.h"
#include <boost/lexical_cast.hpp>
#include "XlsxConverter.h"
#include "DocxConverter.h"
#include "PptxConverter.h"
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
View file @
925bca71
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.h
View file @
925bca71
...
...
@@ -33,7 +33,6 @@
#include "Converter.h"
#include <boost/foreach.hpp>
#include <cpdoccore/CPSharedPtr.h>
#include <cpdoccore/CPOptional.h>
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
View file @
925bca71
...
...
@@ -52,8 +52,6 @@
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/SplitTransition.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/ZoomTransition.h"
#include <boost/lexical_cast.hpp>
#include "../OdfFormat/odp_conversion_context.h"
#include "../OdfFormat/odf_text_context.h"
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.h
View file @
925bca71
...
...
@@ -33,7 +33,6 @@
#include "Converter.h"
#include <boost/foreach.hpp>
#include <cpdoccore/CPSharedPtr.h>
#include <cpdoccore/CPOptional.h>
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
View file @
925bca71
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.h
View file @
925bca71
...
...
@@ -32,7 +32,7 @@
#pragma once
#include "Converter.h"
#include <boost/foreach.hpp>
#include <cpdoccore/CPSharedPtr.h>
#include <cpdoccore/CPOptional.h>
...
...
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