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
8ac51809
Commit
8ac51809
authored
Dec 20, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DocxBin background documents ...
parent
8cdf4911
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1347 additions
and
1345 deletions
+1347
-1345
ASCOfficeDocxFile2/BinReader/DocumentWriter.h
ASCOfficeDocxFile2/BinReader/DocumentWriter.h
+1
-1
ASCOfficeDocxFile2/BinReader/ReaderClasses.h
ASCOfficeDocxFile2/BinReader/ReaderClasses.h
+324
-322
ASCOfficeDocxFile2/BinReader/Readers.h
ASCOfficeDocxFile2/BinReader/Readers.h
+17
-4
ASCOfficeDocxFile2/BinWriter/BinWriters.h
ASCOfficeDocxFile2/BinWriter/BinWriters.h
+21
-23
ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp
ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp
+967
-979
ASCOfficePPTXFile/Editor/BinReaderWriterDefines.h
ASCOfficePPTXFile/Editor/BinReaderWriterDefines.h
+6
-5
ASCOfficePPTXFile/PPTXFormat/Logic/Shape.h
ASCOfficePPTXFile/PPTXFormat/Logic/Shape.h
+10
-10
X2tConverter/build/Qt/X2tConverter.pri
X2tConverter/build/Qt/X2tConverter.pri
+1
-1
No files found.
ASCOfficeDocxFile2/BinReader/DocumentWriter.h
View file @
8ac51809
...
...
@@ -54,7 +54,7 @@ namespace Writers
CFile
oFile
;
oFile
.
CreateFile
(
filePath
.
GetPath
());
oFile
.
WriteStringUTF8
(
CString
(
_T
(
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?>"
)));
oFile
.
WriteStringUTF8
(
CString
(
_T
(
"<
/w:body><
w:document xmlns:wpc=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas
\"
xmlns:mc=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
xmlns:wp14=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing
\"
xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
xmlns:w14=
\"
http://schemas.microsoft.com/office/word/2010/wordml
\"
xmlns:wpg=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingGroup
\"
xmlns:wpi=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingInk
\"
xmlns:wne=
\"
http://schemas.microsoft.com/office/word/2006/wordml
\"
xmlns:wps=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingShape
\"
mc:Ignorable=
\"
w14 wp14
\"
>"
)));
oFile
.
WriteStringUTF8
(
CString
(
_T
(
"<w:document xmlns:wpc=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas
\"
xmlns:mc=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
xmlns:wp14=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing
\"
xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
xmlns:w14=
\"
http://schemas.microsoft.com/office/word/2010/wordml
\"
xmlns:wpg=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingGroup
\"
xmlns:wpi=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingInk
\"
xmlns:wne=
\"
http://schemas.microsoft.com/office/word/2006/wordml
\"
xmlns:wps=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingShape
\"
mc:Ignorable=
\"
w14 wp14
\"
>"
)));
oFile
.
WriteStringUTF8
(
m_oBackground
.
GetData
());
...
...
ASCOfficeDocxFile2/BinReader/ReaderClasses.h
View file @
8ac51809
...
...
@@ -1996,13 +1996,14 @@ public:
double
PositionVPctOffset
;
double
SimplePosX
;
double
SimplePosY
;
CDrawingPropertyWrap
DrawingPropertyWrap
;
CString
sChartRels
;
CString
sSizeRelH
;
CString
sSizeRelV
;
int
m_nDocPr
;
CString
sGraphicFramePr
;
CDrawingPropertyWrap
DrawingPropertyWrap
;
bool
bDataPos
;
bool
bDataLength
;
bool
bType
;
...
...
@@ -2031,6 +2032,7 @@ public:
bool
bSimplePosX
;
bool
bSimplePosY
;
bool
bDrawingPropertyWrap
;
CDrawingProperty
(
int
nDocPr
)
{
m_nDocPr
=
nDocPr
;
...
...
@@ -2069,9 +2071,10 @@ public:
}
CString
Write
()
{
if
(
!
bType
)
return
L""
;
CString
sXml
;
if
(
bType
)
{
bool
bChart
=
IsChart
();
if
(
c_oAscWrapStyle
::
Inline
==
Type
)
{
...
...
@@ -2346,7 +2349,6 @@ public:
sXml
.
Append
(
_T
(
"</w:drawing>"
));
}
}
}
return
sXml
;
}
};
...
...
ASCOfficeDocxFile2/BinReader/Readers.h
View file @
8ac51809
...
...
@@ -3653,7 +3653,7 @@ public:
else
if
(
c_oSerParType
::
Background
==
type
)
{
Background
oBackground
;
res
=
Read
1
(
length
,
&
Binary_DocumentTableReader
::
Read_Background
,
this
,
&
oBackground
);
res
=
Read
2
(
length
,
&
Binary_DocumentTableReader
::
Read_Background
,
this
,
&
oBackground
);
m_oDocumentWriter
.
m_oBackground
.
WriteString
(
oBackground
.
Write
());
}
else
...
...
@@ -6577,17 +6577,30 @@ public:
}
else
if
(
c_oSerBackgroundType
::
pptxDrawing
==
type
)
{
long
nCurPos
=
m_oBufferedStream
.
GetPos
();
CDrawingProperty
oCDrawingProperty
(
m_oFileWriter
.
getNextDocPr
());
oCDrawingProperty
.
bType
=
oCDrawingProperty
.
bHeight
=
oCDrawingProperty
.
bWidth
=
true
;
oCDrawingProperty
.
Type
=
c_oAscWrapStyle
::
Inline
;
CString
sDrawingProperty
=
oCDrawingProperty
.
Write
();
BYTE
type
=
m_oBufferedStream
.
GetUChar
();
long
lenType
=
m_oBufferedStream
.
GetUChar
();
int
nRealLen
=
m_oBufferedStream
.
GetLong
();
CString
*
bstrDrawingXml
=
NULL
;
m_oFileWriter
.
m_pDrawingConverter
->
SaveObjectEx
(
nCurPos
,
length
,
L""
,
XMLWRITER_DOC_TYPE_DOCX
,
&
bstrDrawingXml
);
m_oBufferedStream
.
Seek
(
nCurPos
);
long
nCurPos
=
m_oBufferedStream
.
GetPos
();
m_oFileWriter
.
m_pDrawingConverter
->
SaveObjectEx
(
nCurPos
,
nRealLen
,
sDrawingProperty
,
XMLWRITER_DOC_TYPE_DOCX
,
&
bstrDrawingXml
);
if
(
NULL
!=
bstrDrawingXml
&&
false
==
bstrDrawingXml
->
IsEmpty
())
{
pBackground
->
sObject
=
*
bstrDrawingXml
;
}
RELEASEOBJECT
(
bstrDrawingXml
);
m_oBufferedStream
.
Seek
(
nCurPos
+
nRealLen
);
}
else
res
=
c_oSerConstants
::
ReadUnknown
;
...
...
ASCOfficeDocxFile2/BinWriter/BinWriters.h
View file @
8ac51809
...
...
@@ -3086,24 +3086,24 @@ namespace BinDocxRW
sXml
=
pBackground
->
m_oBackground
->
toXML
();
}
if
(
!
sXml
.
IsEmpty
())
{
int
nCurPos
=
m_oBcw
.
WriteItemStart
(
c_oSerBackgroundType
::
pptxDrawing
);
WriteDrawing
(
&
sXml
,
NULL
,
NULL
);
m_oBcw
.
WriteItemEnd
(
nCurPos
);
}
else
{
if
(
pBackground
->
m_oColor
.
IsInit
())
{
m_oBcw
.
WriteColor
(
c_oSerBackgroundType
::
Color
,
pBackground
->
m_oColor
.
get
());
}
else
if
(
pBackground
->
m_oThemeColor
.
IsInit
())
if
(
pBackground
->
m_oThemeColor
.
IsInit
())
{
m_oBcw
.
WriteThemeColor
(
c_oSerBackgroundType
::
ColorTheme
,
pBackground
->
m_oColor
,
pBackground
->
m_oThemeColor
,
pBackground
->
m_oThemeTint
,
pBackground
->
m_oThemeShade
);
}
}
if
(
!
sXml
.
IsEmpty
())
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerBackgroundType
::
pptxDrawing
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Variable
);
int
nCurPos
=
m_oBcw
.
WriteItemWithLengthStart
();
WriteDrawing
(
&
sXml
,
NULL
,
NULL
);
m_oBcw
.
WriteItemEnd
(
nCurPos
);
}
}
void
WriteParapraph
(
OOX
::
Logic
::
CParagraph
&
par
,
OOX
::
Logic
::
CParagraphProperty
*
pPr
)
{
...
...
@@ -5486,15 +5486,13 @@ namespace BinDocxRW
CString
*
bstrOutputXml
=
NULL
;
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerImageType2
::
PptxData
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Variable
);
nCurPos
=
m_oBcw
.
WriteItemWithLengthStart
();
HRESULT
hRes
=
m_pOfficeDrawingConverter
->
AddObject
(
*
pXml
,
&
bstrOutputXml
);
m_oBcw
.
WriteItemWithLengthEnd
(
nCurPos
);
if
(
S_OK
==
hRes
&&
NULL
!=
bstrOutputXml
)
{
// CString sDrawingXml;
// sDrawingXml.Format(_T("<root xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\"><w:drawing>%ls</w:drawing></root>"), *bstrOutputXml);
//
CString
sBegin
(
_T
(
"<root xmlns:wpc=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas
\"
xmlns:mc=
\"
http://schemas.openxmlformats.org/markup-compatibility/2006
\"
xmlns:o=
\"
urn:schemas-microsoft-com:office:office
\"
xmlns:r=
\"
http://schemas.openxmlformats.org/officeDocument/2006/relationships
\"
xmlns:m=
\"
http://schemas.openxmlformats.org/officeDocument/2006/math
\"
xmlns:v=
\"
urn:schemas-microsoft-com:vml
\"
xmlns:wp14=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing
\"
xmlns:wp=
\"
http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing
\"
xmlns:w10=
\"
urn:schemas-microsoft-com:office:word
\"
xmlns:w=
\"
http://schemas.openxmlformats.org/wordprocessingml/2006/main
\"
xmlns:w14=
\"
http://schemas.microsoft.com/office/word/2010/wordml
\"
xmlns:wpg=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingGroup
\"
xmlns:wpi=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingInk
\"
xmlns:wne=
\"
http://schemas.microsoft.com/office/word/2006/wordml
\"
xmlns:wps=
\"
http://schemas.microsoft.com/office/word/2010/wordprocessingShape
\"
><w:drawing>"
));
CString
sEnd
(
_T
(
"</w:drawing></root>"
));
...
...
ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp
View file @
8ac51809
This source diff could not be displayed because it is too large. You can
view the blob
instead.
ASCOfficePPTXFile/Editor/BinReaderWriterDefines.h
View file @
8ac51809
...
...
@@ -269,6 +269,7 @@ static CString SchemeClr_GetStringCode(const BYTE& val)
#define XMLWRITER_DOC_TYPE_XLSX 2
#define XMLWRITER_DOC_TYPE_CHART 3
#define XMLWRITER_DOC_TYPE_WORDART 4
#define XMLWRITER_DOC_TYPE_DOCX_CHILD 5
#define XMLWRITER_RECORD_TYPE_SPPR 0
#define XMLWRITER_RECORD_TYPE_CLRMAPOVR 1
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Shape.h
View file @
8ac51809
X2tConverter/build/Qt/X2tConverter.pri
View file @
8ac51809
...
...
@@ -7,7 +7,7 @@
QT -= core
QT -= gui
VERSION = 2.0.2.42
2
VERSION = 2.0.2.42
3
DEFINES += INTVER=$$VERSION
TARGET = x2t
...
...
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