[Libreoffice-commits] .: 2 commits - cui/source sfx2/source solenv/prj svl/inc svl/source

Bjoern Michaelsen bmichaelsen at kemper.freedesktop.org
Tue Sep 6 17:40:53 PDT 2011


 cui/source/dialogs/iconcdlg.cxx  |    2 +-
 sfx2/source/appl/appmain.cxx     |    2 ++
 sfx2/source/control/dispatch.cxx |    2 +-
 sfx2/source/dialog/tabdlg.cxx    |    2 +-
 solenv/prj/build.lst             |    2 +-
 svl/inc/svl/itempool.hxx         |   10 +++++-----
 svl/inc/svl/slstitm.hxx          |    2 +-
 svl/source/items/itempool.cxx    |   35 +++++++++++------------------------
 svl/source/items/poolio.cxx      |    2 +-
 svl/source/items/poolitem.cxx    |    7 +------
 10 files changed, 25 insertions(+), 41 deletions(-)

New commits:
commit 0d8c345bf916ef7c1148bda84968c57189e14f5c
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Wed Sep 7 00:57:49 2011 +0200

    kill TF_POOLABLE, step 1: error if unset

diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index c78da40..6590e37 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -982,7 +982,7 @@ const sal_uInt16* IconChoiceDialog::GetInputRanges( const SfxItemPool& rPool )
 
     // remove double Id's
 #ifndef TF_POOLABLE
-    if ( rPool.HasMap() )
+#error "TF_POOLABLE should always be set."
 #endif
     {
         nCount = aUS.Count();
diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx
index 54c07bd..0cce285 100644
--- a/sfx2/source/appl/appmain.cxx
+++ b/sfx2/source/appl/appmain.cxx
@@ -86,6 +86,8 @@ static SfxItemInfo const aItemInfos[] =
 {
     { 0, 0 }
 };
+#else
+#error "TF_POOLABLE should always be set."
 #endif
 
 //===================================================================
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 92a11be..2571594 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1003,7 +1003,7 @@ void MappedPut_Impl( SfxAllItemSet &rSet, const SfxPoolItem &rItem )
 #ifdef TF_POOLABLE
     if ( pPool->IsSlot(nWhich) )
 #else
-    if ( pPool->HasMap() && pPool->IsSlot(nWhich) )
+#error "TF_POOLABLE should always be set."
 #endif
         nWhich = pPool->GetWhich(nWhich);
     rSet.Put( rItem, nWhich );
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 34caddf..8f2a39f 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1642,7 +1642,7 @@ const sal_uInt16* SfxTabDialog::GetInputRanges( const SfxItemPool& rPool )
 
     //! Remove duplicated Ids?
 #ifndef TF_POOLABLE
-    if ( rPool.HasMap() )
+#error "TF_POOLABLE should always be set."
 #endif
     {
         nCount = aUS.Count();
diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx
index a3a543e..03f17af 100644
--- a/svl/inc/svl/itempool.hxx
+++ b/svl/inc/svl/itempool.hxx
@@ -114,7 +114,7 @@ class SVL_DLLPUBLIC SfxItemPool
 #ifdef TF_POOLABLE
     const SfxItemInfo*              pItemInfos;
 #else
-    sal_uInt16*                         pSlotIds;
+#error "TF_POOLABLE should always be set."
 #endif
     SfxItemPool_Impl*               pImp;
     SfxPoolItem**                   ppStaticDefaults;
@@ -164,10 +164,12 @@ public:
                                                  sal_uInt16 nStart, sal_uInt16 nEnd,
 #ifdef TF_POOLABLE
                                                  const SfxItemInfo *pItemInfos,
+#else
+#error "TF_POOLABLE should always be set."
 #endif
                                                  SfxPoolItem **pDefaults = 0,
 #ifndef TF_POOLABLE
-                                                 sal_uInt16 *pSlotIds = 0,
+#error "TF_POOLABLE should always be set."
 #endif
                                                  bool bLoadRefCounts = true );
 protected:
@@ -246,9 +248,7 @@ public:
     void                            SetItemInfos( const SfxItemInfo *pInfos )
                                     { pItemInfos = pInfos; }
 #else
-    int                             HasMap() const { return 0 != pSlotIds; }
-    void                            SetMap( sal_uInt16 *pNewSlotIds )
-                                    { pSlotIds = pNewSlotIds; }
+#error "TF_POOLABLE should always be set."
 #endif
     sal_uInt16                          GetWhich( sal_uInt16 nSlot, sal_Bool bDeep = sal_True ) const;
     sal_uInt16                          GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep = sal_True ) const;
diff --git a/svl/inc/svl/slstitm.hxx b/svl/inc/svl/slstitm.hxx
index 18dff40..ed0a115 100644
--- a/svl/inc/svl/slstitm.hxx
+++ b/svl/inc/svl/slstitm.hxx
@@ -56,7 +56,7 @@ public:
     const std::vector<String>& GetList() const;
 
 #ifndef TF_POOLABLE
-    virtual int             IsPoolable() const;
+#error "TF_POOLABLE should always be set."
 #endif
 
     // String-Separator: \n
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 3b4ff12..920a4eb 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -110,12 +110,14 @@ SfxItemPool::SfxItemPool
     sal_uInt16              nEndWhich,      /* letzte Which-Id des Pools */
 #ifdef TF_POOLABLE
     const SfxItemInfo*  pInfos,         /* SID-Map und Item-Flags */
+#else
+#error "TF_POOLABLE should always be set."
 #endif
     SfxPoolItem**       pDefaults,      /* Pointer auf statische Defaults,
                                            wird direkt vom Pool referenziert,
                                            jedoch kein Eigent"umer"ubergang */
 #ifndef TF_POOLABLE
-    sal_uInt16*             pSlotIdArray,   /* Zuordnung von Slot-Ids zu Which-Ids */
+#error "TF_POOLABLE should always be set."
 #endif
     bool                bLoadRefCounts  /* Ref-Counts mitladen oder auf 1 setzen */
 )
@@ -157,7 +159,7 @@ SfxItemPool::SfxItemPool
 #ifdef TF_POOLABLE
     pItemInfos(pInfos),
 #else
-    pSlotIds(pSlotIdArray),
+#error "TF_POOLABLE should always be set."
 #endif
     pImp( new SfxItemPool_Impl( nStart, nEnd ) ),
     ppStaticDefaults(0),
@@ -218,7 +220,7 @@ SfxItemPool::SfxItemPool
 #ifdef TF_POOLABLE
     pItemInfos(rPool.pItemInfos),
 #else
-    pSlotIds(rPool.pSlotIds),
+#error "TF_POOLABLE should always be set."
 #endif
     pImp( new SfxItemPool_Impl( nStart, nEnd ) ),
     ppStaticDefaults(0),
@@ -793,6 +795,8 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich
                     *pNewItem == rItem,
                     nWhich, "unequal items in Put(): no operator==?" );
     }
+#else
+#error "TF_POOLABLE should always be set."
 #endif
 #endif
     AddRef( *pNewItem, pImp->nInitRefCount );
@@ -1008,13 +1012,7 @@ sal_uInt16 SfxItemPool::GetWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const
         if ( pItemInfos[nOfs]._nSID == nSlotId )
             return nOfs + nStart;
 #else
-    if ( pSlotIds )
-    {
-        sal_uInt16 nCount = nEnd - nStart + 1;
-        for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs )
-            if ( pSlotIds[nOfs] == nSlotId )
-                return nOfs + nStart;
-    }
+#error "TF_POOLABLE should always be set."
 #endif
     if ( pSecondary && bDeep )
         return pSecondary->GetWhich(nSlotId);
@@ -1040,9 +1038,7 @@ sal_uInt16 SfxItemPool::GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const
     sal_uInt16 nSID = pItemInfos[nWhich - nStart]._nSID;
     return nSID ? nSID : nWhich;
 #else
-    else if ( pSlotIds )
-        return pSlotIds[nWhich - nStart];
-    return nWhich;
+#error "TF_POOLABLE should always be set."
 #endif
 }
 
@@ -1059,13 +1055,7 @@ sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, sal_Bool bDeep ) const
         if ( pItemInfos[nOfs]._nSID == nSlotId )
             return nOfs + nStart;
 #else
-    if ( pSlotIds )
-    {
-        sal_uInt16 nCount = nEnd - nStart + 1;
-        for ( sal_uInt16 nOfs = 0; nOfs < nCount; ++nOfs )
-            if ( pSlotIds[nOfs] == nSlotId )
-                return nOfs + nStart;
-    }
+#error "TF_POOLABLE should always be set."
 #endif
     if ( pSecondary && bDeep )
         return pSecondary->GetTrueWhich(nSlotId);
@@ -1089,10 +1079,7 @@ sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const
 #ifdef TF_POOLABLE
     return pItemInfos[nWhich - nStart]._nSID;
 #else
-    else if ( pSlotIds )
-        return pSlotIds[nWhich - nStart];
-    else
-        return 0;
+#error "TF_POOLABLE should always be set."
 #endif
 }
 // -----------------------------------------------------------------------
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index 2740485..7e54d65 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -199,7 +199,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const
 #ifdef TF_POOLABLE
                 if ( *pArr && IsItemFlag(**ppDefItem, SFX_ITEM_POOLABLE) &&
 #else
-                if ( *pArr && (*ppDefItem)->IsPoolable() &&
+#error "TF_POOLABLE should always be set."
 #endif
                      pImp->bInSetItem == (*ppDefItem)->ISA(SfxSetItem) )
                 {
diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx
index ec2909f..8fecea1 100644
--- a/svl/source/items/poolitem.cxx
+++ b/svl/source/items/poolitem.cxx
@@ -189,12 +189,7 @@ int SfxPoolItem::operator==( const SfxPoolItem& rCmp ) const
 
 // -----------------------------------------------------------------------
 #ifndef TF_POOLABLE
-
-int SfxPoolItem::IsPoolable() const
-{
-    DBG_CHKTHIS(SfxPoolItem, 0);
-    return sal_True;
-}
+#error "TF_POOLABLE should always be set."
 #endif
 
 // -----------------------------------------------------------------------
commit 2d299c9867a8653fd52a23567a8ddc51ea1ffaf4
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Wed Sep 7 00:35:59 2011 +0200

    try to prevent race condition related to settings.mk/%minor.mk
    
     * observed on gentoo tinderbox

diff --git a/solenv/prj/build.lst b/solenv/prj/build.lst
index eb46b06..8f3f9b0 100644
--- a/solenv/prj/build.lst
+++ b/solenv/prj/build.lst
@@ -1,4 +1,4 @@
 sn  solenv : NULL
 sn	solenv									usr1	-	all	sn_mkout NULL
 sn	solenv									nmake	-	all	sn_init NULL
-sn	solenv\gdb									nmake	-	all	sn_gdb NULL
+sn	solenv\gdb									nmake	-	all	sn_gdb sn_init NULL


More information about the Libreoffice-commits mailing list