22#include <editeng/editids.hrc>
72 FndBox_ aFndBox(
nullptr,
nullptr );
78 FndPara aPara( aSelBoxes, &aFndBox );
86 rY = aFndBox.
GetLines().front()->GetBoxes().size();
92 : GenericDialogController(pParent,
"modules/swriter/ui/sortdialog.ui",
"SortDialog")
94 , m_xColLbl(m_xBuilder->weld_label(
"column"))
95 , m_xKeyCB1(m_xBuilder->weld_check_button(
"key1"))
96 , m_xColEdt1(m_xBuilder->weld_spin_button(
"colsb1"))
97 , m_xTypDLB1(m_xBuilder->weld_combo_box(
"typelb1"))
98 , m_xSortUp1RB(m_xBuilder->weld_radio_button(
"up1"))
99 , m_xSortDn1RB(m_xBuilder->weld_radio_button(
"down1"))
100 , m_xKeyCB2(m_xBuilder->weld_check_button(
"key2"))
101 , m_xColEdt2(m_xBuilder->weld_spin_button(
"colsb2"))
102 , m_xTypDLB2(m_xBuilder->weld_combo_box(
"typelb2"))
103 , m_xSortUp2RB(m_xBuilder->weld_radio_button(
"up2"))
104 , m_xSortDn2RB(m_xBuilder->weld_radio_button(
"down2"))
105 , m_xKeyCB3(m_xBuilder->weld_check_button(
"key3"))
106 , m_xColEdt3(m_xBuilder->weld_spin_button(
"colsb3"))
107 , m_xTypDLB3(m_xBuilder->weld_combo_box(
"typelb3"))
108 , m_xSortUp3RB(m_xBuilder->weld_radio_button(
"up3"))
109 , m_xSortDn3RB(m_xBuilder->weld_radio_button(
"down3"))
110 , m_xColumnRB(m_xBuilder->weld_radio_button(
"columns"))
111 , m_xRowRB(m_xBuilder->weld_radio_button(
"rows"))
112 , m_xDelimTabRB(m_xBuilder->weld_radio_button(
"tabs"))
113 , m_xDelimFreeRB(m_xBuilder->weld_radio_button(
"character"))
114 , m_xDelimEdt(m_xBuilder->weld_entry(
"separator"))
115 , m_xDelimPB(m_xBuilder->weld_button(
"delimpb"))
116 , m_xLangLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"langlb")))
117 , m_xCaseCB(m_xBuilder->weld_check_button(
"matchcase"))
120 , m_aNumericText(
SwResId(STR_NUMERIC))
174 m_xLangLB->SetLanguageList( SvxLanguageListFlags::ALL | SvxLanguageListFlags::ONLY_KNOWN,
true );
214 if( !aTmp.isEmpty() )
222 short nRet = GenericDialogController::run();
255 OUString sEntry(
m_xTypDLB1->get_active_text() );
258 else if (!
m_xTypDLB1->get_active_id().isEmpty())
261 aOptions.
aKeys.push_back(
268 OUString sEntry(
m_xTypDLB2->get_active_text() );
271 else if (!
m_xTypDLB2->get_active_id().isEmpty())
274 aOptions.
aKeys.push_back(
281 OUString sEntry(
m_xTypDLB3->get_active_text() );
284 else if (!
m_xTypDLB3->get_active_id().isEmpty())
287 aOptions.
aKeys.push_back(
311 VclMessageType::Info, VclButtonsType::Ok,
319 bool bEnable = &rButton == m_xDelimFreeRB.get() && m_xDelimFreeRB->get_sensitive();
320 m_xDelimEdt->set_sensitive( bEnable );
321 m_xDelimPB->set_sensitive( bEnable );
330 if(
RET_OK == pMap->Execute() )
332 const SfxInt32Item* pItem = SfxItemSet::GetItem<SfxInt32Item>(pMap->GetOutputItemSet(), SID_ATTR_CHAR,
false);
340 if (&rControl == m_xRowRB.get())
342 m_xColLbl->set_label(m_aColText);
343 m_xColEdt1->set_max(m_nY);
344 m_xColEdt2->set_max(m_nY);
345 m_xColEdt3->set_max(m_nY);
347 m_xColEdt1->set_accessible_name(m_aColText);
348 m_xColEdt2->set_accessible_name(m_aColText);
349 m_xColEdt3->set_accessible_name(m_aColText);
351 else if (&rControl == m_xColumnRB.get())
353 m_xColLbl->set_label(m_aRowText);
354 m_xColEdt1->set_max(m_nX);
355 m_xColEdt2->set_max(m_nX);
356 m_xColEdt3->set_max(m_nX);
358 m_xColEdt1->set_accessible_name(m_aRowText);
359 m_xColEdt2->set_accessible_name(m_aRowText);
360 m_xColEdt3->set_accessible_name(m_aRowText);
362 else if(!m_xKeyCB1->get_active() &&
363 !m_xKeyCB2->get_active() &&
364 !m_xKeyCB3->get_active())
366 rControl.set_active(
true);
383 const int nLstBoxCnt = 3;
386 OUString aOldStrArr[ nLstBoxCnt ];
388 for(
int n = 0;
n < nLstBoxCnt; ++
n )
392 if (!sUserData.isEmpty())
393 aOldStrArr[
n ] = sUserData;
397 OUString sAlg, sUINm;
398 const sal_Int32 nEnd =
aSeq.getLength();
399 for( sal_Int32 nCnt = 0; nCnt <= nEnd; ++nCnt )
404 sUINm =
m_xColRes->GetTranslation( sAlg );
409 for(
int n = 0;
n < nLstBoxCnt; ++
n )
413 if (pLBox && sAlg == aOldStrArr[
n])
418 for(
int n = 0;
n < nLstBoxCnt; ++
n )
Reference< XExecutableDialog > m_xDialog
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
sal_Int32 GetValue() const
const FndLines_t & GetLines() const
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual VclPtr< SfxAbstractDialog > CreateCharMapDialog(weld::Window *pParent, const SfxItemSet &rAttr, const css::uno::Reference< css::frame::XFrame > &rFrame)=0
static SvxAbstractDialogFactory * Create()
const SwTableNode * IsCursorInTable() const
Check if Point of current cursor is placed within a table.
void StartAllAction()
For all views of this document.
bool Sort(const SwSortOptions &)
std::unique_ptr< weld::RadioButton > m_xSortUp3RB
std::unique_ptr< SvxLanguageBox > m_xLangLB
void LanguageHdl(weld::ComboBox const *)
std::unique_ptr< weld::SpinButton > m_xColEdt1
std::unique_ptr< weld::SpinButton > m_xColEdt3
std::unique_ptr< weld::Button > m_xDelimPB
std::unique_ptr< weld::SpinButton > m_xColEdt2
std::unique_ptr< weld::RadioButton > m_xSortDn2RB
sal_Unicode GetDelimChar() const
std::unique_ptr< weld::RadioButton > m_xSortUp2RB
std::unique_ptr< weld::CheckButton > m_xKeyCB2
std::unique_ptr< weld::RadioButton > m_xSortDn3RB
std::unique_ptr< weld::ComboBox > m_xTypDLB2
std::unique_ptr< weld::RadioButton > m_xSortDn1RB
std::unique_ptr< weld::RadioButton > m_xSortUp1RB
SwSortDlg(weld::Window *pParent, SwWrtShell &rSh)
std::unique_ptr< weld::RadioButton > m_xRowRB
std::unique_ptr< CollatorResource > m_xColRes
std::unique_ptr< weld::Label > m_xColLbl
std::unique_ptr< weld::Entry > m_xDelimEdt
std::unique_ptr< weld::CheckButton > m_xKeyCB3
std::unique_ptr< weld::RadioButton > m_xDelimTabRB
std::unique_ptr< weld::RadioButton > m_xColumnRB
std::unique_ptr< weld::RadioButton > m_xDelimFreeRB
std::unique_ptr< weld::CheckButton > m_xKeyCB1
std::unique_ptr< weld::ComboBox > m_xTypDLB3
std::unique_ptr< weld::CheckButton > m_xCaseCB
std::unique_ptr< weld::ComboBox > m_xTypDLB1
virtual short run() override
const SwTable & GetTable() const
SwTable is one table in the document model, containing rows (which contain cells).
SwTableLines & GetTabLines()
SwDocShell * GetDocShell()
Used by the UI to modify the document model.
SelectionType GetSelectionType() const
const SwView & GetView() const
virtual OUString get_active_id() const=0
virtual void set_active_id(const OUString &rStr)=0
void append(const weld::ComboBoxEntry &rItem)
virtual void set_active(int pos)=0
virtual int get_active() const=0
LanguageType GetAppLanguage()
CollatorWrapper & GetAppCollator()
#define LANGUAGE_DONTKNOW
#define LINK(Instance, Class, Member)
Sequence< sal_Int8 > aSeq
IMPL_LINK_NOARG(SwSortDlg, DelimCharHdl, weld::Button &, void)
IMPL_LINK(SwSortDlg, DelimHdl, weld::Toggleable &, rButton, void)
static bool lcl_GetSelTable(SwWrtShell const &rSh, sal_uInt16 &rX, sal_uInt16 &rY)
static LanguageType nLang
std::vector< SwSortKey > aKeys
SwSortDirection eDirection
OUString SwResId(TranslateId aId)
void ForEach_FndLineCopyCol(SwTableLines &rLines, FndPara *pFndPara)
This creates a structure mirroring the SwTable structure that contains all rows and non-leaf boxes (a...
void GetTableSel(const SwCursorShell &rShell, SwSelBoxes &rBoxes, const SwTableSearchType eSearchType)