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
fb9d2cbf
Commit
fb9d2cbf
authored
Nov 22, 2016
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 33488
parent
0d7c8ebc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
68 deletions
+8
-68
ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp
ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp
+6
-66
DesktopEditor/common/File.h
DesktopEditor/common/File.h
+2
-2
No files found.
ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.cpp
View file @
fb9d2cbf
...
...
@@ -1507,32 +1507,9 @@ namespace NSBinPptxRW
if
(
sizeof
(
wchar_t
)
==
4
)
{
wchar_t
*
sBuffer
=
new
wchar_t
[
lSize
+
1
]
;
memset
(
sBuffer
,
0
,
lSize
+
1
);
std
::
wstring
val
=
NSFile
::
CUtf8Converter
::
GetWStringFromUTF16
((
unsigned
short
*
)
m_pDataCur
,
lSize
)
;
CString
res
(
val
.
c_str
(),
val
.
length
()
);
UTF16
*
pStrUtf16
=
(
UTF16
*
)
m_pDataCur
;
UTF32
*
pStrUtf32
=
(
UTF32
*
)
sBuffer
;
// this values will be modificated
const
UTF16
*
pStrUtf16_Conv
=
pStrUtf16
;
UTF32
*
pStrUtf32_Conv
=
pStrUtf32
;
ConversionResult
eUnicodeConversionResult
=
ConvertUTF16toUTF32
(
&
pStrUtf16_Conv
,
&
pStrUtf16
[
lSize
]
,
&
pStrUtf32_Conv
,
&
pStrUtf32
[
lSize
]
,
strictConversion
);
if
(
conversionOK
!=
eUnicodeConversionResult
)
{
delete
[]
sBuffer
;
return
_T
(
""
);
}
CString
res
((
WCHAR
*
)
sBuffer
,
lSize
);
delete
[]
sBuffer
;
m_lPos
+=
len
;
m_pDataCur
+=
len
;
...
...
@@ -1557,48 +1534,11 @@ namespace NSBinPptxRW
_UINT32
lSize
=
len
>>
1
;
//string in char
if
(
sizeof
(
wchar_t
)
==
4
)
{
wchar_t
*
sBuffer
=
new
wchar_t
[
lSize
+
1
];
memset
(
sBuffer
,
0
,
lSize
+
1
);
UTF16
*
pStrUtf16
=
(
UTF16
*
)
m_pDataCur
;
UTF32
*
pStrUtf32
=
(
UTF32
*
)
sBuffer
;
// this values will be modificated
const
UTF16
*
pStrUtf16_Conv
=
pStrUtf16
;
UTF32
*
pStrUtf32_Conv
=
pStrUtf32
;
ConversionResult
eUnicodeConversionResult
=
ConvertUTF16toUTF32
(
&
pStrUtf16_Conv
,
&
pStrUtf16
[
lSize
]
,
&
pStrUtf32_Conv
,
&
pStrUtf32
[
lSize
]
,
strictConversion
);
if
(
conversionOK
!=
eUnicodeConversionResult
)
{
delete
[]
sBuffer
;
return
_T
(
""
);
}
std
::
wstring
res
((
WCHAR
*
)
sBuffer
,
lSize
);
delete
[]
sBuffer
;
m_lPos
+=
len
;
m_pDataCur
+=
len
;
return
res
;
}
else
{
std
::
wstring
res
((
WCHAR
*
)
m_pDataCur
,
lSize
);
m_lPos
+=
len
;
m_pDataCur
+=
len
;
std
::
wstring
res
=
NSFile
::
CUtf8Converter
::
GetWStringFromUTF16
((
unsigned
short
*
)
m_pDataCur
,
lSize
);
m_lPos
+=
len
;
m_pDataCur
+=
len
;
return
res
;
}
return
res
;
}
bool
CBinaryFileReader
::
GetArray
(
BYTE
**
pBuffer
,
_INT32
len
)
...
...
DesktopEditor/common/File.h
View file @
fb9d2cbf
...
...
@@ -542,7 +542,7 @@ namespace NSFile
int
nCurrent
=
0
;
while
(
nCurrent
<
nCount
)
{
if
(
*
pShort
<
0xD800
||
*
pShort
>
0xD
F
FF
)
if
(
*
pShort
<
0xD800
||
*
pShort
>
0xD
B
FF
)
{
*
pWCurrent
=
(
wchar_t
)(
*
pShort
);
++
pShort
;
...
...
@@ -550,7 +550,7 @@ namespace NSFile
}
else
{
*
pWCurrent
=
(
wchar_t
)((((
pShort
[
0
])
&
0x03FF
)
<<
10
)
|
((
pShort
[
1
])
&
0x03FF
)
);
*
pWCurrent
=
(
wchar_t
)((((
(
pShort
[
0
]
-
0xD800
)
&
0x03FF
)
<<
10
)
|
((
pShort
[
1
]
-
0xDC00
)
&
0x03FF
))
+
0x10000
);
pShort
+=
2
;
nCurrent
+=
2
;
}
...
...
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