summaryrefslogtreecommitdiff
path: root/sc/source/ui/inc
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/inc')
-rw-r--r--sc/source/ui/inc/asciiopt.hxx2
-rw-r--r--sc/source/ui/inc/csvtablebox.hxx2
-rw-r--r--sc/source/ui/inc/scuiasciiopt.hxx14
3 files changed, 13 insertions, 5 deletions
diff --git a/sc/source/ui/inc/asciiopt.hxx b/sc/source/ui/inc/asciiopt.hxx
index 6028b8825d94..af97d4b0f2ba 100644
--- a/sc/source/ui/inc/asciiopt.hxx
+++ b/sc/source/ui/inc/asciiopt.hxx
@@ -52,7 +52,7 @@ public:
static const sal_Unicode cDefaultTextSep = '"';
- void ReadFromString( std::u16string_view rString );
+ void ReadFromString( std::u16string_view rString, SvStream* pStream4Detect = nullptr );
OUString WriteToString() const;
rtl_TextEncoding GetCharSet() const { return eCharSet; }
diff --git a/sc/source/ui/inc/csvtablebox.hxx b/sc/source/ui/inc/csvtablebox.hxx
index e2392a478f4c..9d626493fd54 100644
--- a/sc/source/ui/inc/csvtablebox.hxx
+++ b/sc/source/ui/inc/csvtablebox.hxx
@@ -72,10 +72,12 @@ public:
// common table box handling ----------------------------------------------
public:
+ void Refresh();
/** Sets the control to separators mode. */
void SetSeparatorsMode();
/** Sets the control to fixed width mode. */
void SetFixedWidthMode();
+ bool IsFixedWidthMode(){ return mbFixedMode; }
ScCsvRuler& GetRuler() { return *mxRuler; }
ScCsvGrid& GetGrid() { return *mxGrid; }
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();