[Libreoffice-commits] core.git: chart2/Library_chartcontroller.mk chart2/source
Muhammet Kara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Nov 14 07:43:17 UTC 2019
chart2/Library_chartcontroller.mk | 1
chart2/source/controller/dialogs/ChartResourceGroupDlgs.cxx | 131 ++++++++++++
chart2/source/controller/dialogs/ChartResourceGroups.cxx | 99 ---------
chart2/source/controller/dialogs/tp_ChartType.cxx | 1
chart2/source/inc/ChartResourceGroupDlgs.hxx | 65 +++++
chart2/source/inc/ChartResourceGroups.hxx | 42 ---
6 files changed, 205 insertions(+), 134 deletions(-)
New commits:
commit b59f58475d83345463c763497b8aa2260f42fa94
Author: Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Thu Nov 14 09:59:19 2019 +0300
Commit: Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Thu Nov 14 08:42:15 2019 +0100
Move SplinePropertiesDialog & SteppedPropertiesDialog to reuse
Change-Id: I2937c617bed0d000734784301421237f282014e9
ecefe02a664e6a6852cf132d615c20e56e580e92
Reviewed-on: https://gerrit.libreoffice.org/82124
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Muhammet Kara <muhammet.kara at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/82648
Tested-by: Jenkins
diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk
index e57a170a80c7..351dcbf0250d 100644
--- a/chart2/Library_chartcontroller.mk
+++ b/chart2/Library_chartcontroller.mk
@@ -86,6 +86,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/chartapiwrapper/WrappedSymbolProperties \
chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty \
chart2/source/controller/dialogs/ChangingResource \
+ chart2/source/controller/dialogs/ChartResourceGroupDlgs \
chart2/source/controller/dialogs/ChartResourceGroups \
chart2/source/controller/dialogs/ChartTypeDialogController \
chart2/source/controller/dialogs/DataBrowser \
diff --git a/chart2/source/controller/dialogs/ChartResourceGroupDlgs.cxx b/chart2/source/controller/dialogs/ChartResourceGroupDlgs.cxx
new file mode 100644
index 000000000000..91307afaad3d
--- /dev/null
+++ b/chart2/source/controller/dialogs/ChartResourceGroupDlgs.cxx
@@ -0,0 +1,131 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <ChartResourceGroupDlgs.hxx>
+#include <ChartTypeDialogController.hxx>
+
+#include <strings.hrc>
+#include <ResId.hxx>
+
+namespace chart
+{
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
+
+const sal_uInt16 CUBIC_SPLINE_POS = 0;
+const sal_uInt16 B_SPLINE_POS = 1;
+
+SplinePropertiesDialog::SplinePropertiesDialog(weld::Window* pParent)
+ : GenericDialogController(pParent, "modules/schart/ui/smoothlinesdlg.ui", "SmoothLinesDialog")
+ , m_xLB_Spline_Type(m_xBuilder->weld_combo_box("SplineTypeComboBox"))
+ , m_xMF_SplineResolution(m_xBuilder->weld_spin_button("ResolutionSpinbutton"))
+ , m_xFT_SplineOrder(m_xBuilder->weld_label("PolynomialsLabel"))
+ , m_xMF_SplineOrder(m_xBuilder->weld_spin_button("PolynomialsSpinButton"))
+{
+ m_xDialog->set_title(SchResId(STR_DLG_SMOOTH_LINE_PROPERTIES));
+
+ m_xLB_Spline_Type->connect_changed(LINK(this, SplinePropertiesDialog, SplineTypeListBoxHdl));
+}
+
+void SplinePropertiesDialog::fillControls(const ChartTypeParameter& rParameter)
+{
+ switch (rParameter.eCurveStyle)
+ {
+ case CurveStyle_CUBIC_SPLINES:
+ m_xLB_Spline_Type->set_active(CUBIC_SPLINE_POS);
+ break;
+ case CurveStyle_B_SPLINES:
+ m_xLB_Spline_Type->set_active(B_SPLINE_POS);
+ break;
+ default:
+ m_xLB_Spline_Type->set_active(CUBIC_SPLINE_POS);
+ break;
+ }
+ m_xMF_SplineOrder->set_value(rParameter.nSplineOrder);
+ m_xMF_SplineResolution->set_value(rParameter.nCurveResolution);
+
+ //dis/enabling
+ m_xFT_SplineOrder->set_sensitive(m_xLB_Spline_Type->get_active() == B_SPLINE_POS);
+ m_xMF_SplineOrder->set_sensitive(m_xLB_Spline_Type->get_active() == B_SPLINE_POS);
+}
+
+void SplinePropertiesDialog::fillParameter(ChartTypeParameter& rParameter, bool bSmoothLines)
+{
+ if (!bSmoothLines)
+ rParameter.eCurveStyle = CurveStyle_LINES;
+ else if (m_xLB_Spline_Type->get_active() == CUBIC_SPLINE_POS)
+ rParameter.eCurveStyle = CurveStyle_CUBIC_SPLINES;
+ else if (m_xLB_Spline_Type->get_active() == B_SPLINE_POS)
+ rParameter.eCurveStyle = CurveStyle_B_SPLINES;
+
+ rParameter.nCurveResolution = m_xMF_SplineResolution->get_value();
+ rParameter.nSplineOrder = m_xMF_SplineOrder->get_value();
+}
+
+IMPL_LINK_NOARG(SplinePropertiesDialog, SplineTypeListBoxHdl, weld::ComboBox&, void)
+{
+ m_xFT_SplineOrder->set_sensitive(m_xLB_Spline_Type->get_active() == B_SPLINE_POS);
+ m_xMF_SplineOrder->set_sensitive(m_xLB_Spline_Type->get_active() == B_SPLINE_POS);
+}
+
+SteppedPropertiesDialog::SteppedPropertiesDialog(weld::Window* pParent)
+ : GenericDialogController(pParent, "modules/schart/ui/steppedlinesdlg.ui", "SteppedLinesDialog")
+ , m_xRB_Start(m_xBuilder->weld_radio_button("step_start_rb"))
+ , m_xRB_End(m_xBuilder->weld_radio_button("step_end_rb"))
+ , m_xRB_CenterX(m_xBuilder->weld_radio_button("step_center_x_rb"))
+ , m_xRB_CenterY(m_xBuilder->weld_radio_button("step_center_y_rb"))
+{
+ m_xDialog->set_title(SchResId(STR_DLG_STEPPED_LINE_PROPERTIES));
+}
+
+void SteppedPropertiesDialog::fillControls(const ChartTypeParameter& rParameter)
+{
+ switch (rParameter.eCurveStyle)
+ {
+ case CurveStyle_STEP_END:
+ m_xRB_End->set_active(true);
+ break;
+ case CurveStyle_STEP_CENTER_X:
+ m_xRB_CenterX->set_active(true);
+ break;
+ case CurveStyle_STEP_CENTER_Y:
+ m_xRB_CenterY->set_active(true);
+ break;
+ default: // includes CurveStyle_STEP_START
+ m_xRB_Start->set_active(true);
+ break;
+ }
+}
+void SteppedPropertiesDialog::fillParameter(ChartTypeParameter& rParameter, bool bSteppedLines)
+{
+ if (!bSteppedLines)
+ rParameter.eCurveStyle = CurveStyle_LINES;
+ else if (m_xRB_CenterY->get_active())
+ rParameter.eCurveStyle = CurveStyle_STEP_CENTER_Y;
+ else if (m_xRB_Start->get_active())
+ rParameter.eCurveStyle = CurveStyle_STEP_START;
+ else if (m_xRB_End->get_active())
+ rParameter.eCurveStyle = CurveStyle_STEP_END;
+ else if (m_xRB_CenterX->get_active())
+ rParameter.eCurveStyle = CurveStyle_STEP_CENTER_X;
+}
+
+} //namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/ChartResourceGroups.cxx b/chart2/source/controller/dialogs/ChartResourceGroups.cxx
index 0e449881dc58..2ba46bbad5c8 100644
--- a/chart2/source/controller/dialogs/ChartResourceGroups.cxx
+++ b/chart2/source/controller/dialogs/ChartResourceGroups.cxx
@@ -18,6 +18,10 @@
*/
#include <ChartResourceGroups.hxx>
+#include <ChartResourceGroupDlgs.hxx>
+
+#include <strings.hrc>
+#include <ResId.hxx>
namespace chart
{
@@ -188,101 +192,6 @@ IMPL_LINK_NOARG(StackingResourceGroup, StackingEnableHdl, weld::ToggleButton&, v
m_pChangeListener->stateChanged();
}
-SplinePropertiesDialog::SplinePropertiesDialog(weld::Window* pParent)
- : GenericDialogController(pParent, "modules/schart/ui/smoothlinesdlg.ui", "SmoothLinesDialog")
- , m_xLB_Spline_Type(m_xBuilder->weld_combo_box("SplineTypeComboBox"))
- , m_xMF_SplineResolution(m_xBuilder->weld_spin_button("ResolutionSpinbutton"))
- , m_xFT_SplineOrder(m_xBuilder->weld_label("PolynomialsLabel"))
- , m_xMF_SplineOrder(m_xBuilder->weld_spin_button("PolynomialsSpinButton"))
-{
- m_xDialog->set_title(SchResId(STR_DLG_SMOOTH_LINE_PROPERTIES));
-
- m_xLB_Spline_Type->connect_changed(LINK(this, SplinePropertiesDialog, SplineTypeListBoxHdl));
-}
-
-void SplinePropertiesDialog::fillControls(const ChartTypeParameter& rParameter)
-{
- switch (rParameter.eCurveStyle)
- {
- case CurveStyle_CUBIC_SPLINES:
- m_xLB_Spline_Type->set_active(CUBIC_SPLINE_POS);
- break;
- case CurveStyle_B_SPLINES:
- m_xLB_Spline_Type->set_active(B_SPLINE_POS);
- break;
- default:
- m_xLB_Spline_Type->set_active(CUBIC_SPLINE_POS);
- break;
- }
- m_xMF_SplineOrder->set_value(rParameter.nSplineOrder);
- m_xMF_SplineResolution->set_value(rParameter.nCurveResolution);
-
- //dis/enabling
- m_xFT_SplineOrder->set_sensitive(m_xLB_Spline_Type->get_active() == B_SPLINE_POS);
- m_xMF_SplineOrder->set_sensitive(m_xLB_Spline_Type->get_active() == B_SPLINE_POS);
-}
-
-void SplinePropertiesDialog::fillParameter(ChartTypeParameter& rParameter, bool bSmoothLines)
-{
- if (!bSmoothLines)
- rParameter.eCurveStyle = CurveStyle_LINES;
- else if (m_xLB_Spline_Type->get_active() == CUBIC_SPLINE_POS)
- rParameter.eCurveStyle = CurveStyle_CUBIC_SPLINES;
- else if (m_xLB_Spline_Type->get_active() == B_SPLINE_POS)
- rParameter.eCurveStyle = CurveStyle_B_SPLINES;
-
- rParameter.nCurveResolution = m_xMF_SplineResolution->get_value();
- rParameter.nSplineOrder = m_xMF_SplineOrder->get_value();
-}
-
-IMPL_LINK_NOARG(SplinePropertiesDialog, SplineTypeListBoxHdl, weld::ComboBox&, void)
-{
- m_xFT_SplineOrder->set_sensitive(m_xLB_Spline_Type->get_active() == B_SPLINE_POS);
- m_xMF_SplineOrder->set_sensitive(m_xLB_Spline_Type->get_active() == B_SPLINE_POS);
-}
-
-SteppedPropertiesDialog::SteppedPropertiesDialog(weld::Window* pParent)
- : GenericDialogController(pParent, "modules/schart/ui/steppedlinesdlg.ui", "SteppedLinesDialog")
- , m_xRB_Start(m_xBuilder->weld_radio_button("step_start_rb"))
- , m_xRB_End(m_xBuilder->weld_radio_button("step_end_rb"))
- , m_xRB_CenterX(m_xBuilder->weld_radio_button("step_center_x_rb"))
- , m_xRB_CenterY(m_xBuilder->weld_radio_button("step_center_y_rb"))
-{
- m_xDialog->set_title(SchResId(STR_DLG_STEPPED_LINE_PROPERTIES));
-}
-
-void SteppedPropertiesDialog::fillControls(const ChartTypeParameter& rParameter)
-{
- switch (rParameter.eCurveStyle)
- {
- case CurveStyle_STEP_END:
- m_xRB_End->set_active(true);
- break;
- case CurveStyle_STEP_CENTER_X:
- m_xRB_CenterX->set_active(true);
- break;
- case CurveStyle_STEP_CENTER_Y:
- m_xRB_CenterY->set_active(true);
- break;
- default: // includes CurveStyle_STEP_START
- m_xRB_Start->set_active(true);
- break;
- }
-}
-void SteppedPropertiesDialog::fillParameter(ChartTypeParameter& rParameter, bool bSteppedLines)
-{
- if (!bSteppedLines)
- rParameter.eCurveStyle = CurveStyle_LINES;
- else if (m_xRB_CenterY->get_active())
- rParameter.eCurveStyle = CurveStyle_STEP_CENTER_Y;
- else if (m_xRB_Start->get_active())
- rParameter.eCurveStyle = CurveStyle_STEP_START;
- else if (m_xRB_End->get_active())
- rParameter.eCurveStyle = CurveStyle_STEP_END;
- else if (m_xRB_CenterX->get_active())
- rParameter.eCurveStyle = CurveStyle_STEP_CENTER_X;
-}
-
SplineResourceGroup::SplineResourceGroup(weld::Builder* pBuilder, weld::Window* pParent)
: ChangingResource()
, m_pParent(pParent)
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 98a44f8f24f7..293f4658d2b0 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -18,6 +18,7 @@
*/
#include "tp_ChartType.hxx"
+#include <ChartResourceGroupDlgs.hxx>
#include <ChartResourceGroups.hxx>
#include <strings.hrc>
#include <ResId.hxx>
diff --git a/chart2/source/inc/ChartResourceGroupDlgs.hxx b/chart2/source/inc/ChartResourceGroupDlgs.hxx
new file mode 100644
index 000000000000..755e7af15345
--- /dev/null
+++ b/chart2/source/inc/ChartResourceGroupDlgs.hxx
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_CHART2_SOURCE_CHARTRESOURCEGROUPDLGS_HXX
+#define INCLUDED_CHART2_SOURCE_CHARTRESOURCEGROUPDLGS_HXX
+
+#include <vcl/weld.hxx>
+
+namespace chart
+{
+class ChartTypeParameter;
+
+class SplinePropertiesDialog : public weld::GenericDialogController
+{
+public:
+ explicit SplinePropertiesDialog(weld::Window* pParent);
+
+ void fillControls(const ChartTypeParameter& rParameter);
+ void fillParameter(ChartTypeParameter& rParameter, bool bSmoothLines);
+
+private:
+ DECL_LINK(SplineTypeListBoxHdl, weld::ComboBox&, void);
+
+private:
+ std::unique_ptr<weld::ComboBox> m_xLB_Spline_Type;
+ std::unique_ptr<weld::SpinButton> m_xMF_SplineResolution;
+ std::unique_ptr<weld::Label> m_xFT_SplineOrder;
+ std::unique_ptr<weld::SpinButton> m_xMF_SplineOrder;
+};
+
+class SteppedPropertiesDialog : public weld::GenericDialogController
+{
+public:
+ explicit SteppedPropertiesDialog(weld::Window* pParent);
+
+ void fillControls(const ChartTypeParameter& rParameter);
+ void fillParameter(ChartTypeParameter& rParameter, bool bSteppedLines);
+
+private:
+ std::unique_ptr<weld::RadioButton> m_xRB_Start;
+ std::unique_ptr<weld::RadioButton> m_xRB_End;
+ std::unique_ptr<weld::RadioButton> m_xRB_CenterX;
+ std::unique_ptr<weld::RadioButton> m_xRB_CenterY;
+};
+
+} //namespace chart
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/ChartResourceGroups.hxx b/chart2/source/inc/ChartResourceGroups.hxx
index 3e04fe1f1d81..6e474992dda7 100644
--- a/chart2/source/inc/ChartResourceGroups.hxx
+++ b/chart2/source/inc/ChartResourceGroups.hxx
@@ -20,9 +20,6 @@
#ifndef INCLUDED_CHART2_SOURCE_CHARTRESOURCEGROUPS_HXX
#define INCLUDED_CHART2_SOURCE_CHARTRESOURCEGROUPS_HXX
-#include <strings.hrc>
-#include "ResId.hxx"
-
#include "res_BarGeometry.hxx"
#include "ChangingResource.hxx"
#include "ChartTypeDialogController.hxx"
@@ -36,6 +33,9 @@ namespace chart
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
+class SplinePropertiesDialog;
+class SteppedPropertiesDialog;
+
enum
{
POS_3DSCHEME_SIMPLE = 0,
@@ -99,42 +99,6 @@ private:
std::unique_ptr<weld::RadioButton> m_xRB_Stack_Z;
};
-class SplinePropertiesDialog : public weld::GenericDialogController
-{
-public:
- explicit SplinePropertiesDialog(weld::Window* pParent);
-
- void fillControls(const ChartTypeParameter& rParameter);
- void fillParameter(ChartTypeParameter& rParameter, bool bSmoothLines);
-
-private:
- DECL_LINK(SplineTypeListBoxHdl, weld::ComboBox&, void);
-
-private:
- std::unique_ptr<weld::ComboBox> m_xLB_Spline_Type;
- std::unique_ptr<weld::SpinButton> m_xMF_SplineResolution;
- std::unique_ptr<weld::Label> m_xFT_SplineOrder;
- std::unique_ptr<weld::SpinButton> m_xMF_SplineOrder;
-};
-
-const sal_uInt16 CUBIC_SPLINE_POS = 0;
-const sal_uInt16 B_SPLINE_POS = 1;
-
-class SteppedPropertiesDialog : public weld::GenericDialogController
-{
-public:
- explicit SteppedPropertiesDialog(weld::Window* pParent);
-
- void fillControls(const ChartTypeParameter& rParameter);
- void fillParameter(ChartTypeParameter& rParameter, bool bSteppedLines);
-
-private:
- std::unique_ptr<weld::RadioButton> m_xRB_Start;
- std::unique_ptr<weld::RadioButton> m_xRB_End;
- std::unique_ptr<weld::RadioButton> m_xRB_CenterX;
- std::unique_ptr<weld::RadioButton> m_xRB_CenterY;
-};
-
#define POS_LINETYPE_STRAIGHT 0
#define POS_LINETYPE_SMOOTH 1
#define POS_LINETYPE_STEPPED 2
More information about the Libreoffice-commits
mailing list