Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Office
Calligra
Commits
e2a8cdd2
Commit
e2a8cdd2
authored
Mar 09, 2013
by
Matus Uzak
Browse files
Handle UTF-8/UTF-16 encoding when processing Document Information.
BUG:305440
parent
959ecb38
Changes
2
Hide whitespace changes
Inline
Side-by-side
filters/libmso/msoleps.h
View file @
e2a8cdd2
...
...
@@ -29,7 +29,8 @@
*/
enum
PropertyType
{
PIDSI_TITLE
=
0x00000002
,
PIDSI_CODEPAGE
=
0x00000001
,
PIDSI_TITLE
,
PIDSI_SUBJECT
,
PIDSI_AUTHOR
,
PIDSI_KEYWORDS
,
...
...
filters/words/msword-odf/document.cpp
View file @
e2a8cdd2
...
...
@@ -228,6 +228,9 @@ void Document::processAssociatedStrings()
}
}
static
const
quint16
CP_WINUNICODE
=
0x04B0
;
bool
isUnicode16
=
false
;
QString
title
;
QString
subject
;
QString
keywords
;
...
...
@@ -241,6 +244,13 @@ void Document::processAssociatedStrings()
for
(
uint
i
=
0
;
i
<
ps
.
numProperties
;
i
++
)
{
switch
(
ps
.
propertyIdentifierAndOffset
.
at
(
i
).
propertyIdentifier
)
{
case
PIDSI_CODEPAGE
:
if
(
ps
.
property
.
at
(
i
).
_has_vt_I2
)
{
if
(
ps
.
property
.
at
(
i
).
vt_I2
==
CP_WINUNICODE
)
{
isUnicode16
=
true
;
}
}
break
;
case
PIDSI_TITLE
:
p_str
=
&
title
;
break
;
...
...
@@ -264,7 +274,11 @@ void Document::processAssociatedStrings()
}
if
(
p_str
)
{
if
(
ps
.
property
.
at
(
i
).
vt_lpstr
)
{
*
p_str
=
ps
.
property
.
at
(
i
).
vt_lpstr
->
characters
;
if
(
isUnicode16
)
{
*
p_str
=
QString
::
fromUtf16
((
ushort
*
)
ps
.
property
.
at
(
i
).
vt_lpstr
->
characters
.
data
());
}
else
{
*
p_str
=
QString
::
fromUtf8
(
ps
.
property
.
at
(
i
).
vt_lpstr
->
characters
.
data
());
}
}
p_str
=
0
;
}
...
...
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