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;
36 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
37 aHatch
.Distance
= 150;
41 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
42 aHatch
.Distance
= 200;
46 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
47 aHatch
.Distance
= 175;
51 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
52 aHatch
.Distance
= 150;
56 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
57 aHatch
.Distance
= 125;
61 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
62 aHatch
.Distance
= 150;
66 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
67 aHatch
.Distance
= 125;
71 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
72 aHatch
.Distance
= 100;
76 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
81 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
86 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
87 aHatch
.Distance
= 100;
91 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
92 aHatch
.Distance
= 100;
96 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
101 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
102 aHatch
.Distance
= 50;
106 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
107 aHatch
.Distance
= 25;
111 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
112 aHatch
.Distance
= 25;
116 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
117 aHatch
.Distance
= 50;
121 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
122 aHatch
.Distance
= 50;
126 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
127 aHatch
.Distance
= 150;
131 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
132 aHatch
.Distance
= 150;
136 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
137 aHatch
.Distance
= 100;
141 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
142 aHatch
.Distance
= 100;
146 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
147 aHatch
.Distance
= 100;
151 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
152 aHatch
.Distance
= 50;
156 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
157 aHatch
.Distance
= 50;
161 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
162 aHatch
.Distance
= 50;
166 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
167 aHatch
.Distance
= 50;
171 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
172 aHatch
.Distance
= 100;
176 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
177 aHatch
.Distance
= 100;
181 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
182 aHatch
.Distance
= 150;
186 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
187 aHatch
.Distance
= 150;
191 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
192 aHatch
.Distance
= 100;
196 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
197 aHatch
.Distance
= 50;
201 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
202 aHatch
.Distance
= 100;
206 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
207 aHatch
.Distance
= 50;
211 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
212 aHatch
.Distance
= 100;
216 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
217 aHatch
.Distance
= 400;
221 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
222 aHatch
.Distance
= 200;
226 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
227 aHatch
.Distance
= 100;
231 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
232 aHatch
.Distance
= 300;
236 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
237 aHatch
.Distance
= 300;
241 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
242 aHatch
.Distance
= 100;
246 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
247 aHatch
.Distance
= 100;
251 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
252 aHatch
.Distance
= 300;
256 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
257 aHatch
.Distance
= 200;
261 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
262 aHatch
.Distance
= 100;
266 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
267 aHatch
.Distance
= 150;
271 aHatch
.Style
= drawing::HatchStyle_TRIPLE
;
272 aHatch
.Distance
= 400;
276 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
277 aHatch
.Distance
= 200;
281 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
282 aHatch
.Distance
= 100;
286 aHatch
.Style
= drawing::HatchStyle_DOUBLE
;
287 aHatch
.Distance
= 75;
291 aHatch
.Style
= drawing::HatchStyle_SINGLE
;
292 aHatch
.Distance
= 75;