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
be65f18a
Commit
be65f18a
authored
May 09, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatReader - presentation master notes
parent
60f61109
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
206 additions
and
137 deletions
+206
-137
ASCOfficeOdfFile/src/docx/pptx_conversion_context.cpp
ASCOfficeOdfFile/src/docx/pptx_conversion_context.cpp
+42
-33
ASCOfficeOdfFile/src/docx/pptx_output_xml.cpp
ASCOfficeOdfFile/src/docx/pptx_output_xml.cpp
+36
-25
ASCOfficeOdfFile/src/docx/pptx_output_xml.h
ASCOfficeOdfFile/src/docx/pptx_output_xml.h
+26
-22
ASCOfficeOdfFile/src/odf/draw_page.cpp
ASCOfficeOdfFile/src/odf/draw_page.cpp
+51
-51
ASCOfficeOdfFile/src/odf/draw_page.h
ASCOfficeOdfFile/src/odf/draw_page.h
+3
-3
ASCOfficeOdfFile/src/odf/odfcontext.cpp
ASCOfficeOdfFile/src/odf/odfcontext.cpp
+2
-2
ASCOfficeOdfFile/src/odf/odfcontext.h
ASCOfficeOdfFile/src/odf/odfcontext.h
+1
-1
ASCOfficeOdfFile/src/odf/styles.cpp
ASCOfficeOdfFile/src/odf/styles.cpp
+44
-0
ASCOfficeOdfFile/src/odf/styles.h
ASCOfficeOdfFile/src/odf/styles.h
+1
-0
No files found.
ASCOfficeOdfFile/src/docx/pptx_conversion_context.cpp
View file @
be65f18a
...
...
@@ -199,9 +199,9 @@ void pptx_conversion_context::process_theme(std::wstring name)
}
start_theme
(
name
);
//
pptx_serialize_clrScheme
(
current_theme
().
clrSchemeData
());
pptx_serialize_fmtScheme
(
current_theme
().
fmtSchemeData
());
pptx_serialize_fontScheme
(
current_theme
().
fontSchemeData
());
pptx_serialize_clrScheme
(
current_theme
().
clrSchemeData
());
pptx_serialize_fmtScheme
(
current_theme
().
fmtSchemeData
());
pptx_serialize_fontScheme
(
current_theme
().
fontSchemeData
());
//
end_theme
();
...
...
@@ -222,8 +222,6 @@ void pptx_conversion_context::start_document()
void
pptx_conversion_context
::
end_document
()
{
unsigned
int
count
=
1
;
for
(
size_t
i
=
0
;
i
<
slideMasters_
.
size
();
i
++
)
{
pptx_xml_slideMaster_ptr
&
slideM
=
slideMasters_
[
i
];
...
...
@@ -243,10 +241,11 @@ void pptx_conversion_context::end_document()
CP_XML_ATTR
(
L"r:id"
,
slideM
->
rId
());
}
}
count
++
;
}
if
(
!
slideMasters_
.
empty
())
presentation_
.
slidesProperties
()
<<
slideMasters_
[
0
]
->
Sizes
().
str
();
////////////////////////////////////////////////////////////////////////////////////////////////////
count
=
0
;
for
(
size_t
i
=
0
;
i
<
slides_
.
size
();
i
++
)
{
pptx_xml_slide_ptr
&
slide
=
slides_
[
i
];
...
...
@@ -262,11 +261,10 @@ void pptx_conversion_context::end_document()
{
CP_XML_NODE
(
L"p:sldId"
)
{
CP_XML_ATTR
(
L"id"
,
0x100
+
count
);
CP_XML_ATTR
(
L"id"
,
0x100
+
i
);
CP_XML_ATTR
(
L"r:id"
,
slide
->
rId
());
}
}
count
++
;
}
//----------------------------------------------------------------------------------
for
(
size_t
i
=
0
;
i
<
slideLayouts_
.
size
();
i
++
)
...
...
@@ -294,37 +292,28 @@ void pptx_conversion_context::end_document()
}
if
(
slideNotesMaster_
)
{
package
::
slide_content_ptr
content
=
package
::
slide_content
::
create
();
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
();
if
((
pageLayouts
.
master_pages
().
size
()
>
0
)
&&
(
pageLayouts
.
master_pages
()[
0
]
->
attlist_
.
style_name_
))
//default
{
const
std
::
wstring
masterStyleName
=
pageLayouts
.
master_pages
()[
0
]
->
attlist_
.
style_name_
.
get
();
const
std
::
wstring
pageProperties
=
root
()
->
odf_context
().
pageLayoutContainer
().
page_layout_name_by_style
(
masterStyleName
);
odf_reader
::
page_layout_instance
*
pages_layouts
=
root
()
->
odf_context
().
pageLayoutContainer
().
page_layout_by_name
(
pageProperties
);
if
(
pages_layouts
)
pages_layouts
->
pptx_convert
(
*
this
);
CP_XML_WRITER
(
presentation_
.
slideNotesMastersData
())
//presentation.xml
{
CP_XML_NODE
(
L"p:notesMasterId"
)
{
CP_XML_ATTR
(
L"r:id"
,
slideNotesMaster_
->
rId
());
}
}
}
//
///////////////////////////////////////////////////////////////////////////////////////////
pptx_serialize_size
(
current_presentation
().
notesSlidesSize
(),
6858000
,
9144000
,
L"p:notesSz"
);
//
else
pptx_serialize_size
(
current_presentation
().
slidesNotesProperties
(),
6858000
,
9144000
,
L"p:notesSz"
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//добавляем диаграммы
count
=
0
;
for
(
size_t
i
=
0
;
i
<
charts_
.
size
();
i
++
)
{
count
++
;
package
::
chart_content_ptr
content
=
package
::
chart_content
::
create
();
charts_
[
i
]
->
serialize
(
content
->
content
());
...
...
@@ -334,7 +323,6 @@ void pptx_conversion_context::end_document()
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//добавляем темы
for
(
size_t
i
=
0
;
i
<
themes_
.
size
();
i
++
)
{
output_document_
->
get_ppt_files
().
add_theme
(
themes_
[
i
]);
...
...
@@ -569,6 +557,14 @@ bool pptx_conversion_context::start_master(int master_index)
current_master
().
add_layout
(
masters
.
content
[
master_index
].
layouts
[
i
].
Id
,
masters
.
content
[
master_index
].
layouts
[
i
].
rId
,
0x80000000
+
last_uniq_big_id
++
);
}
//----------------------------------------------------------------------------------
//размеры страниц в презентации
const
std
::
wstring
pageProperties
=
root
()
->
odf_context
().
pageLayoutContainer
().
page_layout_name_by_style
(
masters
.
content
[
master_index
].
master_name
);
odf_reader
::
page_layout_instance
*
pages_layouts
=
root
()
->
odf_context
().
pageLayoutContainer
().
page_layout_by_name
(
pageProperties
);
if
(
pages_layouts
)
pages_layouts
->
pptx_serialize
(
current_master
().
Sizes
(),
*
this
);
return
true
;
}
...
...
@@ -597,10 +593,14 @@ bool pptx_conversion_context::start_page_notes()
{
create_new_slideNotes
(
);
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"
));
current_slide
().
Rels
().
add
(
relationship
(
notes_
.
back
()
->
rId
(),
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"
,
L"../notesSlides/notesSlide"
+
std
::
to_wstring
(
notes_
.
size
())
+
L".xml"
));
get_slide_context
().
start_slide
();
current_notes
().
Rels
().
add
(
relationship
(
L"nId1"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide"
,
L"../slides/slide"
+
std
::
to_wstring
(
slides_
.
size
())
+
L".xml"
));
return
true
;
}
...
...
@@ -616,9 +616,11 @@ void pptx_conversion_context::end_page_notes()
bool
pptx_conversion_context
::
start_master_notes
()
{
create_new_slideNotesMaster
(
);
get_slide_context
().
start_slide
();
//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"));
process_theme
(
L""
);
//add default theme - одинаковые но под разными именами
current_notesMaster
().
add_theme
(
current_theme
().
id
(),
L"tId1"
);
get_slide_context
().
start_slide
();
return
true
;
...
...
@@ -632,6 +634,13 @@ void pptx_conversion_context::end_master_notes()
get_slide_context
().
dump_rels
(
current_notesMaster
().
Rels
());
//hyperlinks, mediaitems, ...
get_slide_context
().
end_slide
();
for
(
size_t
i
=
0
;
i
<
notes_
.
size
();
i
++
)
{
notes_
[
i
]
->
Rels
().
add
(
relationship
(
L"nmId1"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster"
,
L"../notesMasters/notesMaster1.xml"
));
}
}
void
pptx_conversion_context
::
end_layout
()
{
...
...
ASCOfficeOdfFile/src/docx/pptx_output_xml.cpp
View file @
be65f18a
...
...
@@ -68,15 +68,15 @@ pptx_xml_slide::~pptx_xml_slide()
}
std
::
wostream
&
pptx_xml_slide
::
Data
()
{
return
s
lide
Data_
;
return
s
trm
Data_
;
}
std
::
wostream
&
pptx_xml_slide
::
Background
()
{
return
s
lide
Background_
;
return
s
trm
Background_
;
}
std
::
wostream
&
pptx_xml_slide
::
Timing
()
{
return
s
lide
Timing_
;
return
s
trm
Timing_
;
}
rels
&
pptx_xml_slide
::
Rels
()
{
...
...
@@ -100,14 +100,14 @@ void pptx_xml_slide::write_to(std::wostream & strm)
{
CP_XML_ATTR
(
L"name"
,
name
());
CP_XML_STREAM
()
<<
s
lide
Background_
.
str
();
CP_XML_STREAM
()
<<
s
trm
Background_
.
str
();
CP_XML_NODE
(
L"p:spTree"
)
{
CP_XML_STREAM
()
<<
s
lide
Data_
.
str
();
CP_XML_STREAM
()
<<
s
trm
Data_
.
str
();
}
}
CP_XML_STREAM
()
<<
s
lide
Timing_
.
str
();
CP_XML_STREAM
()
<<
s
trm
Timing_
.
str
();
CP_XML_NODE
(
L"p:clrMapOvr"
)
{
CP_XML_NODE
(
L"a:masterClrMapping"
);
...
...
@@ -137,7 +137,7 @@ pptx_xml_slideLayout::~pptx_xml_slideLayout()
}
std
::
wostream
&
pptx_xml_slideLayout
::
Data
()
{
return
s
lideLayout
Data_
;
return
s
trm
Data_
;
}
rels
&
pptx_xml_slideLayout
::
Rels
()
{
...
...
@@ -166,7 +166,7 @@ void pptx_xml_slideLayout::write_to(std::wostream & strm)
{
CP_XML_NODE
(
L"p:spTree"
)
{
CP_XML_STREAM
()
<<
s
lideLayout
Data_
.
str
();
CP_XML_STREAM
()
<<
s
trm
Data_
.
str
();
//в slideLayoutData_
//contentPart (Content Part) §19.3.1.14
...
...
@@ -212,15 +212,19 @@ pptx_xml_slideMaster::~pptx_xml_slideMaster()
}
std
::
wostream
&
pptx_xml_slideMaster
::
Data
()
{
return
s
lideMaster
Data_
;
return
s
trm
Data_
;
}
std
::
wostream
&
pptx_xml_slideMaster
::
DataExtra
()
{
return
s
lideMaster
DataExtra_
;
return
s
trm
DataExtra_
;
}
std
::
wostream
&
pptx_xml_slideMaster
::
Background
()
{
return
slideMasterBackground_
;
return
strmBackground_
;
}
std
::
wstringstream
&
pptx_xml_slideMaster
::
Sizes
()
{
return
strmSizes_
;
}
rels
&
pptx_xml_slideMaster
::
Rels
()
{
...
...
@@ -255,11 +259,11 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
CP_XML_NODE
(
L"p:cSld"
)
{
CP_XML_STREAM
()
<<
s
lideMaster
Background_
.
str
();
CP_XML_STREAM
()
<<
s
trm
Background_
.
str
();
CP_XML_NODE
(
L"p:spTree"
)
{
CP_XML_STREAM
()
<<
s
lideMaster
Data_
.
str
();
CP_XML_STREAM
()
<<
s
trm
Data_
.
str
();
}
}
CP_XML_NODE
(
L"p:clrMap"
)
...
...
@@ -288,7 +292,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
}
}
}
CP_XML_STREAM
()
<<
s
lideMaster
DataExtra_
.
str
();
CP_XML_STREAM
()
<<
s
trm
DataExtra_
.
str
();
CP_XML_NODE
(
L"p:txStyles"
)
{
CP_XML_NODE
(
L"p:titleStyle"
);
...
...
@@ -415,14 +419,18 @@ void pptx_xml_presentation::write_to(std::wostream & strm)
CP_XML_NODE
(
L"p:sldMasterIdLst"
)
{
CP_XML_STREAM
()
<<
slideMastersData_
.
str
();
}
}
CP_XML_NODE
(
L"p:notesMasterIdLst"
)
{
CP_XML_STREAM
()
<<
slideNotesMastersData_
.
str
();
}
CP_XML_NODE
(
L"p:sldIdLst"
)
{
CP_XML_STREAM
()
<<
slidesData_
.
str
();
}
CP_XML_STREAM
()
<<
slidesProperties_
.
str
();
CP_XML_STREAM
()
<<
notesSlidesSize
_
.
str
();
CP_XML_STREAM
()
<<
slidesNotesProperties
_
.
str
();
CP_XML_NODE
(
L"p:defaultTextStyle"
)
//??
{
...
...
@@ -453,11 +461,11 @@ pptx_xml_slideNotes::~pptx_xml_slideNotes()
}
std
::
wostream
&
pptx_xml_slideNotes
::
Data
()
{
return
s
lide
Data_
;
return
s
trm
Data_
;
}
std
::
wostream
&
pptx_xml_slideNotes
::
Background
()
{
return
s
lide
Background_
;
return
s
trm
Background_
;
}
rels
&
pptx_xml_slideNotes
::
Rels
()
...
...
@@ -480,11 +488,11 @@ void pptx_xml_slideNotes::write_to(std::wostream & strm)
CP_XML_NODE
(
L"p:cSld"
)
{
CP_XML_STREAM
()
<<
s
lide
Background_
.
str
();
CP_XML_STREAM
()
<<
s
trm
Background_
.
str
();
CP_XML_NODE
(
L"p:spTree"
)
{
CP_XML_STREAM
()
<<
s
lide
Data_
.
str
();
CP_XML_STREAM
()
<<
s
trm
Data_
.
str
();
}
}
CP_XML_NODE
(
L"p:clrMapOvr"
)
...
...
@@ -517,12 +525,15 @@ pptx_xml_slideNotesMaster::~pptx_xml_slideNotesMaster()
}
std
::
wostream
&
pptx_xml_slideNotesMaster
::
Data
()
{
return
s
lideMaster
Data_
;
return
s
trm
Data_
;
}
std
::
wostream
&
pptx_xml_slideNotesMaster
::
Background
()
{
return
slideMasterBackground_
;
return
strmBackground_
;
}
std
::
wostream
&
pptx_xml_slideNotesMaster
::
Sizes
()
{
return
strmSizes_
;
}
rels
&
pptx_xml_slideNotesMaster
::
Rels
()
{
...
...
@@ -549,11 +560,11 @@ void pptx_xml_slideNotesMaster::write_to(std::wostream & strm)
CP_XML_NODE
(
L"p:cSld"
)
{
CP_XML_STREAM
()
<<
s
lideMaster
Background_
.
str
();
CP_XML_STREAM
()
<<
s
trm
Background_
.
str
();
CP_XML_NODE
(
L"p:spTree"
)
{
CP_XML_STREAM
()
<<
s
lideMaster
Data_
.
str
();
CP_XML_STREAM
()
<<
s
trm
Data_
.
str
();
}
}
CP_XML_NODE
(
L"p:clrMap"
)
...
...
ASCOfficeOdfFile/src/docx/pptx_output_xml.h
View file @
be65f18a
...
...
@@ -65,9 +65,9 @@ public:
private:
std
::
wstring
name_
;
std
::
wstringstream
s
lide
Data_
;
std
::
wstringstream
s
lide
Background_
;
std
::
wstringstream
s
lide
Timing_
;
std
::
wstringstream
s
trm
Data_
;
std
::
wstringstream
s
trm
Background_
;
std
::
wstringstream
s
trm
Timing_
;
std
::
wstring
rId_
;
rels
rels_
;
...
...
@@ -94,8 +94,8 @@ public:
static
pptx_xml_slideNotes_ptr
create
(
int
id
);
private:
std
::
wstringstream
s
lide
Data_
;
std
::
wstringstream
s
lide
Background_
;
std
::
wstringstream
s
trm
Data_
;
std
::
wstringstream
s
trm
Background_
;
std
::
wstring
rId_
;
rels
rels_
;
...
...
@@ -107,23 +107,23 @@ public:
pptx_xml_presentation
(){}
~
pptx_xml_presentation
(){}
std
::
wstringstream
&
slidesData
()
{
return
slidesData_
;}
std
::
wstringstream
&
slideMastersData
()
{
return
slideMastersData_
;}
std
::
wstringstream
&
notesSlidesData
()
{
return
notesSlide
sData_
;}
std
::
wstringstream
&
slidesData
()
{
return
slidesData_
;}
std
::
wstringstream
&
slideMastersData
()
{
return
slideMastersData_
;}
std
::
wstringstream
&
slideNotesMastersData
()
{
return
slideNotesMaster
sData_
;}
std
::
wstringstream
&
slidesProperties
()
{
return
slidesProperties_
;}
std
::
wstringstream
&
notesSlidesSize
()
{
return
notesSlidesSize
_
;}
std
::
wstringstream
&
slidesProperties
()
{
return
slidesProperties_
;}
std
::
wstringstream
&
slidesNotesProperties
()
{
return
slidesNotesProperties
_
;}
void
write_to
(
std
::
wostream
&
strm
);
private:
std
::
wstringstream
slidesProperties_
;
std
::
wstringstream
notesSlidesSize
_
;
std
::
wstringstream
slidesNotesProperties
_
;
std
::
wstringstream
slidesData_
;
std
::
wstringstream
slideMastersData_
;
std
::
wstringstream
notesSlide
sData_
;
std
::
wstringstream
h
andoutMasterData_
;
std
::
wstringstream
slideNotesMaster
sData_
;
std
::
wstringstream
slideH
andoutMasterData_
;
};
//------------------------------------------------------------------------------------
...
...
@@ -148,7 +148,7 @@ public:
static
pptx_xml_slideLayout_ptr
create
(
int
id
);
private:
std
::
wstringstream
s
lideLayout
Data_
;
std
::
wstringstream
s
trm
Data_
;
std
::
wstring
rId_
;
rels
rels_
;
...
...
@@ -165,9 +165,10 @@ public:
std
::
wstring
rId
()
const
;
std
::
wostream
&
Data
();
std
::
wostream
&
DataExtra
();
std
::
wostream
&
Background
();
std
::
wostream
&
Data
();
std
::
wostream
&
DataExtra
();
std
::
wostream
&
Background
();
std
::
wstringstream
&
Sizes
();
rels
&
Rels
();
void
add_layout
(
int
id
,
const
std
::
wstring
&
rId
,
const
unsigned
int
&
uniqId
);
...
...
@@ -178,9 +179,10 @@ public:
static
pptx_xml_slideMaster_ptr
create
(
int
id
);
private:
std
::
wstringstream
slideMasterData_
;
std
::
wstringstream
slideMasterDataExtra_
;
std
::
wstringstream
slideMasterBackground_
;
std
::
wstringstream
strmData_
;
std
::
wstringstream
strmDataExtra_
;
std
::
wstringstream
strmBackground_
;
std
::
wstringstream
strmSizes_
;
std
::
vector
<
std
::
pair
<
std
::
wstring
,
unsigned
int
>>
layoutsId_
;
std
::
wstring
rId_
;
...
...
@@ -204,6 +206,7 @@ public:
std
::
wostream
&
Data
();
std
::
wostream
&
Background
();
std
::
wostream
&
Sizes
();
rels
&
Rels
();
void
add_theme
(
int
id
,
const
std
::
wstring
&
tId
);
...
...
@@ -213,8 +216,9 @@ public:
static
pptx_xml_slideNotesMaster_ptr
create
();
private:
std
::
wstringstream
slideMasterData_
;
std
::
wstringstream
slideMasterBackground_
;
std
::
wstringstream
strmData_
;
std
::
wstringstream
strmBackground_
;
std
::
wstringstream
strmSizes_
;
std
::
wstring
rId_
;
int
id_
;
...
...
ASCOfficeOdfFile/src/odf/draw_page.cpp
View file @
be65f18a
...
...
@@ -262,46 +262,46 @@ void presentation_notes::add_attributes( const xml::attributes_wc_ptr & Attribut
attlist_
.
add_attributes
(
Attributes
);
}
//
void presentation_notes::pptx_convert_placeHolder(oox::pptx_conversion_context & Context, std::wstring styleName, presentation_class::type PresentationClass)
//
{
//
office_element_ptr elm = Context.root()->odf_context().drawStyles().find_by_style_name(styleName);
//
//todooo если это элемент datatime -нужно вытащить формат поля
//
//
if (!elm)return;
//
//
int index=-1;
//
//
const std::wstring masterName = attlist_.master_page_name_.get_value_or(L"");
//
style_master_page * master = Context.root()->odf_context().pageLayoutContainer().master_page_by_name(masterName);
//
//
//if (master)
//
// index = master->find_placeHolderIndex(PresentationClass, Context.last_idx_placeHolder);
//
//
//
Context.get_slide_context().start_shape(1);
//
Context.get_slide_context().set_placeHolder_type(presentation_class(PresentationClass).get_type_ms());
//
Context.get_slide_context().set_placeHolder_idx(index);
//
//
Context.get_text_context().start_object();
//
//
if (PresentationClass == presentation_class::date_time)
//
{
//
Context.get_text_context().start_field(oox::datetime, L"");
//
}
//
//
elm->pptx_convert(Context);
//
//
std::wstring text_content_ = Context.get_text_context().end_object();
//
//
if (text_content_.length()>0)
//
{
//
Context.get_slide_context().set_property(_property(L"text-content",text_content_));
//
}
//
Context.get_slide_context().set_property(_property(L"no_rect",true));
//
Context.get_slide_context().end_shape();
//
//
}
//
void
presentation_notes
::
pptx_convert_placeHolder
(
oox
::
pptx_conversion_context
&
Context
,
std
::
wstring
styleName
,
presentation_class
::
type
PresentationClass
)
{
office_element_ptr
elm
=
Context
.
root
()
->
odf_context
().
drawStyles
().
find_by_style_name
(
styleName
);
//todooo если это элемент datatime -нужно вытащить формат поля
if
(
!
elm
)
return
;
int
index
=-
1
;
const
std
::
wstring
masterName
=
attlist_
.
master_page_name_
.
get_value_or
(
L""
);
style_master_page
*
master
=
Context
.
root
()
->
odf_context
().
pageLayoutContainer
().
master_page_by_name
(
masterName
);
//if (master)
// index = master->find_placeHolderIndex(PresentationClass, Context.last_idx_placeHolder);
Context
.
get_slide_context
().
start_shape
(
1
);
Context
.
get_slide_context
().
set_placeHolder_type
(
presentation_class
(
PresentationClass
).
get_type_ms
());
Context
.
get_slide_context
().
set_placeHolder_idx
(
index
);
Context
.
get_text_context
().
start_object
();
if
(
PresentationClass
==
presentation_class
::
date_time
)
{
Context
.
get_text_context
().
start_field
(
oox
::
datetime
,
L""
);
}
elm
->
pptx_convert
(
Context
);
std
::
wstring
text_content_
=
Context
.
get_text_context
().
end_object
();
if
(
text_content_
.
length
()
>
0
)
{
Context
.
get_slide_context
().
set_property
(
_property
(
L"text-content"
,
text_content_
));
}
Context
.
get_slide_context
().
set_property
(
_property
(
L"no_rect"
,
true
));
Context
.
get_slide_context
().
end_shape
();
}
void
presentation_notes
::
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
)
{
const
std
::
wstring
pageStyleName
=
attlist_
.
draw_style_name_
.
get_value_or
(
L""
);
...
...
@@ -312,7 +312,7 @@ void presentation_notes::pptx_convert(oox::pptx_conversion_context & Context)
if
(
attlist_
.
draw_style_name_
)
{
style_instance
*
style_inst
=
Context
.
root
()
->
odf_context
().
styleContainer
().
style_by_name
(
pageStyleName
,
style_family
::
DrawingPage
,
false
);
style_instance
*
style_inst
=
Context
.
root
()
->
odf_context
().
styleContainer
().
style_by_name
(
pageStyleName
,
style_family
::
DrawingPage
,
Context
.
process_masters_
);
if
((
style_inst
)
&&
(
style_inst
->
content
()))
{
...
...
@@ -347,16 +347,16 @@ void presentation_notes::pptx_convert(oox::pptx_conversion_context & Context)
content_
[
i
]
->
pptx_convert
(
Context
);
}
//if (attlist_.use_footer_name_)//from master_page
//
{
//
std::wstring name = L"footer:" + *attlist_.use_footer_name_;
//
pptx_convert_placeHolder(Context, name, presentation_class::footer);
//
}
//if (attlist_.use_date_time_name_)//from master_page
//
{
//
std::wstring name = L"datetime:" + *attlist_.use_date_time_name_;
//
pptx_convert_placeHolder(Context, name, presentation_class::date_time);
//
}
if
(
attlist_
.
use_footer_name_
)
//from master_page_notes
{
std
::
wstring
name
=
L"footer:"
+
*
attlist_
.
use_footer_name_
;
pptx_convert_placeHolder
(
Context
,
name
,
presentation_class
::
footer
);
}
if
(
attlist_
.
use_date_time_name_
)
//from master_page_notes
{
std
::
wstring
name
=
L"datetime:"
+
*
attlist_
.
use_date_time_name_
;
pptx_convert_placeHolder
(
Context
,
name
,
presentation_class
::
date_time
);
}
}
...
...
ASCOfficeOdfFile/src/odf/draw_page.h
View file @
be65f18a
...
...
@@ -150,14 +150,14 @@ public:
static
const
ElementType
type
=
typePresentationNotes
;
CPDOCCORE_DEFINE_VISITABLE
();
virtual
void
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
);
private:
virtual
void
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
);
void
pptx_convert_placeHolder
(
oox
::
pptx_conversion_context
&
Context
,
std
::
wstring
styleName
,
odf_types
::
presentation_class
::
type
PresentationClass
);
virtual
void
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
);
virtual
void
add_child_element
(
xml
::
sax
*
Reader
,
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
);
office_element_ptr_array
content_
;
draw_page_attr
attlist_
;
};
...
...
ASCOfficeOdfFile/src/odf/odfcontext.cpp
View file @
be65f18a
...
...
@@ -360,11 +360,11 @@ void page_layout_instance::docx_convert_serialize(std::wostream & strm, oox::doc
if
(
props
)
props
->
docx_convert_serialize
(
strm
,
Context
);
}
void
page_layout_instance
::
pptx_
convert
(
oox
::
pptx_conversion_context
&
Context
)
void
page_layout_instance
::
pptx_
serialize
(
std
::
wostream
&
strm
,
oox
::
pptx_conversion_context
&
Context
)
{
style_page_layout_properties
*
props
=
properties
();
if
(
props
)
props
->
pptx_
convert
(
Context
);
props
->
pptx_
serialize
(
strm
,
Context
);
}
void
page_layout_container
::
add_page_layout
(
const
style_page_layout
*
StylePageLayout
)
...
...
ASCOfficeOdfFile/src/odf/odfcontext.h
View file @
be65f18a
...
...
@@ -195,7 +195,7 @@ public:
void
docx_convert_serialize
(
std
::
wostream
&
strm
,
oox
::
docx_conversion_context
&
Context
);
void
xlsx_serialize
(
std
::
wostream
&
strm
,
oox
::
xlsx_conversion_context
&
Context
);
void
pptx_
convert
(
oox
::
pptx_conversion_context
&
Context
);
void
pptx_
serialize
(
std
::
wostream
&
strm
,
oox
::
pptx_conversion_context
&
Context
);
const
style_page_layout
*
style_page_layout_
;
...
...
ASCOfficeOdfFile/src/odf/styles.cpp
View file @
be65f18a
...
...
@@ -1378,6 +1378,50 @@ void style_page_layout_properties::pptx_convert(oox::pptx_conversion_context & C
attlist_
.
pptx_convert
(
Context
);
}
void
style_page_layout_properties
::
pptx_serialize
(
std
::
wostream
&
strm
,
oox
::
pptx_conversion_context
&
Context
)
{
if
(
attlist_
.
fo_page_width_
||
attlist_
.
fo_page_height_
||
attlist_
.
style_print_orientation_
)
{
std
::
wstring
w_w
,
w_h
;
_INT64
h
=
0
,
w
=
0
;
if
(
attlist_
.
fo_page_width_
)
{
w
=
attlist_
.
fo_page_width_
->
get_value_unit
(
length
::
emu
);
if
(
w
<
914400
)
w
=
914400
;
w_w
=
boost
::
lexical_cast
<
std
::
wstring
>
(
w
);
}
if
(
attlist_
.
fo_page_height_
)
{
h
=
attlist_
.
fo_page_height_
->
get_value_unit
(
length
::
emu
);
if
(
h
<
914400
)
h
=
914400
;
w_h
=
std
::
to_wstring
(
h
);
}
std
::
wstring
w_orient
=
L"custom"
;
//if (w && h)
//{
// double ratio = (double)w/(double)h;
// if (abs(ratio - 16./9.)<0.01) w_orient = L"screen16x9";
// if (abs(ratio - 4./3.)<0.01) w_orient = L"screen4x3";
//}
strm
<<
L"<p:sldSz "
;
if
(
!
w_h
.
empty
())
strm
<<
L"cy=
\"
"
<<
w_h
<<
L"
\"
"
;
if
(
!
w_w
.
empty
())
strm
<<
L"cx=
\"
"
<<
w_w
<<
L"
\"
"
;
strm
<<
L"type=
\"
"
<<
w_orient
<<
L"
\"
"
;
strm
<<
L"/>"
;
}
}
// style-page-layout-properties-elements
//////////////////////////////////////////////////////////////////////////////////////////////////
...
...
ASCOfficeOdfFile/src/odf/styles.h
View file @
be65f18a
...
...
@@ -980,6 +980,7 @@ public:
bool
docx_background_serialize
(
std
::
wostream
&
strm
,
oox
::
docx_conversion_context
&
Context
,
oox
::
_oox_fill
&
fill
,
int
id
);
void
xlsx_serialize
(
std
::
wostream
&
strm
,
oox
::
xlsx_conversion_context
&
Context
);
void
pptx_serialize
(
std
::
wostream
&
strm
,
oox
::
pptx_conversion_context
&
Context
);
style_page_layout_properties
()
{
}
...
...
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