25#include <com/sun/star/uno/Any.hxx>
26#include <rtl/ustrbuf.hxx>
34 {
XML_LEFT, style::GraphicLocation_LEFT_MIDDLE },
35 {
XML_RIGHT, style::GraphicLocation_RIGHT_MIDDLE },
41 {
XML_TOP, style::GraphicLocation_MIDDLE_TOP },
42 {
XML_BOTTOM, style::GraphicLocation_MIDDLE_BOTTOM },
57 style::GraphicLocation
ePos = style::GraphicLocation_NONE, eTmp;
58 style::GraphicLocation nTmpGraphicLocation;
60 std::u16string_view aToken;
61 bool bHori =
false, bVert =
false;
69 else if( std::u16string_view::npos != aToken.find(
'%' ) )
76 ePos = nPrc < 25 ? style::GraphicLocation_LEFT_TOP :
77 (nPrc < 75 ? style::GraphicLocation_MIDDLE_MIDDLE :
78 style::GraphicLocation_RIGHT_BOTTOM);
83 eTmp = nPrc < 25 ? style::GraphicLocation_LEFT_TOP:
84 (nPrc < 75 ? style::GraphicLocation_LEFT_MIDDLE :
85 style::GraphicLocation_LEFT_BOTTOM);
103 ePos = style::GraphicLocation_MIDDLE_MIDDLE;
110 ePos = nTmpGraphicLocation;
121 ePos = nTmpGraphicLocation;
132 bRet &= style::GraphicLocation_NONE !=
ePos;
134 rValue <<= static_cast<style::GraphicLocation>(
static_cast<sal_uInt16
>(
ePos));
144 style::GraphicLocation eLocation;
145 if( !( rValue >>= eLocation ) )
149 eLocation =
static_cast<style::GraphicLocation
>(
nValue);
160 case style::GraphicLocation_LEFT_TOP:
161 case style::GraphicLocation_MIDDLE_TOP:
162 case style::GraphicLocation_RIGHT_TOP:
166 case style::GraphicLocation_LEFT_MIDDLE:
167 case style::GraphicLocation_MIDDLE_MIDDLE:
168 case style::GraphicLocation_RIGHT_MIDDLE:
172 case style::GraphicLocation_LEFT_BOTTOM:
173 case style::GraphicLocation_MIDDLE_BOTTOM:
174 case style::GraphicLocation_RIGHT_BOTTOM:
188 case style::GraphicLocation_LEFT_TOP:
189 case style::GraphicLocation_LEFT_BOTTOM:
190 case style::GraphicLocation_LEFT_MIDDLE:
193 case style::GraphicLocation_MIDDLE_TOP:
194 case style::GraphicLocation_MIDDLE_MIDDLE:
195 case style::GraphicLocation_MIDDLE_BOTTOM:
198 case style::GraphicLocation_RIGHT_MIDDLE:
199 case style::GraphicLocation_RIGHT_TOP:
200 case style::GraphicLocation_RIGHT_BOTTOM:
209 rStrExpValue = aOut.makeStringAndClear();
218 case style::GraphicLocation_LEFT_TOP:
219 case style::GraphicLocation_LEFT_MIDDLE:
220 case style::GraphicLocation_LEFT_BOTTOM:
221 ePos = style::GraphicLocation_MIDDLE_TOP==eVert ?
222 style::GraphicLocation_LEFT_TOP :
223 (style::GraphicLocation_MIDDLE_MIDDLE==eVert ?
224 style::GraphicLocation_LEFT_MIDDLE :
225 style::GraphicLocation_LEFT_BOTTOM);
228 case style::GraphicLocation_MIDDLE_TOP:
229 case style::GraphicLocation_MIDDLE_MIDDLE:
230 case style::GraphicLocation_MIDDLE_BOTTOM:
234 case style::GraphicLocation_RIGHT_TOP:
235 case style::GraphicLocation_RIGHT_MIDDLE:
236 case style::GraphicLocation_RIGHT_BOTTOM:
237 ePos = style::GraphicLocation_MIDDLE_TOP==eVert ?
238 style::GraphicLocation_RIGHT_TOP :
239 (style::GraphicLocation_MIDDLE_MIDDLE==eVert ?
240 style::GraphicLocation_RIGHT_MIDDLE :
241 style::GraphicLocation_RIGHT_BOTTOM);
250 SAL_WARN_IF( !(style::GraphicLocation_LEFT_MIDDLE==eHori || style::GraphicLocation_MIDDLE_MIDDLE==eHori || style::GraphicLocation_RIGHT_MIDDLE==eHori),
"xmloff",
251 "lcl_frmitems_MergeXMLHoriPos: vertical pos must be middle" );
255 case style::GraphicLocation_LEFT_TOP:
256 case style::GraphicLocation_MIDDLE_TOP:
257 case style::GraphicLocation_RIGHT_TOP:
258 ePos = style::GraphicLocation_LEFT_MIDDLE==eHori ?
259 style::GraphicLocation_LEFT_TOP :
260 (style::GraphicLocation_MIDDLE_MIDDLE==eHori ?
261 style::GraphicLocation_MIDDLE_TOP :
262 style::GraphicLocation_RIGHT_TOP);
265 case style::GraphicLocation_LEFT_MIDDLE:
266 case style::GraphicLocation_MIDDLE_MIDDLE:
267 case style::GraphicLocation_RIGHT_MIDDLE:
271 case style::GraphicLocation_LEFT_BOTTOM:
272 case style::GraphicLocation_MIDDLE_BOTTOM:
273 case style::GraphicLocation_RIGHT_BOTTOM:
274 ePos = style::GraphicLocation_LEFT_MIDDLE==eHori ?
275 style::GraphicLocation_LEFT_BOTTOM :
276 (style::GraphicLocation_MIDDLE_MIDDLE==eHori ?
277 style::GraphicLocation_MIDDLE_BOTTOM :
278 style::GraphicLocation_RIGHT_BOTTOM);
css::chart::ChartAxisLabelPosition ePos
SvXMLEnumMapEntry< style::GraphicLocation > const pXML_BrushVerticalPos[]
SvXMLEnumMapEntry< style::GraphicLocation > const pXML_BrushHorizontalPos[]
bool getNextToken(std::u16string_view &rToken)
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
virtual bool exportXML(OUString &rStrExpValue, const css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Exports the given value according to the XML-data-type corresponding to the derived class.
static void MergeXMLHoriPos(css::style::GraphicLocation &ePos, css::style::GraphicLocation eHori)
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class.
virtual ~XMLBackGraphicPositionPropHdl() override
static void MergeXMLVertPos(css::style::GraphicLocation &ePos, css::style::GraphicLocation eVert)
static bool convertPercent(sal_Int32 &rValue, std::u16string_view rString)
#define SAL_WARN_IF(condition, area, stream)
Handling of tokens in XML:
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken