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
8cdf4911
Commit
8cdf4911
authored
Dec 19, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DocxBin - add background document
parent
c5c64cb6
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
605 additions
and
440 deletions
+605
-440
ASCOfficeDocxFile2/BinReader/DocumentWriter.h
ASCOfficeDocxFile2/BinReader/DocumentWriter.h
+16
-7
ASCOfficeDocxFile2/BinReader/HeaderFooterWriter.h
ASCOfficeDocxFile2/BinReader/HeaderFooterWriter.h
+2
-1
ASCOfficeDocxFile2/BinReader/ReaderClasses.h
ASCOfficeDocxFile2/BinReader/ReaderClasses.h
+49
-4
ASCOfficeDocxFile2/BinReader/Readers.h
ASCOfficeDocxFile2/BinReader/Readers.h
+120
-71
ASCOfficeDocxFile2/BinWriter/BinReaderWriterDefines.h
ASCOfficeDocxFile2/BinWriter/BinReaderWriterDefines.h
+23
-15
ASCOfficeDocxFile2/BinWriter/BinWriters.h
ASCOfficeDocxFile2/BinWriter/BinWriters.h
+361
-334
ASCOfficeOdfFileW/ASCOfficeOdfFileWTest/ASCOfficeOdfFileWTest.cpp
...eOdfFileW/ASCOfficeOdfFileWTest/ASCOfficeOdfFileWTest.cpp
+6
-0
ASCOfficeOdfFileW/ASCOfficeOdfFileWTest/ASCOfficeOdfFileWTest.vcproj
...fFileW/ASCOfficeOdfFileWTest/ASCOfficeOdfFileWTest.vcproj
+12
-0
Common/DocxFormat/Source/DocxFormat/Document.h
Common/DocxFormat/Source/DocxFormat/Document.h
+16
-8
No files found.
ASCOfficeDocxFile2/BinReader/DocumentWriter.h
View file @
8cdf4911
...
...
@@ -53,13 +53,22 @@ namespace Writers
CFile
oFile
;
oFile
.
CreateFile
(
filePath
.
GetPath
());
oFile
.
WriteStringUTF8
(
CString
(
_T
(
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
standalone=
\"
yes
\"
?><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
\"
><w:body>"
)));
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
(
m_oBackground
.
GetData
());
oFile
.
WriteStringUTF8
(
CString
(
_T
(
"<w:body>"
)));
oFile
.
WriteStringUTF8
(
m_oContent
.
GetData
());
oFile
.
WriteStringUTF8
(
CString
(
_T
(
"<w:sectPr >"
)));
oFile
.
WriteStringUTF8
(
WriteSectPrHdrFtr
());
oFile
.
WriteStringUTF8
(
m_oSecPr
.
GetData
());
oFile
.
WriteStringUTF8
(
CString
(
_T
(
"</w:sectPr>"
)));
oFile
.
WriteStringUTF8
(
CString
(
_T
(
"</w:body></w:document>"
)));
oFile
.
WriteStringUTF8
(
CString
(
_T
(
"</w:body>"
)));
oFile
.
WriteStringUTF8
(
CString
(
_T
(
"</w:document>"
)));
oFile
.
CloseFile
();
}
CString
WriteSectPrHdrFtr
()
...
...
ASCOfficeDocxFile2/BinReader/HeaderFooterWriter.h
View file @
8cdf4911
...
...
@@ -39,6 +39,7 @@ namespace Writers
class
ContentWriter
{
public:
XmlUtils
::
CStringWriter
m_oBackground
;
XmlUtils
::
CStringWriter
m_oContent
;
XmlUtils
::
CStringWriter
m_oSecPr
;
};
...
...
ASCOfficeDocxFile2/BinReader/ReaderClasses.h
View file @
8cdf4911
...
...
@@ -265,6 +265,51 @@ public:
bBeforeAuto
=
false
;
}
};
class
Background
{
public:
docRGB
Color
;
CThemeColor
ThemeColor
;
CString
sObject
;
bool
bColor
;
bool
bThemeColor
;
Background
()
:
bColor
(
false
),
bThemeColor
(
false
)
{}
CString
Write
()
{
CString
sBackground
=
L"<w:background"
;
if
(
bColor
)
{
sBackground
+=
L" w:color=
\"
"
+
Color
.
ToString
()
+
L"
\"
"
;
}
if
(
bThemeColor
&&
ThemeColor
.
IsNoEmpty
())
{
if
(
ThemeColor
.
bColor
)
sBackground
+=
L" w:themeColor=
\"
"
+
ThemeColor
.
ToStringColor
()
+
L"
\"
"
;
if
(
ThemeColor
.
bTint
)
sBackground
+=
L" w:themeColorTint=
\"
"
+
ThemeColor
.
ToStringTint
()
+
L"
\"
"
;
if
(
ThemeColor
.
bShade
)
sBackground
+=
L" w:themeColorShade=
\"
"
+
ThemeColor
.
ToStringShade
()
+
L"
\"
"
;
}
if
(
!
bColor
&&
!
bThemeColor
)
{
sBackground
+=
L" w:color=
\"
ffffff
\"
"
;
}
sBackground
+=
L">"
;
sBackground
+=
sObject
;
sBackground
+=
L"</w:background>"
;
return
sBackground
;
}
};
class
Shd
{
public:
...
...
ASCOfficeDocxFile2/BinReader/Readers.h
View file @
8cdf4911
This diff is collapsed.
Click to expand it.
ASCOfficeDocxFile2/BinWriter/BinReaderWriterDefines.h
View file @
8cdf4911
...
...
@@ -152,7 +152,8 @@ extern int g_nCurFormatVersion;
Comments
=
8
,
Settings
=
9
,
Footnotes
=
10
,
Endnotes
=
11
Endnotes
=
11
,
Background
};}
namespace
c_oSerSigTypes
{
enum
c_oSerSigTypes
{
...
...
@@ -459,7 +460,8 @@ extern int g_nCurFormatVersion;
Hyperlink
=
10
,
FldSimple
=
11
,
Del
=
12
,
Ins
=
13
Ins
=
13
,
Background
=
14
};}
namespace
c_oSerDocTableType
{
enum
c_oSerDocTableType
{
...
...
@@ -506,6 +508,12 @@ extern int g_nCurFormatVersion;
endnoteReference
=
27
,
arPr
=
28
};}
namespace
c_oSerBackgroundType
{
enum
c_oSerBackgroundType
{
Color
=
0
,
ColorTheme
=
1
,
pptxDrawing
=
2
};}
namespace
c_oSerImageType
{
enum
c_oSerImageType
{
MediaId
=
0
,
...
...
ASCOfficeDocxFile2/BinWriter/BinWriters.h
View file @
8cdf4911
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFileW/ASCOfficeOdfFileWTest/ASCOfficeOdfFileWTest.cpp
View file @
8cdf4911
...
...
@@ -47,6 +47,12 @@
#include "../source/Oox2OdfConverter/Oox2OdfConverter.h"
#if defined(_WIN64)
#pragma comment(lib, "../../build/bin/icu/win_64/icuuc.lib")
#elif defined (_WIN32)
#pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib")
#endif
std
::
wstring
DetectTypeDocument
(
const
std
::
wstring
&
pathOOX
)
{
std
::
wstring
sRes
;
...
...
ASCOfficeOdfFileW/ASCOfficeOdfFileWTest/ASCOfficeOdfFileWTest.vcproj
View file @
8cdf4911
...
...
@@ -373,6 +373,18 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=
"..\..\UnicodeConverter\UnicodeConverter.cpp"
>
<FileConfiguration
Name=
"Debug|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
UsePrecompiledHeader=
"0"
/>
</FileConfiguration>
</File>
</Filter>
</Files>
<Globals>
...
...
Common/DocxFormat/Source/DocxFormat/Document.h
View file @
8cdf4911
...
...
@@ -96,6 +96,8 @@ namespace OOX
if
(
_T
(
"w:drawing"
)
==
sName
)
m_oDrawing
=
oReader
;
else
if
(
_T
(
"v:background"
)
==
sName
)
m_oBackground
=
oReader
;
}
}
virtual
CString
toXML
()
const
...
...
@@ -136,6 +138,11 @@ namespace OOX
sResult
+=
m_oDrawing
->
toXML
();
sResult
+=
_T
(
"</w:background>"
);
}
else
if
(
m_oBackground
.
IsInit
())
{
//наличие атрибута Color обязательно
sResult
+=
m_oBackground
->
toXML
();
sResult
+=
_T
(
"</w:background>"
);
}
else
sResult
+=
_T
(
"/>"
);
...
...
@@ -172,6 +179,7 @@ namespace OOX
// Childs
nullable
<
OOX
::
Logic
::
CDrawing
>
m_oDrawing
;
nullable
<
OOX
::
Vml
::
CBackground
>
m_oBackground
;
};
}
}
...
...
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