[Libreoffice-commits] core.git: 6 commits - chart2/inc chart2/source sfx2/inc sfx2/source svtools/inc svtools/source
Michael Stahl
mstahl at redhat.com
Fri Dec 4 03:03:17 PST 2015
chart2/inc/pch/precompiled_chartcore.hxx | 1
chart2/source/view/charttypes/VSeriesPlotter.cxx | 21 +++++------
chart2/source/view/inc/3DChartObjects.hxx | 7 ++-
chart2/source/view/inc/VDataSeries.hxx | 4 +-
chart2/source/view/main/3DChartObjects.cxx | 11 ++----
chart2/source/view/main/VDataSeries.cxx | 17 ++++-----
sfx2/inc/pch/precompiled_sfx.hxx | 1
sfx2/source/control/shell.cxx | 24 ++++++-------
svtools/inc/pch/precompiled_svt.hxx | 1
svtools/source/contnr/imivctl.hxx | 8 ++--
svtools/source/contnr/imivctl1.cxx | 24 ++++++-------
svtools/source/contnr/treelist.cxx | 42 +++++++++++------------
12 files changed, 79 insertions(+), 82 deletions(-)
New commits:
commit b1ff7054a0d7c12e0961c7a78bb2626b33c7f0d1
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Dec 3 23:36:50 2015 +0100
svtools: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: Ic61b2b9a472431e5443c74eb8b319ff8796e1672
diff --git a/svtools/inc/pch/precompiled_svt.hxx b/svtools/inc/pch/precompiled_svt.hxx
index bcd65e5..b7c9b0d 100644
--- a/svtools/inc/pch/precompiled_svt.hxx
+++ b/svtools/inc/pch/precompiled_svt.hxx
@@ -53,7 +53,6 @@
#include <boost/intrusive_ptr.hpp>
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
-#include <boost/ptr_container/ptr_map.hpp>
#include <osl/conditn.hxx>
#include <osl/diagnose.h>
#include <osl/endian.h>
diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx
index 31272b7..e35e5be 100644
--- a/svtools/source/contnr/imivctl.hxx
+++ b/svtools/source/contnr/imivctl.hxx
@@ -32,7 +32,9 @@
#include <limits.h>
#include <svtools/ivctrl.hxx>
-#include <boost/ptr_container/ptr_map.hpp>
+
+#include <memory>
+#include <map>
class IcnCursor_Impl;
class SvtIconChoiceCtrl;
@@ -150,7 +152,7 @@ public:
// Implementation-class of IconChoiceCtrl
-typedef boost::ptr_map<sal_uInt16, SvxIconChoiceCtrlColumnInfo> SvxIconChoiceCtrlColumnInfoMap;
+typedef std::map<sal_uInt16, std::unique_ptr<SvxIconChoiceCtrlColumnInfo>> SvxIconChoiceCtrlColumnInfoMap;
typedef std::vector<SvxIconChoiceCtrlEntry*> SvxIconChoiceCtrlEntryPtrVec;
class SvxIconChoiceCtrl_Impl
@@ -182,7 +184,7 @@ class SvxIconChoiceCtrl_Impl
long nMaxVirtWidth; // max. width aVirtOutputSize for ALIGN_TOP
long nMaxVirtHeight; // max. height aVirtOutputSize for ALIGN_LEFT
SvxIconChoiceCtrlEntryList_impl* pZOrderList;
- SvxIconChoiceCtrlColumnInfoMap* pColumns;
+ SvxIconChoiceCtrlColumnInfoMap* m_pColumns;
VclPtr<IcnViewEdit_Impl> pEdit;
WinBits nWinBits;
long nMaxBoundHeight; // height of highest BoundRects
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index f7ea4cf..5d80be7d 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -95,7 +95,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl(
aHorSBar( VclPtr<ScrollBar>::Create(pCurView, WB_DRAG | WB_HSCROLL) ),
aScrBarBox( VclPtr<ScrollBarBox>::Create(pCurView) ),
aImageSize( 32, 32 ),
- pColumns( nullptr )
+ m_pColumns( nullptr )
{
bChooseWithCursor = false;
pEntryPaintDev = nullptr;
@@ -227,7 +227,7 @@ void SvxIconChoiceCtrl_Impl::SetStyle( WinBits nWinStyle )
nWinBits |= WB_ALIGN_LEFT;
if( (nWinStyle & WB_DETAILS))
{
- if( !pColumns )
+ if (!m_pColumns)
SetColumn( 0, SvxIconChoiceCtrlColumnInfo( 0, 100, IcnViewAlignLeft ));
}
}
@@ -3501,20 +3501,20 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt )
void SvxIconChoiceCtrl_Impl::ClearColumnList()
{
- if( !pColumns )
+ if (!m_pColumns)
return;
- pColumns->clear();
- DELETEZ(pColumns);
+ m_pColumns->clear();
+ DELETEZ(m_pColumns);
}
void SvxIconChoiceCtrl_Impl::SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& rInfo)
{
- if( !pColumns )
- pColumns = new SvxIconChoiceCtrlColumnInfoMap;
+ if (!m_pColumns)
+ m_pColumns = new SvxIconChoiceCtrlColumnInfoMap;
SvxIconChoiceCtrlColumnInfo* pInfo = new SvxIconChoiceCtrlColumnInfo( rInfo );
- pColumns->insert( nIndex, pInfo );
+ m_pColumns->insert(std::make_pair(nIndex, std::unique_ptr<SvxIconChoiceCtrlColumnInfo>(pInfo)));
// HACK: Detail mode is not yet fully implemented, this workaround makes it
// fly with a single column
@@ -3527,12 +3527,12 @@ void SvxIconChoiceCtrl_Impl::SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCt
const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetColumn( sal_uInt16 nIndex ) const
{
- if (!pColumns)
+ if (!m_pColumns)
return nullptr;
- SvxIconChoiceCtrlColumnInfoMap::const_iterator it = pColumns->find( nIndex );
- if( it == pColumns->end() )
+ auto const it = m_pColumns->find( nIndex );
+ if (it == m_pColumns->end())
return nullptr;
- return it->second;
+ return it->second.get();
}
void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(vcl::RenderContext& rRenderContext, const Rectangle& rBmpRect, bool bHide)
commit de25d1d0f5f50a05e40f687224379e97b701bcae
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Dec 3 23:24:48 2015 +0100
svtools: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: I56fb6eb96f0d7c0a80741ba1dec7a2cbe650c33c
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index cf12ad3..8fc372f 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -22,10 +22,11 @@
#include <svtools/viewdataentry.hxx>
#include <osl/diagnose.h>
-#include <boost/ptr_container/ptr_map.hpp>
+#include <memory>
+#include <map>
-typedef boost::ptr_map<SvTreeListEntry*, SvViewDataEntry> SvDataTable;
+typedef std::map<SvTreeListEntry*, std::unique_ptr<SvViewDataEntry>> SvDataTable;
struct SvListView::Impl
{
@@ -1223,21 +1224,20 @@ void SvListView::Impl::InitTable()
}
SvTreeListEntry* pEntry;
- SvViewDataEntry* pViewData;
// insert root entry
pEntry = m_rThis.pModel->pRootItem;
- pViewData = new SvViewDataEntry;
+ std::unique_ptr<SvViewDataEntry> pViewData(new SvViewDataEntry);
pViewData->SetExpanded(true);
- m_DataTable.insert( pEntry, pViewData );
+ m_DataTable.insert(std::make_pair(pEntry, std::move(pViewData)));
// now all the other entries
pEntry = m_rThis.pModel->First();
while( pEntry )
{
- pViewData = m_rThis.CreateViewData( pEntry );
+ pViewData.reset(m_rThis.CreateViewData( pEntry ));
DBG_ASSERT(pViewData,"InitTable:No ViewData");
- m_rThis.InitViewData( pViewData, pEntry );
- m_DataTable.insert( pEntry, pViewData );
+ m_rThis.InitViewData( pViewData.get(), pEntry );
+ m_DataTable.insert(std::make_pair(pEntry, std::move(pViewData)));
pEntry = m_rThis.pModel->Next( pEntry );
}
}
@@ -1257,9 +1257,9 @@ void SvListView::Clear()
{
// insert root entry
SvTreeListEntry* pEntry = pModel->pRootItem;
- SvViewDataEntry* pViewData = new SvViewDataEntry;
+ std::unique_ptr<SvViewDataEntry> pViewData(new SvViewDataEntry);
pViewData->SetExpanded(true);
- m_pImpl->m_DataTable.insert( pEntry, pViewData );
+ m_pImpl->m_DataTable.insert(std::make_pair(pEntry, std::move(pViewData)));
}
}
@@ -1325,7 +1325,7 @@ void SvListView::Impl::ActionMoving( SvTreeListEntry* pEntry,SvTreeListEntry*,sa
DBG_ASSERT(pParent,"Model not consistent");
if (pParent != m_rThis.pModel->pRootItem && pParent->m_Children.size() == 1)
{
- SvViewDataEntry* pViewData = m_DataTable.find( pParent )->second;
+ SvViewDataEntry* pViewData = m_DataTable.find( pParent )->second.get();
pViewData->SetExpanded(false);
}
// preliminary
@@ -1344,10 +1344,10 @@ void SvListView::Impl::ActionMoved( SvTreeListEntry* /* pEntry */ ,
void SvListView::Impl::ActionInserted( SvTreeListEntry* pEntry )
{
DBG_ASSERT(pEntry,"Insert:No Entry");
- SvViewDataEntry* pData = m_rThis.CreateViewData( pEntry );
- m_rThis.InitViewData( pData, pEntry );
+ std::unique_ptr<SvViewDataEntry> pData(m_rThis.CreateViewData( pEntry ));
+ m_rThis.InitViewData( pData.get(), pEntry );
std::pair<SvDataTable::iterator, bool> aSuccess =
- m_DataTable.insert( pEntry, pData );
+ m_DataTable.insert(std::make_pair(pEntry, std::move(pData)));
DBG_ASSERT(aSuccess.second,"Entry already in View");
if (m_nVisibleCount && m_rThis.pModel->IsEntryVisible(&m_rThis, pEntry))
{
@@ -1369,10 +1369,10 @@ void SvListView::Impl::ActionInsertedTree( SvTreeListEntry* pEntry )
while( pCurEntry )
{
DBG_ASSERT(m_DataTable.find(pCurEntry) != m_DataTable.end(),"Entry already in Table");
- SvViewDataEntry* pViewData = m_rThis.CreateViewData( pCurEntry );
+ std::unique_ptr<SvViewDataEntry> pViewData(m_rThis.CreateViewData(pCurEntry));
DBG_ASSERT(pViewData,"No ViewData");
- m_rThis.InitViewData( pViewData, pEntry );
- m_DataTable.insert( pCurEntry, pViewData );
+ m_rThis.InitViewData( pViewData.get(), pEntry );
+ m_DataTable.insert(std::make_pair(pCurEntry, std::move(pViewData)));
pCurEntry = m_rThis.pModel->Next( pCurEntry );
if ( pCurEntry && m_rThis.pModel->GetDepth(pCurEntry) <= nRefDepth)
pCurEntry = nullptr;
@@ -1396,7 +1396,7 @@ void SvListView::Impl::ActionRemoving( SvTreeListEntry* pEntry )
{
DBG_ASSERT(pEntry,"Remove:No Entry");
- SvViewDataEntry* pViewData = m_DataTable.find( pEntry )->second;
+ SvViewDataEntry* pViewData = m_DataTable.find( pEntry )->second.get();
sal_uLong nSelRemoved = 0;
if ( pViewData->IsSelected() )
nSelRemoved = 1 + m_rThis.pModel->GetChildSelectionCount(&m_rThis, pEntry);
@@ -1422,7 +1422,7 @@ void SvListView::Impl::ActionRemoving( SvTreeListEntry* pEntry )
SvTreeListEntry* pCurEntry = pEntry->pParent;
if (pCurEntry && pCurEntry != m_rThis.pModel->pRootItem && pCurEntry->m_Children.size() == 1)
{
- pViewData = m_DataTable.find(pCurEntry)->second;
+ pViewData = m_DataTable.find(pCurEntry)->second.get();
pViewData->SetExpanded(false);
}
}
@@ -1522,14 +1522,14 @@ const SvViewDataEntry* SvListView::GetViewData( const SvTreeListEntry* pEntry )
m_pImpl->m_DataTable.find(const_cast<SvTreeListEntry*>(pEntry));
if (itr == m_pImpl->m_DataTable.end())
return nullptr;
- return itr->second;
+ return itr->second.get();
}
SvViewDataEntry* SvListView::GetViewData( SvTreeListEntry* pEntry )
{
SvDataTable::iterator itr = m_pImpl->m_DataTable.find( pEntry );
DBG_ASSERT(itr != m_pImpl->m_DataTable.end(),"Entry not in model or wrong view");
- return itr->second;
+ return itr->second.get();
}
sal_Int32 SvTreeList::Compare(const SvTreeListEntry* pLeft, const SvTreeListEntry* pRight) const
commit 9e87b8ea8ff4928af4751573585219d4c902d9c9
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Dec 3 23:10:04 2015 +0100
sfx2: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: Ic5aed60d40d0e1cd4c227032bc4cf9adbd7be00a
diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx
index d599a0d..2365943 100644
--- a/sfx2/inc/pch/precompiled_sfx.hxx
+++ b/sfx2/inc/pch/precompiled_sfx.hxx
@@ -47,7 +47,6 @@
#include <boost/logic/tribool.hpp>
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
-#include <boost/ptr_container/ptr_map.hpp>
#include <osl/conditn.hxx>
#include <osl/diagnose.h>
#include <osl/file.hxx>
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index a073b46..ca82105 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -45,12 +45,12 @@
#include <sidebar/ContextChangeBroadcaster.hxx>
#include <com/sun/star/ui/dialogs/XSLTFilterDialog.hpp>
-#include <boost/ptr_container/ptr_map.hpp>
-#include <vector>
#include <memory>
+#include <vector>
+#include <map>
// Maps the Which() field to a pointer to a SfxPoolItem
-typedef boost::ptr_map<sal_uInt16, SfxPoolItem> SfxItemPtrMap;
+typedef std::map<sal_uInt16, std::unique_ptr<SfxPoolItem>> SfxItemPtrMap;
using namespace com::sun::star;
@@ -58,7 +58,7 @@ using namespace com::sun::star;
struct SfxShell_Impl: public SfxBroadcaster
{
OUString aObjectName; // Name of Sbx-Objects
- SfxItemPtrMap aItems; // Data exchange on Item level
+ SfxItemPtrMap m_Items; // Data exchange on Item level
SfxViewShell* pViewSh; // SfxViewShell if Shell is
// ViewFrame/ViewShell/SubShell list
SfxViewFrame* pFrame; // Frame, if <UI-active>
@@ -153,9 +153,9 @@ const SfxPoolItem* SfxShell::GetItem
sal_uInt16 nSlotId // Slot-Id of the querying <SfxPoolItem>s
) const
{
- SfxItemPtrMap::const_iterator it = pImp->aItems.find( nSlotId );
- if( it != pImp->aItems.end() )
- return it->second;
+ auto const it = pImp->m_Items.find( nSlotId );
+ if (it != pImp->m_Items.end())
+ return it->second.get();
return nullptr;
}
@@ -174,12 +174,12 @@ void SfxShell::PutItem
SfxPoolItemHint aItemHint( pItem );
sal_uInt16 nWhich = rItem.Which();
- SfxItemPtrMap::iterator it = pImp->aItems.find( nWhich );
- if( it != pImp->aItems.end() )
+ auto const it = pImp->m_Items.find(nWhich);
+ if (it != pImp->m_Items.end())
{
// Replace Item
- pImp->aItems.erase( it );
- pImp->aItems.insert( nWhich, pItem );
+ pImp->m_Items.erase( it );
+ pImp->m_Items.insert(std::make_pair(nWhich, std::unique_ptr<SfxPoolItem>(pItem)));
// if active, notify Bindings
SfxDispatcher *pDispat = GetDispatcher();
@@ -200,7 +200,7 @@ void SfxShell::PutItem
else
{
Broadcast( aItemHint );
- pImp->aItems.insert( nWhich, pItem );
+ pImp->m_Items.insert(std::make_pair(nWhich, std::unique_ptr<SfxPoolItem>(pItem)));
}
}
commit 19f64ccc8c71b1e63b166c559479ee1c3390f8a0
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Dec 3 23:04:19 2015 +0100
chart2: replace boost::ptr_map with std::map
Change-Id: I07a8b2eaa11ca29e3303d323060c3a4c52823967
diff --git a/chart2/inc/pch/precompiled_chartcore.hxx b/chart2/inc/pch/precompiled_chartcore.hxx
index 5941967..4c7b206 100644
--- a/chart2/inc/pch/precompiled_chartcore.hxx
+++ b/chart2/inc/pch/precompiled_chartcore.hxx
@@ -38,7 +38,6 @@
#include <vector>
#include <boost/checked_delete.hpp>
#include <boost/intrusive_ptr.hpp>
-#include <boost/ptr_container/ptr_map.hpp>
#include <osl/conditn.hxx>
#include <osl/diagnose.h>
#include <osl/doublecheckedlocking.h>
diff --git a/chart2/source/view/inc/3DChartObjects.hxx b/chart2/source/view/inc/3DChartObjects.hxx
index 1c2d61b..27123ce 100644
--- a/chart2/source/view/inc/3DChartObjects.hxx
+++ b/chart2/source/view/inc/3DChartObjects.hxx
@@ -17,9 +17,10 @@
#include <vcl/opengl/OpenGLContext.hxx>
#include "GL3DRenderer.hxx"
-#include <boost/ptr_container/ptr_map.hpp>
#include <boost/shared_array.hpp>
+#include <map>
+
namespace chart {
namespace opengl3D {
@@ -39,9 +40,9 @@ class TextCache
public:
const TextCacheItem &getText(OUString const & rText, bool bIs3dText = false);
private:
- typedef boost::ptr_map<OUString const, TextCacheItem> TextCacheType;
+ typedef std::map<OUString const, TextCacheItem> TextCacheType;
- TextCacheType maTextCache;
+ TextCacheType m_TextCache;
};
class Renderable3DObject
diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx
index e8bb046..56cc323 100644
--- a/chart2/source/view/main/3DChartObjects.cxx
+++ b/chart2/source/view/main/3DChartObjects.cxx
@@ -72,9 +72,9 @@ void Line::setLineColor(const Color& rColor)
const TextCacheItem& TextCache::getText(OUString const & rText, bool bIs3dText)
{
- TextCacheType::const_iterator itr = maTextCache.find(rText);
- if(itr != maTextCache.end())
- return *itr->second;
+ TextCacheType::const_iterator const itr = m_TextCache.find(rText);
+ if (itr != m_TextCache.end())
+ return itr->second;
ScopedVclPtrInstance< VirtualDevice > pDevice(*Application::GetDefaultDevice(),
DeviceFormat::DEFAULT, DeviceFormat::DEFAULT);
@@ -105,10 +105,9 @@ const TextCacheItem& TextCache::getText(OUString const & rText, bool bIs3dText)
long nBmpHeight = aText.GetSizePixel().Height();
sal_uInt8* pBitmapBuf(new sal_uInt8[3* nBmpWidth * nBmpHeight]);
memcpy(pBitmapBuf, buf, 3* nBmpWidth * nBmpHeight);
- TextCacheItem *pItem = new TextCacheItem(pBitmapBuf, aText.GetSizePixel());
- maTextCache.insert(rText, pItem);
+ m_TextCache.insert(std::make_pair(rText, TextCacheItem(pBitmapBuf, aText.GetSizePixel())));
Bitmap::ReleaseAccess(pAcc);
- return *maTextCache.find(rText)->second;
+ return m_TextCache.find(rText)->second;
}
Text::Text(OpenGL3DRenderer* pRenderer, TextCache& rTextCache, const OUString& rStr, sal_uInt32 nId):
commit f46327e6c99e5230907debf660337a47d4fa7caf
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Dec 3 22:56:55 2015 +0100
chart2: replace boost::ptr_map with std::map
Change-Id: Id647a5b681e10defd944ccb2ec8509689df704af
diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx
index 05e6e16..38da4c4 100644
--- a/chart2/source/view/inc/VDataSeries.hxx
+++ b/chart2/source/view/inc/VDataSeries.hxx
@@ -35,8 +35,8 @@
#include <memory>
#include <vector>
+#include <map>
#include <boost/noncopyable.hpp>
-#include <boost/ptr_container/ptr_map.hpp>
namespace chart
{
@@ -206,7 +206,7 @@ private: //member
VDataSequence* m_pValueSequenceForDataLabelNumberFormatDetection;
- boost::ptr_map<OUString, VDataSequence> maPropertyMap;
+ std::map<OUString, VDataSequence> m_PropertyMap;
mutable double m_fXMeanValue;
mutable double m_fYMeanValue;
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index 60b6412..b0cf9ff 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -229,9 +229,9 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
m_aValues_Bubble_Size.init( xDataSequence );
else
{
- VDataSequence* pSequence = new VDataSequence();
- pSequence->init( xDataSequence );
- maPropertyMap.insert(aRole, pSequence);
+ VDataSequence aSequence;
+ aSequence.init(xDataSequence);
+ m_PropertyMap.insert(std::make_pair(aRole, aSequence));
}
}
catch( const uno::Exception& e )
@@ -1087,7 +1087,7 @@ VDataSeries* VDataSeries::createCopyForTimeBased() const
pNew->m_aValues_Y_First = m_aValues_Y_First;
pNew->m_aValues_Y_Last = m_aValues_Y_Last;
pNew->m_aValues_Bubble_Size = m_aValues_Bubble_Size;
- pNew->maPropertyMap = maPropertyMap;
+ pNew->m_PropertyMap = m_PropertyMap;
pNew->m_nPointCount = m_nPointCount;
@@ -1096,16 +1096,15 @@ VDataSeries* VDataSeries::createCopyForTimeBased() const
double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropName ) const
{
- boost::ptr_map<OUString, VDataSequence>::const_iterator itr =
- maPropertyMap.find(rPropName);
- if(itr == maPropertyMap.end())
+ auto const itr = m_PropertyMap.find(rPropName);
+ if (itr == m_PropertyMap.end())
{
double fNan;
::rtl::math::setNan( &fNan );
return fNan;
}
- const VDataSequence* pData = itr->second;
+ const VDataSequence* pData = &itr->second;
double fValue = pData->getValue(nIndex);
if(mpOldSeries && mpOldSeries->hasPropertyMapping(rPropName))
{
@@ -1129,7 +1128,7 @@ double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropN
bool VDataSeries::hasPropertyMapping(const OUString& rPropName ) const
{
- return maPropertyMap.find(rPropName) != maPropertyMap.end();
+ return m_PropertyMap.find(rPropName) != m_PropertyMap.end();
}
} //namespace chart
commit 25ad18c1e136a03b0d04a1aefbde43a2290460dc
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Dec 3 22:48:05 2015 +0100
chart2: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: I0b80042bdab33b52b339267292249add6f70ac3c
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 4ed9bdc..d0f230f 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -60,6 +60,7 @@
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <editeng/unoprnms.hxx>
#include <tools/color.hxx>
+#include <o3tl/make_unique.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/math.hxx>
#include <basegfx/vector/b2dvector.hxx>
@@ -84,7 +85,6 @@
#include <map>
#include <unordered_map>
-#include <boost/ptr_container/ptr_map.hpp>
namespace chart {
@@ -1684,9 +1684,9 @@ class PerXMinMaxCalculator
{
typedef std::pair<double, double> MinMaxType;
typedef std::map<size_t, MinMaxType> SeriesMinMaxType;
- typedef boost::ptr_map<double, SeriesMinMaxType> GroupMinMaxType;
+ typedef std::map<double, std::unique_ptr<SeriesMinMaxType>> GroupMinMaxType;
typedef std::unordered_map<double, MinMaxType> TotalStoreType;
- GroupMinMaxType maSeriesGroup;
+ GroupMinMaxType m_SeriesGroup;
size_t mnCurSeries;
public:
@@ -1751,12 +1751,11 @@ private:
void getTotalStore(TotalStoreType& rStore) const
{
TotalStoreType aStore;
- GroupMinMaxType::const_iterator it = maSeriesGroup.begin(), itEnd = maSeriesGroup.end();
- for (; it != itEnd; ++it)
+ for (auto const& it : m_SeriesGroup)
{
- double fX = it->first;
+ double fX = it.first;
- const SeriesMinMaxType& rSeries = *it->second;
+ const SeriesMinMaxType& rSeries = *it.second;
SeriesMinMaxType::const_iterator itSeries = rSeries.begin(), itSeriesEnd = rSeries.end();
for (; itSeries != itSeriesEnd; ++itSeries)
{
@@ -1781,11 +1780,11 @@ private:
SeriesMinMaxType* getByXValue(double fX)
{
- GroupMinMaxType::iterator it = maSeriesGroup.find(fX);
- if (it == maSeriesGroup.end())
+ GroupMinMaxType::iterator it = m_SeriesGroup.find(fX);
+ if (it == m_SeriesGroup.end())
{
std::pair<GroupMinMaxType::iterator,bool> r =
- maSeriesGroup.insert(fX, new SeriesMinMaxType);
+ m_SeriesGroup.insert(std::make_pair(fX, o3tl::make_unique<SeriesMinMaxType>()));
if (!r.second)
// insertion failed.
@@ -1794,7 +1793,7 @@ private:
it = r.first;
}
- return it->second;
+ return it->second.get();
}
};
More information about the Libreoffice-commits
mailing list