Kaydet (Commit) 427f28ea authored tarafından Markus Mohrhard's avatar Markus Mohrhard

add selection change listener to area panel

Change-Id: I4e3f0c1c669ec1c584cc2d6932fd78e177effa89
üst bc459213
......@@ -63,7 +63,8 @@ ChartAreaPanel::ChartAreaPanel(vcl::Window* pParent,
ChartController* pController):
svx::sidebar::AreaPropertyPanelBase(pParent, rxFrame),
mxModel(pController->getModel()),
mxListener(new ChartSidebarModifyListener(this))
mxListener(new ChartSidebarModifyListener(this)),
mxSelectionListener(new ChartSidebarSelectionListener(this))
{
}
......@@ -77,6 +78,10 @@ void ChartAreaPanel::dispose()
css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
xBroadcaster->removeModifyListener(mxListener);
css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(mxModel->getCurrentController(), css::uno::UNO_QUERY);
if (xSelectionSupplier.is())
xSelectionSupplier->removeSelectionChangeListener(mxSelectionListener);
AreaPropertyPanelBase::dispose();
}
......@@ -84,6 +89,10 @@ void ChartAreaPanel::Initialize()
{
css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
xBroadcaster->addModifyListener(mxListener);
css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(mxModel->getCurrentController(), css::uno::UNO_QUERY);
if (xSelectionSupplier.is())
xSelectionSupplier->addSelectionChangeListener(mxSelectionListener);
}
void ChartAreaPanel::setFillTransparence(const XFillTransparenceItem& rItem)
......@@ -170,6 +179,16 @@ void ChartAreaPanel::modelInvalid()
{
}
void ChartAreaPanel::selectionChanged(bool bCorrectType)
{
if (bCorrectType)
updateData();
}
void ChartAreaPanel::SelectionInvalid()
{
}
void ChartAreaPanel::updateModel(
css::uno::Reference<css::frame::XModel> xModel)
{
......@@ -180,6 +199,10 @@ void ChartAreaPanel::updateModel(
css::uno::Reference<css::util::XModifyBroadcaster> xBroadcasterNew(mxModel, css::uno::UNO_QUERY_THROW);
xBroadcasterNew->addModifyListener(mxListener);
css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(mxModel->getCurrentController(), css::uno::UNO_QUERY);
if (xSelectionSupplier.is())
xSelectionSupplier->addSelectionChangeListener(mxSelectionListener);
}
......
......@@ -29,6 +29,7 @@
#include <svx/sidebar/AreaPropertyPanelBase.hxx>
#include "ChartSidebarModifyListener.hxx"
#include "ChartSidebarSelectionListener.hxx"
class XFillFloatTransparenceItem;
class XFillTransparenceItem;
......@@ -47,7 +48,7 @@ namespace sidebar {
class ChartAreaPanel : public svx::sidebar::AreaPropertyPanelBase,
public sfx2::sidebar::SidebarModelUpdate,
public ChartSidebarModifyListenerParent,
public sfx2::sidebar::SidebarModelUpdate
public ChartSidebarSelectionListenerParent
{
public:
static VclPtr<vcl::Window> Create(
......@@ -72,9 +73,11 @@ public:
virtual void setFillStyleAndBitmap(const XFillStyleItem* pStyleItem, const XFillBitmapItem& rBitmapItem);
virtual void updateData() SAL_OVERRIDE;
virtual void modelInvalid() SAL_OVERRIDE;
virtual void selectionChanged(bool bCorrectType) SAL_OVERRIDE;
virtual void SelectionInvalid() SAL_OVERRIDE;
virtual void dispose() SAL_OVERRIDE;
virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) SAL_OVERRIDE;
......@@ -83,6 +86,7 @@ private:
css::uno::Reference<css::frame::XModel> mxModel;
css::uno::Reference<css::util::XModifyListener> mxListener;
css::uno::Reference<css::view::XSelectionChangeListener> mxSelectionListener;
void Initialize();
......
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