sc/inc/scitems.hxx           |    5 ++---
 sc/source/ui/app/msgpool.cxx |   33 +++++++++++++--------------------
 sc/source/ui/inc/msgpool.hxx |    4 +---
 3 files changed, 16 insertions(+), 26 deletions(-)

New commits:
commit e92b89428e66ab44c6c08463b3c43200e1cf7341
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Fri Jan 5 08:46:26 2018 +0200

    SCITEM_PRINTWARN is unused
    
    and mpPoolDefaults doesn't need to be a pointer
    
    Change-Id: I02735b22466711d7260d2ff0cbc6bf0cab5d83b2
    Reviewed-on: https://gerrit.libreoffice.org/47450
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sc/inc/scitems.hxx b/sc/inc/scitems.hxx
index adc6c564c6a6..aa04f2847d99 100644
--- a/sc/inc/scitems.hxx
+++ b/sc/inc/scitems.hxx
@@ -41,10 +41,9 @@
 #define SCITEM_PIVOTDATA            1106
 #define SCITEM_SOLVEDATA            1107
 #define SCITEM_USERLIST             1108
-#define SCITEM_PRINTWARN            1109
-#define SCITEM_CONDFORMATDLGDATA    1110
+#define SCITEM_CONDFORMATDLGDATA    1109
 
-#define MSGPOOL_END                 1110
+#define MSGPOOL_END                 1109
 
 // Item-IDs for attributes:
 
diff --git a/sc/source/ui/app/msgpool.cxx b/sc/source/ui/app/msgpool.cxx
index fda92ef8ce39..fb0dbbd67012 100644
--- a/sc/source/ui/app/msgpool.cxx
+++ b/sc/source/ui/app/msgpool.cxx
@@ -35,7 +35,6 @@ static SfxItemInfo const aMsgItemInfos[] =
     { SID_PIVOT_TABLE,           true },   // SCITEM_PIVOTDATA
     { SID_SOLVE,                 true },   // SCITEM_SOLVEDATA
     { SID_SCUSERLISTS,           true },   // SCITEM_USERLIST
-    { SID_PRINTER_NOTFOUND_WARN, true },   // SCITEM_PRINTWARN
     { 0,                         false }  // SCITEM_CONDFORMATDLGDATA
 };
 
@@ -53,27 +52,23 @@ ScMessagePool::ScMessagePool()
     aGlobalPivotItem        ( ScPivotItem           ( SCITEM_PIVOTDATA, 
nullptr, nullptr, false ) ),
     aGlobalSolveItem        ( ScSolveItem           ( SCITEM_SOLVEDATA, 
nullptr ) ),
     aGlobalUserListItem     ( ScUserListItem        ( SCITEM_USERLIST ) ),
-
-    aPrintWarnItem          ( SfxBoolItem           ( SCITEM_PRINTWARN, false 
) ),
     aCondFormatDlgItem      ( ScCondFormatDlgItem   ( nullptr, -1, false ) ),
 
-    mpPoolDefaults(new std::vector<SfxPoolItem*>(MSGPOOL_END - MSGPOOL_START + 
1)),
+    mvPoolDefaults(MSGPOOL_END - MSGPOOL_START + 1),
     pDocPool(new ScDocumentPool)
 {
-    std::vector<SfxPoolItem*>& rPoolDefaults = *mpPoolDefaults;
-    rPoolDefaults[SCITEM_STRING            - MSGPOOL_START] = 
&aGlobalStringItem;
-    rPoolDefaults[SCITEM_SEARCHDATA        - MSGPOOL_START] = 
&aGlobalSearchItem;
-    rPoolDefaults[SCITEM_SORTDATA          - MSGPOOL_START] = &aGlobalSortItem;
-    rPoolDefaults[SCITEM_QUERYDATA         - MSGPOOL_START] = 
&aGlobalQueryItem;
-    rPoolDefaults[SCITEM_SUBTDATA          - MSGPOOL_START] = 
&aGlobalSubTotalItem;
-    rPoolDefaults[SCITEM_CONSOLIDATEDATA   - MSGPOOL_START] = 
&aGlobalConsolidateItem;
-    rPoolDefaults[SCITEM_PIVOTDATA         - MSGPOOL_START] = 
&aGlobalPivotItem;
-    rPoolDefaults[SCITEM_SOLVEDATA         - MSGPOOL_START] = 
&aGlobalSolveItem;
-    rPoolDefaults[SCITEM_USERLIST          - MSGPOOL_START] = 
&aGlobalUserListItem;
-    rPoolDefaults[SCITEM_PRINTWARN         - MSGPOOL_START] = &aPrintWarnItem;
-    rPoolDefaults[SCITEM_CONDFORMATDLGDATA - MSGPOOL_START] = 
&aCondFormatDlgItem;
+    mvPoolDefaults[SCITEM_STRING            - MSGPOOL_START] = 
&aGlobalStringItem;
+    mvPoolDefaults[SCITEM_SEARCHDATA        - MSGPOOL_START] = 
&aGlobalSearchItem;
+    mvPoolDefaults[SCITEM_SORTDATA          - MSGPOOL_START] = 
&aGlobalSortItem;
+    mvPoolDefaults[SCITEM_QUERYDATA         - MSGPOOL_START] = 
&aGlobalQueryItem;
+    mvPoolDefaults[SCITEM_SUBTDATA          - MSGPOOL_START] = 
&aGlobalSubTotalItem;
+    mvPoolDefaults[SCITEM_CONSOLIDATEDATA   - MSGPOOL_START] = 
&aGlobalConsolidateItem;
+    mvPoolDefaults[SCITEM_PIVOTDATA         - MSGPOOL_START] = 
&aGlobalPivotItem;
+    mvPoolDefaults[SCITEM_SOLVEDATA         - MSGPOOL_START] = 
&aGlobalSolveItem;
+    mvPoolDefaults[SCITEM_USERLIST          - MSGPOOL_START] = 
&aGlobalUserListItem;
+    mvPoolDefaults[SCITEM_CONDFORMATDLGDATA - MSGPOOL_START] = 
&aCondFormatDlgItem;
 
-    SetDefaults( mpPoolDefaults );
+    SetDefaults( &mvPoolDefaults );
 
     SetSecondaryPool( pDocPool );
 }
@@ -84,9 +79,7 @@ ScMessagePool::~ScMessagePool()
     SetSecondaryPool( nullptr ); // before deleting defaults (accesses 
defaults)
 
     for ( sal_uInt16 i=0; i <= MSGPOOL_END-MSGPOOL_START; i++ )
-        ClearRefCount( *(*mpPoolDefaults)[i] );
-
-    delete mpPoolDefaults;
+        ClearRefCount( *mvPoolDefaults[i] );
 
     SfxItemPool::Free(pDocPool);
 }
diff --git a/sc/source/ui/inc/msgpool.hxx b/sc/source/ui/inc/msgpool.hxx
index eff5c178ee14..476e19a6291d 100644
--- a/sc/source/ui/inc/msgpool.hxx
+++ b/sc/source/ui/inc/msgpool.hxx
@@ -43,11 +43,9 @@ class ScMessagePool: public SfxItemPool
     ScPivotItem         aGlobalPivotItem;
     ScSolveItem         aGlobalSolveItem;
     ScUserListItem      aGlobalUserListItem;
-
-    SfxBoolItem         aPrintWarnItem;
     ScCondFormatDlgItem aCondFormatDlgItem;
 
-    std::vector<SfxPoolItem*>*   mpPoolDefaults;
+    std::vector<SfxPoolItem*>    mvPoolDefaults;
     ScDocumentPool*              pDocPool;
 
 public:
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to