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
3e93d9aa
Commit
3e93d9aa
authored
Mar 27, 2016
by
ElenaSubbotina
Committed by
Alexander Trofimov
May 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XlsFormat - формулы формата 5.0 и ниже
parent
87652986
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
136 additions
and
44 deletions
+136
-44
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Formula.cpp
...eXlsFile2/source/XlsFormat/Logic/Biff_records/Formula.cpp
+6
-6
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellParsedFormula.cpp
...rce/XlsFormat/Logic/Biff_structures/CellParsedFormula.cpp
+5
-5
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellRef.h
...XlsFile2/source/XlsFormat/Logic/Biff_structures/CellRef.h
+1
-4
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgArea.cpp
...sFile2/source/XlsFormat/Logic/Biff_structures/PtgArea.cpp
+21
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgArea3d.cpp
...ile2/source/XlsFormat/Logic/Biff_structures/PtgArea3d.cpp
+18
-9
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgArea3d.h
...sFile2/source/XlsFormat/Logic/Biff_structures/PtgArea3d.h
+0
-4
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgAreaN.cpp
...File2/source/XlsFormat/Logic/Biff_structures/PtgAreaN.cpp
+21
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgName.cpp
...sFile2/source/XlsFormat/Logic/Biff_structures/PtgName.cpp
+9
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgName.h
...XlsFile2/source/XlsFormat/Logic/Biff_structures/PtgName.h
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgNameX.cpp
...File2/source/XlsFormat/Logic/Biff_structures/PtgNameX.cpp
+14
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgRef.cpp
...lsFile2/source/XlsFormat/Logic/Biff_structures/PtgRef.cpp
+14
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgRef3d.cpp
...File2/source/XlsFormat/Logic/Biff_structures/PtgRef3d.cpp
+12
-8
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgRef3d.h
...lsFile2/source/XlsFormat/Logic/Biff_structures/PtgRef3d.h
+0
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgRefN.cpp
...sFile2/source/XlsFormat/Logic/Biff_structures/PtgRefN.cpp
+14
-1
No files found.
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Formula.cpp
View file @
3e93d9aa
...
...
@@ -50,12 +50,12 @@ void Formula::readFields(CFRecord& record)
fShrFmla
=
GETBIT
(
flags
,
3
);
fClearErrors
=
GETBIT
(
flags
,
5
);
if
(
record
.
getGlobalWorkbookInfo
()
->
Version
<
0x0600
)
{
//
_UINT16 chn = 0;
//
record >> chn;
}
else
//
if (record.getGlobalWorkbookInfo()->Version < 0x0600)
//
{
//
_UINT16 chn = 0;
//
record >> chn;
//
}
//
else
{
_UINT32
chn
=
0
;
record
>>
chn
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellParsedFormula.cpp
View file @
3e93d9aa
...
...
@@ -33,11 +33,11 @@ void CellParsedFormula::load(CFRecord& record)
unsigned
short
cce
;
record
>>
cce
;
if
(
record
.
getGlobalWorkbookInfo
()
->
Version
<
0x0600
)
{
record
.
skipNunBytes
(
record
.
getDataSize
()
-
record
.
getRdPtr
());
}
else
//
if (record.getGlobalWorkbookInfo()->Version < 0x0600)
//
{
//
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
//
}
//
else
{
rgce
.
load
(
record
,
cce
);
rgcb
.
load
(
record
,
rgce
.
getPtgs
(),
is_part_of_a_revision_
);
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellRef.h
View file @
3e93d9aa
...
...
@@ -25,23 +25,20 @@ public:
void
operator
+=
(
const
CellRef
&
appended_ref
);
void
operator
-=
(
const
CellRef
&
subtracted_ref
);
private:
virtual
void
load
(
CFRecord
&
record
)
{}
virtual
void
store
(
CFRecord
&
record
)
{}
public:
const
int
getRow
()
const
;
const
int
getColumn
()
const
;
const
bool
getRowRelative
()
const
;
const
bool
getColumnRelative
()
const
;
protected:
int
row
;
int
column
;
bool
rowRelative
;
bool
colRelative
;
protected:
bool
fQuoted
;
mutable
std
::
wstring
to_string_cache
;
};
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgArea.cpp
View file @
3e93d9aa
...
...
@@ -34,7 +34,27 @@ void PtgArea::storeFields(CFRecord& record)
void
PtgArea
::
loadFields
(
CFRecord
&
record
)
{
record
>>
area
;
if
(
record
.
getGlobalWorkbookInfo
()
->
Version
<
0x600
)
{
unsigned
char
colFirst
,
colLast
;
_UINT16
rwFirst
,
rwLast
;
record
>>
rwFirst
>>
rwLast
>>
colFirst
>>
colLast
;
area
.
rowFirstRelative
=
rwFirst
&
0x8000
;
area
.
columnLastRelative
=
rwFirst
&
0x4000
;
area
.
columnFirst
=
colFirst
;
area
.
rowFirst
=
rwFirst
&
0x3FFF
;
area
.
rowLastRelative
=
rwLast
&
0x8000
;
area
.
columnLastRelative
=
rwLast
&
0x4000
;
area
.
columnLast
=
colLast
;
area
.
rowLast
=
rwLast
&
0x3FFF
;
}
else
record
>>
area
;
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgArea3d.cpp
View file @
3e93d9aa
...
...
@@ -43,9 +43,25 @@ void PtgArea3d::loadFields(CFRecord& record)
if
(
global_info
->
Version
<
0x0600
)
{
unsigned
short
rwFirst
,
rwLast
;
unsigned
char
colFirst
,
colLast
;
record
>>
ixals
;
record
.
skipNunBytes
(
8
);
record
>>
itabFirst
>>
itabLast
>>
grbitRwFirst
>>
grbitRwLast
>>
colFirst
>>
colLast
;
record
>>
itabFirst
>>
itabLast
>>
rwFirst
>>
rwLast
>>
colFirst
>>
colLast
;
area
.
rowFirstRelative
=
rwFirst
&
0x8000
;
area
.
columnLastRelative
=
rwFirst
&
0x4000
;
area
.
columnFirst
=
colFirst
;
area
.
rowFirst
=
rwFirst
&
0x3FFF
;
area
.
rowLastRelative
=
rwLast
&
0x8000
;
area
.
columnLastRelative
=
rwLast
&
0x4000
;
area
.
columnLast
=
colLast
;
area
.
rowLast
=
rwLast
&
0x3FFF
;
}
else
{
...
...
@@ -67,16 +83,10 @@ void PtgArea3d::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool f
extra_data
.
pop
();
return
;
}
std
::
wstring
range_ref
=
area
.
toString
();
if
(
global_info
->
Version
<
0x0600
)
{
CellRef
cell1
(
grbitRwFirst
,
colFirst
,
false
,
false
);
CellRef
cell2
(
grbitRwLast
,
colLast
,
false
,
false
);
CellRangeRef
range
(
cell1
,
cell2
);
std
::
wstring
range_ref
=
range
.
toString
();
if
(
ixals
==
0xffff
)
{
std
::
wstring
prefix
=
XMLSTUFF
::
xti_indexes2sheet_name
(
itabFirst
,
itabLast
,
global_info
->
sheets_names
);
...
...
@@ -91,7 +101,6 @@ void PtgArea3d::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool f
}
else
{
std
::
wstring
range_ref
=
area
.
toString
();
ptg_stack
.
push
(
XMLSTUFF
::
make3dRef
(
ixti
,
range_ref
,
global_info
->
xti_parsed
,
full_ref
));
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgArea3d.h
View file @
3e93d9aa
...
...
@@ -34,10 +34,6 @@ public:
unsigned
short
ixals
;
unsigned
short
itabFirst
;
unsigned
short
itabLast
;
unsigned
short
grbitRwFirst
;
unsigned
short
grbitRwLast
;
unsigned
char
colFirst
;
unsigned
char
colLast
;
};
}
// namespace XLS
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgAreaN.cpp
View file @
3e93d9aa
...
...
@@ -35,7 +35,27 @@ void PtgAreaN::storeFields(CFRecord& record)
void
PtgAreaN
::
loadFields
(
CFRecord
&
record
)
{
record
>>
area
;
if
(
record
.
getGlobalWorkbookInfo
()
->
Version
<
0x600
)
{
unsigned
char
colFirst
,
colLast
;
_UINT16
rwFirst
,
rwLast
;
record
>>
rwFirst
>>
rwLast
>>
colFirst
>>
colLast
;
area
.
rowFirstRelative
=
rwFirst
&
0x8000
;
area
.
columnFirstRelative
=
rwFirst
&
0x4000
;
area
.
columnFirst
=
colFirst
;
area
.
rowFirst
=
rwFirst
&
0x3FFF
;
area
.
rowLastRelative
=
rwLast
&
0x8000
;
area
.
columnLastRelative
=
rwLast
&
0x4000
;
area
.
columnLast
=
colLast
;
area
.
rowLast
=
rwLast
&
0x3FFF
;
}
else
record
>>
area
;
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgName.cpp
View file @
3e93d9aa
...
...
@@ -35,6 +35,15 @@ void PtgName::loadFields(CFRecord& record)
{
record
>>
nameindex
;
if
(
record
.
getGlobalWorkbookInfo
()
->
Version
<
0x0600
)
{
record
.
skipNunBytes
(
12
);
}
else
{
record
.
skipNunBytes
(
2
);
}
global_info
=
record
.
getGlobalWorkbookInfo
();
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgName.h
View file @
3e93d9aa
...
...
@@ -24,7 +24,7 @@ public:
static
const
unsigned
short
fixed_id
=
0x03
;
_UINT
32
nameindex
;
_UINT
16
nameindex
;
private:
GlobalWorkbookInfoPtr
global_info
;
};
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgNameX.cpp
View file @
3e93d9aa
...
...
@@ -33,7 +33,20 @@ void PtgNameX::storeFields(CFRecord& record)
void
PtgNameX
::
loadFields
(
CFRecord
&
record
)
{
record
>>
ixti
>>
nameindex
;
record
>>
ixti
;
if
(
record
.
getGlobalWorkbookInfo
()
->
Version
<
0x0600
)
{
record
.
skipNunBytes
(
8
);
_UINT16
val
;
record
>>
val
;
nameindex
=
val
;
record
.
skipNunBytes
(
12
);
}
else
record
>>
nameindex
;
global_info
=
record
.
getGlobalWorkbookInfo
();
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgRef.cpp
View file @
3e93d9aa
...
...
@@ -33,7 +33,20 @@ void PtgRef::storeFields(CFRecord& record)
void
PtgRef
::
loadFields
(
CFRecord
&
record
)
{
record
>>
loc
;
if
(
record
.
getGlobalWorkbookInfo
()
->
Version
<
0x0600
)
{
unsigned
char
col
;
_UINT16
rw
;
record
>>
rw
>>
col
;
loc
.
rowRelative
=
GETBIT
(
rw
,
15
);
loc
.
colRelative
=
GETBIT
(
rw
,
14
);
loc
.
column
=
col
;
loc
.
row
=
GETBITS
(
rw
,
0
,
13
);
}
else
record
>>
loc
;
}
void
PtgRef
::
assemble
(
AssemblerStack
&
ptg_stack
,
PtgQueue
&
extra_data
,
bool
full_ref
)
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgRef3d.cpp
View file @
3e93d9aa
...
...
@@ -43,10 +43,18 @@ void PtgRef3d::loadFields(CFRecord& record)
if
(
global_info
->
Version
<
0x0600
)
{
_UINT16
rw
;
unsigned
char
col
;
record
>>
ixals
;
record
.
skipNunBytes
(
8
);
record
>>
itabFirst
>>
itabLast
>>
grbitRw
>>
col
;
record
>>
itabFirst
>>
itabLast
>>
rw
>>
col
;
rgce_loc
.
rowRelative
=
GETBIT
(
rw
,
15
);
rgce_loc
.
colRelative
=
GETBIT
(
rw
,
14
);
rgce_loc
.
column
=
col
;
rgce_loc
.
row
=
GETBITS
(
rw
,
0
,
13
);
}
else
{
...
...
@@ -69,28 +77,24 @@ void PtgRef3d::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool fu
extra_data
.
pop
();
return
;
}
std
::
wstring
cell_ref
=
rgce_loc
.
toString
();
if
(
global_info
->
Version
<
0x0600
)
{
CellRef
cell
(
grbitRw
,
col
,
false
,
false
);
std
::
wstring
range_ref
=
cell
.
toString
();
if
(
ixals
==
0xffff
)
{
std
::
wstring
prefix
=
XMLSTUFF
::
xti_indexes2sheet_name
(
itabFirst
,
itabLast
,
global_info
->
sheets_names
);
if
(
!
prefix
.
empty
())
prefix
+=
L"!"
;
ptg_stack
.
push
(
prefix
+
range
_ref
);
ptg_stack
.
push
(
prefix
+
cell
_ref
);
}
else
{
ptg_stack
.
push
(
XMLSTUFF
::
make3dRef
(
ixals
,
range
_ref
,
global_info
->
xti_parsed
,
full_ref
));
// from External !
ptg_stack
.
push
(
XMLSTUFF
::
make3dRef
(
ixals
,
cell
_ref
,
global_info
->
xti_parsed
,
full_ref
));
// from External !
}
}
else
{
std
::
wstring
cell_ref
=
rgce_loc
.
toString
();
cell_ref
=
XMLSTUFF
::
make3dRef
(
ixti
,
cell_ref
,
global_info
->
xti_parsed
,
full_ref
);
ptg_stack
.
push
(
cell_ref
);
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgRef3d.h
View file @
3e93d9aa
...
...
@@ -34,8 +34,6 @@ private:
_UINT16
ixals
;
_UINT16
itabFirst
;
_UINT16
itabLast
;
_UINT16
grbitRw
;
unsigned
char
col
;
GlobalWorkbookInfoPtr
global_info
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgRefN.cpp
View file @
3e93d9aa
...
...
@@ -35,7 +35,20 @@ void PtgRefN::storeFields(CFRecord& record)
void
PtgRefN
::
loadFields
(
CFRecord
&
record
)
{
record
>>
loc
;
if
(
record
.
getGlobalWorkbookInfo
()
->
Version
<
0x0600
)
{
unsigned
char
col
;
_UINT16
rw
;
record
>>
rw
>>
col
;
loc
.
rowRelative
=
rw
&
0x8000
;
loc
.
colRelative
=
rw
&
0x4000
;
loc
.
column
=
col
;
loc
.
row
=
GETBITS
(
rw
,
0
,
13
);
}
else
record
>>
loc
;
}
...
...
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