xref: /AOO41X/main/drawinglayer/source/primitive2d/textenumsprimitive2d.cxx (revision 464702f4578bd67db020a330afd07883930c5e07)
1*464702f4SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*464702f4SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*464702f4SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*464702f4SAndrew Rist  * distributed with this work for additional information
6*464702f4SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*464702f4SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*464702f4SAndrew Rist  * "License"); you may not use this file except in compliance
9*464702f4SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*464702f4SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*464702f4SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*464702f4SAndrew Rist  * software distributed under the License is distributed on an
15*464702f4SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*464702f4SAndrew Rist  * KIND, either express or implied.  See the License for the
17*464702f4SAndrew Rist  * specific language governing permissions and limitations
18*464702f4SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*464702f4SAndrew Rist  *************************************************************/
21*464702f4SAndrew Rist 
22*464702f4SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_drawinglayer.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
30cdf0e10cSrcweir 
31cdf0e10cSrcweir namespace drawinglayer
32cdf0e10cSrcweir {
33cdf0e10cSrcweir 	namespace primitive2d
34cdf0e10cSrcweir 	{
mapFontUnderlineToTextLine(FontUnderline eLineStyle)35cdf0e10cSrcweir 		TextLine mapFontUnderlineToTextLine(FontUnderline eLineStyle)
36cdf0e10cSrcweir 		{
37cdf0e10cSrcweir 			switch(eLineStyle)
38cdf0e10cSrcweir 			{
39cdf0e10cSrcweir 				case UNDERLINE_SINGLE:          return TEXT_LINE_SINGLE;
40cdf0e10cSrcweir 				case UNDERLINE_DOUBLE:          return TEXT_LINE_DOUBLE;
41cdf0e10cSrcweir 				case UNDERLINE_DOTTED:          return TEXT_LINE_DOTTED;
42cdf0e10cSrcweir 				case UNDERLINE_DASH:            return TEXT_LINE_DASH;
43cdf0e10cSrcweir 				case UNDERLINE_LONGDASH:        return TEXT_LINE_LONGDASH;
44cdf0e10cSrcweir 				case UNDERLINE_DASHDOT:         return TEXT_LINE_DASHDOT;
45cdf0e10cSrcweir 				case UNDERLINE_DASHDOTDOT:      return TEXT_LINE_DASHDOTDOT;
46cdf0e10cSrcweir 				case UNDERLINE_SMALLWAVE:       return TEXT_LINE_SMALLWAVE;
47cdf0e10cSrcweir 				case UNDERLINE_WAVE:            return TEXT_LINE_WAVE;
48cdf0e10cSrcweir 				case UNDERLINE_DOUBLEWAVE:      return TEXT_LINE_DOUBLEWAVE;
49cdf0e10cSrcweir 				case UNDERLINE_BOLD:            return TEXT_LINE_BOLD;
50cdf0e10cSrcweir 				case UNDERLINE_BOLDDOTTED:      return TEXT_LINE_BOLDDOTTED;
51cdf0e10cSrcweir 				case UNDERLINE_BOLDDASH:        return TEXT_LINE_BOLDDASH;
52cdf0e10cSrcweir 				case UNDERLINE_BOLDLONGDASH:    return TEXT_LINE_BOLDLONGDASH;
53cdf0e10cSrcweir 				case UNDERLINE_BOLDDASHDOT:     return TEXT_LINE_BOLDDASHDOT;
54cdf0e10cSrcweir 				case UNDERLINE_BOLDDASHDOTDOT:  return TEXT_LINE_BOLDDASHDOTDOT;
55cdf0e10cSrcweir 				case UNDERLINE_BOLDWAVE:        return TEXT_LINE_BOLDWAVE;
56cdf0e10cSrcweir 				// FontUnderline_FORCE_EQUAL_SIZE, UNDERLINE_DONTKNOW, UNDERLINE_NONE
57cdf0e10cSrcweir 				default:                        return TEXT_LINE_NONE;
58cdf0e10cSrcweir 			}
59cdf0e10cSrcweir 		}
60cdf0e10cSrcweir 
mapTextLineToFontUnderline(TextLine eLineStyle)61cdf0e10cSrcweir 		FontUnderline mapTextLineToFontUnderline(TextLine eLineStyle)
62cdf0e10cSrcweir 		{
63cdf0e10cSrcweir             switch(eLineStyle)
64cdf0e10cSrcweir             {
65cdf0e10cSrcweir 				default: /*TEXT_LINE_NONE*/   return UNDERLINE_NONE;
66cdf0e10cSrcweir                 case TEXT_LINE_SINGLE:        return UNDERLINE_SINGLE;
67cdf0e10cSrcweir                 case TEXT_LINE_DOUBLE:        return UNDERLINE_DOUBLE;
68cdf0e10cSrcweir                 case TEXT_LINE_DOTTED:        return UNDERLINE_DOTTED;
69cdf0e10cSrcweir                 case TEXT_LINE_DASH:          return UNDERLINE_DASH;
70cdf0e10cSrcweir                 case TEXT_LINE_LONGDASH:      return UNDERLINE_LONGDASH;
71cdf0e10cSrcweir                 case TEXT_LINE_DASHDOT:       return UNDERLINE_DASHDOT;
72cdf0e10cSrcweir                 case TEXT_LINE_DASHDOTDOT:    return UNDERLINE_DASHDOTDOT;
73cdf0e10cSrcweir                 case TEXT_LINE_SMALLWAVE:     return UNDERLINE_SMALLWAVE;
74cdf0e10cSrcweir                 case TEXT_LINE_WAVE:          return UNDERLINE_WAVE;
75cdf0e10cSrcweir                 case TEXT_LINE_DOUBLEWAVE:    return UNDERLINE_DOUBLEWAVE;
76cdf0e10cSrcweir                 case TEXT_LINE_BOLD:          return UNDERLINE_BOLD;
77cdf0e10cSrcweir                 case TEXT_LINE_BOLDDOTTED:    return UNDERLINE_BOLDDOTTED;
78cdf0e10cSrcweir                 case TEXT_LINE_BOLDDASH:      return UNDERLINE_BOLDDASH;
79cdf0e10cSrcweir                 case TEXT_LINE_BOLDLONGDASH:  return UNDERLINE_LONGDASH;
80cdf0e10cSrcweir                 case TEXT_LINE_BOLDDASHDOT:   return UNDERLINE_BOLDDASHDOT;
81cdf0e10cSrcweir                 case TEXT_LINE_BOLDDASHDOTDOT:return UNDERLINE_BOLDDASHDOT;
82cdf0e10cSrcweir                 case TEXT_LINE_BOLDWAVE:      return UNDERLINE_BOLDWAVE;
83cdf0e10cSrcweir             }
84cdf0e10cSrcweir 		}
85cdf0e10cSrcweir 
mapFontStrikeoutToTextStrikeout(FontStrikeout eFontStrikeout)86cdf0e10cSrcweir 		TextStrikeout mapFontStrikeoutToTextStrikeout(FontStrikeout eFontStrikeout)
87cdf0e10cSrcweir 		{
88cdf0e10cSrcweir 			switch(eFontStrikeout)
89cdf0e10cSrcweir 			{
90cdf0e10cSrcweir 				case STRIKEOUT_SINGLE:	return TEXT_STRIKEOUT_SINGLE;
91cdf0e10cSrcweir 				case STRIKEOUT_DOUBLE:	return TEXT_STRIKEOUT_DOUBLE;
92cdf0e10cSrcweir 				case STRIKEOUT_BOLD:	return TEXT_STRIKEOUT_BOLD;
93cdf0e10cSrcweir 				case STRIKEOUT_SLASH:	return TEXT_STRIKEOUT_SLASH;
94cdf0e10cSrcweir 				case STRIKEOUT_X:		return TEXT_STRIKEOUT_X;
95cdf0e10cSrcweir 				// FontStrikeout_FORCE_EQUAL_SIZE, STRIKEOUT_NONE, STRIKEOUT_DONTKNOW
96cdf0e10cSrcweir 				default:				return TEXT_STRIKEOUT_NONE;
97cdf0e10cSrcweir 			}
98cdf0e10cSrcweir 		}
99cdf0e10cSrcweir 
mapTextStrikeoutToFontStrikeout(TextStrikeout eTextStrikeout)100cdf0e10cSrcweir 		FontStrikeout mapTextStrikeoutToFontStrikeout(TextStrikeout eTextStrikeout)
101cdf0e10cSrcweir 		{
102cdf0e10cSrcweir 			switch(eTextStrikeout)
103cdf0e10cSrcweir 			{
104cdf0e10cSrcweir 				default: /*case primitive2d::TEXT_STRIKEOUT_NONE*/	return STRIKEOUT_NONE;
105cdf0e10cSrcweir 				case TEXT_STRIKEOUT_SINGLE:		return STRIKEOUT_SINGLE;
106cdf0e10cSrcweir 				case TEXT_STRIKEOUT_DOUBLE:		return STRIKEOUT_DOUBLE;
107cdf0e10cSrcweir 				case TEXT_STRIKEOUT_BOLD:		return STRIKEOUT_BOLD;
108cdf0e10cSrcweir 				case TEXT_STRIKEOUT_SLASH:		return STRIKEOUT_SLASH;
109cdf0e10cSrcweir 				case TEXT_STRIKEOUT_X:			return STRIKEOUT_X;
110cdf0e10cSrcweir 			}
111cdf0e10cSrcweir 		}
112cdf0e10cSrcweir 
113cdf0e10cSrcweir 	} // end of namespace primitive2d
114cdf0e10cSrcweir } // end of namespace drawinglayer
115cdf0e10cSrcweir 
116cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
117cdf0e10cSrcweir // eof
118