Kaydet (Commit) 9ae62c14 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen Kaydeden (comit) Björn Michaelsen

simplify lcl_SendChartEvent mess

Change-Id: I2476cbabbb3625ab0d562218102fbbcfbb08f4e6
Reviewed-on: https://gerrit.libreoffice.org/68404
Tested-by: Jenkins
Reviewed-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@libreoffice.org>
üst a1fe4f5a
......@@ -141,66 +141,43 @@ namespace
throw uno::RuntimeException("Table too complex", pObject);
return pTable;
}
}
#define UNO_TABLE_COLUMN_SUM 10000
static void lcl_SendChartEvent(uno::Reference<uno::XInterface> const& xSource,
::cppu::OInterfaceContainerHelper & rListeners)
{
if (!rListeners.getLength())
return;
//TODO: find appropriate settings of the Event
chart::ChartDataChangeEvent event;
event.Source = xSource;
event.Type = chart::ChartDataChangeType_ALL;
event.StartColumn = 0;
event.EndColumn = 1;
event.StartRow = 0;
event.EndRow = 1;
rListeners.notifyEach(
& chart::XChartDataChangeEventListener::chartDataChanged, event);
}
static void lcl_SendChartEvent(uno::Reference<uno::XInterface> const& xSource,
::comphelper::OInterfaceContainerHelper2 & rListeners)
{
if (!rListeners.getLength())
return;
//TODO: find appropriate settings of the Event
chart::ChartDataChangeEvent event;
event.Source = xSource;
event.Type = chart::ChartDataChangeType_ALL;
event.StartColumn = 0;
event.EndColumn = 1;
event.StartRow = 0;
event.EndRow = 1;
rListeners.notifyEach(
& chart::XChartDataChangeEventListener::chartDataChanged, event);
}
chart::ChartDataChangeEvent createChartEvent(uno::Reference<uno::XInterface> const& xSource)
{
//TODO: find appropriate settings of the Event
chart::ChartDataChangeEvent event;
event.Source = xSource;
event.Type = chart::ChartDataChangeType_ALL;
event.StartColumn = 0;
event.EndColumn = 1;
event.StartRow = 0;
event.EndRow = 1;
return event;
}
static void lcl_SendChartEvent(::cppu::OWeakObject & rSource,
::comphelper::OInterfaceContainerHelper2 & rListeners)
{
return lcl_SendChartEvent(&rSource, rListeners);
}
void lcl_SendChartEvent(
uno::Reference<uno::XInterface> const& xSource,
::comphelper::OInterfaceContainerHelper2& rListeners)
{
rListeners.notifyEach(
&chart::XChartDataChangeEventListener::chartDataChanged,
createChartEvent(xSource));
}
static void lcl_SendChartEvent(uno::Reference<uno::XInterface> const& xSource,
::cppu::OMultiTypeInterfaceContainerHelper const & rListeners)
{
::cppu::OInterfaceContainerHelper *const pContainer(rListeners.getContainer(
cppu::UnoType<chart::XChartDataChangeEventListener>::get()));
if (pContainer)
void lcl_SendChartEvent(
uno::Reference<uno::XInterface> const& xSource,
::cppu::OMultiTypeInterfaceContainerHelper const& rListeners)
{
lcl_SendChartEvent(xSource, *pContainer);
auto pContainer(rListeners.getContainer(cppu::UnoType<chart::XChartDataChangeEventListener>::get()));
if (pContainer)
pContainer->notifyEach(
&chart::XChartDataChangeEventListener::chartDataChanged,
createChartEvent(xSource));
}
}
static void lcl_SendChartEvent(::cppu::OWeakObject & rSource,
::cppu::OMultiTypeInterfaceContainerHelper const & rListeners)
{
return lcl_SendChartEvent(&rSource, rListeners);
}
#define UNO_TABLE_COLUMN_SUM 10000
static bool lcl_LineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLine)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment