svl/source/items/poolitem.cxx | 73 ------------------------------------------ 1 file changed, 1 insertion(+), 72 deletions(-)
New commits: commit de77b1b22b60a98363886339c4038df7f652d92e Author: Stephan Bergmann <[email protected]> Date: Mon Jan 9 17:48:08 2017 +0100 Wow! The ultimate Easter Egg Instantiate one million SfxPoolItems to reach the next level! Change-Id: Ib600f6f2ece080eb98d7f8d284080b5584b0a9d1 diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index d23bbe2..ba27df6 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.cxx @@ -24,51 +24,12 @@ #include <libxml/xmlwriter.h> #include <typeinfo> - -#if OSL_DEBUG_LEVEL > 0 -static sal_uLong nItemCount = 0; - -static const char* pw1 = "Wow! 10.000 items!"; -static const char* pw2 = "Wow! 100.000 items!"; -static const char* pw3 = "Wow! 1.000.000 items!"; -static const char* pw4 = "Wow! 50.000.000 items!"; -static const char* pw5 = "Wow! 10.000.000 items!"; -#endif - SfxPoolItem::SfxPoolItem(sal_uInt16 const nWhich) : m_nRefCount(0) , m_nWhich(nWhich) , m_nKind(SfxItemKind::NONE) { assert(nWhich <= SHRT_MAX); -#if OSL_DEBUG_LEVEL > 0 - ++nItemCount; - if ( pw1 && nItemCount>=10000 ) - { - SAL_INFO( "svl", pw1 ); - pw1 = nullptr; - } - if ( pw2 && nItemCount>=100000 ) - { - SAL_INFO( "svl", pw2 ); - pw2 = nullptr; - } - if ( pw3 && nItemCount>=1000000 ) - { - SAL_INFO( "svl", pw3 ); - pw3 = nullptr; - } - if ( pw4 && nItemCount>=5000000 ) - { - SAL_INFO( "svl", pw4 ); - pw4 = nullptr; - } - if ( pw5 && nItemCount>=10000000 ) - { - SAL_INFO( "svl", pw5 ); - pw5 = nullptr; - } -#endif } @@ -76,45 +37,13 @@ SfxPoolItem::SfxPoolItem( const SfxPoolItem& rCpy ) : m_nRefCount(0) // don't copy that , m_nWhich(rCpy.m_nWhich) , m_nKind(SfxItemKind::NONE) -{ -#if OSL_DEBUG_LEVEL > 0 - ++nItemCount; - if ( pw1 && nItemCount>=10000 ) - { - SAL_INFO( "svl", pw1 ); - pw1 = nullptr; - } - if ( pw2 && nItemCount>=100000 ) - { - SAL_INFO( "svl", pw2 ); - pw2 = nullptr; - } - if ( pw3 && nItemCount>=1000000 ) - { - SAL_INFO( "svl", pw3 ); - pw3 = nullptr; - } - if ( pw4 && nItemCount>=5000000 ) - { - SAL_INFO( "svl", pw4 ); - pw4 = nullptr; - } - if ( pw5 && nItemCount>=10000000 ) - { - SAL_INFO( "svl", pw5 ); - pw5 = nullptr; - } -#endif -} +{} SfxPoolItem::~SfxPoolItem() { assert((m_nRefCount == 0 || m_nRefCount > SFX_ITEMS_MAXREF) && "destroying item in use"); -#if OSL_DEBUG_LEVEL > 0 - --nItemCount; -#endif } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
