diff options
Diffstat (limited to 'editeng/source/items/paraitem.cxx')
-rw-r--r-- | editeng/source/items/paraitem.cxx | 85 |
1 files changed, 33 insertions, 52 deletions
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index 217bdf3b6a..0d33ed716f 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -140,15 +141,13 @@ int SvxLineSpacingItem::operator==( const SfxPoolItem& rAttr ) const 1 : 0; } -/*-----------------18.03.98 16:32------------------- - os: wer weiss noch, wieso das LineSpacingItem so - kompliziert ist? Fuer UNO koennen wir das nicht - gebrauchen. Da gibt es nur zwei Werte: - - ein sal_uInt16 fuer den Modus - - ein sal_uInt32 fuer alle Werte (Abstand, Hoehe, rel. Angaben) - ---------------------------------------------------*/ -sal_Bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +/* wer weiss noch, wieso das LineSpacingItem so + kompliziert ist? Fuer UNO koennen wir das nicht + gebrauchen. Da gibt es nur zwei Werte: + - ein sal_uInt16 fuer den Modus + - ein sal_uInt32 fuer alle Werte (Abstand, Hoehe, rel. Angaben) +*/ +bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -190,12 +189,10 @@ sal_Bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const default: DBG_ERROR("Wrong MemberId!"); break; } - return sal_True; + return true; } -/*-----------------18.03.98 16:32------------------- ---------------------------------------------------*/ -sal_Bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -387,10 +384,7 @@ int SvxAdjustItem::operator==( const SfxPoolItem& rAttr ) const ? 1 : 0 ); } -/*-----------------18.03.98 16:15------------------- - ---------------------------------------------------*/ -sal_Bool SvxAdjustItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxAdjustItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -406,13 +400,10 @@ sal_Bool SvxAdjustItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const } default: ;//prevent warning } - return sal_True; + return true; } -/*-----------------18.03.98 16:15------------------- - ---------------------------------------------------*/ -sal_Bool SvxAdjustItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxAdjustItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -445,7 +436,7 @@ sal_Bool SvxAdjustItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) bOneBlock = Any2Bool(rVal); break; } - return sal_True; + return true; } // ----------------------------------------------------------------------- @@ -709,7 +700,7 @@ SvxHyphenZoneItem::SvxHyphenZoneItem( const sal_Bool bHyph, const sal_uInt16 nId } // ----------------------------------------------------------------------- -sal_Bool SvxHyphenZoneItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxHyphenZoneItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -728,10 +719,10 @@ sal_Bool SvxHyphenZoneItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const rVal <<= (sal_Int16)nMaxHyphens; break; } - return sal_True; + return true; } // ----------------------------------------------------------------------- -sal_Bool SvxHyphenZoneItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxHyphenZoneItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -739,7 +730,7 @@ sal_Bool SvxHyphenZoneItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) if( nMemberId != MID_IS_HYPHEN ) if(!(rVal >>= nNewVal)) - return sal_False; + return false; switch(nMemberId) { @@ -756,7 +747,7 @@ sal_Bool SvxHyphenZoneItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) nMaxHyphens = (BYTE)nNewVal; break; } - return sal_True; + return true; } // ----------------------------------------------------------------------- @@ -1011,11 +1002,8 @@ struct ::com::sun::star::style::TabStop typedef sequence ::com::sun::star::style::TabStop> TabSTopSequence; */ -/*-----------------19.03.98 08:50------------------- - ---------------------------------------------------*/ -sal_Bool SvxTabStopItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxTabStopItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1055,11 +1043,8 @@ sal_Bool SvxTabStopItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const } return sal_True; } -/*-----------------19.03.98 08:50------------------- ---------------------------------------------------*/ - -sal_Bool SvxTabStopItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxTabStopItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1140,9 +1125,12 @@ sal_Bool SvxTabStopItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) sal_Int32 nNewPos = 0; if (!(rVal >>= nNewPos) ) return sal_False; + if (bConvert) + nNewPos = MM100_TO_TWIP ( nNewPos ); + if (nNewPos <= 0) + return sal_False; const SvxTabStop& rTab = *(GetStart()); - SvxTabStop aNewTab ( bConvert ? MM100_TO_TWIP ( nNewPos ) : nNewPos, - rTab.GetAdjustment(), rTab.GetDecimal(), rTab.GetFill() ); + SvxTabStop aNewTab ( nNewPos, rTab.GetAdjustment(), rTab.GetDecimal(), rTab.GetFill() ); Remove ( 0 ); Insert( aNewTab ); break; @@ -1242,7 +1230,7 @@ SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) //Alles nur SWG! const SfxItemPool *pPool = SfxItemPool::GetStoringPool(); - const FASTBOOL bStoreDefTabs = pPool + const bool bStoreDefTabs = pPool && pPool->GetName().EqualsAscii("SWG") && ::IsDefaultItem( this ); @@ -1380,7 +1368,7 @@ SfxPoolItem* SvxPageModelItem::Clone( SfxItemPool* ) const //------------------------------------------------------------------------ -sal_Bool SvxPageModelItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const +bool SvxPageModelItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const { // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1395,7 +1383,7 @@ sal_Bool SvxPageModelItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMem return sal_True; } -sal_Bool SvxPageModelItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId ) +bool SvxPageModelItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId ) { // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1420,7 +1408,7 @@ SfxItemPresentation SvxPageModelItem::GetPresentation ) const { rText.Erase(); - FASTBOOL bSet = ( GetValue().Len() > 0 ); + bool bSet = ( GetValue().Len() > 0 ); switch ( ePres ) { @@ -1556,25 +1544,19 @@ SvxForbiddenRuleItem::SvxForbiddenRuleItem( : SfxBoolItem( nId, bOn ) { } -/* -----------------------------29.11.00 11:23-------------------------------- - ---------------------------------------------------------------------------*/ SfxPoolItem* SvxForbiddenRuleItem::Clone( SfxItemPool * ) const { return new SvxForbiddenRuleItem( GetValue(), Which() ); } -/* -----------------------------29.11.00 11:23-------------------------------- - ---------------------------------------------------------------------------*/ SfxPoolItem* SvxForbiddenRuleItem::Create(SvStream & rStrm, USHORT) const { sal_Bool nValue; rStrm >> nValue; return new SvxForbiddenRuleItem( nValue, Which() ); } -/* -----------------------------29.11.00 11:23-------------------------------- - ---------------------------------------------------------------------------*/ USHORT SvxForbiddenRuleItem::GetVersion( USHORT nFFVer ) const { DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || @@ -1584,9 +1566,7 @@ USHORT SvxForbiddenRuleItem::GetVersion( USHORT nFFVer ) const return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0; } -/* -----------------------------29.11.00 11:23-------------------------------- - ---------------------------------------------------------------------------*/ SfxItemPresentation SvxForbiddenRuleItem::GetPresentation( SfxItemPresentation ePres, SfxMapUnit /*eCoreMetric*/, SfxMapUnit /*ePresMetric*/, @@ -1675,14 +1655,14 @@ SfxItemPresentation SvxParaVertAlignItem::GetPresentation( return SFX_ITEM_PRESENTATION_NONE; } -sal_Bool SvxParaVertAlignItem::QueryValue( com::sun::star::uno::Any& rVal, +bool SvxParaVertAlignItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const { rVal <<= (sal_Int16)GetValue(); return sal_True; } -sal_Bool SvxParaVertAlignItem::PutValue( const com::sun::star::uno::Any& rVal, +bool SvxParaVertAlignItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) { sal_Int16 nVal = sal_Int16(); @@ -1755,3 +1735,4 @@ SfxItemPresentation SvxParaGridItem::GetPresentation( } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |