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
44fdbf6d
Commit
44fdbf6d
authored
Aug 07, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatWriter - fix notes layouts
parent
582fce4c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
27 deletions
+81
-27
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
+6
-10
ASCOfficePPTXFile/PPTXFormat/Folder.cpp
ASCOfficePPTXFile/PPTXFormat/Folder.cpp
+12
-2
ASCOfficePPTXFile/PPTXFormat/Logic/Shape.cpp
ASCOfficePPTXFile/PPTXFormat/Logic/Shape.cpp
+8
-0
ASCOfficePPTXFile/PPTXFormat/NotesMaster.h
ASCOfficePPTXFile/PPTXFormat/NotesMaster.h
+41
-6
ASCOfficePPTXFile/PPTXFormat/NotesSlide.h
ASCOfficePPTXFile/PPTXFormat/NotesSlide.h
+14
-9
No files found.
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
View file @
44fdbf6d
...
...
@@ -449,25 +449,21 @@ void PptxConverter::convert(PPTX::NotesSlide *oox_notes)
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
();
if
(
notes_master
.
IsInit
())
if
(
oox_notes
->
master_
.
IsInit
())
{
current_theme
=
notes_master
->
theme_
.
operator
->
();
current_clrMap
=
&
notes_master
->
clrMap
;
current_theme
=
oox_notes
->
master_
->
theme_
.
operator
->
();
current_clrMap
=
&
oox_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
();
}
convert_slide
(
&
oox_notes
->
cSld
,
NULL
,
true
,
true
,
Notes
);
...
...
ASCOfficePPTXFile/PPTXFormat/Folder.cpp
View file @
44fdbf6d
...
...
@@ -102,7 +102,6 @@ namespace PPTX
}
for
(
std
::
map
<
std
::
wstring
,
smart_ptr
<
OOX
::
File
>>::
const_iterator
pPair
=
map
.
m_map
.
begin
();
pPair
!=
map
.
m_map
.
end
();
++
pPair
)
{
const
OOX
::
FileType
&
curType
=
pPair
->
second
->
type
();
...
...
@@ -128,7 +127,6 @@ namespace PPTX
}
}
for
(
std
::
map
<
std
::
wstring
,
smart_ptr
<
OOX
::
File
>>::
const_iterator
pPair
=
map
.
m_map
.
begin
();
pPair
!=
map
.
m_map
.
end
();
++
pPair
)
{
const
OOX
::
FileType
&
curType
=
pPair
->
second
->
type
();
...
...
@@ -141,6 +139,18 @@ namespace PPTX
}
}
for
(
std
::
map
<
std
::
wstring
,
smart_ptr
<
OOX
::
File
>>::
const_iterator
pPair
=
map
.
m_map
.
begin
();
pPair
!=
map
.
m_map
.
end
();
++
pPair
)
{
const
OOX
::
FileType
&
curType
=
pPair
->
second
->
type
();
if
(
OOX
::
Presentation
::
FileTypes
::
NotesSlide
==
curType
)
{
smart_ptr
<
PPTX
::
NotesSlide
>
pointer
=
pPair
->
second
.
smart_dynamic_cast
<
PPTX
::
NotesSlide
>
();
if
(
pointer
.
is_init
())
pointer
->
ApplyRels
();
}
}
if
(
Event
)
Event
->
Progress
(
0
,
1000000
);
}
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Shape.cpp
View file @
44fdbf6d
...
...
@@ -469,9 +469,17 @@ namespace PPTX
if
((
nvSpPr
.
nvPr
.
ph
->
type
.
IsInit
())
||
(
nvSpPr
.
nvPr
.
ph
->
idx
.
IsInit
()))
{
if
(
parentFileIs
<
Slide
>
())
{
parentFileAs
<
Slide
>
().
Layout
->
GetLevelUp
(
this
);
}
else
if
(
parentFileIs
<
SlideLayout
>
())
{
parentFileAs
<
SlideLayout
>
().
Master
->
GetLevelUp
(
this
);
}
else
if
(
parentFileIs
<
NotesSlide
>
())
{
parentFileAs
<
NotesSlide
>
().
master_
->
GetLevelUp
(
this
);
}
}
}
}
...
...
ASCOfficePPTXFile/PPTXFormat/NotesMaster.h
View file @
44fdbf6d
...
...
@@ -58,7 +58,6 @@ namespace PPTX
{
}
public:
virtual
void
read
(
const
OOX
::
CPath
&
filename
,
FileMap
&
map
)
{
//FileContainer::read(filename, map);
...
...
@@ -85,8 +84,6 @@ namespace PPTX
WrapperFile
::
write
(
filename
,
directory
,
content
);
FileContainer
::
write
(
filename
,
directory
,
content
);
}
public:
virtual
const
OOX
::
FileType
type
()
const
{
return
OOX
::
Presentation
::
FileTypes
::
NotesMaster
;
...
...
@@ -186,10 +183,48 @@ namespace PPTX
pReader
->
Seek
(
end
);
}
virtual
void
GetLevelUp
(
Logic
::
Shape
*
pShape
)
{
if
(
!
pShape
)
return
;
public:
smart_ptr
<
Theme
>
theme_
;
smart_ptr
<
TableStyles
>
tableStyles_
;
if
(
pShape
->
nvSpPr
.
nvPr
.
ph
.
is_init
())
{
std
::
wstring
idx
=
pShape
->
nvSpPr
.
nvPr
.
ph
->
idx
.
get_value_or
(
L""
);
std
::
wstring
type
=
pShape
->
nvSpPr
.
nvPr
.
ph
->
type
.
get_value_or
(
L"body"
);
if
(
type
==
L"ctrTitle"
)
type
=
L"title"
;
for
(
size_t
i
=
0
;
i
<
cSld
.
spTree
.
SpTreeElems
.
size
();
++
i
)
{
smart_ptr
<
Logic
::
Shape
>
pMasterShape
=
cSld
.
spTree
.
SpTreeElems
[
i
].
GetElem
().
smart_dynamic_cast
<
Logic
::
Shape
>
();
if
(
pMasterShape
.
IsInit
())
{
if
(
pMasterShape
->
nvSpPr
.
nvPr
.
ph
.
is_init
())
{
std
::
wstring
lIdx
=
pMasterShape
->
nvSpPr
.
nvPr
.
ph
->
idx
.
get_value_or
(
_T
(
""
));
std
::
wstring
lType
=
pMasterShape
->
nvSpPr
.
nvPr
.
ph
->
type
.
get_value_or
(
_T
(
"body"
));
if
(
lType
==
L"ctrTitle"
)
lType
=
L"title"
;
if
((
type
==
lType
)
&&
(
idx
==
lIdx
)
&&
!
idx
.
empty
())
{
pShape
->
SetLevelUpElement
(
pMasterShape
.
operator
->
());
return
;
}
else
if
((
type
==
lType
)
&&
idx
.
empty
()
&&
lIdx
.
empty
())
{
pShape
->
SetLevelUpElement
(
pMasterShape
.
operator
->
());
return
;
}
}
}
}
}
}
smart_ptr
<
Theme
>
theme_
;
smart_ptr
<
TableStyles
>
tableStyles_
;
Logic
::
CSld
cSld
;
Logic
::
ClrMap
clrMap
;
...
...
ASCOfficePPTXFile/PPTXFormat/NotesSlide.h
View file @
44fdbf6d
...
...
@@ -37,8 +37,7 @@
#include "FileContainer.h"
#include "FileTypes.h"
#include "Logic/ClrMapOvr.h"
#include "Logic/CSld.h"
#include "NotesMaster.h"
namespace
PPTX
{
...
...
@@ -55,8 +54,6 @@ namespace PPTX
virtual
~
NotesSlide
()
{
}
public:
virtual
void
read
(
const
OOX
::
CPath
&
filename
,
FileMap
&
map
)
{
//FileContainer::read(filename, map);
...
...
@@ -79,8 +76,6 @@ namespace PPTX
WrapperFile
::
write
(
filename
,
directory
,
content
);
FileContainer
::
write
(
filename
,
directory
,
content
);
}
public:
virtual
const
OOX
::
FileType
type
()
const
{
return
OOX
::
Presentation
::
FileTypes
::
NotesSlide
;
...
...
@@ -127,7 +122,6 @@ namespace PPTX
pWriter
->
EndNode
(
_T
(
"p:notes"
));
}
virtual
void
fromPPTY
(
NSBinPptxRW
::
CBinaryFileReader
*
pReader
)
{
pReader
->
Skip
(
1
);
// type
...
...
@@ -145,7 +139,6 @@ namespace PPTX
else
if
(
1
==
_at
)
showMasterSp
=
pReader
->
GetBool
();
}
while
(
pReader
->
GetPos
()
<
end
)
{
BYTE
_rec
=
pReader
->
GetUChar
();
...
...
@@ -173,13 +166,25 @@ namespace PPTX
pReader
->
Seek
(
end
);
}
void
ApplyRels
()
{
smart_ptr
<
OOX
::
File
>
pFile
=
FileContainer
::
Get
(
OOX
::
Presentation
::
FileTypes
::
NotesMaster
);
public:
master_
=
pFile
.
smart_dynamic_cast
<
PPTX
::
NotesMaster
>
();
if
(
master_
.
IsInit
())
{
theme_
=
master_
->
theme_
;
}
}
Logic
::
CSld
cSld
;
nullable
<
Logic
::
ClrMapOvr
>
clrMapOvr
;
nullable_bool
showMasterPhAnim
;
nullable_bool
showMasterSp
;
smart_ptr
<
NotesMaster
>
master_
;
smart_ptr
<
Theme
>
theme_
;
};
}
// namespace PPTX
...
...
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