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
0e37afed
Commit
0e37afed
authored
8 years ago
by
ElenaSubbotina
Committed by
Alexander Trofimov
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
правка багов по результатам тестирования
DocFormatReader - картинки маркированных списков
parent
0e5a581f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
92 additions
and
18 deletions
+92
-18
ASCOfficeDocFile/Common/FormatUtils.h
ASCOfficeDocFile/Common/FormatUtils.h
+61
-10
ASCOfficeDocFile/DocDocxConverter/FontTableMapping.cpp
ASCOfficeDocFile/DocDocxConverter/FontTableMapping.cpp
+2
-2
ASCOfficeDocFile/DocDocxConverter/OleObject.h
ASCOfficeDocFile/DocDocxConverter/OleObject.h
+10
-3
ASCOfficeDocFile/DocDocxConverter/PictureDescriptor.cpp
ASCOfficeDocFile/DocDocxConverter/PictureDescriptor.cpp
+2
-2
ASCOfficeDocFile/DocDocxConverter/StyleSheetMapping.cpp
ASCOfficeDocFile/DocDocxConverter/StyleSheetMapping.cpp
+1
-1
ASCOfficeDocFile/DocDocxConverter/VMLPictureMapping.cpp
ASCOfficeDocFile/DocDocxConverter/VMLPictureMapping.cpp
+4
-0
ASCOfficeDocFile/DocDocxConverter/VMLShapeTypeMapping.cpp
ASCOfficeDocFile/DocDocxConverter/VMLShapeTypeMapping.cpp
+12
-0
No files found.
ASCOfficeDocFile/Common/FormatUtils.h
View file @
0e37afed
...
...
@@ -77,22 +77,73 @@ namespace ASCDocFormatUtils
class
FormatUtils
{
public:
static
inline
std
::
wstring
XmlEncode
(
std
::
wstring
data
)
static
inline
bool
IsUnicodeSymbol
(
wchar_t
symbol
)
{
bool
result
=
false
;
if
(
(
0x0009
==
symbol
)
||
(
0x000A
==
symbol
)
||
(
0x000D
==
symbol
)
||
(
(
0x0020
<=
symbol
)
&&
(
0xD7FF
>=
symbol
)
)
||
(
(
0xE000
<=
symbol
)
&&
(
symbol
<=
0xFFFD
)
)
||
(
(
0x10000
<=
symbol
)
&&
symbol
)
)
{
result
=
true
;
}
return
result
;
}
static
inline
std
::
wstring
XmlEncode
(
std
::
wstring
data
,
bool
bDeleteNoUnicode
=
false
)
{
std
::
wstring
buffer
;
buffer
.
reserve
(
data
.
size
());
for
(
size_t
pos
=
0
;
pos
!=
data
.
size
();
++
pos
)
if
(
bDeleteNoUnicode
)
{
switch
(
data
[
pos
])
{
case
'&'
:
buffer
.
append
(
_T
(
"&"
));
break
;
case
'\"'
:
buffer
.
append
(
_T
(
"""
));
break
;
case
'\''
:
buffer
.
append
(
_T
(
"'"
));
break
;
case
'<'
:
buffer
.
append
(
_T
(
"<"
));
break
;
case
'>'
:
buffer
.
append
(
_T
(
">"
));
break
;
default:
buffer
.
append
(
&
data
[
pos
],
1
);
break
;
for
(
size_t
pos
=
0
;
pos
!=
data
.
size
();
++
pos
)
{
switch
(
data
[
pos
])
{
case
'&'
:
buffer
.
append
(
_T
(
"&"
));
break
;
case
'\"'
:
buffer
.
append
(
_T
(
"""
));
break
;
case
'\''
:
buffer
.
append
(
_T
(
"'"
));
break
;
case
'<'
:
buffer
.
append
(
_T
(
"<"
));
break
;
case
'>'
:
buffer
.
append
(
_T
(
">"
));
break
;
default:
{
if
(
false
==
IsUnicodeSymbol
(
data
[
pos
]
)
)
{
wchar_t
symbol1
=
data
[
pos
];
if
(
0xD800
<=
symbol1
&&
symbol1
<=
0xDFFF
&&
pos
+
1
<
data
.
size
())
{
pos
++
;
wchar_t
symbol2
=
data
[
pos
];
if
(
symbol1
<
0xDC00
&&
symbol2
>=
0xDC00
&&
symbol2
<=
0xDFFF
)
{
buffer
.
append
(
&
data
[
pos
-
1
],
2
);
}
}
}
else
buffer
.
append
(
&
data
[
pos
],
1
);
}
break
;
}
}
}
else
{
for
(
size_t
pos
=
0
;
pos
!=
data
.
size
();
++
pos
)
{
switch
(
data
[
pos
])
{
case
'&'
:
buffer
.
append
(
_T
(
"&"
));
break
;
case
'\"'
:
buffer
.
append
(
_T
(
"""
));
break
;
case
'\''
:
buffer
.
append
(
_T
(
"'"
));
break
;
case
'<'
:
buffer
.
append
(
_T
(
"<"
));
break
;
case
'>'
:
buffer
.
append
(
_T
(
">"
));
break
;
default:
buffer
.
append
(
&
data
[
pos
],
1
);
break
;
}
}
}
return
buffer
;
}
...
...
This diff is collapsed.
Click to expand it.
ASCOfficeDocFile/DocDocxConverter/FontTableMapping.cpp
View file @
0e37afed
...
...
@@ -35,14 +35,14 @@ namespace DocFileFormat
FontFamilyName
*
font
=
dynamic_cast
<
FontFamilyName
*>
(
*
iter
);
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:font"
),
TRUE
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:name"
),
FormatUtils
::
XmlEncode
(
font
->
xszFtn
).
c_str
()
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:name"
),
FormatUtils
::
XmlEncode
(
font
->
xszFtn
,
true
).
c_str
()
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
,
FALSE
);
//alternative name
if
(
(
font
->
xszAlt
!=
wstring
(
_T
(
""
)
)
)
&&
(
font
->
xszAlt
.
length
()
>
0
)
)
{
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:altName"
),
TRUE
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:val"
),
FormatUtils
::
XmlEncode
(
font
->
xszAlt
).
c_str
()
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:val"
),
FormatUtils
::
XmlEncode
(
font
->
xszAlt
,
true
).
c_str
()
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
,
FALSE
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
"w:altName"
)
);
}
...
...
This diff is collapsed.
Click to expand it.
ASCOfficeDocFile/DocDocxConverter/OleObject.h
View file @
0e37afed
...
...
@@ -187,9 +187,16 @@ namespace DocFileFormat
if
(
sz_obj
>
4
)
{
UserType
=
reader
.
ReadLengthPrefixedAnsiString
();
ClipboardFormat
=
reader
.
ReadLengthPrefixedAnsiString
();
Program
=
reader
.
ReadLengthPrefixedAnsiString
();
//todooo сделать по нормальному CompObjHeader - psc3a.doc
//UserType = reader.ReadLengthPrefixedAnsiString();
//sz_obj = reader.GetSize() - reader.GetPosition();
//if (sz_obj > 4)
// ClipboardFormat = reader.ReadLengthPrefixedAnsiString();
//sz_obj = reader.GetSize() - reader.GetPosition();
//if (sz_obj > 4)
// Program = reader.ReadLengthPrefixedAnsiString();
}
delete
pCompStream
;
}
...
...
This diff is collapsed.
Click to expand it.
ASCOfficeDocFile/DocDocxConverter/PictureDescriptor.cpp
View file @
0e37afed
...
...
@@ -46,7 +46,7 @@ namespace DocFileFormat
if
(
lcb
>
10000000
)
return
;
if
(
lcb
>
sz
)
if
(
lcb
>
sz
&&
sz
!=
2
)
//bullet picture
{
unsigned
char
*
bytes
=
reader
.
ReadBytes
(
sz
-
fc
-
4
,
false
);
if
(
bytes
)
...
...
@@ -56,7 +56,7 @@ namespace DocFileFormat
return
;
}
if
(
lcb
>
0
)
if
(
lcb
>
=
1
0
)
{
unsigned
short
cbHeader
=
reader
.
ReadUInt16
();
...
...
This diff is collapsed.
Click to expand it.
ASCOfficeDocFile/DocDocxConverter/StyleSheetMapping.cpp
View file @
0e37afed
...
...
@@ -69,7 +69,7 @@ namespace DocFileFormat
// <w:name val="" />
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"w:name"
),
TRUE
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:val"
),
FormatUtils
::
XmlEncode
(
getStyleName
(
*
iter
)
).
c_str
()
);
m_pXmlWriter
->
WriteAttribute
(
_T
(
"w:val"
),
FormatUtils
::
XmlEncode
(
getStyleName
(
*
iter
)
,
true
).
c_str
()
);
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
""
),
TRUE
);
// <w:basedOn val="" />
...
...
This diff is collapsed.
Click to expand it.
ASCOfficeDocFile/DocDocxConverter/VMLPictureMapping.cpp
View file @
0e37afed
...
...
@@ -140,6 +140,10 @@ namespace DocFileFormat
{
m_pXmlWriter
->
WriteAttribute
(
_T
(
"o:ole"
),
_T
(
""
)
);
}
else
if
(
m_isBulletPicture
)
{
m_pXmlWriter
->
WriteAttribute
(
_T
(
"o:bullet"
),
true
);
}
std
::
list
<
OptionEntry
>::
iterator
end
=
options
.
end
();
for
(
std
::
list
<
OptionEntry
>::
iterator
iter
=
options
.
begin
();
iter
!=
end
;
++
iter
)
...
...
This diff is collapsed.
Click to expand it.
ASCOfficeDocFile/DocDocxConverter/VMLShapeTypeMapping.cpp
View file @
0e37afed
...
...
@@ -41,6 +41,8 @@ namespace DocFileFormat
// Path
if
(
!
pShape
->
Path
.
empty
())
m_pXmlWriter
->
WriteAttribute
(
_T
(
"path"
),
pShape
->
Path
.
c_str
()
);
else
if
(
_isBulletPicture
)
m_pXmlWriter
->
WriteAttribute
(
_T
(
"path"
),
_T
(
"m@4@5l@4@11@9@11@9@5xe"
));
//Default fill / stroke
...
...
@@ -87,6 +89,16 @@ namespace DocFileFormat
m_pXmlWriter
->
WriteNodeEnd
(
_T
(
"v:formulas"
)
);
}
else
if
(
_isBulletPicture
)
{
m_pXmlWriter
->
WriteString
(
_T
(
"<v:formulas><v:f eqn=
\"
if lineDrawn pixelLineWidth 0
\"
/>\
<v:f eqn=
\"
sum @0 1 0
\"
/><v:f eqn=
\"
sum 0 0 @1
\"
/>\
<v:f eqn=
\"
prod @2 1 2
\"
/><v:f eqn=
\"
prod @3 21600 pixelWidth
\"
/>\
<v:f eqn=
\"
prod @3 21600 pixelHeight
\"
/><v:f eqn=
\"
sum @0 0 1
\"
/>\
<v:f eqn=
\"
prod @6 1 2
\"
/><v:f eqn=
\"
prod @7 21600 pixelWidth
\"
/>\
<v:f eqn=
\"
sum @8 21600 0
\"
/><v:f eqn=
\"
prod @7 21600 pixelHeight
\"
/>\
<v:f eqn=
\"
sum @10 21600 0
\"
/></v:formulas>"
));
}
// Path
m_pXmlWriter
->
WriteNodeBegin
(
_T
(
"v:path"
),
true
);
...
...
This diff is collapsed.
Click to expand it.
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