Avoid potential negative array index access to cached text.
[LibreOffice.git] / include / oox / ole / axfontdata.hxx
blobdf350324716192446b51d26a20faa363e8508f1a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_OOX_OLE_AXFONTDATA_HXX
21 #define INCLUDED_OOX_OLE_AXFONTDATA_HXX
23 #include <oox/dllapi.h>
24 #include <rtl/ustring.hxx>
25 #include <sal/types.h>
26 #include <o3tl/typed_flags_set.hxx>
28 namespace oox {
29 class BinaryInputStream;
30 class BinaryOutputStream;
33 enum class AxFontFlags {
34 NONE = 0x00000000,
35 Bold = 0x00000001,
36 Italic = 0x00000002,
37 Underline = 0x00000004,
38 Strikeout = 0x00000008,
39 Disabled = 0x00002000,
40 AutoColor = 0x40000000,
42 namespace o3tl {
43 template<> struct typed_flags<AxFontFlags> : is_typed_flags<AxFontFlags, 0x4000200f> {};
46 namespace oox::ole {
48 enum class AxHorizontalAlign {
49 Left = 1, Right = 2, Center = 3
52 /** All entries of a font property. */
53 struct OOX_DLLPUBLIC AxFontData
55 OUString maFontName; ///< Name of the used font.
56 AxFontFlags mnFontEffects; ///< Font effect flags.
57 sal_Int32 mnFontHeight; ///< Height of the font (not really twips, see code).
58 sal_Int32 mnFontCharSet; ///< Windows character set of the font.
59 AxHorizontalAlign mnHorAlign; ///< Horizontal text alignment.
60 bool mbDblUnderline; ///< True = double underline style (legacy VML drawing controls only).
62 explicit AxFontData();
64 /** Converts the internal representation of the font height to points. */
65 sal_Int16 getHeightPoints() const;
66 /** Converts the passed font height from points to the internal representation. */
67 void setHeightPoints( sal_Int16 nPoints );
69 /** Reads the font data settings from the passed input stream. */
70 bool importBinaryModel( BinaryInputStream& rInStrm );
72 void exportBinaryModel( BinaryOutputStream& rOutStrm );
73 /** Reads the font data settings from the passed input stream that contains
74 an OLE StdFont structure. */
75 bool importStdFont( BinaryInputStream& rInStrm );
76 /** Reads the font data settings from the passed input stream depending on
77 the GUID preceding the actual font data. */
78 bool importGuidAndFont( BinaryInputStream& rInStrm );
82 } // namespace oox::ole
84 #endif
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */