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
c55af15c
Commit
c55af15c
authored
Jul 21, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a2bbb164
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
115 additions
and
29 deletions
+115
-29
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DConn.cpp
...iceXlsFile2/source/XlsFormat/Logic/Biff_records/DConn.cpp
+49
-5
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffString.cpp
...le2/source/XlsFormat/Logic/Biff_structures/BiffString.cpp
+13
-3
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgStr.cpp
...lsFile2/source/XlsFormat/Logic/Biff_structures/PtgStr.cpp
+4
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgSxName.cpp
...ile2/source/XlsFormat/Logic/Biff_structures/PtgSxName.cpp
+4
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DBB.cpp
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DBB.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DBQUERY.cpp
...ceXlsFile2/source/XlsFormat/Logic/Biff_unions/DBQUERY.cpp
+12
-10
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.cpp
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.cpp
+12
-5
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.h
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.h
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTCACHEDEFINITION.cpp
...urce/XlsFormat/Logic/Biff_unions/PIVOTCACHEDEFINITION.cpp
+11
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/SXOPER.cpp
...iceXlsFile2/source/XlsFormat/Logic/Biff_unions/SXOPER.cpp
+4
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/SXSRC.cpp
...ficeXlsFile2/source/XlsFormat/Logic/Biff_unions/SXSRC.cpp
+3
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/SXSRC.h
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/SXSRC.h
+1
-0
No files found.
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DConn.cpp
View file @
c55af15c
...
...
@@ -58,10 +58,17 @@ BaseObjectPtr DConn::clone()
void
DConn
::
readFields
(
CFRecord
&
record
)
{
unsigned
short
flags1
,
reserved1
;
unsigned
char
flags2
,
reserved2
;
unsigned
char
flags2
,
reserved2
,
reserved3
;
record
>>
frtHeaderOld
>>
dbt
>>
flags1
>>
cParams
>>
reserved1
>>
flags2
>>
reserved2
;
//DBT_ODBC 0x0001 ODBC-based source
//DBT_DAO 0x0002 DAO-based source
//DBT_WEB 0x0004 Web query
//DBT_OLEDB 0x0005 OLE DB-based source
//DBT_TXT 0x0006 Text-based source created via text query
//DBT_ADO 0x0007 ADO record set
fSavePwd
=
GETBIT
(
flags1
,
0
);
fTablesOnlyHtml
=
GETBIT
(
flags1
,
1
);
fTableNames
=
GETBIT
(
flags1
,
2
);
...
...
@@ -84,17 +91,39 @@ void DConn::readFields(CFRecord& record)
case
4
:
grbitDbt
.
reset
(
new
ConnGrbitDbtWeb
);
break
;
case
5
:
grbitDbt
.
reset
(
new
ConnGrbitDbtOledb
);
break
;
case
7
:
grbitDbt
.
reset
(
new
ConnGrbitDbtAdo
);
break
;
default:
break
;
}
if
(
grbitDbt
)
{
record
>>
*
grbitDbt
;
}
else
{
unsigned
short
unused
;
record
>>
unused
;
}
record
>>
bVerDbqueryEdit
>>
bVerDbqueryRefreshed
>>
bVerDbqueryRefreshableMin
>>
wRefreshInterval
>>
wHtmlFmt
>>
wHtmlFmt
>>
rcc
>>
credMethod
;
record
>>
bVerDbqueryEdit
>>
bVerDbqueryRefreshed
>>
bVerDbqueryRefreshableMin
>>
wRefreshInterval
>>
wHtmlFmt
>>
rcc
>>
credMethod
>>
reserved3
;
if
(
dbt
==
5
)
{
record
>>
rgchSourceDataFile
;
}
record
>>
rgchSource
DataFile
>>
rgchSourceConnectionFile
>>
rgchConnectionName
>>
rgchConnectionDesc
>>
rgchSSOApplicationID
>>
tableNames
;
record
>>
rgchSource
ConnectionFile
>>
rgchConnectionName
>>
rgchConnectionDesc
;
for
(
unsigned
short
i
=
0
;
i
<
cParams
;
i
++
)
if
(
dbt
==
1
||
dbt
==
5
)
{
record
>>
rgchSSOApplicationID
;
}
if
(
fTableNames
)
{
record
>>
tableNames
;
}
for
(
unsigned
short
i
=
0
;
fStandAlone
&&
i
<
cParams
;
i
++
)
{
DConnParameter
val
;
params
.
push_back
(
val
);
...
...
@@ -111,7 +140,22 @@ void DConn::readFields(CFRecord& record)
if
(
connection
)
record
>>
*
connection
;
record
>>
rgbSQL
>>
rgbSQLSav
>>
rgbEditWebPage
>>
id
;
if
(
dbt
==
1
||
dbt
==
5
)
{
record
>>
rgbSQL
;
}
if
(
dbt
==
1
)
{
record
>>
rgbSQLSav
;
}
if
(
dbt
==
4
)
{
record
>>
rgbEditWebPage
;
}
record
>>
id
;
int
skip
=
record
.
getDataSize
()
-
record
.
getRdPtr
();
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffString.cpp
View file @
c55af15c
...
...
@@ -216,19 +216,29 @@ void XLUnicodeStringSegmented::load(CFRecord& record)
if
(
cchTotal
<
1
)
return
;
if
(
cchTotal
>
record
.
getDataSize
()
-
record
.
getRdPtr
())
{
cchTotal
=
cchTotal
>>
8
;
}
_UINT32
cchTotal_test
=
0
;
while
(
true
)
{
if
(
record
.
isEOF
())
break
;
if
(
cchTotal_test
>=
cchTotal
)
break
;
_UINT32
max_string_size
=
cchTotal
-
cchTotal_test
;
XLUnicodeString
string
;
record
>>
string
;
cchTotal_test
+=
string
.
value
().
length
();
arStrings
.
push_back
(
string
.
value
());
strTotal
+=
string
.
value
();
cchTotal_test
+=
arStrings
.
back
().
length
();
strTotal
+=
arStrings
.
back
();
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgStr.cpp
View file @
c55af15c
...
...
@@ -71,6 +71,10 @@ void PtgStr::loadFields(CFRecord& record)
{
string_
=
string_
.
substr
(
1
,
string_
.
length
()
-
2
);
}
else
if
(
pos1
>
0
)
{
boost
::
algorithm
::
replace_all
(
string_
,
L"
\"
"
,
L"
\"\"
"
);
}
string_
=
L"
\"
"
+
string_
+
L"
\"
"
;
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgSxName.cpp
View file @
c55af15c
...
...
@@ -67,6 +67,10 @@ void PtgSxName::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool f
if
((
name
)
&&
(
name
->
ifdb
>=
0
&&
name
->
ifdb
<
global_info
->
arPivotCacheSxNames
.
size
()))
{
_Name
=
global_info
->
arPivotCacheSxNames
[
name
->
ifdb
];
if
(
std
::
wstring
::
npos
!=
_Name
.
find
(
L" "
))
{
_Name
=
L"'"
+
_Name
+
L"'"
;
}
}
else
if
(
!
global_info
->
arPivotSxNames
[
sxIndex
].
pair
.
empty
())
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DBB.cpp
View file @
c55af15c
...
...
@@ -97,7 +97,7 @@ int DBB::serialize(std::wostream & strm)
for
(
size_t
i
=
0
;
i
<
arPivotCacheFields
.
size
();
i
++
)
{
if
(
arPivotCacheFields
[
i
]
==
false
)
if
(
arPivotCacheFields
[
i
]
==
false
&&
indexOPER
<
m_arSXOPER
.
size
()
)
{
m_arSXOPER
[
indexOPER
++
]
->
serialize
(
CP_XML_STREAM
());
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DBQUERY.cpp
View file @
c55af15c
...
...
@@ -206,8 +206,8 @@ int DBQUERY::serialize_connection(std::wostream & strm)
{
CP_XML_NODE
(
L"connection"
)
{
CP_XML_ATTR
(
L"id"
,
1
);
//connectionId in connections(root)
CP_XML_ATTR
(
L"name"
,
L"Connection"
);
CP_XML_ATTR
(
L"id"
,
connectionId
);
CP_XML_ATTR
(
L"name"
,
L"Connection"
+
std
::
to_wstring
(
connectionId
)
);
CP_XML_ATTR
(
L"type"
,
queryOrParam
->
query
.
dbt
);
//switch(queryOrParam->query.dbt)
...
...
@@ -222,22 +222,24 @@ int DBQUERY::serialize_connection(std::wostream & strm)
//}
if
(
queryOrParam
->
query
.
fSavePwd
)
CP_XML_ATTR
(
L"savePassword"
,
1
);
if
(
queryOrParam
->
query
.
fSavePwd
)
CP_XML_ATTR
(
L"refreshedVersion"
,
1
);
CP_XML_ATTR
(
L"refreshedVersion"
,
1
);
int
index
=
0
;
CP_XML_NODE
(
L"dbPr"
)
{
if
(
index
<
m_arSXString
.
size
())
std
::
wstring
command
,
connection
;
for
(
index
=
0
;
index
<
queryOrParam
->
query
.
cstQuery
;
index
++
)
{
CP_XML_ATTR
(
L"command"
,
m_arSXString
[
index
])
;
command
+=
m_arSXString
[
index
]
;
}
index
++
;
if
(
index
<
m_arSXString
.
size
()
)
for
(;
index
<
queryOrParam
->
query
.
cstQuery
+
queryOrParam
->
query
.
cstOdbcConn
;
index
++
)
{
CP_XML_ATTR
(
L"connection"
,
m_arSXString
[
index
])
;
connection
+=
m_arSXString
[
index
]
;
}
index
++
;
CP_XML_ATTR
(
L"connection"
,
connection
);
CP_XML_ATTR
(
L"command"
,
command
);
}
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.cpp
View file @
c55af15c
...
...
@@ -175,7 +175,7 @@ const bool FDB::loadContent(BinProcessor& proc)
return
true
;
}
int
FDB
::
serialize
(
std
::
wostream
&
strm
)
int
FDB
::
serialize
(
std
::
wostream
&
strm
,
bool
bSql
)
{
SXFDB
*
fdb
=
dynamic_cast
<
SXFDB
*>
(
m_SXFDB
.
get
());
SXFDBType
*
fdb_type
=
dynamic_cast
<
SXFDBType
*>
(
m_SXFDBType
.
get
());
...
...
@@ -190,13 +190,20 @@ int FDB::serialize(std::wostream & strm)
{
CP_XML_ATTR
(
L"name"
,
fdb
->
stFieldName
.
value
());
if
(
bSql
)
{
CP_XML_ATTR
(
L"numFmtId"
,
0
);
if
(
fdb_type
->
wTypeSql
>
0
)
CP_XML_ATTR
(
L"sqlType"
,
fdb_type
->
wTypeSql
);
}
else
{
CP_XML_ATTR
(
L"numFmtId"
,
fdb_type
->
wTypeSql
);
//CP_XML_ATTR(L"sqlType", fdb_type->wTypeSql); //in db
}
if
(
m_arSRCSXOPER
.
empty
()
&&
m_arGRPSXOPER
.
empty
()
==
false
)
{
CP_XML_ATTR
(
L"databaseField"
,
0
);
}
switch
(
fdb_type
->
wTypeSql
)
//format code
{
case
0x0000
:
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.h
View file @
c55af15c
...
...
@@ -47,7 +47,7 @@ public:
virtual
const
bool
loadContent
(
BinProcessor
&
proc
);
int
serialize
(
std
::
wostream
&
strm
);
int
serialize
(
std
::
wostream
&
strm
,
bool
bSql
);
static
const
ElementType
type
=
typeFDB
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTCACHEDEFINITION.cpp
View file @
c55af15c
...
...
@@ -34,6 +34,7 @@
#include "PIVOTCACHE.h"
#include "SXSRC.h"
#include "SXADDLCACHE.h"
#include "FDB.h"
#include "../Biff_records/SXStreamID.h"
#include "../Biff_records/SXVS.h"
...
...
@@ -110,6 +111,8 @@ int PIVOTCACHEDEFINITION::serialize_definitions(std::wostream & strm)
if
(
!
db
||
!
db_ex
)
return
0
;
bool
bSql
=
false
;
CP_XML_WRITER
(
strm
)
{
CP_XML_NODE
(
L"pivotCacheDefinition"
)
...
...
@@ -124,13 +127,16 @@ int PIVOTCACHEDEFINITION::serialize_definitions(std::wostream & strm)
CP_XML_ATTR
(
L"enableRefresh"
,
1
);
CP_XML_ATTR
(
L"refreshedBy"
,
db
->
rgb
.
value
());
CP_XML_ATTR
(
L"refreshedDate"
,
db_ex
->
numDate
.
data
.
value
);
CP_XML_ATTR
(
L"recordCount"
,
db
->
crdb
Used
);
CP_XML_ATTR
(
L"recordCount"
,
db
->
crdb
db
);
//createdVersion="1"
//refreshedVersion="2"
//upgradeOnRefresh="1">
SXSRC
*
src
=
dynamic_cast
<
SXSRC
*>
(
m_SXSRC
.
get
());
if
(
src
)
{
bSql
=
src
->
bSql
;
src
->
serialize
(
CP_XML_STREAM
());
}
if
(
pivot_cache
->
m_arFDB
.
empty
()
==
false
)
{
...
...
@@ -140,7 +146,10 @@ int PIVOTCACHEDEFINITION::serialize_definitions(std::wostream & strm)
for
(
size_t
i
=
0
;
i
<
pivot_cache
->
m_arFDB
.
size
();
i
++
)
{
pivot_cache
->
m_arFDB
[
i
]
->
serialize
(
CP_XML_STREAM
());
FDB
*
field
=
dynamic_cast
<
FDB
*>
(
pivot_cache
->
m_arFDB
[
i
].
get
());
if
(
!
field
)
continue
;
field
->
serialize
(
CP_XML_STREAM
(),
bSql
);
}
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/SXOPER.cpp
View file @
c55af15c
...
...
@@ -82,6 +82,9 @@ const bool SXOPER::loadContent(BinProcessor& proc)
}
bNumber
=
!
bInteger
;
node
=
L"n"
;
if
(
bInteger
)
value
=
std
::
to_wstring
((
int
)
num
->
num
.
data
.
value
);
else
value
=
std
::
to_wstring
(
num
->
num
.
data
.
value
);
}
else
if
(
proc
.
optional
<
SxBool
>
())
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/SXSRC.cpp
View file @
c55af15c
...
...
@@ -38,9 +38,9 @@
namespace
XLS
{
SXSRC
::
SXSRC
()
{
bSql
=
false
;
}
...
...
@@ -57,6 +57,7 @@ BaseObjectPtr SXSRC::clone()
// SXSRC = DREF / SXTBL / DBQUERY
const
bool
SXSRC
::
loadContent
(
BinProcessor
&
proc
)
{
bSql
=
false
;
if
(
!
proc
.
optional
<
DREF
>
())
{
if
(
!
proc
.
optional
<
SXTBL
>
())
...
...
@@ -65,6 +66,7 @@ const bool SXSRC::loadContent(BinProcessor& proc)
{
return
false
;
}
bSql
=
true
;
}
}
m_source
=
elements_
.
back
();
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/SXSRC.h
View file @
c55af15c
...
...
@@ -52,6 +52,7 @@ public:
static
const
ElementType
type
=
typeSXSRC
;
BaseObjectPtr
m_source
;
bool
bSql
;
};
}
// namespace XLS
...
...
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