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
635a5d23
Commit
635a5d23
authored
Dec 13, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DocFormatReader - background page
parent
6fa18eb2
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
757 additions
and
828 deletions
+757
-828
ASCOfficeDocFile/DocDocxConverter/DocumentProperties.cpp
ASCOfficeDocFile/DocDocxConverter/DocumentProperties.cpp
+154
-133
ASCOfficeDocFile/DocDocxConverter/DocumentProperties.h
ASCOfficeDocFile/DocDocxConverter/DocumentProperties.h
+1
-0
ASCOfficeDocFile/DocDocxConverter/FileInformationBlock.h
ASCOfficeDocFile/DocDocxConverter/FileInformationBlock.h
+2
-0
ASCOfficeDocFile/DocDocxConverter/MainDocumentMapping.cpp
ASCOfficeDocFile/DocDocxConverter/MainDocumentMapping.cpp
+38
-24
ASCOfficeDocFile/DocDocxConverter/OfficeArtContent.h
ASCOfficeDocFile/DocDocxConverter/OfficeArtContent.h
+20
-9
ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/DrawingRecord.h
...iceDocFile/DocDocxConverter/OfficeDrawing/DrawingRecord.h
+5
-7
ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/RecordFactory.cpp
...eDocFile/DocDocxConverter/OfficeDrawing/RecordFactory.cpp
+15
-21
ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/Shape.h
ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/Shape.h
+14
-27
ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/ShapeContainer.h
...ceDocFile/DocDocxConverter/OfficeDrawing/ShapeContainer.h
+13
-1
ASCOfficeDocFile/DocDocxConverter/SectionPropertiesMapping.cpp
...ficeDocFile/DocDocxConverter/SectionPropertiesMapping.cpp
+1
-0
ASCOfficeDocFile/DocDocxConverter/SettingsMapping.cpp
ASCOfficeDocFile/DocDocxConverter/SettingsMapping.cpp
+164
-160
ASCOfficeDocFile/DocDocxConverter/ShadingDescriptor.h
ASCOfficeDocFile/DocDocxConverter/ShadingDescriptor.h
+9
-19
ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp
ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp
+306
-419
ASCOfficeDocFile/DocFormatTest/DocFormatTest.cpp
ASCOfficeDocFile/DocFormatTest/DocFormatTest.cpp
+3
-1
ASCOfficeOdfFile/Test/ASCOfficeOdfFileTest/ASCOfficeOdfFileTest.cpp
...dfFile/Test/ASCOfficeOdfFileTest/ASCOfficeOdfFileTest.cpp
+10
-1
ASCOfficeOdfFile/Test/ASCOfficeOdfFileTest/ASCOfficeOdfFileTest.vcproj
...ile/Test/ASCOfficeOdfFileTest/ASCOfficeOdfFileTest.vcproj
+0
-4
ASCOfficePPTFile/Win32/PptFormatTest/PptFormatTest.cpp
ASCOfficePPTFile/Win32/PptFormatTest/PptFormatTest.cpp
+2
-2
No files found.
ASCOfficeDocFile/DocDocxConverter/DocumentProperties.cpp
View file @
635a5d23
This diff is collapsed.
Click to expand it.
ASCOfficeDocFile/DocDocxConverter/DocumentProperties.h
View file @
635a5d23
...
@@ -54,6 +54,7 @@ namespace DocFileFormat
...
@@ -54,6 +54,7 @@ namespace DocFileFormat
friend
class
SettingsMapping
;
friend
class
SettingsMapping
;
bool
bDisplayBackgroundShape
;
private:
private:
// True when facing pages should be printed
// True when facing pages should be printed
bool
fFacingPages
;
bool
fFacingPages
;
...
...
ASCOfficeDocFile/DocDocxConverter/FileInformationBlock.h
View file @
635a5d23
...
@@ -1162,6 +1162,8 @@ namespace DocFileFormat
...
@@ -1162,6 +1162,8 @@ namespace DocFileFormat
{
{
//Read the FibRgCswNew
//Read the FibRgCswNew
m_FibNew
.
nFibNew
=
(
FibVersion
)
reader
.
ReadUInt16
();
m_FibNew
.
nFibNew
=
(
FibVersion
)
reader
.
ReadUInt16
();
if
(
m_FibNew
.
nFibNew
==
0
)
m_FibNew
.
nFibNew
=
Fib1997
;
m_FibNew
.
cQuickSavesNew
=
reader
.
ReadUInt16
();
m_FibNew
.
cQuickSavesNew
=
reader
.
ReadUInt16
();
}
}
}
}
...
...
ASCOfficeDocFile/DocDocxConverter/MainDocumentMapping.cpp
View file @
635a5d23
...
@@ -53,33 +53,47 @@ namespace DocFileFormat
...
@@ -53,33 +53,47 @@ namespace DocFileFormat
m_context
->
_docx
->
RegisterDocument
();
m_context
->
_docx
->
RegisterDocument
();
// Header
// Header
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
?"
)
);
m_pXmlWriter
->
WriteNodeBegin
(
L"?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
?"
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:document"
)
,
TRUE
);
m_pXmlWriter
->
WriteNodeBegin
(
L"w:document"
,
TRUE
);
// Namespaces
// Namespaces
m_pXmlWriter
->
WriteAttribute
(
_T
(
"xmlns:w"
)
,
OpenXmlNamespaces
::
WordprocessingML
);
m_pXmlWriter
->
WriteAttribute
(
L"xmlns:w"
,
OpenXmlNamespaces
::
WordprocessingML
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"xmlns:v"
)
,
OpenXmlNamespaces
::
VectorML
);
m_pXmlWriter
->
WriteAttribute
(
L"xmlns:v"
,
OpenXmlNamespaces
::
VectorML
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"xmlns:o"
)
,
OpenXmlNamespaces
::
Office
);
m_pXmlWriter
->
WriteAttribute
(
L"xmlns:o"
,
OpenXmlNamespaces
::
Office
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"xmlns:w10"
),
OpenXmlNamespaces
::
OfficeWord
);
m_pXmlWriter
->
WriteAttribute
(
L"xmlns:w10"
,
OpenXmlNamespaces
::
OfficeWord
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"xmlns:r"
)
,
OpenXmlNamespaces
::
Relationships
);
m_pXmlWriter
->
WriteAttribute
(
L"xmlns:r"
,
OpenXmlNamespaces
::
Relationships
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"xmlns:m"
),
_T
(
"http://schemas.openxmlformats.org/officeDocument/2006/math"
)
);
m_pXmlWriter
->
WriteAttribute
(
L"xmlns:m"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/math"
);
//m_pXmlWriter->WriteAttribute(
_T("xmlns:wpc"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas")
);
//m_pXmlWriter->WriteAttribute(
L"xmlns:wpc", L"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"
);
//m_pXmlWriter->WriteAttribute(
_T("xmlns:mc"), _T("http://schemas.openxmlformats.org/markup-compatibility/2006")
);
//m_pXmlWriter->WriteAttribute(
L"xmlns:mc", L"http://schemas.openxmlformats.org/markup-compatibility/2006"
);
//m_pXmlWriter->WriteAttribute(
_T("xmlns:wp14"),_T("http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing")
);
//m_pXmlWriter->WriteAttribute(
L"xmlns:wp14", L"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"
);
//m_pXmlWriter->WriteAttribute(
_T("xmlns:wp"), _T("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing")
);
//m_pXmlWriter->WriteAttribute(
L"xmlns:wp", L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
);
//m_pXmlWriter->WriteAttribute(
_T("xmlns:w14"), _T("http://schemas.microsoft.com/office/word/2010/wordml")
);
//m_pXmlWriter->WriteAttribute(
L"xmlns:w14", L"http://schemas.microsoft.com/office/word/2010/wordml"
);
//m_pXmlWriter->WriteAttribute(
_T("xmlns:wpg"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingGroup")
);
//m_pXmlWriter->WriteAttribute(
L"xmlns:wpg", L"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"
);
//m_pXmlWriter->WriteAttribute(
_T("xmlns:wpi"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingInk")
);
//m_pXmlWriter->WriteAttribute(
L"xmlns:wpi", L"http://schemas.microsoft.com/office/word/2010/wordprocessingInk"
);
//m_pXmlWriter->WriteAttribute(
_T("xmlns:wne"), _T("http://schemas.microsoft.com/office/word/2006/wordml")
);
//m_pXmlWriter->WriteAttribute(
L"xmlns:wne", L"http://schemas.microsoft.com/office/word/2006/wordml"
);
//m_pXmlWriter->WriteAttribute(
_T("xmlns:wps"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingShape")
);
//m_pXmlWriter->WriteAttribute(
L"xmlns:wps", L"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"
);
//m_pXmlWriter->WriteAttribute(
_T("mc:Ignorable"), _T("w14 wp14")
);
//m_pXmlWriter->WriteAttribute(
L"mc:Ignorable", L"w14 wp14"
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
)
,
TRUE
,
FALSE
);
m_pXmlWriter
->
WriteNodeEnd
(
L""
,
TRUE
,
FALSE
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:body"
),
FALSE
);
if
((
m_document
->
GetOfficeArt
())
&&
(
m_document
->
GetOfficeArt
()
->
GetShapeBackgound
()))
{
m_document
->
DocProperties
->
bDisplayBackgroundShape
=
true
;
ShapeContainer
*
pShape
=
m_document
->
GetOfficeArt
()
->
GetShapeBackgound
();
m_pXmlWriter
->
WriteNodeBegin
(
L"w:background"
,
TRUE
);
m_pXmlWriter
->
WriteAttribute
(
L"w:color"
,
L"FFFFFF"
);
m_pXmlWriter
->
WriteNodeEnd
(
L""
,
TRUE
,
FALSE
);
VMLShapeMapping
oVmlWriter
(
m_context
,
m_pXmlWriter
,
NULL
,
NULL
,
_caller
);
pShape
->
Convert
(
&
oVmlWriter
);
m_pXmlWriter
->
WriteNodeEnd
(
L"w:background"
);
}
m_pXmlWriter
->
WriteNodeBegin
(
L"w:body"
,
FALSE
);
// Convert the document
// Convert the document
_lastValidPapx
=
NULL
;
_lastValidPapx
=
NULL
;
if
(
m_document
->
AllPapxFkps
->
empty
()
==
false
)
if
(
m_document
->
AllPapxFkps
->
empty
()
==
false
)
{
{
...
@@ -175,8 +189,8 @@ namespace DocFileFormat
...
@@ -175,8 +189,8 @@ namespace DocFileFormat
}
}
}
}
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
"w:body"
)
);
m_pXmlWriter
->
WriteNodeEnd
(
L"w:body"
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
"w:document"
)
);
m_pXmlWriter
->
WriteNodeEnd
(
L"w:document"
);
m_context
->
_docx
->
DocumentXML
=
std
::
wstring
(
m_pXmlWriter
->
GetXmlString
());
m_context
->
_docx
->
DocumentXML
=
std
::
wstring
(
m_pXmlWriter
->
GetXmlString
());
}
}
...
...
ASCOfficeDocFile/DocDocxConverter/OfficeArtContent.h
View file @
635a5d23
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include "OfficeDrawing/RecordFactory.h"
#include "OfficeDrawing/RecordFactory.h"
#include "OfficeDrawing/DrawingContainer.h"
#include "OfficeDrawing/DrawingContainer.h"
#include "OfficeDrawing/DrawingRecord.h"
#include "OfficeDrawing/DrawingGroup.h"
#include "OfficeDrawing/DrawingGroup.h"
#include "OfficeDrawing/GroupContainer.h"
#include "OfficeDrawing/GroupContainer.h"
#include "OfficeDrawing/Shape.h"
#include "OfficeDrawing/Shape.h"
...
@@ -57,7 +58,7 @@ namespace DocFileFormat
...
@@ -57,7 +58,7 @@ namespace DocFileFormat
public:
public:
OfficeArtContent
(
const
FileInformationBlock
*
pFIB
,
POLE
::
Stream
*
pStream
)
:
m_pDrawingGroupData
(
NULL
)
OfficeArtContent
(
const
FileInformationBlock
*
pFIB
,
POLE
::
Stream
*
pStream
)
:
m_pDrawingGroupData
(
NULL
)
,
m_pBackgroud
(
NULL
)
{
{
VirtualStreamReader
oStearmReader
(
pStream
,
0
,
pFIB
->
m_bOlderVersion
);
VirtualStreamReader
oStearmReader
(
pStream
,
0
,
pFIB
->
m_bOlderVersion
);
...
@@ -87,15 +88,23 @@ namespace DocFileFormat
...
@@ -87,15 +88,23 @@ namespace DocFileFormat
{
{
// the child is a subgroup
// the child is a subgroup
GroupContainer
*
group
=
static_cast
<
GroupContainer
*>
(
groupChild
);
GroupContainer
*
group
=
static_cast
<
GroupContainer
*>
(
groupChild
);
group
->
Index
=
i
;
if
(
group
)
drawing
.
container
->
Children
[
i
]
=
group
;
{
group
->
Index
=
i
;
}
}
}
else
if
(
ShapeContainer
::
TYPE_CODE_0xF004
==
groupChild
->
TypeCode
)
else
if
(
ShapeContainer
::
TYPE_CODE_0xF004
==
groupChild
->
TypeCode
)
{
{
// the child is a shape
// the child is a shape
ShapeContainer
*
shape
=
static_cast
<
ShapeContainer
*>
(
groupChild
);
ShapeContainer
*
shape
=
static_cast
<
ShapeContainer
*>
(
groupChild
);
shape
->
Index
=
i
;
if
(
shape
)
drawing
.
container
->
Children
[
i
]
=
shape
;
{
shape
->
Index
=
i
;
if
(
shape
->
isBackground
())
{
m_pBackgroud
=
shape
;
}
}
}
}
}
}
}
}
...
@@ -112,7 +121,10 @@ namespace DocFileFormat
...
@@ -112,7 +121,10 @@ namespace DocFileFormat
for
(
std
::
list
<
OfficeArtWordDrawing
>::
iterator
iter
=
m_arrDrawings
.
begin
();
iter
!=
m_arrDrawings
.
end
();
++
iter
)
for
(
std
::
list
<
OfficeArtWordDrawing
>::
iterator
iter
=
m_arrDrawings
.
begin
();
iter
!=
m_arrDrawings
.
end
();
++
iter
)
RELEASEOBJECT
(
iter
->
container
);
RELEASEOBJECT
(
iter
->
container
);
}
}
inline
ShapeContainer
*
GetShapeBackgound
()
{
return
m_pBackgroud
;
}
inline
ShapeContainer
*
GetShapeContainer
(
int
spid
)
inline
ShapeContainer
*
GetShapeContainer
(
int
spid
)
{
{
ShapeContainer
*
ret
=
NULL
;
ShapeContainer
*
ret
=
NULL
;
...
@@ -138,7 +150,6 @@ namespace DocFileFormat
...
@@ -138,7 +150,6 @@ namespace DocFileFormat
if
(
shape
->
GetShapeID
()
==
spid
)
if
(
shape
->
GetShapeID
()
==
spid
)
{
{
ret
=
container
;
ret
=
container
;
break
;
break
;
}
}
}
}
...
@@ -150,7 +161,7 @@ namespace DocFileFormat
...
@@ -150,7 +161,7 @@ namespace DocFileFormat
if
(
shape
->
GetShapeID
()
==
spid
)
if
(
shape
->
GetShapeID
()
==
spid
)
{
{
ret
=
container
;
ret
=
container
;
break
;
break
;
}
}
}
}
...
@@ -174,7 +185,7 @@ namespace DocFileFormat
...
@@ -174,7 +185,7 @@ namespace DocFileFormat
}
}
private:
private:
ShapeContainer
*
m_pBackgroud
;
DrawingGroup
*
m_pDrawingGroupData
;
DrawingGroup
*
m_pDrawingGroupData
;
std
::
list
<
OfficeArtWordDrawing
>
m_arrDrawings
;
std
::
list
<
OfficeArtWordDrawing
>
m_arrDrawings
;
};
};
...
...
ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/DrawingRecord.h
View file @
635a5d23
...
@@ -39,11 +39,9 @@ namespace DocFileFormat
...
@@ -39,11 +39,9 @@ namespace DocFileFormat
{
{
public:
public:
static
const
unsigned
short
TYPE_CODE_0xF008
=
0xF008
;
static
const
unsigned
short
TYPE_CODE_0xF008
=
0xF008
;
/// The number of shapes in this drawing
unsigned
int
csp
;
// The number of shapes in this drawing
unsigned
int
csp
;
int
spidCur
;
// The last MSOSPID given to an SP in this DG
/// The last MSOSPID given to an SP in this DG
int
spidCur
;
DrawingRecord
()
:
DrawingRecord
()
:
Record
(),
csp
(
0
),
spidCur
(
0
)
Record
(),
csp
(
0
),
spidCur
(
0
)
...
@@ -53,8 +51,8 @@ namespace DocFileFormat
...
@@ -53,8 +51,8 @@ namespace DocFileFormat
DrawingRecord
(
IBinaryReader
*
_reader
,
unsigned
int
size
,
unsigned
int
typeCode
,
unsigned
int
version
,
unsigned
int
instance
)
:
DrawingRecord
(
IBinaryReader
*
_reader
,
unsigned
int
size
,
unsigned
int
typeCode
,
unsigned
int
version
,
unsigned
int
instance
)
:
Record
(
_reader
,
size
,
typeCode
,
version
,
instance
)
Record
(
_reader
,
size
,
typeCode
,
version
,
instance
)
{
{
this
->
csp
=
this
->
Reader
->
ReadUInt32
();
csp
=
Reader
->
ReadUInt32
();
this
->
spidCur
=
this
->
Reader
->
ReadInt32
();
spidCur
=
Reader
->
ReadInt32
();
}
}
virtual
~
DrawingRecord
()
virtual
~
DrawingRecord
()
...
...
ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/RecordFactory.cpp
View file @
635a5d23
...
@@ -93,29 +93,23 @@ namespace DocFileFormat
...
@@ -93,29 +93,23 @@ namespace DocFileFormat
{
{
case
ShapeContainer
:
:
TYPE_CODE_0xF004
:
case
ShapeContainer
:
:
TYPE_CODE_0xF004
:
return
new
ShapeContainer
();
return
new
ShapeContainer
();
break
;
case
Shape
:
:
TYPE_CODE_0xF00A
:
case
Shape
:
:
TYPE_CODE_0xF00A
:
return
new
Shape
();
return
new
Shape
();
break
;
case
ShapeOptions
:
:
TYPE_CODE_0xF00B
:
case
ShapeOptions
:
:
TYPE_CODE_0xF00B
:
case
ShapeOptions
:
:
TYPE_CODE_0xF121
:
case
ShapeOptions
:
:
TYPE_CODE_0xF121
:
case
ShapeOptions
:
:
TYPE_CODE_0xF122
:
case
ShapeOptions
:
:
TYPE_CODE_0xF122
:
return
new
ShapeOptions
();
return
new
ShapeOptions
();
break
;
case
ClientAnchor
:
:
TYPE_CODE_0xF010
:
case
ClientAnchor
:
:
TYPE_CODE_0xF010
:
return
new
ClientAnchor
();
return
new
ClientAnchor
();
break
;
case
ChildAnchor
:
:
TYPE_CODE_0xF00F
:
case
ChildAnchor
:
:
TYPE_CODE_0xF00F
:
return
new
ChildAnchor
();
return
new
ChildAnchor
();
break
;
case
BlipStoreEntry
:
:
TYPE_CODE_0xF007
:
case
BlipStoreEntry
:
:
TYPE_CODE_0xF007
:
return
new
BlipStoreEntry
();
return
new
BlipStoreEntry
();
break
;
case
BitmapBlip
:
:
TYPE_CODE_0xF01D
:
//OfficeArtBlipJPEG
case
BitmapBlip
:
:
TYPE_CODE_0xF01D
:
//OfficeArtBlipJPEG
case
BitmapBlip
:
:
TYPE_CODE_0xF01E
:
//OfficeArtBlipPNG
case
BitmapBlip
:
:
TYPE_CODE_0xF01E
:
//OfficeArtBlipPNG
...
@@ -125,25 +119,25 @@ namespace DocFileFormat
...
@@ -125,25 +119,25 @@ namespace DocFileFormat
case
BitmapBlip
:
:
TYPE_CODE_0xF029
:
//OfficeArtBlipTIFF
case
BitmapBlip
:
:
TYPE_CODE_0xF029
:
//OfficeArtBlipTIFF
case
BitmapBlip
:
:
TYPE_CODE_0xF02A
:
//OfficeArtBlipJPEG
case
BitmapBlip
:
:
TYPE_CODE_0xF02A
:
//OfficeArtBlipJPEG
return
new
BitmapBlip
();
return
new
BitmapBlip
();
break
;
case
MetafilePictBlip
:
:
TYPE_CODE_0xF01A
:
//OfficeArtBlipEMF
case
MetafilePictBlip
:
:
TYPE_CODE_0xF01A
:
//OfficeArtBlipEMF
case
MetafilePictBlip
:
:
TYPE_CODE_0xF01B
:
//OfficeArtBlipWMF
case
MetafilePictBlip
:
:
TYPE_CODE_0xF01B
:
//OfficeArtBlipWMF
case
MetafilePictBlip
:
:
TYPE_CODE_0xF01C
:
//OfficeArtBlipPICT
case
MetafilePictBlip
:
:
TYPE_CODE_0xF01C
:
//OfficeArtBlipPICT
return
new
MetafilePictBlip
();
break
;
return
new
MetafilePictBlip
();
case
DrawingGroup
:
:
TYPE_CODE_0xF000
:
return
new
DrawingGroup
();
break
;
case
DrawingGroup
:
:
TYPE_CODE_0xF000
:
return
new
DrawingGroup
();
case
DrawingGroupRecord
:
:
TYPE_CODE_0xF006
:
return
new
DrawingGroupRecord
();
break
;
case
DrawingGroupRecord
:
:
TYPE_CODE_0xF006
:
return
new
DrawingGroupRecord
();
case
BlipStoreContainer
:
:
TYPE_CODE_0xF001
:
return
new
BlipStoreContainer
();
break
;
case
BlipStoreContainer
:
:
TYPE_CODE_0xF001
:
return
new
BlipStoreContainer
();
case
SplitMenuColorContainer
:
:
TYPE_CODE_0xF11E
:
return
new
SplitMenuColorContainer
();
break
;
case
SplitMenuColorContainer
:
:
TYPE_CODE_0xF11E
:
return
new
SplitMenuColorContainer
();
case
ClientData
:
:
TYPE_CODE_0xF011
:
return
new
ClientData
();
break
;
case
ClientData
:
:
TYPE_CODE_0xF011
:
return
new
ClientData
();
case
DrawingContainer
:
:
TYPE_CODE_0xF002
:
return
new
DrawingContainer
();
break
;
case
DrawingContainer
:
:
TYPE_CODE_0xF002
:
return
new
DrawingContainer
();
case
DrawingRecord
:
:
TYPE_CODE_0xF008
:
return
new
DrawingRecord
();
break
;
case
DrawingRecord
:
:
TYPE_CODE_0xF008
:
return
new
DrawingRecord
();
case
GroupContainer
:
:
TYPE_CODE_0xF003
:
return
new
GroupContainer
();
break
;
case
GroupContainer
:
:
TYPE_CODE_0xF003
:
return
new
GroupContainer
();
case
GroupShapeRecord
:
:
TYPE_CODE_0xF009
:
return
new
GroupShapeRecord
();
break
;
case
GroupShapeRecord
:
:
TYPE_CODE_0xF009
:
return
new
GroupShapeRecord
();
case
OfficeArtClientTextbox
:
:
TYPE_CODE_0xF00D
:
return
new
OfficeArtClientTextbox
();
break
;
case
OfficeArtClientTextbox
:
:
TYPE_CODE_0xF00D
:
return
new
OfficeArtClientTextbox
();
default:
return
new
UnknownRecord
();
break
;
default:
return
new
UnknownRecord
();
}
}
}
}
}
}
ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/Shape.h
View file @
635a5d23
...
@@ -39,33 +39,20 @@ namespace DocFileFormat
...
@@ -39,33 +39,20 @@ namespace DocFileFormat
class
Shape
:
public
Record
class
Shape
:
public
Record
{
{
public:
public:
int
spid
;
int
spid
;
/// This shape is a group shape
bool
fGroup
;
bool
fGroup
;
bool
fChild
;
/// Not a top-level shape
bool
fPatriarch
;
// This is the topmost group shape. Exactly one of these per drawing.
bool
fChild
;
bool
fDeleted
;
// The shape has been deleted
/// This is the topmost group shape.
bool
fOleShape
;
// The shape is an OLE object
/// Exactly one of these per drawing.
bool
fHaveMaster
;
bool
fPatriarch
;
bool
fFlipH
;
/// The shape has been deleted
bool
fFlipV
;
bool
fDeleted
;
bool
fConnector
;
/// The shape is an OLE object
bool
fHaveAnchor
;
bool
fOleShape
;
bool
fBackground
;
/// Shape has a hspMaster property
bool
fHaveSpt
;
bool
fHaveMaster
;
/// Shape is flipped horizontally
bool
fFlipH
;
/// Shape is flipped vertically
bool
fFlipV
;
/// Connector type of shape
bool
fConnector
;
/// Shape has an anchor of some kind
bool
fHaveAnchor
;
/// Background shape
bool
fBackground
;
/// Shape has a shape type property
bool
fHaveSpt
;
/// The shape type of the shape
ShapeType
*
shapeType
;
ShapeType
*
shapeType
;
public:
public:
...
...
ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/ShapeContainer.h
View file @
635a5d23
...
@@ -69,7 +69,20 @@ namespace DocFileFormat
...
@@ -69,7 +69,20 @@ namespace DocFileFormat
}
}
return
0
;
return
0
;
}
}
bool
isBackground
()
{
int
ret
=
0
;
for
(
std
::
vector
<
Record
*>::
const_iterator
iter
=
this
->
Children
.
begin
();
iter
!=
this
->
Children
.
end
();
iter
++
)
{
Shape
*
sh
=
dynamic_cast
<
Shape
*>
(
*
iter
);
if
(
sh
)
{
return
sh
->
fBackground
;
}
}
return
false
;
}
virtual
~
ShapeContainer
()
virtual
~
ShapeContainer
()
{
{
}
}
...
@@ -79,7 +92,6 @@ namespace DocFileFormat
...
@@ -79,7 +92,6 @@ namespace DocFileFormat
return
new
ShapeContainer
(
_reader
,
bodySize
,
typeCode
,
version
,
instance
);
return
new
ShapeContainer
(
_reader
,
bodySize
,
typeCode
,
version
,
instance
);
}
}
/// Searches all OptionEntry in the ShapeContainer and puts them into a list.
std
::
list
<
OptionEntry
>
ExtractOptions
()
const
std
::
list
<
OptionEntry
>
ExtractOptions
()
const
{
{
std
::
list
<
OptionEntry
>
ret
;
std
::
list
<
OptionEntry
>
ret
;
...
...
ASCOfficeDocFile/DocDocxConverter/SectionPropertiesMapping.cpp
View file @
635a5d23
...
@@ -476,6 +476,7 @@ namespace DocFileFormat
...
@@ -476,6 +476,7 @@ namespace DocFileFormat
default:
default:
{
{
int
sz
=
iter
->
argumentsSize
;
}
break
;
}
break
;
}
}
}
}
...
...
ASCOfficeDocFile/DocDocxConverter/SettingsMapping.cpp
View file @
635a5d23
This diff is collapsed.
Click to expand it.
ASCOfficeDocFile/DocDocxConverter/ShadingDescriptor.h
View file @
635a5d23
...
@@ -112,23 +112,14 @@ namespace DocFileFormat
...
@@ -112,23 +112,14 @@ namespace DocFileFormat
friend
class
PropertiesMapping
;
friend
class
PropertiesMapping
;
private:
private:
/// 24-bit foreground color
unsigned
int
cvFore
;
// 24-bit foreground color
unsigned
int
cvFore
;
bool
cvForeAuto
;
bool
cvForeAuto
;
int
icoFore
;
// Foreground color.
/// Foreground color.
unsigned
int
cvBack
;
/// Only used if cvFore is not set
bool
cvBackAuto
;
int
icoFore
;
int
icoBack
;
/// 24-bit background color
ShadingPattern
ipat
;
unsigned
int
cvBack
;
ShadingType
shadingType
;
bool
cvBackAuto
;
/// Background color.
/// Only used if cvBack is not set.
int
icoBack
;
/// Shading pattern
ShadingPattern
ipat
;
/// Shading type
ShadingType
shadingType
;
/// Shading special vale
ShadingSpecialValue
shadingSpecialValue
;
ShadingSpecialValue
shadingSpecialValue
;
public:
public:
...
@@ -236,7 +227,7 @@ namespace DocFileFormat
...
@@ -236,7 +227,7 @@ namespace DocFileFormat
else
if
(
0x0F
==
icoBack
)
{
cvBack
=
RGB2
(
0x80
,
0x80
,
0x80
);
}
else
if
(
0x0F
==
icoBack
)
{
cvBack
=
RGB2
(
0x80
,
0x80
,
0x80
);
}
else
if
(
0x10
==
icoBack
)
{
cvBack
=
RGB2
(
0xC0
,
0xC0
,
0xC0
);
}
else
if
(
0x10
==
icoBack
)
{
cvBack
=
RGB2
(
0xC0
,
0xC0
,
0xC0
);
}
//
TODO :
если будут документы с такими цветовыми палитрами
//
....
если будут документы с такими цветовыми палитрами
//if ((cvFore == 0) && (icoFore == 0x0) && (cvBack == 0) && (icoBack == 0x0) && (ipat == Automatic))
//if ((cvFore == 0) && (icoFore == 0x0) && (cvBack == 0) && (icoBack == 0x0) && (ipat == Automatic))
//{
//{
...
@@ -250,7 +241,6 @@ namespace DocFileFormat
...
@@ -250,7 +241,6 @@ namespace DocFileFormat
}
}
else
else
{
{
//throw new ByteParseException("Cannot parse the struct SHD, the length of the struct doesn't match");
}
}
}
}
}
}
...
...
ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp
View file @
635a5d23
This diff is collapsed.
Click to expand it.
ASCOfficeDocFile/DocFormatTest/DocFormatTest.cpp
View file @
635a5d23
...
@@ -50,8 +50,10 @@
...
@@ -50,8 +50,10 @@
int
_tmain
(
int
argc
,
_TCHAR
*
argv
[])
int
_tmain
(
int
argc
,
_TCHAR
*
argv
[])
{
{
if
(
argc
<
2
)
return
1
;
std
::
wstring
sSrcDoc
=
argv
[
1
];
std
::
wstring
sSrcDoc
=
argv
[
1
];
std
::
wstring
sDstDocx
=
argv
[
2
]
;
std
::
wstring
sDstDocx
=
argc
>
2
?
argv
[
2
]
:
sSrcDoc
+
L"-my.docx"
;
std
::
wstring
outputDir
=
FileSystem
::
Directory
::
GetFolderPath
(
sDstDocx
);
std
::
wstring
outputDir
=
FileSystem
::
Directory
::
GetFolderPath
(
sDstDocx
);
std
::
wstring
dstTempPath
=
FileSystem
::
Directory
::
CreateDirectoryWithUniqueName
(
outputDir
);
std
::
wstring
dstTempPath
=
FileSystem
::
Directory
::
CreateDirectoryWithUniqueName
(
outputDir
);
...
...
ASCOfficeOdfFile/Test/ASCOfficeOdfFileTest/ASCOfficeOdfFileTest.cpp
View file @
635a5d23
...
@@ -37,12 +37,21 @@
...
@@ -37,12 +37,21 @@
#include "../../src/ConvertOO2OOX.h"
#include "../../src/ConvertOO2OOX.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
int
_tmain
(
int
argc
,
_TCHAR
*
argv
[])
int
_tmain
(
int
argc
,
_TCHAR
*
argv
[])
{
{
if
(
argc
<
2
)
return
1
;
HRESULT
hr
=
S_OK
;
HRESULT
hr
=
S_OK
;
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
std
::
wstring
srcFileName
=
argv
[
1
];
std
::
wstring
srcFileName
=
argv
[
1
];
std
::
wstring
dstPath
=
argv
[
2
];
std
::
wstring
dstPath
=
argc
>
2
?
argv
[
2
]
:
sSrcDoc
+
L"-my.docx"
;
//xlsx pptx
std
::
wstring
outputDir
=
FileSystem
::
Directory
::
GetFolderPath
(
dstPath
);
std
::
wstring
outputDir
=
FileSystem
::
Directory
::
GetFolderPath
(
dstPath
);
std
::
wstring
srcTempPath
=
FileSystem
::
Directory
::
CreateDirectoryWithUniqueName
(
outputDir
);
std
::
wstring
srcTempPath
=
FileSystem
::
Directory
::
CreateDirectoryWithUniqueName
(
outputDir
);
...
...
ASCOfficeOdfFile/Test/ASCOfficeOdfFileTest/ASCOfficeOdfFileTest.vcproj
View file @
635a5d23
...
@@ -345,10 +345,6 @@
...
@@ -345,10 +345,6 @@
/>
/>
</FileConfiguration>
</FileConfiguration>
</File>
</File>
<File
RelativePath=
"..\..\..\Common\3dParty\icu\win_32\lib\icuuc.lib"
>
</File>
<File
<File
RelativePath=
"..\..\..\Common\3dParty\pole\pole.cpp"
RelativePath=
"..\..\..\Common\3dParty\pole\pole.cpp"
>
>
...
...
ASCOfficePPTFile/Win32/PptFormatTest/PptFormatTest.cpp
View file @
635a5d23
...
@@ -38,10 +38,10 @@
...
@@ -38,10 +38,10 @@
int
_tmain
(
int
argc
,
_TCHAR
*
argv
[])
int
_tmain
(
int
argc
,
_TCHAR
*
argv
[])
{
{
if
(
argc
<
3
)
return
3
;
if
(
argc
<
2
)
return
1
;
std
::
wstring
sSrcPpt
=
argv
[
1
];
std
::
wstring
sSrcPpt
=
argv
[
1
];
std
::
wstring
sDstPptx
=
arg
v
[
2
]
;
std
::
wstring
sDstPptx
=
arg
c
>
2
?
argv
[
2
]
:
sSrcDoc
+
L"-my.pptx"
;
std
::
wstring
outputDir
=
FileSystem
::
Directory
::
GetFolderPath
(
sDstPptx
);
std
::
wstring
outputDir
=
FileSystem
::
Directory
::
GetFolderPath
(
sDstPptx
);
std
::
wstring
dstTempPath
=
FileSystem
::
Directory
::
CreateDirectoryWithUniqueName
(
outputDir
);
std
::
wstring
dstTempPath
=
FileSystem
::
Directory
::
CreateDirectoryWithUniqueName
(
outputDir
);
...
...
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