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
7896b750
Commit
7896b750
authored
May 11, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PptFormatReader - presentation master notes & master handout
parent
7d188b22
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
652 additions
and
317 deletions
+652
-317
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/Converter.cpp
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/Converter.cpp
+211
-160
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/Converter.h
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/Converter.h
+1
-0
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/ImageManager.h
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/ImageManager.h
+12
-9
ASCOfficePPTFile/PPTFormatLib/Reader/PPTDocumentInfoOneUser.cpp
...icePPTFile/PPTFormatLib/Reader/PPTDocumentInfoOneUser.cpp
+405
-29
ASCOfficePPTFile/PPTFormatLib/Reader/PPTDocumentInfoOneUser.h
...fficePPTFile/PPTFormatLib/Reader/PPTDocumentInfoOneUser.h
+13
-3
ASCOfficePPTFile/PPTFormatLib/Reader/SlideInfo.h
ASCOfficePPTFile/PPTFormatLib/Reader/SlideInfo.h
+0
-1
ASCOfficePPTFile/PPTFormatLib/Records/DocumentRecords.h
ASCOfficePPTFile/PPTFormatLib/Records/DocumentRecords.h
+0
-78
ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcproj
ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcproj
+0
-4
ASCOfficePPTXFile/Editor/Drawing/Document.h
ASCOfficePPTXFile/Editor/Drawing/Document.h
+10
-33
No files found.
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/Converter.cpp
View file @
7896b750
This diff is collapsed.
Click to expand it.
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/Converter.h
View file @
7896b750
...
...
@@ -72,6 +72,7 @@ namespace NSPresentationEditor
void
WritePresInfo
();
void
WriteAll
();
void
WriteThemes
();
void
WriteTheme
(
CTheme
*
pTheme
,
int
&
nIndexTheme
,
int
&
nStartLayout
,
int
Type
=
1
);
void
WriteSlides
();
void
WriteNotes
();
void
WriteLayout
(
CLayout
&
oLayout
,
int
nIndexLayout
,
int
nStartLayout
,
int
nIndexTheme
);
...
...
ASCOfficePPTFile/PPTFormatLib/PPTXWriter/ImageManager.h
View file @
7896b750
...
...
@@ -170,12 +170,11 @@ namespace NSPresentationEditor
m_oWriter
.
WriteString
(
str1
);
int
nCurrent
=
nStartLayoutIndex
;
for
(
int
i
=
0
;
i
<
nCountLayouts
;
++
i
)
{
std
::
wstring
str
=
L"<Relationship Id=
\"
rId"
+
std
::
to_wstring
(
m_lNextRelsID
++
)
+
L"
\"
Type=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout
\"
Target=
\"
../slideLayouts/slideLayout"
+
std
::
to_wstring
(
n
Current
+
1
)
+
L".xml
\"
/>"
;
++
nCurrent
;
+
std
::
to_wstring
(
n
StartLayoutIndex
+
1
)
+
L".xml
\"
/>"
;
nStartLayoutIndex
++
;
m_oWriter
.
WriteString
(
str
);
}
...
...
@@ -196,16 +195,20 @@ namespace NSPresentationEditor
m_oWriter
.
WriteString
(
str
);
}
inline
void
StartNotes
(
int
nIndexSlide
)
inline
void
StartNotes
(
int
nIndexSlide
,
bool
bMaster
)
{
m_oWriter
.
WriteString
(
L"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>\
<Relationships xmlns=
\"
http://schemas.openxmlformats.org/package/2006/relationships
\"
>"
);
m_oWriter
.
WriteString
(
L"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>\
<Relationships xmlns=
\"
http://schemas.openxmlformats.org/package/2006/relationships
\"
>"
);
if
(
bMaster
)
{
m_oWriter
.
WriteString
(
L"<Relationship Id=
\"
rId"
+
std
::
to_wstring
(
m_lNextRelsID
++
)
+
L"
\"
Type=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster
\"
Target=
\"
../notesMasters/notesMaster1.xml
\"
/>"
);
}
if
(
nIndexSlide
>=
0
)
{
m_oWriter
.
WriteString
(
L"<Relationship Id=
\"
rId"
+
std
::
to_wstring
(
m_lNextRelsID
++
)
+
L"
\"
Type=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesS
lide
\"
Target=
\"
../slides/slide"
+
std
::
to_wstring
(
nIndexSlide
+
1
)
+
L".xml
\"
/>"
);
L"
\"
Type=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships/s
lide
\"
Target=
\"
../slides/slide"
+
std
::
to_wstring
(
nIndexSlide
+
1
)
+
L".xml
\"
/>"
);
}
}
inline
void
StartSlide
(
int
nIndexLayout
,
int
nIndexNotes
)
...
...
ASCOfficePPTFile/PPTFormatLib/Reader/PPTDocumentInfoOneUser.cpp
View file @
7896b750
This diff is collapsed.
Click to expand it.
ASCOfficePPTFile/PPTFormatLib/Reader/PPTDocumentInfoOneUser.h
View file @
7896b750
...
...
@@ -51,6 +51,9 @@ public:
std
::
map
<
DWORD
,
CRecordSlide
*>
m_mapMasters
;
std
::
map
<
DWORD
,
CRecordSlide
*>
m_mapNotes
;
std
::
map
<
DWORD
,
CRecordSlide
*>
m_mapNotesMasters
;
std
::
map
<
DWORD
,
CRecordSlide
*>
m_mapHandoutMasters
;
std
::
vector
<
DWORD
>
m_arrSlidesOrder
;
std
::
vector
<
DWORD
>
m_arrMastersOrder
;
std
::
vector
<
DWORD
>
m_arrNotesOrder
;
...
...
@@ -66,6 +69,9 @@ public:
std
::
vector
<
CSlideInfo
>
m_arMasterWrapper
;
std
::
vector
<
CSlideInfo
>
m_arNotesWrapper
;
CSlideInfo
*
m_pNotesMasterWrapper
;
CSlideInfo
*
m_pHandoutMasterWrapper
;
// эти параметры - одни на весь документ.
// чтобы поддержать нашу схему (пптх) - копируем их в темы
std
::
vector
<
CRecordBlipStoreContainer
*>
m_arrBlipStore
;
...
...
@@ -124,10 +130,14 @@ public:
void
LoadNoMainMaster
(
DWORD
dwMasterID
,
const
LONG
&
lOriginWidth
,
const
LONG
&
lOriginHeight
);
void
LoadMainMaster
(
DWORD
dwMasterID
,
const
LONG
&
lOriginWidth
,
const
LONG
&
lOriginHeight
);
void
CPPTUserInfo
::
LoadMaster
(
CRecordSlide
*
pMaster
,
CSlideInfo
*&
pMasterWrapper
,
CTheme
*&
pTheme
);
void
LoadSlideFromPrevUsers
(
DWORD
dwSlideID
);
void
LoadMasterFromPrevUsers
(
DWORD
dwSlideID
);
void
LoadNoteFromPrevUsers
(
DWORD
dwSlideID
);
void
LoadSlideFromPrevUsers
(
DWORD
dwSlideID
);
void
LoadMasterFromPrevUsers
(
DWORD
dwSlideID
);
void
LoadNotesFromPrevUsers
(
DWORD
dwSlideID
);
void
LoadNotesMasterFromPrevUsers
(
DWORD
dwSlideID
);
void
LoadHandoutMasterFromPrevUsers
(
DWORD
dwSlideID
);
void
LoadExternal
(
CRecordExObjListContainer
*
pExObjects
);
...
...
ASCOfficePPTFile/PPTFormatLib/Reader/SlideInfo.h
View file @
7896b750
...
...
@@ -85,7 +85,6 @@ public:
std
::
map
<
int
,
std
::
wstring
>*
m_mapFilePictures
;
nullable_base
<
NSPresentationEditor
::
CTextStyles
>
m_pStyles
[
9
];
public:
CSlideInfo
()
{
}
...
...
ASCOfficePPTFile/PPTFormatLib/Records/DocumentRecords.h
View file @
7896b750
...
...
@@ -50,84 +50,6 @@ public:
m_arSlidePersists
.
clear
();
}
/*virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_arMasterPersists.clear();
m_arNotePersists.clear();
m_arSlidePersists.clear();
m_arRecords.clear();
UINT lCurLen = 0;
ULONG lReadLen = 0;
SRecordHeader oRec;
while (lCurLen < m_oHeader.RecLen)
{
pStream->Read(&oRec, sizeof(oRec), &lReadLen);
if (0 >= lReadLen)
{
break;
}
if (RECORD_TYPE_SLIDELISTWITHTEXT == oRec.RecType)
{
CRecordSlideListWithText* pAtom = new CRecordSlideListWithText();
pAtom->ReadFromStream(oRec, pStream);
std::vector<SSlidePersist>* pArray = NULL;
switch (pAtom->m_Type)
{
case CRecordSlideListWithText::CollectionOfMasterSlides:
{
pArray = &m_arMasterPersists;
break;
}
case CRecordSlideListWithText::CollectionOfNotesSlides:
{
pArray = &m_arNotePersists;
break;
}
case CRecordSlideListWithText::CollectionOfSlides:
{
pArray = &m_arSlidePersists;
break;
}
default:
{
// этого не может быть...
lCurLen += (8 + oRec.RecLen);
continue;
}
};
size_t nCountItems = pAtom->m_arSlides.size();
for (size_t index = 0; index < nCountItems; ++index)
{
SSlidePersist oPersist;
oPersist.m_nPsrRef = pAtom->m_arSlides[index]->m_nPsrRef;
oPersist.m_nSlideID = pAtom->m_arSlides[index]->m_nSlideID;
oPersist.m_arTextAttrs += pAtom->m_arTextPlaceHolders[index];
pArray->Add(oPersist);
}
delete pAtom;
}
else
{
IRecord* pRecord = CreateByType(oRec);
pRecord->ReadFromStream(oRec, pStream);
m_arRecords.Add(pRecord);
}
lCurLen += (8 + oRec.RecLen);
}
}*/
virtual
void
ReadFromStream
(
SRecordHeader
&
oHeader
,
POLE
::
Stream
*
pStream
)
{
m_oHeader
=
oHeader
;
...
...
ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcproj
View file @
7896b750
...
...
@@ -462,10 +462,6 @@
RelativePath=
"..\Reader\ClassesAtom.h"
>
</File>
<File
RelativePath=
"..\..\..\ASCPresentationEditor\OfficeDrawing\Document.h"
>
</File>
<File
RelativePath=
"..\Reader\PPTDocumentInfo.h"
>
...
...
ASCOfficePPTXFile/Editor/Drawing/Document.h
View file @
7896b750
...
...
@@ -43,59 +43,36 @@ namespace NSPresentationEditor
std
::
vector
<
CSlide
*>
m_arSlides
;
std
::
vector
<
CSlide
*>
m_arNotes
;
CTheme
*
m_pNotesMaster
;
CTheme
*
m_pHandoutMaster
;
CMetricInfo
m_oInfo
;
CDocument
()
:
m_arThemes
(),
m_arSlides
()
{
m_pHandoutMaster
=
NULL
;
m_pNotesMaster
=
NULL
;
}
~
CDocument
()
{
}
CDocument
&
operator
=
(
const
CDocument
&
oSrc
)
{
m_arThemes
=
oSrc
.
m_arThemes
;
m_arSlides
=
oSrc
.
m_arSlides
;
m_arNotes
=
oSrc
.
m_arNotes
;
m_oInfo
=
oSrc
.
m_oInfo
;
return
*
this
;
}
CDocument
(
const
CDocument
&
oSrc
)
{
*
this
=
oSrc
;
Clear
();
}
inline
void
Clear
()
{
ClearThemes
();
m_arThemes
.
clear
();
try
{
ClearSlides
();
ClearNotes
();
RELEASEOBJECT
(
m_pHandoutMaster
);
RELEASEOBJECT
(
m_pNotesMaster
);
}
catch
(...)
{
}
}
inline
void
ClearThemes
()
{
m_arThemes
.
clear
();
}
inline
void
AddTheme
(
const
CTheme
&
oTheme
)
{
m_arThemes
.
push_back
(
oTheme
);
}
inline
void
UpdateTheme
(
size_t
nIndex
,
const
CTheme
&
oTheme
)
{
if
(
nIndex
>=
m_arThemes
.
size
())
return
;
m_arThemes
[
nIndex
]
=
oTheme
;
}
inline
void
ClearSlides
()
{
for
(
size_t
i
=
0
;
i
<
m_arSlides
.
size
();
i
++
)
...
...
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