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
e0296d5a
Commit
e0296d5a
authored
Mar 29, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatWriter - odp master page
parent
e26cf3bf
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
235 additions
and
205 deletions
+235
-205
ASCOfficeOdfFileW/source/OdfFormat/draw_page.cpp
ASCOfficeOdfFileW/source/OdfFormat/draw_page.cpp
+24
-26
ASCOfficeOdfFileW/source/OdfFormat/draw_page.h
ASCOfficeOdfFileW/source/OdfFormat/draw_page.h
+2
-7
ASCOfficeOdfFileW/source/OdfFormat/odf_page_layout_context.cpp
...ficeOdfFileW/source/OdfFormat/odf_page_layout_context.cpp
+1
-1
ASCOfficeOdfFileW/source/OdfFormat/odp_conversion_context.cpp
...fficeOdfFileW/source/OdfFormat/odp_conversion_context.cpp
+20
-9
ASCOfficeOdfFileW/source/OdfFormat/odp_conversion_context.h
ASCOfficeOdfFileW/source/OdfFormat/odp_conversion_context.h
+3
-0
ASCOfficeOdfFileW/source/OdfFormat/odp_page_state.cpp
ASCOfficeOdfFileW/source/OdfFormat/odp_page_state.cpp
+8
-3
ASCOfficeOdfFileW/source/OdfFormat/odp_page_state.h
ASCOfficeOdfFileW/source/OdfFormat/odp_page_state.h
+1
-1
ASCOfficeOdfFileW/source/OdfFormat/odp_slide_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odp_slide_context.cpp
+1
-1
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
+11
-35
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertVml.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertVml.cpp
+16
-16
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
+35
-35
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.h
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.h
+6
-3
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
+46
-46
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
+38
-7
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.h
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.h
+9
-2
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
+11
-11
ASCOfficePPTXFile/PPTXFormat/SlideLayout.h
ASCOfficePPTXFile/PPTXFormat/SlideLayout.h
+1
-1
ASCOfficePPTXFile/PPTXFormat/SlideMaster.h
ASCOfficePPTXFile/PPTXFormat/SlideMaster.h
+2
-1
No files found.
ASCOfficeOdfFileW/source/OdfFormat/draw_page.cpp
View file @
e0296d5a
...
...
@@ -37,8 +37,6 @@
#include "office_elements_create.h"
#include <cpdoccore/xml/simple_xml_writer.h>
namespace
cpdoccore
{
using
namespace
odf_types
;
...
...
@@ -46,18 +44,18 @@ namespace cpdoccore {
namespace
odf_writer
{
void
draw_page_attr
::
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
)
void
draw_page_attr
::
serialize
(
CP_ATTR_NODE
)
{
CP_
APPLY_ATTR
(
L"draw:id"
,
draw_id_
);
CP_
XML_ATTR_OPT
(
L"draw:id"
,
draw_id_
);
CP_
APPLY_ATTR
(
L"draw:name"
,
draw_name_
);
CP_
APPLY_ATTR
(
L"draw:style-name"
,
draw_style_name_
);
CP_
XML_ATTR_OPT
(
L"draw:name"
,
draw_name_
);
CP_
XML_ATTR_OPT
(
L"draw:style-name"
,
draw_style_name_
);
CP_
APPLY_ATTR
(
L"presentation:presentation-page-layout-name"
,
page_layout_name_
);
CP_
APPLY_ATTR
(
L"draw:master-page-name"
,
master_page_name_
);
CP_
XML_ATTR_OPT
(
L"presentation:presentation-page-layout-name"
,
page_layout_name_
);
CP_
XML_ATTR_OPT
(
L"draw:master-page-name"
,
master_page_name_
);
CP_
APPLY_ATTR
(
L"presentation:use-date-time-name"
,
use_date_time_name_
);
CP_
APPLY_ATTR
(
L"presentation:use-footer-name"
,
use_footer_name_
);
CP_
XML_ATTR_OPT
(
L"presentation:use-date-time-name"
,
use_date_time_name_
);
CP_
XML_ATTR_OPT
(
L"presentation:use-footer-name"
,
use_footer_name_
);
}
...
...
@@ -81,20 +79,20 @@ void draw_page::add_child_element( const office_element_ptr & child_element)
content_
.
push_back
(
child_element
);
}
void
draw_page
::
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
)
{
draw_page_attr_
.
add_attributes
(
Attributes
);
}
void
draw_page
::
serialize
(
std
::
wostream
&
_Wostream
)
{
CP_XML_WRITER
(
_Wostream
)
{
CP_XML_NODE_SIMPLE
()
{
draw_page_attr_
.
serialize
(
CP_GET_XML_NODE
());
for
(
int
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
content_
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
if
(
animation_
)
animation_
->
serialize
(
CP_XML_STREAM
());
}
}
}
...
...
@@ -104,22 +102,22 @@ void draw_page::serialize(std::wostream & _Wostream)
const
wchar_t
*
presentation_footer_decl
::
ns
=
L"presentation"
;
const
wchar_t
*
presentation_footer_decl
::
name
=
L"footer-decl"
;
void
presentation_footer_decl
::
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
)
{
CP_APPLY_ATTR
(
L"presentation:name"
,
presentation_name_
);
}
//
void presentation_footer_decl::add_attributes( const xml::attributes_wc_ptr & Attributes )
//
{
// CP_XML_ATTR_OPT
(L"presentation:name", presentation_name_);
//
}
//////////////////////////////////////////////////////////////////////////////////////////////////
const
wchar_t
*
presentation_date_time_decl
::
ns
=
L"presentation"
;
const
wchar_t
*
presentation_date_time_decl
::
name
=
L"date-time-decl"
;
void
presentation_date_time_decl
::
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
)
{
CP_APPLY_ATTR
(
L"presentation:name"
,
presentation_name_
);
CP_APPLY_ATTR
(
L"presentation:source"
,
presentation_source_
);
CP_APPLY_ATTR
(
L"style:data-style-name"
,
style_data_style_name_
);
}
//
//
void presentation_date_time_decl::add_attributes( const xml::attributes_wc_ptr & Attributes )
//
{
// CP_XML_ATTR_OPT
(L"presentation:name", presentation_name_);
// CP_XML_ATTR_OPT
(L"presentation:source", presentation_source_);
// CP_XML_ATTR_OPT
(L"style:data-style-name", style_data_style_name_);
//
}
//
}
}
ASCOfficeOdfFileW/source/OdfFormat/draw_page.h
View file @
e0296d5a
...
...
@@ -34,6 +34,7 @@
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/xmlelement.h>
#include <cpdoccore/xml/nodetype.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "office_elements.h"
#include "office_elements_create.h"
...
...
@@ -48,7 +49,7 @@ namespace odf_writer {
class
draw_page_attr
{
public:
void
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
);
void
serialize
(
CP_ATTR_NODE
);
_CP_OPT
(
std
::
wstring
)
draw_name_
;
_CP_OPT
(
std
::
wstring
)
draw_id_
;
...
...
@@ -75,8 +76,6 @@ public:
virtual
void
serialize
(
std
::
wostream
&
_Wostream
);
void
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
);
office_element_ptr_array
content_
;
office_element_ptr
animation_
;
...
...
@@ -100,8 +99,6 @@ public:
virtual
void
serialize
(
std
::
wostream
&
_Wostream
){}
void
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
);
_CP_OPT
(
std
::
wstring
)
presentation_name_
;
std
::
wstring
text_
;
...
...
@@ -128,8 +125,6 @@ public:
virtual
void
add_child_element
(
const
office_element_ptr
&
child_element
){}
virtual
void
serialize
(
std
::
wostream
&
_Wostream
){}
void
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
);
};
CP_REGISTER_OFFICE_ELEMENT2
(
presentation_date_time_decl
);
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_page_layout_context.cpp
View file @
e0296d5a
...
...
@@ -106,7 +106,7 @@ void odf_page_layout_context::add_master_page(std::wstring page_name)
void
odf_page_layout_context
::
process_master_styles
(
office_element_ptr
root
)
{
for
(
size_t
i
=
0
;
i
<
master_state_list_
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
master_state_list_
.
size
();
i
++
)
{
try
{
...
...
ASCOfficeOdfFileW/source/OdfFormat/odp_conversion_context.cpp
View file @
e0296d5a
...
...
@@ -73,23 +73,34 @@ void odp_conversion_context::end_document()
void
odp_conversion_context
::
start_slide
()
{
create_element
(
L"draw"
,
L"page"
,
root_presentation_
->
pages_
,
this
);
slide_context_
.
start_page
(
root_presentation_
->
pages_
.
back
());
drawing_context
()
->
set_styles_context
(
styles_context
());
page_layout_context
()
->
set_styles_context
(
styles_context
());
//page_layout_context()->add_master_page(L"");
drawing_context
()
->
set_styles_context
(
styles_context
());
//page_layout_context()->set_styles_context(styles_context());
}
std
::
wstring
odp_conversion_context
::
start_master_slide
()
{
std
::
wstring
name
;
page_layout_context
()
->
add_master_page
(
name
);
name
=
page_layout_context
()
->
last_master
()
->
get_name
();
slide_context_
.
start_page
(
page_layout_context
()
->
last_master
()
->
get_root
());
drawing_context
()
->
set_styles_context
(
page_layout_context
()
->
get_local_styles_context
());
//current_table().set_table_master_page(page_layout_context()->last_master() ?
// page_layout_context()->last_master()->get_name() : L"");
return
name
;
}
void
odp_conversion_context
::
end_slide
()
void
odp_conversion_context
::
end_
master_
slide
()
{
slide_context_
.
end_page
();
}
void
odp_conversion_context
::
end_slide
()
{
slide_context_
.
end_page
();
//
//styles_context()->reset_defaults();
}
void
odp_conversion_context
::
start_text_context
()
...
...
ASCOfficeOdfFileW/source/OdfFormat/odp_conversion_context.h
View file @
e0296d5a
...
...
@@ -52,6 +52,9 @@ public:
void
start_slide
();
void
end_slide
();
std
::
wstring
start_master_slide
();
void
end_master_slide
();
///////////////////////////////////////////////////////
odp_page_state
&
current_slide
()
{
return
slide_context_
.
state
();}
/////////////////////////////////////////////////////
...
...
ASCOfficeOdfFileW/source/OdfFormat/odp_page_state.cpp
View file @
e0296d5a
...
...
@@ -66,18 +66,23 @@ odp_page_state::odp_page_state(odf_conversion_context * Context, office_element_
void
odp_page_state
::
set_page_name
(
std
::
wstring
name
)
{
if
(
name
.
empty
())
return
;
office_page_name_
=
name
;
draw_page
*
page
=
dynamic_cast
<
draw_page
*>
(
draw_page_
.
get
());
if
(
page
==
NULL
)
return
;
page
->
draw_page_attr_
.
draw_name_
=
name
;
}
void
odp_page_state
::
set_
page_
master_page
(
std
::
wstring
name
)
void
odp_page_state
::
set_master_page
(
std
::
wstring
name
)
{
if
(
!
office_page_style_
)
return
;
if
(
name
.
empty
())
return
;
draw_page
*
page
=
dynamic_cast
<
draw_page
*>
(
draw_page_
.
get
());
if
(
page
==
NULL
)
return
;
office_page_style_
->
style_
master_page_name_
=
name
;
page
->
draw_page_attr_
.
master_page_name_
=
name
;
}
void
odp_page_state
::
set_page_style
(
office_element_ptr
&
elm
)
...
...
ASCOfficeOdfFileW/source/OdfFormat/odp_page_state.h
View file @
e0296d5a
...
...
@@ -77,7 +77,7 @@ public:
odp_page_state
(
odf_conversion_context
*
Context
,
office_element_ptr
&
elm
);
void
set_page_name
(
std
::
wstring
name
);
void
set_page_style
(
office_element_ptr
&
_style
);
void
set_
page_
master_page
(
std
::
wstring
name
);
void
set_master_page
(
std
::
wstring
name
);
void
add_child_element
(
const
office_element_ptr
&
child_element
);
...
...
ASCOfficeOdfFileW/source/OdfFormat/odp_slide_context.cpp
View file @
e0296d5a
...
...
@@ -59,7 +59,7 @@ void odp_slide_context::start_page(office_element_ptr & elm)
{
page_state_list_
.
push_back
(
odp_page_state
(
&
context_
,
elm
)
);
std
::
wstring
style_name_new
=
L"
ta
"
+
boost
::
lexical_cast
<
std
::
wstring
>
(
page_state_list_
.
size
());
std
::
wstring
style_name_new
=
L"
dp
"
+
boost
::
lexical_cast
<
std
::
wstring
>
(
page_state_list_
.
size
());
office_element_ptr
&
style
=
context_
.
styles_context
()
->
add_or_find
(
style_name_new
,
style_family
::
DrawingPage
,
true
);
style
->
create_child_element
(
L"style"
,
L"drawing-page-properties"
);
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
View file @
e0296d5a
...
...
@@ -434,12 +434,12 @@ void OoxConverter::convert(PPTX::Logic::PathBase *oox_path)
{
if
(
!
oox_path
)
return
;
PPTX
::
Logic
::
MoveTo
*
moveTo
=
stat
ic_cast
<
PPTX
::
Logic
::
MoveTo
*>
(
oox_path
);
PPTX
::
Logic
::
LineTo
*
lineTo
=
stat
ic_cast
<
PPTX
::
Logic
::
LineTo
*>
(
oox_path
);
PPTX
::
Logic
::
CubicBezTo
*
cubicBezTo
=
stat
ic_cast
<
PPTX
::
Logic
::
CubicBezTo
*>
(
oox_path
);
PPTX
::
Logic
::
Close
*
close
=
stat
ic_cast
<
PPTX
::
Logic
::
Close
*>
(
oox_path
);
PPTX
::
Logic
::
ArcTo
*
arcTo
=
stat
ic_cast
<
PPTX
::
Logic
::
ArcTo
*>
(
oox_path
);
PPTX
::
Logic
::
QuadBezTo
*
quadBezTo
=
stat
ic_cast
<
PPTX
::
Logic
::
QuadBezTo
*>
(
oox_path
);
PPTX
::
Logic
::
MoveTo
*
moveTo
=
dynam
ic_cast
<
PPTX
::
Logic
::
MoveTo
*>
(
oox_path
);
PPTX
::
Logic
::
LineTo
*
lineTo
=
dynam
ic_cast
<
PPTX
::
Logic
::
LineTo
*>
(
oox_path
);
PPTX
::
Logic
::
CubicBezTo
*
cubicBezTo
=
dynam
ic_cast
<
PPTX
::
Logic
::
CubicBezTo
*>
(
oox_path
);
PPTX
::
Logic
::
Close
*
close
=
dynam
ic_cast
<
PPTX
::
Logic
::
Close
*>
(
oox_path
);
PPTX
::
Logic
::
ArcTo
*
arcTo
=
dynam
ic_cast
<
PPTX
::
Logic
::
ArcTo
*>
(
oox_path
);
PPTX
::
Logic
::
QuadBezTo
*
quadBezTo
=
dynam
ic_cast
<
PPTX
::
Logic
::
QuadBezTo
*>
(
oox_path
);
if
(
moveTo
)
{
...
...
@@ -634,40 +634,16 @@ void OoxConverter::convert(PPTX::Logic::UniColor * color, std::wstring & hexStri
DWORD
argb
=
0
;
smart_ptr
<
PPTX
::
Logic
::
ClrMap
>
clrMap
;
smart_ptr
<
PPTX
::
Logic
::
ClrMap
>
clrMap
(
oox_clrMap
());
clrMap
.
AddRef
()
;
smart_ptr
<
PPTX
::
Theme
>
theme
(
oox_theme
());
theme
.
AddRef
();
argb
=
color
->
GetRGBColor
(
theme
,
clrMap
);
//switch(color->getType ())
//{
// case OOX::et_a_schemeClr:
// {
// NSCommon::smart_ptr<PPTX::Logic::SchemeClr> schemeColor = color->Color.smart_dynamic_cast<PPTX::Logic::SchemeClr>();
// if (schemeColor.IsInit())
// {
// convert(schemeColor->val.get(), argb);
// }
// }break;
// case OOX::et_a_prstClr:
// case OOX::et_a_scrgbClr:
// case OOX::et_a_srgbClr:
// case OOX::et_a_sysClr:
// default:
// {
// argb = color->GetARGB();
// result = true;
// }break;
//}
//if (result)
{
hexString
=
XmlUtils
::
IntToString
(
argb
&
0x00FFFFFF
,
L"#%06X"
);
hexString
=
XmlUtils
::
IntToString
(
argb
&
0x00FFFFFF
,
L"#%06X"
);
if
((
argb
>>
24
)
!=
0xff
)
{
opacity
=
((
argb
>>
24
)
/
255.
)
*
100.
;
}
if
((
argb
>>
24
)
!=
0xff
)
{
opacity
=
((
argb
>>
24
)
/
255.
)
*
100.
;
}
}
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertVml.cpp
View file @
e0296d5a
...
...
@@ -324,7 +324,7 @@ void OoxConverter::convert(OOX::Vml::CShape *vml_shape)
odf_context
()
->
drawing_context
()
->
set_path
(
vml_shape
->
m_oPath
->
GetValue
());
}
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
stat
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_shape
);
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
dynam
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_shape
);
convert
(
vml_common
);
}
...
...
@@ -381,14 +381,14 @@ void OoxConverter::convert(OOX::Vml::CArc *vml_arc)
{
if
(
vml_arc
==
NULL
)
return
;
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
stat
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_arc
);
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
dynam
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_arc
);
convert
(
vml_common
);
}
void
OoxConverter
::
convert
(
OOX
::
Vml
::
CBackground
*
vml_background
)
{
if
(
vml_background
==
NULL
)
return
;
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
stat
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_background
);
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
dynam
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_background
);
convert
(
vml_common
);
}
...
...
@@ -520,7 +520,7 @@ void OoxConverter::convert(OOX::Vml::CLine *vml_line)
{
if
(
vml_line
==
NULL
)
return
;
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
stat
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_line
);
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
dynam
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_line
);
convert
(
vml_common
);
_CP_OPT
(
double
)
x
=
vml_line
->
m_oFrom
.
GetX
();
...
...
@@ -538,7 +538,7 @@ void OoxConverter::convert(OOX::Vml::COval *vml_oval)
{
if
(
vml_oval
==
NULL
)
return
;
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
stat
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_oval
);
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
dynam
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_oval
);
convert
(
vml_common
);
}
void
OoxConverter
::
convert
(
OOX
::
Vml
::
CPath
*
vml_path
)
...
...
@@ -564,14 +564,14 @@ void OoxConverter::convert(OOX::Vml::CPolyLine *vml_polyline)
{
if
(
vml_polyline
==
NULL
)
return
;
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
stat
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_polyline
);
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
dynam
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_polyline
);
convert
(
vml_common
);
}
void
OoxConverter
::
convert
(
OOX
::
Vml
::
CRect
*
vml_rect
)
{
if
(
vml_rect
==
NULL
)
return
;
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
stat
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_rect
);
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
dynam
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_rect
);
convert
(
vml_common
);
}
...
...
@@ -579,7 +579,7 @@ void OoxConverter::convert(OOX::Vml::CRoundRect *vml_roundrect)
{
if
(
vml_roundrect
==
NULL
)
return
;
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
stat
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_roundrect
);
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
dynam
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_roundrect
);
convert
(
vml_common
);
}
...
...
@@ -587,7 +587,7 @@ void OoxConverter::convert(OOX::Vml::CCurve *vml_curve)
{
if
(
vml_curve
==
NULL
)
return
;
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
stat
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_curve
);
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
dynam
ic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_curve
);
convert
(
vml_common
);
}
void
OoxConverter
::
convert
(
OOX
::
Vml
::
CShadow
*
vml_shadow
)
...
...
@@ -905,7 +905,7 @@ void OoxConverter::convert(OOX::Vml::CGroup *vml_group)
if
(
vml_group
->
m_arrItems
[
i
]
->
getType
()
==
OOX
::
et_v_group
)
{
OOX
::
Vml
::
CGroup
*
vml
=
stat
ic_cast
<
OOX
::
Vml
::
CGroup
*>
(
vml_group
->
m_arrItems
[
i
]);
OOX
::
Vml
::
CGroup
*
vml
=
dynam
ic_cast
<
OOX
::
Vml
::
CGroup
*>
(
vml_group
->
m_arrItems
[
i
]);
convert
(
vml
);
continue
;
}
...
...
@@ -919,7 +919,7 @@ void OoxConverter::convert(OOX::Vml::CGroup *vml_group)
{
case
OOX
:
:
et_v_shape
:
{
OOX
::
Vml
::
CShape
*
vml
=
stat
ic_cast
<
OOX
::
Vml
::
CShape
*>
(
vml_group
->
m_arrItems
[
i
]);
OOX
::
Vml
::
CShape
*
vml
=
dynam
ic_cast
<
OOX
::
Vml
::
CShape
*>
(
vml_group
->
m_arrItems
[
i
]);
bool
bSet
=
false
;
if
(
vml
)
{
...
...
@@ -952,7 +952,7 @@ void OoxConverter::convert(OOX::Vml::CGroup *vml_group)
}
break
;
case
OOX
:
:
et_v_shapetype
:
{
OOX
::
Vml
::
CShapeType
*
vml
=
stat
ic_cast
<
OOX
::
Vml
::
CShapeType
*>
(
vml_group
->
m_arrItems
[
i
]);
OOX
::
Vml
::
CShapeType
*
vml
=
dynam
ic_cast
<
OOX
::
Vml
::
CShapeType
*>
(
vml_group
->
m_arrItems
[
i
]);
SimpleTypes
::
Vml
::
SptType
sptType
=
vml
->
m_oSpt
.
IsInit
()
?
static_cast
<
SimpleTypes
::
Vml
::
SptType
>
(
vml
->
m_oSpt
->
GetValue
())
:
SimpleTypes
::
Vml
::
sptNotPrimitive
;
odf_context
()
->
drawing_context
()
->
start_shape
(
OOX
::
VmlShapeType2PrstShape
(
sptType
));
...
...
@@ -961,28 +961,28 @@ void OoxConverter::convert(OOX::Vml::CGroup *vml_group)
}
break
;
case
OOX
:
:
et_v_oval
:
{
OOX
::
Vml
::
COval
*
vml
=
stat
ic_cast
<
OOX
::
Vml
::
COval
*>
(
vml_group
->
m_arrItems
[
i
]);
OOX
::
Vml
::
COval
*
vml
=
dynam
ic_cast
<
OOX
::
Vml
::
COval
*>
(
vml_group
->
m_arrItems
[
i
]);
odf_context
()
->
drawing_context
()
->
start_shape
(
SimpleTypes
::
shapetypeEllipse
);
OoxConverter
::
convert
(
vml
);
odf_context
()
->
drawing_context
()
->
end_shape
();
}
break
;
case
OOX
:
:
et_v_rect
:
{
OOX
::
Vml
::
CRect
*
vml
=
stat
ic_cast
<
OOX
::
Vml
::
CRect
*>
(
vml_group
->
m_arrItems
[
i
]);
OOX
::
Vml
::
CRect
*
vml
=
dynam
ic_cast
<
OOX
::
Vml
::
CRect
*>
(
vml_group
->
m_arrItems
[
i
]);
odf_context
()
->
drawing_context
()
->
start_shape
(
SimpleTypes
::
shapetypeRect
);
OoxConverter
::
convert
(
vml
);
odf_context
()
->
drawing_context
()
->
end_shape
();
}
break
;
case
OOX
:
:
et_v_line
:
{
OOX
::
Vml
::
CLine
*
vml
=
stat
ic_cast
<
OOX
::
Vml
::
CLine
*>
(
vml_group
->
m_arrItems
[
i
]);
OOX
::
Vml
::
CLine
*
vml
=
dynam
ic_cast
<
OOX
::
Vml
::
CLine
*>
(
vml_group
->
m_arrItems
[
i
]);
odf_context
()
->
drawing_context
()
->
start_shape
(
SimpleTypes
::
shapetypeLine
);
OoxConverter
::
convert
(
vml
);
odf_context
()
->
drawing_context
()
->
end_shape
();
}
break
;
case
OOX
:
:
et_v_curve
:
{
OOX
::
Vml
::
CCurve
*
vml
=
stat
ic_cast
<
OOX
::
Vml
::
CCurve
*>
(
vml_group
->
m_arrItems
[
i
]);
OOX
::
Vml
::
CCurve
*
vml
=
dynam
ic_cast
<
OOX
::
Vml
::
CCurve
*>
(
vml_group
->
m_arrItems
[
i
]);
odf_context
()
->
drawing_context
()
->
start_shape
(
1000
);
OoxConverter
::
convert
(
vml
);
odf_context
()
->
drawing_context
()
->
end_shape
();
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
View file @
e0296d5a
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.h
View file @
e0296d5a
...
...
@@ -263,6 +263,7 @@ namespace PPTX
class
Theme
;
namespace
Logic
{
class
ClrMap
;
class
SpTreeElem
;
class
GraphicFrame
;
class
SpTree
;
...
...
@@ -340,9 +341,11 @@ public:
double
getSystemDPI
();
//.......................................................................................................................
virtual
cpdoccore
::
odf_writer
::
odf_conversion_context
*
odf_context
()
=
0
;
virtual
PPTX
::
Theme
*
oox_theme
()
=
0
;
virtual
std
::
wstring
find_link_by_id
(
std
::
wstring
sId
,
int
t
)
=
0
;
virtual
cpdoccore
::
odf_writer
::
odf_conversion_context
*
odf_context
()
=
0
;
virtual
PPTX
::
Theme
*
oox_theme
()
=
0
;
virtual
PPTX
::
Logic
::
ClrMap
*
oox_clrMap
()
{
return
NULL
;}
virtual
std
::
wstring
find_link_by_id
(
std
::
wstring
sId
,
int
t
)
=
0
;
virtual
NSCommon
::
smart_ptr
<
OOX
::
File
>
find_file_by_id
(
std
::
wstring
sId
)
=
0
;
OOX
::
IFileContainer
*
oox_current_child_document
;
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
View file @
e0296d5a
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
View file @
e0296d5a
...
...
@@ -80,14 +80,17 @@ PptxConverter::PptxConverter(const std::wstring & path, const ProgressCallback*
output_document
=
new
odf_writer
::
package
::
odf_document
(
L"presentation"
);
odp_context
=
new
odf_writer
::
odp_conversion_context
(
output_document
);
current_clrMap
=
NULL
;
current_slide
=
NULL
;
current_theme
=
NULL
;
pCallBack
=
CallBack
;
if
(
UpdateProgress
(
290000
))
return
;
}
PptxConverter
::~
PptxConverter
()
{
current_clrMap
=
NULL
;
current_slide
=
NULL
;
current_theme
=
NULL
;
presentation
=
NULL
;
...
...
@@ -112,6 +115,10 @@ PPTX::Theme* PptxConverter::oox_theme()
{
return
current_theme
;
}
PPTX
::
Logic
::
ClrMap
*
PptxConverter
::
oox_clrMap
()
{
return
current_clrMap
;
}
NSCommon
::
smart_ptr
<
OOX
::
File
>
PptxConverter
::
find_file_by_id
(
std
::
wstring
sId
)
{
...
...
@@ -205,20 +212,44 @@ void PptxConverter::convert_slides()
{
continue
;
// странное ... слайд 38 в FY10_September_Partner_Call.pptx
}
current_slide
=
slide
.
operator
->
();
current_theme
=
slide
->
theme
.
operator
->
();
std
::
wstring
master_style_name
;
std
::
wstring
layout_style_name
;
if
(
slide
->
Master
.
IsInit
())
{
current_clrMap
=
&
slide
->
Master
->
clrMap
;
std
::
map
<
std
::
wstring
,
std
::
wstring
>::
iterator
pFind
=
m_mapMasters
.
find
(
slide
->
Master
->
m_sOutputFilename
);
if
(
pFind
==
m_mapMasters
.
end
())
{
current_slide
=
slide
->
Master
.
operator
->
();
master_style_name
=
odp_context
->
start_master_slide
();
convert
(
&
slide
->
Master
->
cSld
);
odp_context
->
end_master_slide
();
m_mapMasters
.
insert
(
std
::
make_pair
(
slide
->
Master
->
m_sOutputFilename
,
master_style_name
));
}
else
master_style_name
=
pFind
->
second
;
}
if
(
slide
->
clrMapOvr
.
IsInit
())
current_clrMap
=
slide
->
clrMapOvr
->
overrideClrMapping
.
GetPointer
();
//smart_ptr<SlideLayout> Layout;
//smart_ptr<SlideMaster> Master;
current_slide
=
slide
.
operator
->
();
odp_context
->
start_slide
();
convert
(
slide
->
cSld
.
GetPointer
());
odp_context
->
current_slide
().
set_master_page
(
master_style_name
);
//odp_context->current_slide().set_layout_style(layout_style_name);
//nullable_bool show;
//nullable_bool showMasterPhAnim;
//nullable_bool showMasterSp;
convert
(
slide
->
cSld
.
GetPointer
());
//nullable<Logic::ClrMapOvr> clrMapOvr;
//nullable<Logic::CSld> cSld;
//nullable<Logic::Transition> transition;
//nullable<Logic::Timing> timing;
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.h
View file @
e0296d5a
...
...
@@ -85,9 +85,11 @@ namespace Oox2Odf
virtual
void
convertDocument
();
virtual
void
write
(
const
std
::
wstring
&
path
);
virtual
odf_writer
::
odf_conversion_context
*
odf_context
();
virtual
odf_writer
::
odf_conversion_context
*
odf_context
();
virtual
PPTX
::
Theme
*
oox_theme
();
virtual
std
::
wstring
find_link_by_id
(
std
::
wstring
sId
,
int
t
);
virtual
PPTX
::
Logic
::
ClrMap
*
oox_clrMap
();
virtual
std
::
wstring
find_link_by_id
(
std
::
wstring
sId
,
int
t
);
virtual
NSCommon
::
smart_ptr
<
OOX
::
File
>
find_file_by_id
(
std
::
wstring
sId
);
void
convert
(
OOX
::
WritingElement
*
oox_unknown
);
...
...
@@ -99,9 +101,14 @@ namespace Oox2Odf
cpdoccore
::
odf_writer
::
package
::
odf_document
*
output_document
;
PPTX
::
Theme
*
current_theme
;
OOX
::
IFileContainer
*
current_slide
;
PPTX
::
Logic
::
ClrMap
*
current_clrMap
;
odf_writer
::
odp_conversion_context
*
odp_context
;
std
::
map
<
std
::
wstring
,
std
::
wstring
>
m_mapMasters
;
std
::
vector
<
std
::
wstring
>
m_arLayouts
;
void
convert_slides
();
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
View file @
e0296d5a
...
...
@@ -527,7 +527,7 @@ void XlsxConverter::convert_sharing_string(int number)
if
(
number
<
0
||
(
SharedStrings
->
m_oCount
.
IsInit
()
&&
number
>
SharedStrings
->
m_oCount
->
GetValue
()))
return
;
//???? m_oUniqueCount;
convert
(
stat
ic_cast
<
OOX
::
Spreadsheet
::
CSi
*>
(
SharedStrings
->
m_arrItems
[
number
]));
convert
(
dynam
ic_cast
<
OOX
::
Spreadsheet
::
CSi
*>
(
SharedStrings
->
m_arrItems
[
number
]));
}
void
XlsxConverter
::
convert
(
OOX
::
Spreadsheet
::
CSi
*
oox_rtf_text
)
...
...
@@ -552,27 +552,27 @@ void XlsxConverter::convert(OOX::Spreadsheet::WritingElement *oox_unknown)
{
case
OOX
:
:
et_x_r
:
{
OOX
::
Spreadsheet
::
CRun
*
pRun
=
stat
ic_cast
<
OOX
::
Spreadsheet
::
CRun
*>
(
oox_unknown
);
OOX
::
Spreadsheet
::
CRun
*
pRun
=
dynam
ic_cast
<
OOX
::
Spreadsheet
::
CRun
*>
(
oox_unknown
);
convert
(
pRun
);
}
break
;
case
OOX
:
:
et_x_t
:
{
OOX
::
Spreadsheet
::
CText
*
pText
=
stat
ic_cast
<
OOX
::
Spreadsheet
::
CText
*>
(
oox_unknown
);
OOX
::
Spreadsheet
::
CText
*
pText
=
dynam
ic_cast
<
OOX
::
Spreadsheet
::
CText
*>
(
oox_unknown
);
convert
(
pText
);
}
break
;
case
OOX
:
:
et_x_IconSet
:
{
OOX
::
Spreadsheet
::
CIconSet
*
pIc
=
stat
ic_cast
<
OOX
::
Spreadsheet
::
CIconSet
*>
(
oox_unknown
);
OOX
::
Spreadsheet
::
CIconSet
*
pIc
=
dynam
ic_cast
<
OOX
::
Spreadsheet
::
CIconSet
*>
(
oox_unknown
);
convert
(
pIc
);
}
break
;
case
OOX
:
:
et_x_DataBar
:
{
OOX
::
Spreadsheet
::
CDataBar
*
pB
=
stat
ic_cast
<
OOX
::
Spreadsheet
::
CDataBar
*>
(
oox_unknown
);
OOX
::
Spreadsheet
::
CDataBar
*
pB
=
dynam
ic_cast
<
OOX
::
Spreadsheet
::
CDataBar
*>
(
oox_unknown
);
convert
(
pB
);
}
break
;
case
OOX
:
:
et_x_FormulaCF
:
{
OOX
::
Spreadsheet
::
CFormulaCF
*
pF
=
stat
ic_cast
<
OOX
::
Spreadsheet
::
CFormulaCF
*>
(
oox_unknown
);
OOX
::
Spreadsheet
::
CFormulaCF
*
pF
=
dynam
ic_cast
<
OOX
::
Spreadsheet
::
CFormulaCF
*>
(
oox_unknown
);
convert
(
pF
);
}
break
;
default:
...
...
@@ -1774,22 +1774,22 @@ void XlsxConverter::convert(OOX::Spreadsheet::CFromTo* oox_from_to, oox_table_po
// {
// case OOX::et_x_Shape:
// {
// OOX::Spreadsheet::CShape* item =
stat
ic_cast<OOX::Spreadsheet::CShape*>(oox_group_shape->m_arrItems[i]);
// OOX::Spreadsheet::CShape* item =
dynam
ic_cast<OOX::Spreadsheet::CShape*>(oox_group_shape->m_arrItems[i]);
// convert(item);
// }break;
// case OOX::et_x_ConnShape:
// {
// OOX::Spreadsheet::CConnShape* item =
stat
ic_cast<OOX::Spreadsheet::CConnShape*>(oox_group_shape->m_arrItems[i]);
// OOX::Spreadsheet::CConnShape* item =
dynam
ic_cast<OOX::Spreadsheet::CConnShape*>(oox_group_shape->m_arrItems[i]);
// convert(item);
// }break;
// case OOX::et_x_GroupShape:
// {
// OOX::Spreadsheet::CGroupShape* item =
stat
ic_cast<OOX::Spreadsheet::CGroupShape*>(oox_group_shape->m_arrItems[i]);
// OOX::Spreadsheet::CGroupShape* item =
dynam
ic_cast<OOX::Spreadsheet::CGroupShape*>(oox_group_shape->m_arrItems[i]);
// convert(item);
// }break;
// case OOX::et_x_Pic:
// {
// OOX::Spreadsheet::CPic* item =
stat
ic_cast<OOX::Spreadsheet::CPic*>(oox_group_shape->m_arrItems[i]);
// OOX::Spreadsheet::CPic* item =
dynam
ic_cast<OOX::Spreadsheet::CPic*>(oox_group_shape->m_arrItems[i]);
// convert(item);
// }break;
// }
...
...
@@ -2045,7 +2045,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CColorScale *oox_cond_colorscale)
else
{
_CP_OPT
(
odf_types
::
color
)
color
;
convert
(
stat
ic_cast
<
OOX
::
Spreadsheet
::
CColor
*>
(
oox_cond_colorscale
->
m_arrItems
[
i
]),
color
);
convert
(
dynam
ic_cast
<
OOX
::
Spreadsheet
::
CColor
*>
(
oox_cond_colorscale
->
m_arrItems
[
i
]),
color
);
ods_context
->
current_table
().
add_conditional_colorscale
(
color
);
}
}
...
...
ASCOfficePPTXFile/PPTXFormat/SlideLayout.h
View file @
e0296d5a
...
...
@@ -77,7 +77,7 @@ namespace PPTX
public:
virtual
void
read
(
const
OOX
::
CPath
&
filename
,
FileMap
&
map
)
{
//FileContainer::read(filename, map
);
m_sOutputFilename
=
filename
.
GetFilename
(
);
XmlUtils
::
CXmlNode
oNode
;
oNode
.
FromXmlFile
(
filename
.
m_strFilename
);
...
...
ASCOfficePPTXFile/PPTXFormat/SlideMaster.h
View file @
e0296d5a
...
...
@@ -76,7 +76,8 @@ namespace PPTX
public:
virtual
void
read
(
const
OOX
::
CPath
&
filename
,
FileMap
&
map
)
{
//FileContainer::read(filename, map);
m_sOutputFilename
=
filename
.
GetFilename
();
XmlUtils
::
CXmlNode
oNode
;
oNode
.
FromXmlFile
(
filename
.
m_strFilename
);
...
...
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