Kaydet (Commit) 11300c48 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#121246 crash in chart dialogs

Change-Id: I3bc720e44f5ea15749e6bc0f0fada3a17a783e23
Reviewed-on: https://gerrit.libreoffice.org/63463
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 41d58883
......@@ -20,9 +20,6 @@
#define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_AXISPOSITIONS_HXX
#include <sfx2/tabdlg.hxx>
#include <vcl/fmtfield.hxx>
#include <vcl/button.hxx>
#include <vcl/lstbox.hxx>
namespace chart
{
......@@ -30,9 +27,8 @@ namespace chart
class AxisPositionsTabPage : public SfxTabPage
{
public:
AxisPositionsTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
AxisPositionsTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~AxisPositionsTabPage() override;
virtual void dispose() override;
static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rInAttrs );
virtual bool FillItemSet( SfxItemSet* rOutAttrs ) override;
......@@ -48,41 +44,35 @@ public:
void SupportAxisPositioning( bool bSupportAxisPositioning );
private: //methods:
DECL_LINK( CrossesAtSelectHdl, ListBox&, void );
DECL_LINK( PlaceLabelsSelectHdl, ListBox&, void );
DECL_LINK(CrossesAtSelectHdl, weld::ComboBox&, void);
DECL_LINK(PlaceLabelsSelectHdl, weld::ComboBox&, void);
private: //member:
VclPtr<VclFrame> m_pFL_AxisLine;
VclPtr<ListBox> m_pLB_CrossesAt;
VclPtr<FormattedField> m_pED_CrossesAt;
VclPtr<ComboBox> m_pED_CrossesAtCategory;
VclPtr<CheckBox> m_pCB_AxisBetweenCategories;
SvNumberFormatter* m_pNumFormatter;
VclPtr<VclFrame> m_pFL_Labels;
VclPtr<ListBox> m_pLB_PlaceLabels;
VclPtr<FormattedField> m_pED_LabelDistance;
bool m_bCrossingAxisIsCategoryAxis;
css::uno::Sequence< OUString > m_aCategories;
VclPtr<CheckBox> m_pCB_TicksInner;
VclPtr<CheckBox> m_pCB_TicksOuter;
bool m_bSupportAxisPositioning;
VclPtr<CheckBox> m_pCB_MinorInner;
VclPtr<CheckBox> m_pCB_MinorOuter;
std::unique_ptr<weld::Frame> m_xFL_AxisLine;
std::unique_ptr<weld::ComboBox> m_xLB_CrossesAt;
std::unique_ptr<weld::FormattedSpinButton> m_xED_CrossesAt;
std::unique_ptr<weld::ComboBox> m_xED_CrossesAtCategory;
std::unique_ptr<weld::CheckButton> m_xCB_AxisBetweenCategories;
VclPtr<VclBox> m_pBxPlaceTicks;
VclPtr<ListBox> m_pLB_PlaceTicks;
std::unique_ptr<weld::Frame> m_xFL_Labels;
std::unique_ptr<weld::ComboBox> m_xLB_PlaceLabels;
std::unique_ptr<weld::FormattedSpinButton> m_xED_LabelDistance;
// Not implemented
// VclPtr<CheckBox> m_pCB_MajorGrid;
// VclPtr<PushButton> m_pPB_MajorGrid;
// VclPtr<CheckBox> m_pCB_MinorGrid;
// VclPtr<PushButton> m_pPB_MinorGrid;
std::unique_ptr<weld::CheckButton> m_xCB_TicksInner;
std::unique_ptr<weld::CheckButton> m_xCB_TicksOuter;
SvNumberFormatter* m_pNumFormatter;
std::unique_ptr<weld::CheckButton> m_xCB_MinorInner;
std::unique_ptr<weld::CheckButton> m_xCB_MinorOuter;
bool m_bCrossingAxisIsCategoryAxis;
css::uno::Sequence< OUString > m_aCategories;
bool m_bSupportAxisPositioning;
std::unique_ptr<weld::Widget> m_xBxPlaceTicks;
std::unique_ptr<weld::ComboBox> m_xLB_PlaceTicks;
};
} //namespace chart
......
......@@ -32,9 +32,8 @@ namespace chart
class ScaleTabPage : public SfxTabPage
{
public:
ScaleTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
ScaleTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~ScaleTabPage() override;
virtual void dispose() override;
static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rInAttrs );
virtual bool FillItemSet( SfxItemSet* rOutAttrs ) override;
......@@ -48,39 +47,6 @@ public:
void ShowAxisOrigin( bool bShowOrigin );
private:
VclPtr<CheckBox> m_pCbxReverse;
VclPtr<CheckBox> m_pCbxLogarithm;
VclPtr<VclBox> m_pBxType;
VclPtr<ListBox> m_pLB_AxisType;
VclPtr<VclGrid> m_pBxMinMax;
VclPtr<FormattedField> m_pFmtFldMin;
VclPtr<CheckBox> m_pCbxAutoMin;
VclPtr<FormattedField> m_pFmtFldMax;
VclPtr<CheckBox> m_pCbxAutoMax;
VclPtr<VclBox> m_pBxResolution;
VclPtr<ListBox> m_pLB_TimeResolution;
VclPtr<CheckBox> m_pCbx_AutoTimeResolution;
VclPtr<FixedText> m_pTxtMain;
VclPtr<FormattedField> m_pFmtFldStepMain;
VclPtr<MetricField> m_pMt_MainDateStep;
VclPtr<ListBox> m_pLB_MainTimeUnit;
VclPtr<CheckBox> m_pCbxAutoStepMain;
VclPtr<FixedText> m_pTxtHelpCount;
VclPtr<FixedText> m_pTxtHelp;
VclPtr<MetricField> m_pMtStepHelp;
VclPtr<ListBox> m_pLB_HelpTimeUnit;
VclPtr<CheckBox> m_pCbxAutoStepHelp;
VclPtr<FormattedField> m_pFmtFldOrigin;
VclPtr<CheckBox> m_pCbxAutoOrigin;
VclPtr<VclBox> m_pBxOrigin;
double fMin;
double fMax;
double fStepMain;
......@@ -95,11 +61,36 @@ private:
bool m_bShowAxisOrigin;
std::unique_ptr<weld::CheckButton> m_xCbxReverse;
std::unique_ptr<weld::CheckButton> m_xCbxLogarithm;
std::unique_ptr<weld::Widget> m_xBxType;
std::unique_ptr<weld::ComboBox> m_xLB_AxisType;
std::unique_ptr<weld::Widget> m_xBxMinMax;
std::unique_ptr<weld::FormattedSpinButton> m_xFmtFldMin;
std::unique_ptr<weld::CheckButton> m_xCbxAutoMin;
std::unique_ptr<weld::FormattedSpinButton> m_xFmtFldMax;
std::unique_ptr<weld::CheckButton> m_xCbxAutoMax;
std::unique_ptr<weld::Widget> m_xBxResolution;
std::unique_ptr<weld::ComboBox> m_xLB_TimeResolution;
std::unique_ptr<weld::CheckButton> m_xCbx_AutoTimeResolution;
std::unique_ptr<weld::Label> m_xTxtMain;
std::unique_ptr<weld::FormattedSpinButton> m_xFmtFldStepMain;
std::unique_ptr<weld::SpinButton> m_xMt_MainDateStep;
std::unique_ptr<weld::ComboBox> m_xLB_MainTimeUnit;
std::unique_ptr<weld::CheckButton> m_xCbxAutoStepMain;
std::unique_ptr<weld::Label> m_xTxtHelpCount;
std::unique_ptr<weld::Label> m_xTxtHelp;
std::unique_ptr<weld::SpinButton> m_xMtStepHelp;
std::unique_ptr<weld::ComboBox> m_xLB_HelpTimeUnit;
std::unique_ptr<weld::CheckButton> m_xCbxAutoStepHelp;
std::unique_ptr<weld::FormattedSpinButton> m_xFmtFldOrigin;
std::unique_ptr<weld::CheckButton> m_xCbxAutoOrigin;
std::unique_ptr<weld::Widget> m_xBxOrigin;
void EnableControls();
DECL_LINK( SelectAxisTypeHdl, ListBox&, void );
DECL_LINK( EnableValueHdl, Button*, void );
DECL_STATIC_LINK( ScaleTabPage, FmtFieldModifiedHdl, Edit&, void);
DECL_LINK(SelectAxisTypeHdl, weld::ComboBox&, void);
DECL_LINK(EnableValueHdl, weld::ToggleButton&, void);
/** shows a warning window due to an invalid input.
......@@ -114,7 +105,7 @@ private:
@return false, if nResIdMessage was 0, true otherwise
*/
bool ShowWarning(const char* pResIdMessage, Control* pControl);
bool ShowWarning(const char* pResIdMessage, weld::Widget* pControl);
void HideAllControls();
};
......
This diff is collapsed.
......@@ -175,9 +175,6 @@
<glade-widget-class title="AutoComplete MultiLine Edit" name="cuilo-AutoCompleteMultiListBox"
generic-name="MultiLineEdit" parent="GtkTextView"
icon-name="widget-gtk-textview"/>
<glade-widget-class title="SvtFormattedField" name="svtlo-FormattedField"
generic-name="Formatted Field" parent="GtkSpinButton"
icon-name="widget-gtk-textentry"/>
<glade-widget-class title="Address MultiLine Edit" name="swuilo-AddressMultiLineEdit"
generic-name="AddressMultiLineEdit" parent="GtkTextView"
icon-name="widget-gtk-textview"/>
......
......@@ -715,6 +715,8 @@ public:
}
virtual void set_formatter(SvNumberFormatter* pFormatter) = 0;
virtual sal_Int32 get_format_key() const = 0;
virtual void set_format_key(sal_Int32 nFormatKey) = 0;
void connect_value_changed(const Link<FormattedSpinButton&, void>& rLink)
{
......
......@@ -29,6 +29,7 @@ chart2/uiconfig/ui/tp_axisLabel.ui://GtkSpinButton[@id='OrientDegree'] no-labell
chart2/uiconfig/ui/tp_axisLabel.ui://GtkLabel[@id='degreeL'] orphan-label
chart2/uiconfig/ui/tp_axisLabel.ui://GtkLabel[@id='labelABCD'] orphan-label
chart2/uiconfig/ui/tp_axisLabel.ui://GtkLabel[@id='textdirL'] orphan-label
chart2/uiconfig/ui/tp_AxisPositions.ui://GtkSpinButton[@id='EDT_CROSSES_OTHER_AXIS_AT'] no-labelled-by
chart2/uiconfig/ui/tp_ChartType.ui://GtkLabel[@id='FT_CAPTION_FOR_WIZARD'] orphan-label
chart2/uiconfig/ui/tp_ChartType.ui://GtkTreeView[@id='charttype:border'] no-labelled-by
chart2/uiconfig/ui/tp_DataLabel.ui://GtkLabel[@id='CT_LABEL_DIAL'] orphan-label
......@@ -50,15 +51,15 @@ chart2/uiconfig/ui/tp_RangeChooser.ui://GtkLabel[@id='FT_CAPTION_FOR_WIZARD'] or
chart2/uiconfig/ui/tp_RangeChooser.ui://GtkLabel[@id='STR_PAGE_DATA_RANGE'] orphan-label
chart2/uiconfig/ui/tp_SeriesToAxis.ui://GtkLabel[@id='FT_MISSING_VALUES'] orphan-label
chart2/uiconfig/ui/tp_Scale.ui://GtkLabel[@id='TXT_STEP_MAIN'] orphan-label
chart2/uiconfig/ui/tp_Scale.ui://GtkSpinButton[@id='MT_MAIN_DATE_STEP:0'] no-labelled-by
chart2/uiconfig/ui/tp_Scale.ui://GtkSpinButton[@id='MT_MAIN_DATE_STEP'] no-labelled-by
chart2/uiconfig/ui/tp_Scale.ui://GtkComboBox[@id='LB_MAIN_TIME_UNIT'] no-labelled-by
chart2/uiconfig/ui/tp_Scale.ui://svtlo-FormattedField[@id='EDT_STEP_MAIN'] no-labelled-by
chart2/uiconfig/ui/tp_Scale.ui://GtkSpinButton[@id='EDT_STEP_MAIN'] no-labelled-by
chart2/uiconfig/ui/tp_Scale.ui://GtkLabel[@id='TXT_STEP_HELP'] orphan-label
chart2/uiconfig/ui/tp_Scale.ui://GtkLabel[@id='TXT_STEP_HELP_COUNT'] orphan-label
chart2/uiconfig/ui/tp_Scale.ui://GtkSpinButton[@id='MT_STEPHELP:0'] no-labelled-by
chart2/uiconfig/ui/tp_Scale.ui://GtkSpinButton[@id='MT_STEPHELP'] no-labelled-by
chart2/uiconfig/ui/tp_Scale.ui://GtkComboBox[@id='LB_HELP_TIME_UNIT'] no-labelled-by
chart2/uiconfig/ui/tp_Scale.ui://GtkLabel[@id='TXT_ORIGIN'] orphan-label
chart2/uiconfig/ui/tp_Scale.ui://svtlo-FormattedField[@id='EDT_ORIGIN:0'] no-labelled-by
chart2/uiconfig/ui/tp_Scale.ui://GtkSpinButton[@id='EDT_ORIGIN'] no-labelled-by
chart2/uiconfig/ui/tp_Trendline.ui://GtkLabel[@id='label3'] orphan-label
chart2/uiconfig/ui/tp_Trendline.ui://GtkSpinButton[@id='degree'] no-labelled-by
chart2/uiconfig/ui/tp_Trendline.ui://GtkLabel[@id='label4'] orphan-label
......
......@@ -2093,6 +2093,11 @@ public:
: SalInstanceEntry(pButton, bTakeOwnership)
, m_xButton(pButton)
{
// #i6278# allow more decimal places than the output format. As
// the numbers shown in the edit fields are used for input, it makes more
// sense to display the values in the input format rather than the output
// format.
m_xButton->UseInputStringForFormatting();
}
virtual double get_value() const override
......@@ -2121,6 +2126,16 @@ public:
{
m_xButton->SetFormatter(pFormatter);
}
virtual sal_Int32 get_format_key() const override
{
return m_xButton->GetFormatKey();
}
virtual void set_format_key(sal_Int32 nFormatKey) override
{
m_xButton->SetFormatKey(nFormatKey);
}
};
class SalInstanceLabel : public SalInstanceWidget, public virtual weld::Label
......
......@@ -320,8 +320,6 @@ FormattedField::FormattedField(vcl::Window* pParent, WinBits nStyle)
{
}
VCL_BUILDER_FACTORY_ARGS(FormattedField, WB_BORDER | WB_SPIN)
void FormattedField::SetText(const OUString& rStr)
{
......
......@@ -4540,7 +4540,7 @@ private:
}
else
{
m_pFormatter->GetOutputString(dVal, m_nFormatKey, sNewText, &m_pLastOutputColor);
m_pFormatter->GetInputLineString(dVal, m_nFormatKey, sNewText);
}
set_text(sNewText);
return true;
......@@ -4658,6 +4658,16 @@ public:
signal_output();
}
virtual sal_Int32 get_format_key() const override
{
return m_nFormatKey;
}
virtual void set_format_key(sal_Int32 nFormatKey) override
{
m_nFormatKey = nFormatKey;
}
virtual ~GtkInstanceFormattedSpinButton() override
{
g_signal_handler_disconnect(m_pButton, m_nInputSignalId);
......
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