bump product version to 4.1.6.2
[LibreOffice.git] / xmloff / source / style / DrawAspectHdl.cxx
blobb39140babc76e74942fcca3d70789ef53c744833
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 .
21 #include "DrawAspectHdl.hxx"
23 #include <com/sun/star/uno/Any.hxx>
25 #include <rtl/ustrbuf.hxx>
27 #include <tools/solar.h>
29 #include <sax/tools/converter.hxx>
31 #include <xmloff/xmlement.hxx>
32 #include <xmloff/xmltoken.hxx>
36 using namespace ::com::sun::star;
37 using namespace ::xmloff::token;
39 ///////////////////////////////////////////////////////////////////////////////
41 // class XMLMeasurePropHdl
44 SvXMLEnumMapEntry const pXML_DrawAspect_Enum[] =
46 { XML_CONTENT, 1 },
47 { XML_THUMBNAIL, 2 },
48 { XML_ICON, 4 },
49 { XML_PRINT, 8 },
50 { XML_TOKEN_INVALID, 0 }
53 DrawAspectHdl::~DrawAspectHdl()
55 // nothing to do
58 sal_Bool DrawAspectHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
60 sal_Int64 nAspect = 0;
62 ::sax::Converter::convertNumber64( nAspect, rStrImpValue );
63 rValue <<= nAspect;
65 return nAspect > 0;
68 sal_Bool DrawAspectHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
70 sal_Bool bRet = sal_False;
71 OUStringBuffer aOut;
73 sal_Int64 nAspect = 0;
74 if( ( rValue >>= nAspect ) && nAspect > 0 )
76 // store the aspect as an integer value
77 aOut.append( nAspect );
79 rStrExpValue = aOut.makeStringAndClear();
81 bRet = sal_True;
84 return bRet;
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */