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
964f057a
Commit
964f057a
authored
Sep 19, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DocFormatReader - fix wrong FIB.version - users-02.doc
parent
d9979d12
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
75 additions
and
61 deletions
+75
-61
ASCOfficeDocFile/DocDocxConverter/AnnotationReferenceDescriptor.h
...eDocFile/DocDocxConverter/AnnotationReferenceDescriptor.h
+1
-1
ASCOfficeDocFile/DocDocxConverter/BookmarkFirst.h
ASCOfficeDocFile/DocDocxConverter/BookmarkFirst.h
+1
-1
ASCOfficeDocFile/DocDocxConverter/ByteStructure.h
ASCOfficeDocFile/DocDocxConverter/ByteStructure.h
+1
-1
ASCOfficeDocFile/DocDocxConverter/EndnoteDescriptor.h
ASCOfficeDocFile/DocDocxConverter/EndnoteDescriptor.h
+1
-1
ASCOfficeDocFile/DocDocxConverter/FileInformationBlock.h
ASCOfficeDocFile/DocDocxConverter/FileInformationBlock.h
+5
-5
ASCOfficeDocFile/DocDocxConverter/FontFamilyName.h
ASCOfficeDocFile/DocDocxConverter/FontFamilyName.h
+1
-1
ASCOfficeDocFile/DocDocxConverter/FootnoteDescriptor.h
ASCOfficeDocFile/DocDocxConverter/FootnoteDescriptor.h
+1
-1
ASCOfficeDocFile/DocDocxConverter/ListData.cpp
ASCOfficeDocFile/DocDocxConverter/ListData.cpp
+5
-8
ASCOfficeDocFile/DocDocxConverter/ListData.h
ASCOfficeDocFile/DocDocxConverter/ListData.h
+3
-3
ASCOfficeDocFile/DocDocxConverter/ListLevel.cpp
ASCOfficeDocFile/DocDocxConverter/ListLevel.cpp
+44
-31
ASCOfficeDocFile/DocDocxConverter/ListLevel.h
ASCOfficeDocFile/DocDocxConverter/ListLevel.h
+5
-2
ASCOfficeDocFile/DocDocxConverter/Plex.h
ASCOfficeDocFile/DocDocxConverter/Plex.h
+2
-1
ASCOfficeDocFile/DocDocxConverter/Spa.h
ASCOfficeDocFile/DocDocxConverter/Spa.h
+1
-1
ASCOfficeDocFile/DocDocxConverter/WideString.h
ASCOfficeDocFile/DocDocxConverter/WideString.h
+1
-1
ASCOfficeDocFile/DocDocxConverter/WordDocument.cpp
ASCOfficeDocFile/DocDocxConverter/WordDocument.cpp
+2
-2
X2tConverter/build/Qt/X2tConverter.pro
X2tConverter/build/Qt/X2tConverter.pro
+1
-1
No files found.
ASCOfficeDocFile/DocDocxConverter/AnnotationReferenceDescriptor.h
View file @
964f057a
...
...
@@ -69,7 +69,7 @@ namespace DocFileFormat
{
}
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
);
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
);
private:
...
...
ASCOfficeDocFile/DocDocxConverter/BookmarkFirst.h
View file @
964f057a
...
...
@@ -68,7 +68,7 @@ namespace DocFileFormat
{
}
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
)
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
)
{
BookmarkFirst
*
newObject
=
new
BookmarkFirst
();
...
...
ASCOfficeDocFile/DocDocxConverter/ByteStructure.h
View file @
964f057a
...
...
@@ -54,7 +54,7 @@ namespace DocFileFormat
virtual
~
EmptyStructure
()
{}
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
)
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
)
{
EmptyStructure
*
newObject
=
new
EmptyStructure
();
...
...
ASCOfficeDocFile/DocDocxConverter/EndnoteDescriptor.h
View file @
964f057a
...
...
@@ -61,4 +61,4 @@ namespace DocFileFormat
return
static_cast
<
ByteStructure
*>
(
newObject
);
}
};
}
\ No newline at end of file
}
ASCOfficeDocFile/DocDocxConverter/FileInformationBlock.h
View file @
964f057a
...
...
@@ -529,7 +529,7 @@ namespace DocFileFormat
void
reset
(
VirtualStreamReader
reader
)
{
if
(
m_FibBase
.
nFib
>
0
&&
m_FibBase
.
nFib
<
Fib1997
)
if
(
m_FibBase
.
nFib
>
0
&&
m_FibBase
.
nFib
<=
Fib1995
)
{
m_RgLw97
.
cbMac
=
reader
.
ReadInt32
();
//32
/*m_FibWord97.fcSpare0 = */
reader
.
ReadInt32
();
...
...
@@ -539,8 +539,8 @@ namespace DocFileFormat
m_RgLw97
.
ccpText
=
reader
.
ReadInt32
();
m_RgLw97
.
ccpFtn
=
reader
.
ReadInt32
();
m_RgLw97
.
ccpHdr
=
reader
.
ReadInt32
();
/*m_FibWord97.ccpMcr = */
reader
.
ReadInt32
();
/*m_FibWord97.ccpMcr = */
reader
.
ReadInt32
();
m_RgLw97
.
ccpAtn
=
reader
.
ReadInt32
();
m_RgLw97
.
ccpEdn
=
reader
.
ReadInt32
();
m_RgLw97
.
ccpTxbx
=
reader
.
ReadInt32
();
...
...
@@ -743,7 +743,7 @@ namespace DocFileFormat
m_FibWord97
.
fcSttbFnm
=
reader
.
ReadInt32
();
m_FibWord97
.
lcbSttbFnm
=
reader
.
ReadInt32
();
//676
}
if
(
m_FibBase
.
nFib
>=
Fib1997
||
m_FibBase
.
nFib
==
0
)
if
(
m_FibBase
.
nFib
>
Fib1995
||
m_FibBase
.
nFib
==
0
)
{
reader
.
ReadBytes
(
8
,
false
);
//68
...
...
@@ -1218,7 +1218,7 @@ namespace DocFileFormat
if
(
m_FibBase
.
nFib
>
Fib1995
)
csw
=
reader
.
ReadUInt16
();
//32
if
(
m_FibBase
.
nFib
>=
Fib1997
||
m_FibBase
.
nFib
==
0
)
if
(
m_FibBase
.
nFib
>
Fib1995
||
m_FibBase
.
nFib
==
0
)
{
//read the RgW97
...
...
ASCOfficeDocFile/DocDocxConverter/FontFamilyName.h
View file @
964f057a
...
...
@@ -79,7 +79,7 @@ namespace DocFileFormat
public:
FontFamilyName
();
virtual
~
FontFamilyName
();
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
);
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
);
private:
long
searchTerminationZero
(
VirtualStreamReader
*
reader
);
...
...
ASCOfficeDocFile/DocDocxConverter/FootnoteDescriptor.h
View file @
964f057a
...
...
@@ -61,4 +61,4 @@ namespace DocFileFormat
return
static_cast
<
ByteStructure
*>
(
newObject
);
}
};
}
\ No newline at end of file
}
ASCOfficeDocFile/DocDocxConverter/ListData.cpp
View file @
964f057a
...
...
@@ -148,11 +148,7 @@ namespace DocFileFormat
}
OutlineListDescriptor
::~
OutlineListDescriptor
()
{
for
(
int
i
=
0
;
i
<
9
;
i
++
)
{
if
(
lvl
[
i
])
delete
lvl
[
i
];
lvl
[
i
]
=
NULL
;
}
}
OutlineListDescriptor
::
OutlineListDescriptor
(
unsigned
char
*
data
,
int
length
)
{
...
...
@@ -160,10 +156,11 @@ namespace DocFileFormat
for
(
int
i
=
0
;
i
<
9
;
i
++
)
{
lvl
[
i
]
=
new
NumberingLevelDescriptor
(
data
+
pos
,
length
-
pos
);
lvl
[
i
].
Parse
(
data
+
pos
,
length
-
pos
);
pos
+=
16
;
}
fRestartHdr
=
FormatUtils
::
BytesToUChar
(
data
,
pos
,
length
);
pos
+=
2
;
fRestartHdr
=
FormatUtils
::
BytesToUChar
(
data
,
pos
,
length
);
pos
+=
2
;
fSpareOlst2
=
FormatUtils
::
BytesToUChar
(
data
,
pos
,
length
);
pos
+=
2
;
fSpareOlst3
=
FormatUtils
::
BytesToUChar
(
data
,
pos
,
length
);
pos
+=
2
;
fSpareOlst4
=
FormatUtils
::
BytesToUChar
(
data
,
pos
,
length
);
pos
+=
2
;
...
...
@@ -189,7 +186,7 @@ namespace DocFileFormat
delete
[]
data
;
return
static_cast
<
ByteStructure
*>
(
newObject
);
return
static_cast
<
ByteStructure
*>
(
newObject
);
}
}
ASCOfficeDocFile/DocDocxConverter/ListData.h
View file @
964f057a
...
...
@@ -134,7 +134,7 @@ namespace DocFileFormat
private:
NumberingLevelDescriptor
*
lvl
[
9
];
NumberingLevelDescriptor
lvl
[
9
];
unsigned
char
fRestartHdr
;
unsigned
char
fSpareOlst2
;
...
...
@@ -145,11 +145,11 @@ namespace DocFileFormat
public:
static
const
int
STRUCTURE_SIZE
=
212
;
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
);
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
);
virtual
~
OutlineListDescriptor
();
// Parses the given StreamReader to retrieve a OLST struct
OutlineListDescriptor
(
unsigned
char
*
data
,
int
length
);
//cbOLST(count of bytes of OLST) is 212
OutlineListDescriptor
()
{}
};
}
\ No newline at end of file
}
ASCOfficeDocFile/DocDocxConverter/ListLevel.cpp
View file @
964f057a
...
...
@@ -97,52 +97,65 @@ namespace DocFileFormat
RELEASEARRAYOBJECTS
(
bytes
);
}
}
NumberingLevelDescriptor
::
NumberingLevelDescriptor
()
{
//default set
bEnabled
=
false
;
}
NumberingLevelDescriptor
::~
NumberingLevelDescriptor
()
{
}
NumberingLevelDescriptor
::
NumberingLevelDescriptor
(
unsigned
char
*
data
,
int
length
)
NumberingLevelDescriptor
::
NumberingLevelDescriptor
(
unsigned
char
*
data
,
int
length
)
{
nfc
=
FormatUtils
::
BytesToUChar
(
data
,
0
,
length
);
cbTextBefore
=
FormatUtils
::
BytesToUChar
(
data
,
1
,
length
);
cbTextAfter
=
FormatUtils
::
BytesToUChar
(
data
,
2
,
length
);
bEnabled
=
false
;
int
flag
=
FormatUtils
::
BytesToUChar
(
data
,
3
,
length
);
Parse
(
data
,
length
);
}
jc
=
(
unsigned
char
)(
flag
&
0x03
);
void
NumberingLevelDescriptor
::
Parse
(
unsigned
char
*
data
,
int
length
)
{
bEnabled
=
true
;
fPrev
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x04
);
fHang
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x08
);
nfc
=
FormatUtils
::
BytesToUChar
(
data
,
0
,
length
);
cbTextBefore
=
FormatUtils
::
BytesToUChar
(
data
,
1
,
length
);
cbTextAfter
=
FormatUtils
::
BytesToUChar
(
data
,
2
,
length
);
fSetBold
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x10
);
fSetItalic
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x20
);
fSetSmallCaps
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x40
);
fSetCaps
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x80
);
int
flag
=
FormatUtils
::
BytesToUChar
(
data
,
3
,
length
);
flag
=
FormatUtils
::
BytesToUChar
(
data
,
4
,
length
);
;
jc
=
(
unsigned
char
)(
flag
&
0x03
)
;
fSetStrike
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x01
);
fSetKul
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x02
);
fPrev
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x04
);
fHang
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x08
);
fPrevSpace
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x04
);
fBold
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x08
);
fItalic
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x10
);
fSmallCaps
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x20
);
fCaps
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x40
);
fStrike
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x80
);
fSetBold
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x10
);
fSetItalic
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x20
);
fSetSmallCaps
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x40
);
fSetCaps
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x80
);
flag
=
FormatUtils
::
BytesToUChar
(
data
,
5
,
length
)
;
flag
=
FormatUtils
::
BytesToUChar
(
data
,
4
,
length
);
;
kul
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x07
);
//3 bit
ico
=
FormatUtils
::
BitmaskToBool
(
flag
,
0xf1
);
//5 bit
fSetStrike
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x01
);
fSetKul
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x02
);
ftc
=
FormatUtils
::
BytesToInt16
(
data
,
6
,
length
);
hps
=
FormatUtils
::
BytesToUInt16
(
data
,
8
,
length
);
fPrevSpace
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x04
);
fBold
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x08
);
fItalic
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x10
);
fSmallCaps
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x20
);
fCaps
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x40
);
fStrike
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x80
);
iStartAt
=
FormatUtils
::
BytesToUInt16
(
data
,
10
,
length
);
dxaIndent
=
FormatUtils
::
BytesToUInt16
(
data
,
12
,
length
);
dxaSpace
=
FormatUtils
::
BytesToUInt16
(
data
,
14
,
length
);
}
flag
=
FormatUtils
::
BytesToUChar
(
data
,
5
,
length
);
kul
=
FormatUtils
::
BitmaskToBool
(
flag
,
0x07
);
//3 bit
ico
=
FormatUtils
::
BitmaskToBool
(
flag
,
0xf1
);
//5 bit
ftc
=
FormatUtils
::
BytesToInt16
(
data
,
6
,
length
);
hps
=
FormatUtils
::
BytesToUInt16
(
data
,
8
,
length
);
iStartAt
=
FormatUtils
::
BytesToUInt16
(
data
,
10
,
length
);
dxaIndent
=
FormatUtils
::
BytesToUInt16
(
data
,
12
,
length
);
dxaSpace
=
FormatUtils
::
BytesToUInt16
(
data
,
14
,
length
);
}
}
ASCOfficeDocFile/DocDocxConverter/ListLevel.h
View file @
964f057a
...
...
@@ -141,8 +141,11 @@ namespace DocFileFormat
unsigned
short
dxaIndent
;
unsigned
short
dxaSpace
;
public:
bool
bEnabled
;
virtual
~
NumberingLevelDescriptor
();
// Parses the given StreamReader to retrieve a ANLV struct
NumberingLevelDescriptor
(
unsigned
char
*
data
,
int
length
);
//cbANLV is 16 bytes
};
NumberingLevelDescriptor
();
NumberingLevelDescriptor
(
unsigned
char
*
data
,
int
length
);
//cbANLV is 16 bytes
void
Parse
(
unsigned
char
*
data
,
int
length
);
};
}
ASCOfficeDocFile/DocDocxConverter/Plex.h
View file @
964f057a
...
...
@@ -86,7 +86,8 @@ namespace DocFileFormat
{
for
(
int
i
=
0
;
i
<
n
;
++
i
)
{
Elements
.
push_back
(
T
().
ConstructObject
(
&
reader
,
structureLength
));
T
object
;
Elements
.
push_back
(
object
.
ConstructObject
(
&
reader
,
structureLength
));
}
}
...
...
ASCOfficeDocFile/DocDocxConverter/Spa.h
View file @
964f057a
...
...
@@ -63,7 +63,7 @@ namespace DocFileFormat
virtual
~
Spa
();
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
);
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
);
inline
int
GetShapeID
()
const
{
return
spid
;
...
...
ASCOfficeDocFile/DocDocxConverter/WideString.h
View file @
964f057a
...
...
@@ -51,7 +51,7 @@ namespace DocFileFormat
{
}
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
)
virtual
ByteStructure
*
ConstructObject
(
VirtualStreamReader
*
reader
,
int
length
)
{
WideString
*
newObject
=
new
WideString
();
...
...
ASCOfficeDocFile/DocDocxConverter/WordDocument.cpp
View file @
964f057a
...
...
@@ -104,14 +104,14 @@ namespace DocFileFormat
if
(
FIB
->
m_FibBase
.
nFib
)
{
if
(
FIB
->
m_FibBase
.
nFib
<
Fib1997
)
if
(
FIB
->
m_FibBase
.
nFib
<=
Fib1995
)
{
bOlderVersion
=
FIB
->
m_bOlderVersion
=
true
;
}
}
else
{
if
(
FIB
->
m_FibNew
.
nFibNew
<
Fib1997
&&
FIB
->
m_FibNew
.
nFibNew
>
0
)
if
(
FIB
->
m_FibNew
.
nFibNew
<=
Fib1995
&&
FIB
->
m_FibNew
.
nFibNew
>
0
)
{
bOlderVersion
=
FIB
->
m_bOlderVersion
=
true
;
}
...
...
X2tConverter/build/Qt/X2tConverter.pro
View file @
964f057a
...
...
@@ -7,7 +7,7 @@
QT
-=
core
QT
-=
gui
VERSION
=
2.0
.
2.39
0
VERSION
=
2.0
.
2.39
1
DEFINES
+=
INTVER
=
$$
VERSION
TEMPLATE
=
app
...
...
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