diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-01-09 17:48:08 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-01-09 17:48:08 +0100 |
commit | de77b1b22b60a98363886339c4038df7f652d92e (patch) | |
tree | cd1e49a36dd5cb2d7859be9bc6c58419ae633739 /svl | |
parent | 0c9f0f3c17a03b305f9d55ad40cc7e4111269760 (diff) |
Wow! The ultimate Easter Egg
Instantiate one million SfxPoolItems to reach the next level!
Change-Id: Ib600f6f2ece080eb98d7f8d284080b5584b0a9d1
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/poolitem.cxx | 73 |
1 files changed, 1 insertions, 72 deletions
diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index d23bbe26a3a9..ba27df64fcf1 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 } |