summaryrefslogtreecommitdiff
path: root/sc/source/ui/inc/scuiasciiopt.hxx
diff options
context:
space:
mode:
authorGabriel Masei <gabriel.masei@1and1.ro>2024-04-09 13:07:18 +0300
committerAndras Timar <andras.timar@collabora.com>2024-10-09 14:49:11 +0200
commit565b619d57a3b98b0826c4b49dee6606f9ae70e0 (patch)
treec2fa077a576ce94a2fa5131c19c84bee84faa21d /sc/source/ui/inc/scuiasciiopt.hxx
parent2f1dcf01d713f786ed1bfdc2ba3b6c9e06fb8ecf (diff)
tdf#160582 Preserve settings saving in csv import dialog
Also, improve detection algorithm by replacing the limit of 20 lines with a time limit of 500ms. Change-Id: Iac519b6ebe675b91ce84b900646d9d320ea9ddc1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165905 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sc/source/ui/inc/scuiasciiopt.hxx')
-rw-r--r--sc/source/ui/inc/scuiasciiopt.hxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx
index ee8ca78b221d..5b19b8c4d3ee 100644
--- a/sc/source/ui/inc/scuiasciiopt.hxx
+++ b/sc/source/ui/inc/scuiasciiopt.hxx
@@ -31,29 +31,34 @@ class SvxTextEncodingBox;
class ScImportAsciiDlg : public weld::GenericDialogController
{
- SvStream* mpDatStream;
+ SvStream* mpDatStream;
sal_uLong mnStreamPos;
+ sal_uLong mnStreamInitPos;
std::unique_ptr<sal_uLong[]> mpRowPosArray;
sal_uLong mnRowPosCount;
OUString maPreviewLine[ CSV_PREVIEW_LINES ];
OUString maFieldSeparators; // selected field separators
+ OUString maDetectedFieldSeps; // detected field seps
sal_Unicode mcTextSep;
rtl_TextEncoding meCharSet; /// Selected char set.
+ rtl_TextEncoding meDetectedCharSet; /// This is computed only once at initialization, so store it.
bool mbCharSetSystem; /// Is System char set selected?
+ bool mbCharSetDetect; /// Should we autodetect character set ?
ScImportAsciiCall meCall; /// How the dialog is called (see asciiopt.hxx)
- bool mbDetectSep; /// Whether to detect a possible separator.
std::unique_ptr<weld::Label> mxFtCharSet;
std::unique_ptr<SvxTextEncodingBox> mxLbCharSet;
+ std::unique_ptr<weld::Label> mxFtDetectedCharSet;
std::unique_ptr<weld::Label> mxFtCustomLang;
std::unique_ptr<SvxLanguageBox> mxLbCustomLang;
std::unique_ptr<weld::Label> mxFtRow;
std::unique_ptr<weld::SpinButton> mxNfRow;
+ std::unique_ptr<weld::RadioButton> mxRbDetectSep;
std::unique_ptr<weld::RadioButton> mxRbFixed;
std::unique_ptr<weld::RadioButton> mxRbSeparated;
@@ -83,8 +88,7 @@ class ScImportAsciiDlg : public weld::GenericDialogController
public:
ScImportAsciiDlg(
weld::Window* pParent, std::u16string_view aDatName,
- SvStream* pInStream, ScImportAsciiCall eCall,
- const ScAsciiOptions* aOptions = nullptr );
+ SvStream* pInStream, ScImportAsciiCall eCall);
virtual ~ScImportAsciiDlg() override;
void GetOptions( ScAsciiOptions& rOpt );
@@ -98,6 +102,8 @@ private:
void SetSeparators( sal_Unicode cSep );
/** Returns all separator characters in a string. */
OUString GetSeparators() const;
+ OUString GetActiveSeparators() const;
+ void DetectCsvSeparators();
/** Enables or disables all separator checkboxes and edit fields. */
void SetupSeparatorCtrls();