1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <com/sun/star/drawing/Hatch.hpp>
11 #include <oox/token/tokens.hxx>
13 #include <tools/color.hxx>
15 using namespace com::sun::star
;
18 static drawing::Hatch
createHatch(sal_Int32 nHatchToken
, ::Color nColor
)
20 drawing::Hatch aHatch
;
21 aHatch
.Color
= sal_Int32(nColor
);
22 // best-effort mapping; we do not support all the styles in core
26 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
27 aHatch
.Distance
= 250;
31 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
32 aHatch
.Distance
= 200;
37 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
38 aHatch
.Distance
= 150;
42 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
43 aHatch
.Distance
= 200;
47 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
48 aHatch
.Distance
= 175;
53 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
54 aHatch
.Distance
= 150;
58 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
59 aHatch
.Distance
= 125;
63 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
64 aHatch
.Distance
= 150;
68 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
69 aHatch
.Distance
= 125;
73 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
74 aHatch
.Distance
= 100;
78 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
83 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
89 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
90 aHatch
.Distance
= 100;
94 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
95 aHatch
.Distance
= 100;
100 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
101 aHatch
.Distance
= 50;
106 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
107 aHatch
.Distance
= 50;
111 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
112 aHatch
.Distance
= 25;
116 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
117 aHatch
.Distance
= 25;
121 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
122 aHatch
.Distance
= 150;
126 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
127 aHatch
.Distance
= 150;
132 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
133 aHatch
.Distance
= 100;
138 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
139 aHatch
.Distance
= 100;
144 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
145 aHatch
.Distance
= 100;
150 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
151 aHatch
.Distance
= 50;
156 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
157 aHatch
.Distance
= 50;
161 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
162 aHatch
.Distance
= 150;
166 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
167 aHatch
.Distance
= 100;
171 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
172 aHatch
.Distance
= 50;
176 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
177 aHatch
.Distance
= 100;
181 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
182 aHatch
.Distance
= 50;
186 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
187 aHatch
.Distance
= 400;
191 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
192 aHatch
.Distance
= 200;
196 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
197 aHatch
.Distance
= 100;
201 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
202 aHatch
.Distance
= 300;
207 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
208 aHatch
.Distance
= 300;
212 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
213 aHatch
.Distance
= 100;
217 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
218 aHatch
.Distance
= 100;
222 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
223 aHatch
.Distance
= 200;
227 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
228 aHatch
.Distance
= 100;
232 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
233 aHatch
.Distance
= 400;
237 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
238 aHatch
.Distance
= 200;
242 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
243 aHatch
.Distance
= 75;
247 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
248 aHatch
.Distance
= 75;