summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-17 09:59:52 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-17 10:25:49 +0200
commitc2bd7a7de177bd81927ad29060ec3db43f9a6086 (patch)
tree95b8655404e9f8c63c764f32e68492833a440909 /chart2
parent747ee55b1a0842982833a9a8a9e54ee40958e339 (diff)
remove unnecessary parts in chart sidebar code
Change-Id: I5adedbb47edd39959220fa7ab3826d586734e943
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/sidebar/Chart2PanelFactory.cxx26
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.cxx18
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.hxx7
-rw-r--r--chart2/source/controller/sidebar/ChartSeriesPanel.cxx12
-rw-r--r--chart2/source/controller/sidebar/ChartSeriesPanel.hxx8
5 files changed, 16 insertions, 55 deletions
diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
index 61e167700216..be68e6b59927 100644
--- a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
+++ b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
@@ -62,8 +62,6 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
const ::comphelper::NamedValueCollection aArguments (rArguments);
Reference<css::frame::XFrame> xFrame (aArguments.getOrDefault("Frame", Reference<css::frame::XFrame>()));
Reference<css::awt::XWindow> xParentWindow (aArguments.getOrDefault("ParentWindow", Reference<css::awt::XWindow>()));
- const sal_uInt64 nBindingsValue (aArguments.getOrDefault("SfxBindings", sal_uInt64(0)));
- SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue);
Reference<css::frame::XController> xController (aArguments.getOrDefault("Controller", Reference<css::frame::XController>()));
vcl::Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow);
@@ -75,10 +73,6 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
throw RuntimeException(
"PanelFactory::createUIElement called without Frame",
NULL);
- if (pBindings == NULL)
- throw RuntimeException(
- "PanelFactory::createUIElement called without SfxBindings",
- NULL);
if (!xController.is())
throw RuntimeException(
"ChartPanelFactory::createUIElement called without Controller",
@@ -93,25 +87,9 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
sal_Int32 nMinimumSize = -1;
VclPtr<vcl::Window> pPanel;
if (rsResourceURL.endsWith("/ElementsPanel"))
- pPanel = ChartElementsPanel::Create( pParentWindow, xFrame, pBindings, pController );
+ pPanel = ChartElementsPanel::Create( pParentWindow, xFrame, pController );
else if (rsResourceURL.endsWith("/SeriesPanel"))
- pPanel = ChartSeriesPanel::Create(pParentWindow, xFrame, pBindings, pController);
- /*
- else if (rsResourceURL.endsWith("/CellAppearancePropertyPanel"))
- pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings );
- else if (rsResourceURL.endsWith("/NumberFormatPropertyPanel"))
- pPanel = NumberFormatPropertyPanel::Create( pParentWindow, xFrame, pBindings );
- else if (rsResourceURL.endsWith("/NavigatorPanel"))
- {
- pPanel = VclPtr<ScNavigatorDlg>::Create(pBindings, nullptr, pParentWindow, false);
- nMinimumSize = 0;
- }
- else if (rsResourceURL.endsWith("/FunctionsPanel"))
- {
- pPanel = VclPtr<ScFunctionDockWin>::Create(pBindings, nullptr, pParentWindow, ScResId(FID_FUNCTION_BOX));
- nMinimumSize = 0;
- }
- */
+ pPanel = ChartSeriesPanel::Create(pParentWindow, xFrame, pController);
if (pPanel)
xElement = sfx2::sidebar::SidebarPanelBase::Create(
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 8325ee41e4b7..1cbec9ec9b87 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -284,12 +284,10 @@ void setLegendPos(css::uno::Reference<css::frame::XModel> xModel, sal_Int32 nPos
ChartElementsPanel::ChartElementsPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings,
ChartController* pController)
: PanelLayout(pParent, "ChartElementsPanel", "modules/schart/ui/sidebarelements.ui", rxFrame),
mxFrame(rxFrame),
maContext(),
- mpBindings(pBindings),
mxModel(pController->getModel()),
mxListener(new ChartSidebarModifyListener(this))
{
@@ -408,24 +406,17 @@ void ChartElementsPanel::updateData()
mpLBLegendPosition->SelectEntryPos(getLegendPos(mxModel));
}
-void ChartElementsPanel::modelInvalid()
-{
-}
-
VclPtr<vcl::Window> ChartElementsPanel::Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings, ChartController* pController)
+ ChartController* pController)
{
if (pParent == NULL)
throw lang::IllegalArgumentException("no parent Window given to ChartElementsPanel::Create", NULL, 0);
if ( ! rxFrame.is())
throw lang::IllegalArgumentException("no XFrame given to ChartElementsPanel::Create", NULL, 1);
- if (pBindings == NULL)
- throw lang::IllegalArgumentException("no SfxBindings given to ChartElementsPanel::Create", NULL, 2);
-
return VclPtr<ChartElementsPanel>::Create(
- pParent, rxFrame, pBindings, pController);
+ pParent, rxFrame, pController);
}
void ChartElementsPanel::DataChanged(
@@ -455,6 +446,11 @@ void ChartElementsPanel::NotifyItemUpdate(
{
}
+void ChartElementsPanel::modelInvalid()
+{
+
+}
+
IMPL_LINK(ChartElementsPanel, CheckBoxHdl, CheckBox*, pCheckBox)
{
bool bChecked = pCheckBox->IsChecked();
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
index 358a8bec2194..32ffb7d0f41f 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
@@ -45,7 +45,7 @@ public:
static VclPtr<vcl::Window> Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings, ChartController* pController);
+ ChartController* pController);
virtual void DataChanged(
const DataChangedEvent& rEvent) SAL_OVERRIDE;
@@ -59,13 +59,11 @@ public:
const SfxPoolItem* pState,
const bool bIsEnabled) SAL_OVERRIDE;
- SfxBindings* GetBindings() { return mpBindings;}
-
// constructor/destuctor
ChartElementsPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings, ChartController* pController);
+ ChartController* pController);
virtual ~ChartElementsPanel();
virtual void dispose() SAL_OVERRIDE;
@@ -96,7 +94,6 @@ private:
css::uno::Reference<css::frame::XFrame> mxFrame;
::sfx2::sidebar::EnumContext maContext;
- SfxBindings* mpBindings;
css::uno::Reference<css::frame::XModel> mxModel;
css::uno::Reference<css::util::XModifyListener> mxListener;
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
index c42407cb1798..8341fc78f230 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
@@ -238,12 +238,9 @@ void setAttachedAxisType(css::uno::Reference<css::frame::XModel>
ChartSeriesPanel::ChartSeriesPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings,
ChartController* pController)
: PanelLayout(pParent, "ChartSeriesPanel", "modules/schart/ui/sidebarseries.ui", rxFrame),
mxFrame(rxFrame),
- maContext(),
- mpBindings(pBindings),
mxModel(pController->getModel()),
mxListener(new ChartSidebarModifyListener(this))
{
@@ -336,17 +333,15 @@ void ChartSeriesPanel::updateData()
VclPtr<vcl::Window> ChartSeriesPanel::Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings, ChartController* pController)
+ ChartController* pController)
{
if (pParent == NULL)
throw lang::IllegalArgumentException("no parent Window given to ChartSeriesPanel::Create", NULL, 0);
if ( ! rxFrame.is())
throw lang::IllegalArgumentException("no XFrame given to ChartSeriesPanel::Create", NULL, 1);
- if (pBindings == NULL)
- throw lang::IllegalArgumentException("no SfxBindings given to ChartSeriesPanel::Create", NULL, 2);
return VclPtr<ChartSeriesPanel>::Create(
- pParent, rxFrame, pBindings, pController);
+ pParent, rxFrame, pController);
}
void ChartSeriesPanel::DataChanged(
@@ -356,9 +351,8 @@ void ChartSeriesPanel::DataChanged(
}
void ChartSeriesPanel::HandleContextChange(
- const ::sfx2::sidebar::EnumContext& rContext)
+ const ::sfx2::sidebar::EnumContext& )
{
- maContext = rContext;
updateData();
}
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
index 32cce9551c57..a19ecb22323a 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
@@ -46,7 +46,7 @@ public:
static VclPtr<vcl::Window> Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings, ChartController* pController);
+ ChartController* pController);
virtual void DataChanged(
const DataChangedEvent& rEvent) SAL_OVERRIDE;
@@ -60,13 +60,11 @@ public:
const SfxPoolItem* pState,
const bool bIsEnabled) SAL_OVERRIDE;
- SfxBindings* GetBindings() { return mpBindings;}
-
// constructor/destuctor
ChartSeriesPanel(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings, ChartController* pController);
+ ChartController* pController);
virtual ~ChartSeriesPanel();
virtual void dispose() SAL_OVERRIDE;
@@ -86,8 +84,6 @@ private:
VclPtr<ListBox> mpLBLabelPlacement;
css::uno::Reference<css::frame::XFrame> mxFrame;
- ::sfx2::sidebar::EnumContext maContext;
- SfxBindings* mpBindings;
css::uno::Reference<css::frame::XModel> mxModel;
css::uno::Reference<css::util::XModifyListener> mxListener;