diff options
author | Laurent Balland <laurent.balland@mailo.fr> | 2023-06-03 14:52:45 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2023-06-27 17:41:43 +0200 |
commit | 983644d061e1415c7c5554dd6fd51fe1043e9b9a (patch) | |
tree | b6518fb0a187eeedb0c8aab325c7372af6420d78 /sc/source/ui/dbgui | |
parent | 8ef4d3a4160af967937e9bb7c60bee4a8eb71a1b (diff) |
Import CSV: remove erroneous warning
If Fixed width is selected, clicking on any option in Other section generates a
warning about option not allowed, which is wrong. Only checkboxes in
Seprator section are not allowed
Change-Id: I3fc6fd6ac870e8c681aae8fd1d033b550d9bc20d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152573
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/ui/dbgui')
-rw-r--r-- | sc/source/ui/dbgui/scuiasciiopt.cxx | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index 61fa2d697251..601323a6586d 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -506,20 +506,21 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, std::u16string_view aD mcTextSep = lcl_CharFromCombo(*mxCbTextSep, SCSTR_TEXTSEP); Link<weld::Toggleable&,void> aSeparatorClickHdl =LINK( this, ScImportAsciiDlg, SeparatorClickHdl ); + Link<weld::Toggleable&,void> aOtherOptionsClickHdl =LINK( this, ScImportAsciiDlg, OtherOptionsClickHdl ); mxCbTextSep->connect_changed( LINK( this, ScImportAsciiDlg, SeparatorComboBoxHdl ) ); mxCkbTab->connect_toggled( aSeparatorClickHdl ); mxCkbSemicolon->connect_toggled( aSeparatorClickHdl ); mxCkbComma->connect_toggled( aSeparatorClickHdl ); mxCkbAsOnce->connect_toggled( aSeparatorClickHdl ); - mxCkbQuotedAsText->connect_toggled( aSeparatorClickHdl ); - mxCkbDetectNumber->connect_toggled( aSeparatorClickHdl ); - mxCkbDetectScientificNumber->connect_toggled( aSeparatorClickHdl ); - mxCkbEvaluateFormulas->connect_toggled( aSeparatorClickHdl ); - mxCkbSkipEmptyCells->connect_toggled( aSeparatorClickHdl ); mxCkbSpace->connect_toggled( aSeparatorClickHdl ); mxCkbRemoveSpace->connect_toggled( aSeparatorClickHdl ); mxCkbOther->connect_toggled( aSeparatorClickHdl ); mxEdOther->connect_changed(LINK(this, ScImportAsciiDlg, SeparatorEditHdl)); + mxCkbQuotedAsText->connect_toggled( aOtherOptionsClickHdl ); + mxCkbDetectNumber->connect_toggled( aOtherOptionsClickHdl ); + mxCkbDetectScientificNumber->connect_toggled( aOtherOptionsClickHdl ); + mxCkbEvaluateFormulas->connect_toggled( aOtherOptionsClickHdl ); + mxCkbSkipEmptyCells->connect_toggled( aOtherOptionsClickHdl ); // *** text encoding ListBox *** // all encodings allowed, including Unicode, but subsets are excluded @@ -837,12 +838,9 @@ IMPL_LINK( ScImportAsciiDlg, SeparatorEditHdl, weld::Entry&, rEdit, void ) SeparatorHdl(&rEdit); } -void ScImportAsciiDlg::SeparatorHdl(const weld::Widget* pCtrl) +IMPL_LINK(ScImportAsciiDlg, OtherOptionsClickHdl, weld::Toggleable&, rCtrl, void) { - OSL_ENSURE( pCtrl, "ScImportAsciiDlg::SeparatorHdl - missing sender" ); - OSL_ENSURE( !mxRbFixed->get_active(), "ScImportAsciiDlg::SeparatorHdl - not allowed in fixed width" ); - - if (pCtrl == mxCkbDetectNumber.get()) + if (&rCtrl == mxCkbDetectNumber.get()) { if (mxCkbDetectNumber->get_active()) { @@ -853,6 +851,13 @@ void ScImportAsciiDlg::SeparatorHdl(const weld::Widget* pCtrl) mxCkbDetectScientificNumber->set_sensitive(true); return; } +} + +void ScImportAsciiDlg::SeparatorHdl(const weld::Widget* pCtrl) +{ + OSL_ENSURE( pCtrl, "ScImportAsciiDlg::SeparatorHdl - missing sender" ); + OSL_ENSURE( !mxRbFixed->get_active(), "ScImportAsciiDlg::SeparatorHdl - not allowed in fixed width" ); + /* #i41550# First update state of the controls. The GetSeparators() function needs final state of the check boxes. */ if (pCtrl == mxCkbOther.get() && mxCkbOther->get_active()) |