2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 21:25:09 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 21:25:09 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 21:25:09 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 21:25:09 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 21:25:09 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 21:25:09 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 03:18:22 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_svx.hxx"
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// include ---------------------------------------------------------------
|
|
|
|
|
|
|
|
#include "dlgutil.hxx"
|
2009-12-11 11:15:06 +01:00
|
|
|
#include <svl/itemset.hxx>
|
|
|
|
#include <sfx2/sfxsids.hrc>
|
2010-02-03 11:03:54 +01:00
|
|
|
#include <sfx2/module.hxx>
|
2010-01-07 18:52:36 +01:00
|
|
|
#include <svl/intitem.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2009-12-10 18:44:22 +01:00
|
|
|
FieldUnit GetModuleFieldUnit( const SfxItemSet& rSet )
|
2000-10-09 10:36:50 +00:00
|
|
|
{
|
|
|
|
FieldUnit eUnit = FUNIT_INCH;
|
2000-10-23 08:21:29 +00:00
|
|
|
const SfxPoolItem* pItem = NULL;
|
2009-12-10 18:44:22 +01:00
|
|
|
if ( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_METRIC, FALSE, &pItem ) )
|
2000-10-23 08:21:29 +00:00
|
|
|
eUnit = (FieldUnit)( (const SfxUInt16Item*)pItem )->GetValue();
|
2010-02-03 11:03:54 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
DBG_ERROR("Using fallback for field unit - field unit should be provided in ItemSet");
|
|
|
|
return SfxModule::GetCurrentFieldUnit();
|
|
|
|
}
|
|
|
|
|
2000-10-09 10:36:50 +00:00
|
|
|
return eUnit;
|
|
|
|
}
|
|
|
|
|