summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/source/view/main/DataTableView.cxx19
1 files changed, 15 insertions, 4 deletions
diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx
index d80e753d9e65..ae90b475e75a 100644
--- a/chart2/source/view/main/DataTableView.cxx
+++ b/chart2/source/view/main/DataTableView.cxx
@@ -287,16 +287,22 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV
}
// ROW HEADER
- // Prepare keys
+ // Prepare keys (symbols)
+ sal_Int32 nMaxSymbolWidth = 0;
if (bKeys)
{
- awt::Size aMaxSymbolExtent(300, 300);
for (VSeriesPlotter* pSeriesPlotter : m_pSeriesPlotterList)
{
if (pSeriesPlotter)
{
+ sal_Int32 nSymbolWidth = 300;
+ if (pSeriesPlotter->getLegendSymbolStyle() == LegendSymbolStyle::Line)
+ nSymbolWidth = 600;
+
+ nMaxSymbolWidth = std::max(nSymbolWidth, nMaxSymbolWidth);
+
std::vector<ViewLegendSymbol> aNewEntries = pSeriesPlotter->createSymbols(
- aMaxSymbolExtent, m_xTarget, m_xComponentContext);
+ { nSymbolWidth, 300 }, m_xTarget, m_xComponentContext);
aSymbols.insert(aSymbols.end(), aNewEntries.begin(), aNewEntries.end());
}
}
@@ -327,7 +333,10 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV
xCellPropertySet->setPropertyValue("ParaAdjust", uno::Any(style::ParagraphAdjust_LEFT));
if (bKeys)
- xCellPropertySet->setPropertyValue("ParaLeftMargin", uno::Any(sal_Int32(500)));
+ {
+ xCellPropertySet->setPropertyValue("ParaLeftMargin",
+ uno::Any(nMaxSymbolWidth + sal_Int32(200)));
+ }
}
nRow++;
}
@@ -376,6 +385,7 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV
pTableObject->DistributeColumns(0, nColumnCount - 1, true, true);
pTableObject->DistributeRows(0, nRowCount - 1, true, true);
+ xBroadcaster->lockBroadcasts();
uno::Reference<beans::XPropertySet> xPropertySet(xTableColumns->getByIndex(0), uno::UNO_QUERY);
sal_Int32 nWidth = 0;
xPropertySet->getPropertyValue("Width") >>= nWidth;
@@ -406,6 +416,7 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV
nTotalHeight += nHeight;
}
}
+ xBroadcaster->unlockBroadcasts();
}
void DataTableView::initializeShapes(const rtl::Reference<SvxShapeGroupAnyD>& xTarget)