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
dce58b62
Commit
dce58b62
authored
Nov 21, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug #36322
parent
bae85402
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
36 deletions
+41
-36
ASCOfficeDocFile/DocDocxConverter/IVisitable.h
ASCOfficeDocFile/DocDocxConverter/IVisitable.h
+2
-0
ASCOfficeDocFile/DocDocxConverter/PropertiesMapping.cpp
ASCOfficeDocFile/DocDocxConverter/PropertiesMapping.cpp
+34
-31
ASCOfficeDocFile/DocDocxConverter/ShadingDescriptor.h
ASCOfficeDocFile/DocDocxConverter/ShadingDescriptor.h
+4
-4
ASCOfficeDocFile/DocDocxConverter/TableCellPropertiesMapping.cpp
...ceDocFile/DocDocxConverter/TableCellPropertiesMapping.cpp
+1
-1
No files found.
ASCOfficeDocFile/DocDocxConverter/IVisitable.h
View file @
dce58b62
...
...
@@ -33,6 +33,8 @@
#include "IMapping.h"
#define GETBITS(from, numL, numH) ((from & (((1 << (numH - numL + 1)) - 1) << numL)) >> numL)
namespace
DocFileFormat
{
class
IVisitable
...
...
ASCOfficeDocFile/DocDocxConverter/PropertiesMapping.cpp
View file @
dce58b62
...
...
@@ -462,57 +462,60 @@ namespace DocFileFormat
void
PropertiesMapping
::
appendShading
(
XMLTools
::
XMLElement
*
parent
,
const
ShadingDescriptor
&
desc
)
{
std
::
wstring
pattern
=
getShadingPattern
(
desc
);
if
(
(
parent
!=
NULL
)
&&
(
desc
.
shadingSpecialValue
==
shadingSpecialValueNormal
))
{
XMLTools
::
XMLElement
shd
(
L"w:shd"
);
//fill color
XMLTools
::
XMLAttribute
fill
(
L"w:fill"
);
//pattern
XMLTools
::
XMLAttribute
val
(
L"w:val"
);
val
.
SetValue
(
pattern
);
shd
.
AppendAttribute
(
val
);
if
(
desc
.
shadingType
==
shadingTypeShd
)
if
(
pattern
!=
L"nil"
)
{
if
(
desc
.
cvBackAuto
)
//fill color
XMLTools
::
XMLAttribute
fill
(
L"w:fill"
);
if
(
desc
.
shadingType
==
shadingTypeShd
)
{
fill
.
SetValue
(
L"auto"
);
if
(
desc
.
cvBackAuto
)
{
fill
.
SetValue
(
L"auto"
);
}
else
{
fill
.
SetValue
(
RGBColor
(
(
int
)
desc
.
cvBack
,
RedLast
).
SixDigitHexCode
);
}
}
else
{
fill
.
SetValue
(
RGBColor
(
(
int
)
desc
.
cvBack
,
RedLast
).
SixDigitHexCode
);
fill
.
SetValue
(
FormatUtils
::
MapValueToWideString
(
desc
.
icoBack
,
&
Global
::
ColorIdentifier
[
0
][
0
],
17
,
12
)
);
}
}
else
{
fill
.
SetValue
(
FormatUtils
::
MapValueToWideString
(
desc
.
icoBack
,
&
Global
::
ColorIdentifier
[
0
][
0
],
17
,
12
));
}
shd
.
AppendAttribute
(
fill
);
shd
.
AppendAttribute
(
fill
);
//foreground color
XMLTools
::
XMLAttribute
color
(
L"w:color"
);
//foreground color
XMLTools
::
XMLAttribute
color
(
L"w:color"
);
if
(
desc
.
shadingType
==
shadingTypeShd
)
{
if
(
desc
.
cvForeAuto
)
if
(
desc
.
shadingType
==
shadingTypeShd
)
{
color
.
SetValue
(
L"auto"
);
if
(
desc
.
cvForeAuto
)
{
color
.
SetValue
(
L"auto"
);
}
else
{
color
.
SetValue
(
RGBColor
(
(
int
)
desc
.
cvFore
,
RedLast
).
SixDigitHexCode
);
}
}
else
{
color
.
SetValue
(
RGBColor
(
(
int
)
desc
.
cvFore
,
RedLast
).
SixDigitHexCode
);
color
.
SetValue
(
FormatUtils
::
MapValueToWideString
(
desc
.
icoFore
,
&
Global
::
ColorIdentifier
[
0
][
0
],
17
,
12
)
);
}
}
else
{
color
.
SetValue
(
FormatUtils
::
MapValueToWideString
(
desc
.
icoFore
,
&
Global
::
ColorIdentifier
[
0
][
0
],
17
,
12
));
}
shd
.
AppendAttribute
(
color
);
//pattern
XMLTools
::
XMLAttribute
val
(
L"w:val"
);
val
.
SetValue
(
getShadingPattern
(
desc
));
shd
.
AppendAttribute
(
val
);
shd
.
AppendAttribute
(
color
);
}
parent
->
RemoveChildByName
(
L"w:shd"
);
parent
->
AppendChild
(
shd
);
}
...
...
ASCOfficeDocFile/DocDocxConverter/ShadingDescriptor.h
View file @
dce58b62
...
...
@@ -174,9 +174,9 @@ namespace DocFileFormat
//it's a Word 97 SPRM
short
val
=
FormatUtils
::
BytesToInt16
(
bytes
,
0
,
size
);
icoFore
=
(
val
&
0x1F
);
icoBack
=
((
val
>>
5
)
&
0x1F
);
ipat
=
(
ShadingPattern
)
((
val
>>
10
)
&
0x3F
);
icoFore
=
GETBITS
(
val
,
0
,
4
);
icoBack
=
GETBITS
(
val
,
5
,
9
);
ipat
=
(
ShadingPattern
)
GETBITS
(
val
,
10
,
15
);
shadingType
=
shadingTypeShd80
;
...
...
@@ -209,7 +209,7 @@ namespace DocFileFormat
else
if
(
0x0F
==
icoFore
)
{
cvFore
=
RGB2
(
0x80
,
0x80
,
0x80
);
}
else
if
(
0x10
==
icoFore
)
{
cvFore
=
RGB2
(
0xC0
,
0xC0
,
0xC0
);
}
if
(
0x00
==
icoBack
)
{
cvBack
=
RGB2
(
0x
00
,
0x00
,
0x00
);
cvBackAuto
=
true
;
}
if
(
0x00
==
icoBack
)
{
cvBack
=
RGB2
(
0x
FF
,
0xFF
,
0xFF
);
cvBackAuto
=
true
;
}
else
if
(
0x01
==
icoBack
)
{
cvBack
=
RGB2
(
0x00
,
0x00
,
0x00
);
}
else
if
(
0x02
==
icoBack
)
{
cvBack
=
RGB2
(
0x00
,
0x00
,
0xFF
);
}
else
if
(
0x03
==
icoBack
)
{
cvBack
=
RGB2
(
0x00
,
0xFF
,
0xFF
);
}
...
...
ASCOfficeDocFile/DocDocxConverter/TableCellPropertiesMapping.cpp
View file @
dce58b62
...
...
@@ -349,7 +349,7 @@ namespace DocFileFormat
void
TableCellPropertiesMapping
::
apppendCellShading
(
unsigned
char
*
sprmArg
,
int
size
,
int
cellIndex
)
{
if
(
sprmArg
)
if
(
sprmArg
&&
cellIndex
>=
0
)
{
//shading descriptor can have 10 bytes (Word 2000) or 2 bytes (Word 97)
int
shdLength
=
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