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
b4f28733
Commit
b4f28733
authored
Aug 22, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XlsFormat - codepage from font charset
parent
eb0d03f7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
5 deletions
+81
-5
ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp
ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp
+18
-3
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Font.cpp
...ficeXlsFile2/source/XlsFormat/Logic/Biff_records/Font.cpp
+5
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Label.cpp
...iceXlsFile2/source/XlsFormat/Logic/Biff_records/Label.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.h
...fficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.h
+2
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
...fficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
+55
-1
No files found.
ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp
View file @
b4f28733
...
...
@@ -37,9 +37,9 @@
#else
#include <iconv.h>
#endif
#else
#include "../../../../UnicodeConverter/UnicodeConverter.h"
#endif
#include "../../../../UnicodeConverter/UnicodeConverter.h"
#include <Logic/Biff_structures/CellRangeRef.h>
...
...
@@ -555,7 +555,22 @@ const std::string toStdString(std::wstring wide_string, const unsigned int code_
}
const
std
::
wstring
toStdWString
(
char
*
ansi
,
int
size
,
const
unsigned
int
code_page
)
{
#if defined (_WIN32) || defined (_WIN64)
std
::
string
sCodePage
;
for
(
int
i
=
0
;
i
<
UNICODE_CONVERTER_ENCODINGS_COUNT
;
++
i
)
{
if
(
code_page
==
NSUnicodeConverter
::
Encodings
[
i
].
WindowsCodePage
)
{
sCodePage
=
NSUnicodeConverter
::
Encodings
[
i
].
Name
;
break
;
}
}
if
(
!
sCodePage
.
empty
())
{
NSUnicodeConverter
::
CUnicodeConverter
oConverter
;
return
oConverter
.
toUnicode
(
ansi
,
size
,
sCodePage
.
c_str
());
}
#if defined (_WIN32) || defined (_WIN64)
const
int
nSize
=
MultiByteToWideChar
(
code_page
,
0
,
ansi
,
size
,
NULL
,
0
);
wchar_t
*
sTemp
=
new
wchar_t
[
nSize
];
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Font.cpp
View file @
b4f28733
...
...
@@ -99,6 +99,11 @@ void Font::readFields(CFRecord& record)
{
record
>>
fontName
;
}
if
(
global_info
->
fonts_charsets
.
find
(
bCharSet
)
==
global_info
->
fonts_charsets
.
end
())
{
global_info
->
fonts_charsets
.
insert
(
global_info
->
fonts_charsets
.
begin
(),
std
::
pair
<
int
,
int
>
(
bCharSet
,
bFamily
));
}
}
int
Font
::
serialize
(
std
::
wostream
&
stream
)
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Label.cpp
View file @
b4f28733
...
...
@@ -66,7 +66,7 @@ void Label::readFields(CFRecord& record)
record
>>
cell
;
if
(
record
.
getGlobalWorkbookInfo
()
->
Version
<
0x0600
)
if
(
global_info_
->
Version
<
0x0600
)
{
LPAnsiString
name
;
record
>>
name
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.h
View file @
b4f28733
...
...
@@ -87,7 +87,9 @@ public:
boost
::
unordered_map
<
BorderInfo
,
int
>
border_x_ids
;
boost
::
unordered_map
<
FillInfo
,
int
>
fill_x_ids
;
std
::
map
<
int
,
FillInfoExt
>
fonts_color_ext
;
std
::
map
<
int
,
int
>
fonts_charsets
;
std
::
map
<
int
,
std
::
wstring
>
colors_palette
;
std
::
vector
<
BaseObjectPtr
>
*
m_arFonts
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
View file @
b4f28733
...
...
@@ -98,6 +98,42 @@
namespace
XLS
{;
static
const
int
aCodePages
[][
2
]
=
{
//charset codepage
0
,
1252
,
//ANSI
1
,
0
,
//Default
2
,
42
,
//Symbol
77
,
10000
,
//Mac Roman
78
,
10001
,
//Mac Shift Jis
79
,
10003
,
//Mac Hangul
80
,
10008
,
//Mac GB2312
81
,
10002
,
//Mac Big5
83
,
10005
,
//Mac Hebrew
84
,
10004
,
//Mac Arabic
85
,
10006
,
//Mac Greek
86
,
10081
,
//Mac Turkish
87
,
10021
,
//Mac Thai
88
,
10029
,
//Mac East Europe
89
,
10007
,
//Mac Russian
128
,
932
,
//Shift JIS
129
,
949
,
//Hangul
130
,
1361
,
//Johab
134
,
936
,
//GB2312
136
,
950
,
//Big5
238
,
1250
,
//Greek
161
,
1253
,
//Greek
162
,
1254
,
//Turkish
163
,
1258
,
//Vietnamese
177
,
1255
,
//Hebrew
178
,
1256
,
//Arabic
186
,
1257
,
//Baltic
204
,
1251
,
//Russian
222
,
874
,
//Thai
238
,
1250
,
//Eastern European
254
,
437
,
//PC 437
255
,
850
//OEM
};
GlobalsSubstream
::
GlobalsSubstream
(
const
unsigned
short
code_page
)
:
code_page_
(
code_page
)
{
...
...
@@ -412,7 +448,25 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
proc
.
SkipRecord
();
}
break
;
}
}
}
if
(
proc
.
getGlobalWorkbookInfo
()
->
CodePage
==
0
)
{
//try from charsets ... todooo make local set on each record (aka Label)
//from ixfe -> ifnt from xf -> arFonts
for
(
std
::
map
<
int
,
int
>::
iterator
it
=
proc
.
getGlobalWorkbookInfo
()
->
fonts_charsets
.
begin
()
;
proc
.
getGlobalWorkbookInfo
()
->
CodePage
==
0
&&
it
!=
proc
.
getGlobalWorkbookInfo
()
->
fonts_charsets
.
end
()
;
it
++
)
{
for
(
int
i
=
0
;
i
<
sizeof
(
aCodePages
)
/
2
;
i
++
)
{
if
(
aCodePages
[
i
][
0
]
==
it
->
first
)
{
proc
.
getGlobalWorkbookInfo
()
->
CodePage
=
aCodePages
[
i
][
1
];
break
;
}
}
}
}
return
true
;
}
...
...
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