[Libreoffice-commits] core.git: chart2/source

Kohei Yoshida kohei.yoshida at collabora.com
Thu Jun 26 19:32:59 PDT 2014


 chart2/source/tools/InternalData.cxx |   36 ++++++++++++++++++++++++++---------
 1 file changed, 27 insertions(+), 9 deletions(-)

New commits:
commit 822d0e9db610ce3cbee2cf8d3154ee41218ea562
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jun 26 22:31:20 2014 -0400

    Use new GridPrinter instance for each table.
    
    resize() sometimes leads to a crash.  Need to debug later.
    
    Change-Id: Ia3809eb4f171369a58b84d5b44001692be1453a1

diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx
index 72ce315..5265602 100644
--- a/chart2/source/tools/InternalData.cxx
+++ b/chart2/source/tools/InternalData.cxx
@@ -513,19 +513,37 @@ void InternalData::setComplexColumnLabels( const vector< vector< uno::Any > >& r
 void InternalData::dump() const
 {
     // Header
-    svl::GridPrinter aPrinter(1, m_nColumnCount, true);
-    for (sal_Int32 nCol = 0; nCol < m_nColumnCount; ++nCol)
+    if (!m_aColumnLabels.empty())
     {
-        if (m_aColumnLabels[nCol].empty())
-            continue;
+        svl::GridPrinter aPrinter(1, m_aColumnLabels.size(), true);
+        for (size_t nCol = 0; nCol < m_aColumnLabels.size(); ++nCol)
+        {
+            if (m_aColumnLabels[nCol].empty())
+                continue;
+
+            OUString aStr;
+            if (m_aColumnLabels[nCol][0] >>= aStr)
+                aPrinter.set(0, nCol, aStr);
+        }
+        aPrinter.print("Header");
+    }
 
-        OUString aStr;
-        if (m_aColumnLabels[nCol][0] >>= aStr)
-            aPrinter.set(0, nCol, aStr);
+    if (!m_aRowLabels.empty())
+    {
+        svl::GridPrinter aPrinter(m_aRowLabels.size(), m_aRowLabels[0].size());
+        for (size_t nRow = 0; nRow < m_aRowLabels.size(); ++nRow)
+        {
+            for (size_t nCol = 0; nCol < m_aRowLabels[nRow].size(); ++nCol)
+            {
+                OUString aStr;
+                if (m_aRowLabels[nRow].at(nCol) >>= aStr)
+                    aPrinter.set(nRow, nCol, aStr);
+            }
+        }
+        aPrinter.print("Row labels");
     }
-    aPrinter.print("Header");
 
-    aPrinter.resize(m_nRowCount, m_nColumnCount);
+    svl::GridPrinter aPrinter(m_nRowCount, m_nColumnCount);
 
     for (sal_Int32 nRow = 0; nRow < m_nRowCount; ++nRow)
     {


More information about the Libreoffice-commits mailing list