[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Dec 8 12:11:46 PST 2010


 sc/source/filter/excel/xechart.cxx |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 8a72837f82e28c755e7895af13fdf8b0f256f336
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 8 15:11:18 2010 -0500

    Removed another use of operator[] with std::map.

diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index d35c37e..d40b52e 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -2420,8 +2420,17 @@ void XclExpChTypeGroup::ConvertSeries(
                 maType.SetStacked( bPercent );
 
                 // connected data points (only in stacked bar charts)
-                if( bConnectBars && (maTypeInfo.meTypeCateg == EXC_CHTYPECATEG_BAR) )
-                    maChartLines[ EXC_CHCHARTLINE_CONNECT ].reset( new XclExpChLineFormat( GetChRoot() ) );
+                if (bConnectBars && (maTypeInfo.meTypeCateg == EXC_CHTYPECATEG_BAR))
+                {
+                    XclExpChLineFormatMap::iterator itr = maChartLines.find(EXC_CHCHARTLINE_CONNECT);
+                    if (itr != maChartLines.end())
+                        // Remove existing element before inserting a new one.
+                        maChartLines.erase(itr);
+
+                    XclExpChLineFormatRef p(new XclExpChLineFormat(GetChRoot()));
+                    maChartLines.insert(
+                        XclExpChLineFormatMap::value_type(EXC_CHCHARTLINE_CONNECT, p));
+                }
             }
             else
             {


More information about the Libreoffice-commits mailing list