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
9e1773df
Commit
9e1773df
authored
Apr 27, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used ClrMap in docx settings
parent
39e41405
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
35 deletions
+58
-35
ASCOfficeDocxFile2/BinWriter/BinWriters.h
ASCOfficeDocxFile2/BinWriter/BinWriters.h
+39
-25
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
+9
-1
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.h
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.h
+1
-0
ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp
ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp
+1
-1
ASCOfficePPTXFile/PPTXFormat/Logic/ClrMap.h
ASCOfficePPTXFile/PPTXFormat/Logic/ClrMap.h
+1
-1
ASCOfficePPTXFile/PPTXFormat/Logic/Colors/ColorBase.h
ASCOfficePPTXFile/PPTXFormat/Logic/Colors/ColorBase.h
+7
-7
No files found.
ASCOfficeDocxFile2/BinWriter/BinWriters.h
View file @
9e1773df
...
...
@@ -7194,80 +7194,94 @@ namespace BinDocxRW
}
}
}
void
WriteColorSchemeMapping
(
const
OOX
::
Settings
::
CColorSchemeMapping
&
oColorSchemeMapping
)
void
WriteColorSchemeMapping
(
const
PPTX
::
Logic
::
ClrMap
&
oColorSchemeMapping
)
{
int
nCurPos
=
0
;
if
(
oColorSchemeMapping
.
m_oAccent1
.
IsInit
())
std
::
map
<
std
::
wstring
,
PPTX
::
Limit
::
ColorSchemeIndex
>::
const_iterator
pFind
;
pFind
=
oColorSchemeMapping
.
ColorMap
.
find
(
L"accent1"
);
if
(
pFind
!=
oColorSchemeMapping
.
ColorMap
.
end
())
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ClrSchemeMappingType
::
Accent1
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Byte
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
oColorSchemeMapping
.
m_oAccent1
->
GetValu
e
());
m_oBcw
.
m_oStream
.
WriteBYTE
(
pFind
->
second
.
GetBYTECod
e
());
}
if
(
oColorSchemeMapping
.
m_oAccent2
.
IsInit
())
pFind
=
oColorSchemeMapping
.
ColorMap
.
find
(
L"accent2"
);
if
(
pFind
!=
oColorSchemeMapping
.
ColorMap
.
end
())
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ClrSchemeMappingType
::
Accent2
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Byte
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
oColorSchemeMapping
.
m_oAccent2
->
GetValu
e
());
m_oBcw
.
m_oStream
.
WriteBYTE
(
pFind
->
second
.
GetBYTECod
e
());
}
if
(
oColorSchemeMapping
.
m_oAccent3
.
IsInit
())
pFind
=
oColorSchemeMapping
.
ColorMap
.
find
(
L"accent3"
);
if
(
pFind
!=
oColorSchemeMapping
.
ColorMap
.
end
())
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ClrSchemeMappingType
::
Accent3
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Byte
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
oColorSchemeMapping
.
m_oAccent3
->
GetValu
e
());
m_oBcw
.
m_oStream
.
WriteBYTE
(
pFind
->
second
.
GetBYTECod
e
());
}
if
(
oColorSchemeMapping
.
m_oAccent4
.
IsInit
())
pFind
=
oColorSchemeMapping
.
ColorMap
.
find
(
L"accent4"
);
if
(
pFind
!=
oColorSchemeMapping
.
ColorMap
.
end
())
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ClrSchemeMappingType
::
Accent4
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Byte
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
oColorSchemeMapping
.
m_oAccent4
->
GetValu
e
());
m_oBcw
.
m_oStream
.
WriteBYTE
(
pFind
->
second
.
GetBYTECod
e
());
}
if
(
oColorSchemeMapping
.
m_oAccent5
.
IsInit
())
pFind
=
oColorSchemeMapping
.
ColorMap
.
find
(
L"accent5"
);
if
(
pFind
!=
oColorSchemeMapping
.
ColorMap
.
end
())
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ClrSchemeMappingType
::
Accent5
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Byte
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
oColorSchemeMapping
.
m_oAccent5
->
GetValu
e
());
m_oBcw
.
m_oStream
.
WriteBYTE
(
pFind
->
second
.
GetBYTECod
e
());
}
if
(
oColorSchemeMapping
.
m_oAccent6
.
IsInit
())
pFind
=
oColorSchemeMapping
.
ColorMap
.
find
(
L"accent6"
);
if
(
pFind
!=
oColorSchemeMapping
.
ColorMap
.
end
())
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ClrSchemeMappingType
::
Accent6
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Byte
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
oColorSchemeMapping
.
m_oAccent6
->
GetValu
e
());
m_oBcw
.
m_oStream
.
WriteBYTE
(
pFind
->
second
.
GetBYTECod
e
());
}
if
(
oColorSchemeMapping
.
m_oBg1
.
IsInit
())
pFind
=
oColorSchemeMapping
.
ColorMap
.
find
(
L"bg1"
);
if
(
pFind
!=
oColorSchemeMapping
.
ColorMap
.
end
())
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ClrSchemeMappingType
::
Bg1
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Byte
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
oColorSchemeMapping
.
m_oBg1
->
GetValu
e
());
m_oBcw
.
m_oStream
.
WriteBYTE
(
pFind
->
second
.
GetBYTECod
e
());
}
if
(
oColorSchemeMapping
.
m_oBg2
.
IsInit
())
pFind
=
oColorSchemeMapping
.
ColorMap
.
find
(
L"bg2"
);
if
(
pFind
!=
oColorSchemeMapping
.
ColorMap
.
end
())
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ClrSchemeMappingType
::
Bg2
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Byte
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
oColorSchemeMapping
.
m_oBg2
->
GetValu
e
());
m_oBcw
.
m_oStream
.
WriteBYTE
(
pFind
->
second
.
GetBYTECod
e
());
}
if
(
oColorSchemeMapping
.
m_oFollowedHyperlink
.
IsInit
())
pFind
=
oColorSchemeMapping
.
ColorMap
.
find
(
L"folHlink"
);
if
(
pFind
!=
oColorSchemeMapping
.
ColorMap
.
end
())
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ClrSchemeMappingType
::
FollowedHyperlink
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Byte
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
oColorSchemeMapping
.
m_oFollowedHyperlink
->
GetValu
e
());
m_oBcw
.
m_oStream
.
WriteBYTE
(
pFind
->
second
.
GetBYTECod
e
());
}
if
(
oColorSchemeMapping
.
m_oHyperlink
.
IsInit
())
pFind
=
oColorSchemeMapping
.
ColorMap
.
find
(
L"hlink"
);
if
(
pFind
!=
oColorSchemeMapping
.
ColorMap
.
end
())
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ClrSchemeMappingType
::
Hyperlink
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Byte
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
oColorSchemeMapping
.
m_oHyperlink
->
GetValu
e
());
m_oBcw
.
m_oStream
.
WriteBYTE
(
pFind
->
second
.
GetBYTECod
e
());
}
if
(
oColorSchemeMapping
.
m_oT1
.
IsInit
())
pFind
=
oColorSchemeMapping
.
ColorMap
.
find
(
L"tx1"
);
if
(
pFind
!=
oColorSchemeMapping
.
ColorMap
.
end
())
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ClrSchemeMappingType
::
T1
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Byte
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
oColorSchemeMapping
.
m_oT1
->
GetValu
e
());
m_oBcw
.
m_oStream
.
WriteBYTE
(
pFind
->
second
.
GetBYTECod
e
());
}
if
(
oColorSchemeMapping
.
m_oT2
.
IsInit
())
pFind
=
oColorSchemeMapping
.
ColorMap
.
find
(
L"tx2"
);
if
(
pFind
!=
oColorSchemeMapping
.
ColorMap
.
end
())
{
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSer_ClrSchemeMappingType
::
T2
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
c_oSerPropLenType
::
Byte
);
m_oBcw
.
m_oStream
.
WriteBYTE
(
oColorSchemeMapping
.
m_oT2
->
GetValu
e
());
m_oBcw
.
m_oStream
.
WriteBYTE
(
pFind
->
second
.
GetBYTECod
e
());
}
};
};
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
View file @
9e1773df
...
...
@@ -2809,11 +2809,19 @@ void DocxConverter::convert(ComplexTypes::Word::CColor *color, _CP_OPT(odf_types
if
(
!
color
)
return
;
convert
(
color
->
m_oVal
.
GetPointer
(),
color
->
m_oThemeColor
.
GetPointer
(),
color
->
m_oThemeTint
.
GetPointer
(),
color
->
m_oThemeShade
.
GetPointer
(),
odf_color
);
}
PPTX
::
Logic
::
ClrMap
*
DocxConverter
::
oox_clrMap
()
{
//return current_clrMap; todoooo
OOX
::
CSettings
*
docx_settings
=
docx_document
->
GetSettings
();
if
(
!
docx_settings
)
return
NULL
;
return
docx_settings
->
m_oClrSchemeMapping
.
GetPointer
();
}
void
DocxConverter
::
convert_settings
()
{
if
(
!
odt_context
)
return
;
OOX
::
CSettings
*
docx_settings
=
docx_document
->
GetSettings
();
OOX
::
CSettings
*
docx_settings
=
docx_document
->
GetSettings
();
if
(
!
docx_settings
)
return
;
if
(
docx_settings
->
m_oZoom
.
IsInit
())
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.h
View file @
9e1773df
...
...
@@ -150,6 +150,7 @@ namespace Oox2Odf
virtual
OOX
::
IFileContainer
*
current_document
();
virtual
odf_writer
::
odf_conversion_context
*
odf_context
();
virtual
PPTX
::
Theme
*
oox_theme
();
virtual
PPTX
::
Logic
::
ClrMap
*
oox_clrMap
();
virtual
std
::
wstring
find_link_by_id
(
std
::
wstring
sId
,
int
t
);
virtual
NSCommon
::
smart_ptr
<
OOX
::
File
>
find_file_by_id
(
std
::
wstring
sId
);
...
...
ASCOfficePPTXFile/ASCOfficeDrawingConverter.cpp
View file @
9e1773df
...
...
@@ -4309,7 +4309,7 @@ HRESULT CDrawingConverter::LoadClrMap(const std::wstring& bsXml)
if
(
oNode
.
IsValid
())
{
pClrMap
->
fromXML
W
(
oNode
.
ReadNode
(
L"w:clrSchemeMapping"
));
pClrMap
->
fromXML
(
oNode
.
ReadNode
(
L"w:clrSchemeMapping"
));
}
*
m_pClrMap
=
pClrMap
;
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/ClrMap.h
View file @
9e1773df
...
...
@@ -245,7 +245,7 @@ namespace PPTX
std
::
map
<
std
::
wstring
,
Limit
::
ColorSchemeIndex
>
ColorMap
;
std
::
wstring
m_name
;
std
::
wstring
m_name
;
protected:
virtual
void
FillParentPointersForChilds
(){};
};
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Colors/ColorBase.h
View file @
9e1773df
...
...
@@ -496,13 +496,13 @@ namespace PPTX
static
void
HSL2RGB
(
unsigned
char
*
HSL
,
unsigned
char
*
RGB
)
{
if
(
HSL
[
1
]
==
0
)
{
RGB
[
0
]
=
HSL
[
2
];
RGB
[
1
]
=
HSL
[
2
];
RGB
[
2
]
=
HSL
[
2
];
}
else
//
if ( HSL[1] == 0 )
//
{
//
RGB[0] = HSL[2];
//
RGB[1] = HSL[2];
//
RGB[2] = HSL[2];
//
}
//
else
{
double
H
=
double
(
HSL
[
0
])
/
240.0
;
double
S
=
double
(
HSL
[
1
])
/
240.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