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/.
9 #ifndef INCLUDED_UNITS_HXX
10 #define INCLUDED_UNITS_HXX
12 #include <sal/config.h>
13 #include <rtl/ustring.hxx>
28 SVG_LENGTH_UNIT_PERCENTAGE
,
32 /** return svg_length_t in 100th's of mm
33 @param fVal value to convert
34 @param unit unit the value is in
35 @param rState current state (needed for viewport dimensions etc.)
36 @param dir direction - either 'h' or 'v' for horizonal or vertical, resp.
38 double convLength( double fVal
, SvgUnit unit
, const State
& rState
, char dir
);
40 /** return svg_length_t in 100th's of mm
41 @param sValue value to convert
42 @param rState current state (needed for viewport dimensions etc.)
43 @param dir direction - either 'h' or 'v' for horizonal or vertical, resp.
45 double convLength( const OUString
& sValue
, const State
& rState
, char dir
);
47 inline double pt2mm(double fVal
) { return fVal
*25.4/72.0; }
48 inline double pt100thmm(double fVal
) { return fVal
*2540.0/72.0; }
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */