[Libreoffice-commits] core.git: 16 commits - sc/source

Noel Grandin noel at peralex.com
Thu Nov 12 00:45:31 PST 2015


 sc/source/filter/excel/xistyle.cxx              |   46 +++++++-------
 sc/source/filter/inc/xistyle.hxx                |   18 ++---
 sc/source/filter/xml/XMLStylesExportHelper.cxx  |    9 +-
 sc/source/filter/xml/XMLStylesExportHelper.hxx  |    4 -
 sc/source/filter/xml/xmlcelli.cxx               |   13 ++--
 sc/source/filter/xml/xmlcelli.hxx               |    6 -
 sc/source/ui/dbgui/PivotLayoutTreeListData.cxx  |    4 -
 sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx |    6 -
 sc/source/ui/dbgui/sortkeydlg.cxx               |    4 -
 sc/source/ui/dbgui/tpsort.cxx                   |   74 ++++++++++++------------
 sc/source/ui/docshell/autostyl.cxx              |   41 +++----------
 sc/source/ui/inc/PivotLayoutDialog.hxx          |    2 
 sc/source/ui/inc/PivotLayoutTreeListData.hxx    |    5 -
 sc/source/ui/inc/PivotLayoutTreeListLabel.hxx   |    5 -
 sc/source/ui/inc/areasave.hxx                   |    9 +-
 sc/source/ui/inc/autostyl.hxx                   |   31 ++++++++--
 sc/source/ui/inc/gridwin.hxx                    |    1 
 sc/source/ui/inc/sortkeydlg.hxx                 |    5 -
 sc/source/ui/inc/viewfunc.hxx                   |    1 
 sc/source/ui/undo/areasave.cxx                  |    9 --
 sc/source/ui/unoobj/cellsuno.cxx                |    6 -
 sc/source/ui/view/output2.cxx                   |   13 ++--
 22 files changed, 151 insertions(+), 161 deletions(-)

New commits:
commit 9822ddf366459d31148a4ccbf0a49da4f726b3db
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 10:21:50 2015 +0200

    sc: boost::ptr_vector->std::vector
    
    Change-Id: I046ca3c7b16906695c8b15beb33d3ccf735315a5

diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 4ff74b5..603d294 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -1683,8 +1683,6 @@ ScStyleSheet* XclImpXFBuffer::CreateStyleSheet( sal_uInt16 nXFIndex )
 
 // Buffer for XF indexes in cells =============================================
 
-IMPL_FIXEDMEMPOOL_NEWDEL( XclImpXFRange )
-
 bool XclImpXFRange::Expand( SCROW nScRow, const XclImpXFIndex& rXFIndex )
 {
     if( maXFIndex != rXFIndex )
@@ -1722,7 +1720,7 @@ void XclImpXFRangeColumn::SetDefaultXF( const XclImpXFIndex& rXFIndex )
     OSL_ENSURE( maIndexList.empty(), "XclImpXFRangeColumn::SetDefaultXF - Setting Default Column XF is not empty" );
 
     // insert a complete row range with one insert.
-    maIndexList.push_back( new XclImpXFRange( 0, MAXROW, rXFIndex ) );
+    maIndexList.push_back( XclImpXFRange( 0, MAXROW, rXFIndex ) );
 }
 
 void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex )
@@ -1759,20 +1757,20 @@ void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex )
                 ++(pThisRange->mnScRow1);
                 // try to concatenate with previous of this
                 if( !pPrevRange || !pPrevRange->Expand( nScRow, rXFIndex ) )
-                    Insert( new XclImpXFRange( nScRow, rXFIndex ), nIndex );
+                    Insert( XclImpXFRange( nScRow, rXFIndex ), nIndex );
             }
             else if( nLastScRow == nScRow )         // replace last XF
             {
                 --(pThisRange->mnScRow2);
                 if( !pNextRange || !pNextRange->Expand( nScRow, rXFIndex ) )
-                    Insert( new XclImpXFRange( nScRow, rXFIndex ), nNextIndex );
+                    Insert( XclImpXFRange( nScRow, rXFIndex ), nNextIndex );
             }
             else                                    // insert in the middle of the range
             {
                 pThisRange->mnScRow1 = nScRow + 1;
                 // List::Insert() moves entries towards end of list, so insert twice at nIndex
-                Insert( new XclImpXFRange( nScRow, rXFIndex ), nIndex );
-                Insert( new XclImpXFRange( nFirstScRow, nScRow - 1, pThisRange->maXFIndex ), nIndex );
+                Insert( XclImpXFRange( nScRow, rXFIndex ), nIndex );
+                Insert( XclImpXFRange( nFirstScRow, nScRow - 1, pThisRange->maXFIndex ), nIndex );
             }
             return;
         }
@@ -1788,12 +1786,12 @@ void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex )
         return;
 
     // create new range
-    Insert( new XclImpXFRange( nScRow, rXFIndex ), nNextIndex );
+    Insert( XclImpXFRange( nScRow, rXFIndex ), nNextIndex );
 }
 
-void XclImpXFRangeColumn::Insert(XclImpXFRange* pXFRange, sal_uLong nIndex)
+void XclImpXFRangeColumn::Insert(const XclImpXFRange& rXFRange, sal_uLong nIndex)
 {
-    maIndexList.insert( maIndexList.begin() + nIndex, pXFRange );
+    maIndexList.insert( maIndexList.begin() + nIndex, rXFRange );
 }
 
 void XclImpXFRangeColumn::Find(
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index 1fd2978..183d472 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -25,7 +25,6 @@
 #include <vector>
 #include <tools/mempool.hxx>
 #include <boost/noncopyable.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
 #include "rangelst.hxx"
 #include "patattr.hxx"
 #include "xladdress.hxx"
@@ -520,8 +519,6 @@ private:
 /** Contains an (encoded) XF index for a range of rows in a single column. */
 class XclImpXFRange
 {
-    DECL_FIXEDMEMPOOL_NEWDEL( XclImpXFRange )
-
 public:
     SCROW               mnScRow1;       /// The first row of an equal-formatted range.
     SCROW               mnScRow2;       /// The last row of an equal-formatted range.
@@ -562,7 +559,7 @@ inline bool XclImpXFRange::Contains( SCROW nScRow ) const
 class XclImpXFRangeColumn : private boost::noncopyable
 {
 public:
-    typedef ::boost::ptr_vector<XclImpXFRange> IndexList;
+    typedef std::vector<XclImpXFRange> IndexList;
 
     inline explicit     XclImpXFRangeColumn() {}
 
@@ -590,7 +587,7 @@ private:
     void                TryConcatPrev( sal_uLong nIndex );
 
     /** Insert a range into the list at the specified index. */
-    void                Insert(XclImpXFRange* pXFRange, sal_uLong nIndex);
+    void                Insert(const XclImpXFRange& rXFRange, sal_uLong nIndex);
 
 private:
     IndexList maIndexList;    /// The list of XF index range.
commit f7b9212610edee748ceb0ebaa243def995b1951c
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 10:16:04 2015 +0200

    sc: boost::ptr_vector->std::vector<std::unique_ptr>
    
    Change-Id: I4629d67b8cc69a2ace5a20f3d22505d7fc1ad10b

diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 21894be..4ff74b5 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -1569,7 +1569,7 @@ void XclImpXFBuffer::ReadXF( XclImpStream& rStrm )
 {
     XclImpXF* pXF = new XclImpXF( GetRoot() );
     pXF->ReadXF( rStrm );
-    maXFList.push_back( pXF );
+    maXFList.push_back( std::unique_ptr<XclImpXF>(pXF) );
 }
 
 void XclImpXFBuffer::ReadStyle( XclImpStream& rStrm )
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index 01e614d..1fd2978 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -489,10 +489,10 @@ public:
 
     /** Returns the object that stores all contents of an XF record. */
     inline XclImpXF*    GetXF( sal_uInt16 nXFIndex )
-                            { return (nXFIndex >= maXFList.size()) ? nullptr : &maXFList.at(nXFIndex); }
+                            { return (nXFIndex >= maXFList.size()) ? nullptr : maXFList.at(nXFIndex).get(); }
 
     inline const XclImpXF*    GetXF( sal_uInt16 nXFIndex ) const
-                            { return (nXFIndex >= maXFList.size()) ? nullptr : &maXFList.at(nXFIndex); }
+                            { return (nXFIndex >= maXFList.size()) ? nullptr : maXFList.at(nXFIndex).get(); }
 
     /** Returns the index to the Excel font used in the specified XF record. */
     sal_uInt16          GetFontIndex( sal_uInt16 nXFIndex ) const;
@@ -509,7 +509,7 @@ private:
     typedef std::vector< std::unique_ptr<XclImpStyle> >        XclImpStyleList;
     typedef ::std::map< sal_uInt16, XclImpStyle* >  XclImpStyleMap;
 
-    boost::ptr_vector< XclImpXF > maXFList; /// List of contents of all XF record.
+    std::vector< std::unique_ptr<XclImpXF> > maXFList; /// List of contents of all XF record.
     XclImpStyleList     maBuiltinStyles;    /// List of built-in cell styles.
     XclImpStyleList     maUserStyles;       /// List of user defined cell styles.
     XclImpStyleMap      maStylesByXf;       /// Maps XF records to cell styles.
commit 49b2208ffab0631a8aa150c26086f722aa8d978d
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 10:07:22 2015 +0200

    sc: boost::ptr_vector->std::vector<std::unique_ptr>
    
    Change-Id: I6f1ab588b4523fa5d2fdbe41b136fa8365499351

diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 68e49eb..21894be 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -1576,7 +1576,7 @@ void XclImpXFBuffer::ReadStyle( XclImpStream& rStrm )
 {
     XclImpStyle* pStyle = new XclImpStyle( GetRoot() );
     pStyle->ReadStyle( rStrm );
-    (pStyle->IsBuiltin() ? maBuiltinStyles : maUserStyles).push_back( pStyle );
+    (pStyle->IsBuiltin() ? maBuiltinStyles : maUserStyles).push_back( std::unique_ptr<XclImpStyle>(pStyle) );
     OSL_ENSURE( maStylesByXf.count( pStyle->GetXfId() ) == 0, "XclImpXFBuffer::ReadStyle - multiple styles with equal XF identifier" );
     maStylesByXf[ pStyle->GetXfId() ] = pStyle;
 }
@@ -1632,13 +1632,13 @@ void XclImpXFBuffer::CreateUserStyles()
         in the aConflictNameStyles list. */
     for( XclImpStyleList::iterator itStyle = maBuiltinStyles.begin(); itStyle != maBuiltinStyles.end(); ++itStyle )
     {
-        OUString aStyleName = XclTools::GetBuiltInStyleName( itStyle->GetBuiltinId(), itStyle->GetName(), itStyle->GetLevel() );
+        OUString aStyleName = XclTools::GetBuiltInStyleName( (*itStyle)->GetBuiltinId(), (*itStyle)->GetName(), (*itStyle)->GetLevel() );
         OSL_ENSURE( bReserveAll || (aCellStyles.count( aStyleName ) == 0),
             "XclImpXFBuffer::CreateUserStyles - multiple styles with equal built-in identifier" );
         if( aCellStyles.count( aStyleName ) > 0 )
-            aConflictNameStyles.push_back( &(*itStyle) );
+            aConflictNameStyles.push_back( itStyle->get() );
         else
-            aCellStyles[ aStyleName ] = &(*itStyle);
+            aCellStyles[ aStyleName ] = itStyle->get();
     }
 
     /*  Calculate names of user defined styles. Store styles with reserved
@@ -1646,12 +1646,12 @@ void XclImpXFBuffer::CreateUserStyles()
     for( XclImpStyleList::iterator itStyle = maUserStyles.begin(); itStyle != maUserStyles.end(); ++itStyle )
     {
         // #i1624# #i1768# ignore unnamed user styles
-        if( !itStyle->GetName().isEmpty() )
+        if( !(*itStyle)->GetName().isEmpty() )
         {
-            if( aCellStyles.count( itStyle->GetName() ) > 0 )
-                aConflictNameStyles.push_back( &(*itStyle) );
+            if( aCellStyles.count( (*itStyle)->GetName() ) > 0 )
+                aConflictNameStyles.push_back( itStyle->get() );
             else
-                aCellStyles[ itStyle->GetName() ] = &(*itStyle);
+                aCellStyles[ (*itStyle)->GetName() ] = itStyle->get();
         }
     }
 
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index f302bea..01e614d 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -506,7 +506,7 @@ public:
     ScStyleSheet*       CreateStyleSheet( sal_uInt16 nXFIndex );
 
 private:
-    typedef boost::ptr_vector< XclImpStyle >        XclImpStyleList;
+    typedef std::vector< std::unique_ptr<XclImpStyle> >        XclImpStyleList;
     typedef ::std::map< sal_uInt16, XclImpStyle* >  XclImpStyleMap;
 
     boost::ptr_vector< XclImpXF > maXFList; /// List of contents of all XF record.
commit 3a03dd6c66b50d37df498e7820efbb7f345965b0
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 10:02:40 2015 +0200

    sc: boost::ptr_vector->std::vector
    
    Change-Id: I5495205d376284f2310e5dc67e897e7a9ccf010f

diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 4dc07db..68e49eb 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -561,15 +561,15 @@ const XclImpFont* XclImpFontBuffer::GetFont( sal_uInt16 nFontIndex ) const
 
 void XclImpFontBuffer::ReadFont( XclImpStream& rStrm )
 {
-    XclImpFont* pFont = new XclImpFont( GetRoot() );
-    pFont->ReadFont( rStrm );
-    maFontList.push_back( pFont );
+    maFontList.push_back( XclImpFont( GetRoot() ) );
+    XclImpFont& rFont = maFontList.back();
+    rFont.ReadFont( rStrm );
 
     if( maFontList.size() == 1 )
     {
-        UpdateAppFont( pFont->GetFontData(), pFont->HasCharSet() );
+        UpdateAppFont( rFont.GetFontData(), rFont.HasCharSet() );
         // #i71033# set text encoding from application font, if CODEPAGE is missing
-        SetAppFontEncoding( pFont->GetFontEncoding() );
+        SetAppFontEncoding( rFont.GetFontEncoding() );
     }
 }
 
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index d0e8771..f302bea 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -22,6 +22,7 @@
 
 #include <list>
 #include <memory>
+#include <vector>
 #include <tools/mempool.hxx>
 #include <boost/noncopyable.hpp>
 #include <boost/ptr_container/ptr_vector.hpp>
@@ -194,7 +195,7 @@ private:
     void                UpdateAppFont( const XclFontData& rFontData, bool bHasCharSet );
 
 private:
-    boost::ptr_vector< XclImpFont > maFontList; /// List of all FONT records in the Excel file.
+    std::vector< XclImpFont > maFontList; /// List of all FONT records in the Excel file.
     XclFontData         maAppFont;              /// Application font (for column width).
     XclImpFont          maFont4;                /// Built-in font with index 4.
     XclImpFont          maCtrlFont;             /// BIFF5 default form controls font (Helv,8pt,bold).
commit e6f574211cba9687fefd3efddf732edefc72da31
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 09:54:28 2015 +0200

    sc: boost::ptr_vector->std::vector<std::unique_ptr>
    
    Change-Id: Ic362e3aa55f5ae2e9a789922257ce9db99ef0a34

diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index 979024a..4805ccc 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -34,6 +34,7 @@
 #include <com/sun/star/sheet/TableValidationVisibility.hpp>
 #include <comphelper/extract.hxx>
 #include <sfx2/app.hxx>
+#include <o3tl/make_unique.hxx>
 
 #include <algorithm>
 
@@ -1118,7 +1119,7 @@ void ScRowStyles::AddNewTable(const sal_Int32 nTable, const sal_Int32 nFields)
     if (nTable > nSize)
         for (sal_Int32 i = nSize; i < nTable; ++i)
         {
-            aTables.push_back(new StylesType(0, nFields+1, -1));
+            aTables.push_back(o3tl::make_unique<StylesType>(0, nFields+1, -1));
         }
 }
 
@@ -1132,7 +1133,7 @@ sal_Int32 ScRowStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32
         // Cache hit !
         return maCache.mnStyle;
 
-    StylesType& r = aTables[nTable];
+    StylesType& r = *aTables[nTable].get();
     if (!r.is_tree_valid())
         r.build_tree();
     sal_Int32 nStyle(0);
@@ -1154,7 +1155,7 @@ void ScRowStyles::AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nFie
     const sal_Int32 nStringIndex)
 {
     OSL_ENSURE(static_cast<size_t>(nTable) < aTables.size(), "wrong table");
-    StylesType& r = aTables[nTable];
+    StylesType& r = *aTables[nTable].get();
     r.insert_back(nField, nField+1, nStringIndex);
 }
 
@@ -1163,7 +1164,7 @@ void ScRowStyles::AddFieldStyleName(const sal_Int32 nTable, const sal_Int32 nSta
 {
     OSL_ENSURE( nStartField <= nEndField, "bad field range");
     OSL_ENSURE(static_cast<size_t>(nTable) < aTables.size(), "wrong table");
-    StylesType& r = aTables[nTable];
+    StylesType& r = *aTables[nTable].get();
     r.insert_back(nStartField, nEndField+1, nStringIndex);
 }
 
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.hxx b/sc/source/filter/xml/XMLStylesExportHelper.hxx
index 86825c3..673dedb 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.hxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SC_SOURCE_FILTER_XML_XMLSTYLESEXPORTHELPER_HXX
 
 #include <vector>
+#include <memory>
 #include <list>
 #include <com/sun/star/uno/Any.h>
 #include <com/sun/star/table/CellRangeAddress.hpp>
@@ -29,7 +30,6 @@
 #include <com/sun/star/sheet/ValidationAlertStyle.hpp>
 #include <com/sun/star/sheet/ValidationType.hpp>
 
-#include <boost/ptr_container/ptr_vector.hpp>
 #include <mdds/flat_segment_tree.hpp>
 
 class ScDocument;
@@ -251,7 +251,7 @@ public:
 class ScRowStyles : public ScColumnRowStylesBase
 {
     typedef ::mdds::flat_segment_tree<sal_Int32, sal_Int32> StylesType;
-    ::boost::ptr_vector<StylesType> aTables;
+    std::vector<std::unique_ptr<StylesType> > aTables;
     struct Cache
     {
         sal_Int32 mnTable;
commit 3d85664ffc00122f421d80ef417c09d0a8bd2eac
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 09:51:41 2015 +0200

    sc: boost::ptr_vector->std::vector<std::unique_ptr>
    
    Change-Id: I930114dd44fadfcd98d1204d51ef271a4c556388

diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 34a15fd..ded2e194 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -361,8 +361,8 @@ void ScXMLTableRowCellContext::PushParagraphSpan(const OUString& rSpan, const OU
 void ScXMLTableRowCellContext::PushParagraphField(SvxFieldData* pData, const OUString& rStyleName)
 {
     mbHasFormatRuns = true;
-    maFields.push_back(new Field(pData));
-    Field& rField = maFields.back();
+    maFields.push_back(o3tl::make_unique<Field>(pData));
+    Field& rField = *maFields.back().get();
 
     sal_Int32 nPos = maParagraph.getLength();
     maParagraph.append('\1'); // Placeholder text for inserted field item.
@@ -1114,7 +1114,7 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress& rCurrentPos,
                 {
                     FieldsType::const_iterator it = maFields.begin(), itEnd = maFields.end();
                     for (; it != itEnd; ++it)
-                        mpEditEngine->QuickInsertField(SvxFieldItem(*it->mpData, EE_FEATURE_FIELD), it->maSelection);
+                        mpEditEngine->QuickInsertField(SvxFieldItem(*(*it)->mpData, EE_FEATURE_FIELD), (*it)->maSelection);
                 }
 
                 // This edit engine uses the SfxItemPool instance returned
diff --git a/sc/source/filter/xml/xmlcelli.hxx b/sc/source/filter/xml/xmlcelli.hxx
index 534085c..56090ca 100644
--- a/sc/source/filter/xml/xmlcelli.hxx
+++ b/sc/source/filter/xml/xmlcelli.hxx
@@ -28,7 +28,6 @@
 #include <editeng/flditem.hxx>
 
 #include <boost/optional.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
 #include <boost/noncopyable.hpp>
 #include <memory>
 #include <vector>
@@ -58,7 +57,7 @@ class ScXMLTableRowCellContext : public ScXMLImportContext
     };
 
     typedef std::vector<std::unique_ptr<ParaFormat> > ParaFormatsType;
-    typedef boost::ptr_vector<Field> FieldsType;
+    typedef std::vector<std::unique_ptr<Field> > FieldsType;
     typedef std::pair<OUString, OUString> FormulaWithNamespace;
 
     boost::optional<FormulaWithNamespace> maFormula; /// table:formula attribute
commit ece92b9aabfcf12f44416da14578b2c58ec1a015
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 09:49:08 2015 +0200

    sc: boost::ptr_vector->std::vector<std::unique_ptr>
    
    Change-Id: I1e225446cfbcf9a9b155eec58f1e45bd812298f7

diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 904f8c2..34a15fd 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -116,6 +116,7 @@
 #include <tools/date.hxx>
 #include <i18nlangtag/lang.h>
 #include <comphelper/extract.hxx>
+#include <o3tl/make_unique.hxx>
 
 using namespace com::sun::star;
 using namespace xmloff::token;
@@ -403,8 +404,8 @@ void ScXMLTableRowCellContext::PushFormat(sal_Int32 nBegin, sal_Int32 nEnd, cons
     const ScXMLEditAttributeMap& rEditAttrMap = GetScImport().GetEditAttributeMap();
 
     mbHasFormatRuns = true;
-    maFormats.push_back(new ParaFormat(*mpEditEngine));
-    ParaFormat& rFmt = maFormats.back();
+    maFormats.push_back(o3tl::make_unique<ParaFormat>(*mpEditEngine));
+    ParaFormat& rFmt = *maFormats.back().get();
     rFmt.maSelection.nStartPara = rFmt.maSelection.nEndPara = mnCurParagraph;
     rFmt.maSelection.nStartPos = nBegin;
     rFmt.maSelection.nEndPos = nEnd;
@@ -1107,7 +1108,7 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress& rCurrentPos,
                 {
                     ParaFormatsType::const_iterator it = maFormats.begin(), itEnd = maFormats.end();
                     for (; it != itEnd; ++it)
-                        mpEditEngine->QuickSetAttribs(it->maItemSet, it->maSelection);
+                        mpEditEngine->QuickSetAttribs((*it)->maItemSet, (*it)->maSelection);
                 }
 
                 {
diff --git a/sc/source/filter/xml/xmlcelli.hxx b/sc/source/filter/xml/xmlcelli.hxx
index f302f30..534085c 100644
--- a/sc/source/filter/xml/xmlcelli.hxx
+++ b/sc/source/filter/xml/xmlcelli.hxx
@@ -31,6 +31,7 @@
 #include <boost/ptr_container/ptr_vector.hpp>
 #include <boost/noncopyable.hpp>
 #include <memory>
+#include <vector>
 
 class ScXMLImport;
 class ScFormulaCell;
@@ -56,7 +57,7 @@ class ScXMLTableRowCellContext : public ScXMLImportContext
         ~Field();
     };
 
-    typedef boost::ptr_vector<ParaFormat> ParaFormatsType;
+    typedef std::vector<std::unique_ptr<ParaFormat> > ParaFormatsType;
     typedef boost::ptr_vector<Field> FieldsType;
     typedef std::pair<OUString, OUString> FormulaWithNamespace;
 
commit e666bd8e6d00dadbea74b96a8be8ec830ec92c46
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 09:39:59 2015 +0200

    sc: boost::ptr_vector->std::vector<std::unique_ptr>
    
    Change-Id: I1e1d27b2e7262cda230f193a867d288220dc0ec6

diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
index 7623ed3..9bee066 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
@@ -137,7 +137,7 @@ void ScPivotLayoutTreeListData::FillDataField(ScPivotFieldVector& rDataFields)
                                                        pItemValue->maName,
                                                        pItemValue->maFunctionData.mnDupCount);
 
-        maDataItemValues.push_back(pItemValue);
+        maDataItemValues.push_back(std::unique_ptr<ScItemValue>(pItemValue));
         InsertEntry(sDataItemName, nullptr, false, TREELIST_APPEND, pItemValue);
     }
 }
@@ -193,7 +193,7 @@ void ScPivotLayoutTreeListData::InsertEntryForItem(ScItemValue* pItemValue, sal_
 {
     ScItemValue* pDataItemValue = new ScItemValue(pItemValue);
     pDataItemValue->mpOriginalItemValue = pItemValue;
-    maDataItemValues.push_back(pDataItemValue);
+    maDataItemValues.push_back(std::unique_ptr<ScItemValue>(pDataItemValue));
 
     ScPivotFuncData& rFunctionData = pDataItemValue->maFunctionData;
 
diff --git a/sc/source/ui/inc/PivotLayoutDialog.hxx b/sc/source/ui/inc/PivotLayoutDialog.hxx
index da95ea9..df4e901 100644
--- a/sc/source/ui/inc/PivotLayoutDialog.hxx
+++ b/sc/source/ui/inc/PivotLayoutDialog.hxx
@@ -11,8 +11,6 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTDIALOG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTDIALOG_HXX
 
-#include <boost/ptr_container/ptr_vector.hpp>
-
 #include <svx/checklbx.hxx>
 #include <vcl/lstbox.hxx>
 #include "anyrefdg.hxx"
diff --git a/sc/source/ui/inc/PivotLayoutTreeListData.hxx b/sc/source/ui/inc/PivotLayoutTreeListData.hxx
index 73c6f0c..331967f 100644
--- a/sc/source/ui/inc/PivotLayoutTreeListData.hxx
+++ b/sc/source/ui/inc/PivotLayoutTreeListData.hxx
@@ -12,12 +12,13 @@
 #define INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTTREELISTDATA_HXX
 
 #include "PivotLayoutTreeListBase.hxx"
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
+#include <memory>
 
 class ScPivotLayoutTreeListData : public ScPivotLayoutTreeListBase
 {
 private:
-    boost::ptr_vector<ScItemValue> maDataItemValues;
+    std::vector<std::unique_ptr<ScItemValue> > maDataItemValues;
 
 public:
     ScPivotLayoutTreeListData(vcl::Window* pParent, WinBits nBits);
commit 8733b2ab2480cddf96a694ee3fe12703e402a51f
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 09:32:28 2015 +0200

    sc: boost::ptr_vector->std::vector<std::unique_ptr>
    
    Change-Id: I1634157c56f5aa7a9096ce1bba4df09fd86f7748

diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
index 5efd63f..d4f98ab 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
@@ -43,7 +43,7 @@ void ScPivotLayoutTreeListLabel::FillLabelFields(ScDPLabelDataVector& rLabelVect
         const ScDPLabelData& rLabelData = *it;
 
         ScItemValue* pValue = new ScItemValue(rLabelData.maName, rLabelData.mnCol, rLabelData.mnFuncMask);
-        maItemValues.push_back(pValue);
+        maItemValues.push_back(std::unique_ptr<ScItemValue>(pValue));
         if (rLabelData.mbDataLayout)
         {
             maDataItem = maItemValues.size() - 1;
@@ -71,8 +71,8 @@ bool ScPivotLayoutTreeListLabel::IsDataElement(SCCOL nColumn)
 ScItemValue* ScPivotLayoutTreeListLabel::GetItem(SCCOL nColumn)
 {
     if (nColumn == PIVOT_DATA_FIELD)
-        return &maItemValues[maDataItem];
-    return &maItemValues[nColumn];
+        return maItemValues[maDataItem].get();
+    return maItemValues[nColumn].get();
 }
 
 void ScPivotLayoutTreeListLabel::KeyInput(const KeyEvent& rKeyEvent)
diff --git a/sc/source/ui/inc/PivotLayoutTreeListLabel.hxx b/sc/source/ui/inc/PivotLayoutTreeListLabel.hxx
index 08de8d2..03f42ea 100644
--- a/sc/source/ui/inc/PivotLayoutTreeListLabel.hxx
+++ b/sc/source/ui/inc/PivotLayoutTreeListLabel.hxx
@@ -12,12 +12,13 @@
 #define INCLUDED_SC_SOURCE_UI_INC_PIVOTLAYOUTTREELISTLABEL_HXX
 
 #include "PivotLayoutTreeListBase.hxx"
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
+#include <memory>
 
 class ScPivotLayoutTreeListLabel : public ScPivotLayoutTreeListBase
 {
 private:
-    boost::ptr_vector<ScItemValue> maItemValues;
+    std::vector<std::unique_ptr<ScItemValue> > maItemValues;
     SCCOL maDataItem;
 
 public:
commit f24323d4f463ce15f07c07f1bf51ca8dca485923
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 09:25:23 2015 +0200

    sc: boost::ptr_vector->std::vector
    
    Change-Id: I66c59a40a551d844da85fc39367ec2d79fcf0d18

diff --git a/sc/source/ui/inc/areasave.hxx b/sc/source/ui/inc/areasave.hxx
index 6ea8b39..b55ccf1 100644
--- a/sc/source/ui/inc/areasave.hxx
+++ b/sc/source/ui/inc/areasave.hxx
@@ -22,7 +22,7 @@
 
 #include "address.hxx"
 
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
 
 class ScDocument;
 class ScAreaLink;
@@ -40,18 +40,17 @@ private:
 public:
     ScAreaLinkSaver( const ScAreaLink& rSource );
     ScAreaLinkSaver( const ScAreaLinkSaver& rCopy );
-    ~ScAreaLinkSaver();
 
     bool        IsEqual( const ScAreaLink& rCompare ) const;
     bool        IsEqualSource( const ScAreaLink& rCompare ) const;
 
     void        WriteToLink( ScAreaLink& rLink ) const;
-    void InsertNewLink( ScDocument* pDoc );
+    void        InsertNewLink( ScDocument* pDoc );
 };
 
 class ScAreaLinkSaveCollection
 {
-    typedef ::boost::ptr_vector<ScAreaLinkSaver> DataType;
+    typedef ::std::vector<ScAreaLinkSaver> DataType;
     DataType maData;
 public:
     ScAreaLinkSaveCollection();
@@ -67,7 +66,7 @@ public:
     ScAreaLinkSaver& operator[](size_t nIndex);
     const ScAreaLinkSaver& operator[](size_t nIndex) const;
     size_t size() const;
-    void push_back(ScAreaLinkSaver* p);
+    void push_back(const ScAreaLinkSaver&);
 };
 
 #endif
diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx
index da50ea4..2a2b906 100644
--- a/sc/source/ui/undo/areasave.cxx
+++ b/sc/source/ui/undo/areasave.cxx
@@ -44,8 +44,6 @@ ScAreaLinkSaver::ScAreaLinkSaver( const ScAreaLinkSaver& rCopy ) :
 {
 }
 
-ScAreaLinkSaver::~ScAreaLinkSaver() {}
-
 bool ScAreaLinkSaver::IsEqualSource( const ScAreaLink& rCompare ) const
 {
     return ( aFileName.equals(rCompare.GetFile()) &&
@@ -173,13 +171,12 @@ ScAreaLinkSaveCollection* ScAreaLinkSaveCollection::CreateFromDoc( const ScDocum
         for (sal_uInt16 i=0; i<nLinkCount; i++)
         {
             ::sfx2::SvBaseLink* pBase = rLinks[i].get();
-            if (dynamic_cast<const ScAreaLink*>( pBase) !=  nullptr)
+            if (dynamic_cast<const ScAreaLink*>( pBase) != nullptr)
             {
                 if (!pColl)
                     pColl = new ScAreaLinkSaveCollection;
 
-                ScAreaLinkSaver* pSaver = new ScAreaLinkSaver( *static_cast<ScAreaLink*>(pBase ));
-                pColl->push_back(pSaver);
+                pColl->push_back( ScAreaLinkSaver( *static_cast<ScAreaLink*>(pBase ) ) );
             }
         }
     }
@@ -202,7 +199,7 @@ size_t ScAreaLinkSaveCollection::size() const
     return maData.size();
 }
 
-void ScAreaLinkSaveCollection::push_back(ScAreaLinkSaver* p)
+void ScAreaLinkSaveCollection::push_back(const ScAreaLinkSaver& p)
 {
     maData.push_back(p);
 }
commit 774707888d7af5ba657b59c945619e799e30e9d5
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 09:22:17 2015 +0200

    sc: boost::ptr_vector->std::vector
    
    Change-Id: I52f6d12da17bf8a6ba14064d3cbb8ff6d968f9d5

diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx
index 7edcbef..1e09961 100644
--- a/sc/source/ui/docshell/autostyl.cxx
+++ b/sc/source/ui/docshell/autostyl.cxx
@@ -24,18 +24,7 @@
 #include "docsh.hxx"
 #include "sc.hrc"
 
-struct ScAutoStyleInitData
-{
-    ScRange     aRange;
-    OUString    aStyle1;
-    sal_uLong   nTimeout;
-    OUString    aStyle2;
-
-    ScAutoStyleInitData( const ScRange& rR, const OUString& rSt1, sal_uLong nT, const OUString& rSt2 ) :
-        aRange(rR), aStyle1(rSt1), nTimeout(nT), aStyle2(rSt2) {}
-};
-
-inline sal_uLong TimeNow()          // Sekunden
+static inline sal_uLong TimeNow()          // Sekunden
 {
     return (sal_uLong) time(nullptr);
 }
@@ -86,13 +75,13 @@ ScAutoStyleList::~ScAutoStyleList()
 void ScAutoStyleList::AddInitial( const ScRange& rRange, const OUString& rStyle1,
                                     sal_uLong nTimeout, const OUString& rStyle2 )
 {
-    aInitials.push_back(new ScAutoStyleInitData( rRange, rStyle1, nTimeout, rStyle2 ));
+    aInitials.push_back( ScAutoStyleInitData( rRange, rStyle1, nTimeout, rStyle2 ) );
     aInitIdle.Start();
 }
 
 IMPL_LINK_NOARG_TYPED(ScAutoStyleList, InitHdl, Idle *, void)
 {
-    boost::ptr_vector<ScAutoStyleInitData>::iterator iter;
+    std::vector<ScAutoStyleInitData>::iterator iter;
     for (iter = aInitials.begin(); iter != aInitials.end(); ++iter)
     {
         //  apply first style immediately
diff --git a/sc/source/ui/inc/autostyl.hxx b/sc/source/ui/inc/autostyl.hxx
index adc371b..caf2d45 100644
--- a/sc/source/ui/inc/autostyl.hxx
+++ b/sc/source/ui/inc/autostyl.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_AUTOSTYL_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_AUTOSTYL_HXX
 
-#include <boost/ptr_container/ptr_vector.hpp>
 #include <vector>
 #include <rtl/ustring.hxx>
 #include <vcl/timer.hxx>
@@ -28,7 +27,6 @@
 
 class ScDocShell;
 class ScRange;
-struct ScAutoStyleInitData;
 
 struct ScAutoStyleData
 {
@@ -39,6 +37,17 @@ struct ScAutoStyleData
     ScAutoStyleData( sal_uLong nT, const ScRange& rR, const OUString& rT ) :
         nTimeout(nT), aRange(rR), aStyle(rT) {}
 };
+struct ScAutoStyleInitData
+{
+    ScRange     aRange;
+    OUString    aStyle1;
+    sal_uLong   nTimeout;
+    OUString    aStyle2;
+
+    ScAutoStyleInitData( const ScRange& rR, const OUString& rSt1, sal_uLong nT, const OUString& rSt2 ) :
+        aRange(rR), aStyle1(rSt1), nTimeout(nT), aStyle2(rSt2) {}
+};
+
 
 class ScAutoStyleList
 {
@@ -48,8 +57,8 @@ private:
     Timer           aTimer;
     Idle            aInitIdle;
     sal_uLong       nTimerStart;
-    std::vector<ScAutoStyleData>           aEntries;
-    boost::ptr_vector<ScAutoStyleInitData> aInitials;
+    std::vector<ScAutoStyleData>     aEntries;
+    std::vector<ScAutoStyleInitData> aInitials;
 
     void    ExecuteEntries();
     void    AdjustEntries(sal_uLong nDiff);
commit 82896e32ed91b432f796bbb9441592a7fb9cb61c
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 09:19:51 2015 +0200

    sc: boost::ptr_vector->std::vector
    
    Change-Id: Id445860c63347a49de1291470d091323f13ec8b5

diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx
index 81a80d2..7edcbef 100644
--- a/sc/source/ui/docshell/autostyl.cxx
+++ b/sc/source/ui/docshell/autostyl.cxx
@@ -35,16 +35,6 @@ struct ScAutoStyleInitData
         aRange(rR), aStyle1(rSt1), nTimeout(nT), aStyle2(rSt2) {}
 };
 
-struct ScAutoStyleData
-{
-    sal_uLong nTimeout;
-    ScRange   aRange;
-    OUString  aStyle;
-
-    ScAutoStyleData( sal_uLong nT, const ScRange& rR, const OUString& rT ) :
-        nTimeout(nT), aRange(rR), aStyle(rT) {}
-};
-
 inline sal_uLong TimeNow()          // Sekunden
 {
     return (sal_uLong) time(nullptr);
@@ -122,7 +112,7 @@ void ScAutoStyleList::AddEntry( sal_uLong nTimeout, const ScRange& rRange, const
     sal_uLong nNow = TimeNow();
 
     // Remove the first item with the same range.
-    ::boost::ptr_vector<ScAutoStyleData>::iterator itr =
+    std::vector<ScAutoStyleData>::iterator itr =
         ::std::find_if(aEntries.begin(), aEntries.end(), FindByRange(rRange));
 
     if (itr != aEntries.end())
@@ -137,10 +127,10 @@ void ScAutoStyleList::AddEntry( sal_uLong nTimeout, const ScRange& rRange, const
     }
 
     //  Einfuege-Position suchen
-    boost::ptr_vector<ScAutoStyleData>::iterator iter =
+    std::vector<ScAutoStyleData>::iterator iter =
         ::std::find_if(aEntries.begin(), aEntries.end(), FindByTimeout(nTimeout));
 
-    aEntries.insert(iter,new ScAutoStyleData(nTimeout,rRange,rStyle));
+    aEntries.insert(iter, ScAutoStyleData(nTimeout,rRange,rStyle));
 
     //  abgelaufene ausfuehren, Timer neu starten
 
@@ -150,7 +140,7 @@ void ScAutoStyleList::AddEntry( sal_uLong nTimeout, const ScRange& rRange, const
 
 void ScAutoStyleList::AdjustEntries( sal_uLong nDiff )  // Millisekunden
 {
-    boost::ptr_vector<ScAutoStyleData>::iterator iter;
+    std::vector<ScAutoStyleData>::iterator iter;
     for (iter = aEntries.begin(); iter != aEntries.end(); ++iter)
     {
         if (iter->nTimeout <= nDiff)
@@ -164,7 +154,7 @@ void ScAutoStyleList::ExecuteEntries()
 {
     // Execute and remove all items with timeout == 0 from the begin position
     // until the first item with non-zero timeout value.
-    ::boost::ptr_vector<ScAutoStyleData>::iterator itr = aEntries.begin(), itrEnd = aEntries.end();
+    std::vector<ScAutoStyleData>::iterator itr = aEntries.begin(), itrEnd = aEntries.end();
     for (; itr != itrEnd; ++itr)
     {
         if (itr->nTimeout)
@@ -181,7 +171,7 @@ void ScAutoStyleList::ExecuteAllNow()
 {
     aTimer.Stop();
 
-    boost::ptr_vector<ScAutoStyleData>::iterator iter;
+    std::vector<ScAutoStyleData>::iterator iter;
     for (iter = aEntries.begin(); iter != aEntries.end(); ++iter)
         pDocSh->DoAutoStyle(iter->aRange,iter->aStyle);
 
@@ -191,7 +181,7 @@ void ScAutoStyleList::ExecuteAllNow()
 void ScAutoStyleList::StartTimer( sal_uLong nNow )      // Sekunden
 {
     // ersten Eintrag mit Timeout != 0 suchen
-    boost::ptr_vector<ScAutoStyleData>::iterator iter =
+    std::vector<ScAutoStyleData>::iterator iter =
         ::std::find_if(aEntries.begin(),aEntries.end(), FindNonZeroTimeout());
 
     if (iter != aEntries.end())
diff --git a/sc/source/ui/inc/autostyl.hxx b/sc/source/ui/inc/autostyl.hxx
index dcc3da7..adc371b 100644
--- a/sc/source/ui/inc/autostyl.hxx
+++ b/sc/source/ui/inc/autostyl.hxx
@@ -21,15 +21,25 @@
 #define INCLUDED_SC_SOURCE_UI_INC_AUTOSTYL_HXX
 
 #include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
 #include <rtl/ustring.hxx>
 #include <vcl/timer.hxx>
 #include <vcl/idle.hxx>
 
 class ScDocShell;
 class ScRange;
-struct ScAutoStyleData;
 struct ScAutoStyleInitData;
 
+struct ScAutoStyleData
+{
+    sal_uLong nTimeout;
+    ScRange   aRange;
+    OUString  aStyle;
+
+    ScAutoStyleData( sal_uLong nT, const ScRange& rR, const OUString& rT ) :
+        nTimeout(nT), aRange(rR), aStyle(rT) {}
+};
+
 class ScAutoStyleList
 {
 private:
@@ -37,8 +47,8 @@ private:
     ScDocShell*     pDocSh;
     Timer           aTimer;
     Idle            aInitIdle;
-    sal_uLong           nTimerStart;
-    boost::ptr_vector<ScAutoStyleData> aEntries;
+    sal_uLong       nTimerStart;
+    std::vector<ScAutoStyleData>           aEntries;
     boost::ptr_vector<ScAutoStyleInitData> aInitials;
 
     void    ExecuteEntries();
commit 2328d1dd5ffe76d66a734a2a12587cee31ea713a
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 09:10:28 2015 +0200

    sc: boost::ptr_vector->std::vector<std::unique_ptr>
    
    Change-Id: Id5fba14ac73f6bd90915503ee3be64eb1f50d157

diff --git a/sc/source/ui/dbgui/sortkeydlg.cxx b/sc/source/ui/dbgui/sortkeydlg.cxx
index 5b353a3..6b728fa 100644
--- a/sc/source/ui/dbgui/sortkeydlg.cxx
+++ b/sc/source/ui/dbgui/sortkeydlg.cxx
@@ -42,7 +42,7 @@ ScSortKeyWindow::ScSortKeyWindow(SfxTabPage* pParent, ScSortKeyItems& rSortKeyIt
 {
     pParent->get(m_pBox, "SortKeyWindow");
     if (!mrSortKeyItems.empty())
-        nItemHeight = mrSortKeyItems.front().getItemHeight();
+        nItemHeight = mrSortKeyItems.front()->getItemHeight();
     else
     {
         ScSortKeyItem aTemp(m_pBox);
@@ -70,7 +70,7 @@ void ScSortKeyWindow::AddSortKey( sal_uInt16 nItemNumber )
                      OUString::number( nItemNumber );
     pSortKeyItem->m_pFlSort->SetText( aLine );
 
-    mrSortKeyItems.push_back(pSortKeyItem);
+    mrSortKeyItems.push_back(std::unique_ptr<ScSortKeyItem>(pSortKeyItem));
 }
 
 void ScSortKeyWindow::DoScroll(sal_Int32 nNewPos)
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index daa4530..3367c50 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -140,7 +140,7 @@ void ScTabPageSortFields::Init()
     for ( sal_uInt16 i=0; i<nSortKeyCount; i++ )
     {
         maSortKeyCtrl.AddSortKey(i+1);
-        maSortKeyItems[i].m_pLbSort->SetSelectHdl( LINK( this, ScTabPageSortFields, SelectHdl ) );
+        maSortKeyItems[i]->m_pLbSort->SetSelectHdl( LINK( this, ScTabPageSortFields, SelectHdl ) );
     }
 }
 
@@ -155,7 +155,7 @@ void ScTabPageSortFields::Reset( const SfxItemSet* /* rArgSet */ )
     bSortByRows = aSortData.bByRow;
     bHasHeader  = aSortData.bHasHeader;
 
-    if ( maSortKeyItems[0].m_pLbSort->GetEntryCount() == 0 )
+    if ( maSortKeyItems[0]->m_pLbSort->GetEntryCount() == 0 )
         FillFieldLists(0);
 
     // ListBox selection:
@@ -165,7 +165,7 @@ void ScTabPageSortFields::Reset( const SfxItemSet* /* rArgSet */ )
         for ( sal_uInt16 i=nSortKeyCount; i<aSortData.GetSortKeyCount(); i++ )
         {
             maSortKeyCtrl.AddSortKey(i+1);
-            maSortKeyItems[i].m_pLbSort->SetSelectHdl( LINK( this,
+            maSortKeyItems[i]->m_pLbSort->SetSelectHdl( LINK( this,
                                  ScTabPageSortFields, SelectHdl ) );
         }
         nSortKeyCount = aSortData.GetSortKeyCount();
@@ -175,26 +175,26 @@ void ScTabPageSortFields::Reset( const SfxItemSet* /* rArgSet */ )
         {
             if (aSortData.maKeyState[i].bDoSort )
             {
-                maSortKeyItems[i].m_pLbSort->SelectEntryPos( GetFieldSelPos(
+                maSortKeyItems[i]->m_pLbSort->SelectEntryPos( GetFieldSelPos(
                                     aSortData.maKeyState[i].nField ) );
                 (aSortData.maKeyState[i].bAscending)
-                    ? maSortKeyItems[i].m_pBtnUp->Check()
-                    : maSortKeyItems[i].m_pBtnDown->Check();
+                    ? maSortKeyItems[i]->m_pBtnUp->Check()
+                    : maSortKeyItems[i]->m_pBtnDown->Check();
             }
             else
             {
-                maSortKeyItems[i].m_pLbSort->SelectEntryPos( 0 ); // Select none
-                maSortKeyItems[i].m_pBtnUp->Check();
+                maSortKeyItems[i]->m_pLbSort->SelectEntryPos( 0 ); // Select none
+                maSortKeyItems[i]->m_pBtnUp->Check();
             }
         }
 
         // Enable or disable field depending on preceding Listbox selection
-        maSortKeyItems[0].EnableField();
+        maSortKeyItems[0]->EnableField();
         for ( sal_uInt16 i=1; i<nSortKeyCount; i++ )
-            if ( maSortKeyItems[i - 1].m_pLbSort->GetSelectEntryPos() == 0 )
-                maSortKeyItems[i].DisableField();
+            if ( maSortKeyItems[i - 1]->m_pLbSort->GetSelectEntryPos() == 0 )
+                maSortKeyItems[i]->DisableField();
             else
-                maSortKeyItems[i].EnableField();
+                maSortKeyItems[i]->EnableField();
     }
     else
     {
@@ -207,17 +207,17 @@ void ScTabPageSortFields::Reset( const SfxItemSet* /* rArgSet */ )
 
         sal_uInt16  nSort1Pos = nCol - aSortData.nCol1+1;
 
-        maSortKeyItems[0].m_pLbSort->SelectEntryPos( nSort1Pos );
+        maSortKeyItems[0]->m_pLbSort->SelectEntryPos( nSort1Pos );
         for ( sal_uInt16 i=1; i<nSortKeyCount; i++ )
-            maSortKeyItems[i].m_pLbSort->SelectEntryPos( 0 );
+            maSortKeyItems[i]->m_pLbSort->SelectEntryPos( 0 );
 
         for ( sal_uInt16 i=0; i<nSortKeyCount; i++ )
-            maSortKeyItems[i].m_pBtnUp->Check();
+            maSortKeyItems[i]->m_pBtnUp->Check();
 
-        maSortKeyItems[0].EnableField();
-        maSortKeyItems[1].EnableField();
+        maSortKeyItems[0]->EnableField();
+        maSortKeyItems[1]->EnableField();
         for ( sal_uInt16 i=2; i<nSortKeyCount; i++ )
-            maSortKeyItems[i].DisableField();
+            maSortKeyItems[i]->DisableField();
     }
 
     if ( pDlg )
@@ -227,7 +227,7 @@ void ScTabPageSortFields::Reset( const SfxItemSet* /* rArgSet */ )
     }
 
     // Make sure that there is always a last undefined sort key
-    if ( maSortKeyItems[nSortKeyCount - 1].m_pLbSort->GetSelectEntryPos() > 0 )
+    if ( maSortKeyItems[nSortKeyCount - 1]->m_pLbSort->GetSelectEntryPos() > 0 )
         SetLastSortKey( nSortKeyCount );
 }
 
@@ -250,7 +250,7 @@ bool ScTabPageSortFields::FillItemSet( SfxItemSet* rArgSet )
 
     for ( sal_uInt16 i=0; i<nSortKeyCount; i++ )
     {
-        nSortPos.push_back( maSortKeyItems[i].m_pLbSort->GetSelectEntryPos() );
+        nSortPos.push_back( maSortKeyItems[i]->m_pLbSort->GetSelectEntryPos() );
 
         if ( nSortPos[i] == LISTBOX_ENTRY_NOTFOUND ) nSortPos[i] = 0;
     }
@@ -280,7 +280,7 @@ bool ScTabPageSortFields::FillItemSet( SfxItemSet* rArgSet )
         }
 
         for ( sal_uInt16 i=0; i<nSortKeyCount; i++ )
-            aNewSortData.maKeyState[i].bAscending = maSortKeyItems[i].m_pBtnUp->IsChecked();
+            aNewSortData.maKeyState[i].bAscending = maSortKeyItems[i]->m_pBtnUp->IsChecked();
 
         // bHasHeader is in ScTabPageSortOptions::FillItemSet, where it belongs
     }
@@ -307,14 +307,14 @@ void ScTabPageSortFields::ActivatePage( const SfxItemSet& rSet )
         {
             std::vector<sal_uInt16> nCurSel;
             for ( sal_uInt16 i=0; i<nSortKeyCount; i++ )
-                nCurSel.push_back( maSortKeyItems[i].m_pLbSort->GetSelectEntryPos() );
+                nCurSel.push_back( maSortKeyItems[i]->m_pLbSort->GetSelectEntryPos() );
 
             bHasHeader  = pDlg->GetHeaders();
             bSortByRows = pDlg->GetByRows();
             FillFieldLists(0);
 
             for ( sal_uInt16 i=0; i<nSortKeyCount; i++ )
-                maSortKeyItems[i].m_pLbSort->SelectEntryPos( nCurSel[i] );
+                maSortKeyItems[i]->m_pLbSort->SelectEntryPos( nCurSel[i] );
         }
     }
 }
@@ -346,8 +346,8 @@ void ScTabPageSortFields::FillFieldLists( sal_uInt16 nStartField )
         {
             for ( sal_uInt16 i=nStartField; i<nSortKeyCount; i++ )
             {
-                maSortKeyItems[i].m_pLbSort->Clear();
-                maSortKeyItems[i].m_pLbSort->InsertEntry( aStrUndefined, 0 );
+                maSortKeyItems[i]->m_pLbSort->Clear();
+                maSortKeyItems[i]->m_pLbSort->InsertEntry( aStrUndefined, 0 );
             }
 
             SCCOL   nFirstSortCol   = aSortData.nCol1;
@@ -373,7 +373,7 @@ void ScTabPageSortFields::FillFieldLists( sal_uInt16 nStartField )
                     nFieldArr.push_back( col );
 
                     for ( sal_uInt16 j=nStartField; j<nSortKeyCount; j++ )
-                        maSortKeyItems[j].m_pLbSort->InsertEntry( aFieldName, i );
+                        maSortKeyItems[j]->m_pLbSort->InsertEntry( aFieldName, i );
 
                     i++;
                 }
@@ -394,7 +394,7 @@ void ScTabPageSortFields::FillFieldLists( sal_uInt16 nStartField )
                     nFieldArr.push_back( row );
 
                     for ( sal_uInt16 j=nStartField; j<nSortKeyCount; j++ )
-                        maSortKeyItems[j].m_pLbSort->InsertEntry( aFieldName, i );
+                        maSortKeyItems[j]->m_pLbSort->InsertEntry( aFieldName, i );
 
                     i++;
                 }
@@ -430,14 +430,14 @@ void ScTabPageSortFields::SetLastSortKey( sal_uInt16 nItem )
     // Add Sort Key Item
     ++nSortKeyCount;
     maSortKeyCtrl.AddSortKey( nSortKeyCount );
-    maSortKeyItems[nItem].m_pLbSort->SetSelectHdl(
+    maSortKeyItems[nItem]->m_pLbSort->SetSelectHdl(
                      LINK( this, ScTabPageSortFields, SelectHdl ) );
 
     FillFieldLists( nItem );
 
     // Set Status
-    maSortKeyItems[nItem].m_pBtnUp->Check();
-    maSortKeyItems[nItem].m_pLbSort->SelectEntryPos( 0 );
+    maSortKeyItems[nItem]->m_pBtnUp->Check();
+    maSortKeyItems[nItem]->m_pLbSort->SelectEntryPos( 0 );
 }
 
 // Handler:
@@ -448,7 +448,7 @@ IMPL_LINK_TYPED( ScTabPageSortFields, SelectHdl, ListBox&, rLb, void )
     ScSortKeyItems::iterator pIter;
 
     // If last listbox is enabled add one item
-    if ( maSortKeyItems.back().m_pLbSort == &rLb )
+    if ( maSortKeyItems.back()->m_pLbSort == &rLb )
         if ( aSelEntry != aStrUndefined )
         {
             SetLastSortKey( nSortKeyCount );
@@ -458,7 +458,7 @@ IMPL_LINK_TYPED( ScTabPageSortFields, SelectHdl, ListBox&, rLb, void )
     // Find selected listbox
     for ( pIter = maSortKeyItems.begin(); pIter != maSortKeyItems.end(); ++pIter )
     {
-        if ( pIter->m_pLbSort == &rLb ) break;
+        if ( (*pIter)->m_pLbSort == &rLb ) break;
     }
 
     // If not selecting the last Listbox, modify the succeeding ones
@@ -469,16 +469,16 @@ IMPL_LINK_TYPED( ScTabPageSortFields, SelectHdl, ListBox&, rLb, void )
         {
             for ( ; pIter != maSortKeyItems.end(); ++pIter )
             {
-                pIter->m_pLbSort->SelectEntryPos( 0 );
+                (*pIter)->m_pLbSort->SelectEntryPos( 0 );
 
-                if ( pIter->m_pFlSort->IsEnabled() )
-                    pIter->DisableField();
+                if ( (*pIter)->m_pFlSort->IsEnabled() )
+                    (*pIter)->DisableField();
             }
         }
         else
         {
-            if ( !pIter->m_pFlSort->IsEnabled() )
-                    pIter->EnableField();
+            if ( !(*pIter)->m_pFlSort->IsEnabled() )
+                    (*pIter)->EnableField();
         }
      }
 }
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index ba0aabd..3af7fcb 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -29,7 +29,6 @@
 #include <basegfx/matrix/b2dhommatrix.hxx>
 
 #include <boost/ptr_container/ptr_map.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
 #include <vector>
 
 namespace editeng {
diff --git a/sc/source/ui/inc/sortkeydlg.hxx b/sc/source/ui/inc/sortkeydlg.hxx
index 1f5b26f..8ed729b 100644
--- a/sc/source/ui/inc/sortkeydlg.hxx
+++ b/sc/source/ui/inc/sortkeydlg.hxx
@@ -10,7 +10,8 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_SORTKEYDLG_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_SORTKEYDLG_HXX
 
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
+#include <memory>
 
 #include "anyrefdg.hxx"
 
@@ -39,7 +40,7 @@ struct ScSortKeyItem : public VclBuilderContainer
     long getItemHeight() const;
 };
 
-typedef boost::ptr_vector<ScSortKeyItem> ScSortKeyItems;
+typedef std::vector<std::unique_ptr<ScSortKeyItem> > ScSortKeyItems;
 
 class ScSortKeyWindow
 {
commit 4834531327adab1bedd455e9564473a3dd0e7eba
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 09:02:15 2015 +0200

    remove unused #include
    
    Change-Id: Ib34f092e802b7c2ea2cf33c19d50f29bc85c4b24

diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 590d0d8..a527787 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -26,7 +26,6 @@
 #include <com/sun/star/embed/XEmbeddedObject.hpp>
 #include <com/sun/star/embed/Aspects.hpp>
 #include <vector>
-#include <boost/ptr_container/ptr_vector.hpp>
 
 class ScPatternAttr;
 class ScAutoFormatData;
commit 652be4d4b46cd2d777209680d1b33b24f75cea63
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 08:55:12 2015 +0200

    sc: boost::ptr_vector->std::vector
    
    Change-Id: I4692680a93d7b2175364d7f606763b000d4cd4a2

diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 6bb1884..776a918 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -4150,7 +4150,7 @@ ScCellRangesBase* ScCellRangesBase::getImplementation(const uno::Reference<uno::
     return pRet;
 }
 
-typedef boost::ptr_vector<ScNamedEntry> ScNamedEntryArr_Impl;
+typedef std::vector<ScNamedEntry> ScNamedEntryArr_Impl;
 
 struct ScCellRangesObj::Impl
 {
@@ -4459,9 +4459,7 @@ void SAL_CALL ScCellRangesObj::insertByName( const OUString& aName, const uno::A
                 //  if a name is given, also insert into list of named entries
                 //  (only possible for a single range)
                 //  name is not in m_pImpl->m_aNamedEntries (tested above)
-
-                ScNamedEntry* pEntry = new ScNamedEntry( aNamStr, *rAddRanges[ 0 ] );
-                m_pImpl->m_aNamedEntries.push_back(pEntry);
+                m_pImpl->m_aNamedEntries.push_back(ScNamedEntry( aNamStr, *rAddRanges[ 0 ] ));
             }
         }
     }
commit 528514f13c54c8215f29d20e43fa75aec784d4ec
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 08:50:26 2015 +0200

    sc: boost::ptr_vector->std::vector<std::unique_ptr>
    
    Change-Id: I0861b86901e32aac3005cfe802cfed449f48f16a

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index e6f57dd..718b3cc 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -44,6 +44,7 @@
 #include <vcl/outdev.hxx>
 #include <vcl/pdfextoutdevdata.hxx>
 #include <vcl/settings.hxx>
+#include <o3tl/make_unique.hxx>
 
 #include "output.hxx"
 #include "document.hxx"
@@ -66,8 +67,8 @@
 #include <com/sun/star/i18n/DirectionProperty.hpp>
 #include <comphelper/string.hxx>
 
-#include <boost/ptr_container/ptr_vector.hpp>
 #include <memory>
+#include <vector>
 
 #include <math.h>
 
@@ -1471,7 +1472,7 @@ Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, const ScA
 
     // alternative pattern instances in case we need to modify the pattern
     // before processing the cell value.
-    ::boost::ptr_vector<ScPatternAttr> aAltPatterns;
+    std::vector<std::unique_ptr<ScPatternAttr> > aAltPatterns;
 
     std::vector<long> aDX;
     long nPosY = nScrY;
@@ -1615,8 +1616,8 @@ Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, const ScA
                     }
                     if ( mpDoc->GetPreviewFont() || mpDoc->GetPreviewCellStyle() )
                     {
-                        aAltPatterns.push_back(new ScPatternAttr(*pPattern));
-                        ScPatternAttr* pAltPattern = &aAltPatterns.back();
+                        aAltPatterns.push_back(o3tl::make_unique<ScPatternAttr>(*pPattern));
+                        ScPatternAttr* pAltPattern = aAltPatterns.back().get();
                         if (  ScStyleSheet* pPreviewStyle = mpDoc->GetPreviewCellStyle( nCellX, nCellY, nTab ) )
                         {
                             pAltPattern->SetStyleSheet(pPreviewStyle);
@@ -1639,8 +1640,8 @@ Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, const ScA
                             pPattern->GetItem(ATTR_LINEBREAK, pCondSet)).GetValue())
                     {
                         // Disable line break when the cell content is numeric.
-                        aAltPatterns.push_back(new ScPatternAttr(*pPattern));
-                        ScPatternAttr* pAltPattern = &aAltPatterns.back();
+                        aAltPatterns.push_back(o3tl::make_unique<ScPatternAttr>(*pPattern));
+                        ScPatternAttr* pAltPattern = aAltPatterns.back().get();
                         SfxBoolItem aLineBreak(ATTR_LINEBREAK, false);
                         pAltPattern->GetItemSet().Put(aLineBreak);
                         pPattern = pAltPattern;


More information about the Libreoffice-commits mailing list