22#include <osl/diagnose.h>
34#include <svx/dialogs.hrc>
36#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
37#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
78using namespace ::
sfx2;
85 const OUString& rFileString,
bool bOpen)
89 FileDialogHelper aDlgHelper( bOpen ?
90 TemplateDescription::FILEOPEN_SIMPLE : TemplateDescription::FILESAVE_AUTOEXTENSION,
91 FileDialogFlags::NONE, pParent);
92 uno::Reference < XFilePicker3 > xFP = aDlgHelper.GetFilePicker();
94 xFP->appendFilter( rFileString,
"*.sdi" );
95 xFP->setCurrentFilter( rFileString ) ;
98 xFP->setDisplayDirectory( rURL );
105 const ErrCode aErrCode = aDlgHelper.Execute();
108 sRet = xFP->getSelectedFiles().getConstArray()[0];
124 OUString sAlternative;
150 std::vector<std::unique_ptr<AutoMarkEntry>> m_Entries;
155 sal_Int32 m_nCurrentRow;
159 virtual bool SeekRow( sal_Int32 nRow )
override;
162 virtual ::svt::CellController*
GetController(sal_Int32 nRow, sal_uInt16 nCol)
override;
165 std::vector<tools::Long> GetOptimalColWidths()
const;
168 SwEntryBrowseBox(
const css::uno::Reference<css::awt::XWindow> &rParent);
169 virtual ~SwEntryBrowseBox()
override;
170 virtual void dispose()
override;
172 void WriteEntries(
SvStream& rOutStr);
176 virtual OUString
GetCellText( sal_Int32 nRow, sal_uInt16 nColumn )
const override;
177 virtual void Resize()
override;
178 virtual Size GetOptimalSize()
const override;
183 OUString m_sAutoMarkURL;
186 std::unique_ptr<weld::Button> m_xOKPB;
187 std::unique_ptr<weld::Container> m_xTable;
188 css::uno::Reference<css::awt::XWindow> m_xTableCtrlParent;
193 SwAutoMarkDlg_Impl(
weld::Window* pParent, OUString aAutoMarkURL,
195 virtual ~SwAutoMarkDlg_Impl()
override;
208 sal_uInt16 nToxType,
bool bGlobal)
211 , m_rWrtShell(rShell)
212 , m_pParamTOXBase(pCurTOX)
213 , m_sUserDefinedIndex(
SwResId(STR_USER_DEFINED_INDEX))
214 , m_nInitialTOXType(nToxType)
216 , m_bExampleCreated(false)
217 , m_bGlobalFlag(bGlobal)
218 , m_xShowExampleCB(m_xBuilder->weld_check_button(
"showexample"))
241 for(sal_uInt16 nUser = 0; nUser < nUserTypeCount; nUser++)
262 sBrackets += OUStringChar(pFType->
GetPrefix());
264 sBrackets += OUStringChar(pFType->
GetSuffix());
265 m_vTypeData[nArrayIndex].m_pDescription->SetAuthBrackets(sBrackets);
270 m_vTypeData[nArrayIndex].m_pDescription->SetAuthBrackets(
"[]");
297 if (rId ==
"background")
300 aSet.
Put (
SfxUInt32Item(SID_FLAG_TYPE,
static_cast<sal_uInt32
>(SvxBackgroundTabFlags::SHOW_SELECTOR)));
303 else if (rId ==
"columns")
309 else if (rId ==
"entries")
311 else if (rId ==
"index")
333 m_pMgr->UpdateOrInsertTOX(
336 m_pMgr->UpdateOrInsertTOX(
399 pDesc->SetTitle(pCurTOX->
GetTitle());
403 pDesc->SetIndexOptions(pCurTOX->
GetOptions());
426 OUString sTemplate(
"internal/idxexample.odt");
433 OUString sInfo(
SwResId(STR_FILE_NOT_FOUND));
434 sInfo = sInfo.replaceFirst(
"%1", sTemplate );
437 VclMessageType::Info, VclButtonsType::Ok,
475 return nId != USHRT_MAX &&
483 OUString* m_pStyleArr;
485 std::unique_ptr<weld::Button> m_xOk;
486 std::unique_ptr<weld::Button> m_xLeftPB;
487 std::unique_ptr<weld::Button> m_xRightPB;
488 std::unique_ptr<weld::TreeView> m_xHeaderTree;
490 void ToggleOn(
int nEntry,
int nToggleColumn);
505SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(
weld::Window* pParent,
506 SwWrtShell const & rWrtSh, OUString rStringArr[])
507 :
SfxDialogController(pParent,
"modules/swriter/ui/assignstylesdialog.ui",
"AssignStylesDialog")
508 , m_pStyleArr(rStringArr)
509 , m_xOk(m_xBuilder->weld_button(
"ok"))
510 , m_xLeftPB(m_xBuilder->weld_button(
"left"))
511 , m_xRightPB(m_xBuilder->weld_button(
"right"))
512 , m_xHeaderTree(m_xBuilder->weld_tree_view(
"styles"))
514 m_xOk->connect_clicked(
LINK(
this, SwAddStylesDlg_Impl, OkHdl));
515 m_xLeftPB->connect_clicked(
LINK(
this, SwAddStylesDlg_Impl, LeftRightHdl));
516 m_xRightPB->connect_clicked(
LINK(
this, SwAddStylesDlg_Impl, LeftRightHdl));
518 m_xHeaderTree->connect_size_allocate(
LINK(
this, SwAddStylesDlg_Impl, TreeSizeAllocHdl));
520 m_xHeaderTree->connect_toggled(
LINK(
this, SwAddStylesDlg_Impl, RadioToggleOnHdl));
521 m_xHeaderTree->connect_column_clicked(
LINK(
this, SwAddStylesDlg_Impl, HeaderBarClick));
523 std::vector<int> aWidths
525 o3tl::narrowing<int>(m_xHeaderTree->get_approximate_digit_width() * 30)
527 int nPadding = m_xHeaderTree->get_approximate_digit_width() * 2;
528 OUString sTitle(m_xHeaderTree->get_column_title(1));
531 sTitle = OUString::number(i);
532 m_xHeaderTree->set_column_title(i + 1, sTitle);
533 aWidths.push_back(m_xHeaderTree->get_pixel_size(sTitle).Width() + nPadding);
535 m_xHeaderTree->set_column_fixed_widths(aWidths);
536 auto nWidth = std::accumulate(aWidths.begin(), aWidths.end(),
538 m_xHeaderTree->set_size_request(nWidth, m_xHeaderTree->get_height_rows(15));
543 const OUString &rStyles{rStringArr[
i]};
544 if (rStyles.isEmpty())
550 m_xHeaderTree->append_text(sEntry);
551 for (sal_uInt16 j = 0; j <=
MAXLEVEL; ++j)
554 m_xHeaderTree->set_toggle(nRow, eState, j + 1);
562 for (sal_uInt16 j = 0; j < nSz; ++j)
569 if (!
aName.isEmpty())
572 int nChildren = m_xHeaderTree->n_children();
573 for (
int i = 0;
i < nChildren; ++
i)
575 if (m_xHeaderTree->get_text(i, 0) == aName)
583 m_xHeaderTree->append_text(aName);
584 for (sal_uInt16 k = 0; k <=
MAXLEVEL; ++k)
587 m_xHeaderTree->set_toggle(nRow, eState, k + 1);
594 m_xHeaderTree->make_sorted();
595 m_xHeaderTree->set_sort_column(0);
596 m_xHeaderTree->set_sort_order(
true);
597 m_xHeaderTree->set_sort_indicator(TRISTATE_TRUE, 0);
599 m_xHeaderTree->select(0);
600 m_xHeaderTree->connect_key_release(
LINK(
this, SwAddStylesDlg_Impl, KeyInput));
603IMPL_LINK(SwAddStylesDlg_Impl, HeaderBarClick,
int, nColumn,
void)
605 bool bSortAtoZ = m_xHeaderTree->get_sort_order();
608 if (nColumn == m_xHeaderTree->get_sort_column())
610 bSortAtoZ = !bSortAtoZ;
611 m_xHeaderTree->set_sort_order(bSortAtoZ);
625 std::vector<int> aWidths { 0 };
626 int nPadding = m_xHeaderTree->get_approximate_digit_width() * 2;
629 OUString sTitle(m_xHeaderTree->get_column_title(
i + 1));
630 aWidths.push_back(m_xHeaderTree->get_pixel_size(sTitle).Width() + nPadding);
632 auto nOtherWidth = std::accumulate(aWidths.begin(), aWidths.end(), 0);
633 aWidths[0] = nWidth - nOtherWidth;
634 m_xHeaderTree->set_column_fixed_widths(aWidths);
642 m_xHeaderTree->set_toggle(rRowCol.first, eState,
i + 1);
649 bool bHandled =
false;
651 sal_uInt16 nCode = aCode.
GetCode();
655 LeftRightHdl(*m_xRightPB);
659 LeftRightHdl(*m_xLeftPB);
674 int nEntry = m_xHeaderTree->get_selected_index();
677 ToggleOn(nEntry, nCode !=
KEY_A ? nCode -
KEY_0 : 10);
690 m_pStyleArr[
i].clear();
692 int nChildren = m_xHeaderTree->n_children();
693 for (
int i = 0;
i < nChildren; ++
i)
695 int nToggleColumn = 0;
696 for (sal_uInt16 j = 0; j <=
MAXLEVEL; ++j)
706 int nLevel = nToggleColumn - 1;
707 if(!m_pStyleArr[nLevel].isEmpty())
709 m_pStyleArr[nLevel] += m_xHeaderTree->get_text(
i, 0);
719 bool bLeft = &rBtn == m_xLeftPB.get();
720 int nEntry = m_xHeaderTree->get_selected_index();
724 int nToggleColumn = 0;
725 for (sal_uInt16 j = 0; j <=
MAXLEVEL; ++j)
727 if (m_xHeaderTree->get_toggle(nEntry, j + 1) ==
TRISTATE_TRUE)
745 ToggleOn(nEntry, nToggleColumn);
748void SwAddStylesDlg_Impl::ToggleOn(
int nEntry,
int nToggleColumn)
750 for (sal_uInt16 j = 0; j <=
MAXLEVEL; ++j)
752 m_xHeaderTree->set_toggle(nEntry, j == nToggleColumn ? TRISTATE_TRUE : TRISTATE_FALSE, j + 1);
757 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/tocindexpage.ui",
"TocIndexPage", &rAttrSet)
758 , m_sAutoMarkType(
SwResId(STR_AUTOMARK_TYPE))
759 , m_bWaitingInitialSettings(true)
760 , m_xTitleED(m_xBuilder->weld_entry(
"title"))
761 , m_xTypeFT(m_xBuilder->weld_label(
"typeft"))
762 , m_xTypeLB(m_xBuilder->weld_combo_box(
"type"))
763 , m_xReadOnlyCB(m_xBuilder->weld_check_button(
"readonly"))
764 , m_xAreaFrame(m_xBuilder->weld_widget(
"areaframe"))
765 , m_xAreaLB(m_xBuilder->weld_combo_box(
"scope"))
766 , m_xLevelFT(m_xBuilder->weld_label(
"levelft"))
767 , m_xLevelNF(m_xBuilder->weld_spin_button(
"level"))
768 , m_xCreateFrame(m_xBuilder->weld_widget(
"createframe"))
769 , m_xFromHeadingsCB(m_xBuilder->weld_check_button(
"fromheadings"))
770 , m_xStylesCB(m_xBuilder->weld_check_button(
"stylescb"))
771 , m_xAddStylesCB(m_xBuilder->weld_check_button(
"addstylescb"))
772 , m_xAddStylesPB(m_xBuilder->weld_button(
"styles"))
773 , m_xFromTablesCB(m_xBuilder->weld_check_button(
"fromtables"))
774 , m_xFromFramesCB(m_xBuilder->weld_check_button(
"fromframes"))
775 , m_xFromGraphicsCB(m_xBuilder->weld_check_button(
"fromgraphics"))
776 , m_xFromOLECB(m_xBuilder->weld_check_button(
"fromoles"))
777 , m_xLevelFromChapterCB(m_xBuilder->weld_check_button(
"uselevel"))
778 , m_xFromCaptionsRB(m_xBuilder->weld_radio_button(
"captions"))
779 , m_xFromObjectNamesRB(m_xBuilder->weld_radio_button(
"objnames"))
780 , m_xCaptionSequenceFT(m_xBuilder->weld_label(
"categoryft"))
781 , m_xCaptionSequenceLB(m_xBuilder->weld_combo_box(
"category"))
782 , m_xDisplayTypeFT(m_xBuilder->weld_label(
"displayft"))
783 , m_xDisplayTypeLB(m_xBuilder->weld_combo_box(
"display"))
784 , m_xParaStyleCB(m_xBuilder->weld_check_button(
"useparastyle"))
785 , m_xParaStyleLB(m_xBuilder->weld_combo_box(
"parastyle"))
786 , m_xTOXMarksCB(m_xBuilder->weld_check_button(
"indexmarks"))
787 , m_xIdxOptionsFrame(m_xBuilder->weld_widget(
"optionsframe"))
788 , m_xCollectSameCB(m_xBuilder->weld_check_button(
"combinesame"))
789 , m_xUseFFCB(m_xBuilder->weld_check_button(
"useff"))
790 , m_xUseDashCB(m_xBuilder->weld_check_button(
"usedash"))
791 , m_xCaseSensitiveCB(m_xBuilder->weld_check_button(
"casesens"))
792 , m_xInitialCapsCB(m_xBuilder->weld_check_button(
"initcaps"))
793 , m_xKeyAsEntryCB(m_xBuilder->weld_check_button(
"keyasentry"))
794 , m_xFromFileCB(m_xBuilder->weld_check_button(
"fromfile"))
795 , m_xAutoMarkPB(m_xBuilder->weld_menu_button(
"file"))
796 , m_xFromObjCLB(m_xBuilder->weld_tree_view(
"objects"))
797 , m_xFromObjFrame(m_xBuilder->weld_widget(
"objectframe"))
798 , m_xSequenceCB(m_xBuilder->weld_check_button(
"numberentries"))
799 , m_xBracketLB(m_xBuilder->weld_combo_box(
"brackets"))
800 , m_xAuthorityFrame(m_xBuilder->weld_widget(
"authframe"))
801 , m_xSortFrame(m_xBuilder->weld_widget(
"sortframe"))
802 , m_xLanguageLB(new
SvxLanguageBox(m_xBuilder->weld_combo_box(
"lang")))
803 , m_xSortAlgorithmLB(m_xBuilder->weld_combo_box(
"keytype"))
808 m_xLanguageLB->SetLanguageList( SvxLanguageListFlags::ALL | SvxLanguageListFlags::ONLY_KNOWN,
823 OUString
sId(OUString::number(
static_cast<sal_uInt32
>(RES_SRCTYPES[
i].second)));
877 if(nUserTypeCount <= 1)
882 for (sal_uInt16 nUser = 1; nUser < nUserTypeCount; nUser++)
884 sal_uInt32 nEntryData = nUser << 8;
886 OUString
sId(OUString::number(nEntryData));
888 &
sId,
nullptr,
nullptr);
905 nRet =
eType.nIndex << 8;
925 m_xTypeLB->set_active_id(OUString::number(nData));
941 eRet.
nIndex = (nData&0xff00) >> 8;
950 default: OSL_FAIL(
"what a type?");
962 if (!
m_xTitleED->get_value_changed_from_saved())
979 bool bHasStyleNames =
false;
984 bHasStyleNames =
true;
1006 for (sal_uInt16 j = 0; j < nSz; ++j)
1013 if (!
name.isEmpty())
1022 if (rStyle.isEmpty())
1083 if(sBrackets.isEmpty() || sBrackets ==
" ")
1096 for (
int nCnt = 0, nEntryCount =
m_xSortAlgorithmLB->get_count(); nCnt < nEntryCount; ++nCnt)
1243 m_xTypeLB->set_active_id(OUString::number(nData));
1286 return DeactivateRC::LeavePage;
1291 return std::make_unique<SwTOXSelectTabPage>(pPage, pController, *rAttrSet);
1297 const sal_uInt16
nType = rBox.get_active_id().toUInt32();
1304 m_xLevelFromChapterCB->set_visible( 0 != (
nType & (
TO_USER)) );
1311 m_xFromTablesCB->set_visible( 0 != (
nType & (
TO_USER)) );
1312 m_xFromFramesCB->set_visible( 0 != (
nType & (
TO_USER)) );
1313 m_xFromGraphicsCB->set_visible( 0 != (
nType & (
TO_USER)) );
1332 m_xSortFrame->set_visible(bEnableSortLanguage);
1337 m_xCaptionSequenceLB->set_active_text(
sName);
1342 m_xCaptionSequenceLB->set_active_text(
sName);
1346 m_xAddStylesCB->set_label(m_sAddStyleUser);
1356 ApplyTOXDescription();
1393 if (!m_xAddStylesCB->get_active() && !m_xFromHeadingsCB->get_active() && !m_xTOXMarksCB->get_active())
1396 rButton.set_active(
true);
1398 m_xAddStylesPB->set_sensitive(m_xAddStylesCB->get_active());
1402 m_xAddStylesPB->set_sensitive(m_xAddStylesCB->get_active());
1406 m_xAutoMarkPB->set_sensitive(m_xFromFileCB->get_active());
1407 m_xUseFFCB->set_sensitive(m_xCollectSameCB->get_active() && !m_xUseDashCB->get_active());
1408 m_xUseDashCB->set_sensitive(m_xCollectSameCB->get_active() && !m_xUseFFCB->get_active());
1409 m_xCaseSensitiveCB->set_sensitive(m_xCollectSameCB->get_active());
1415 bool const bEnable(m_xParaStyleCB->get_active());
1416 m_xParaStyleLB->set_sensitive(bEnable);
1423 bool bEnable = m_xFromCaptionsRB->get_active();
1424 m_xCaptionSequenceFT->set_sensitive(bEnable);
1425 m_xCaptionSequenceLB->set_sensitive(bEnable);
1426 m_xDisplayTypeFT->set_sensitive(bEnable);
1427 m_xDisplayTypeLB->set_sensitive(bEnable);
1447 sal_Int32 nEnd =
aSeq.getLength();
1448 for( sal_Int32 nCnt = 0; nCnt < nEnd; ++nCnt )
1450 const OUString sAlg(
aSeq[ nCnt ]);
1451 const OUString sUINm =
m_pIndexRes->GetTranslation( sAlg );
1453 if( sAlg == sOldString )
1474 m_xAutoMarkPB->set_item_sensitive(
"edit", !m_sAutoMarkURL.isEmpty());
1479 const OUString sSaveAutoMarkURL = m_sAutoMarkURL;
1481 if (rIdent ==
"open")
1484 m_sAutoMarkURL, m_sAutoMarkType,
true);
1486 else if (rIdent ==
"new" || rIdent ==
"edit")
1488 bool bNew = (rIdent ==
"new");
1492 m_sAutoMarkURL, m_sAutoMarkType,
false);
1493 if (m_sAutoMarkURL.isEmpty())
1497 SwAutoMarkDlg_Impl aAutoMarkDlg(
GetFrameWeld(), m_sAutoMarkURL, bNew);
1498 if (
RET_OK != aAutoMarkDlg.run() && bNew)
1499 m_sAutoMarkURL = sSaveAutoMarkURL;
1530 :
m_xBuilder(
Application::CreateBuilder(pTokenWin->get_child_container(),
"modules/swriter/ui/toxentrywidget.ui"))
1549 return WindowType::EDIT;
1569 m_xEntry->set_accessible_name(rName);
1579 m_xEntry->get_extents_relative_to(rRelative,
x,
y, width, height);
1594 m_xEntry->get_selection_bounds(rStartPos, rEndPos);
1599 m_xEntry->select_region(nStartPos, nEndPos);
1630 m_aModifiedLink.Call(*
this);
1636 int nStartPos, nEndPos;
1637 bool bStartIsEnd = !m_xEntry->get_selection_bounds(nStartPos, nEndPos);
1638 int nMin =
std::min(nStartPos, nEndPos);
1639 const sal_Int32 nTextLen = GetText().getLength();
1640 if ((bStartIsEnd && !nMin) || nMin == nTextLen)
1645 m_bNextControl =
true;
1650 m_bNextControl =
false;
1657 m_pParent->SetFocus2theAllBtn();
1660 if (bCall && m_aPrevNextControlLink.IsSet())
1661 m_aPrevNextControlLink.Call(*
this);
1671 m_aGetFocusLink.Call(*
this);
1677 float fChars = nWidth /
m_xEntry->get_approximate_digit_width();
1678 m_xEntry->set_width_chars(std::max(1.0f, std::ceil(fChars)));
1691 :
m_xBuilder(
Application::CreateBuilder(pTokenWin->get_child_container(),
"modules/swriter/ui/toxbuttonwidget.ui"))
1709 return WindowType::PUSHBUTTON;
1739 m_xButton->get_extents_relative_to(rRelative,
x,
y, width, height);
1811 "call SetLinkEnd for link start only!");
1820 "call SetLinkStart for link start only!");
1833 m_bNextControl =
true;
1838 m_bNextControl =
false;
1843 m_pParent->RemoveControl(
this,
true);
1851 m_pParent->SetFocus2theAllBtn();
1854 if (bCall && m_aPrevNextControlLink.IsSet())
1855 m_aPrevNextControlLink.Call(*
this);
1863 m_aGetFocusLink.Call(*
this);
1870 STR_AUTH_FIELD_IDENTIFIER,
1871 STR_AUTH_FIELD_AUTHORITY_TYPE,
1872 STR_AUTH_FIELD_ADDRESS,
1873 STR_AUTH_FIELD_ANNOTE,
1874 STR_AUTH_FIELD_AUTHOR,
1875 STR_AUTH_FIELD_BOOKTITLE,
1876 STR_AUTH_FIELD_CHAPTER,
1877 STR_AUTH_FIELD_EDITION,
1878 STR_AUTH_FIELD_EDITOR,
1879 STR_AUTH_FIELD_HOWPUBLISHED,
1880 STR_AUTH_FIELD_INSTITUTION,
1881 STR_AUTH_FIELD_JOURNAL,
1882 STR_AUTH_FIELD_MONTH,
1883 STR_AUTH_FIELD_NOTE,
1884 STR_AUTH_FIELD_NUMBER,
1885 STR_AUTH_FIELD_ORGANIZATIONS,
1886 STR_AUTH_FIELD_PAGES,
1887 STR_AUTH_FIELD_PUBLISHER,
1888 STR_AUTH_FIELD_SCHOOL,
1889 STR_AUTH_FIELD_SERIES,
1890 STR_AUTH_FIELD_TITLE,
1891 STR_AUTH_FIELD_TYPE,
1892 STR_AUTH_FIELD_VOLUME,
1893 STR_AUTH_FIELD_YEAR,
1895 STR_AUTH_FIELD_CUSTOM1,
1896 STR_AUTH_FIELD_CUSTOM2,
1897 STR_AUTH_FIELD_CUSTOM3,
1898 STR_AUTH_FIELD_CUSTOM4,
1899 STR_AUTH_FIELD_CUSTOM5,
1900 STR_AUTH_FIELD_ISBN,
1901 STR_AUTH_FIELD_LOCAL_URL,
1902 STR_AUTH_FIELD_TARGET_TYPE,
1903 STR_AUTH_FIELD_TARGET_URL,
1908 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/tocentriespage.ui",
"TocEntriesPage", &rAttrSet)
1909 , m_sDelimStr(
SwResId(STR_DELIM))
1910 , m_sNoCharStyle(
SwResId(STR_NO_CHAR_STYLE))
1911 , m_pCurrentForm(nullptr)
1912 , m_bInLevelHdl(false)
1913 , m_xTypeFT(m_xBuilder->weld_label(
"typeft"))
1914 , m_xLevelFT(m_xBuilder->weld_label(
"levelft"))
1915 , m_xLevelLB(m_xBuilder->weld_tree_view(
"level"))
1916 , m_xAllLevelsPB(m_xBuilder->weld_button(
"all"))
1917 , m_xEntryNoPB(m_xBuilder->weld_button(
"chapterno"))
1918 , m_xEntryPB(m_xBuilder->weld_button(
"entrytext"))
1919 , m_xTabPB(m_xBuilder->weld_button(
"tabstop"))
1920 , m_xChapterInfoPB(m_xBuilder->weld_button(
"chapterinfo"))
1921 , m_xPageNoPB(m_xBuilder->weld_button(
"pageno"))
1922 , m_xHyperLinkPB(m_xBuilder->weld_button(
"hyperlink"))
1923 , m_xFieldBox(m_xBuilder->weld_widget(
"fieldbox"))
1924 , m_xAuthFieldsLB(m_xBuilder->weld_combo_box(
"authfield"))
1925 , m_xAuthInsertPB(m_xBuilder->weld_button(
"insert"))
1926 , m_xAuthRemovePB(m_xBuilder->weld_button(
"remove"))
1927 , m_xCharStyleLB(m_xBuilder->weld_combo_box(
"charstyle"))
1928 , m_xEditStylePB(m_xBuilder->weld_button(
"edit"))
1929 , m_xChapterEntryFT(m_xBuilder->weld_label(
"chapterentryft"))
1930 , m_xChapterEntryLB(m_xBuilder->weld_combo_box(
"chapterentry"))
1931 , m_xNumberFormatFT(m_xBuilder->weld_label(
"numberformatft"))
1932 , m_xNumberFormatLB(m_xBuilder->weld_combo_box(
"numberformat"))
1933 , m_xEntryOutlineLevelFT(m_xBuilder->weld_label(
"entryoutlinelevelft"))
1934 , m_xEntryOutlineLevelNF(m_xBuilder->weld_spin_button(
"entryoutlinelevel"))
1935 , m_xFillCharFT(m_xBuilder->weld_label(
"fillcharft"))
1936 , m_xFillCharCB(m_xBuilder->weld_combo_box(
"fillchar"))
1937 , m_xTabPosFT(m_xBuilder->weld_label(
"tabstopposft"))
1938 , m_xTabPosMF(m_xBuilder->weld_metric_spin_button(
"tabstoppos",
FieldUnit::
CM))
1939 , m_xAutoRightCB(m_xBuilder->weld_check_button(
"alignright"))
1940 , m_xFormatFrame(m_xBuilder->weld_widget(
"formatframe"))
1941 , m_xMainEntryStyleFT(m_xBuilder->weld_label(
"mainstyleft"))
1942 , m_xMainEntryStyleLB(m_xBuilder->weld_combo_box(
"mainstyle"))
1943 , m_xAlphaDelimCB(m_xBuilder->weld_check_button(
"alphadelim"))
1944 , m_xCommaSeparatedCB(m_xBuilder->weld_check_button(
"commasep"))
1945 , m_xRelToStyleCB(m_xBuilder->weld_check_button(
"reltostyle"))
1946 , m_xSortingFrame(m_xBuilder->weld_widget(
"sortingframe"))
1947 , m_xSortDocPosRB(m_xBuilder->weld_radio_button(
"sortpos"))
1948 , m_xSortContentRB(m_xBuilder->weld_radio_button(
"sortcontents"))
1949 , m_xSortKeyFrame(m_xBuilder->weld_widget(
"sortkeyframe"))
1950 , m_xFirstKeyLB(m_xBuilder->weld_combo_box(
"key1lb"))
1951 , m_xFirstSortUpRB(m_xBuilder->weld_toggle_button(
"up1cb"))
1952 , m_xFirstSortDownRB(m_xBuilder->weld_toggle_button(
"down1cb"))
1953 , m_xSecondKeyLB(m_xBuilder->weld_combo_box(
"key2lb"))
1954 , m_xSecondSortUpRB(m_xBuilder->weld_toggle_button(
"up2cb"))
1955 , m_xSecondSortDownRB(m_xBuilder->weld_toggle_button(
"down2cb"))
1956 , m_xThirdKeyLB(m_xBuilder->weld_combo_box(
"key3lb"))
1957 , m_xThirdSortUpRB(m_xBuilder->weld_toggle_button(
"up3cb"))
1958 , m_xThirdSortDownRB(m_xBuilder->weld_toggle_button(
"down3cb"))
1959 , m_xTokenWIN(new
SwTokenWindow(m_xBuilder->weld_container(
"token")))
1961 const OUString sNoCharSortKey(
SwResId(STR_NOSORTKEY));
2031 OUString
sId(OUString::number(
i));
2035 m_xFirstKeyLB->append(OUString::number(USHRT_MAX), sNoCharSortKey);
2036 m_xSecondKeyLB->append(OUString::number(USHRT_MAX), sNoCharSortKey);
2037 m_xThirdKeyLB->append(OUString::number(USHRT_MAX), sNoCharSortKey);
2053 int nFieldBoxWidth = 0;
2057 nFieldBoxWidth = std::max<int>(
m_xFieldBox->get_preferred_size().Width(), nFieldBoxWidth);
2059 m_xFieldBox->set_size_request(nFieldBoxWidth, -1);
2082 if (&rToggle == m_xFirstSortUpRB.get())
2083 m_xFirstSortDownRB->set_active(!m_xFirstSortUpRB->get_active());
2084 else if (&rToggle == m_xFirstSortDownRB.get())
2085 m_xFirstSortUpRB->set_active(!m_xFirstSortDownRB->get_active());
2086 else if (&rToggle == m_xSecondSortUpRB.get())
2087 m_xSecondSortDownRB->set_active(!m_xSecondSortUpRB->get_active());
2088 else if (&rToggle == m_xSecondSortDownRB.get())
2089 m_xSecondSortUpRB->set_active(!m_xSecondSortDownRB->get_active());
2090 else if (&rToggle == m_xThirdSortUpRB.get())
2091 m_xThirdSortDownRB->set_active(!m_xThirdSortUpRB->get_active());
2092 else if (&rToggle == m_xThirdSortDownRB.get())
2093 m_xThirdSortUpRB->set_active(!m_xThirdSortDownRB->get_active());
2104 sal_uInt16 nCurLevel =
m_xLevelLB->get_selected_index() + 1;
2106 nCurLevel = USHRT_MAX;
2127 if(!sMainEntryCharStyle.isEmpty())
2188 if(bToxIsAuthorities)
2191 else if( bToxIsIndex )
2196 m_xLevelLB->append_text( OUString::number(
i - 1) );
2201 if(bToxIsAuthorities)
2292 return DeactivateRC::LeavePage;
2297 return std::make_unique<SwTOXEntryTabPage>(pPage, pController, *rAttrSet);
2302 if (m_xCharStyleLB->get_active() != -1)
2304 SfxStringItem aStyle(SID_STYLE_EDIT, m_xCharStyleLB->get_active_text());
2305 SfxUInt16Item aFamily(SID_STYLE_FAMILY, sal_uInt16(SfxStyleFamily::Char));
2307 GetView().GetViewFrame().GetDispatcher()->ExecuteList(SID_STYLE_EDIT,
2308 SfxCallMode::SYNCHRON,
2309 { &aStyle, &aFamily });
2315 bool bInsert = &rButton == m_xAuthInsertPB.get();
2318 sal_Int32 nSelPos = m_xAuthFieldsLB->get_active();
2319 const OUString sToInsert(m_xAuthFieldsLB->get_active_text());
2321 aInsert.
nAuthorityField = m_xAuthFieldsLB->get_id(nSelPos).toUInt32();
2322 m_xTokenWIN->InsertAtSelection(aInsert);
2323 m_xAuthFieldsLB->remove_text(sToInsert);
2324 m_xAuthFieldsLB->set_active(nSelPos ? nSelPos - 1 : 0);
2328 SwTOXWidget* pCtrl = m_xTokenWIN->GetActiveControl();
2329 OSL_ENSURE(WindowType::EDIT != pCtrl->
GetType(),
"Remove should be disabled");
2330 if (WindowType::EDIT != pCtrl->
GetType())
2334 PreTokenButtonRemoved(rToken);
2335 m_xTokenWIN->RemoveControl(
static_cast<SwTOXButton*
>(pCtrl));
2358 OUString sCharStyle;
2360 if (&rBtn == m_xEntryNoPB.get())
2364 else if (&rBtn == m_xEntryPB.get())
2375 else if (&rBtn == m_xChapterInfoPB.get())
2380 else if (&rBtn == m_xPageNoPB.get())
2384 else if (&rBtn == m_xHyperLinkPB.get())
2387 sCharStyle =
SwResId(STR_POOLCHR_TOXJUMP);
2389 else if (&rBtn == m_xTabPB.get())
2397 m_xTokenWIN->InsertAtSelection(aInsert);
2405 if(m_xTokenWIN->IsValid())
2407 const OUString sNewToken = m_xTokenWIN->GetPattern();
2408 for(sal_uInt16
i = 1;
i < m_pCurrentForm->GetFormMax();
i++)
2409 m_pCurrentForm->SetPattern(
i, sNewToken);
2419 const OUString sNewToken =
m_xTokenWIN->GetPattern();
2420 const sal_uInt16 nLastLevel =
m_xTokenWIN->GetLastLevel();
2421 if(nLastLevel != USHRT_MAX)
2430 m_bInLevelHdl =
true;
2433 const sal_uInt16 nLevel = rBox.get_selected_index();
2434 m_xTokenWIN->SetForm(*m_pCurrentForm, nLevel);
2438 m_xAuthFieldsLB->clear();
2441 m_xAuthFieldsLB->append(OUString::number(
i),
SwResId(STR_AUTH_FIELD_ARY[
i]));
2445 SwFormTokens aPattern = m_pCurrentForm->GetPattern(nLevel + 1);
2447 for(
const auto& aToken : aPattern)
2451 sal_uInt32 nSearch = aToken.nAuthorityField;
2452 int nLstBoxPos = m_xAuthFieldsLB->find_id(OUString::number(nSearch));
2453 OSL_ENSURE(nLstBoxPos != -1,
"Entry not found?");
2454 m_xAuthFieldsLB->remove(nLstBoxPos);
2457 m_xAuthFieldsLB->set_active(0);
2459 m_bInLevelHdl =
false;
2465 bool bEnable = m_xSortContentRB->get_active();
2466 m_xSortKeyFrame->set_sensitive(bEnable);
2471 if (!rToken.sCharStyleName.isEmpty())
2472 m_xCharStyleLB->set_active_text(rToken.sCharStyleName);
2474 m_xCharStyleLB->set_active_text(m_sNoCharStyle);
2476 const OUString sEntry = m_xCharStyleLB->get_active_text();
2477 m_xEditStylePB->set_sensitive(sEntry != m_sNoCharStyle);
2482 switch(rToken.nChapterFormat)
2485 m_xChapterEntryLB->set_active(-1);
2488 m_xChapterEntryLB->set_active(0);
2491 m_xChapterEntryLB->set_active(1);
2494 m_xChapterEntryLB->set_active(2);
2499 m_xEntryOutlineLevelNF->set_value(rToken.nOutlineLevel);
2505 m_xEntryOutlineLevelNF->set_value(rToken.nOutlineLevel);
2506 const sal_uInt16 nFormat =
2508 m_xNumberFormatLB->set_active(nFormat);
2512 m_xFillCharFT->set_visible(bTabStop);
2513 m_xFillCharCB->set_visible(bTabStop);
2514 m_xTabPosFT->set_visible(bTabStop);
2515 m_xTabPosMF->set_visible(bTabStop);
2516 m_xAutoRightCB->set_visible(bTabStop);
2517 m_xAutoRightCB->set_sensitive(bTabStop);
2520 m_xTabPosMF->set_value(m_xTabPosMF->normalize(rToken.nTabStopPosition), FieldUnit::TWIP);
2521 m_xAutoRightCB->set_active(SvxTabAdjust::End == rToken.eTabAlign);
2522 m_xFillCharCB->set_entry_text(OUString(rToken.cTabFillChar));
2523 m_xTabPosFT->set_sensitive(!m_xAutoRightCB->get_active());
2524 m_xTabPosMF->set_sensitive(!m_xAutoRightCB->get_active());
2528 m_xTabPosMF->set_sensitive(
false);
2533 m_xChapterEntryFT->set_visible( bIsChapterInfo );
2534 m_xChapterEntryLB->set_visible( bIsChapterInfo );
2535 m_xEntryOutlineLevelFT->set_visible( bIsChapterInfo || bIsEntryNumber );
2536 m_xEntryOutlineLevelNF->set_visible( bIsChapterInfo || bIsEntryNumber );
2537 m_xNumberFormatFT->set_visible( bIsEntryNumber );
2538 m_xNumberFormatLB->set_visible( bIsEntryNumber );
2544 if (m_xEntryNoPB->get_visible())
2546 m_xEntryNoPB->set_sensitive(
TOKEN_ENTRY_NO != rToken.eTokenType );
2548 if (m_xEntryPB->get_visible())
2555 if (m_xChapterInfoPB->get_visible())
2559 if (m_xPageNoPB->get_visible())
2564 if (m_xTabPB->get_visible())
2566 m_xTabPB->set_sensitive(!bTabStop);
2568 if (m_xHyperLinkPB->get_visible())
2574 if (m_xAuthInsertPB->get_visible())
2576 bool bText =
TOKEN_TEXT == rToken.eTokenType;
2577 m_xAuthInsertPB->set_sensitive(bText && !m_xAuthFieldsLB->get_active_text().isEmpty());
2578 m_xAuthRemovePB->set_sensitive(!bText);
2584 OUString sEntry = rBox.get_active_text();
2585 const sal_uInt16
nId = rBox.get_active_id().toUInt32();
2586 const bool bEqualsNoCharStyle = sEntry == m_sNoCharStyle;
2587 m_xEditStylePB->set_sensitive(!bEqualsNoCharStyle);
2588 if (bEqualsNoCharStyle)
2590 SwTOXWidget* pCtrl = m_xTokenWIN->GetActiveControl();
2591 OSL_ENSURE(pCtrl,
"no active control?");
2594 if(WindowType::EDIT == pCtrl->
GetType())
2595 static_cast<SwTOXEdit*
>(pCtrl)->SetCharStyleName(sEntry,
nId);
2605 int nPos = rBox.get_active();
2608 SwTOXWidget* pCtrl = m_xTokenWIN->GetActiveControl();
2609 OSL_ENSURE(pCtrl,
"no active control?");
2610 if(pCtrl && WindowType::EDIT != pCtrl->
GetType())
2618 const sal_uInt16 nLevel = rEdit.get_value();
2620 SwTOXWidget* pCtrl = m_xTokenWIN->GetActiveControl();
2621 OSL_ENSURE(pCtrl,
"no active control?");
2622 if(pCtrl && WindowType::EDIT != pCtrl->
GetType())
2623 static_cast<SwTOXButton*
>(pCtrl)->SetOutlineLevel(nLevel);
2630 const sal_Int32
nPos = rBox.get_active();
2633 SwTOXWidget* pCtrl = m_xTokenWIN->GetActiveControl();
2634 OSL_ENSURE(pCtrl,
"no active control?");
2635 if(pCtrl && WindowType::EDIT != pCtrl->
GetType())
2645 SwTOXWidget* pCtrl = m_xTokenWIN->GetActiveControl();
2646 OSL_ENSURE(pCtrl && WindowType::EDIT != pCtrl->
GetType() &&
2648 "no active style::TabStop control?");
2649 if( pCtrl && WindowType::EDIT != pCtrl->
GetType() )
2652 rEdit.denormalize(rEdit.get_value(FieldUnit::TWIP))));
2659 SwTOXWidget* pCtrl = m_xTokenWIN->GetActiveControl();
2660 OSL_ENSURE(pCtrl && WindowType::EDIT != pCtrl->
GetType() &&
2662 "no active style::TabStop control?");
2663 if (pCtrl && WindowType::EDIT != pCtrl->
GetType())
2666 if (!rBox.get_active_text().isEmpty())
2667 cSet = rBox.get_active_text()[0];
2670 static_cast<SwTOXButton*
>(pCtrl)->SetFillChar( cSet );
2678 SwTOXWidget* pCurCtrl = m_xTokenWIN->GetActiveControl();
2679 OSL_ENSURE(WindowType::EDIT != pCurCtrl->
GetType() &&
2681 "no style::TabStop selected!");
2684 bool bChecked = rBox.get_active();
2687 bChecked ? SvxTabAdjust::End : SvxTabAdjust::Left);
2688 m_xTabPosFT->set_sensitive(!bChecked);
2689 m_xTabPosMF->set_sensitive(!bChecked);
2697 const OUString sDefault(
SwResId(STR_POOLCHR_STANDARD));
2701 if(sDefault != sEntry)
2717 STR_TOKEN_PAGE_NUMS,
2718 STR_TOKEN_CHAPTER_INFO,
2719 STR_TOKEN_LINK_START,
2726 STR_TOKEN_HELP_ENTRY_NO,
2727 STR_TOKEN_HELP_ENTRY,
2728 STR_TOKEN_HELP_ENTRY,
2729 STR_TOKEN_HELP_TAB_STOP,
2730 STR_TOKEN_HELP_TEXT,
2731 STR_TOKEN_HELP_PAGE_NUMS,
2732 STR_TOKEN_HELP_CHAPTER_INFO,
2733 STR_TOKEN_HELP_LINK_START,
2734 STR_TOKEN_HELP_LINK_END,
2735 STR_TOKEN_HELP_AUTHORITY
2742 , m_sCharStyle(
SwResId(STR_CHARSTYLE))
2743 , m_pActiveCtrl(nullptr)
2744 , m_aAdjustPositionsIdle(
"SwTokenWindow m_aAdjustPositionsIdle")
2745 , m_pParent(nullptr)
2746 , m_xParentWidget(
std::move(xParent))
2747 , m_xBuilder(
Application::CreateBuilder(m_xParentWidget.
get(),
"modules/swriter/ui/tokenwidget.ui"))
2748 ,
m_xContainer(m_xBuilder->weld_container(
"TokenWidget"))
2749 , m_xLeftScrollWin(m_xBuilder->weld_button(
"left"))
2750 , m_xCtrlParentWin(m_xBuilder->weld_container(
"ctrl"))
2751 , m_xScrollWin(m_xBuilder->weld_scrolled_window(
"scrollwin"))
2752 , m_xRightScrollWin(m_xBuilder->weld_button(
"right"))
2799 bool bLastWasText =
false;
2802 for (
const auto& aToken : aPattern)
2806 SAL_WARN_IF(bLastWasText,
"sw",
"text following text is invalid");
2808 bLastWasText =
true;
2818 if(!pSetActiveControl)
2819 pSetActiveControl = pCtrl;
2823 switch( aToken.eTokenType )
2838 bLastWasText =
false;
2845 if(!pSetActiveControl)
2846 pSetActiveControl = pCtrl;
2922 pButton->
SetText(sTmp.copy(0, 2));
2929 sAccName +=
" " + OUString::number(
nIndex);
2960 bool bPreStartLinkFound =
false;
2961 bool bPreEndLinkFound =
false;
2969 pControl = it->get();
2971 if( WindowType::EDIT != pControl->
GetType())
2974 static_cast<const SwTOXButton*
>(pControl)->GetFormToken();
2978 bPreStartLinkFound =
true;
2979 pExchange =
nullptr;
2983 if( bPreStartLinkFound )
2984 bPreStartLinkFound =
false;
2987 bPreEndLinkFound =
false;
2988 pExchange = pControl;
2994 bool bPostLinkStartFound =
false;
2996 if(!bPreStartLinkFound && !bPreEndLinkFound)
3000 pControl = it->get();
3003 WindowType::EDIT != pControl->
GetType())
3006 static_cast<const SwTOXButton*
>(pControl)->GetFormToken();
3010 if(bPostLinkStartFound)
3012 bPostLinkStartFound =
true;
3013 pExchange = pControl;
3017 if(bPostLinkStartFound)
3019 bPostLinkStartFound =
false;
3020 pExchange =
nullptr;
3028 if(bPreStartLinkFound)
3034 if(bPostLinkStartFound)
3036 OSL_ENSURE(pExchange,
"no control to exchange?");
3044 if(bPreEndLinkFound)
3046 OSL_ENSURE(pExchange,
"no control to exchange?");
3059 [
this](
const auto& rControl)
3061 SwTOXWidget* pCtrl = rControl.get();
3062 return pCtrl == m_pActiveCtrl;
3073 int nStartPos, nEndPos;
3077 const OUString sLeft = sEditText.copy( 0,
std::min(nStartPos, nEndPos) );
3078 const OUString sRight = sEditText.copy( std::max(nStartPos, nEndPos) );
3129 pButton->
SetText(sTmp.copy(0, 2));
3145 [pDel](
const auto& rControl)
3147 SwTOXWidget* pCtrl = rControl.get();
3148 return pCtrl == pDel;
3160 auto itLeft = it, itRight = it;
3167 static_cast<SwTOXEdit*
>(pRightEdit)->GetText());
3168 static_cast<SwTOXEdit*
>(pLeftEdit)->AdjustSize();
3211 auto nSpace =
m_xScrollWin->hadjustment_get_page_size();
3214 bool bEnable = nWidth > nSpace;
3219 int x,
y, width, height;
3222 if (x < nLeft || x + width > nLeft + nSpace)
3241 if (m_aControlList.empty())
3244 const auto nSpace = m_xScrollWin->hadjustment_get_page_size();
3245 const auto nWidth = m_xScrollWin->hadjustment_get_upper();
3246 const auto nLeft = m_xScrollWin->hadjustment_get_value();
3249 if (&rBtn == m_xLeftScrollWin.get())
3252 auto it = std::find_if(m_aControlList.begin(), m_aControlList.end(),
3253 [
this, nLeft](
const auto& rControl)
3255 SwTOXWidget* pCtrl = rControl.get();
3257 int x, y, width, height;
3258 pCtrl->get_extents_relative_to(*m_xCtrlParentWin, x, y, width, height);
3262 if (it != m_aControlList.end())
3264 if (it == m_aControlList.begin())
3275 int x,
y, width, height;
3285 auto it = std::find_if(m_aControlList.rbegin(), m_aControlList.rend(),
3286 [
this, nLeft, nSpace](
const auto& rControl) {
3287 SwTOXWidget* pCtrl = rControl.get();
3289 int x, y, width, height;
3290 pCtrl->get_extents_relative_to(*m_xCtrlParentWin, x, y, width, height);
3292 auto nXPos = x + width;
3293 return nXPos <= nLeft + nSpace;
3295 if (it != m_aControlList.rend() && it != m_aControlList.rbegin())
3302 int x,
y, width, height;
3305 nMove =
x + width - nSpace;
3314 MoveControls(nMove);
3315 m_xLeftScrollWin->set_sensitive(nMove > 0);
3316 m_xRightScrollWin->set_sensitive(nMove + nSpace < nWidth);
3322 OUStringBuffer sRet;
3330 :
static_cast<const SwTOXButton*
>(pCtrl)->GetFormToken();
3336 return sRet.makeStringAndClear();
3349 :
static_cast<const SwTOXButton*
>(pCtrl)->GetFormToken();
3387 m_aModifyHdl.Call(
nullptr);
3392 auto it = std::find_if(m_aControlList.begin(), m_aControlList.end(),
3393 [&rEdit](
const auto& rControl)
3395 SwTOXWidget* pCtrl = rControl.get();
3396 return pCtrl == &rEdit;
3399 if (it == m_aControlList.end())
3405 if ((it != m_aControlList.begin() && !rEdit.IsNextControl()) ||
3406 (itTest != m_aControlList.end() && rEdit.IsNextControl()))
3408 auto iterFocus = it;
3409 rEdit.IsNextControl() ? ++iterFocus : --iterFocus;
3422 for (
const auto& aControl : m_aControlList)
3425 if (pCtrl && pCtrl->
GetType() != WindowType::EDIT)
3429 SetActiveControl(pEdit);
3434 auto it = std::find_if(m_aControlList.begin(), m_aControlList.end(),
3435 [&rBtn](
const auto& rControl)
3437 SwTOXWidget* pCtrl = rControl.get();
3438 return pCtrl == &rBtn;
3441 if (it == m_aControlList.end())
3447 if (rBtn.IsNextControl() && (itTest == m_aControlList.end() || !rBtn.IsNextControl()))
3450 bool isNext = rBtn.IsNextControl();
3452 auto iterFocus = it;
3453 isNext ? ++iterFocus : --iterFocus;
3457 int nStartPos(0), nEndPos(0);
3461 const sal_Int32 nLen =
static_cast<SwTOXEdit*
>(pCtrlFocus)->GetText().getLength();
3467 static_cast<SwTOXEdit*
>(pCtrlFocus)->select_region(nStartPos, nEndPos);
3477 for (
const auto& aControl : m_aControlList)
3481 if (pControl && WindowType::EDIT != pControl->
GetType())
3485 SetActiveControl(pBtn);
3512 :
static_cast<const SwTOXButton*
>(pControl)->GetFormToken();
3524 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/tocstylespage.ui",
"TocStylesPage", &rAttrSet)
3525 , m_xLevelLB(m_xBuilder->weld_tree_view(
"levels"))
3526 , m_xAssignBT(m_xBuilder->weld_button(
"assign"))
3527 , m_xParaLayLB(m_xBuilder->weld_tree_view(
"styles"))
3528 , m_xStdBT(m_xBuilder->weld_button(
"default"))
3529 , m_xEditStyleBT(m_xBuilder->weld_button(
"edit"))
3532 auto nHeight =
m_xLevelLB->get_height_rows(16);
3581 for( sal_uInt16
i=1;
i < nSize; ++
i )
3609 for( sal_uInt16
i = 0;
i < nSz; ++
i )
3631 return DeactivateRC::LeavePage;
3637 return std::make_unique<SwTOXStylesTabPage>(pPage, pController, *rAttrSet);
3642 if (m_xParaLayLB->get_selected_index() != -1)
3644 SfxStringItem aStyle(SID_STYLE_EDIT, m_xParaLayLB->get_selected_text());
3645 SfxUInt16Item aFamily(SID_STYLE_FAMILY, sal_uInt16(SfxStyleFamily::Para));
3648 SfxCallMode::SYNCHRON,
3649 { &aStyle, &aFamily });
3656 auto nLevPos = m_xLevelLB->get_selected_index();
3657 auto nTemplPos = m_xParaLayLB->get_selected_index();
3658 if (nLevPos == -1 || nTemplPos == -1)
3663 + m_xParaLayLB->get_selected_text()
3666 m_pCurrentForm->SetTemplate(nLevPos, m_xParaLayLB->get_selected_text());
3668 m_xLevelLB->remove(nLevPos);
3669 m_xLevelLB->insert_text(nLevPos,
aStr);
3670 m_xLevelLB->select_text(
aStr);
3676 const auto nPos = m_xLevelLB->get_selected_index();
3680 m_xLevelLB->remove(
nPos);
3681 m_xLevelLB->insert_text(
nPos,
aStr);
3682 m_xLevelLB->select_text(
aStr);
3683 m_pCurrentForm->SetTemplate(
nPos, OUString());
3690 const OUString aTmpName(m_xParaLayLB->get_selected_text());
3693 if(m_xParaLayLB->get_selected_index() != -1 &&
3695 AssignHdl(*m_xAssignBT);
3703 m_xStdBT->set_sensitive(m_xLevelLB->get_selected_index() != -1);
3706 const OUString aTmpName(m_xParaLayLB->get_selected_text());
3707 m_xAssignBT->set_sensitive(m_xParaLayLB->get_selected_index() != -1 &&
3708 m_xLevelLB->get_selected_index() != -1 &&
3710 m_xEditStyleBT->set_sensitive(m_xParaLayLB->get_selected_index() != -1);
3723#define ITEM_SEARCH 1
3724#define ITEM_ALTERNATIVE 2
3725#define ITEM_PRIM_KEY 3
3726#define ITEM_SEC_KEY 4
3727#define ITEM_COMMENT 5
3729#define ITEM_WORDONLY 7
3731SwEntryBrowseBox::SwEntryBrowseBox(
const css::uno::Reference<css::awt::XWindow> &rParent)
3742 , m_aCellCheckBox(
VclPtr<
svt::CheckBoxControl>::
Create(&GetDataWindow()))
3744 , m_bModified(false)
3746 OUString sSearch =
SwResId(STR_AUTOMARK_SEARCHTERM);
3747 OUString sAlternative =
SwResId(STR_AUTOMARK_ALTERNATIVE);
3748 OUString sPrimKey =
SwResId(STR_AUTOMARK_KEY1);
3749 OUString sSecKey =
SwResId(STR_AUTOMARK_KEY2);
3750 OUString sComment =
SwResId(STR_AUTOMARK_COMMENT);
3751 OUString sCaseSensitive =
SwResId(STR_AUTOMARK_CASESENSITIVE);
3752 OUString sWordOnly =
SwResId(STR_AUTOMARK_WORDONLY);
3753 m_sYes =
SwResId(STR_AUTOMARK_YES);
3754 m_sNo =
SwResId(STR_AUTOMARK_NO);
3756 m_aCellCheckBox->EnableTriState(
false);
3757 m_xController = new ::svt::EditCellController(m_aCellEdit.get());
3758 m_xCheckController = new ::svt::CheckBoxCellController(m_aCellCheckBox.get());
3766 aStyle &= ~WB_CLIPCHILDREN;
3770 const OUString* aTitles[7] =
3784 for(sal_uInt16
i = 1;
i < 8;
i++)
3785 InsertDataColumn(
i, *aTitles[
i - 1], nWidth );
3788SwEntryBrowseBox::~SwEntryBrowseBox()
3795 m_aCellEdit.disposeAndClear();
3796 m_aCellCheckBox.disposeAndClear();
3800void SwEntryBrowseBox::Resize()
3805 std::vector<tools::Long> aWidths = GetOptimalColWidths();
3806 tools::Long nNaturalWidth(std::accumulate(aWidths.begin(), aWidths.end(), 0));
3807 tools::Long nExcess = ((nWidth - nNaturalWidth) / aWidths.size()) - 1;
3809 for (
size_t i = 0;
i < aWidths.size(); ++
i)
3810 SetColumnWidth(i+1, aWidths[i] + nExcess);
3813std::vector<tools::Long> SwEntryBrowseBox::GetOptimalColWidths()
const
3815 std::vector<tools::Long> aWidths;
3817 tools::Long nStandardColMinWidth = approximate_digit_width() * 15;
3818 tools::Long nYesNoWidth = approximate_digit_width() * 5;
3819 nYesNoWidth = std::max(nYesNoWidth, GetTextWidth(m_sYes));
3820 nYesNoWidth = std::max(nYesNoWidth, GetTextWidth(m_sNo));
3821 for (sal_uInt16 i = 1;
i < 6;
i++)
3823 tools::Long nColWidth = std::max(nStandardColMinWidth,
3824 GetTextWidth(GetColumnTitle(i)));
3826 aWidths.push_back(nColWidth);
3829 for (sal_uInt16 i = 6;
i < 8;
i++)
3832 GetTextWidth(GetColumnTitle(i)));
3834 aWidths.push_back(nColWidth);
3840Size SwEntryBrowseBox::GetOptimalSize()
const
3842 Size aSize = LogicToPixel(
Size(276 , 175),
MapMode(MapUnit::MapAppFont));
3844 std::vector<tools::Long> aWidths = GetOptimalColWidths();
3846 tools::Long nWidth(std::accumulate(aWidths.begin(), aWidths.end(), 0));
3853bool SwEntryBrowseBox::SeekRow( sal_Int32 nRow )
3855 m_nCurrentRow = nRow;
3859OUString SwEntryBrowseBox::GetCellText(sal_Int32 nRow, sal_uInt16 nColumn)
const
3864 const AutoMarkEntry* pEntry = m_Entries[ nRow ].get();
3872 case ITEM_CASE : pRet = pEntry->bCase ? m_sYes : m_sNo;
break;
3873 case ITEM_WORDONLY : pRet = pEntry->bWord ? m_sYes : m_sNo;
break;
3882 const DrawTextFlags nStyle = DrawTextFlags::Clip | DrawTextFlags::Center;
3883 rDev.
DrawText( rRect, GetCellText( m_nCurrentRow, nColumnId ), nStyle );
3888 return nCol <
ITEM_CASE ? m_xController.get() : m_xCheckController.get();
3891bool SwEntryBrowseBox::SaveModified()
3894 const size_t nRow = GetCurRow();
3895 const sal_uInt16 nCol = GetCurColumnId();
3902 pController = m_xController.get();
3907 pController = m_xCheckController.get();
3910 const bool bAddEntry = nRow >= m_Entries.size();
3911 std::unique_ptr<AutoMarkEntry> xNewEntry(bAddEntry ?
new AutoMarkEntry :
nullptr);
3912 AutoMarkEntry* pEntry = bAddEntry ? xNewEntry.get() : m_Entries[nRow].get();
3920 case ITEM_CASE : pEntry->bCase = bVal;
break;
3925 m_Entries.push_back(std::move(xNewEntry));
3926 RowInserted(nRow, 1,
true,
true);
3936void SwEntryBrowseBox::InitController(
3939 const OUString rText = GetCellText( nRow, nCol );
3942 rController = m_xController;
3948 rController = m_xCheckController;
3955void SwEntryBrowseBox::ReadEntries(
SvStream& rInStr)
3957 AutoMarkEntry* pToInsert =
nullptr;
3960 if (eTEnc == RTL_TEXTENCODING_DONTKNOW)
3961 eTEnc = osl_getThreadTextEncoding();
3962 while (rInStr.
good())
3971 if( !sLine.isEmpty() )
3975 if(
'#' != sLine[0] )
3978 pToInsert =
new AutoMarkEntry;
3980 sal_Int32 nSttPos = 0;
3981 pToInsert->sSearch = sLine.getToken(0,
';', nSttPos );
3982 pToInsert->sAlternative = sLine.getToken(0,
';', nSttPos );
3983 pToInsert->sPrimKey = sLine.getToken(0,
';', nSttPos );
3984 pToInsert->sSecKey = sLine.getToken(0,
';', nSttPos );
3986 std::u16string_view sStr =
o3tl::getToken(sLine, 0,
';', nSttPos );
3987 pToInsert->bCase = !sStr.empty() && sStr !=
u"0";
3990 pToInsert->bWord = !sStr.empty() && sStr !=
u"0";
3992 m_Entries.push_back(std::unique_ptr<AutoMarkEntry>(pToInsert));
3993 pToInsert =
nullptr;
3998 m_Entries.push_back(std::unique_ptr<AutoMarkEntry>(pToInsert));
3999 pToInsert =
new AutoMarkEntry;
4000 pToInsert->sComment = sLine.copy(1);
4005 m_Entries.push_back(std::unique_ptr<AutoMarkEntry>(pToInsert));
4006 RowInserted(0, m_Entries.size() + 1);
4009void SwEntryBrowseBox::WriteEntries(
SvStream& rOutStr)
4012 const sal_uInt16 nCol = GetCurColumnId();
4015 pController = m_xController.get();
4017 pController = m_xCheckController.get();
4019 GoToColumnId(nCol + (nCol <
ITEM_CASE ? 1 : -1 ));
4021 for(
const std::unique_ptr<AutoMarkEntry> & rpEntry : m_Entries)
4023 AutoMarkEntry* pEntry = rpEntry.get();
4024 if(!pEntry->sComment.isEmpty())
4027 rOutStr.
WriteByteStringLine( Concat2View(
"#" + pEntry->sComment), RTL_TEXTENCODING_UTF8 );
4030 OUString sWrite( pEntry->sSearch +
";" +
4031 pEntry->sAlternative +
";" +
4032 pEntry->sPrimKey +
";" +
4033 pEntry->sSecKey +
";" +
4034 (pEntry->bCase ? std::u16string_view(u
"1") : std::u16string_view(u
"0")) +
4036 (pEntry->bWord ? std::u16string_view(u
"1") : std::u16string_view(u
"0")) );
4038 if( sWrite.getLength() > 5 )
4044bool SwEntryBrowseBox::IsModified()
const
4050 const sal_uInt16 nCol = GetCurColumnId();
4053 pController = m_xController.get();
4055 pController = m_xCheckController.get();
4059SwAutoMarkDlg_Impl::SwAutoMarkDlg_Impl(
weld::Window* pParent, OUString aAutoMarkURL,
4061 : GenericDialogController(pParent,
"modules/swriter/ui/createautomarkdialog.ui",
"CreateAutomarkDialog")
4062 , m_sAutoMarkURL(
std::move(aAutoMarkURL))
4063 , m_bCreateMode(bCreate)
4064 , m_xOKPB(m_xBuilder->weld_button(
"ok"))
4065 , m_xTable(m_xBuilder->weld_container(
"area"))
4066 , m_xTableCtrlParent(m_xTable->CreateChildFrame())
4067 , m_xEntriesBB(
VclPtr<SwEntryBrowseBox>::
Create(m_xTableCtrlParent))
4069 m_xEntriesBB->Show();
4070 m_xOKPB->connect_clicked(
LINK(
this, SwAutoMarkDlg_Impl, OkHdl));
4073 bool bError =
false;
4075 m_xEntriesBB->RowInserted(0);
4078 SfxMedium aMed( m_sAutoMarkURL, StreamMode::STD_READ );
4079 if( aMed.GetInStream() && !aMed.GetInStream()->GetError() )
4080 m_xEntriesBB->ReadEntries( *aMed.GetInStream() );
4085 Size aPrefSize = m_xEntriesBB->GetOptimalSize();
4086 m_xTable->set_size_request(aPrefSize.
Width(), aPrefSize.
Height());
4092SwAutoMarkDlg_Impl::~SwAutoMarkDlg_Impl()
4094 m_xEntriesBB.disposeAndClear();
4095 m_xTableCtrlParent->dispose();
4096 m_xTableCtrlParent.clear();
4101 bool bError =
false;
4102 if (m_xEntriesBB->IsModified() || m_bCreateMode)
4105 m_bCreateMode ? StreamMode::WRITE
4106 : StreamMode::WRITE| StreamMode::TRUNC );
4112 m_xEntriesBB->WriteEntries( *pStrm );
Reference< XExecutableDialog > m_xDialog
@ CF_NUMBER
only the chapter number
@ CF_NUMBER_NOPREPST
only chapter number without post-/prefix
@ CF_NUM_NOPREPST_TITLE
chapter number without post-/prefix and title
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
virtual OUString GetCellText(sal_Int32 _nRow, sal_uInt16 _nColId) const
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
static SfxAbstractDialogFactory * Create()
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SvStream * GetOutStream()
void SetCurPageId(const OUString &rName)
void AddTabPage(const OUString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
const SfxItemSet * GetOutputItemSet() const
SfxItemSet * GetInputSetImpl()
virtual void PageCreated(const SfxAllItemSet &aSet)
SfxOkDialogController * GetDialogController() const
void SetExchangeSupport()
SfxDispatcher * GetDispatcher()
SfxViewFrame & GetViewFrame() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
constexpr tools::Long Width() const
sal_Int32 GetScrollBarSize() const
bool WriteByteStringLine(std::u16string_view rStr, rtl_TextEncoding eDestCharSet)
bool ReadByteStringLine(OUString &rStr, rtl_TextEncoding eSrcCharSet, sal_Int32 nMaxBytesToRead=0xFFFE)
void SetStreamCharSet(rtl_TextEncoding eCharSet)
bool SearchFile(OUString &rIniFile, Paths ePath=Paths::UserConfig)
const OUString & GetTemplatePath() const
const OUString & GetUserConfigPath() const
tools::Long GetWidth() const
const SwTOXSortKey * GetSortKey(sal_uInt16 nIdx) const
sal_Unicode GetPrefix() const
static OUString const & GetAuthFieldName(ToxAuthorityField eType)
static OUString const & GetAuthTypeName(ToxAuthorityType eType)
sal_Unicode GetSuffix() const
bool IsSortByDocument() const
sal_uInt16 GetSortKeyCount() const
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
size_t GetFieldTypeCount(SwFieldIds nResId=SwFieldIds::Unknown) const
count field types with a ResId, if SwFieldIds::Unknown count all
OUString const & GetTOIAutoMarkURL() const
AutoMark file.
SwTextFormatColl & GetTextFormatColl(sal_uInt16 nTextFormatColl) const
sal_uInt16 GetTextFormatCollCount() const
const SwTOXBase * GetDefaultTOXBase(TOXTypes eTyp, bool bCreate=false)
sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const
Manage types of content tables.
void SetDefaultTOXBase(const SwTOXBase &rBase)
SwFieldType * GetFieldType(size_t nField, SwFieldIds nResId=SwFieldIds::Unknown) const
get field types with a ResId, if 0 get all
SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId)
const SwTOXType * GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
Instances of SwFields and those derived from it occur 0 to n times.
virtual OUString GetName() const
Only in derived classes.
static SW_DLLPUBLIC rtl_TextEncoding GetTextEncoding(SvStream &)
const CurTOXType & GetCurrentTOXType() const
std::vector< TypeData > m_vTypeData
void CreateOrUpdateExample(TOXTypes nTOXIndex, sal_uInt16 nPage=0, sal_uInt16 nCurLevel=USHRT_MAX)
static bool IsNoNum(SwWrtShell &rSh, const OUString &rName)
sal_uInt16 m_nInitialTOXType
std::unique_ptr< SwTOXDescription > CreateTOXDescFromTOXBase(const SwTOXBase *pCurTOX)
virtual short Ok() override
std::unique_ptr< SwTOXMgr > m_pMgr
void SetCurrentTOXType(const CurTOXType &eSet)
std::unique_ptr< SwOneExampleFrame > m_xExampleFrame
virtual ~SwMultiTOXTabDialog() override
OUString m_sUserDefinedIndex
std::unique_ptr< weld::CheckButton > m_xShowExampleCB
SwTOXBase * m_pParamTOXBase
bool IsTOXEditMode() const
std::unique_ptr< weld::CustomWeld > m_xExampleFrameWin
SwWrtShell & GetWrtShell()
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
SwTOXDescription & GetTOXDescription(CurTOXType eTOXTypes)
CurTOXType m_eCurrentTOXType
SwForm * GetForm(CurTOXType eType)
SwMultiTOXTabDialog(weld::Widget *pParent, const SfxItemSet &rSet, SwWrtShell &rShell, SwTOXBase *pCurTOX, sal_uInt16 nToxType, bool bGlobal)
sal_uInt16 GetType() const
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
static const OUString & GetUIName(const OUString &rName, SwGetPoolIdFromName)
const OUString & GetSequenceName() const
const OUString & GetSortAlgorithm() const
bool IsLevelFromChapter() const
void SetTOXForm(const SwForm &rForm)
LanguageType GetLanguage() const
SwTOXElement GetCreateType() const
bool IsFromChapter() const
SwTOOElements GetOLEOptions() const
const SwForm & GetTOXForm() const
const OUString & GetMainEntryCharStyle() const
const SwTOXType * GetTOXType() const
sal_uInt16 GetLevel() const
bool IsFromObjectNames() const
OUString const & GetStyleNames(sal_uInt16 nLevel) const
SwTOIOptions GetOptions() const
const OUString & GetTitle() const
SwCaptionDisplay GetCaptionDisplay() const
void SetCaptionDisplay(SwCaptionDisplay eSet)
void SetTitle(const OUString &rSet)
const OUString & GetSortAlgorithm() const
void SetContentOptions(SwTOXElement nSet)
void SetTOUName(const OUString &rSet)
void SetStyleNames(const OUString &rSet, sal_uInt16 nLvl)
LanguageType GetLanguage() const
void SetLanguage(LanguageType nLang)
void SetLevelFromChapter(bool bSet)
SwTOXElement GetContentOptions() const
void SetForm(const SwForm &rSet)
bool IsFromChapter() const
sal_uInt8 GetLevel() const
bool IsCreateFromObjectNames() const
void SetSortKeys(SwTOXSortKey eKey1, SwTOXSortKey eKey2, SwTOXSortKey eKey3)
void SetSequenceName(const OUString &rSet)
void SetAuthBrackets(const OUString &rSet)
SwTOIOptions GetIndexOptions() const
void SetFromChapter(bool bSet)
void SetAutoMarkURL(const OUString &rSet)
SwCaptionDisplay GetCaptionDisplay() const
const OUString & GetSequenceName() const
const OUString & GetStyleNames(sal_uInt16 nLvl) const
void ApplyTo(SwTOXBase &rTOXBase)
void SetSortAlgorithm(const OUString &rSet)
std::optional< OUString > const & GetTitle() const
void SetCreateFromObjectNames(bool bSet)
void SetIndexOptions(SwTOIOptions nSet)
const OUString & GetAuthBrackets() const
void SetSortByDocument(bool bSet)
TOXTypes GetTOXType() const
void SetAuthSequence(bool bSet)
bool IsLevelFromChapter() const
void SetReadonly(bool bSet)
void SetLevel(sal_uInt8 nSet)
const OUString & GetMainEntryCharStyle() const
bool IsAuthSequence() const
void SetMainEntryCharStyle(const OUString &rSet)
void SetOLEOptions(SwTOOElements nOpt)
SwTOOElements GetOLEOptions() const
std::unique_ptr< weld::Entry > m_xEntry
DECL_LINK(ModifyHdl, weld::Entry &, void)
virtual void set_grid_left_attach(int nPos) override
void get_selection_bounds(int &rStartPos, int &rEndPos)
virtual ~SwTOXEdit() override
DECL_LINK(KeyInputHdl, const KeyEvent &, bool)
void SetAccessibleName(const OUString &rName)
const SwFormToken & GetFormToken()
void SetCharStyleName(const OUString &rSet, sal_uInt16 nPoolId)
SwTokenWindow * m_pParent
void SetText(const OUString &rText)
void SetModifyHdl(const Link< SwTOXEdit &, void > &rLink)
DECL_LINK(FocusInHdl, weld::Widget &, void)
bool IsNextControl() const
std::unique_ptr< weld::Builder > m_xBuilder
void SetPrevNextLink(const Link< SwTOXEdit &, void > &rLink)
virtual WindowType GetType() const override
virtual void get_extents_relative_to(weld::Widget &rRelative, int &x, int &y, int &width, int &height) override
Link< SwTOXEdit &, void > m_aModifiedLink
Link< SwTOXEdit &, void > m_aPrevNextControlLink
virtual void GrabFocus() override
SwTOXEdit(SwTokenWindow *pTokenWin, const SwFormToken &rToken)
void select_region(int nStartPos, int nEndPos)
virtual void Hide() override
void ShowHideControls(int eType)
virtual void ActivatePage(const SfxItemSet &) override
std::unique_ptr< weld::ComboBox > m_xFillCharCB
std::unique_ptr< weld::ToggleButton > m_xFirstSortDownRB
std::unique_ptr< weld::ComboBox > m_xFirstKeyLB
std::unique_ptr< weld::Button > m_xTabPB
std::unique_ptr< weld::ToggleButton > m_xSecondSortDownRB
std::unique_ptr< SwTokenWindow > m_xTokenWIN
std::unique_ptr< weld::Button > m_xPageNoPB
virtual void Reset(const SfxItemSet *) override
std::unique_ptr< weld::CheckButton > m_xAlphaDelimCB
std::unique_ptr< weld::ComboBox > m_xThirdKeyLB
std::unique_ptr< weld::ComboBox > m_xNumberFormatLB
format for numbering (E#)
std::unique_ptr< weld::Label > m_xLevelFT
std::unique_ptr< weld::ComboBox > m_xSecondKeyLB
std::unique_ptr< weld::Button > m_xEntryNoPB
std::unique_ptr< weld::ComboBox > m_xAuthFieldsLB
std::unique_ptr< weld::Button > m_xChapterInfoPB
CurTOXType m_aLastTOXType
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::CheckButton > m_xCommaSeparatedCB
void SetFocus2theAllBtn()
std::unique_ptr< weld::ToggleButton > m_xThirdSortDownRB
void SetWrtShell(SwWrtShell &rSh)
std::unique_ptr< weld::SpinButton > m_xEntryOutlineLevelNF
level to evaluate outline level to, for i53420
std::unique_ptr< weld::TreeView > m_xLevelLB
std::unique_ptr< weld::ComboBox > m_xCharStyleLB
std::unique_ptr< weld::ToggleButton > m_xSecondSortUpRB
void PreTokenButtonRemoved(const SwFormToken &rToken)
std::unique_ptr< weld::Widget > m_xSortingFrame
std::unique_ptr< weld::CheckButton > m_xAutoRightCB
std::unique_ptr< weld::Button > m_xEntryPB
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::RadioButton > m_xSortContentRB
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< weld::Widget > m_xSortKeyFrame
std::unique_ptr< weld::Button > m_xAllLevelsPB
std::unique_ptr< weld::ToggleButton > m_xFirstSortUpRB
std::unique_ptr< weld::Button > m_xEditStylePB
void OnModify(bool bAllLevels)
std::unique_ptr< weld::Label > m_xMainEntryStyleFT
SwTOXEntryTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
std::unique_ptr< weld::ComboBox > m_xMainEntryStyleLB
std::unique_ptr< weld::RadioButton > m_xSortDocPosRB
std::unique_ptr< weld::Label > m_xTypeFT
std::unique_ptr< weld::Button > m_xHyperLinkPB
std::unique_ptr< weld::Widget > m_xFormatFrame
std::unique_ptr< weld::MetricSpinButton > m_xTabPosMF
virtual ~SwTOXEntryTabPage() override
std::unique_ptr< weld::ToggleButton > m_xThirdSortUpRB
std::unique_ptr< weld::Widget > m_xFieldBox
std::unique_ptr< weld::Button > m_xAuthInsertPB
std::unique_ptr< weld::Button > m_xAuthRemovePB
std::unique_ptr< weld::ComboBox > m_xChapterEntryLB
std::unique_ptr< weld::CheckButton > m_xRelToStyleCB
Built on top of SwWrtShell, provides functionality to insert, update or perform other actions on vari...
std::unique_ptr< weld::CheckButton > m_xFromHeadingsCB
void LanguageHdl(const weld::ComboBox *)
std::unique_ptr< weld::RadioButton > m_xFromCaptionsRB
std::unique_ptr< weld::ComboBox > m_xCaptionSequenceLB
std::unique_ptr< weld::CheckButton > m_xCaseSensitiveCB
std::unique_ptr< weld::ComboBox > m_xDisplayTypeLB
OUString m_aStyleArr[MAXLEVEL]
bool m_bWaitingInitialSettings
std::unique_ptr< weld::RadioButton > m_xFromObjectNamesRB
std::unique_ptr< weld::CheckButton > m_xInitialCapsCB
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::Button > m_xAddStylesPB
std::unique_ptr< weld::CheckButton > m_xFromTablesCB
std::unique_ptr< weld::CheckButton > m_xParaStyleCB
std::unique_ptr< const IndexEntrySupplierWrapper > m_pIndexEntryWrapper
std::unique_ptr< SvxLanguageBox > m_xLanguageLB
OUString m_sAddStyleContent
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< weld::CheckButton > m_xFromFileCB
std::unique_ptr< weld::Entry > m_xTitleED
std::unique_ptr< weld::Label > m_xTypeFT
std::unique_ptr< weld::CheckButton > m_xAddStylesCB
virtual ~SwTOXSelectTabPage() override
std::unique_ptr< weld::ComboBox > m_xSortAlgorithmLB
std::unique_ptr< weld::CheckButton > m_xFromFramesCB
std::unique_ptr< weld::CheckButton > m_xUseDashCB
std::unique_ptr< weld::CheckButton > m_xSequenceCB
std::unique_ptr< weld::ComboBox > m_xBracketLB
std::unique_ptr< IndexEntryResource > m_pIndexRes
std::unique_ptr< weld::CheckButton > m_xTOXMarksCB
std::unique_ptr< weld::CheckButton > m_xFromOLECB
void ApplyTOXDescription()
std::unique_ptr< weld::CheckButton > m_xCollectSameCB
void FillTOXDescription()
virtual void Reset(const SfxItemSet *) override
std::unique_ptr< weld::CheckButton > m_xLevelFromChapterCB
SwTOXSelectTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
std::unique_ptr< weld::CheckButton > m_xKeyAsEntryCB
std::unique_ptr< weld::CheckButton > m_xStylesCB
std::unique_ptr< weld::TreeView > m_xFromObjCLB
void SetWrtShell(SwWrtShell const &rSh)
std::unique_ptr< weld::ComboBox > m_xTypeLB
std::unique_ptr< weld::ComboBox > m_xAreaLB
std::unique_ptr< weld::MenuButton > m_xAutoMarkPB
std::unique_ptr< weld::CheckButton > m_xReadOnlyCB
void SelectType(TOXTypes eSet)
virtual void ActivatePage(const SfxItemSet &) override
std::unique_ptr< weld::ComboBox > m_xParaStyleLB
std::unique_ptr< weld::SpinButton > m_xLevelNF
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::CheckButton > m_xFromGraphicsCB
std::unique_ptr< weld::CheckButton > m_xUseFFCB
SwTOXStylesTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::Button > m_xAssignBT
virtual void Reset(const SfxItemSet *) override
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< SwForm > m_pCurrentForm
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::Button > m_xEditStyleBT
virtual ~SwTOXStylesTabPage() override
virtual void ActivatePage(const SfxItemSet &) override
std::unique_ptr< weld::TreeView > m_xLevelLB
std::unique_ptr< weld::Button > m_xStdBT
std::unique_ptr< weld::TreeView > m_xParaLayLB
const OUString & GetTypeName() const
Represents the style of a paragraph.
bool IsAssignedToListLevelOfOutlineStyle() const
std::unique_ptr< weld::Container > m_xCtrlParentWin
OUString m_sAdditionalAccnameString3
std::unique_ptr< weld::ScrolledWindow > m_xScrollWin
std::vector< std::unique_ptr< SwTOXWidget > > m_aControlList
void RemoveControl(const SwTOXButton *pDel, bool bInternalCall=false)
Link< SwFormToken &, void > m_aButtonSelectedHdl
OUString m_sAdditionalAccnameString1
weld::Container * get_child_container()
void SetForm(SwForm &rForm, sal_uInt16 nLevel)
OUString GetPattern() const
SwTOXWidget * GetActiveControl()
OUString m_aButtonHelpTexts[TOKEN_END]
sal_uInt32 GetControlIndex(FormTokenType eType) const
OUString m_sAccessibleName
void SetFocus2theAllBtn()
SwTokenWindow(std::unique_ptr< weld::Container > xParent)
SwTOXWidget * InsertItem(const OUString &rText, const SwFormToken &aToken)
OUString CreateQuickHelp(const SwFormToken &rToken)
std::unique_ptr< weld::Button > m_xLeftScrollWin
void SetActiveControl(SwTOXWidget *pSet)
void InsertAtSelection(const SwFormToken &aToken)
bool Contains(FormTokenType) const
void MoveControls(tools::Long nOffset)
SwTOXEntryTabPage * m_pParent
OUString m_aButtonTexts[TOKEN_END]
OUString m_sAdditionalAccnameString2
Link< LinkParamNone *, void > m_aModifyHdl
std::unique_ptr< weld::Button > m_xRightScrollWin
SwTOXWidget * m_pActiveCtrl
SwDocShell * GetDocShell()
Used by the UI to modify the document model.
SwTextFormatColl * GetParaStyle(const OUString &rCollName, GetStyle eCreate=GETSTYLE_NOCREATE)
const SwView & GetView() const
virtual bool IsValueChangedFromSaved() const=0
virtual void SaveValue()=0
virtual CellController * GetController(sal_Int32 nRow, sal_uInt16 nCol)
virtual void PaintCell(OutputDevice &rDev, const tools::Rectangle &rRect, sal_uInt16 nColId) const=0
virtual void Resize() override
virtual bool SaveModified()
virtual bool SeekRow(sal_Int32 nRow) override
virtual bool IsModified() const
virtual void dispose() override
virtual void InitController(CellControllerRef &rController, sal_Int32 nRow, sal_uInt16 nCol)
sal_uInt16 GetCode() const
virtual void move(weld::Widget *pWidget, weld::Container *pNewParent)=0
std::pair< const TreeIter &, int > iter_col
#define FN_PARAM_TOX_TYPE
const TranslateId STR_TOKEN_HELP_ARY[]
IMPL_LINK(SwAddStylesDlg_Impl, HeaderBarClick, int, nColumn, void)
const sal_Unicode aDeliEnd
IMPL_LINK_NOARG(SwMultiTOXTabDialog, ShowPreviewHdl, weld::Toggleable &, void)
const TranslateId STR_TOKEN_ARY[]
static tools::Long lcl_TOXTypesToUserData(CurTOXType eType)
const sal_Unicode aDeliStart
static CurTOXType lcl_UserData2TOXTypes(sal_uInt16 nData)
static OUString lcl_CreateAutoMarkFileDlg(weld::Window *pParent, const OUString &rURL, const OUString &rFileString, bool bOpen)
::svt::EditBrowseBox SwEntryBrowseBox_Base
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
virtual void SetText(const OUString &rStr) override
std::u16string_view rNewToken
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr sal_uInt16 KEY_0
constexpr sal_uInt16 KEY_6
constexpr sal_uInt16 KEY_8
constexpr sal_uInt16 KEY_F3
constexpr sal_uInt16 KEY_7
constexpr sal_uInt16 KEY_1
constexpr sal_uInt16 KEY_ADD
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_4
constexpr sal_uInt16 KEY_5
constexpr sal_uInt16 KEY_9
constexpr sal_uInt16 KEY_3
constexpr sal_uInt16 KEY_A
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_2
constexpr sal_uInt16 KEY_SUBTRACT
#define LINK(Instance, Class, Member)
Sequence< sal_Int8 > aSeq
#define SAL_WARN_IF(condition, area, stream)
#define SAL_N_ELEMENTS(arr)
constexpr OUStringLiteral first
const SwGetSetExpType GSE_SEQ
Sequence.
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Reference< XNameAccess > m_xContainer
@ RES_POOLCOLL_LABEL_FIGURE
Label figure.
@ RES_POOLCOLL_LABEL_TABLE
Label table.
@ RES_POOLCHR_IDX_MAIN_ENTRY
Main entry in indices.
sal_uInt16 GetFlatIndex() const
OUString SwResId(TranslateId aId)
constexpr sal_uInt8 MAXLEVEL
#define FORM_ALPHA_DELIMITER
#define TOX_STYLE_DELIMITER
std::vector< SwFormToken > SwFormTokens
Vector of tokens.
WinBits const WB_CLIPCHILDREN