[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Mar 1 17:15:53 PST 2011
sc/source/filter/excel/xichart.cxx | 24 ++++++++++++------------
sc/source/filter/inc/xichart.hxx | 4 ++--
2 files changed, 14 insertions(+), 14 deletions(-)
New commits:
commit 28b5dbeb60efc113759423f8ccbc96de7bf10594
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Mar 1 20:13:40 2011 -0500
More on ScfRefMap to boost::ptr_map.
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index cd75fa8..7667d85 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -2702,15 +2702,15 @@ void XclImpChTypeGroup::ReadChDropBar( XclImpStream& rStrm )
{
if (maDropBars.find(EXC_CHDROPBAR_UP) == maDropBars.end())
{
- XclImpChDropBarRef p(new XclImpChDropBar(EXC_CHDROPBAR_UP));
+ auto_ptr<XclImpChDropBar> p(new XclImpChDropBar(EXC_CHDROPBAR_UP));
p->ReadRecordGroup(rStrm);
- maDropBars.insert(XclImpChDropBarMap::value_type(EXC_CHDROPBAR_UP, p));
+ maDropBars.insert(EXC_CHDROPBAR_UP, p);
}
else if(maDropBars.find(EXC_CHDROPBAR_DOWN) == maDropBars.end())
{
- XclImpChDropBarRef p(new XclImpChDropBar(EXC_CHDROPBAR_DOWN));
+ auto_ptr<XclImpChDropBar> p(new XclImpChDropBar(EXC_CHDROPBAR_DOWN));
p->ReadRecordGroup(rStrm);
- maDropBars.insert(XclImpChDropBarMap::value_type(EXC_CHDROPBAR_DOWN, p));
+ maDropBars.insert(EXC_CHDROPBAR_DOWN, p);
}
}
@@ -2829,20 +2829,20 @@ void XclImpChTypeGroup::CreateStockSeries( Reference< XChartType > xChartType, s
xHiLoLine->second->Convert( GetChRoot(), aSeriesProp, EXC_CHOBJTYPE_HILOLINE );
}
// white dropbar format
- XclImpChDropBarRef xUpBar = maDropBars.get( EXC_CHDROPBAR_UP );
- Reference< XPropertySet > xWhitePropSet;
- if( xUpBar && aTypeProp.GetProperty( xWhitePropSet, EXC_CHPROP_WHITEDAY ) )
+ XclImpChDropBarMap::const_iterator itr = maDropBars.find(EXC_CHDROPBAR_UP);
+ Reference<XPropertySet> xWhitePropSet;
+ if (itr != maDropBars.end() && aTypeProp.GetProperty(xWhitePropSet, EXC_CHPROP_WHITEDAY))
{
ScfPropertySet aBarProp( xWhitePropSet );
- xUpBar->Convert( GetChRoot(), aBarProp );
+ itr->second->Convert(GetChRoot(), aBarProp);
}
// black dropbar format
- XclImpChDropBarRef xDownBar = maDropBars.get( EXC_CHDROPBAR_DOWN );
- Reference< XPropertySet > xBlackPropSet;
- if( xDownBar && aTypeProp.GetProperty( xBlackPropSet, EXC_CHPROP_BLACKDAY ) )
+ itr = maDropBars.find(EXC_CHDROPBAR_DOWN);
+ Reference<XPropertySet> xBlackPropSet;
+ if (itr != maDropBars.end() && aTypeProp.GetProperty(xBlackPropSet, EXC_CHPROP_BLACKDAY))
{
ScfPropertySet aBarProp( xBlackPropSet );
- xDownBar->Convert( GetChRoot(), aBarProp );
+ itr->second->Convert(GetChRoot(), aBarProp);
}
// insert the series into the chart type object
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index 655cbed..26f9306 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -1107,8 +1107,8 @@ private:
private:
typedef ::std::vector< XclImpChSeriesRef > XclImpChSeriesVec;
- typedef ScfRefMap< sal_uInt16, XclImpChDropBar > XclImpChDropBarMap;
- typedef boost::ptr_map< sal_uInt16, XclImpChLineFormat > XclImpChLineFormatMap;
+ typedef boost::ptr_map<sal_uInt16, XclImpChDropBar> XclImpChDropBarMap;
+ typedef boost::ptr_map<sal_uInt16, XclImpChLineFormat> XclImpChLineFormatMap;
typedef ::std::set< sal_uInt16 > UInt16Set;
XclChTypeGroup maData; /// Contents of the CHTYPEGROUP record.
More information about the Libreoffice-commits
mailing list