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
60f61109
Commit
60f61109
authored
May 09, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatReader - presentation slide notes
parent
4201bcec
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
606 additions
and
235 deletions
+606
-235
ASCOfficeOdfFile/src/docx/drawing_object_description.h
ASCOfficeOdfFile/src/docx/drawing_object_description.h
+2
-0
ASCOfficeOdfFile/src/docx/pptx_conversion_context.cpp
ASCOfficeOdfFile/src/docx/pptx_conversion_context.cpp
+106
-45
ASCOfficeOdfFile/src/docx/pptx_conversion_context.h
ASCOfficeOdfFile/src/docx/pptx_conversion_context.h
+16
-9
ASCOfficeOdfFile/src/docx/pptx_output_xml.cpp
ASCOfficeOdfFile/src/docx/pptx_output_xml.cpp
+158
-8
ASCOfficeOdfFile/src/docx/pptx_output_xml.h
ASCOfficeOdfFile/src/docx/pptx_output_xml.h
+73
-13
ASCOfficeOdfFile/src/docx/pptx_package.cpp
ASCOfficeOdfFile/src/docx/pptx_package.cpp
+97
-14
ASCOfficeOdfFile/src/docx/pptx_package.h
ASCOfficeOdfFile/src/docx/pptx_package.h
+38
-39
ASCOfficeOdfFile/src/docx/pptx_slide_context.cpp
ASCOfficeOdfFile/src/docx/pptx_slide_context.cpp
+53
-53
ASCOfficeOdfFile/src/docx/pptx_slide_context.h
ASCOfficeOdfFile/src/docx/pptx_slide_context.h
+9
-6
ASCOfficeOdfFile/src/odf/draw_page.cpp
ASCOfficeOdfFile/src/odf/draw_page.cpp
+10
-5
ASCOfficeOdfFile/src/odf/draw_page.h
ASCOfficeOdfFile/src/odf/draw_page.h
+1
-0
ASCOfficeOdfFile/src/odf/styles.cpp
ASCOfficeOdfFile/src/odf/styles.cpp
+5
-4
ASCOfficeOdfFileW/OdfFileWTest/OdfFileWTest.sln
ASCOfficeOdfFileW/OdfFileWTest/OdfFileWTest.sln
+0
-17
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
+4
-4
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
+4
-4
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
+29
-13
ASCOfficeOdfFileW/source/win32/Oox2OdfConverter.vcproj
ASCOfficeOdfFileW/source/win32/Oox2OdfConverter.vcproj
+1
-1
No files found.
ASCOfficeOdfFile/src/docx/drawing_object_description.h
View file @
60f61109
...
...
@@ -49,6 +49,8 @@ struct _rect
struct
drawing_object_description
{
bool
bNotes_
;
oox
::
RelsType
type_
;
std
::
wstring
name_
;
...
...
ASCOfficeOdfFile/src/docx/pptx_conversion_context.cpp
View file @
60f61109
...
...
@@ -153,7 +153,9 @@ void pptx_conversion_context::process_master_pages()
get_text_context
().
set_process_layouts
(
true
);
//берем только актуальные
for
(
size_t
master_index
=
0
;
master_index
<
masters
.
content
.
size
();
master_index
++
)
odf_reader
::
office_element_ptr
master_notes_
;
for
(
size_t
master_index
=
0
;
master_index
<
masters
.
content
.
size
();
master_index
++
)
{
start_master
(
master_index
);
...
...
@@ -163,10 +165,21 @@ void pptx_conversion_context::process_master_pages()
if
(
master
)
{
master
->
pptx_convert
(
*
this
);
if
(
!
master_notes_
&&
master
->
presentation_notes_
)
master_notes_
=
master
->
presentation_notes_
;
}
end_master
();
}
if
(
master_notes_
)
{
start_master_notes
();
master_notes_
->
pptx_convert
(
*
this
);
end_master_notes
();
}
process_masters_
=
false
;
get_text_context
().
set_process_layouts
(
false
);
...
...
@@ -180,7 +193,7 @@ void pptx_conversion_context::process_theme(std::wstring name)
{
int
current
=
themes_
.
size
()
+
1
;
if
(
name
.
length
()
<
1
)
if
(
name
.
empty
()
)
{
name
=
L"User Theme: "
+
boost
::
lexical_cast
<
std
::
wstring
>
(
current
);
}
...
...
@@ -255,7 +268,7 @@ void pptx_conversion_context::end_document()
}
count
++
;
}
//
/////////////////////////////////////////////////////////////////////////////////////////
//
----------------------------------------------------------------------------------
for
(
size_t
i
=
0
;
i
<
slideLayouts_
.
size
();
i
++
)
{
pptx_xml_slideLayout_ptr
&
slideL
=
slideLayouts_
[
i
];
...
...
@@ -267,10 +280,31 @@ void pptx_conversion_context::end_document()
output_document_
->
get_ppt_files
().
add_slideLayout
(
content
);
//slideMaster.xml
}
//////////////////////////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------------
for
(
size_t
i
=
0
;
i
<
notes_
.
size
();
i
++
)
{
pptx_xml_slideNotes_ptr
&
slideN
=
notes_
[
i
];
package
::
slide_content_ptr
content
=
package
::
slide_content
::
create
();
slideN
->
write_to
(
content
->
content
());
content
->
add_rels
(
slideN
->
Rels
());
//media & links rels
output_document_
->
get_ppt_files
().
add_notes
(
content
);
}
if
(
slideNotesMaster_
)
{
package
::
slide_content_ptr
content
=
package
::
slide_content
::
create
();
slideNotesMaster_
->
write_to
(
content
->
content
());
content
->
add_rels
(
slideNotesMaster_
->
Rels
());
//media & links rels
output_document_
->
get_ppt_files
().
add_notesMaster
(
content
);
}
//----------------------------------------------------------------------------------
//размеры страниц в презентации
odf_reader
::
odf_read_context
&
context
=
root
()
->
odf_context
();
odf_reader
::
page_layout_container
&
pageLayouts
=
context
.
pageLayoutContainer
();
odf_reader
::
odf_read_context
&
context
=
root
()
->
odf_context
();
odf_reader
::
page_layout_container
&
pageLayouts
=
context
.
pageLayoutContainer
();
if
((
pageLayouts
.
master_pages
().
size
()
>
0
)
&&
(
pageLayouts
.
master_pages
()[
0
]
->
attlist_
.
style_name_
))
//default
{
...
...
@@ -308,10 +342,10 @@ void pptx_conversion_context::end_document()
}
package
::
ppt_comments_files_ptr
comments
=
package
::
ppt_comments_files
::
create
(
comments_context_handle_
.
content
());
output_document_
->
get_ppt_files
().
set_presentation
(
presentation_
);
output_document_
->
get_ppt_files
().
set_comments
(
comments
);
output_document_
->
get_ppt_files
().
set_authors_comments
(
authors_comments_
);
output_document_
->
get_ppt_files
().
set_media
(
get_mediaitems
(),
applicationFonts_
);
output_document_
->
get_ppt_files
().
set_presentation
(
presentation_
);
output_document_
->
get_ppt_files
().
set_comments
(
comments
);
output_document_
->
get_ppt_files
().
set_authors_comments
(
authors_comments_
);
output_document_
->
get_ppt_files
().
set_media
(
get_mediaitems
(),
applicationFonts_
);
output_document_
->
get_content_types_file
().
set_media
(
get_mediaitems
());
}
...
...
@@ -321,7 +355,28 @@ void pptx_conversion_context::start_body()
void
pptx_conversion_context
::
end_body
()
{}
pptx_xml_slideNotesMaster
&
pptx_conversion_context
::
current_notesMaster
()
{
if
(
slideNotesMaster_
)
{
return
*
slideNotesMaster_
;
}
else
{
throw
std
::
runtime_error
(
"internal error"
);
}
}
pptx_xml_slideNotes
&
pptx_conversion_context
::
current_notes
()
{
if
(
!
notes_
.
empty
())
{
return
*
notes_
.
back
().
get
();
}
else
{
throw
std
::
runtime_error
(
"internal error"
);
}
}
pptx_xml_slide
&
pptx_conversion_context
::
current_slide
()
{
if
(
!
slides_
.
empty
())
...
...
@@ -384,9 +439,18 @@ pptx_xml_slideMaster & pptx_conversion_context::current_master()
}
void
pptx_conversion_context
::
create_new_slide
(
std
::
wstring
const
&
name
)
{
pptx_xml_slide_ptr
s
=
pptx_xml_slide
::
create
(
name
,
slides_
.
size
()
+
1
);
pptx_xml_slide_ptr
s
=
pptx_xml_slide
::
create
(
name
,
slides_
.
size
()
+
1
);
slides_
.
push_back
(
s
);
}
void
pptx_conversion_context
::
create_new_slideNotes
()
{
pptx_xml_slideNotes_ptr
s
=
pptx_xml_slideNotes
::
create
(
notes_
.
size
()
+
1
);
notes_
.
push_back
(
s
);
}
void
pptx_conversion_context
::
create_new_slideNotesMaster
()
{
slideNotesMaster_
=
pptx_xml_slideNotesMaster
::
create
();
}
void
pptx_conversion_context
::
create_new_slideLayout
(
int
id
)
{
pptx_xml_slideLayout_ptr
s
=
pptx_xml_slideLayout
::
create
(
id
);
...
...
@@ -397,7 +461,6 @@ void pptx_conversion_context::create_new_slideMaster(int id)
pptx_xml_slideMaster_ptr
s
=
pptx_xml_slideMaster
::
create
(
id
);
slideMasters_
.
push_back
(
s
);
}
bool
pptx_conversion_context
::
start_page
(
const
std
::
wstring
&
pageName
,
const
std
::
wstring
&
pageStyleName
,
const
std
::
wstring
&
pageLayoutName
,
const
std
::
wstring
&
pageMasterName
)
...
...
@@ -414,7 +477,7 @@ bool pptx_conversion_context::start_page(const std::wstring & pageName, const st
root
()
->
odf_context
().
styleContainer
().
presentation_layouts
().
add_or_find
(
pageLayoutName
,
pageMasterName
);
current_slide
().
Rels
().
add
(
relationship
(
layout_id
.
second
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"
,
std
::
wstring
(
L"../slideLayouts/slideLayout"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
layout_id
.
first
)
+
L".xml"
));
std
::
wstring
(
L"../slideLayouts/slideLayout"
)
+
std
::
to_wstring
(
layout_id
.
first
)
+
L".xml"
));
return
true
;
}
...
...
@@ -530,47 +593,45 @@ void pptx_conversion_context::end_page()
get_slide_context
().
end_slide
();
}
bool
pptx_conversion_context
::
start_note
(
const
std
::
wstring
&
pageName
,
const
std
::
wstring
&
pageStyleName
,
const
std
::
wstring
&
pageLayoutName
,
const
std
::
wstring
&
pageMasterName
)
bool
pptx_conversion_context
::
start_page_notes
()
{
// create_new_slide(pageName);
//get_slide_context().start_note();//pageName, pageStyleName);
create_new_slideNotes
(
);
//current_master_page_name_ = pageMasterName;
//current_layout_page_name_ = pageLayoutName;
//
////const std::wstring masterPageNameLayout = root()->odf_context().pageLayoutContainer().page_layout_name_by_style(current_master_page_name_);
current_slide
().
Rels
().
add
(
relationship
(
current_notes
().
rId
(),
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"
,
std
::
wstring
(
L"../notesSlides/notesSlide"
)
+
std
::
to_wstring
(
notes_
.
size
())
+
L".xml"
));
get_slide_context
().
start_slide
();
return
true
;
}
//std::pair<int,std::wstring> layout_id =
// root()->odf_context().styleContainer().presentation_layouts().add_or_find(pageLayoutName,pageMasterName);
void
pptx_conversion_context
::
end_page_notes
()
{
get_slide_context
().
serialize_background
(
current_notes
().
Background
());
get_slide_context
().
serialize_objects
(
current_notes
().
Data
());
//current_slide().Rels().add(relationship(layout_id.second, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",
// std::wstring(L"../slideLayouts/slideLayout") + boost::lexical_cast<std::wstring>(layout_id.first) + L".xml"));
get_slide_context
().
dump_rels
(
current_notes
().
Rels
());
//hyperlinks, mediaitems, ...
return
true
;
get_slide_context
().
end_slide
()
;
}
void
pptx_conversion_context
::
end_note
()
bool
pptx_conversion_context
::
start_master_notes
()
{
//if (!get_comments_context().empty())
// {
// std::wstringstream strm;
// get_comments_context().serialize(strm);
//
// const std::pair<std::wstring, std::wstring> commentsName =
// comments_context_handle_.add_comments_xml(strm.str(), get_comments_context().get_comments() );
create_new_slideNotesMaster
(
);
//
get_slide_context().add_rels(false, commentsName.second, L"../comments/" + commentsName.first, typeComment);
//
}
//
current_slide().Rels().add(relationship(current_notes().rId(), L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide",
//
std::wstring(L"../notesSlides/notesSlide") + std::to_wstring(notes_.size()) + L".xml"));
//get_slide_context().serialize_background(current_slide().Background());
//get_slide_context().serialize_objects (current_slide().Data());
//get_slide_context().serialize_animations(current_slide().Timing());
//
//get_slide_context().dump_rels(current_slide().Rels());//hyperlinks, mediaitems, ...
get_slide_context
().
start_slide
();
return
true
;
}
//get_slide_context().end_slide();
void
pptx_conversion_context
::
end_master_notes
()
{
get_slide_context
().
serialize_background
(
current_notesMaster
().
Background
());
get_slide_context
().
serialize_objects
(
current_notesMaster
().
Data
());
get_slide_context
().
dump_rels
(
current_notesMaster
().
Rels
());
//hyperlinks, mediaitems, ...
get_slide_context
().
end_slide
();
}
void
pptx_conversion_context
::
end_layout
()
{
...
...
ASCOfficeOdfFile/src/docx/pptx_conversion_context.h
View file @
60f61109
...
...
@@ -88,11 +88,11 @@ public:
const
std
::
wstring
&
pageMasterName
);
void
end_page
();
bool
start_
note
(
const
std
::
wstring
&
pageName
,
const
std
::
wstring
&
pageStyleName
,
const
std
::
wstring
&
pageLayoutName
,
const
std
::
wstring
&
pageMasterName
);
void
end_
note
();
bool
start_
page_notes
();
void
end_page_notes
();
bool
start_master_notes
(
);
void
end_
master_notes
();
bool
start_layout
(
int
layout_index
);
void
end_layout
();
...
...
@@ -113,10 +113,13 @@ public:
return
odf_document_
;
}
pptx_xml_slide
&
current_slide
();
pptx_xml_slideLayout
&
current_layout
();
pptx_xml_slideMaster
&
current_master
();
pptx_xml_theme
&
current_theme
();
pptx_xml_slide
&
current_slide
();
pptx_xml_slideLayout
&
current_layout
();
pptx_xml_slideMaster
&
current_master
();
pptx_xml_theme
&
current_theme
();
pptx_xml_slideNotes
&
current_notes
();
pptx_xml_slideNotesMaster
&
current_notesMaster
();
pptx_xml_presentation
&
current_presentation
();
//собственно она одна
oox_chart_context
&
current_chart
();
...
...
@@ -144,6 +147,8 @@ private:
void
create_new_slide
(
std
::
wstring
const
&
name
);
void
create_new_slideLayout
(
int
id
);
void
create_new_slideMaster
(
int
id
);
void
create_new_slideNotes
();
void
create_new_slideNotesMaster
();
package
::
pptx_document
*
output_document_
;
odf_reader
::
odf_document
*
odf_document_
;
...
...
@@ -158,10 +163,12 @@ private:
std
::
vector
<
oox_chart_context_ptr
>
charts_
;
std
::
vector
<
pptx_xml_slide_ptr
>
slides_
;
std
::
vector
<
pptx_xml_slideNotes_ptr
>
notes_
;
std
::
vector
<
pptx_xml_slideMaster_ptr
>
slideMasters_
;
std
::
vector
<
pptx_xml_slideLayout_ptr
>
slideLayouts_
;
std
::
vector
<
pptx_xml_theme_ptr
>
themes_
;
pptx_xml_slideNotesMaster_ptr
slideNotesMaster_
;
pptx_xml_authors_comments_ptr
authors_comments_
;
pptx_xml_presentation
presentation_
;
...
...
ASCOfficeOdfFile/src/docx/pptx_output_xml.cpp
View file @
60f61109
...
...
@@ -41,7 +41,7 @@
namespace
cpdoccore
{
namespace
oox
{
//---------------------------------------------------------------------------------------------------------
std
::
wstring
pptx_xml_slide
::
name
()
const
{
return
name_
;
...
...
@@ -53,7 +53,7 @@ std::wstring pptx_xml_slide::rId() const
pptx_xml_slide_ptr
pptx_xml_slide
::
create
(
std
::
wstring
const
&
name
,
int
id
)
{
const
std
::
wstring
rId
=
std
::
wstring
(
L"sId"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
id
);
const
std
::
wstring
rId
=
std
::
wstring
(
L"sId"
)
+
std
::
to_wstring
(
id
);
return
boost
::
make_shared
<
pptx_xml_slide
>
(
name
,
rId
);
}
...
...
@@ -115,7 +115,7 @@ void pptx_xml_slide::write_to(std::wostream & strm)
}
}
}
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
---------------------------------------------------------------------------------------------------------
std
::
wstring
pptx_xml_slideLayout
::
rId
()
const
{
return
rId_
;
...
...
@@ -123,7 +123,7 @@ std::wstring pptx_xml_slideLayout::rId() const
pptx_xml_slideLayout_ptr
pptx_xml_slideLayout
::
create
(
int
id
)
{
const
std
::
wstring
rId
=
std
::
wstring
(
L"lrId"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
id
);
const
std
::
wstring
rId
=
std
::
wstring
(
L"lrId"
)
+
std
::
to_wstring
(
id
);
return
boost
::
make_shared
<
pptx_xml_slideLayout
>
(
rId
);
}
...
...
@@ -189,7 +189,7 @@ void pptx_xml_slideLayout::write_to(std::wostream & strm)
}
}
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
---------------------------------------------------------------------------------------------------------
std
::
wstring
pptx_xml_slideMaster
::
rId
()
const
{
return
rId_
;
...
...
@@ -197,7 +197,7 @@ std::wstring pptx_xml_slideMaster::rId() const
pptx_xml_slideMaster_ptr
pptx_xml_slideMaster
::
create
(
int
id
)
{
const
std
::
wstring
rId
=
std
::
wstring
(
L"smId"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
id
);
const
std
::
wstring
rId
=
std
::
wstring
(
L"smId"
)
+
std
::
to_wstring
(
id
);
return
boost
::
make_shared
<
pptx_xml_slideMaster
>
(
rId
,
id
);
}
...
...
@@ -229,7 +229,7 @@ rels & pptx_xml_slideMaster::Rels()
void
pptx_xml_slideMaster
::
add_theme
(
int
id
,
const
std
::
wstring
&
tId
)
{
rels_
.
add
(
relationship
(
tId
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"
,
std
::
wstring
(
L"../theme/theme"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
id
)
+
L".xml"
));
std
::
wstring
(
L"../theme/theme"
)
+
std
::
to_wstring
(
id
)
+
L".xml"
));
}
void
pptx_xml_slideMaster
::
add_layout
(
int
id
,
const
std
::
wstring
&
rId
,
const
unsigned
int
&
uniqId
)
...
...
@@ -237,7 +237,7 @@ void pptx_xml_slideMaster::add_layout(int id, const std::wstring & rId, const un
layoutsId_
.
push_back
(
std
::
pair
<
std
::
wstring
,
unsigned
int
>
(
rId
,
uniqId
));
rels_
.
add
(
relationship
(
rId
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"
,
std
::
wstring
(
L"../slideLayouts/slideLayout"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
id
)
+
L".xml"
));
std
::
wstring
(
L"../slideLayouts/slideLayout"
)
+
std
::
to_wstring
(
id
)
+
L".xml"
));
}
void
pptx_xml_slideMaster
::
write_to
(
std
::
wostream
&
strm
)
...
...
@@ -299,6 +299,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
}
}
//---------------------------------------------------------------------------------------------------------
pptx_xml_theme_ptr
pptx_xml_theme
::
create
(
std
::
wstring
const
&
name
,
int
id
)
{
return
boost
::
make_shared
<
pptx_xml_theme
>
(
name
,
id
);
...
...
@@ -336,6 +337,7 @@ void pptx_xml_theme::write_to(std::wostream & strm)
}
}
}
//---------------------------------------------------------------------------------------------------------
pptx_xml_authors_comments_ptr
pptx_xml_authors_comments
::
create
()
{
return
boost
::
make_shared
<
pptx_xml_authors_comments
>
();
...
...
@@ -399,6 +401,7 @@ void pptx_xml_authors_comments::write_to(std::wostream & strm)
}
}
//---------------------------------------------------------------------------------------------------------
void
pptx_xml_presentation
::
write_to
(
std
::
wostream
&
strm
)
{
CP_XML_WRITER
(
strm
)
...
...
@@ -428,5 +431,152 @@ void pptx_xml_presentation::write_to(std::wostream & strm)
}
}
}
//---------------------------------------------------------------------------------------------------------
std
::
wstring
pptx_xml_slideNotes
::
rId
()
const
{
return
rId_
;
}
pptx_xml_slideNotes_ptr
pptx_xml_slideNotes
::
create
(
int
id
)
{
const
std
::
wstring
rId
=
std
::
wstring
(
L"nId"
)
+
std
::
to_wstring
(
id
);
return
boost
::
make_shared
<
pptx_xml_slideNotes
>
(
rId
);
}
pptx_xml_slideNotes
::
pptx_xml_slideNotes
(
std
::
wstring
const
&
id
)
{
rId_
=
id
;
}
pptx_xml_slideNotes
::~
pptx_xml_slideNotes
()
{
}
std
::
wostream
&
pptx_xml_slideNotes
::
Data
()
{
return
slideData_
;
}
std
::
wostream
&
pptx_xml_slideNotes
::
Background
()
{
return
slideBackground_
;
}
rels
&
pptx_xml_slideNotes
::
Rels
()
{
return
rels_
;
}
void
pptx_xml_slideNotes
::
write_to
(
std
::
wostream
&
strm
)
{
CP_XML_WRITER
(
strm
)
{
CP_XML_NODE
(
L"p:notes"
)
{
CP_XML_ATTR
(
L"xmlns:a"
,
L"http://schemas.openxmlformats.org/drawingml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:p"
,
L"http://schemas.openxmlformats.org/presentationml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:r"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
);
CP_XML_ATTR
(
L"xmlns:p14"
,
L"http://schemas.microsoft.com/office/powerpoint/2010/main"
);
CP_XML_ATTR
(
L"xmlns:p15"
,
L"http://schemas.microsoft.com/office/powerpoint/2012/main"
);
CP_XML_ATTR
(
L"xmlns:mc"
,
L"http://schemas.openxmlformats.org/markup-compatibility/2006"
);
CP_XML_NODE
(
L"p:cSld"
)
{
CP_XML_STREAM
()
<<
slideBackground_
.
str
();
CP_XML_NODE
(
L"p:spTree"
)
{
CP_XML_STREAM
()
<<
slideData_
.
str
();
}
}
CP_XML_NODE
(
L"p:clrMapOvr"
)
{
CP_XML_NODE
(
L"a:masterClrMapping"
);
}
}
}
}
//---------------------------------------------------------------------------------------------------------
std
::
wstring
pptx_xml_slideNotesMaster
::
rId
()
const
{
return
rId_
;
}
pptx_xml_slideNotesMaster_ptr
pptx_xml_slideNotesMaster
::
create
()
{
const
std
::
wstring
rId
=
std
::
wstring
(
L"nmId1"
);
return
boost
::
make_shared
<
pptx_xml_slideNotesMaster
>
(
rId
,
1
);
}
pptx_xml_slideNotesMaster
::
pptx_xml_slideNotesMaster
(
std
::
wstring
const
&
rId
,
int
id
)
{
rId_
=
rId
;
id_
=
id
;
}
pptx_xml_slideNotesMaster
::~
pptx_xml_slideNotesMaster
()
{
}
std
::
wostream
&
pptx_xml_slideNotesMaster
::
Data
()
{
return
slideMasterData_
;
}
std
::
wostream
&
pptx_xml_slideNotesMaster
::
Background
()
{
return
slideMasterBackground_
;
}
rels
&
pptx_xml_slideNotesMaster
::
Rels
()
{
return
rels_
;
}
void
pptx_xml_slideNotesMaster
::
add_theme
(
int
id
,
const
std
::
wstring
&
tId
)
{
rels_
.
add
(
relationship
(
tId
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"
,
std
::
wstring
(
L"../theme/theme"
)
+
std
::
to_wstring
(
id
)
+
L".xml"
));
}
void
pptx_xml_slideNotesMaster
::
write_to
(
std
::
wostream
&
strm
)
{
CP_XML_WRITER
(
strm
)
{
CP_XML_NODE
(
L"p:notesMaster"
)
{
CP_XML_ATTR
(
L"xmlns:a"
,
L"http://schemas.openxmlformats.org/drawingml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:p"
,
L"http://schemas.openxmlformats.org/presentationml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:r"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
);
CP_XML_ATTR
(
L"xmlns:p14"
,
L"http://schemas.microsoft.com/office/powerpoint/2010/main"
);
CP_XML_ATTR
(
L"xmlns:p15"
,
L"http://schemas.microsoft.com/office/powerpoint/2012/main"
);
CP_XML_ATTR
(
L"xmlns:mc"
,
L"http://schemas.openxmlformats.org/markup-compatibility/2006"
);
CP_XML_NODE
(
L"p:cSld"
)
{
CP_XML_STREAM
()
<<
slideMasterBackground_
.
str
();
CP_XML_NODE
(
L"p:spTree"
)
{
CP_XML_STREAM
()
<<
slideMasterData_
.
str
();
}
}
CP_XML_NODE
(
L"p:clrMap"
)
{
CP_XML_ATTR
(
L"folHlink"
,
L"folHlink"
);
CP_XML_ATTR
(
L"hlink"
,
L"hlink"
);
CP_XML_ATTR
(
L"accent6"
,
L"accent6"
);
CP_XML_ATTR
(
L"accent5"
,
L"accent5"
);
CP_XML_ATTR
(
L"accent4"
,
L"accent4"
);
CP_XML_ATTR
(
L"accent3"
,
L"accent5"
);
CP_XML_ATTR
(
L"accent2"
,
L"accent2"
);
CP_XML_ATTR
(
L"accent1"
,
L"accent1"
);
CP_XML_ATTR
(
L"tx2"
,
L"dk2"
);
CP_XML_ATTR
(
L"tx1"
,
L"dk1"
);
CP_XML_ATTR
(
L"bg2"
,
L"lt2"
);
CP_XML_ATTR
(
L"bg1"
,
L"lt1"
);
}
CP_XML_NODE
(
L"p:notesStyle"
)
{
}
}
}
}
//---------------------------------------------------------------------------------------------------------
}
}
ASCOfficeOdfFile/src/docx/pptx_output_xml.h
View file @
60f61109
...
...
@@ -49,7 +49,7 @@ class pptx_xml_slide: noncopyable
public:
pptx_xml_slide
(
std
::
wstring
const
&
name
,
std
::
wstring
const
&
id
);
~
pptx_xml_slide
();
public:
std
::
wstring
name
()
const
;
std
::
wstring
rId
()
const
;
...
...
@@ -72,19 +72,47 @@ private:
rels
rels_
;
};
////////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------------
class
pptx_xml_slideNotes
;
typedef
_CP_PTR
(
pptx_xml_slideNotes
)
pptx_xml_slideNotes_ptr
;
class
pptx_xml_slideNotes
:
noncopyable
{
public:
pptx_xml_slideNotes
(
std
::
wstring
const
&
id
);
~
pptx_xml_slideNotes
();
std
::
wstring
rId
()
const
;
std
::
wostream
&
Data
();
std
::
wostream
&
Background
();
rels
&
Rels
();
void
write_to
(
std
::
wostream
&
strm
);
static
pptx_xml_slideNotes_ptr
create
(
int
id
);
private:
std
::
wstringstream
slideData_
;
std
::
wstringstream
slideBackground_
;
std
::
wstring
rId_
;
rels
rels_
;
};
//------------------------------------------------------------------------------------
class
pptx_xml_presentation
:
noncopyable
{
public:
pptx_xml_presentation
(){}
~
pptx_xml_presentation
(){}
std
::
wstringstream
&
slidesData
(){
return
slidesData_
;}
std
::
wstringstream
&
slideMastersData
(){
return
slideMastersData_
;}
std
::
wstringstream
&
notesSlidesData
(){
return
notesSlidesData_
;}
std
::
wstringstream
&
slidesData
()
{
return
slidesData_
;}
std
::
wstringstream
&
slideMastersData
()
{
return
slideMastersData_
;}
std
::
wstringstream
&
notesSlidesData
()
{
return
notesSlidesData_
;}
std
::
wstringstream
&
slidesProperties
(){
return
slidesProperties_
;}
std
::
wstringstream
&
notesSlidesSize
(){
return
notesSlidesSize_
;}
std
::
wstringstream
&
slidesProperties
()
{
return
slidesProperties_
;}
std
::
wstringstream
&
notesSlidesSize
()
{
return
notesSlidesSize_
;}
void
write_to
(
std
::
wostream
&
strm
);
...
...
@@ -92,14 +120,13 @@ private:
std
::
wstringstream
slidesProperties_
;
std
::
wstringstream
notesSlidesSize_
;
std
::
wstringstream
slidesData_
;
std
::
wstringstream
slideMastersData_
;
std
::
wstringstream
notesSlidesData_
;
std
::
wstringstream
handoutMasterData_
;
};
//
////////////////////////////////////////////////////////////////////////////////////
//
------------------------------------------------------------------------------------
class
pptx_xml_slideLayout
;
typedef
_CP_PTR
(
pptx_xml_slideLayout
)
pptx_xml_slideLayout_ptr
;
...
...
@@ -126,7 +153,7 @@ private:
rels
rels_
;
};
//
/////////////////////////////////////////////////////////////////////////////////////////
//
------------------------------------------------------------------------------------
class
pptx_xml_slideMaster
;
typedef
_CP_PTR
(
pptx_xml_slideMaster
)
pptx_xml_slideMaster_ptr
;
...
...
@@ -135,7 +162,7 @@ class pptx_xml_slideMaster: noncopyable
public:
pptx_xml_slideMaster
(
std
::
wstring
const
&
rId
,
int
id
);
~
pptx_xml_slideMaster
();
public:
std
::
wstring
rId
()
const
;
std
::
wostream
&
Data
();
...
...
@@ -163,7 +190,40 @@ private:
rels
rels_
;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------------
class
pptx_xml_slideNotesMaster
;
typedef
_CP_PTR
(
pptx_xml_slideNotesMaster
)
pptx_xml_slideNotesMaster_ptr
;
class
pptx_xml_slideNotesMaster
:
noncopyable
{
public:
pptx_xml_slideNotesMaster
(
std
::
wstring
const
&
rId
,
int
id
);
~
pptx_xml_slideNotesMaster
();
std
::
wstring
rId
()
const
;
std
::
wostream
&
Data
();
std
::
wostream
&
Background
();
rels
&
Rels
();
void
add_theme
(
int
id
,
const
std
::
wstring
&
tId
);
void
write_to
(
std
::
wostream
&
strm
);
static
pptx_xml_slideNotesMaster_ptr
create
();
private:
std
::
wstringstream
slideMasterData_
;
std
::
wstringstream
slideMasterBackground_
;
std
::
wstring
rId_
;
int
id_
;
std
::
wstring
themeId_
;
rels
rels_
;
};
//------------------------------------------------------------------------------------
class
pptx_xml_theme
;
typedef
_CP_PTR
(
pptx_xml_theme
)
pptx_xml_theme_ptr
;
...
...
@@ -192,7 +252,7 @@ private:
std
::
wstring
name_
;
int
id_
;
};
//
//////////////////////////////////////////////////////////////////////////////////////////////////////
//
------------------------------------------------------------------------------------
class
pptx_xml_authors_comments
;
typedef
_CP_PTR
(
pptx_xml_authors_comments
)
pptx_xml_authors_comments_ptr
;
...
...
ASCOfficeOdfFile/src/docx/pptx_package.cpp
View file @
60f61109
...
...
@@ -105,10 +105,11 @@ void slide_content::add_rels(rels & _r)
rels_
->
get_rels
().
add
(
r
[
i
]);
}
}
////////////
//---------------------------------------------------------------------------
slides_files
::
slides_files
()
{}
{
rels_
=
NULL
;
}
void
slides_files
::
add_slide
(
slide_content_ptr
slide
)
{
...
...
@@ -127,13 +128,13 @@ void slides_files::write(const std::wstring & RootPath)
{
if
(
!
slides_
[
i
])
continue
;
const
std
::
wstring
fileName
=
std
::
wstring
(
L"slide"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
i
+
1
)
+
L".xml"
;
const
std
::
wstring
fileName
=
std
::
wstring
(
L"slide"
)
+
std
::
to_wstring
(
i
+
1
)
+
L".xml"
;
contentTypes
->
add_override
(
std
::
wstring
(
L"/ppt/slides/"
)
+
fileName
,
kWSConType
);
if
(
rels_
)
{
const
std
::
wstring
id
=
std
::
wstring
(
L"sId"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
i
+
1
);
const
std
::
wstring
id
=
std
::
wstring
(
L"sId"
)
+
std
::
to_wstring
(
i
+
1
);
static
const
std
::
wstring
kWSRel
=
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide"
;
const
std
::
wstring
fileRef
=
std
::
wstring
(
L"slides/"
)
+
fileName
;
rels_
->
add
(
id
,
kWSRel
,
fileRef
);
...
...
@@ -149,7 +150,42 @@ void slides_files::write(const std::wstring & RootPath)
}
}
////////////////////////////////////////////
//---------------------------------------------------------------------------
void
notes_files
::
write
(
const
std
::
wstring
&
RootPath
)
{
std
::
wstring
path
=
RootPath
+
FILE_SEPARATOR_STR
+
L"notesSlides"
;
NSDirectory
::
CreateDirectory
(
path
.
c_str
());
content_type_content
*
contentTypes
=
this
->
get_main_document
()
->
get_content_types_file
().
content
();
static
const
std
::
wstring
kWSConType
=
L"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml"
;
for
(
int
i
=
0
;
i
<
slides_
.
size
();
i
++
)
{
if
(
!
slides_
[
i
])
continue
;
const
std
::
wstring
fileName
=
std
::
wstring
(
L"notesSlide"
)
+
std
::
to_wstring
(
i
+
1
)
+
L".xml"
;
contentTypes
->
add_override
(
std
::
wstring
(
L"/ppt/notesSlides/"
)
+
fileName
,
kWSConType
);
if
(
rels_
)
{
const
std
::
wstring
id
=
std
::
wstring
(
L"nId"
)
+
std
::
to_wstring
(
i
+
1
);
static
const
std
::
wstring
kWSRel
=
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"
;
const
std
::
wstring
fileRef
=
std
::
wstring
(
L"notesSlides/"
)
+
fileName
;
rels_
->
add
(
id
,
kWSRel
,
fileRef
);
}
slides_
[
i
]
->
get_rel_file
()
->
set_file_name
(
fileName
+
L".rels"
);
//внитренние релсы
rels_files
relFiles
;
relFiles
.
add_rel_file
(
slides_
[
i
]
->
get_rel_file
());
relFiles
.
write
(
path
);
package
::
simple_element
(
fileName
,
slides_
[
i
]
->
str
()).
write
(
path
);
}
}
//---------------------------------------------------------------------------
slideMasters_files
::
slideMasters_files
()
{}
...
...
@@ -170,12 +206,12 @@ void slideMasters_files::write(const std::wstring & RootPath)
{
if
(
!
slides_
[
i
])
continue
;
const
std
::
wstring
fileName
=
std
::
wstring
(
L"slideMaster"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
i
+
1
)
+
L".xml"
;
const
std
::
wstring
fileName
=
std
::
wstring
(
L"slideMaster"
)
+
std
::
to_wstring
(
i
+
1
)
+
L".xml"
;
contentTypes
->
add_override
(
std
::
wstring
(
L"/ppt/slideMasters/"
)
+
fileName
,
kWSConType
);
if
(
rels_
)
{
const
std
::
wstring
id
=
std
::
wstring
(
L"smId"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
i
+
1
);
const
std
::
wstring
id
=
std
::
wstring
(
L"smId"
)
+
std
::
to_wstring
(
i
+
1
);
static
const
std
::
wstring
kWSRel
=
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"
;
const
std
::
wstring
fileRef
=
std
::
wstring
(
L"slideMasters/"
)
+
fileName
;
rels_
->
add
(
id
,
kWSRel
,
fileRef
);
...
...
@@ -191,7 +227,41 @@ void slideMasters_files::write(const std::wstring & RootPath)
}
}
////////////////////////////////////////////
//---------------------------------------------------------------------------
void
notesMaster_files
::
write
(
const
std
::
wstring
&
RootPath
)
{
std
::
wstring
path
=
RootPath
+
FILE_SEPARATOR_STR
+
L"notesMasters"
;
NSDirectory
::
CreateDirectory
(
path
.
c_str
());
content_type_content
*
contentTypes
=
this
->
get_main_document
()
->
get_content_types_file
().
content
();
static
const
std
::
wstring
kWSConType
=
L"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml"
;
for
(
int
i
=
0
;
i
<
slides_
.
size
();
i
++
)
{
if
(
!
slides_
[
i
])
continue
;
const
std
::
wstring
fileName
=
std
::
wstring
(
L"notesMaster"
)
+
std
::
to_wstring
(
i
+
1
)
+
L".xml"
;
contentTypes
->
add_override
(
std
::
wstring
(
L"/ppt/notesMasters/"
)
+
fileName
,
kWSConType
);
if
(
rels_
)
{
const
std
::
wstring
id
=
std
::
wstring
(
L"nmId"
)
+
std
::
to_wstring
(
i
+
1
);
static
const
std
::
wstring
kWSRel
=
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster"
;
const
std
::
wstring
fileRef
=
std
::
wstring
(
L"notesMasters/"
)
+
fileName
;
rels_
->
add
(
id
,
kWSRel
,
fileRef
);
}
slides_
[
i
]
->
get_rel_file
()
->
set_file_name
(
fileName
+
L".rels"
);
//внитренние релсы
rels_files
relFiles
;
relFiles
.
add_rel_file
(
slides_
[
i
]
->
get_rel_file
());
relFiles
.
write
(
path
);
package
::
simple_element
(
fileName
,
slides_
[
i
]
->
str
()).
write
(
path
);
}
}
slideLayouts_files
::
slideLayouts_files
()
{}
...
...
@@ -209,7 +279,7 @@ void slideLayouts_files::write(const std::wstring & RootPath)
{
if
(
!
slides_
[
i
])
continue
;
const
std
::
wstring
fileName
=
std
::
wstring
(
L"slideLayout"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
i
+
1
)
+
L".xml"
;
const
std
::
wstring
fileName
=
std
::
wstring
(
L"slideLayout"
)
+
std
::
to_wstring
(
i
+
1
)
+
L".xml"
;
const
std
::
wstring
kWSConType
=
L"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"
;
content_type_content
*
contentTypes
=
get_main_document
()
->
get_content_types_file
().
content
();
...
...
@@ -225,7 +295,7 @@ void slideLayouts_files::write(const std::wstring & RootPath)
}
}
//
/////////////////////////////////////////////////////////////////////////////////////
//
------------------------------------------------------------------------------------
authors_comments_element
::
authors_comments_element
(
pptx_xml_authors_comments_ptr
&
authors_comments
)
:
authors_comments_
(
authors_comments
)
{
}
...
...
@@ -261,7 +331,7 @@ void ppt_charts_files::write(const std::wstring & RootPath)
{
if
(
!
charts_
[
i
])
continue
;
const
std
::
wstring
fileName
=
std
::
wstring
(
L"chart"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
i
+
1
)
+
L".xml"
;
const
std
::
wstring
fileName
=
std
::
wstring
(
L"chart"
)
+
std
::
to_wstring
(
i
+
1
)
+
L".xml"
;
content_type_content
*
contentTypes
=
get_main_document
()
->
get_content_types_file
().
content
();
static
const
std
::
wstring
kWSConType
=
L"application/vnd.openxmlformats-officedocument.drawingml.chart+xml"
;
...
...
@@ -291,7 +361,7 @@ void ppt_themes_files::write(const std::wstring & RootPath)
{
if
(
!
themes_
[
i
])
continue
;
const
std
::
wstring
fileName
=
std
::
wstring
(
L"theme"
)
+
boost
::
lexical_cast
<
std
::
wstring
>
(
i
+
1
)
+
L".xml"
;
const
std
::
wstring
fileName
=
std
::
wstring
(
L"theme"
)
+
std
::
to_wstring
(
i
+
1
)
+
L".xml"
;
const
std
::
wstring
kWSConType
=
L"application/vnd.openxmlformats-officedocument.theme+xml"
;
content_type_content
*
contentTypes
=
get_main_document
()
->
get_content_types_file
().
content
();
...
...
@@ -345,6 +415,12 @@ void ppt_files::write(const std::wstring & RootPath)
slideMasters_files_
.
set_main_document
(
this
->
get_main_document
()
);
slideMasters_files_
.
write
(
path
);
notes_files_
.
set_main_document
(
this
->
get_main_document
()
);
notes_files_
.
write
(
path
);
notesMaster_files_
.
set_rels
(
&
rels_files_
);
notesMaster_files_
.
set_main_document
(
this
->
get_main_document
()
);
notesMaster_files_
.
write
(
path
);
//rels_files_.add( relationship( L"hId1", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", L"ppt/presentation.xml" ) );
...
...
@@ -412,6 +488,10 @@ void ppt_files::add_slide(slide_content_ptr slide)
{
slides_files_
.
add_slide
(
slide
);
}
void
ppt_files
::
add_notes
(
slide_content_ptr
slide
)
{
notes_files_
.
add_slide
(
slide
);
}
void
ppt_files
::
add_slideLayout
(
slide_content_ptr
slide
)
{
slideLayouts_files_
.
add_slide
(
slide
);
...
...
@@ -420,7 +500,10 @@ void ppt_files::add_slideMaster(slide_content_ptr slide)
{
slideMasters_files_
.
add_slide
(
slide
);
}
void
ppt_files
::
add_notesMaster
(
slide_content_ptr
slide
)
{
notesMaster_files_
.
add_slide
(
slide
);
}
void
ppt_files
::
set_media
(
mediaitems
&
_Mediaitems
,
CApplicationFonts
*
pAppFonts
)
{
if
(
_Mediaitems
.
count_image
+
_Mediaitems
.
count_media
>
0
)
...
...
ASCOfficeOdfFile/src/docx/pptx_package.h
View file @
60f61109
...
...
@@ -41,8 +41,10 @@ namespace cpdoccore {
namespace
oox
{
class
pptx_xml_presentation
;
class
pptx_xml_theme
;
typedef
_CP_PTR
(
pptx_xml_theme
)
pptx_xml_theme_ptr
;
class
pptx_xml_authors_comments
;
typedef
_CP_PTR
(
pptx_xml_authors_comments
)
pptx_xml_authors_comments_ptr
;
...
...
@@ -55,7 +57,7 @@ public:
};
//
/////////////////////////////////////////////////////////////////////////////////
//
------------------------------------------------------------------------------
class
slide_content
;
typedef
_CP_PTR
(
slide_content
)
slide_content_ptr
;
...
...
@@ -72,11 +74,10 @@ public:
static
_CP_PTR
(
slide_content
)
create
();
private:
std
::
wstringstream
content_
;
rels_file_ptr
rels_
;
std
::
wstringstream
content_
;
rels_file_ptr
rels_
;
};
// slides_files
//------------------------------------------------------------------------------
class
slides_files
:
public
element
{
public:
...
...
@@ -92,12 +93,18 @@ public:
virtual
void
write
(
const
std
::
wstring
&
RootPath
);
void
set_slide_ref
(
const
std
::
wstring
&
ref_file_path
,
const
std
::
wstring
&
ref_file_name
);
public:
std
::
vector
<
slide_content_ptr
>
slides_
;
rels_files
*
rels_
;
};
// slideLayouts_files
//------------------------------------------------------------------------------
class
notes_files
:
public
slides_files
{
public:
virtual
void
write
(
const
std
::
wstring
&
RootPath
);
};
//------------------------------------------------------------------------------
class
slideLayouts_files
:
public
element
{
public:
...
...
@@ -107,12 +114,9 @@ public:
virtual
void
write
(
const
std
::
wstring
&
RootPath
);
public:
std
::
vector
<
slide_content_ptr
>
slides_
;
};
///////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------------------------
class
authors_comments_element
:
public
element
{
public:
...
...
@@ -123,9 +127,7 @@ private:
pptx_xml_authors_comments_ptr
&
authors_comments_
;
};
/////////////////////////////////////////////////////////////////////////////////////////
// slideMasters_files
//------------------------------------------------------------------------------
class
slideMasters_files
:
public
element
{
public:
...
...
@@ -140,16 +142,19 @@ public:
virtual
void
write
(
const
std
::
wstring
&
RootPath
);
public:
std
::
vector
<
slide_content_ptr
>
slides_
;
rels_files
*
rels_
;
};
///////////////////////////////////////////////////////////
//------------------------------------------------------------------------------
class
notesMaster_files
:
public
slideMasters_files
{
public:
virtual
void
write
(
const
std
::
wstring
&
RootPath
);
};
//------------------------------------------------------------------------------
class
ppt_comments_files
;
typedef
_CP_PTR
(
ppt_comments_files
)
ppt_comments_files_ptr
;
// ppt_comments
class
ppt_comments_files
:
public
element
{
public:
...
...
@@ -165,9 +170,7 @@ private:
const
std
::
vector
<
pptx_comment_elm
>
&
comments_
;
};
//////////////////////////////////////////////////////////////////////////////
// ppt_charts_files
//------------------------------------------------------------------------------
class
ppt_charts_files
:
public
element
{
public:
...
...
@@ -179,8 +182,8 @@ public:
std
::
vector
<
chart_content_ptr
>
charts_
;
};
//
////////////////////////////////////////////////////////////////////////////
// ppt_theme_files
//
------------------------------------------------------------------------------
class
ppt_themes_files
:
public
element
{
public:
...
...
@@ -192,13 +195,12 @@ public:
std
::
vector
<
pptx_xml_theme_ptr
>
themes_
;
};
//
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
------------------------------------------------------------------------------
class
ppt_files
:
public
element
{
public:
ppt_files
();
public:
virtual
void
write
(
const
std
::
wstring
&
RootPath
);
void
set_presentation
(
pptx_xml_presentation
&
presentation
);
...
...
@@ -206,9 +208,11 @@ public:
void
set_styles
(
element_ptr
Element
);
void
set_comments
(
element_ptr
Element
);
void
add_slide
(
slide_content_ptr
sheet
);
void
add_slide
(
slide_content_ptr
sheet
);
void
add_slideLayout
(
slide_content_ptr
sheet
);
void
add_slideMaster
(
slide_content_ptr
sheet
);
void
add_notes
(
slide_content_ptr
sheet
);
void
add_notesMaster
(
slide_content_ptr
sheet
);
void
set_media
(
mediaitems
&
_Mediaitems
,
CApplicationFonts
*
pAppFonts
);
void
add_charts
(
chart_content_ptr
chart
);
...
...
@@ -217,25 +221,21 @@ public:
void
set_authors_comments
(
pptx_xml_authors_comments_ptr
&
authors_comments
);
private:
rels_files
rels_files_
;
rels_files
rels_files_
;
slides_files
slides_files_
;
slideLayouts_files
slideLayouts_files_
;
slideMasters_files
slideMasters_files_
;
slides_files
slides_files_
;
slideLayouts_files
slideLayouts_files_
;
slideMasters_files
slideMasters_files_
;
notes_files
notes_files_
;
notesMaster_files
notesMaster_files_
;
//slides_files handoutMasters_files_;
ppt_themes_files
themes_files_
;
ppt_charts_files
charts_files_
;
//slides_files notesSlides_files_;
//slides_files notesMasters_files_;
//slides_files handoutMasters_files_;
element_ptr
authors_comments_
;
element_ptr
authors_comments_
;
element_ptr
presentation_
;
element_ptr
tableStyles_
;
element_ptr
comments_
;
element_ptr
media_
;
element_ptr
embeddings_
;
...
...
@@ -247,7 +247,6 @@ class pptx_document : public document
public:
pptx_document
();
public:
virtual
void
write
(
const
std
::
wstring
&
RootPath
);
virtual
content_types_file
&
get_content_types_file
()
{
return
content_type_file_
;
}
...
...
ASCOfficeOdfFile/src/docx/pptx_slide_context.cpp
View file @
60f61109
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFile/src/docx/pptx_slide_context.h
View file @
60f61109
...
...
@@ -89,16 +89,19 @@ public:
void
end_table
();
void
start_shape
(
int
type
);
void
end_shape
();
void
end_shape
();
void
set_use_image_replacement
();
bool
empty
()
const
;
//////////////////////////////////////////////////////////////////////////////////////////////
void
serialize_objects
(
std
::
wostream
&
strm
);
void
serialize_HeaderFooter
(
std
::
wostream
&
strm
);
void
serialize_background
(
std
::
wostream
&
strm
,
bool
always
=
false
);
void
serialize_animations
(
std
::
wostream
&
strm
);
void
serialize_HeaderFooter
(
std
::
wostream
&
strm
);
void
serialize_animations
(
std
::
wostream
&
strm
);
void
serialize_objects
(
std
::
wostream
&
strm
);
void
serialize_background
(
std
::
wostream
&
strm
,
bool
always
=
false
);
void
dump_rels
(
rels
&
Rels
);
...
...
@@ -106,7 +109,7 @@ public:
mediaitems
&
get_mediaitems
();
void
add_background
(
_oox_fill
&
fill
);
void
add_background
(
_oox_fill
&
fill
);
void
add_rels
(
bool
isInternal
,
std
::
wstring
const
&
rid
,
...
...
ASCOfficeOdfFile/src/odf/draw_page.cpp
View file @
60f61109
...
...
@@ -74,6 +74,8 @@ void draw_page::add_child_element( xml::sax * Reader, const std::wstring & Ns, c
{
if
CP_CHECK_NAME
(
L"anim"
,
L"par"
)
CP_CREATE_ELEMENT
(
animation_
);
else
if
(
L"presentation"
==
Ns
&&
L"notes"
==
Name
)
CP_CREATE_ELEMENT
(
presentation_notes_
);
else
CP_CREATE_ELEMENT
(
content_
);
}
...
...
@@ -202,8 +204,15 @@ void draw_page::pptx_convert(oox::pptx_conversion_context & Context)
std
::
wstring
name
=
L"datetime:"
+
*
attlist_
.
use_date_time_name_
;
pptx_convert_placeHolder
(
Context
,
name
,
presentation_class
::
date_time
);
}
Context
.
end_page
();
Context
.
end_page
();
if
(
presentation_notes_
)
{
Context
.
start_page_notes
();
presentation_notes_
->
pptx_convert
(
Context
);
Context
.
end_page_notes
();
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////
const
wchar_t
*
presentation_footer_decl
::
ns
=
L"presentation"
;
...
...
@@ -296,14 +305,11 @@ void presentation_notes::add_attributes( const xml::attributes_wc_ptr & Attribut
void
presentation_notes
::
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
)
{
const
std
::
wstring
pageStyleName
=
attlist_
.
draw_style_name_
.
get_value_or
(
L""
);
const
std
::
wstring
pageName
=
attlist_
.
draw_name_
.
get_value_or
(
L""
);
const
std
::
wstring
layoutName
=
attlist_
.
page_layout_name_
.
get_value_or
(
L""
);
const
std
::
wstring
masterName
=
attlist_
.
master_page_name_
.
get_value_or
(
L""
);
_CP_LOG
<<
L"[info][pptx] process note slide"
<<
std
::
endl
;
Context
.
start_note
(
pageName
,
pageStyleName
,
layoutName
,
masterName
);
if
(
attlist_
.
draw_style_name_
)
{
style_instance
*
style_inst
=
Context
.
root
()
->
odf_context
().
styleContainer
().
style_by_name
(
pageStyleName
,
style_family
::
DrawingPage
,
false
);
...
...
@@ -352,7 +358,6 @@ void presentation_notes::pptx_convert(oox::pptx_conversion_context & Context)
// pptx_convert_placeHolder(Context, name, presentation_class::date_time);
//}
Context
.
end_note
();
}
}
...
...
ASCOfficeOdfFile/src/odf/draw_page.h
View file @
60f61109
...
...
@@ -81,6 +81,7 @@ private:
office_element_ptr_array
content_
;
office_element_ptr
animation_
;
office_element_ptr
presentation_notes_
;
draw_page_attr
attlist_
;
};
...
...
ASCOfficeOdfFile/src/odf/styles.cpp
View file @
60f61109
...
...
@@ -1519,10 +1519,11 @@ void style_master_page::pptx_convert(oox::pptx_conversion_context & Context)
}
}
BOOST_FOREACH
(
office_element_ptr
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
pptx_convert
(
Context
);
content_
[
i
]
->
pptx_convert
(
Context
);
}
}
////////////////
...
...
@@ -1698,9 +1699,9 @@ void style_presentation_page_layout::add_child_element( xml::sax * Reader, const
}
void
style_presentation_page_layout
::
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
)
{
BOOST_FOREACH
(
office_element_ptr
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
elm
->
pptx_convert
(
Context
);
content_
[
i
]
->
pptx_convert
(
Context
);
}
}
...
...
ASCOfficeOdfFileW/OdfFileWTest/OdfFileWTest.sln
View file @
60f61109
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfFormatWriterLib", "..\source\win32\OdfFormat.vcproj", "{E5A67556-44DA-4481-8F87-0A3AEDBD20DD}"
ProjectSection(ProjectDependencies) = postProject
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
{609ED938-3CA8-4BED-B363-25096D4C4812} = {609ED938-3CA8-4BED-B363-25096D4C4812}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
{94954A67-A853-43B1-A727-6EF2774C5A6A} = {94954A67-A853-43B1-A727-6EF2774C5A6A}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Oox2OdfConverter", "..\source\win32\Oox2OdfConverter.vcproj", "{BEE01B53-244A-44E6-8947-ED9342D9247E}"
ProjectSection(ProjectDependencies) = postProject
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD} = {E5A67556-44DA-4481-8F87-0A3AEDBD20DD}
{94954A67-A853-43B1-A727-6EF2774C5A6A} = {94954A67-A853-43B1-A727-6EF2774C5A6A}
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
EndProjectSection
...
...
@@ -98,14 +89,6 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD}.Debug|Win32.ActiveCfg = Debug|Win32
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD}.Debug|Win32.Build.0 = Debug|Win32
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD}.Debug|x64.ActiveCfg = Debug|x64
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD}.Debug|x64.Build.0 = Debug|x64
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD}.Release|Win32.ActiveCfg = Release|Win32
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD}.Release|Win32.Build.0 = Release|Win32
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD}.Release|x64.ActiveCfg = Release|x64
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD}.Release|x64.Build.0 = Release|x64
{BEE01B53-244A-44E6-8947-ED9342D9247E}.Debug|Win32.ActiveCfg = Debug|Win32
{BEE01B53-244A-44E6-8947-ED9342D9247E}.Debug|Win32.Build.0 = Debug|Win32
{BEE01B53-244A-44E6-8947-ED9342D9247E}.Debug|x64.ActiveCfg = Debug|x64
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
View file @
60f61109
...
...
@@ -2627,15 +2627,15 @@ void odf_drawing_context::set_gradient_angle(double angle)
draw_gradient
*
gradient
=
dynamic_cast
<
draw_gradient
*>
(
impl_
->
styles_context_
->
last_state
(
style_family
::
Gradient
)
->
get_office_element
().
get
());
if
(
!
gradient
)
return
;
gradient
->
draw_angle_
=
(
270
-
angle
)
*
10
;
//(int)((360 - angle)/180. * 3.14159265358979323846);
gradient
->
draw_angle_
=
(
270
-
angle
)
*
10
;
//(int)((360 - angle)/180. * 3.14159265358979323846);
}
void
odf_drawing_context
::
set_gradient_rect
(
double
l
,
double
t
,
double
r
,
double
b
)
void
odf_drawing_context
::
set_gradient_rect
(
double
l
,
double
t
,
double
r
,
double
b
)
{
draw_gradient
*
gradient
=
dynamic_cast
<
draw_gradient
*>
(
impl_
->
styles_context_
->
last_state
(
style_family
::
Gradient
)
->
get_office_element
().
get
());
if
(
!
gradient
)
return
;
gradient
->
draw_cy_
=
percent
((
b
-
t
)
/
2.
+
50.
);
gradient
->
draw_cx_
=
percent
((
r
-
l
)
/
2.
+
50.
);
gradient
->
draw_cy_
=
percent
((
b
-
t
)
/
2.
+
50.
);
gradient
->
draw_cx_
=
percent
((
r
-
l
)
/
2.
+
50.
);
}
void
odf_drawing_context
::
set_gradient_center
(
double
cx
,
double
cy
)
{
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
View file @
60f61109
...
...
@@ -854,10 +854,10 @@ void OoxConverter::convert(PPTX::Logic::GradFill *oox_grad_fill, DWORD nARGB)
}
if
(
oox_grad_fill
->
path
->
rect
.
IsInit
())
{
odf_context
()
->
drawing_context
()
->
set_gradient_rect
(
XmlUtils
::
GetInteger
(
oox_grad_fill
->
path
->
rect
->
l
.
get_value_or
(
L""
)),
XmlUtils
::
GetInteger
(
oox_grad_fill
->
path
->
rect
->
t
.
get_value_or
(
L""
)),
XmlUtils
::
GetInteger
(
oox_grad_fill
->
path
->
rect
->
r
.
get_value_or
(
L""
)),
XmlUtils
::
GetInteger
(
oox_grad_fill
->
path
->
rect
->
b
.
get_value_or
(
L""
)));
odf_context
()
->
drawing_context
()
->
set_gradient_rect
(
XmlUtils
::
GetInteger
(
oox_grad_fill
->
path
->
rect
->
l
.
get_value_or
(
L""
))
/
1000.
,
XmlUtils
::
GetInteger
(
oox_grad_fill
->
path
->
rect
->
t
.
get_value_or
(
L""
))
/
1000.
,
XmlUtils
::
GetInteger
(
oox_grad_fill
->
path
->
rect
->
r
.
get_value_or
(
L""
))
/
1000.
,
XmlUtils
::
GetInteger
(
oox_grad_fill
->
path
->
rect
->
b
.
get_value_or
(
L""
))
/
1000.
);
}
}
odf_context
()
->
drawing_context
()
->
set_gradient_type
(
grad_style
);
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
View file @
60f61109
...
...
@@ -423,8 +423,13 @@ void PptxConverter::convert(PPTX::NotesMaster *oox_notes)
odp_context
->
start_note
(
true
);
current_slide
=
dynamic_cast
<
OOX
::
IFileContainer
*>
(
oox_notes
);
PPTX
::
Theme
*
old_theme
=
current_theme
;
PPTX
::
Logic
::
ClrMap
*
old_clrMap
=
current_clrMap
;
current_theme
=
oox_notes
->
theme_
.
operator
->
();
current_clrMap
=
&
oox_notes
->
clrMap
;
current_slide
=
dynamic_cast
<
OOX
::
IFileContainer
*>
(
oox_notes
);
//PPTX::Logic::TxStyles* current_txStyles = oox_notes->notesStyle.GetPointer();
if
(
presentation
->
notesSz
.
IsInit
())
...
...
@@ -433,35 +438,46 @@ void PptxConverter::convert(PPTX::NotesMaster *oox_notes)
_CP_OPT
(
odf_types
::
length
)
height
=
odf_types
::
length
(
presentation
->
notesSz
->
cy
/
12700.
,
odf_types
::
length
::
pt
);
odf_context
()
->
page_layout_context
()
->
set_page_size
(
width
,
height
);
//if (presentation->notesSz->type.IsInit())
//{
// switch(presentation->notesSz->type->GetBYTECode())
// {
// default:
// break;
// }
// odf_context()->page_layout_context()->set_page_orientation
//}
}
convert_slide
(
&
oox_notes
->
cSld
,
NULL
,
true
,
true
);
odp_context
->
end_note
();
current_clrMap
=
old_clrMap
;
current_theme
=
old_theme
;
}
void
PptxConverter
::
convert
(
PPTX
::
NotesSlide
*
oox_notes
)
{
if
(
!
oox_notes
)
return
;
PPTX
::
Theme
*
old_theme
=
current_theme
;
PPTX
::
Logic
::
ClrMap
*
old_clrMap
=
current_clrMap
;
smart_ptr
<
PPTX
::
NotesMaster
>
notes_master
;
if
(
!
presentation
->
notesMasterIdLst
.
empty
())
{
std
::
wstring
rId
=
presentation
->
notesMasterIdLst
[
0
].
rid
.
get
();
notes_master
=
((
*
presentation
)[
rId
]).
smart_dynamic_cast
<
PPTX
::
NotesMaster
>
();
}
odp_context
->
start_note
();
current_slide
=
dynamic_cast
<
OOX
::
IFileContainer
*>
(
oox_notes
);
if
(
notes_master
.
IsInit
())
{
current_theme
=
notes_master
->
theme_
.
operator
->
();
current_clrMap
=
&
notes_master
->
clrMap
;
}
current_slide
=
dynamic_cast
<
OOX
::
IFileContainer
*>
(
oox_notes
);
if
(
oox_notes
->
clrMapOvr
.
IsInit
()
&&
oox_notes
->
clrMapOvr
->
overrideClrMapping
.
IsInit
())
current_clrMap
=
oox_notes
->
clrMapOvr
->
overrideClrMapping
.
GetPointer
();
//current_txStyles = oox_notes->Master->txStyles.GetPointer();
convert_slide
(
&
oox_notes
->
cSld
,
NULL
,
true
,
true
);
odp_context
->
end_note
();
current_clrMap
=
old_clrMap
;
current_theme
=
old_theme
;
}
void
PptxConverter
::
convert
(
OOX
::
WritingElement
*
oox_unknown
)
...
...
ASCOfficeOdfFileW/source/win32/Oox2OdfConverter.vcproj
View file @
60f61109
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType=
"Visual C++"
Version=
"8
,
00"
Version=
"8
.
00"
Name=
"Oox2OdfConverter"
ProjectGUID=
"{BEE01B53-244A-44E6-8947-ED9342D9247E}"
RootNamespace=
"Oox2OdfConverter"
...
...
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