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

Noel Grandin noel at peralex.com
Thu Nov 12 02:29:51 PST 2015


 cui/source/inc/numpages.hxx             |    3 +++
 cui/source/tabpages/numpages.cxx        |   15 +++++++++++++++
 sc/source/filter/excel/xestyle.cxx      |    5 +++--
 sc/source/filter/excel/xicontent.cxx    |   15 ++++++++-------
 sc/source/filter/excel/xihelper.cxx     |   13 +++++++------
 sc/source/filter/excel/xiname.cxx       |   17 +++++++++--------
 sc/source/filter/inc/orcusinterface.hxx |    4 ++--
 sc/source/filter/inc/rtfparse.hxx       |    5 +++--
 sc/source/filter/inc/xestyle.hxx        |    4 ++--
 sc/source/filter/inc/xicontent.hxx      |   11 ++++++-----
 sc/source/filter/inc/xihelper.hxx       |    4 ++--
 sc/source/filter/inc/xiname.hxx         |    4 ++--
 sc/source/filter/orcus/interface.cxx    |   28 ++++++++++++++--------------
 sc/source/filter/rtf/rtfparse.cxx       |   14 +++++++-------
 14 files changed, 83 insertions(+), 59 deletions(-)

New commits:
commit 98785dbb95eca5443b38535cba6552e21d4e2c5b
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 12:19:06 2015 +0200

    fix tdf#95689 - List indent is broken
    
    caused by my commit e85b2333bce7b1dcae73861df6d90b48b9f4efe5
    "convert Link<> to typed"
    
    Change-Id: Ieeb9e6fa5d5be3789ea70549e85d4bd3ffd51e59

diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx
index 8e7194c..cea7ac0 100644
--- a/cui/source/inc/numpages.hxx
+++ b/cui/source/inc/numpages.hxx
@@ -440,8 +440,11 @@ class SvxNumPositionTabPage : public SfxTabPage
 
     DECL_LINK_TYPED(LabelFollowedByHdl_Impl, ListBox&, void);
     DECL_LINK_TYPED( ListtabPosHdl_Impl, SpinField&, void );
+    DECL_LINK_TYPED( ListtabPosFocusHdl_Impl, Control&, void );
     DECL_LINK_TYPED( AlignAtHdl_Impl, SpinField&, void );
+    DECL_LINK_TYPED( AlignAtFocusHdl_Impl, Control&, void );
     DECL_LINK_TYPED( IndentAtHdl_Impl, SpinField&, void );
+    DECL_LINK_TYPED( IndentAtFocusHdl_Impl, Control&, void );
 
 public:
         SvxNumPositionTabPage(vcl::Window* pParent,
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index e032500..c9b5b2a 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -2803,16 +2803,19 @@ SvxNumPositionTabPage::SvxNumPositionTabPage(vcl::Window* pParent,
     m_pLabelFollowedByLB->SetSelectHdl( LINK(this, SvxNumPositionTabPage, LabelFollowedByHdl_Impl) );
 
     aLk3 = LINK(this, SvxNumPositionTabPage, ListtabPosHdl_Impl);
+    aLk2 = LINK(this, SvxNumPositionTabPage, ListtabPosFocusHdl_Impl);
     m_pListtabMF->SetUpHdl(aLk3);
     m_pListtabMF->SetDownHdl(aLk3);
     m_pListtabMF->SetLoseFocusHdl(aLk2);
 
     aLk3 = LINK(this, SvxNumPositionTabPage, AlignAtHdl_Impl);
+    aLk2 = LINK(this, SvxNumPositionTabPage, AlignAtFocusHdl_Impl);
     m_pAlignedAtMF->SetUpHdl(aLk3);
     m_pAlignedAtMF->SetDownHdl(aLk3);
     m_pAlignedAtMF->SetLoseFocusHdl(aLk2);
 
     aLk3 = LINK(this, SvxNumPositionTabPage, IndentAtHdl_Impl);
+    aLk2 = LINK(this, SvxNumPositionTabPage, IndentAtFocusHdl_Impl);
     m_pIndentAtMF->SetUpHdl(aLk3);
     m_pIndentAtMF->SetDownHdl(aLk3);
     m_pIndentAtMF->SetLoseFocusHdl(aLk2);
@@ -3542,6 +3545,10 @@ IMPL_LINK_NOARG_TYPED(SvxNumPositionTabPage, LabelFollowedByHdl_Impl, ListBox&,
     SetModified();
 }
 
+IMPL_LINK_TYPED( SvxNumPositionTabPage, ListtabPosFocusHdl_Impl, Control&, rControl, void )
+{
+    ListtabPosHdl_Impl(static_cast<SpinField&>(rControl));
+}
 IMPL_LINK_TYPED( SvxNumPositionTabPage, ListtabPosHdl_Impl, SpinField&, rFld, void )
 {
     // determine value to be set at the chosen list levels
@@ -3563,6 +3570,10 @@ IMPL_LINK_TYPED( SvxNumPositionTabPage, ListtabPosHdl_Impl, SpinField&, rFld, vo
     SetModified();
 }
 
+IMPL_LINK_TYPED( SvxNumPositionTabPage, AlignAtFocusHdl_Impl, Control&, rControl, void )
+{
+    AlignAtHdl_Impl(static_cast<SpinField&>(rControl));
+}
 IMPL_LINK_TYPED( SvxNumPositionTabPage, AlignAtHdl_Impl, SpinField&, rFld, void )
 {
     // determine value to be set at the chosen list levels
@@ -3585,6 +3596,10 @@ IMPL_LINK_TYPED( SvxNumPositionTabPage, AlignAtHdl_Impl, SpinField&, rFld, void
     SetModified();
 }
 
+IMPL_LINK_TYPED( SvxNumPositionTabPage, IndentAtFocusHdl_Impl, Control&, rControl, void )
+{
+    IndentAtHdl_Impl(static_cast<SpinField&>(rControl));
+}
 IMPL_LINK_TYPED( SvxNumPositionTabPage, IndentAtHdl_Impl, SpinField&, rFld, void )
 {
     // determine value to be set at the chosen list levels
commit 147b74beea7b5f0fb121e5495bbdfb4869786603
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 11:59:36 2015 +0200

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

diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index d42a46c..36dcbdc 100644
--- a/sc/source/filter/inc/orcusinterface.hxx
+++ b/sc/source/filter/inc/orcusinterface.hxx
@@ -25,7 +25,7 @@
 #define __ORCUS_STATIC_LIB
 #include <orcus/spreadsheet/import_interface.hpp>
 
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <memory>
 #include <map>
 #include <unordered_map>
 #include <vector>
@@ -455,7 +455,7 @@ class ScOrcusFactory : public orcus::spreadsheet::iface::import_factory
     StringCellCaches maStringCells;
     ScOrcusGlobalSettings maGlobalSettings;
     ScOrcusSharedStrings maSharedStrings;
-    boost::ptr_vector<ScOrcusSheet> maSheets;
+    std::vector< std::unique_ptr<ScOrcusSheet> > maSheets;
     ScOrcusStyles maStyles;
 
     int mnProgress;
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 334efb3..78c0b9d 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -34,6 +34,7 @@
 #include <formula/token.hxx>
 #include <tools/datetime.hxx>
 #include <svl/sharedstringpool.hxx>
+#include <o3tl/make_unique.hxx>
 
 #include <com/sun/star/task/XStatusIndicator.hpp>
 
@@ -74,18 +75,18 @@ orcus::spreadsheet::iface::import_sheet* ScOrcusFactory::append_sheet(const char
         return nullptr;
 
     SCTAB nTab = maDoc.getSheetCount() - 1;
-    maSheets.push_back(new ScOrcusSheet(maDoc, nTab, *this));
-    return &maSheets.back();
+    maSheets.push_back(o3tl::make_unique<ScOrcusSheet>(maDoc, nTab, *this));
+    return maSheets.back().get();
 }
 
-class FindSheetByIndex : std::unary_function<ScOrcusSheet, bool>
+class FindSheetByIndex : std::unary_function< std::unique_ptr<ScOrcusSheet>, bool>
 {
     SCTAB mnTab;
 public:
     explicit FindSheetByIndex(SCTAB nTab) : mnTab(nTab) {}
-    bool operator() (const ScOrcusSheet& rSheet) const
+    bool operator() (const std::unique_ptr<ScOrcusSheet>& rSheet) const
     {
-        return rSheet.getIndex() == mnTab;
+        return rSheet->getIndex() == mnTab;
     }
 };
 
@@ -98,33 +99,32 @@ orcus::spreadsheet::iface::import_sheet* ScOrcusFactory::get_sheet(const char* s
         return nullptr;
 
     // See if we already have an orcus sheet instance by that index.
-    boost::ptr_vector<ScOrcusSheet>::iterator it =
+    std::vector< std::unique_ptr<ScOrcusSheet> >::iterator it =
         std::find_if(maSheets.begin(), maSheets.end(), FindSheetByIndex(nTab));
 
     if (it != maSheets.end())
         // We already have one. Return it.
-        return &(*it);
+        return it->get();
 
     // Create a new orcus sheet instance for this.
-    maSheets.push_back(new ScOrcusSheet(maDoc, nTab, *this));
-    return &maSheets.back();
+    maSheets.push_back(o3tl::make_unique<ScOrcusSheet>(maDoc, nTab, *this));
+    return maSheets.back().get();
 }
 
 orcus::spreadsheet::iface::import_sheet* ScOrcusFactory::get_sheet(orcus::spreadsheet::sheet_t sheet_index)
 {
     SCTAB nTab = static_cast<SCTAB>(sheet_index);
     // See if we already have an orcus sheet instance by that index.
-    boost::ptr_vector<ScOrcusSheet>::iterator it =
+    std::vector< std::unique_ptr<ScOrcusSheet> >::iterator it =
         std::find_if(maSheets.begin(), maSheets.end(), FindSheetByIndex(nTab));
 
     if (it != maSheets.end())
         // We already have one. Return it.
-        return &(*it);
+        return it->get();
 
     // Create a new orcus sheet instance for this.
-    maSheets.push_back(new ScOrcusSheet(maDoc, nTab, *this));
-    return &maSheets.back();
-
+    maSheets.push_back(o3tl::make_unique<ScOrcusSheet>(maDoc, nTab, *this));
+    return maSheets.back().get();
 }
 
 orcus::spreadsheet::iface::import_global_settings* ScOrcusFactory::get_global_settings()
commit 51e4d1dcfb8fcbc0c36d433896d4b9b7bf021985
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 11:53:54 2015 +0200

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

diff --git a/sc/source/filter/inc/rtfparse.hxx b/sc/source/filter/inc/rtfparse.hxx
index cdc5dde..80c4961 100644
--- a/sc/source/filter/inc/rtfparse.hxx
+++ b/sc/source/filter/inc/rtfparse.hxx
@@ -22,7 +22,8 @@
 
 #include "eeparser.hxx"
 
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
+#include <memory>
 #include <o3tl/sorted_vector.hxx>
 
 struct ScRTFCellDefault
@@ -48,7 +49,7 @@ class EditEngine;
 class ScRTFParser : public ScEEParser
 {
 private:
-    typedef boost::ptr_vector<ScRTFCellDefault> DefaultList;
+    typedef std::vector< std::unique_ptr<ScRTFCellDefault> > DefaultList;
 
     DefaultList maDefaultList;
     size_t mnCurPos;
diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx
index 1fa1dbd..fa41c43 100644
--- a/sc/source/filter/rtf/rtfparse.cxx
+++ b/sc/source/filter/rtf/rtfparse.cxx
@@ -207,7 +207,7 @@ void ScRTFParser::NewCellRow( ImportInfo* /*pInfo*/ )
         // Not flush on the right? => new table
         if ( nLastWidth && !maDefaultList.empty() )
         {
-            const ScRTFCellDefault& rD = maDefaultList.back();
+            const ScRTFCellDefault& rD = *maDefaultList.back().get();
             if (rD.nTwips != nLastWidth)
             {
                 SCCOL n1, n2;
@@ -224,14 +224,14 @@ void ScRTFParser::NewCellRow( ImportInfo* /*pInfo*/ )
         // Build up TwipCols only after nLastWidth comparison!
         for ( size_t i = 0, n = maDefaultList.size(); i < n; ++i )
         {
-            const ScRTFCellDefault& rD = maDefaultList[i];
+            const ScRTFCellDefault& rD = *maDefaultList[i].get();
             SCCOL nCol;
             if ( !SeekTwips(rD.nTwips, &nCol) )
                 pColTwips->insert( rD.nTwips );
         }
     }
     pDefMerge = nullptr;
-    pActDefault = maDefaultList.empty() ? nullptr : &maDefaultList[0];
+    pActDefault = maDefaultList.empty() ? nullptr : maDefaultList[0].get();
     mnCurPos = 0;
     OSL_ENSURE( pActDefault, "NewCellRow: pActDefault==0" );
 }
@@ -270,7 +270,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
         case RTF_TROWD:         // denotes table row defauls, before RTF_CELLX
         {
             if (!maDefaultList.empty())
-                nLastWidth = maDefaultList.back().nTwips;
+                nLastWidth = maDefaultList.back()->nTwips;
 
             nColCnt = 0;
             maDefaultList.clear();
@@ -289,7 +289,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
         {
             if (!pDefMerge && !maDefaultList.empty())
             {
-                pDefMerge = &maDefaultList.back();
+                pDefMerge = maDefaultList.back().get();
                 mnCurPos = maDefaultList.size() - 1;
             }
             OSL_ENSURE( pDefMerge, "RTF_CLMRG: pDefMerge==0" );
@@ -304,7 +304,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
             bNewDef = true;
             pInsDefault->nCol = nColCnt;
             pInsDefault->nTwips = pInfo->nTokenValue; // Right cell border
-            maDefaultList.push_back( pInsDefault );
+            maDefaultList.push_back( std::unique_ptr<ScRTFCellDefault>(pInsDefault) );
             // New free-flying pInsDefault
             pInsDefault = new ScRTFCellDefault( pPool );
             if ( ++nColCnt > nColMax )
@@ -359,7 +359,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
 
             pActDefault = nullptr;
             if (!maDefaultList.empty() && (mnCurPos+1) < maDefaultList.size())
-                pActDefault = &maDefaultList[++mnCurPos];
+                pActDefault = maDefaultList[++mnCurPos].get();
 
             nLastToken = pInfo->nToken;
         }
commit 5f87aafea491b111fa1d7518c746e0e1304a069a
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 11:50:19 2015 +0200

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

diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 68067cf..ef2ec9c 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -52,6 +52,7 @@
 
 #include <oox/token/tokens.hxx>
 #include <boost/ptr_container/ptr_vector.hpp>
+#include <o3tl/make_unique.hxx>
 
 using namespace ::com::sun::star;
 using namespace oox;
@@ -3090,7 +3091,7 @@ XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot )
                             pNumFormat = new XclExpNumFmt( nScNumFmt, nXclNumFmt, GetNumberFormatCode( *this, nScNumFmt, mxFormatter.get(), mpKeywordTable.get() ));
                         }
 
-                        maDxf.push_back(new XclExpDxf( rRoot, pAlign, pBorder, pFont, pNumFormat, pCellProt, pColor ));
+                        maDxf.push_back(o3tl::make_unique<XclExpDxf>( rRoot, pAlign, pBorder, pFont, pNumFormat, pCellProt, pColor ));
                         ++nIndex;
                     }
 
@@ -3120,7 +3121,7 @@ void XclExpDxfs::SaveXml( XclExpXmlStream& rStrm )
 
     for ( DxfContainer::iterator itr = maDxf.begin(); itr != maDxf.end(); ++itr )
     {
-        itr->SaveXml( rStrm );
+        (*itr)->SaveXml( rStrm );
     }
 
     rStyleSheet->endElement( XML_dxfs );
diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx
index 1a8ca71..41e4d00 100644
--- a/sc/source/filter/inc/xestyle.hxx
+++ b/sc/source/filter/inc/xestyle.hxx
@@ -31,7 +31,7 @@
 #include "conditio.hxx"
 #include "fonthelper.hxx"
 #include <memory>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
 
 /* ============================================================================
 - Buffers for style records (PALETTE, FONT, FORMAT, XF, STYLE).
@@ -735,7 +735,7 @@ public:
 
     virtual void SaveXml( XclExpXmlStream& rStrm) override;
 private:
-    typedef boost::ptr_vector<XclExpDxf> DxfContainer;
+    typedef std::vector< std::unique_ptr<XclExpDxf> > DxfContainer;
     std::map<OUString, sal_Int32> maStyleNameToDxfId;
     DxfContainer maDxf;
     SvNumberFormatterPtr mxFormatter;   /// Special number formatter for conversion.
commit 4d427eb6864c0f2bcf5d672a445f5c53d9d2241b
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 11:40:15 2015 +0200

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

diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 408ed45..3e48f35 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -1024,7 +1024,7 @@ void XclImpWebQueryBuffer::ReadQsi( XclImpStream& rStrm )
             {
                 ScRange aRange;
                 if( pRangeData->IsReference( aRange ) )
-                    maWQList.push_back( new XclImpWebQuery( aRange ) );
+                    maWQList.push_back( XclImpWebQuery( aRange ) );
             }
         }
     }
diff --git a/sc/source/filter/inc/xicontent.hxx b/sc/source/filter/inc/xicontent.hxx
index a61ed9a..5eb6811 100644
--- a/sc/source/filter/inc/xicontent.hxx
+++ b/sc/source/filter/inc/xicontent.hxx
@@ -31,7 +31,6 @@
 #include <map>
 #include <vector>
 #include <memory>
-#include <boost/ptr_container/ptr_vector.hpp>
 #include <boost/noncopyable.hpp>
 
 /* ============================================================================
@@ -193,7 +192,7 @@ private:
 // Web queries ================================================================
 
 /** Stores the data of one web query. */
-class XclImpWebQuery : private boost::noncopyable
+class XclImpWebQuery
 {
 public:
     explicit            XclImpWebQuery( const ScRange& rDestRange );
@@ -247,7 +246,7 @@ public:
     void                Apply();
 
 private:
-    typedef boost::ptr_vector< XclImpWebQuery > XclImpWebQueryList;
+    typedef std::vector< XclImpWebQuery > XclImpWebQueryList;
     XclImpWebQueryList  maWQList;       /// List of the web query objects.
 };
 
commit 117ded60b55cd61eb2d41c66a7ec01e70214823f
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 11:18:29 2015 +0200

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

diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 8a78380..408ed45 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -61,6 +61,7 @@
 
 #include <memory>
 #include <utility>
+#include <o3tl/make_unique.hxx>
 
 using ::com::sun::star::uno::Sequence;
 using ::std::unique_ptr;
@@ -866,8 +867,8 @@ void XclImpValidationManager::ReadDV( XclImpStream& rStrm )
         XclTokenArrayHelper::ConvertStringToList(*xTokArr1, rDoc.GetSharedStringPool(), '\n', true);
 
     maDVItems.push_back(
-        new DVItem(aScRanges, ScValidationData(eValMode, eCondMode, xTokArr1.get(), xTokArr2.get(), &rDoc, rScRange.aStart)));
-    DVItem& rItem = maDVItems.back();
+        o3tl::make_unique<DVItem>(aScRanges, ScValidationData(eValMode, eCondMode, xTokArr1.get(), xTokArr2.get(), &rDoc, rScRange.aStart)));
+    DVItem& rItem = *maDVItems.back().get();
 
     rItem.maValidData.SetIgnoreBlank( ::get_flag( nFlags, EXC_DV_IGNOREBLANK ) );
     rItem.maValidData.SetListType( ::get_flagvalue( nFlags, EXC_DV_SUPPRESSDROPDOWN, css::sheet::TableValidationVisibility::INVISIBLE, css::sheet::TableValidationVisibility::UNSORTED ) );
@@ -900,7 +901,7 @@ void XclImpValidationManager::Apply()
     DVItemList::iterator itr = maDVItems.begin(), itrEnd = maDVItems.end();
     for (; itr != itrEnd; ++itr)
     {
-        DVItem& rItem = *itr;
+        DVItem& rItem = *itr->get();
         // set the handle ID
         sal_uLong nHandle = rDoc.AddValidationEntry( rItem.maValidData );
         ScPatternAttr aPattern( rDoc.GetPool() );
diff --git a/sc/source/filter/inc/xicontent.hxx b/sc/source/filter/inc/xicontent.hxx
index 145b367..a61ed9a 100644
--- a/sc/source/filter/inc/xicontent.hxx
+++ b/sc/source/filter/inc/xicontent.hxx
@@ -185,7 +185,7 @@ private:
 
         explicit DVItem ( const ScRangeList& rRanges, const ScValidationData& rValidData );
     };
-    typedef ::boost::ptr_vector<DVItem> DVItemList;
+    typedef std::vector< std::unique_ptr<DVItem> > DVItemList;
 
     DVItemList maDVItems;
 };
commit bd2455d310b35d6e231627c1a89301450be0c65d
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 10:59:31 2015 +0200

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

diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 5b63352..8a78380 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -707,20 +707,20 @@ void XclImpCondFormatManager::ReadCondfmt( XclImpStream& rStrm )
 {
     XclImpCondFormat* pFmt = new XclImpCondFormat( GetRoot(), maCondFmtList.size() );
     pFmt->ReadCondfmt( rStrm );
-    maCondFmtList.push_back( pFmt );
+    maCondFmtList.push_back( std::unique_ptr<XclImpCondFormat>(pFmt) );
 }
 
 void XclImpCondFormatManager::ReadCF( XclImpStream& rStrm )
 {
     OSL_ENSURE( !maCondFmtList.empty(), "XclImpCondFormatManager::ReadCF - CF without leading CONDFMT" );
     if( !maCondFmtList.empty() )
-        maCondFmtList.back().ReadCF( rStrm );
+        maCondFmtList.back()->ReadCF( rStrm );
 }
 
 void XclImpCondFormatManager::Apply()
 {
     for( XclImpCondFmtList::iterator itFmt = maCondFmtList.begin(); itFmt != maCondFmtList.end(); ++itFmt )
-        itFmt->Apply();
+        (*itFmt)->Apply();
     maCondFmtList.clear();
 }
 
diff --git a/sc/source/filter/inc/xicontent.hxx b/sc/source/filter/inc/xicontent.hxx
index 1a76f20..145b367 100644
--- a/sc/source/filter/inc/xicontent.hxx
+++ b/sc/source/filter/inc/xicontent.hxx
@@ -29,6 +29,8 @@
 #include "tabprotection.hxx"
 
 #include <map>
+#include <vector>
+#include <memory>
 #include <boost/ptr_container/ptr_vector.hpp>
 #include <boost/noncopyable.hpp>
 
@@ -157,7 +159,7 @@ public:
     void                Apply();
 
 private:
-    typedef boost::ptr_vector< XclImpCondFormat > XclImpCondFmtList;
+    typedef std::vector< std::unique_ptr<XclImpCondFormat> > XclImpCondFmtList;
     XclImpCondFmtList   maCondFmtList;      /// List with all conditional formatting.
 };
 
commit 2dcec2f7a0a0ee7fb62e0e1aa876d1468d93a31c
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 10:57:29 2015 +0200

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

diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx
index 462e89d7..62c1504 100644
--- a/sc/source/filter/excel/xihelper.cxx
+++ b/sc/source/filter/excel/xihelper.cxx
@@ -36,6 +36,7 @@
 #include "stringutil.hxx"
 #include "scmatrix.hxx"
 #include "documentimport.hxx"
+#include <o3tl/make_unique.hxx>
 
 // Excel->Calc cell address/range conversion ==================================
 
@@ -850,7 +851,7 @@ XclImpCachedMatrix::XclImpCachedMatrix( XclImpStream& rStrm ) :
 
     for( SCSIZE nScRow = 0; nScRow < mnScRows; ++nScRow )
         for( SCSIZE nScCol = 0; nScCol < mnScCols; ++nScCol )
-            maValueList.push_back( new XclImpCachedValue( rStrm ) );
+            maValueList.push_back( o3tl::make_unique<XclImpCachedValue>( rStrm ) );
 }
 
 XclImpCachedMatrix::~XclImpCachedMatrix()
@@ -869,23 +870,23 @@ ScMatrixRef XclImpCachedMatrix::CreateScMatrix( svl::SharedStringPool& rPool ) c
         {
             for( SCSIZE nScCol = 0; nScCol < mnScCols; ++nScCol )
             {
-                switch( itValue->GetType() )
+                switch( (*itValue)->GetType() )
                 {
                     case EXC_CACHEDVAL_EMPTY:
                         // Excel shows 0.0 here, not an empty cell
                         xScMatrix->PutEmpty( nScCol, nScRow );
                     break;
                     case EXC_CACHEDVAL_DOUBLE:
-                        xScMatrix->PutDouble( itValue->GetValue(), nScCol, nScRow );
+                        xScMatrix->PutDouble( (*itValue)->GetValue(), nScCol, nScRow );
                     break;
                     case EXC_CACHEDVAL_STRING:
-                        xScMatrix->PutString(rPool.intern(itValue->GetString()), nScCol, nScRow);
+                        xScMatrix->PutString(rPool.intern((*itValue)->GetString()), nScCol, nScRow);
                     break;
                     case EXC_CACHEDVAL_BOOL:
-                        xScMatrix->PutBoolean( itValue->GetBool(), nScCol, nScRow );
+                        xScMatrix->PutBoolean( (*itValue)->GetBool(), nScCol, nScRow );
                     break;
                     case EXC_CACHEDVAL_ERROR:
-                        xScMatrix->PutError( itValue->GetScError(), nScCol, nScRow );
+                        xScMatrix->PutError( (*itValue)->GetScError(), nScCol, nScRow );
                     break;
                     default:
                         OSL_FAIL( "XclImpCachedMatrix::CreateScMatrix - unknown value type" );
diff --git a/sc/source/filter/inc/xihelper.hxx b/sc/source/filter/inc/xihelper.hxx
index b8f12e8..e6b9012 100644
--- a/sc/source/filter/inc/xihelper.hxx
+++ b/sc/source/filter/inc/xihelper.hxx
@@ -22,12 +22,12 @@
 
 #include <editeng/editdata.hxx>
 #include <boost/noncopyable.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
 #include "types.hxx"
 #include "xladdress.hxx"
 #include "xiroot.hxx"
 #include "xistring.hxx"
 #include <memory>
+#include <vector>
 
 class ScRangeList;
 
@@ -333,7 +333,7 @@ public:
     ScMatrixRef CreateScMatrix( svl::SharedStringPool& rPool ) const;
 
 private:
-    typedef boost::ptr_vector< XclImpCachedValue > XclImpValueList;
+    typedef std::vector< std::unique_ptr<XclImpCachedValue> > XclImpValueList;
 
     XclImpValueList     maValueList;    /// List of cached cell values.
     SCSIZE              mnScCols;       /// Number of cached columns.
commit 024a07537fdcbcbff03c9ca34990520aeb2fc6bb
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Nov 12 10:55:22 2015 +0200

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

diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx
index c120693..679233c 100644
--- a/sc/source/filter/excel/xiname.cxx
+++ b/sc/source/filter/excel/xiname.cxx
@@ -24,6 +24,7 @@
 #include "excimp8.hxx"
 #include "scextopt.hxx"
 #include "document.hxx"
+#include <o3tl/make_unique.hxx>
 
 // *** Implementation ***
 
@@ -276,7 +277,7 @@ void XclImpNameManager::ReadName( XclImpStream& rStrm )
 {
     sal_uLong nCount = maNameList.size();
     if( nCount < 0xFFFF )
-        maNameList.push_back( new XclImpName( rStrm, static_cast< sal_uInt16 >( nCount + 1 ) ) );
+        maNameList.push_back( o3tl::make_unique<XclImpName>( rStrm, static_cast< sal_uInt16 >( nCount + 1 ) ) );
 }
 
 const XclImpName* XclImpNameManager::FindName( const OUString& rXclName, SCTAB nScTab ) const
@@ -285,12 +286,12 @@ const XclImpName* XclImpNameManager::FindName( const OUString& rXclName, SCTAB n
     const XclImpName* pLocalName = nullptr;    // a found local name
     for( XclImpNameList::const_iterator itName = maNameList.begin(); itName != maNameList.end() && !pLocalName; ++itName )
     {
-        if( itName->GetXclName() == rXclName )
+        if( (*itName)->GetXclName() == rXclName )
         {
-            if( itName->GetScTab() == nScTab )
-                pLocalName = &(*itName);
-            else if( itName->IsGlobal() )
-                pGlobalName = &(*itName);
+            if( (*itName)->GetScTab() == nScTab )
+                pLocalName = itName->get();
+            else if( (*itName)->IsGlobal() )
+                pGlobalName = itName->get();
         }
     }
     return pLocalName ? pLocalName : pGlobalName;
@@ -299,14 +300,14 @@ const XclImpName* XclImpNameManager::FindName( const OUString& rXclName, SCTAB n
 const XclImpName* XclImpNameManager::GetName( sal_uInt16 nXclNameIdx ) const
 {
     OSL_ENSURE( nXclNameIdx > 0, "XclImpNameManager::GetName - index must be >0" );
-    return ( nXclNameIdx <= 0 ||  nXclNameIdx > maNameList.size() ) ? nullptr : &(maNameList.at( nXclNameIdx - 1 ));
+    return ( nXclNameIdx <= 0 ||  nXclNameIdx > maNameList.size() ) ? nullptr : maNameList.at( nXclNameIdx - 1 ).get();
 }
 
 void XclImpNameManager::ConvertAllTokens()
 {
     XclImpNameList::iterator it = maNameList.begin(), itEnd = maNameList.end();
     for (; it != itEnd; ++it)
-        it->ConvertTokens();
+        (*it)->ConvertTokens();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/xiname.hxx b/sc/source/filter/inc/xiname.hxx
index 4cc53b5..6cf9465 100644
--- a/sc/source/filter/inc/xiname.hxx
+++ b/sc/source/filter/inc/xiname.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_XINAME_HXX
 #define INCLUDED_SC_SOURCE_FILTER_INC_XINAME_HXX
 
-#include <boost/ptr_container/ptr_vector.hpp>
 #include "xlname.hxx"
 #include "xiroot.hxx"
 #include "xistream.hxx"
@@ -29,6 +28,7 @@
 
 #include <boost/noncopyable.hpp>
 #include <memory>
+#include <vector>
 
 class ScRangeData;
 class ScTokenArray;
@@ -102,7 +102,7 @@ public:
     void ConvertAllTokens();
 
 private:
-    typedef boost::ptr_vector< XclImpName > XclImpNameList;
+    typedef std::vector< std::unique_ptr<XclImpName> > XclImpNameList;
     XclImpNameList      maNameList;
 };
 


More information about the Libreoffice-commits mailing list