summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-06-26 22:31:20 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-06-26 22:33:55 -0400
commit822d0e9db610ce3cbee2cf8d3154ee41218ea562 (patch)
treebc6bc2fdebb74e01bfcaa0f16c2d8d34861aa5a7
parentc6da1842956ceced501858d582f7dcaded0a324a (diff)
Use new GridPrinter instance for each table.
resize() sometimes leads to a crash. Need to debug later. Change-Id: Ia3809eb4f171369a58b84d5b44001692be1453a1
-rw-r--r--chart2/source/tools/InternalData.cxx36
1 files changed, 27 insertions, 9 deletions
diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx
index 72ce3154cc16..52656023699e 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)
{