2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2012-06-02 13:43:01 +02:00
|
|
|
|
2001-10-24 16:00:37 +00:00
|
|
|
#ifndef _GETMETRICVAL_HXX
|
|
|
|
#define _GETMETRICVAL_HXX
|
|
|
|
|
2007-09-27 07:52:48 +00:00
|
|
|
#include <tools/solar.h>
|
|
|
|
|
2001-10-24 16:00:37 +00:00
|
|
|
#define CM_1 0 // 1 centimeter or 1/2 inch
|
|
|
|
#define CM_05 1 // 0.5 centimeter or 1/4 inch
|
|
|
|
#define CM_01 2 // 0.1 centimeter or 1/20 inch
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
inline sal_uInt16 GetMetricVal( int n )
|
2001-10-24 16:00:37 +00:00
|
|
|
{
|
|
|
|
#ifdef USE_MEASUREMENT
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nVal = MEASURE_METRIC == SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
|
2001-10-24 16:00:37 +00:00
|
|
|
? 567 // 1 cm
|
|
|
|
: 770; // 1/2 Inch
|
|
|
|
#else
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nVal = 567; // 1 cm
|
2001-10-24 16:00:37 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
if( CM_01 == n )
|
|
|
|
nVal /= 10;
|
|
|
|
else if( CM_05 == n )
|
|
|
|
nVal /= 2;
|
|
|
|
return nVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|