2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 02:57:10 +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-11 02:57:10 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 02:57:10 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-11 02:57:10 +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-11 02:57:10 +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-11 02:57:10 +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 05:12:44 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
2010-01-06 19:26:54 +01:00
|
|
|
#include "precompiled_editeng.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/eitem.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <tools/list.hxx>
|
|
|
|
|
2011-02-05 13:18:52 +01:00
|
|
|
#include <boost/unordered_map.hpp>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/itemprop.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2010-01-06 19:26:54 +01:00
|
|
|
#include <editeng/unoipset.hxx>
|
|
|
|
#include <editeng/editids.hrc>
|
|
|
|
#include <editeng/editeng.hxx>
|
|
|
|
#include <svl/itempool.hxx>
|
2001-10-31 14:38:48 +00:00
|
|
|
#include <algorithm>
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::rtl;
|
|
|
|
|
2010-12-16 23:09:37 -08:00
|
|
|
using ::std::vector;
|
|
|
|
|
2001-10-26 12:46:09 +00:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2009-06-03 11:26:39 +00:00
|
|
|
struct SfxItemPropertyMapEntryHash
|
2001-10-26 12:46:09 +00:00
|
|
|
{
|
2009-06-03 11:26:39 +00:00
|
|
|
size_t operator()(const SfxItemPropertyMapEntry* pMap) const { return (size_t)pMap; }
|
2001-10-26 12:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
struct SvxIDPropertyCombine
|
|
|
|
{
|
|
|
|
sal_uInt16 nWID;
|
|
|
|
uno::Any aAny;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-12-10 18:09:38 +01:00
|
|
|
SvxItemPropertySet::SvxItemPropertySet( const SfxItemPropertyMapEntry* pMap, SfxItemPool& rItemPool, sal_Bool bConvertTwips )
|
2009-06-03 11:26:39 +00:00
|
|
|
: m_aPropertyMap( pMap ),
|
2009-12-10 18:09:38 +01:00
|
|
|
_pMap(pMap), mbConvertTwips(bConvertTwips), mrItemPool( rItemPool )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
SvxItemPropertySet::~SvxItemPropertySet()
|
|
|
|
{
|
2010-08-26 21:50:11 +02:00
|
|
|
ClearAllUsrAny();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
uno::Any* SvxItemPropertySet::GetUsrAnyForID(sal_uInt16 nWID) const
|
|
|
|
{
|
2010-12-16 23:09:37 -08:00
|
|
|
for ( size_t i = 0, n = aCombineList.size(); i < n; ++i )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2010-12-16 23:09:37 -08:00
|
|
|
SvxIDPropertyCombine* pActual = aCombineList[ i ];
|
|
|
|
if( pActual->nWID == nWID )
|
|
|
|
return &pActual->aAny;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void SvxItemPropertySet::AddUsrAnyForID(const uno::Any& rAny, sal_uInt16 nWID)
|
|
|
|
{
|
|
|
|
SvxIDPropertyCombine* pNew = new SvxIDPropertyCombine;
|
|
|
|
pNew->nWID = nWID;
|
|
|
|
pNew->aAny = rAny;
|
2010-12-16 23:09:37 -08:00
|
|
|
aCombineList.push_back( pNew );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2010-08-26 21:50:11 +02:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SvxItemPropertySet::ClearAllUsrAny()
|
|
|
|
{
|
2010-12-16 23:09:37 -08:00
|
|
|
for ( size_t i = 0, n = aCombineList.size(); i < n; ++i )
|
|
|
|
delete aCombineList[ i ];
|
|
|
|
aCombineList.clear();
|
2010-08-26 21:50:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2010-01-22 16:42:24 +01:00
|
|
|
sal_Bool SvxUnoCheckForPositiveValue( const uno::Any& rVal )
|
|
|
|
{
|
|
|
|
sal_Bool bConvert = sal_True; // the default is that all metric items must be converted
|
|
|
|
sal_Int32 nValue = 0;
|
|
|
|
if( rVal >>= nValue )
|
|
|
|
bConvert = (nValue > 0);
|
|
|
|
return bConvert;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
//----------------------------------------------------------------------
|
2010-01-22 16:42:24 +01:00
|
|
|
uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* pMap, const SfxItemSet& rSet, bool bSearchInParent, bool bDontConvertNegativeValues ) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
uno::Any aVal;
|
|
|
|
if(!pMap || !pMap->nWID)
|
|
|
|
return aVal;
|
|
|
|
|
|
|
|
const SfxPoolItem* pItem = 0;
|
2001-07-11 12:51:49 +00:00
|
|
|
SfxItemPool* pPool = rSet.GetPool();
|
2010-01-06 19:26:54 +01:00
|
|
|
rSet.GetItemState( pMap->nWID, bSearchInParent, &pItem );
|
2001-07-11 12:51:49 +00:00
|
|
|
if( NULL == pItem && pPool )
|
|
|
|
pItem = &(pPool->GetDefaultItem( pMap->nWID ));
|
2001-03-20 11:19:47 +00:00
|
|
|
|
2001-08-01 12:58:49 +00:00
|
|
|
const SfxMapUnit eMapUnit = pPool ? pPool->GetMetric((USHORT)pMap->nWID) : SFX_MAPUNIT_100TH_MM;
|
|
|
|
BYTE nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
|
|
|
|
if( eMapUnit == SFX_MAPUNIT_100TH_MM )
|
|
|
|
nMemberId &= (~CONVERT_TWIPS);
|
|
|
|
|
2001-03-20 11:19:47 +00:00
|
|
|
if(pItem)
|
|
|
|
{
|
2001-08-01 12:58:49 +00:00
|
|
|
pItem->QueryValue( aVal, nMemberId );
|
2010-01-22 16:42:24 +01:00
|
|
|
if( pMap->nMemberId & SFX_METRIC_ITEM )
|
2001-03-20 11:19:47 +00:00
|
|
|
{
|
2010-01-22 16:42:24 +01:00
|
|
|
if( eMapUnit != SFX_MAPUNIT_100TH_MM )
|
|
|
|
{
|
|
|
|
if ( !bDontConvertNegativeValues || SvxUnoCheckForPositiveValue( aVal ) )
|
|
|
|
SvxUnoConvertToMM( eMapUnit, aVal );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( pMap->pType->getTypeClass() == uno::TypeClass_ENUM &&
|
|
|
|
aVal.getValueType() == ::getCppuType((const sal_Int32*)0) )
|
|
|
|
{
|
|
|
|
// convert typeless SfxEnumItem to enum type
|
2001-03-20 11:19:47 +00:00
|
|
|
sal_Int32 nEnum;
|
|
|
|
aVal >>= nEnum;
|
|
|
|
aVal.setValue( &nEnum, *pMap->pType );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DBG_ERROR( "No SfxPoolItem found for property!" );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return aVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2010-01-22 16:42:24 +01:00
|
|
|
void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const uno::Any& rVal, SfxItemSet& rSet, bool bDontConvertNegativeValues ) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
if(!pMap || !pMap->nWID)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// item holen
|
|
|
|
const SfxPoolItem* pItem = 0;
|
|
|
|
SfxPoolItem *pNewItem = 0;
|
|
|
|
SfxItemState eState = rSet.GetItemState( pMap->nWID, sal_True, &pItem );
|
2001-07-11 12:51:49 +00:00
|
|
|
SfxItemPool* pPool = rSet.GetPool();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// UnoAny in item-Wert stecken
|
2001-02-01 17:53:42 +00:00
|
|
|
if(eState < SFX_ITEM_DEFAULT || pItem == NULL)
|
|
|
|
{
|
|
|
|
if( pPool == NULL )
|
|
|
|
{
|
|
|
|
DBG_ERROR( "No default item and no pool?" );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-06-01 15:46:17 +00:00
|
|
|
pItem = &pPool->GetDefaultItem( pMap->nWID );
|
2001-02-01 17:53:42 +00:00
|
|
|
}
|
|
|
|
|
2001-06-06 08:02:44 +00:00
|
|
|
DBG_ASSERT( pItem, "Got no default for item!" );
|
2001-02-01 17:53:42 +00:00
|
|
|
if( pItem )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-07-11 12:51:49 +00:00
|
|
|
uno::Any aValue( rVal );
|
|
|
|
|
2001-08-01 12:58:49 +00:00
|
|
|
const SfxMapUnit eMapUnit = pPool ? pPool->GetMetric((USHORT)pMap->nWID) : SFX_MAPUNIT_100TH_MM;
|
2010-01-22 16:42:24 +01:00
|
|
|
|
|
|
|
// check for needed metric translation
|
|
|
|
if( (pMap->nMemberId & SFX_METRIC_ITEM) && eMapUnit != SFX_MAPUNIT_100TH_MM )
|
|
|
|
{
|
|
|
|
if ( !bDontConvertNegativeValues || SvxUnoCheckForPositiveValue( aValue ) )
|
|
|
|
SvxUnoConvertFromMM( eMapUnit, aValue );
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
pNewItem = pItem->Clone();
|
2001-08-01 12:58:49 +00:00
|
|
|
|
|
|
|
BYTE nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
|
|
|
|
if( eMapUnit == SFX_MAPUNIT_100TH_MM )
|
|
|
|
nMemberId &= (~CONVERT_TWIPS);
|
|
|
|
|
|
|
|
if( pNewItem->PutValue( aValue, nMemberId ) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// neues item in itemset setzen
|
|
|
|
rSet.Put( *pNewItem, pMap->nWID );
|
|
|
|
}
|
|
|
|
delete pNewItem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2009-06-03 11:26:39 +00:00
|
|
|
uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* pMap ) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// Schon ein Wert eingetragen? Dann schnell fertig
|
|
|
|
uno::Any* pUsrAny = GetUsrAnyForID(pMap->nWID);
|
|
|
|
if(pUsrAny)
|
|
|
|
return *pUsrAny;
|
|
|
|
|
|
|
|
// Noch kein UsrAny gemerkt, generiere Default-Eintrag und gib
|
|
|
|
// diesen zurueck
|
2001-11-27 12:26:18 +00:00
|
|
|
|
2009-12-10 18:09:38 +01:00
|
|
|
const SfxMapUnit eMapUnit = mrItemPool.GetMetric((USHORT)pMap->nWID);
|
2001-08-01 12:58:49 +00:00
|
|
|
BYTE nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM);
|
|
|
|
if( eMapUnit == SFX_MAPUNIT_100TH_MM )
|
|
|
|
nMemberId &= (~CONVERT_TWIPS);
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
uno::Any aVal;
|
2009-12-10 18:09:38 +01:00
|
|
|
SfxItemSet aSet( mrItemPool, pMap->nWID, pMap->nWID);
|
2001-07-11 12:51:49 +00:00
|
|
|
|
2000-10-30 10:20:51 +00:00
|
|
|
if( (pMap->nWID < OWN_ATTR_VALUE_START) && (pMap->nWID > OWN_ATTR_VALUE_END ) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// Default aus ItemPool holen
|
2009-12-10 18:09:38 +01:00
|
|
|
if(mrItemPool.IsWhich(pMap->nWID))
|
|
|
|
aSet.Put(mrItemPool.GetDefaultItem(pMap->nWID));
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(aSet.Count())
|
|
|
|
{
|
|
|
|
const SfxPoolItem* pItem = NULL;
|
|
|
|
SfxItemState eState = aSet.GetItemState( pMap->nWID, sal_True, &pItem );
|
|
|
|
if(eState >= SFX_ITEM_DEFAULT && pItem)
|
|
|
|
{
|
2001-08-01 12:58:49 +00:00
|
|
|
pItem->QueryValue( aVal, nMemberId );
|
2000-09-18 16:07:07 +00:00
|
|
|
((SvxItemPropertySet*)this)->AddUsrAnyForID(aVal, pMap->nWID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-07-11 12:51:49 +00:00
|
|
|
if( pMap->nMemberId & SFX_METRIC_ITEM )
|
|
|
|
{
|
|
|
|
// check for needed metric translation
|
|
|
|
if(pMap->nMemberId & SFX_METRIC_ITEM && eMapUnit != SFX_MAPUNIT_100TH_MM)
|
|
|
|
{
|
|
|
|
SvxUnoConvertToMM( eMapUnit, aVal );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( pMap->pType->getTypeClass() == uno::TypeClass_ENUM &&
|
|
|
|
aVal.getValueType() == ::getCppuType((const sal_Int32*)0) )
|
|
|
|
{
|
|
|
|
sal_Int32 nEnum;
|
|
|
|
aVal >>= nEnum;
|
|
|
|
|
|
|
|
aVal.setValue( &nEnum, *pMap->pType );
|
|
|
|
}
|
|
|
|
|
|
|
|
return aVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2009-06-03 11:26:39 +00:00
|
|
|
void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const uno::Any& rVal ) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
uno::Any* pUsrAny = GetUsrAnyForID(pMap->nWID);
|
|
|
|
if(!pUsrAny)
|
|
|
|
((SvxItemPropertySet*)this)->AddUsrAnyForID(rVal, pMap->nWID);
|
|
|
|
else
|
|
|
|
*pUsrAny = rVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2009-06-03 11:26:39 +00:00
|
|
|
const SfxItemPropertySimpleEntry* SvxItemPropertySet::getPropertyMapEntry(const OUString &rName) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2009-06-03 11:26:39 +00:00
|
|
|
return m_aPropertyMap.getByName( rName );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2007-06-05 13:36:51 +00:00
|
|
|
uno::Reference< beans::XPropertySetInfo > SvxItemPropertySet::getPropertySetInfo() const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2009-06-03 11:26:39 +00:00
|
|
|
if( !m_xInfo.is() )
|
|
|
|
m_xInfo = new SfxItemPropertySetInfo( &m_aPropertyMap );
|
|
|
|
return m_xInfo;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
2001-07-11 12:51:49 +00:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef TWIPS_TO_MM
|
|
|
|
#define TWIPS_TO_MM(val) ((val * 127 + 36) / 72)
|
|
|
|
#endif
|
|
|
|
#ifndef MM_TO_TWIPS
|
|
|
|
#define MM_TO_TWIPS(val) ((val * 72 + 63) / 127)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/** converts the given any with a metric to 100th/mm if needed */
|
2007-06-05 13:36:51 +00:00
|
|
|
void SvxUnoConvertToMM( const SfxMapUnit eSourceMapUnit, uno::Any & rMetric ) throw()
|
2001-07-11 12:51:49 +00:00
|
|
|
{
|
|
|
|
// map the metric of the itempool to 100th mm
|
|
|
|
switch(eSourceMapUnit)
|
|
|
|
{
|
|
|
|
case SFX_MAPUNIT_TWIP :
|
|
|
|
{
|
|
|
|
switch( rMetric.getValueTypeClass() )
|
|
|
|
{
|
|
|
|
case uno::TypeClass_BYTE:
|
|
|
|
rMetric <<= (sal_Int8)(TWIPS_TO_MM(*(sal_Int8*)rMetric.getValue()));
|
|
|
|
break;
|
|
|
|
case uno::TypeClass_SHORT:
|
|
|
|
rMetric <<= (sal_Int16)(TWIPS_TO_MM(*(sal_Int16*)rMetric.getValue()));
|
|
|
|
break;
|
|
|
|
case uno::TypeClass_UNSIGNED_SHORT:
|
|
|
|
rMetric <<= (sal_uInt16)(TWIPS_TO_MM(*(sal_uInt16*)rMetric.getValue()));
|
|
|
|
break;
|
|
|
|
case uno::TypeClass_LONG:
|
|
|
|
rMetric <<= (sal_Int32)(TWIPS_TO_MM(*(sal_Int32*)rMetric.getValue()));
|
|
|
|
break;
|
|
|
|
case uno::TypeClass_UNSIGNED_LONG:
|
|
|
|
rMetric <<= (sal_uInt32)(TWIPS_TO_MM(*(sal_uInt32*)rMetric.getValue()));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
DBG_ERROR("AW: Missing unit translation to 100th mm!");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
DBG_ERROR("AW: Missing unit translation to 100th mm!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
/** converts the given any with a metric from 100th/mm to the given metric if needed */
|
2007-06-05 13:36:51 +00:00
|
|
|
void SvxUnoConvertFromMM( const SfxMapUnit eDestinationMapUnit, uno::Any & rMetric ) throw()
|
2001-07-11 12:51:49 +00:00
|
|
|
{
|
|
|
|
switch(eDestinationMapUnit)
|
|
|
|
{
|
|
|
|
case SFX_MAPUNIT_TWIP :
|
|
|
|
{
|
|
|
|
switch( rMetric.getValueTypeClass() )
|
|
|
|
{
|
|
|
|
case uno::TypeClass_BYTE:
|
|
|
|
rMetric <<= (sal_Int8)(MM_TO_TWIPS(*(sal_Int8*)rMetric.getValue()));
|
|
|
|
break;
|
|
|
|
case uno::TypeClass_SHORT:
|
|
|
|
rMetric <<= (sal_Int16)(MM_TO_TWIPS(*(sal_Int16*)rMetric.getValue()));
|
|
|
|
break;
|
|
|
|
case uno::TypeClass_UNSIGNED_SHORT:
|
|
|
|
rMetric <<= (sal_uInt16)(MM_TO_TWIPS(*(sal_uInt16*)rMetric.getValue()));
|
|
|
|
break;
|
|
|
|
case uno::TypeClass_LONG:
|
|
|
|
rMetric <<= (sal_Int32)(MM_TO_TWIPS(*(sal_Int32*)rMetric.getValue()));
|
|
|
|
break;
|
|
|
|
case uno::TypeClass_UNSIGNED_LONG:
|
|
|
|
rMetric <<= (sal_uInt32)(MM_TO_TWIPS(*(sal_uInt32*)rMetric.getValue()));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
DBG_ERROR("AW: Missing unit translation to 100th mm!");
|
|
|
|
}
|
2001-07-23 14:14:31 +00:00
|
|
|
break;
|
2001-07-11 12:51:49 +00:00
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
DBG_ERROR("AW: Missing unit translation to PoolMetrics!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-10-26 12:46:09 +00:00
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|