20#include <core_resource.hxx>
36OUString lcl_getListEntry(std::u16string_view rStr, sal_Int32& rIdx)
41 size_t nFnd = rStr.find(
'\t', rIdx);
42 if (nFnd == std::u16string_view::npos)
47 if (rIdx >=
static_cast<sal_Int32
>(rStr.size()))
60 : m_aFieldSeparatorList (
DBA_RES(STR_AUTOFIELDSEPARATORLIST))
62 , m_aTextNone (
DBA_RES(STR_AUTOTEXT_FIELD_SEP_NONE))
63 , m_nAvailableSections( _nAvailableSections )
64 , m_xBuilder(
Application::CreateBuilder(pParent,
"dbaccess/ui/textpage.ui"))
66 , m_xExtensionHeader(m_xBuilder->weld_widget(
"extensionframe"))
67 , m_xAccessTextFiles(m_xBuilder->weld_radio_button(
"textfile"))
68 , m_xAccessCSVFiles(m_xBuilder->weld_radio_button(
"csvfile"))
69 , m_xAccessOtherFiles(m_xBuilder->weld_radio_button(
"custom"))
70 , m_xOwnExtension(m_xBuilder->weld_entry(
"extension"))
71 , m_xExtensionExample(m_xBuilder->weld_label(
"example"))
72 , m_xFormatHeader(m_xBuilder->weld_widget(
"formatframe"))
73 , m_xFieldSeparatorLabel(m_xBuilder->weld_label(
"fieldlabel"))
74 , m_xFieldSeparator(m_xBuilder->weld_combo_box(
"fieldseparator"))
75 , m_xTextSeparatorLabel(m_xBuilder->weld_label(
"textlabel"))
76 , m_xTextSeparator(m_xBuilder->weld_combo_box(
"textseparator"))
77 , m_xDecimalSeparatorLabel(m_xBuilder->weld_label(
"decimallabel"))
78 , m_xDecimalSeparator(m_xBuilder->weld_combo_box(
"decimalseparator"))
79 , m_xThousandsSeparatorLabel(m_xBuilder->weld_label(
"thousandslabel"))
80 , m_xThousandsSeparator(m_xBuilder->weld_combo_box(
"thousandsseparator"))
81 , m_xRowHeader(m_xBuilder->weld_check_button(
"containsheaders"))
82 , m_xCharSetHeader(m_xBuilder->weld_widget(
"charsetframe"))
83 , m_xCharSetLabel(m_xBuilder->weld_label(
"charsetlabel"))
84 , m_xCharSet(new
CharSetListBox(m_xBuilder->weld_combo_box(
"charset")))
86 for(sal_Int32 nIdx {0}; nIdx>=0;)
89 for(sal_Int32 nIdx {0}; nIdx>=0;)
99 struct SectionDescriptor
103 }
const aSections[] = {
110 for (
auto const &
section: aSections)
127 m_aGetExtensionHandler.Call(
this);
132 bool bDoEnable = m_xAccessOtherFiles->get_active();
133 m_xOwnExtension->set_sensitive(bDoEnable);
134 m_xExtensionExample->set_sensitive(bDoEnable);
135 m_aGetExtensionHandler.Call(
this);
193 m_xCharSet->SelectEntryByIanaName( pCharsetItem->GetValue() );
203 if(aDelText.isEmpty())
205 aErrorText =
DBA_RES(STR_AUTODELIMITER_MISSING);
211 aErrorText =
DBA_RES(STR_AUTODELIMITER_MISSING);
217 aErrorText =
DBA_RES(STR_AUTODELIMITER_MUST_DIFFER);
224 aErrorText =
DBA_RES(STR_AUTODELIMITER_MUST_DIFFER);
231 aErrorText =
DBA_RES(STR_AUTODELIMITER_MUST_DIFFER);
238 aErrorText =
DBA_RES(STR_AUTODELIMITER_MUST_DIFFER);
245 aErrorText =
DBA_RES(STR_AUTODELIMITER_MUST_DIFFER);
252 aErrorText =
DBA_RES(STR_AUTODELIMITER_MUST_DIFFER);
257 else if ((sExtension.indexOf(
'*') != -1) || (sExtension.indexOf(
'?') != -1))
259 aErrorText =
DBA_RES(STR_AUTONO_WILDCARDS);
260 aErrorText = aErrorText.replaceFirst(
"#1",sExtension);
266 VclMessageType::Warning, VclButtonsType::Ok,
275 bool bChangedSomething = _bChangedSomething;
283 bChangedSomething =
true;
292 bChangedSomething =
true;
301 bChangedSomething =
true;
306 bChangedSomething =
true;
312 bChangedSomething =
true;
317 bChangedSomething =
true;
324 bChangedSomething =
true;
327 return bChangedSomething;
334 else if (_rVal ==
"csv")
353 if ( sExtension.startsWith(
"*.") )
354 sExtension = sExtension.copy(2);
376 if (rVal.getLength()==1)
379 for(sal_Int32 nIdx {0}; nIdx>=0;)
381 sal_Int32 nPrevIdx {nIdx};
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
const OUString & GetValue() const
static OUString EraseAllMnemonicChars(const OUString &rStr)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
bool FillItemSet(SfxItemSet &rSet, const bool bChangedSomething)
OTextConnectionHelper(weld::Widget *pParent, const short _nAvailableSections)
std::unique_ptr< weld::Widget > m_xFormatHeader
std::unique_ptr< weld::Entry > m_xOwnExtension
void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList)
std::unique_ptr< weld::Widget > m_xCharSetHeader
void SetExtension(const OUString &_rVal)
OUString GetExtension() const
std::unique_ptr< weld::ComboBox > m_xDecimalSeparator
std::unique_ptr< weld::Label > m_xExtensionExample
short m_nAvailableSections
to be called if a new type is selected
void implInitControls(const SfxItemSet &_rSet, bool _bValid)
std::unique_ptr< weld::RadioButton > m_xAccessCSVFiles
std::unique_ptr< weld::ComboBox > m_xFieldSeparator
OUString m_aFieldSeparatorList
std::unique_ptr< weld::RadioButton > m_xAccessTextFiles
std::unique_ptr< CharSetListBox > m_xCharSet
void SetSeparator(weld::ComboBox &rBox, std::u16string_view rList, const OUString &rVal)
std::unique_ptr< weld::Widget > m_xExtensionHeader
std::unique_ptr< weld::Label > m_xDecimalSeparatorLabel
std::unique_ptr< weld::Label > m_xThousandsSeparatorLabel
std::unique_ptr< weld::Label > m_xCharSetLabel
std::unique_ptr< weld::ComboBox > m_xTextSeparator
OUString GetSeparator(const weld::ComboBox &rBox, std::u16string_view rList)
std::unique_ptr< weld::ComboBox > m_xThousandsSeparator
std::unique_ptr< weld::RadioButton > m_xAccessOtherFiles
std::unique_ptr< weld::Widget > m_xContainer
std::unique_ptr< weld::Label > m_xFieldSeparatorLabel
std::unique_ptr< weld::Label > m_xTextSeparatorLabel
std::unique_ptr< weld::CheckButton > m_xRowHeader
void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList)
OUString m_aTextSeparatorList
virtual int find_text(const OUString &rStr) const=0
virtual OUString get_active_text() const=0
virtual void set_entry_text(const OUString &rStr)=0
virtual int get_count() const=0
#define DSID_DECIMALDELIMITER
#define DSID_THOUSANDSDELIMITER
#define DSID_TEXTFILEEXTENSION
#define DSID_FIELDDELIMITER
#define DSID_TEXTFILEHEADER
#define DSID_TEXTDELIMITER
#define LINK(Instance, Class, Member)
IMPL_LINK_NOARG(OApplicationController, OnClipboardChanged, TransferableDataHelper *, void)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
Reference< XNameAccess > m_xContainer
constexpr OUStringLiteral STR_AUTOTEXTSEPARATORLIST