diff options
Diffstat (limited to 'svl/source/items')
39 files changed, 330 insertions, 607 deletions
diff --git a/svl/source/items/aeitem.cxx b/svl/source/items/aeitem.cxx index 370a3ebeb44e..e45c6acbaa26 100644 --- a/svl/source/items/aeitem.cxx +++ b/svl/source/items/aeitem.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. @@ -27,8 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif #include <tools/string.hxx> @@ -312,3 +311,4 @@ void SfxAllEnumItem::RemoveAllValues() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/cenumitm.cxx b/svl/source/items/cenumitm.cxx index a67df72113ba..03f3ae784da9 100644 --- a/svl/source/items/cenumitm.cxx +++ b/svl/source/items/cenumitm.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. @@ -32,9 +33,7 @@ #include <svl/cenumitm.hxx> #include <whassert.hxx> -#ifndef _CPPUHELPER_EXTRACT_HXX_ #include <comphelper/extract.hxx> -#endif //============================================================================ // @@ -70,7 +69,7 @@ SfxEnumItemInterface::GetPresentation(SfxItemPresentation, SfxMapUnit, //============================================================================ // virtual -sal_Bool SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) +bool SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= sal_Int32(GetEnumValue()); @@ -79,7 +78,7 @@ sal_Bool SfxEnumItemInterface::QueryValue(com::sun::star::uno::Any& rVal, sal_uI //============================================================================ // virtual -sal_Bool SfxEnumItemInterface::PutValue(const com::sun::star::uno::Any& rVal, +bool SfxEnumItemInterface::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int32 nTheValue = 0; @@ -89,7 +88,7 @@ sal_Bool SfxEnumItemInterface::PutValue(const com::sun::star::uno::Any& rVal, SetEnumValue(sal_uInt16(nTheValue)); return true; } - DBG_ERROR("SfxEnumItemInterface::PutValue(): Wrong type"); + OSL_FAIL("SfxEnumItemInterface::PutValue(): Wrong type"); return false; } @@ -233,7 +232,7 @@ SfxItemPresentation CntBoolItem::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const +bool CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= sal_Bool(m_bValue); return true; @@ -241,7 +240,7 @@ sal_Bool CntBoolItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) cons //============================================================================ // virtual -sal_Bool CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) +bool CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Bool bTheValue = sal_Bool(); if (rVal >>= bTheValue) @@ -249,7 +248,7 @@ sal_Bool CntBoolItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) m_bValue = bTheValue; return true; } - DBG_ERROR("CntBoolItem::PutValue(): Wrong type"); + OSL_FAIL("CntBoolItem::PutValue(): Wrong type"); return false; } @@ -288,7 +287,8 @@ UniString CntBoolItem::GetValueTextByVal(sal_Bool bTheValue) const { return bTheValue ? - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_True")) : - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_False")); + UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("TRUE")) : + UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("FALSE")); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/cintitem.cxx b/svl/source/items/cintitem.cxx index 11f68ed69071..1f949babf9dc 100644 --- a/svl/source/items/cintitem.cxx +++ b/svl/source/items/cintitem.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. @@ -87,26 +88,26 @@ SfxItemPresentation CntByteItem::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool CntByteItem::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const +bool CntByteItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int8 nValue = m_nValue; rVal <<= nValue; - return sal_True; + return true; } //============================================================================ // virtual -sal_Bool CntByteItem::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) +bool CntByteItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int8 nValue = sal_Int8(); if (rVal >>= nValue) { m_nValue = nValue; - return sal_True; + return true; } - DBG_ERROR( "CntByteItem::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "CntByteItem::PutValue - Wrong type!" ); + return false; } //============================================================================ @@ -222,27 +223,27 @@ SfxItemPresentation CntUInt16Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool CntUInt16Item::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const +bool CntUInt16Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int32 nValue = m_nValue; rVal <<= nValue; - return sal_True; + return true; } //============================================================================ // virtual -sal_Bool CntUInt16Item::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) +bool CntUInt16Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int32 nValue = 0; if (rVal >>= nValue) { DBG_ASSERT( nValue <= USHRT_MAX, "Overflow in UInt16 value!"); m_nValue = (sal_uInt16)nValue; - return sal_True; + return true; } - DBG_ERROR( "CntUInt16Item::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "CntUInt16Item::PutValue - Wrong type!" ); + return false; } //============================================================================ @@ -354,26 +355,26 @@ SfxItemPresentation CntInt32Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool CntInt32Item::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const +bool CntInt32Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int32 nValue = m_nValue; rVal <<= nValue; - return sal_True; + return true; } //============================================================================ // virtual -sal_Bool CntInt32Item::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) +bool CntInt32Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int32 nValue = 0; if (rVal >>= nValue) { m_nValue = nValue; - return sal_True; + return true; } - DBG_ERROR( "CntInt32Item::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "CntInt32Item::PutValue - Wrong type!" ); + return false; } //============================================================================ @@ -487,28 +488,28 @@ SfxItemPresentation CntUInt32Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool CntUInt32Item::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const +bool CntUInt32Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int32 nValue = m_nValue; DBG_ASSERT( nValue>=0, "Overflow in UInt32 value!"); rVal <<= nValue; - return sal_True; + return true; } //============================================================================ // virtual -sal_Bool CntUInt32Item::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) +bool CntUInt32Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { sal_Int32 nValue = 0; if (rVal >>= nValue) { DBG_ASSERT( nValue>=0, "Overflow in UInt32 value!"); m_nValue = nValue; - return sal_True; + return true; } - DBG_ERROR( "CntUInt32Item::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "CntUInt32Item::PutValue - Wrong type!" ); + return false; } //============================================================================ @@ -560,3 +561,4 @@ SfxFieldUnit CntUInt32Item::GetUnit() const return SFX_FUNIT_NONE; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/cntwall.cxx b/svl/source/items/cntwall.cxx index e5d635990086..22cd8a77904c 100644 --- a/svl/source/items/cntwall.cxx +++ b/svl/source/items/cntwall.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. @@ -150,18 +151,19 @@ SfxPoolItem* CntWallpaperItem::Clone( SfxItemPool* ) const //---------------------------------------------------------------------------- // virtual -sal_Bool CntWallpaperItem::QueryValue( com::sun::star::uno::Any&,sal_uInt8 ) const +bool CntWallpaperItem::QueryValue( com::sun::star::uno::Any&, sal_uInt8) const { - DBG_ERROR("Not implemented!"); - return sal_False; + OSL_FAIL("Not implemented!"); + return false; } //---------------------------------------------------------------------------- // virtual -sal_Bool CntWallpaperItem::PutValue( const com::sun::star::uno::Any&,sal_uInt8 ) +bool CntWallpaperItem::PutValue( const com::sun::star::uno::Any&, sal_uInt8) { - DBG_ERROR("Not implemented!"); - return sal_False; + OSL_FAIL("Not implemented!"); + return false; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/cstitem.src b/svl/source/items/cstitem.src index 009fcb19e3c6..206fe1a18893 100644 --- a/svl/source/items/cstitem.src +++ b/svl/source/items/cstitem.src @@ -30,40 +30,3 @@ String STR_COLUM_DT_AUTO { Text [ en-US ] = "automatic" ; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svl/source/items/ctypeitm.cxx b/svl/source/items/ctypeitm.cxx index 184b692eaad9..d1fe8b9461f9 100644 --- a/svl/source/items/ctypeitm.cxx +++ b/svl/source/items/ctypeitm.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. @@ -223,7 +224,7 @@ void CntContentTypeItem::SetValue( const INetContentType eType ) //---------------------------------------------------------------------------- // virtual -sal_Bool CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 ) const +bool CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= rtl::OUString(GetValue()); return true; @@ -231,7 +232,7 @@ sal_Bool CntContentTypeItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt //---------------------------------------------------------------------------- // virtual -sal_Bool CntContentTypeItem::PutValue( const com::sun::star::uno::Any& rVal,sal_uInt8 ) +bool CntContentTypeItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8) { rtl::OUString aValue; if ( rVal >>= aValue ) @@ -246,6 +247,8 @@ sal_Bool CntContentTypeItem::PutValue( const com::sun::star::uno::Any& rVal,sal_ return true; } - DBG_ERROR( "CntContentTypeItem::PutValue - Wrong type!" ); + OSL_FAIL( "CntContentTypeItem::PutValue - Wrong type!" ); return false; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/custritm.cxx b/svl/source/items/custritm.cxx index ff5d2dadd751..e64f47ec2a3e 100644 --- a/svl/source/items/custritm.cxx +++ b/svl/source/items/custritm.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. @@ -60,7 +61,7 @@ int CntUnencodedStringItem::operator ==(const SfxPoolItem & rItem) const // virtual int CntUnencodedStringItem::Compare(SfxPoolItem const & rWith) const { - DBG_ERROR("CntUnencodedStringItem::Compare(): No international"); + OSL_FAIL("CntUnencodedStringItem::Compare(): No international"); DBG_CHKTHIS(CntUnencodedStringItem, 0); DBG_ASSERT(rWith.ISA(CntUnencodedStringItem), "CntUnencodedStringItem::Compare(): Bad type"); @@ -106,7 +107,7 @@ CntUnencodedStringItem::GetPresentation(SfxItemPresentation, SfxMapUnit, //============================================================================ // virtual -sal_Bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) +bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= rtl::OUString(m_aValue); @@ -115,7 +116,7 @@ sal_Bool CntUnencodedStringItem::QueryValue(com::sun::star::uno::Any& rVal, sal_ //============================================================================ // virtual -sal_Bool CntUnencodedStringItem::PutValue(const com::sun::star::uno::Any& rVal, +bool CntUnencodedStringItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { rtl::OUString aTheValue; @@ -124,7 +125,7 @@ sal_Bool CntUnencodedStringItem::PutValue(const com::sun::star::uno::Any& rVal, m_aValue = UniString(aTheValue); return true; } - DBG_ERROR("CntUnencodedStringItem::PutValue(): Wrong type"); + OSL_FAIL("CntUnencodedStringItem::PutValue(): Wrong type"); return false; } @@ -136,3 +137,4 @@ SfxPoolItem * CntUnencodedStringItem::Clone(SfxItemPool *) const return new CntUnencodedStringItem(*this); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/dateitem.cxx b/svl/source/items/dateitem.cxx index eeaebb3fa2a7..e4c05f0abce0 100644 --- a/svl/source/items/dateitem.cxx +++ b/svl/source/items/dateitem.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. @@ -174,7 +175,7 @@ SfxItemPresentation SfxDateTimeItem::GetPresentation //---------------------------------------------------------------------------- // virtual -sal_Bool SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal, +bool SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; @@ -188,16 +189,16 @@ sal_Bool SfxDateTimeItem::PutValue( const com::sun::star::uno::Any& rVal, aValue.Minutes, aValue.Seconds, aValue.HundredthSeconds ) ); - return sal_True; + return true; } - DBG_ERROR( "SfxDateTimeItem::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "SfxDateTimeItem::PutValue - Wrong type!" ); + return false; } //---------------------------------------------------------------------------- // virtual -sal_Bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal, +bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; @@ -209,7 +210,7 @@ sal_Bool SfxDateTimeItem::QueryValue( com::sun::star::uno::Any& rVal, aDateTime.GetMonth(), aDateTime.GetYear() ); rVal <<= aValue; - return sal_True; + return true; } // ----------------------------------------------------------------------- @@ -276,3 +277,4 @@ SfxItemPresentation SfxColumnDateTimeItem::GetPresentation +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/eitem.cxx b/svl/source/items/eitem.cxx index c8b7f3db287f..6f6e3bfd2835 100644 --- a/svl/source/items/eitem.cxx +++ b/svl/source/items/eitem.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. @@ -45,3 +46,4 @@ TYPEINIT1(SfxEnumItem, CntEnumItem); TYPEINIT1_AUTOFACTORY(SfxBoolItem, CntBoolItem); +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/flagitem.cxx b/svl/source/items/flagitem.cxx index d1c0b84078a4..a151d430cd0d 100644 --- a/svl/source/items/flagitem.cxx +++ b/svl/source/items/flagitem.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. @@ -161,3 +162,4 @@ SfxPoolItem* SfxFlagItem::Clone(SfxItemPool *) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/globalnameitem.cxx b/svl/source/items/globalnameitem.cxx index c630a6b9b4f2..aa36b0afa30c 100644 --- a/svl/source/items/globalnameitem.cxx +++ b/svl/source/items/globalnameitem.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. @@ -80,10 +81,10 @@ SfxPoolItem* SfxGlobalNameItem::Clone(SfxItemPool *) const //---------------------------------------------------------------------------- // virtual -sal_Bool SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) +bool SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { com::sun::star::uno::Reference < com::sun::star::script::XTypeConverter > xConverter - ( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.script.Converter")), + ( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"))), com::sun::star::uno::UNO_QUERY ); com::sun::star::uno::Sequence< sal_Int8 > aSeq; com::sun::star::uno::Any aNew; @@ -94,21 +95,22 @@ sal_Bool SfxGlobalNameItem::PutValue( const com::sun::star::uno::Any& rVal, sal_ if ( aSeq.getLength() == 16 ) { m_aName.MakeFromMemory( (void*) aSeq.getConstArray() ); - return sal_True; + return true; } - DBG_ERROR( "SfxGlobalNameItem::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "SfxGlobalNameItem::PutValue - Wrong type!" ); + return true; } //---------------------------------------------------------------------------- // virtual -sal_Bool SfxGlobalNameItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const +bool SfxGlobalNameItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { com::sun::star::uno::Sequence< sal_Int8 > aSeq( 16 ); void* pData = ( void* ) &m_aName.GetCLSID(); memcpy( aSeq.getArray(), pData, 16 ); rVal <<= aSeq; - return sal_True; + return true; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx index 66bc832c8125..f8d575b52175 100644 --- a/svl/source/items/ilstitem.cxx +++ b/svl/source/items/ilstitem.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. @@ -75,25 +76,25 @@ SfxPoolItem* SfxIntegerListItem::Clone( SfxItemPool * ) const return new SfxIntegerListItem( *this ); } -sal_Bool SfxIntegerListItem::PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 ) +bool SfxIntegerListItem::PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { ::com::sun::star::uno::Reference < ::com::sun::star::script::XTypeConverter > xConverter - ( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.script.Converter")), + ( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"))), ::com::sun::star::uno::UNO_QUERY ); ::com::sun::star::uno::Any aNew; try { aNew = xConverter->convertTo( rVal, ::getCppuType((const ::com::sun::star::uno::Sequence < sal_Int32 >*)0) ); } catch (::com::sun::star::uno::Exception&) { - return sal_False; + return true; } return ( aNew >>= m_aList ); } -sal_Bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const +bool SfxIntegerListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { rVal <<= m_aList; - return sal_True; + return true; } void SfxIntegerListItem::GetList( SvULongs& rList ) const @@ -101,3 +102,5 @@ void SfxIntegerListItem::GetList( SvULongs& rList ) const for ( sal_Int32 n=0; n<m_aList.getLength(); n++ ) rList.Insert( m_aList[n], sal::static_int_cast< sal_uInt16 >(n) ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/imageitm.cxx b/svl/source/items/imageitm.cxx index cd91f082ee1f..4daa24f2a442 100644 --- a/svl/source/items/imageitm.cxx +++ b/svl/source/items/imageitm.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. @@ -87,7 +88,7 @@ int SfxImageItem::operator==( const SfxPoolItem& rItem ) const return( ((SfxImageItem&) rItem).GetValue() == GetValue() && (*pImp == *(((SfxImageItem&)rItem).pImp) ) ); } -sal_Bool SfxImageItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const +bool SfxImageItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aSeq( 4 ); aSeq[0] = ::com::sun::star::uno::makeAny( GetValue() ); @@ -96,10 +97,10 @@ sal_Bool SfxImageItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) c aSeq[3] = ::com::sun::star::uno::makeAny( rtl::OUString( pImp->aURL )); rVal = ::com::sun::star::uno::makeAny( aSeq ); - return sal_True; + return true; } -sal_Bool SfxImageItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) +bool SfxImageItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aSeq; if (( rVal >>= aSeq ) && ( aSeq.getLength() == 4 )) @@ -112,10 +113,10 @@ sal_Bool SfxImageItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 aSeq[2] >>= pImp->bMirrored; if ( aSeq[3] >>= aURL ) pImp->aURL = aURL; - return sal_True; + return true; } - return sal_False; + return false; } void SfxImageItem::SetRotation( long nValue ) @@ -143,3 +144,4 @@ String SfxImageItem::GetURL() const return pImp->aURL; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/intitem.cxx b/svl/source/items/intitem.cxx index 13c691123537..85f9d309f435 100644 --- a/svl/source/items/intitem.cxx +++ b/svl/source/items/intitem.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. @@ -111,26 +112,26 @@ SfxItemPresentation SfxInt16Item::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool SfxInt16Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const +bool SfxInt16Item::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { sal_Int16 nValue = m_nValue; rVal <<= nValue; - return sal_True; + return true; } //============================================================================ // virtual -sal_Bool SfxInt16Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 ) +bool SfxInt16Item::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 ) { sal_Int16 nValue = sal_Int16(); if (rVal >>= nValue) { m_nValue = nValue; - return sal_True; + return true; } - DBG_ERROR( "SfxInt16Item::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "SfxInt16Item::PutValue - Wrong type!" ); + return false; } //============================================================================ @@ -239,20 +240,21 @@ SfxMetricItem::SfxMetricItem(const SfxMetricItem & rItem): //============================================================================ // virtual -int SfxMetricItem::ScaleMetrics(long nMult, long nDiv) +bool SfxMetricItem::ScaleMetrics(long nMult, long nDiv) { BigInt aTheValue(GetValue()); aTheValue *= nMult; aTheValue += nDiv / 2; aTheValue /= nDiv; SetValue(aTheValue); - return 1; + return true; } //============================================================================ // virtual -int SfxMetricItem::HasMetrics() const +bool SfxMetricItem::HasMetrics() const { - return 1; + return true; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itemiter.cxx b/svl/source/items/itemiter.cxx index 57b5dc8e727c..cd349a8c9321 100644 --- a/svl/source/items/itemiter.cxx +++ b/svl/source/items/itemiter.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. @@ -28,9 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif - #include <svl/itemiter.hxx> #include <svl/itempool.hxx> #include <svl/itemset.hxx> @@ -117,3 +115,4 @@ const SfxPoolItem* SfxItemIter::PrevItem() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index c5c0aa68addf..6d9346a3ac5c 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.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. @@ -30,8 +31,6 @@ #include <string.h> #include <stdio.h> -#ifndef GCC -#endif #include <svl/itempool.hxx> #include "whassert.hxx" @@ -74,7 +73,7 @@ const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( sal_uInt16 nWhich ) const // ----------------------------------------------------------------------- -inline FASTBOOL SfxItemPool::IsItemFlag_Impl( sal_uInt16 nPos, sal_uInt16 nFlag ) const +inline bool SfxItemPool::IsItemFlag_Impl( sal_uInt16 nPos, sal_uInt16 nFlag ) const { sal_uInt16 nItemFlag = pItemInfos[nPos]._nFlags; return nFlag == (nItemFlag & nFlag); @@ -82,7 +81,7 @@ inline FASTBOOL SfxItemPool::IsItemFlag_Impl( sal_uInt16 nPos, sal_uInt16 nFlag // ----------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const +bool SfxItemPool::IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const { for ( const SfxItemPool *pPool = this; pPool; pPool = pPool->pSecondary ) { @@ -118,7 +117,7 @@ SfxItemPool::SfxItemPool #ifndef TF_POOLABLE sal_uInt16* pSlotIdArray, /* Zuordnung von Slot-Ids zu Which-Ids */ #endif - FASTBOOL bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */ + bool bLoadRefCounts /* Ref-Counts mitladen oder auf 1 setzen */ ) /* [Beschreibung] @@ -179,7 +178,7 @@ SfxItemPool::SfxItemPool pImp->nInitRefCount = 1; pImp->nVerStart = nStart; pImp->nVerEnd = nEnd; - pImp->bInSetItem = sal_False; + pImp->bInSetItem = false; pImp->nStoringStart = nStartWhich; pImp->nStoringEnd = nEndWhich; @@ -238,7 +237,7 @@ SfxItemPool::SfxItemPool pImp->nInitRefCount = 1; pImp->nVerStart = rPool.pImp->nVerStart; pImp->nVerEnd = rPool.pImp->nVerEnd; - pImp->bInSetItem = sal_False; + pImp->bInSetItem = false; pImp->nStoringStart = nStart; pImp->nStoringEnd = nEnd; @@ -399,7 +398,7 @@ void SfxItemPool::Free(SfxItemPool* pPool) { // tell all the registered SfxItemPoolUsers that the pool is in destruction SfxItemPoolUserVector aListCopy(pPool->maSfxItemPoolUsers.begin(), pPool->maSfxItemPoolUsers.end()); - for(SfxItemPoolUserVector::iterator aIterator = aListCopy.begin(); aIterator != aListCopy.end(); aIterator++) + for(SfxItemPoolUserVector::iterator aIterator = aListCopy.begin(); aIterator != aListCopy.end(); ++aIterator) { SfxItemPoolUser* pSfxItemPoolUser = *aIterator; DBG_ASSERT(pSfxItemPoolUser, "corrupt SfxItemPoolUser list (!)"); @@ -449,7 +448,7 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool ) for( size_t i = (*ppItemArr)->size(); i; ++ppHtArr, --i ) if ( !(*ppHtArr) ) { - DBG_ERROR( "old secondary pool must be empty" ); + OSL_FAIL( "old secondary pool must be empty" ); bOK = sal_False; break; } @@ -748,7 +747,7 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich { if ( pSecondary ) return pSecondary->Put( rItem, nWhich ); - DBG_ERROR( "unknown Which-Id - cannot put item" ); + OSL_FAIL( "unknown Which-Id - cannot put item" ); } // SID oder nicht poolable (neue Definition)? @@ -882,7 +881,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem ) pSecondary->Remove( rItem ); return; } - DBG_ERROR( "unknown Which-Id - cannot remove item" ); + OSL_FAIL( "unknown Which-Id - cannot remove item" ); } // SID oder nicht poolable (neue Definition)? @@ -1166,3 +1165,4 @@ void SfxItemPool::SetFileFormatVersion( sal_uInt16 nFileFormatVersion ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx index eb146afe893b..95ae5f4e71ec 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.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. @@ -32,7 +33,7 @@ #include <svl/itempool.hxx> #include <svl/itemset.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> -#include <hash_map> +#include <boost/unordered_map.hpp> /************************************************************************* UNO III Implementation *************************************************************************/ @@ -41,10 +42,6 @@ using namespace com::sun::star::beans; using namespace com::sun::star::lang; using namespace com::sun::star::uno; -/*-- 16.02.2009 10:03:55--------------------------------------------------- - - -----------------------------------------------------------------------*/ - struct equalOUString { bool operator()(const ::rtl::OUString& r1, const ::rtl::OUString& r2) const @@ -53,7 +50,7 @@ struct equalOUString } }; -typedef ::std::hash_map< ::rtl::OUString, +typedef ::boost::unordered_map< ::rtl::OUString, SfxItemPropertySimpleEntry, ::rtl::OUStringHash, equalOUString > SfxItemPropertyHashMap_t; @@ -72,9 +69,6 @@ SfxItemPropertyMap_Impl::SfxItemPropertyMap_Impl( const SfxItemPropertyMap_Impl* m_aPropSeq = pSource->m_aPropSeq; } -/*-- 16.02.2009 10:03:51--------------------------------------------------- - - -----------------------------------------------------------------------*/ SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries ) : m_pImpl( new SfxItemPropertyMap_Impl ) { @@ -85,23 +79,17 @@ SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries ++pEntries; } } -/*-- 16.02.2009 12:46:41--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMap* pSource ) : m_pImpl( new SfxItemPropertyMap_Impl( pSource->m_pImpl ) ) { } -/*-- 16.02.2009 10:03:51--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxItemPropertyMap::~SfxItemPropertyMap() { delete m_pImpl; } -/*-- 16.02.2009 10:03:51--------------------------------------------------- - -----------------------------------------------------------------------*/ const SfxItemPropertySimpleEntry* SfxItemPropertyMap::getByName( const ::rtl::OUString &rName ) const { SfxItemPropertyHashMap_t::const_iterator aIter = m_pImpl->find(rName); @@ -110,9 +98,6 @@ const SfxItemPropertySimpleEntry* SfxItemPropertyMap::getByName( const ::rtl::OU return &aIter->second; } -/*-- 16.02.2009 10:44:24--------------------------------------------------- - - -----------------------------------------------------------------------*/ uno::Sequence<beans::Property> SfxItemPropertyMap::getProperties() const { if( !m_pImpl->m_aPropSeq.getLength() ) @@ -138,9 +123,7 @@ uno::Sequence<beans::Property> SfxItemPropertyMap::getProperties() const return m_pImpl->m_aPropSeq; } -/*-- 16.02.2009 11:04:31--------------------------------------------------- - -----------------------------------------------------------------------*/ beans::Property SfxItemPropertyMap::getPropertyByName( const ::rtl::OUString rName ) const throw( beans::UnknownPropertyException ) { @@ -156,17 +139,13 @@ beans::Property SfxItemPropertyMap::getPropertyByName( const ::rtl::OUString rNa aProp.Attributes = sal::static_int_cast< sal_Int16 >(pEntry->nFlags); return aProp; } -/*-- 16.02.2009 11:09:16--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_Bool SfxItemPropertyMap::hasPropertyByName( const ::rtl::OUString& rName ) const { SfxItemPropertyHashMap_t::const_iterator aIter = m_pImpl->find(rName); return aIter != m_pImpl->end(); } -/*-- 16.02.2009 11:25:14--------------------------------------------------- - -----------------------------------------------------------------------*/ void SfxItemPropertyMap::mergeProperties( const uno::Sequence< beans::Property >& rPropSeq ) { const beans::Property* pPropArray = rPropSeq.getConstArray(); @@ -181,9 +160,7 @@ void SfxItemPropertyMap::mergeProperties( const uno::Sequence< beans::Property > (*m_pImpl)[pPropArray[nElement].Name] = aTemp; } } -/*-- 18.02.2009 12:04:42--------------------------------------------------- - -----------------------------------------------------------------------*/ PropertyEntryVector_t SfxItemPropertyMap::getPropertyEntries() const { PropertyEntryVector_t aRet; @@ -198,29 +175,21 @@ PropertyEntryVector_t SfxItemPropertyMap::getPropertyEntries() const } return aRet; } -/*-- 18.02.2009 15:11:06--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_uInt32 SfxItemPropertyMap::getSize() const { return m_pImpl->size(); } -/*-- 16.02.2009 13:44:54--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxItemPropertySet::~SfxItemPropertySet() { } -/* -----------------------------21.02.00 11:26-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SfxItemPropertySet::FillItem(SfxItemSet&, sal_uInt16, sal_Bool) const { return sal_False; } -/* -----------------------------06.06.01 12:32-------------------------------- - ---------------------------------------------------------------------------*/ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEntry, const SfxItemSet& rSet, Any& rAny ) const throw(RuntimeException) @@ -256,9 +225,7 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn rAny.setValue( &nTmp, *rEntry.pType ); } } -/* -----------------------------06.06.01 12:32-------------------------------- - ---------------------------------------------------------------------------*/ void SfxItemPropertySet::getPropertyValue( const rtl::OUString &rName, const SfxItemSet& rSet, Any& rAny ) const throw(RuntimeException, UnknownPropertyException) @@ -269,9 +236,7 @@ void SfxItemPropertySet::getPropertyValue( const rtl::OUString &rName, throw UnknownPropertyException(); getPropertyValue( *pEntry,rSet, rAny ); } -/* -----------------------------21.02.00 11:26-------------------------------- - ---------------------------------------------------------------------------*/ Any SfxItemPropertySet::getPropertyValue( const rtl::OUString &rName, const SfxItemSet& rSet ) const throw(RuntimeException, UnknownPropertyException) @@ -280,9 +245,7 @@ Any SfxItemPropertySet::getPropertyValue( const rtl::OUString &rName, getPropertyValue( rName,rSet, aVal ); return aVal; } -/* -----------------------------15.11.00 14:46-------------------------------- - ---------------------------------------------------------------------------*/ void SfxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry& rEntry, const Any& aVal, SfxItemSet& rSet ) const @@ -321,9 +284,7 @@ void SfxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry& rEn delete pNewItem; } } -/* -----------------------------21.02.00 11:26-------------------------------- - ---------------------------------------------------------------------------*/ void SfxItemPropertySet::setPropertyValue( const rtl::OUString &rName, const Any& aVal, SfxItemSet& rSet ) const @@ -338,9 +299,7 @@ void SfxItemPropertySet::setPropertyValue( const rtl::OUString &rName, } setPropertyValue(*pEntry, aVal, rSet); } -/* -----------------------------21.02.00 11:26-------------------------------- - ---------------------------------------------------------------------------*/ PropertyState SfxItemPropertySet::getPropertyState(const SfxItemPropertySimpleEntry& rEntry, const SfxItemSet& rSet) const throw() { @@ -382,9 +341,7 @@ PropertyState SfxItemPropertySet::getPropertyState( eRet = PropertyState_AMBIGUOUS_VALUE; return eRet; } -/* -----------------------------21.02.00 11:26-------------------------------- - ---------------------------------------------------------------------------*/ Reference<XPropertySetInfo> SfxItemPropertySet::getPropertySetInfo() const { @@ -392,75 +349,57 @@ Reference<XPropertySetInfo> m_xInfo = new SfxItemPropertySetInfo( &m_aMap ); return m_xInfo; } -/*-- 16.02.2009 13:49:25--------------------------------------------------- - -----------------------------------------------------------------------*/ struct SfxItemPropertySetInfo_Impl { SfxItemPropertyMap* m_pOwnMap; }; -/*-- 16.02.2009 13:49:24--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxItemPropertySetInfo::SfxItemPropertySetInfo(const SfxItemPropertyMap *pMap ) : m_pImpl( new SfxItemPropertySetInfo_Impl ) { m_pImpl->m_pOwnMap = new SfxItemPropertyMap( pMap ); } -/*-- 16.02.2009 13:49:25--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxItemPropertySetInfo::SfxItemPropertySetInfo(const SfxItemPropertyMapEntry *pEntries ) : m_pImpl( new SfxItemPropertySetInfo_Impl ) { m_pImpl->m_pOwnMap = new SfxItemPropertyMap( pEntries ); } -/* -----------------------------21.02.00 11:09-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< Property > SAL_CALL SfxItemPropertySetInfo::getProperties( ) throw(RuntimeException) { return m_pImpl->m_pOwnMap->getProperties(); } -/*-- 16.02.2009 13:49:27--------------------------------------------------- - -----------------------------------------------------------------------*/ const SfxItemPropertyMap* SfxItemPropertySetInfo::getMap() const { return m_pImpl->m_pOwnMap; } -/*-- 16.02.2009 12:43:36--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxItemPropertySetInfo::~SfxItemPropertySetInfo() { delete m_pImpl->m_pOwnMap; delete m_pImpl; } -/* -----------------------------21.02.00 11:27-------------------------------- - ---------------------------------------------------------------------------*/ Property SAL_CALL SfxItemPropertySetInfo::getPropertyByName( const ::rtl::OUString& rName ) throw(UnknownPropertyException, RuntimeException) { return m_pImpl->m_pOwnMap->getPropertyByName( rName ); } -/* -----------------------------21.02.00 11:28-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SAL_CALL SfxItemPropertySetInfo::hasPropertyByName( const ::rtl::OUString& rName ) throw(RuntimeException) { return m_pImpl->m_pOwnMap->hasPropertyByName( rName ); } -/* -----------------------------21.02.00 12:03-------------------------------- - ---------------------------------------------------------------------------*/ SfxExtItemPropertySetInfo::SfxExtItemPropertySetInfo( const SfxItemPropertyMapEntry *pMap, const Sequence<Property>& rPropSeq ) : @@ -468,32 +407,24 @@ SfxExtItemPropertySetInfo::SfxExtItemPropertySetInfo( { aExtMap.mergeProperties( rPropSeq ); } -/*-- 16.02.2009 12:06:49--------------------------------------------------- - -----------------------------------------------------------------------*/ SfxExtItemPropertySetInfo::~SfxExtItemPropertySetInfo() { } -/* -----------------------------21.02.00 12:03-------------------------------- - ---------------------------------------------------------------------------*/ Sequence< Property > SAL_CALL SfxExtItemPropertySetInfo::getProperties( ) throw(RuntimeException) { return aExtMap.getProperties(); } -/* -----------------------------21.02.00 12:03-------------------------------- - ---------------------------------------------------------------------------*/ Property SAL_CALL SfxExtItemPropertySetInfo::getPropertyByName( const rtl::OUString& rPropertyName ) throw(UnknownPropertyException, RuntimeException) { return aExtMap.getPropertyByName( rPropertyName ); } -/* -----------------------------21.02.00 12:03-------------------------------- - ---------------------------------------------------------------------------*/ sal_Bool SAL_CALL SfxExtItemPropertySetInfo::hasPropertyByName( const rtl::OUString& rPropertyName ) throw(RuntimeException) @@ -501,3 +432,4 @@ SfxExtItemPropertySetInfo::hasPropertyByName( const rtl::OUString& rPropertyName return aExtMap.hasPropertyByName( rPropertyName ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 250e7f99a6ec..78fbd27e8bdb 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.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. @@ -30,10 +31,7 @@ #include <string.h> -#if STLPORT_VERSION>=321 #include <cstdarg> -#endif - #define _SVSTDARR_USHORTS #define _SVSTDARR_ULONGS @@ -51,7 +49,7 @@ // STATIC DATA ----------------------------------------------------------- static const sal_uInt16 nInitCount = 10; // einzelne USHORTs => 5 Paare ohne '0' -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 static sal_uLong nRangesCopyCount = 0; // wie oft wurden Ranges kopiert #endif @@ -235,7 +233,9 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool, void SfxItemSet::InitRanges_Impl(const sal_uInt16 *pWhichPairTable) { DBG_CHKTHIS(SfxItemSet, 0); - DBG_TRACE1("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount); + #if OSL_DEBUG_LEVEL > 1 + OSL_TRACE("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount); + #endif sal_uInt16 nCnt = 0; const sal_uInt16* pPtr = pWhichPairTable; @@ -315,7 +315,9 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ): *ppDst = &_pPool->Put( **ppSrc ); // dann noch die Which Ranges kopieren - DBG_TRACE1("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount); + #if OSL_DEBUG_LEVEL > 1 + OSL_TRACE("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount); + #endif std::ptrdiff_t cnt = pPtr - rASet._pWhichRanges+1; _pWhichRanges = new sal_uInt16[ cnt ]; memcpy( _pWhichRanges, rASet._pWhichRanges, sizeof( sal_uInt16 ) * cnt); @@ -726,7 +728,7 @@ void SfxItemSet::PutExtended break; default: - DBG_ERROR( "invalid Argument for eDontCareAs" ); + OSL_FAIL( "invalid Argument for eDontCareAs" ); } } else @@ -751,7 +753,7 @@ void SfxItemSet::PutExtended break; default: - DBG_ERROR( "invalid Argument for eDefaultAs" ); + OSL_FAIL( "invalid Argument for eDefaultAs" ); } } pPtr += 2; @@ -973,7 +975,7 @@ const SfxPoolItem* SfxItemSet::GetItem return pItem; // sonst Fehler melden - DBG_ERROR( "invalid argument type" ); + OSL_FAIL( "invalid argument type" ); } // kein Item gefunden oder falschen Typ gefunden @@ -1498,7 +1500,7 @@ sal_uInt16 SfxItemSet::GetWhichByPos( sal_uInt16 nPos ) const SvStream &SfxItemSet::Store ( SvStream& rStream, // Zielstream f"ur normale Items - FASTBOOL bDirect // sal_True: Items direkt speicher, sal_False: Surrogate + bool bDirect // TRUE: Items direkt speicher, FALSE: Surrogate ) const /* [Beschreibung] @@ -1565,7 +1567,7 @@ SvStream &SfxItemSet::Load ( SvStream& rStream, // Stream, aus dem geladen werden soll - FASTBOOL bDirect, /* sal_True + bool bDirect, /* TRUE Items werden direkt aus dem Stream gelesen, nicht "uber Surrogate @@ -2039,73 +2041,6 @@ void SfxItemSet::DisableItem(sal_uInt16 nWhich) // ----------------------------------------------------------------------- -#if 0 -sal_Bool SfxAllItemSet::Remove(sal_uInt16 nWhich) -{ - DBG_CHKTHIS(SfxAllItemSet, 0); - sal_uInt16 *pPtr = _pWhichRanges; - sal_uInt16 nPos = 0; - while( *pPtr ) - { - if( *pPtr <= nWhich && nWhich <= *(pPtr+1) ) - { - sal_uInt16 *pTmp = pPtr; - sal_uInt16 nLeft = 0; - sal_uInt16 nRest = 0; - while(*++pTmp){ - if( nLeft & 1 ) - nRest = *pTmp - *(pTmp-1) + 1; - ++nLeft; - } - - // in diesem Bereich - nPos += nWhich - *pPtr; - nRest -= nWhich - *pPtr; - // 3,3 - if(*pPtr == nWhich && *(pPtr+1) == nWhich) { - memmove(pPtr, pPtr + 2, nLeft * sizeof(sal_uInt16)); - nFree += 2; - } - // Anfang - else if(*pPtr == nWhich) - (*pPtr)++; - // Ende - else if(*(pPtr+1) == nWhich) - (*(pPtr+1))--; - else { - if(nPos + nRest + 2 > nFree) { - sal_uInt16 nOf = pPtr - _pWhichRanges; - _pWhichRanges = IncrSize(_pWhichRanges, nPos + nRest, nInitCount); - nFree += nInitCount; - pPtr = _pWhichRanges + nOf; - } - memmove(pPtr +2, pPtr, (nLeft+2) * sizeof(sal_uInt16)); - *++pPtr = nWhich-1; - *++pPtr = nWhich+1; - nFree -= 2; - } - SfxPoolItem* pItem = *( _aItems + nPos ); - if( pItem ) - { - if(_pPool) - _pPool->Remove(*pItem ); - else - delete pItem; - --_nCount; - } - memmove(_aItems + nPos +1, _aItems + nPos, - sizeof(SfxPoolItem *) * (nRest - 1)); - break; // dann beim Parent suchen - } - nPos += *(pPtr+1) - *pPtr + 1; - pPtr += 2; - } - return *pPtr? sal_True: sal_False; -} -#endif - -// ----------------------------------------------------------------------- - SfxItemSet *SfxAllItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const { DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet); @@ -2120,3 +2055,4 @@ SfxItemSet *SfxAllItemSet::Clone(sal_Bool bItems, SfxItemPool *pToPool ) const return bItems ? new SfxAllItemSet(*this) : new SfxAllItemSet(*_pPool); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/lckbitem.cxx b/svl/source/items/lckbitem.cxx index 433bfeec1e8e..872420a35322 100644 --- a/svl/source/items/lckbitem.cxx +++ b/svl/source/items/lckbitem.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. @@ -137,7 +138,7 @@ SvStream& SfxLockBytesItem::Store(SvStream &rStream, sal_uInt16 ) const //---------------------------------------------------------------------------- // virtual -sal_Bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) +bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { com::sun::star::uno::Sequence< sal_Int8 > aSeq; if ( rVal >>= aSeq ) @@ -153,16 +154,16 @@ sal_Bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, sal_u else _xVal = NULL; - return sal_True; + return true; } - DBG_ERROR( "SfxLockBytesItem::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "SfxLockBytesItem::PutValue - Wrong type!" ); + return true; } //---------------------------------------------------------------------------- // virtual -sal_Bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 ) const +bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { if ( _xVal.Is() ) { @@ -172,7 +173,7 @@ sal_Bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 if ( _xVal->Stat( &aStat, SVSTATFLAG_DEFAULT ) == ERRCODE_NONE ) nLen = aStat.nSize; else - return sal_False; + return false; sal_uLong nRead = 0; com::sun::star::uno::Sequence< sal_Int8 > aSeq( nLen ); @@ -186,6 +187,7 @@ sal_Bool SfxLockBytesItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 rVal <<= aSeq; } - return sal_True; + return true; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx index 1cd7e194d266..b9c6ddc79cec 100644 --- a/svl/source/items/macitem.cxx +++ b/svl/source/items/macitem.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. @@ -29,9 +30,6 @@ #include "precompiled_svl.hxx" #include <tools/stream.hxx> -#ifndef GCC -#endif - #include <svl/macitem.hxx> // STATIC DATA ----------------------------------------------------------- @@ -293,3 +291,4 @@ sal_uInt16 SvxMacroItem::GetVersion( sal_uInt16 nFileFormatVersion ) const ? 0 : aMacroTable.GetVersion(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/nranges.cxx b/svl/source/items/nranges.cxx index 3684a748db14..db0dc169c9dc 100644 --- a/svl/source/items/nranges.cxx +++ b/svl/source/items/nranges.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. @@ -575,7 +576,7 @@ SfxNumRanges& SfxNumRanges::operator -= } // we should never be here - DBG_ERROR( "SfxNumRanges::operator-=: internal error" ); + OSL_FAIL( "SfxNumRanges::operator-=: internal error" ); } // while pTarget[ nTargetPos ] = 0; @@ -594,64 +595,6 @@ SfxNumRanges& SfxNumRanges::operator -= delete [] pTarget; return *this; - - /* untested code from MI commented out (MDA, 28.01.97) - do - { - // 1st range is smaller than 2nd range? - if ( pRange1[1] < pRange2[0] ) - // => keep 1st range - pRange1 += 2; - - // 2nd range is smaller than 1st range? - else if ( pRange2[1] < pRange1[0] ) - // => skip 2nd range - pRange2 += 2; - - // 2nd range totally overlaps the 1st range? - else if ( pRange2[0] <= pRange1[0] && pRange2[1] >= pRange1[1] ) - // => remove 1st range - memmove( pRange1, pRange1+2, sizeof(NUMTYPE) * (pEndOfTarget-pRange1+2) ); - - // 2nd range overlaps only the beginning of 1st range? - else if ( pRange2[0] <= pRange1[0] && pRange2[1] < pRange1[1] ) - { - // => cut the beginning of 1st range and goto next 2nd range - pRange1[0] = pRange2[1] + 1; - pRange2 += 2; - } - - // 2nd range overlaps only the end of 1st range? - else if ( pRange2[0] > pRange1[0] && pRange2[1] >= pRange1[0] ) - // => cut the beginning of 1st range - pRange1[0] = pRange2[1]+1; - - // 2nd range is a real subset of 1st range - else - { - // => split 1st range and goto next 2nd range - memmove( pRange1+3, pRange1+1, sizeof(NUMTYPE) * (pEndOfTarget-pRange1-1) ); - pRange1[1] = pRange2[0] - 1; - pRange1[2] = pRange2[1] + 1; - pRange1 += 2; - pRange2 += 2; - } - } - while ( *pRange1 && *pRange2 ); - - // assign the differentiated ranges - delete[] _pRanges; - NUMTYPE nUShorts = Count_Impl(pTarget) + 1; - if ( 1 != nUShorts ) - { - _pRanges = new NUMTYPE[ nUShorts ]; - memcpy( _pRanges, pTarget, nUShorts * sizeof(NUMTYPE) ); - _pRanges[ nUShorts-1 ] = 0; - } - else - _pRanges = 0; - return *this; - */ } //------------------------------------------------------------------------ @@ -848,3 +791,5 @@ sal_Bool SfxNumRanges::Contains( NUMTYPE n ) const return sal_False; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/poolcach.cxx b/svl/source/items/poolcach.cxx index 6e13a3b77485..9a2b109682b5 100644 --- a/svl/source/items/poolcach.cxx +++ b/svl/source/items/poolcach.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. @@ -30,9 +31,6 @@ #include <limits.h> -#ifndef GCC -#endif - #include <svl/itempool.hxx> #include <svl/itemset.hxx> #include <svl/poolcach.hxx> @@ -142,3 +140,4 @@ const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, sal_Bo +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index ec55ba09195c..f9ddc18a2318 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.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. @@ -31,9 +32,6 @@ #include <string.h> #include <stdio.h> -#ifndef GCC -#endif - #include <tools/solar.h> #include <svl/itempool.hxx> #include "whassert.hxx" @@ -202,8 +200,10 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const SfxMultiMixRecordWriter aWhichIdsRec( &rStream, SFX_ITEMPOOL_REC_WHICHIDS, 0 ); // erst Atomaren-Items und dann die Sets schreiben (wichtig beim Laden) - for ( pImp->bInSetItem = sal_False; pImp->bInSetItem <= sal_True && !rStream.GetError(); ++pImp->bInSetItem ) + for (int ft = 0 ; ft < 2 && !rStream.GetError(); ft++) { + pImp->bInSetItem = ft != 0; + SfxPoolItemArray_Impl **pArr = pImp->ppPoolItems; SfxPoolItem **ppDefItem = ppStaticDefaults; const sal_uInt16 nSize = GetSize_Impl(); @@ -274,7 +274,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const } } - pImp->bInSetItem = sal_False; + pImp->bInSetItem = false; } // die gesetzten Defaults speichern (Pool-Defaults) @@ -625,7 +625,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) } // Items laden - FASTBOOL bSecondaryLoaded = sal_False; + bool bSecondaryLoaded = false; long nSecondaryEnd = 0; { SfxMultiRecordReader aWhichIdsRec( &rStream, SFX_ITEMPOOL_REC_WHICHIDS); @@ -665,7 +665,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) // Sekund"arpool einlesen pSecondary->Load( rStream ); - bSecondaryLoaded = sal_True; + bSecondaryLoaded = true; nSecondaryEnd = rStream.Tell(); // zur"uck zu unseren eigenen Items @@ -818,7 +818,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) // Items laden rStream.Seek( nStartPos ); CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_ITEMS ); - FASTBOOL bSecondaryLoaded = sal_False; + bool bSecondaryLoaded = false; long nSecondaryEnd = 0; sal_uInt16 nWhich, nSlot; while ( rStream >> nWhich, nWhich ) @@ -867,7 +867,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) // Sekund"arpool einlesen pSecondary->Load1_Impl( rStream ); - bSecondaryLoaded = sal_True; + bSecondaryLoaded = true; nSecondaryEnd = rStream.Tell(); // zur"uck zu unseren eigenen Items @@ -1090,7 +1090,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate // auf jeden Fall aufgel"ost werden. if ( !pRefPool ) pRefPool = this; - FASTBOOL bResolvable = pRefPool->GetName().Len() > 0; + bool bResolvable = pRefPool->GetName().Len() > 0; if ( !bResolvable ) { // Bei einem anders aufgebauten Pool im Stream, mu\s die SlotId @@ -1125,7 +1125,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate : 0; if ( !pItem ) { - DBG_ERROR( "can't resolve surrogate" ); + OSL_FAIL( "can't resolve surrogate" ); rWhich = 0; // nur zur Sicherheit fuer richtige Stream-Pos return 0; } @@ -1153,7 +1153,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate //------------------------------------------------------------------------- -FASTBOOL SfxItemPool::StoreSurrogate +bool SfxItemPool::StoreSurrogate ( SvStream& rStream, const SfxPoolItem* pItem @@ -1166,7 +1166,7 @@ FASTBOOL SfxItemPool::StoreSurrogate [R"uckgabewert] - FASTBOOL sal_True + bool TRUE es wurde ein echtes Surrogat gespeichert, auch SFX_ITEMS_NULL bei 'pItem==0', SFX_ITEMS_STATICDEFAULT und SFX_ITEMS_POOLDEFAULT @@ -1181,7 +1181,7 @@ FASTBOOL SfxItemPool::StoreSurrogate { if ( pItem ) { - FASTBOOL bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE); + bool bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE); rStream << ( bRealSurrogate ? GetSurrogate( pItem ) : SFX_ITEMS_DIRECT ); @@ -1227,7 +1227,7 @@ sal_uInt32 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const // ----------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsInStoringRange( sal_uInt16 nWhich ) const +bool SfxItemPool::IsInStoringRange( sal_uInt16 nWhich ) const { return nWhich >= pImp->nStoringStart && nWhich <= pImp->nStoringEnd; @@ -1444,14 +1444,14 @@ sal_uInt16 SfxItemPool::GetNewWhich // ----------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsInVersionsRange( sal_uInt16 nWhich ) const +bool SfxItemPool::IsInVersionsRange( sal_uInt16 nWhich ) const { return nWhich >= pImp->nVerStart && nWhich <= pImp->nVerEnd; } // ----------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsCurrentVersionLoading() const +bool SfxItemPool::IsCurrentVersionLoading() const /* [Beschreibung] @@ -1542,7 +1542,7 @@ sal_uInt16 SfxItemPool::GetLoadingVersion() const //------------------------------------------------------------------------- -FASTBOOL SfxItemPool::IsVer2_Impl() const +bool SfxItemPool::IsVer2_Impl() const { return pMaster->pImp->nMajorVer >= 2; } @@ -1550,8 +1550,8 @@ FASTBOOL SfxItemPool::IsVer2_Impl() const //------------------------------------------------------------------------- -FASTBOOL SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, - FASTBOOL bDirect ) const +bool SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, + bool bDirect ) const /* [Beschreibung] @@ -1576,7 +1576,7 @@ FASTBOOL SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, [Querverweise] - <SfxItemPool::LoadItem(SvStream&,FASTBOOL)const> + <SfxItemPool::LoadItem(SvStream&,bool)const> */ { @@ -1616,7 +1616,7 @@ FASTBOOL SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, //------------------------------------------------------------------------- -const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect, +const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect, const SfxItemPool *pRefPool ) // pRefPool==-1 => nicht putten! @@ -1650,7 +1650,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect, } // wird eine andere Version geladen? - FASTBOOL bCurVersion = pRefPool->IsCurrentVersionLoading(); + bool bCurVersion = pRefPool->IsCurrentVersionLoading(); if ( !bCurVersion ) // Which-Id auf neue Version mappen nWhich = pRefPool->GetNewWhich( nWhich ); @@ -1711,3 +1711,4 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, FASTBOOL bDirect, } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index 8626daeffbd5..ec2909fbd9ad 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.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. @@ -360,75 +361,6 @@ SfxPoolItem* SfxVoidItem::Clone(SfxItemPool *) const } // SfxInvalidItem --------------------------------------------------------- -#if 0 /* @@@ NOT USED @@@ */ -SfxInvalidItem::SfxInvalidItem( sal_uInt16 nWhich, const SfxPoolItem &rDefault ): - SfxPoolItem(nWhich), - pDefaultItem(&rDefault) -{ - DBG_CTOR(SfxInvalidItem, 0); -} - -// ------------------------------------------------------------------------ -SfxInvalidItem::SfxInvalidItem( const SfxInvalidItem& rCopy): - SfxPoolItem(rCopy), - pDefaultItem(rCopy.pDefaultItem) -{ - DBG_CTOR(SfxInvalidItem, 0); - //! pDefaultItem->ReleaseRef? -} - -// ------------------------------------------------------------------------ -SfxInvalidItem::~SfxInvalidItem() -{ - DBG_DTOR(SfxInvalidItem, 0); -} - -// ------------------------------------------------------------------------ -int SfxInvalidItem::operator==( const SfxPoolItem& rCmp) const -{ - DBG_CHKTHIS(SfxInvalidItem, 0); - DBG_ASSERT( SfxPoolItem::operator==(rCmp), "unequal type" ); - return *pDefaultItem == *((SfxInvalidItem&)rCmp).pDefaultItem; -} - -// ------------------------------------------------------------------------ -SfxItemPresentation SfxInvalidItem::GetPresentation -( - SfxItemPresentation ePresentation, - SfxMapUnit eCoreMetric, - SfxMapUnit ePresentationMetric, - XubString& rText, - const IntlWrapper * -) const -{ - DBG_CHKTHIS(SfxInvalidItem, 0); - rText.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Invalid")); - return SFX_ITEM_PRESENTATION_NAMELESS; -} - -// ------------------------------------------------------------------------ -SfxPoolItem* SfxInvalidItem::Clone(SfxItemPool *) const -{ - DBG_CHKTHIS(SfxInvalidItem, 0); - return new SfxInvalidItem(*this); -} - -// ------------------------------------------------------------------------ -SfxPoolItem* SfxInvalidItem::Create(SvStream &, sal_uInt16 nVersion) const -{ - DBG_CHKTHIS(SfxInvalidItem, 0); - DBG_ERROR("SfxInvalidItem::Create() ist sinnlos"); - return Clone(); -} - -// ------------------------------------------------------------------------ -SvStream& SfxInvalidItem::Store(SvStream &rStream, sal_uInt16 nItemVersion ) const -{ - DBG_CHKTHIS(SfxInvalidItem, 0); - DBG_ERROR("SfxInvalidItem::Store() ist sinnlos"); - return rStream; -} -#endif /* @@@ NOT USED @@@ */ // SfxItemHandle ---------------------------------------------------------- SfxItemHandle::SfxItemHandle(SfxPoolItem &rItem): @@ -477,48 +409,36 @@ SfxItemHandle::~SfxItemHandle() } // ------------------------------------------------------------------------ -int SfxPoolItem::ScaleMetrics( long /*lMult*/, long /*lDiv*/ ) +bool SfxPoolItem::ScaleMetrics( long /*lMult*/, long /*lDiv*/ ) { - return 0; + return false; } // ------------------------------------------------------------------------ -int SfxPoolItem::HasMetrics() const +bool SfxPoolItem::HasMetrics() const { - return 0; + return false; } // ----------------------------------------------------------------------- -#if 0 /* @@@ NOT USED @@@ */ -void SfxPoolItem::GetVersion() const -{ - DBG_ERROR( "dummy called" ); -} -// ----------------------------------------------------------------------- -void SfxPoolItem::Store(SvStream &rStream) const +bool SfxPoolItem::QueryValue( com::sun::star::uno::Any&, sal_uInt8 ) const { - DBG_ERROR( "dummy called" ); + OSL_FAIL("There is no implementation for QueryValue for this item!"); + return false; } -#endif /* @@@ NOT USED @@@ */ // ----------------------------------------------------------------------- -sal_Bool SfxPoolItem::QueryValue( com::sun::star::uno::Any&, sal_uInt8 ) const +bool SfxPoolItem::PutValue( const com::sun::star::uno::Any&, sal_uInt8 ) { - DBG_ERROR("There is no implementation for QueryValue for this item!"); - return sal_False; -} - -// ----------------------------------------------------------------------- - -sal_Bool SfxPoolItem::PutValue( const com::sun::star::uno::Any&, sal_uInt8 ) -{ - DBG_ERROR("There is no implementation for PutValue for this item!"); - return sal_False; + OSL_FAIL("There is no implementation for PutValue for this item!"); + return false; } SfxVoidItem::~SfxVoidItem() { DBG_DTOR(SfxVoidItem, 0); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/ptitem.cxx b/svl/source/items/ptitem.cxx index cd557312932c..e3d3ad5fdc1a 100644 --- a/svl/source/items/ptitem.cxx +++ b/svl/source/items/ptitem.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. @@ -139,7 +140,7 @@ SvStream& SfxPointItem::Store(SvStream &rStream, sal_uInt16 ) const // ----------------------------------------------------------------------- -sal_Bool SfxPointItem::QueryValue( uno::Any& rVal, +bool SfxPointItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); @@ -155,20 +156,20 @@ sal_Bool SfxPointItem::QueryValue( uno::Any& rVal, case 0: rVal <<= aTmp; break; case MID_X: rVal <<= aTmp.X; break; case MID_Y: rVal <<= aTmp.Y; break; - default: DBG_ERROR("Wrong MemberId!"); return sal_False; + default: OSL_FAIL("Wrong MemberId!"); return true; } - return sal_True; + return true; } // ----------------------------------------------------------------------- -sal_Bool SfxPointItem::PutValue( const uno::Any& rVal, +bool SfxPointItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; - sal_Bool bRet = sal_False; + bool bRet = false; awt::Point aValue; sal_Int32 nVal = 0; if ( !nMemberId ) @@ -194,7 +195,7 @@ sal_Bool SfxPointItem::PutValue( const uno::Any& rVal, case 0: aVal.setX( aValue.X ); aVal.setY( aValue.Y ); break; case MID_X: aVal.setX( nVal ); break; case MID_Y: aVal.setY( nVal ); break; - default: DBG_ERROR("Wrong MemberId!"); return sal_False; + default: OSL_FAIL("Wrong MemberId!"); return false; } } @@ -203,3 +204,4 @@ sal_Bool SfxPointItem::PutValue( const uno::Any& rVal, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/rectitem.cxx b/svl/source/items/rectitem.cxx index 7aae8caceac5..ddf19201e63b 100644 --- a/svl/source/items/rectitem.cxx +++ b/svl/source/items/rectitem.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. @@ -139,7 +140,7 @@ SvStream& SfxRectangleItem::Store(SvStream &rStream, sal_uInt16 ) const // ----------------------------------------------------------------------- -sal_Bool SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal, +bool SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId) const { nMemberId &= ~CONVERT_TWIPS; @@ -157,17 +158,17 @@ sal_Bool SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal, case MID_RECT_RIGHT: rVal <<= aVal.getY(); break; case MID_WIDTH: rVal <<= aVal.getWidth(); break; case MID_HEIGHT: rVal <<= aVal.getHeight(); break; - default: DBG_ERROR("Wrong MemberID!"); return sal_False; + default: OSL_FAIL("Wrong MemberID!"); return false; } - return sal_True; + return true; } // ----------------------------------------------------------------------- -sal_Bool SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal, +bool SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { - sal_Bool bRet = sal_False; + bool bRet = false; nMemberId &= ~CONVERT_TWIPS; com::sun::star::awt::Rectangle aValue; sal_Int32 nVal = 0; @@ -190,7 +191,7 @@ sal_Bool SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal, case MID_RECT_RIGHT: aVal.setY( nVal ); break; case MID_WIDTH: aVal.setWidth( nVal ); break; case MID_HEIGHT: aVal.setHeight( nVal ); break; - default: DBG_ERROR("Wrong MemberID!"); return sal_False; + default: OSL_FAIL("Wrong MemberID!"); return false; } } @@ -199,3 +200,4 @@ sal_Bool SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/rngitem.cxx b/svl/source/items/rngitem.cxx index 2bb4fb4236c9..6be0975f8535 100644 --- a/svl/source/items/rngitem.cxx +++ b/svl/source/items/rngitem.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. @@ -52,3 +53,4 @@ #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/rngitem_inc.cxx b/svl/source/items/rngitem_inc.cxx index a9d68980ec6a..5be6228f147f 100755..100644 --- a/svl/source/items/rngitem_inc.cxx +++ b/svl/source/items/rngitem_inc.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. @@ -238,3 +239,5 @@ SvStream& SfxXRangesItem::Store( SvStream &rStream, sal_uInt16 ) const #undef NUMTYPE #undef SfxXRangeItem #undef SfxXRangesItem + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/sfontitm.cxx b/svl/source/items/sfontitm.cxx index f22c1cb7c26a..61afc8a2004a 100644 --- a/svl/source/items/sfontitm.cxx +++ b/svl/source/items/sfontitm.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. @@ -137,3 +138,4 @@ SvStream & SfxFontItem::Store(SvStream & rStream, sal_uInt16) const return rStream; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/sitem.cxx b/svl/source/items/sitem.cxx index 7f990aec36d3..a077a6f5380f 100644 --- a/svl/source/items/sitem.cxx +++ b/svl/source/items/sitem.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. @@ -27,10 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -// INCLUDE --------------------------------------------------------------- - -#ifndef GCC -#endif #include <tools/string.hxx> #include <tools/stream.hxx> @@ -111,3 +108,4 @@ SvStream& SfxSetItem::Store(SvStream& rStream, sal_uInt16) const return rStream; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx index be214cccf599..e001bf1e23f2 100644 --- a/svl/source/items/slstitm.cxx +++ b/svl/source/items/slstitm.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. @@ -393,22 +394,22 @@ void SfxStringListItem::GetStringList( com::sun::star::uno::Sequence< rtl::OUStr //---------------------------------------------------------------------------- // virtual -sal_Bool SfxStringListItem::PutValue( const com::sun::star::uno::Any& rVal,sal_uInt8 ) +bool SfxStringListItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { com::sun::star::uno::Sequence< rtl::OUString > aValue; if ( rVal >>= aValue ) { SetStringList( aValue ); - return sal_True; + return true; } - DBG_ERROR( "SfxStringListItem::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "SfxStringListItem::PutValue - Wrong type!" ); + return false; } //---------------------------------------------------------------------------- // virtual -sal_Bool SfxStringListItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 ) const +bool SfxStringListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 ) const { // GetString() is not const!!! SfxStringListItem* pThis = const_cast< SfxStringListItem * >( this ); @@ -416,7 +417,8 @@ sal_Bool SfxStringListItem::QueryValue( com::sun::star::uno::Any& rVal,sal_uInt8 com::sun::star::uno::Sequence< rtl::OUString > aStringList; pThis->GetStringList( aStringList ); rVal = ::com::sun::star::uno::makeAny( aStringList ); - return sal_True; + return true; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx index 225a5b99907b..d1d0bf7483f5 100644 --- a/svl/source/items/srchitem.cxx +++ b/svl/source/items/srchitem.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. @@ -31,6 +32,7 @@ // include --------------------------------------------------------------- #include <svl/srchitem.hxx> +#include <sal/macros.h> #include <unotools/searchopt.hxx> #include <com/sun/star/util/XReplaceable.hpp> @@ -51,7 +53,7 @@ using namespace com::sun::star::util; #define CFG_ROOT_NODE "Office.Common/SearchOptions" -#define SRCH_PARAMS 11 +#define SRCH_PARAMS 12 #define SRCH_PARA_OPTIONS "Options" #define SRCH_PARA_FAMILY "Family" #define SRCH_PARA_COMMAND "Command" @@ -59,6 +61,7 @@ using namespace com::sun::star::util; #define SRCH_PARA_APPFLAG "AppFlag" #define SRCH_PARA_ROWDIR "RowDirection" #define SRCH_PARA_ALLTABLES "AllTables" +#define SRCH_PARA_SEARCHFILTERED "SearchFiltered" #define SRCH_PARA_BACKWARD "Backward" #define SRCH_PARA_PATTERN "Pattern" #define SRCH_PARA_CONTENT "Content" @@ -96,7 +99,7 @@ static Sequence< ::rtl::OUString > lcl_GetNotifyNames() "Japanese/IsIgnoreMiddleDot" // 18 }; - const int nCount = sizeof( aTranslitNames ) / sizeof( aTranslitNames[0] ); + const int nCount = SAL_N_ELEMENTS( aTranslitNames ); Sequence< ::rtl::OUString > aNames( nCount ); ::rtl::OUString* pNames = aNames.getArray(); for (sal_Int32 i = 0; i < nCount; ++i) @@ -109,7 +112,7 @@ static Sequence< ::rtl::OUString > lcl_GetNotifyNames() SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : SfxPoolItem( nId ), - ConfigItem( ::rtl::OUString::createFromAscii( CFG_ROOT_NODE ) ), + ConfigItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFG_ROOT_NODE )) ), aSearchOpt ( SearchAlgorithms_ABSOLUTE, SearchFlags::LEV_RELAXED, @@ -124,6 +127,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : nAppFlag ( SVX_SEARCHAPP_WRITER ), bRowDirection ( sal_True ), bAllTables ( sal_False ), + bSearchFiltered ( sal_False ), bNotes ( sal_False), bBackward ( sal_False ), bPattern ( sal_False ), @@ -196,7 +200,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : SvxSearchItem::SvxSearchItem( const SvxSearchItem& rItem ) : SfxPoolItem ( rItem ), - ConfigItem( ::rtl::OUString::createFromAscii( CFG_ROOT_NODE ) ), + ConfigItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CFG_ROOT_NODE )) ), aSearchOpt ( rItem.aSearchOpt ), eFamily ( rItem.eFamily ), @@ -205,6 +209,7 @@ SvxSearchItem::SvxSearchItem( const SvxSearchItem& rItem ) : nAppFlag ( rItem.nAppFlag ), bRowDirection ( rItem.bRowDirection ), bAllTables ( rItem.bAllTables ), + bSearchFiltered ( rItem.bSearchFiltered ), bNotes ( rItem.bNotes), bBackward ( rItem.bBackward ), bPattern ( rItem.bPattern ), @@ -254,6 +259,7 @@ int SvxSearchItem::operator==( const SfxPoolItem& rItem ) const ( eFamily == rSItem.eFamily ) && ( bRowDirection == rSItem.bRowDirection ) && ( bAllTables == rSItem.bAllTables ) && + ( bSearchFiltered == rSItem.bSearchFiltered ) && ( nCellType == rSItem.nCellType ) && ( nAppFlag == rSItem.nAppFlag ) && ( bAsianOptions == rSItem.bAsianOptions ) && @@ -425,7 +431,7 @@ void SvxSearchItem::SetTransliterationFlags( sal_Int32 nFlags ) aSearchOpt.transliterateFlags = nFlags; } -sal_Bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const +bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) @@ -447,6 +453,8 @@ sal_Bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nM aSeq[5].Value <<= bRowDirection; aSeq[6].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_ALLTABLES )); aSeq[6].Value <<= bAllTables; + aSeq[6].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_SEARCHFILTERED )); + aSeq[6].Value <<= bSearchFiltered; aSeq[7].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_BACKWARD )); aSeq[7].Value <<= bBackward; aSeq[8].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SRCH_PARA_PATTERN )); @@ -468,6 +476,8 @@ sal_Bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nM rVal <<= (sal_Bool) bRowDirection; break; case MID_SEARCH_ALLTABLES: rVal <<= (sal_Bool) bAllTables; break; + case MID_SEARCH_SEARCHFILTERED: + rVal <<= (sal_Bool) bSearchFiltered; break; case MID_SEARCH_BACKWARD: rVal <<= (sal_Bool) bBackward; break; case MID_SEARCH_PATTERN: @@ -505,18 +515,18 @@ sal_Bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nM default: DBG_ERRORFILE( "SvxSearchItem::QueryValue(): Unknown MemberId" ); - return sal_False; + return false; } - return sal_True; + return true; } // ----------------------------------------------------------------------- -sal_Bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) +bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; - sal_Bool bRet = sal_False; + bool bRet = false; sal_Int32 nInt = 0; switch ( nMemberId ) { @@ -528,12 +538,12 @@ sal_Bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt sal_Int16 nConvertedCount( 0 ); for ( sal_Int32 i = 0; i < aSeq.getLength(); ++i ) { - if ( aSeq[i].Name.equalsAscii( SRCH_PARA_OPTIONS ) ) + if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_OPTIONS ) ) ) { if ( ( aSeq[i].Value >>= aSearchOpt ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_FAMILY ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_FAMILY ) ) ) { sal_uInt16 nTemp( 0 ); if ( ( aSeq[i].Value >>= nTemp ) == sal_True ) @@ -542,47 +552,52 @@ sal_Bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt ++nConvertedCount; } } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_COMMAND ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_COMMAND ) ) ) { if ( ( aSeq[i].Value >>= nCommand ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_CELLTYPE ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_CELLTYPE ) ) ) { if ( ( aSeq[i].Value >>= nCellType ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_APPFLAG ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_APPFLAG ) ) ) { if ( ( aSeq[i].Value >>= nAppFlag ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_ROWDIR ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_ROWDIR ) ) ) { if ( ( aSeq[i].Value >>= bRowDirection ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_ALLTABLES ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_ALLTABLES ) ) ) { if ( ( aSeq[i].Value >>= bAllTables ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_BACKWARD ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_SEARCHFILTERED ) ) ) + { + if ( ( aSeq[i].Value >>= bSearchFiltered ) == sal_True ) + ++nConvertedCount; + } + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_BACKWARD ) ) ) { if ( ( aSeq[i].Value >>= bBackward ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_PATTERN ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_PATTERN ) ) ) { if ( ( aSeq[i].Value >>= bPattern ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_CONTENT ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_CONTENT ) ) ) { if ( ( aSeq[i].Value >>= bContent ) == sal_True ) ++nConvertedCount; } - else if ( aSeq[i].Name.equalsAscii( SRCH_PARA_ASIANOPT ) ) + else if ( aSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SRCH_PARA_ASIANOPT ) ) ) { if ( ( aSeq[i].Value >>= bAsianOptions ) == sal_True ) ++nConvertedCount; @@ -603,6 +618,8 @@ sal_Bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt bRet = (rVal >>= bRowDirection); break; case MID_SEARCH_ALLTABLES: bRet = (rVal >>= bAllTables); break; + case MID_SEARCH_SEARCHFILTERED: + bRet = (rVal >>= bSearchFiltered); break; case MID_SEARCH_BACKWARD: bRet = (rVal >>= bBackward); break; case MID_SEARCH_PATTERN: @@ -644,10 +661,11 @@ sal_Bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt break; } default: - DBG_ERROR( "Unknown MemberId" ); + OSL_FAIL( "Unknown MemberId" ); } return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/stritem.cxx b/svl/source/items/stritem.cxx index de2d97d23c6a..2dc013bdf5d4 100644 --- a/svl/source/items/stritem.cxx +++ b/svl/source/items/stritem.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. @@ -70,3 +71,4 @@ SfxPoolItem * SfxStringItem::Clone(SfxItemPool *) const return new SfxStringItem(*this); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 8af4a67ea4f3..adb7efa7b260 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.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. @@ -28,9 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_ #include <com/sun/star/lang/XComponent.hpp> -#endif #define _SVSTDARR_STRINGS #define _SVSTDARR_STRINGSSORTDTOR @@ -280,7 +279,7 @@ sal_Bool SfxStyleSheetBase::SetParent( const XubString& rName ) SfxStyleSheetBase* pIter = rPool.Find(rName, nFamily); if( rName.Len() && !pIter ) { - DBG_ERROR( "StyleSheet-Parent nicht gefunden" ); + OSL_FAIL( "StyleSheet-Parent nicht gefunden" ); return sal_False; } // rekursive Verknuepfungen verhindern @@ -310,7 +309,7 @@ sal_Bool SfxStyleSheetBase::SetFollow( const XubString& rName ) { if( !rPool.Find( rName, nFamily ) ) { - DBG_ERROR( "StyleSheet-Follow nicht gefunden" ); + OSL_FAIL( "StyleSheet-Follow nicht gefunden" ); return sal_False; } aFollow = rName; @@ -485,7 +484,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::operator[](sal_uInt16 nIdx) ++z; } } - DBG_ERROR("falscher Index"); + OSL_FAIL("falscher Index"); return 0; } @@ -642,7 +641,7 @@ sal_Bool SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& SfxStyleSheetIterator aIter(this,eFam,SFXSTYLEBIT_ALL); SfxStyleSheetBase *pStyle = aIter.Find(rStyle); - DBG_ASSERT(pStyle, "Vorlage nicht gefunden. Writer mit Solar <2541??"); + OSL_ENSURE(pStyle, "Vorlage nicht gefunden. Writer mit Solar <2541??"); if(pStyle) return pStyle->SetParent(rParent); else @@ -699,11 +698,11 @@ SfxStyleSheetBase* SfxStyleSheetBasePool::Create( const SfxStyleSheetBase& r ) SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const XubString& rName, SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos) { - DBG_ASSERT( eFam != SFX_STYLE_FAMILY_ALL, "svl::SfxStyleSheetBasePool::Make(), FamilyAll is not a allowed Familie" ); + OSL_ENSURE( eFam != SFX_STYLE_FAMILY_ALL, "svl::SfxStyleSheetBasePool::Make(), FamilyAll is not a allowed Familie" ); SfxStyleSheetIterator aIter(this, eFam, mask); rtl::Reference< SfxStyleSheetBase > xStyle( aIter.Find( rName ) ); - DBG_ASSERT( !xStyle.is(), "svl::SfxStyleSheetBasePool::Make(), StyleSheet already exists" ); + OSL_ENSURE( !xStyle.is(), "svl::SfxStyleSheetBasePool::Make(), StyleSheet already exists" ); SfxStyleSheetIterator& rIter = GetIterator_Impl(); if( !xStyle.is() ) @@ -827,16 +826,18 @@ void SfxStyleSheetBasePool::Remove( SfxStyleSheetBase* p ) void SfxStyleSheetBasePool::Insert( SfxStyleSheetBase* p ) { - DBG_ASSERT( p, "svl::SfxStyleSheetBasePool::Insert(), no stylesheet?" ); +#if OSL_DEBUG_LEVEL > 0 + OSL_ENSURE( p, "svl::SfxStyleSheetBasePool::Insert(), no stylesheet?" ); SfxStyleSheetIterator aIter(this, p->GetFamily(), p->GetMask()); SfxStyleSheetBase* pOld = aIter.Find( p->GetName() ); - DBG_ASSERT( !pOld, "svl::SfxStyleSheetBasePool::Insert(), StyleSheet already inserted" ); + OSL_ENSURE( !pOld, "svl::SfxStyleSheetBasePool::Insert(), StyleSheet already inserted" ); if( p->GetParent().Len() ) { pOld = aIter.Find( p->GetParent() ); - DBG_ASSERT( pOld, "svl::SfxStyleSheetBasePool::Insert(), Parent not found!" ); + OSL_ENSURE( pOld, "svl::SfxStyleSheetBasePool::Insert(), Parent not found!" ); } +#endif aStyles.push_back( rtl::Reference< SfxStyleSheetBase >( p ) ); Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *p ) ); } @@ -1395,3 +1396,5 @@ const ::com::sun::star::uno::Sequence< ::sal_Int8 >& SfxUnoStyleSheet::getIdenti } // -------------------------------------------------------------------- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx index 8ad8346af075..1873ffda3a3b 100644 --- a/svl/source/items/stylepool.cxx +++ b/svl/source/items/stylepool.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. @@ -54,11 +55,10 @@ namespace { std::vector< StylePool::SfxItemSet_Pointer_t > maItemSet; const SfxPoolItem *mpItem; // my pool item Node *mpUpper; // if I'm a child node that's my parent node - // --> OD 2008-03-07 #i86923# + // #i86923# const bool mbIsItemIgnorable; - // <-- public: - // --> OD 2008-03-07 #i86923# + // #i86923# Node() // root node Ctor : mChildren(), maItemSet(), @@ -73,36 +73,30 @@ namespace { mpUpper( pParent ), mbIsItemIgnorable( bIgnorable ) {} - // <-- ~Node(); - // --> OD 2008-03-11 #i86923# + // #i86923# bool hasItemSet( const bool bCheckUsage ) const; - // <-- - // --> OD 2008-04-29 #i87808# -// const StylePool::SfxItemSet_Pointer_t getItemSet() const { return aItemSet[aItemSet.size()-1]; } + // #i87808# const StylePool::SfxItemSet_Pointer_t getItemSet() const { return maItemSet.back(); } const StylePool::SfxItemSet_Pointer_t getUsedOrLastAddedItemSet() const; - // <-- void setItemSet( const SfxItemSet& rSet ){ maItemSet.push_back( StylePool::SfxItemSet_Pointer_t( rSet.Clone() ) ); } - // --> OD 2008-03-11 #i86923# + // #i86923# Node* findChildNode( const SfxPoolItem& rItem, const bool bIsItemIgnorable = false ); Node* nextItemSet( Node* pLast, const bool bSkipUnusedItemSet, const bool bSkipIgnorable ); - // <-- const SfxPoolItem& getPoolItem() const { return *mpItem; } - // --> OD 2008-03-11 #i86923# + // #i86923# bool hasIgnorableChildren( const bool bCheckUsage ) const; const StylePool::SfxItemSet_Pointer_t getItemSetOfIgnorableChild( const bool bSkipUnusedItemSets ) const; - // <-- }; - // --> OD 2008-04-29 #i87808# + // #i87808# const StylePool::SfxItemSet_Pointer_t Node::getUsedOrLastAddedItemSet() const { std::vector< StylePool::SfxItemSet_Pointer_t >::const_reverse_iterator aIter; @@ -117,9 +111,8 @@ namespace { return maItemSet.back(); } - // <-- - // --> OD 2008-05-06 #i86923# + // #i86923# bool Node::hasItemSet( const bool bCheckUsage ) const { bool bHasItemSet = false; @@ -146,12 +139,10 @@ namespace { } return bHasItemSet; } - // <-- - // --> OD 2008-03-07 #i86923# + // #i86923# Node* Node::findChildNode( const SfxPoolItem& rItem, const bool bIsItemIgnorable ) - // <-- { Node* pNextNode = this; std::vector<Node*>::iterator aIter = mChildren.begin(); @@ -162,9 +153,8 @@ namespace { return *aIter; ++aIter; } - // --> OD 2008-03-07 #i86923# + // #i86923# pNextNode = new Node( rItem, pNextNode, bIsItemIgnorable ); - // <-- mChildren.push_back( pNextNode ); return pNextNode; } @@ -202,15 +192,14 @@ namespace { Node *pNext = 0; while( aIter != mChildren.end() ) { - // --> OD 2008-03-11 #i86923# + // #i86923# if ( bSkipIgnorable && (*aIter)->mbIsItemIgnorable ) { ++aIter; continue; } - // <-- pNext = *aIter; - // --> OD 2008-03-11 #i86923# + // #i86923# if ( pNext->hasItemSet( bSkipUnusedItemSets ) ) { return pNext; @@ -221,7 +210,6 @@ namespace { return pNext; } pNext = pNext->nextItemSet( 0, bSkipUnusedItemSets, bSkipIgnorable ); // 0 => downstairs only - // <-- if( pNext ) return pNext; ++aIter; @@ -229,14 +217,13 @@ namespace { // Searching upstairs if( pLast && mpUpper ) { - // --> OD 2008-03-11 #i86923# + // #i86923# pNext = mpUpper->nextItemSet( this, bSkipUnusedItemSets, bSkipIgnorable ); - // <-- } return pNext; } - // --> OD 2008-03-11 #i86923# + // #i86923# bool Node::hasIgnorableChildren( const bool bCheckUsage ) const { bool bHasIgnorableChildren( false ); @@ -289,7 +276,6 @@ namespace { StylePool::SfxItemSet_Pointer_t pReturn; return pReturn; } - // <-- Node::~Node() { @@ -310,7 +296,7 @@ namespace { const bool mbSkipUnusedItemSets; const bool mbSkipIgnorable; public: - // --> OD 2008-03-07 #i86923# + // #i86923# Iterator( std::map< const SfxItemSet*, Node >& rR, const bool bSkipUnusedItemSets, const bool bSkipIgnorable ) @@ -320,7 +306,6 @@ namespace { mbSkipUnusedItemSets( bSkipUnusedItemSets ), mbSkipIgnorable( bSkipIgnorable ) {} - // <-- virtual StylePool::SfxItemSet_Pointer_t getNext(); virtual ::rtl::OUString getName(); }; @@ -334,31 +319,25 @@ namespace { { mpNode = &mpCurrNode->second; ++mpCurrNode; - // --> OD 2008-03-11 #i86923# + // #i86923# if ( mpNode->hasItemSet( mbSkipUnusedItemSets ) ) { - // --> OD 2008-04-30 #i87808# -// return pNode->getItemSet(); + // #i87808# return mpNode->getUsedOrLastAddedItemSet(); - // <-- } - // <-- } - // --> OD 2008-03-11 #i86923# + // #i86923# mpNode = mpNode->nextItemSet( mpNode, mbSkipUnusedItemSets, mbSkipIgnorable ); if ( mpNode && mpNode->hasItemSet( mbSkipUnusedItemSets ) ) { - // --> OD 2008-04-30 #i87808# -// return pNode->getItemSet(); + // #i87808# return mpNode->getUsedOrLastAddedItemSet(); - // <-- } if ( mbSkipIgnorable && mpNode && mpNode->hasIgnorableChildren( mbSkipUnusedItemSets ) ) { return mpNode->getItemSetOfIgnorableChild( mbSkipUnusedItemSets ); } - // <-- } return pReturn; } @@ -368,10 +347,7 @@ namespace { ::rtl::OUString aString; if( mpNode && mpNode->hasItemSet( false ) ) { - // --> OD 2008-04-30 #i87808# -// aString = StylePool::nameOf( pNode->getItemSet() ); aString = StylePool::nameOf( mpNode->getUsedOrLastAddedItemSet() ); - // <-- } return aString; } @@ -396,11 +372,10 @@ class StylePoolImpl private: std::map< const SfxItemSet*, Node > maRoot; sal_Int32 mnCount; - // --> OD 2008-03-07 #i86923# + // #i86923# SfxItemSet* mpIgnorableItems; - // <-- public: - // --> OD 2008-03-07 #i86923# + // #i86923# explicit StylePoolImpl( SfxItemSet* pIgnorableItems = 0 ) : maRoot(), mnCount(0), @@ -418,14 +393,12 @@ public: { delete mpIgnorableItems; } - // <-- StylePool::SfxItemSet_Pointer_t insertItemSet( const SfxItemSet& rSet ); - // --> OD 2008-03-07 #i86923# + // #i86923# IStylePoolIteratorAccess* createIterator( bool bSkipUnusedItemSets = false, bool bSkipIgnorableItems = false ); - // <-- sal_Int32 getCount() const { return mnCount; } }; @@ -437,8 +410,7 @@ StylePool::SfxItemSet_Pointer_t StylePoolImpl::insertItemSet( const SfxItemSet& const SfxPoolItem* pItem = aIter.GetCurItem(); // Every SfxPoolItem in the SfxItemSet causes a step deeper into the tree, // a complete empty SfxItemSet would stay at the root node. - // --> OD 2008-03-07 #i86923# - // insert ignorable items to the tree leaves. + // #i86923# insert ignorable items to the tree leaves. std::auto_ptr<SfxItemSet> pFoundIgnorableItems; if ( mpIgnorableItems ) { @@ -469,7 +441,6 @@ StylePool::SfxItemSet_Pointer_t StylePoolImpl::insertItemSet( const SfxItemSet& pItem = aIgnorableItemsIter.NextItem(); } } - // <-- // Every leaf node represents an inserted item set, but "non-leaf" nodes represents subsets // of inserted itemsets. // These nodes could have but does not need to have a shared_ptr to a item set. @@ -485,18 +456,12 @@ StylePool::SfxItemSet_Pointer_t StylePoolImpl::insertItemSet( const SfxItemSet& #ifdef DEBUG { sal_Int32 nCheck = -1; - sal_Int32 nNo = -1; IStylePoolIteratorAccess* pIter = createIterator(); StylePool::SfxItemSet_Pointer_t pTemp; do { ++nCheck; pTemp = pIter->getNext(); - if( pCurNode->hasItemSet( false ) && pTemp.get() == pCurNode->getItemSet().get() ) - { - ::rtl::OUString aStr = StylePool::nameOf( pTemp ); - nNo = nCheck; - } } while( pTemp.get() ); DBG_ASSERT( mnCount == nCheck, "Wrong counting"); delete pIter; @@ -505,37 +470,32 @@ StylePool::SfxItemSet_Pointer_t StylePoolImpl::insertItemSet( const SfxItemSet& return pCurNode->getItemSet(); } -// --> OD 2008-03-07 #i86923# +// #i86923# IStylePoolIteratorAccess* StylePoolImpl::createIterator( bool bSkipUnusedItemSets, bool bSkipIgnorableItems ) { return new Iterator( maRoot, bSkipUnusedItemSets, bSkipIgnorableItems ); } -// <-- - // Ctor, Dtor and redirected methods of class StylePool, nearly inline ;-) -// --> OD 2008-03-07 #i86923# +// #i86923# StylePool::StylePool( SfxItemSet* pIgnorableItems ) : pImpl( new StylePoolImpl( pIgnorableItems ) ) {} -// <-- StylePool::SfxItemSet_Pointer_t StylePool::insertItemSet( const SfxItemSet& rSet ) { return pImpl->insertItemSet( rSet ); } -// --> OD 2008-03-11 #i86923# +// #i86923# IStylePoolIteratorAccess* StylePool::createIterator( const bool bSkipUnusedItemSets, const bool bSkipIgnorableItems ) { return pImpl->createIterator( bSkipUnusedItemSets, bSkipIgnorableItems ); } -// <-- sal_Int32 StylePool::getCount() const { return pImpl->getCount(); } StylePool::~StylePool() { delete pImpl; } -// End of class StylePool - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/szitem.cxx b/svl/source/items/szitem.cxx index 161468b1009b..4bb7238c9b76 100644 --- a/svl/source/items/szitem.cxx +++ b/svl/source/items/szitem.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. @@ -135,7 +136,7 @@ SvStream& SfxSizeItem::Store(SvStream &rStream, sal_uInt16 ) const } // ----------------------------------------------------------------------- -sal_Bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal, +bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); @@ -159,20 +160,20 @@ sal_Bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal, rVal <<= aTmp.getWidth(); break; case MID_HEIGHT: rVal <<= aTmp.getHeight(); break; - default: DBG_ERROR("Wrong MemberId!"); return sal_False; + default: OSL_FAIL("Wrong MemberId!"); return false; } - return sal_True; + return true; } // ----------------------------------------------------------------------- -sal_Bool SfxSizeItem::PutValue( const com::sun::star::uno::Any& rVal, +bool SfxSizeItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; - sal_Bool bRet = sal_False; + bool bRet = false; com::sun::star::awt::Size aValue; sal_Int32 nVal = 0; if ( !nMemberId ) @@ -209,3 +210,4 @@ sal_Bool SfxSizeItem::PutValue( const com::sun::star::uno::Any& rVal, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/visitem.cxx b/svl/source/items/visitem.cxx index 81726f017f3a..599709d70938 100644 --- a/svl/source/items/visitem.cxx +++ b/svl/source/items/visitem.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. @@ -85,21 +86,21 @@ SfxItemPresentation SfxVisibilityItem::GetPresentation(SfxItemPresentation, //============================================================================ // virtual -sal_Bool SfxVisibilityItem::QueryValue(com::sun::star::uno::Any& rVal,sal_uInt8) const +bool SfxVisibilityItem::QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8) const { rVal <<= m_nValue; - return sal_True; + return true; } //============================================================================ // virtual -sal_Bool SfxVisibilityItem::PutValue(const com::sun::star::uno::Any& rVal,sal_uInt8) +bool SfxVisibilityItem::PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8) { if (rVal >>= m_nValue) - return sal_True; + return true; - DBG_ERROR( "SfxInt16Item::PutValue - Wrong type!" ); - return sal_False; + OSL_FAIL( "SfxInt16Item::PutValue - Wrong type!" ); + return false; } //============================================================================ @@ -140,6 +141,8 @@ UniString SfxVisibilityItem::GetValueTextByVal(sal_Bool bTheValue) const { return bTheValue ? - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_True")) : - UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("sal_False")); + UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("TRUE")) : + UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("FALSE")); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/whassert.hxx b/svl/source/items/whassert.hxx index 237cf73f6c7f..0fa492b19443 100644 --- a/svl/source/items/whassert.hxx +++ b/svl/source/items/whassert.hxx @@ -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. @@ -52,3 +53,5 @@ #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/whiter.cxx b/svl/source/items/whiter.cxx index 17e0e18115bb..b9fb9ca46330 100644 --- a/svl/source/items/whiter.cxx +++ b/svl/source/items/whiter.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. @@ -27,7 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -// INCLUDE --------------------------------------------------------------- #include <svl/whiter.hxx> #include <svl/itemset.hxx> @@ -120,3 +120,4 @@ sal_uInt16 SfxWhichIter::LastWhich() return PrevWhich(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |