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/.
13 namespace writerfilter
{
15 /// Stores the vertical orientation properties of an RTF fly frame.
19 RTFVertOrient(sal_uInt16 nValue
)
24 sal_uInt16
GetOrient() const
26 return OSL_LONIBBLE(OSL_LOBYTE(nVal
));
29 sal_uInt16
GetRelation() const
31 return OSL_HINIBBLE(OSL_LOBYTE(nVal
));
34 sal_Int32
GetAlign() const
37 switch( GetOrient( ) )
39 case text::VertOrientation::CENTER
:
40 nAlign
= NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_center
;
42 case text::VertOrientation::TOP
:
43 nAlign
= NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_top
;
45 case text::VertOrientation::BOTTOM
:
46 nAlign
= NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_bottom
;
53 sal_Int32
GetAnchor() const
55 sal_Int32 nAnchor
= 0;
56 switch( GetRelation( ) )
58 case text::RelOrientation::FRAME
:
59 nAnchor
= NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_text
;
61 case text::RelOrientation::PAGE_FRAME
:
62 nAnchor
= NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_page
;
64 case text::RelOrientation::PAGE_PRINT_AREA
:
65 nAnchor
= NS_ooxml::LN_Value_wordprocessingml_ST_VAnchor_margin
;
72 sal_uInt16
GetValue() const
81 /// Stores the horizontal orientation properties of an RTF fly frame.
85 RTFHoriOrient(sal_uInt16 nValue
)
90 sal_uInt16
GetOrient() const
92 return OSL_LONIBBLE(OSL_LOBYTE(nVal
));
95 sal_uInt16
GetRelation() const
97 return OSL_LONIBBLE(OSL_HIBYTE(nVal
));
100 sal_uInt16
GetRelAnchor() const
102 return OSL_HINIBBLE(OSL_LOBYTE(nVal
));
105 sal_Int32
GetAlign() const
107 sal_Int32 nAlign
= 0;
108 switch( GetOrient( ) )
110 case text::HoriOrientation::CENTER
:
111 nAlign
= NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_center
;
113 case text::HoriOrientation::RIGHT
:
114 nAlign
= NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_right
;
116 case text::HoriOrientation::LEFT
:
117 nAlign
= NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_left
;
119 case text::HoriOrientation::INSIDE
:
120 nAlign
= NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_inside
;
122 case text::HoriOrientation::OUTSIDE
:
123 nAlign
= NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_outside
;
130 sal_Int32
GetAnchor() const
132 sal_Int32 nAnchor
= 0;
133 switch( GetRelation( ) )
135 case text::RelOrientation::FRAME
:
136 nAnchor
= NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_text
;
138 case text::RelOrientation::PAGE_FRAME
:
139 nAnchor
= NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_page
;
141 case text::RelOrientation::PAGE_PRINT_AREA
:
142 nAnchor
= NS_ooxml::LN_Value_wordprocessingml_ST_HAnchor_margin
;
149 sal_uInt16
GetValue() const
157 } // namespace rtftok
158 } // namespace writerfilter
160 #endif // _RTFFLY_HXX_
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */