1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 // MARKER(update_precomp.py): autogen include statement, do not remove 29 #include "precompiled_drawinglayer.hxx" 30 31 #include <drawinglayer/primitive2d/textenumsprimitive2d.hxx> 32 33 ////////////////////////////////////////////////////////////////////////////// 34 35 namespace drawinglayer 36 { 37 namespace primitive2d 38 { 39 TextLine mapFontUnderlineToTextLine(FontUnderline eLineStyle) 40 { 41 switch(eLineStyle) 42 { 43 case UNDERLINE_SINGLE: return TEXT_LINE_SINGLE; 44 case UNDERLINE_DOUBLE: return TEXT_LINE_DOUBLE; 45 case UNDERLINE_DOTTED: return TEXT_LINE_DOTTED; 46 case UNDERLINE_DASH: return TEXT_LINE_DASH; 47 case UNDERLINE_LONGDASH: return TEXT_LINE_LONGDASH; 48 case UNDERLINE_DASHDOT: return TEXT_LINE_DASHDOT; 49 case UNDERLINE_DASHDOTDOT: return TEXT_LINE_DASHDOTDOT; 50 case UNDERLINE_SMALLWAVE: return TEXT_LINE_SMALLWAVE; 51 case UNDERLINE_WAVE: return TEXT_LINE_WAVE; 52 case UNDERLINE_DOUBLEWAVE: return TEXT_LINE_DOUBLEWAVE; 53 case UNDERLINE_BOLD: return TEXT_LINE_BOLD; 54 case UNDERLINE_BOLDDOTTED: return TEXT_LINE_BOLDDOTTED; 55 case UNDERLINE_BOLDDASH: return TEXT_LINE_BOLDDASH; 56 case UNDERLINE_BOLDLONGDASH: return TEXT_LINE_BOLDLONGDASH; 57 case UNDERLINE_BOLDDASHDOT: return TEXT_LINE_BOLDDASHDOT; 58 case UNDERLINE_BOLDDASHDOTDOT: return TEXT_LINE_BOLDDASHDOTDOT; 59 case UNDERLINE_BOLDWAVE: return TEXT_LINE_BOLDWAVE; 60 // FontUnderline_FORCE_EQUAL_SIZE, UNDERLINE_DONTKNOW, UNDERLINE_NONE 61 default: return TEXT_LINE_NONE; 62 } 63 } 64 65 FontUnderline mapTextLineToFontUnderline(TextLine eLineStyle) 66 { 67 switch(eLineStyle) 68 { 69 default: /*TEXT_LINE_NONE*/ return UNDERLINE_NONE; 70 case TEXT_LINE_SINGLE: return UNDERLINE_SINGLE; 71 case TEXT_LINE_DOUBLE: return UNDERLINE_DOUBLE; 72 case TEXT_LINE_DOTTED: return UNDERLINE_DOTTED; 73 case TEXT_LINE_DASH: return UNDERLINE_DASH; 74 case TEXT_LINE_LONGDASH: return UNDERLINE_LONGDASH; 75 case TEXT_LINE_DASHDOT: return UNDERLINE_DASHDOT; 76 case TEXT_LINE_DASHDOTDOT: return UNDERLINE_DASHDOTDOT; 77 case TEXT_LINE_SMALLWAVE: return UNDERLINE_SMALLWAVE; 78 case TEXT_LINE_WAVE: return UNDERLINE_WAVE; 79 case TEXT_LINE_DOUBLEWAVE: return UNDERLINE_DOUBLEWAVE; 80 case TEXT_LINE_BOLD: return UNDERLINE_BOLD; 81 case TEXT_LINE_BOLDDOTTED: return UNDERLINE_BOLDDOTTED; 82 case TEXT_LINE_BOLDDASH: return UNDERLINE_BOLDDASH; 83 case TEXT_LINE_BOLDLONGDASH: return UNDERLINE_LONGDASH; 84 case TEXT_LINE_BOLDDASHDOT: return UNDERLINE_BOLDDASHDOT; 85 case TEXT_LINE_BOLDDASHDOTDOT:return UNDERLINE_BOLDDASHDOT; 86 case TEXT_LINE_BOLDWAVE: return UNDERLINE_BOLDWAVE; 87 } 88 } 89 90 TextStrikeout mapFontStrikeoutToTextStrikeout(FontStrikeout eFontStrikeout) 91 { 92 switch(eFontStrikeout) 93 { 94 case STRIKEOUT_SINGLE: return TEXT_STRIKEOUT_SINGLE; 95 case STRIKEOUT_DOUBLE: return TEXT_STRIKEOUT_DOUBLE; 96 case STRIKEOUT_BOLD: return TEXT_STRIKEOUT_BOLD; 97 case STRIKEOUT_SLASH: return TEXT_STRIKEOUT_SLASH; 98 case STRIKEOUT_X: return TEXT_STRIKEOUT_X; 99 // FontStrikeout_FORCE_EQUAL_SIZE, STRIKEOUT_NONE, STRIKEOUT_DONTKNOW 100 default: return TEXT_STRIKEOUT_NONE; 101 } 102 } 103 104 FontStrikeout mapTextStrikeoutToFontStrikeout(TextStrikeout eTextStrikeout) 105 { 106 switch(eTextStrikeout) 107 { 108 default: /*case primitive2d::TEXT_STRIKEOUT_NONE*/ return STRIKEOUT_NONE; 109 case TEXT_STRIKEOUT_SINGLE: return STRIKEOUT_SINGLE; 110 case TEXT_STRIKEOUT_DOUBLE: return STRIKEOUT_DOUBLE; 111 case TEXT_STRIKEOUT_BOLD: return STRIKEOUT_BOLD; 112 case TEXT_STRIKEOUT_SLASH: return STRIKEOUT_SLASH; 113 case TEXT_STRIKEOUT_X: return STRIKEOUT_X; 114 } 115 } 116 117 } // end of namespace primitive2d 118 } // end of namespace drawinglayer 119 120 ////////////////////////////////////////////////////////////////////////////// 121 // eof 122