23#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
25#include <com/sun/star/beans/PropertyValue.hpp>
26#include <com/sun/star/beans/XPropertySet.hpp>
27#include <com/sun/star/frame/Bibliography.hpp>
28#include <com/sun/star/i18n/IndexEntrySupplier.hpp>
29#include <com/sun/star/util/SearchAlgorithms2.hpp>
30#include <com/sun/star/util/SearchFlags.hpp>
31#include <com/sun/star/uri/UriReferenceFactory.hpp>
32#include <rtl/ustrbuf.hxx>
41#include <osl/diagnose.h>
77bool SplitUrlAndPage(
const OUString& rText, OUString& rUrl,
int& nPageNumber)
79 uno::Reference<uri::XUriReferenceFactory> xUriReferenceFactory
81 uno::Reference<uri::XUriReference> xUriRef;
84 xUriRef = xUriReferenceFactory->parse(rText);
86 catch (
const uno::Exception& rException)
88 SAL_WARN(
"sw.ui",
"SplitUrlAndPage: failed to parse url: " << rException.Message);
92 OUString aPagePrefix(
"page=");
93 if (!xUriRef->getFragment().startsWith(aPagePrefix))
98 nPageNumber =
o3tl::toInt32(xUriRef->getFragment().subView(aPagePrefix.getLength()));
99 xUriRef->clearFragment();
100 rUrl = xUriRef->getUriReference();
104OUString MergeUrlAndPage(
const OUString& rUrl,
const std::unique_ptr<weld::SpinButton>& xPageSB)
106 if (!xPageSB->get_sensitive())
111 uno::Reference<uri::XUriReferenceFactory> xUriReferenceFactory
113 uno::Reference<uri::XUriReference> xUriRef;
116 xUriRef = xUriReferenceFactory->parse(rUrl);
118 catch (
const uno::Exception& rException)
120 SAL_WARN(
"sw.ui",
"MergeUrlAndPage: failed to parse url: " << rException.Message);
124 OUString aFragment(
"page=" + OUString::number(xPageSB->get_value()));
125 xUriRef->setFragment(aFragment);
126 return xUriRef->getUriReference();
135 , m_bNewMark(bNewDlg)
137 , m_bPhoneticED0_ChangedByUser(false)
138 , m_bPhoneticED1_ChangedByUser(false)
139 , m_bPhoneticED2_ChangedByUser(false)
141 , m_bIsPhoneticReadingEnabled(false)
143 , m_xTypeFT(rBuilder.weld_label(
"typeft"))
144 , m_xTypeDCB(rBuilder.weld_combo_box(
"typecb"))
145 , m_xNewBT(rBuilder.weld_button(
"new"))
146 , m_xEntryED(rBuilder.weld_entry(
"entryed"))
147 , m_xSyncED(rBuilder.weld_button(
"sync"))
148 , m_xPhoneticFT0(rBuilder.weld_label(
"phonetic0ft"))
149 , m_xPhoneticED0(rBuilder.weld_entry(
"phonetic0ed"))
150 , m_xKey1FT(rBuilder.weld_label(
"key1ft"))
151 , m_xKey1DCB(rBuilder.weld_combo_box(
"key1cb"))
152 , m_xPhoneticFT1(rBuilder.weld_label(
"phonetic1ft"))
153 , m_xPhoneticED1(rBuilder.weld_entry(
"phonetic1ed"))
154 , m_xKey2FT(rBuilder.weld_label(
"key2ft"))
155 , m_xKey2DCB(rBuilder.weld_combo_box(
"key2cb"))
156 , m_xPhoneticFT2(rBuilder.weld_label(
"phonetic2ft"))
157 , m_xPhoneticED2(rBuilder.weld_entry(
"phonetic2ed"))
158 , m_xLevelFT(rBuilder.weld_label(
"levelft"))
159 , m_xLevelNF(rBuilder.weld_spin_button(
"levelnf"))
160 , m_xMainEntryCB(rBuilder.weld_check_button(
"mainentrycb"))
161 , m_xApplyToAllCB(rBuilder.weld_check_button(
"applytoallcb"))
162 , m_xSearchCaseSensitiveCB(rBuilder.weld_check_button(
"searchcasesensitivecb"))
163 , m_xSearchCaseWordOnlyCB(rBuilder.weld_check_button(
"searchcasewordonlycb"))
164 , m_xOKBT(bNewDlg ? rBuilder.weld_button(
"insert") : rBuilder.weld_button(
"ok"))
165 , m_xCloseBT(rBuilder.weld_button(
"close"))
166 , m_xDelBT(rBuilder.weld_button(
"delete"))
167 , m_xPrevSameBT(rBuilder.weld_button(
"first"))
168 , m_xNextSameBT(rBuilder.weld_button(
"last"))
169 , m_xPrevBT(rBuilder.weld_button(
"previous"))
170 , m_xNextBT(rBuilder.weld_button(
"next"))
171 , m_xForSelectedEntry(rBuilder.weld_label(
"selectedentrytitle"))
237 assert(pType &&
"No directory type !!");
238 OUString sTmpTypeSelection;
240 sTmpTypeSelection =
m_xTypeDCB->get_active_text();
246 assert(pType &&
"No directory type !!");
256 std::vector<OUString>
aArr;
258 std::sort(
aArr.begin(),
aArr.end());
260 for (
auto it =
aArr.begin(); it !=
last; ++it)
266 std::vector<OUString>
aArr;
268 std::sort(
aArr.begin(),
aArr.end());
270 for (
auto it =
aArr.begin(); it !=
last; ++it)
290 if( pMoveMark != pMark )
295 m_xPrevBT->set_sensitive(pMoveMark != pMark);
297 if( pMoveMark != pMark )
302 m_xNextBT->set_sensitive(pMoveMark != pMark);
311 if( pMoveMark != pMark )
318 if( pMoveMark != pMark )
359 if (!sTmpTypeSelection.isEmpty() &&
m_xTypeDCB->find_text(sTmpTypeSelection) != -1)
360 m_xTypeDCB->set_active_text(sTmpTypeSelection);
384 OSL_ENSURE(pMark,
"need current SwTOXMark");
388 OSL_ENSURE(pTextTOXMark,
"need current SwTextTOXMark");
392 OSL_ENSURE(pTextNode,
"need current SwTextNode");
395 sal_Int32 nTextIndex = pTextTOXMark->
GetStart();
433 m_bSelected = !m_pSh->HasSelection();
434 m_aOrgStr = m_pSh->GetView().GetSelectionTextParam(
true,
false);
435 m_xEntryED->set_text(m_aOrgStr);
439 const FrameTypeFlags nFrameType = m_pSh->GetFrameType(
nullptr,
true);
440 m_xApplyToAllCB->show();
441 m_xSearchCaseSensitiveCB->show();
442 m_xSearchCaseWordOnlyCB->show();
443 m_xApplyToAllCB->set_sensitive(!m_aOrgStr.isEmpty() &&
445 SearchTypeHdl(*m_xApplyToAllCB);
446 ModifyHdl(*m_xEntryED);
501 ( bWordOnly ? SearchFlags::NORM_WORD_ONLY : 0 ),
506 ? TransliterationFlags::NONE
507 : TransliterationFlags::IGNORE_CASE),
508 SearchAlgorithms2::ABSOLUTE,
575 if(pAltText && pAltText->isEmpty())
592 OUString aPrim(
m_xKey1DCB->get_active_text());
614 if(
nPos == -1 && !aKey.isEmpty())
622 if(
nPos == -1 && !aKey.isEmpty())
634 std::unique_ptr<weld::Button> m_xOKPB;
635 std::unique_ptr<weld::Entry> m_xNameED;
641 : GenericDialogController(pParent,
"modules/swriter/ui/newuserindexdialog.ui",
"NewUserIndexDialog")
643 , m_xOKPB(m_xBuilder->weld_button(
"ok"))
644 , m_xNameED(m_xBuilder->weld_entry(
"entry"))
646 m_xNameED->connect_changed(
LINK(
this, SwNewUserIdxDlg, ModifyHdl));
647 m_xOKPB->set_sensitive(
false);
648 m_xNameED->grab_focus();
650 OUString
GetName()
const {
return m_xNameED->get_text(); }
657 m_xOKPB->set_sensitive(!rEdit.get_text().isEmpty() && !m_pDlg->
IsTOXType(rEdit.get_text()));
662 SwNewUserIdxDlg aDlg(
this,
m_xDialog.get());
665 OUString sNewName(aDlg.GetName());
666 m_xTypeDCB->append_text(sNewName);
667 m_xTypeDCB->set_active_text(sNewName);
673 const bool bEnable = rBox.get_active() && rBox.get_sensitive();
674 m_xSearchCaseWordOnlyCB->set_sensitive(bEnable);
675 m_xSearchCaseSensitiveCB->set_sensitive(bEnable);
682 if(!m_bNewMark && !m_xPrevBT->get_visible() && !m_xNextBT->get_visible())
693 SfxCallMode::ASYNCHRON|SfxCallMode::RECORD);
719 bool bLevelEnable =
false,
723 bEntryHasText =
false,
724 bKey1HasText =
false,
725 bKey2HasText =
false;
729 bEntryHasText =
true;
737 bKey1HasText = bSetKey2 = bKey2Enable =
true;
771 bool bHasText = !
m_xEntryED->get_text().isEmpty();
790 m_pTOXMgr->NextTOXMark();
797 m_pTOXMgr->NextTOXMark(
true);
804 m_pTOXMgr->PrevTOXMark();
811 m_pTOXMgr->PrevTOXMark(
true);
821 if(m_pTOXMgr->GetCurTOXMark())
825 CloseHdl(*m_xCloseBT);
836 OSL_ENSURE(pMark,
"no current marker");
846 bool bLevelEnable =
true,
849 bEntryHasText =
false,
850 bKey1HasText =
false,
851 bKey2HasText =
false;
856 bLevelEnable =
false;
858 bKey1HasText = bKey2Enable = !pMark->
GetPrimaryKey().isEmpty();
897 if( pMoveMark != pMark )
899 m_xPrevBT->set_sensitive( pMoveMark != pMark );
901 if( pMoveMark != pMark )
903 m_xNextBT->set_sensitive( pMoveMark != pMark );
909 if( pMoveMark != pMark )
913 if( pMoveMark != pMark )
919 m_xOKBT->set_sensitive(bEnable);
936 if (m_xPhoneticED0.get() == &rEdit)
938 m_bPhoneticED0_ChangedByUser = !rEdit.get_text().isEmpty();
940 else if (m_xPhoneticED1.get() == &rEdit)
942 m_bPhoneticED1_ChangedByUser = !rEdit.get_text().isEmpty();
944 else if (m_xPhoneticED2.get() == &rEdit)
946 m_bPhoneticED2_ChangedByUser = !rEdit.get_text().isEmpty();
953 if (m_xKey1DCB.get() == &rBox)
955 bool bEnable = !rBox.get_active_text().isEmpty();
958 m_xKey2DCB->set_entry_text(OUString());
959 m_xPhoneticED1->set_text(OUString());
960 m_xPhoneticED2->set_text(OUString());
961 m_bPhoneticED1_ChangedByUser =
false;
962 m_bPhoneticED2_ChangedByUser =
false;
966 if (rBox.get_popup_shown())
969 m_bPhoneticED1_ChangedByUser =
false;
971 if (!m_bPhoneticED1_ChangedByUser)
972 m_xPhoneticED1->set_text(GetDefaultPhoneticReading(rBox.get_active_text()));
974 m_xKey2DCB->set_sensitive(bEnable);
975 m_xKey2FT->set_sensitive(bEnable);
977 else if (m_xKey2DCB.get() == &rBox)
979 if (rBox.get_active_text().isEmpty())
981 m_xPhoneticED2->set_text(OUString());
982 m_bPhoneticED2_ChangedByUser =
false;
986 if (rBox.get_popup_shown())
989 m_bPhoneticED2_ChangedByUser =
false;
991 if(!m_bPhoneticED2_ChangedByUser)
992 m_xPhoneticED2->set_text(GetDefaultPhoneticReading(rBox.get_active_text()));
996 bool bKey1HasText = !m_xKey1DCB->get_active_text().isEmpty();
997 bool bKey2HasText = !m_xKey2DCB->get_active_text().isEmpty();
999 m_xPhoneticFT1->set_sensitive(bKey1HasText && m_bIsPhoneticReadingEnabled);
1000 m_xPhoneticED1->set_sensitive(bKey1HasText && m_bIsPhoneticReadingEnabled);
1001 m_xPhoneticFT2->set_sensitive(bKey2HasText && m_bIsPhoneticReadingEnabled);
1002 m_xPhoneticED2->set_sensitive(bKey2HasText && m_bIsPhoneticReadingEnabled);
1015 for(sal_uInt16
i = 0;
i <
m_pTOXMgr->GetTOXMarkCount();
i++)
1029 "modules/swriter/ui/indexentry.ui",
"IndexEntryDialog")
1063 short nRet = SfxDialogController::run();
1073 std::vector<std::unique_ptr<weld::Builder>> m_aBuilders;
1079 bool m_bNewEntryMode;
1080 bool m_bNameAllowed;
1082 std::vector<std::unique_ptr<weld::Container>> m_aOrigContainers;
1083 std::vector<std::unique_ptr<weld::Label>> m_aFixedTexts;
1086 std::unique_ptr<weld::Button> m_xOKBT;
1087 std::unique_ptr<weld::Container> m_xBox;
1088 std::unique_ptr<weld::Container> m_xLeft;
1089 std::unique_ptr<weld::Container> m_xRight;
1090 std::unique_ptr<weld::ComboBox> m_xTypeListBox;
1091 std::unique_ptr<weld::ComboBox> m_xIdentifierBox;
1092 std::unique_ptr<weld::Button> m_xLocalBrowseButton;
1093 std::unique_ptr<weld::CheckButton> m_xLocalPageCB;
1094 std::unique_ptr<weld::SpinButton> m_xLocalPageSB;
1095 std::unique_ptr<weld::ComboBox> m_xTargetTypeListBox;
1107 const OUString pFields[],
1121 const OUString pHelpId;
1164static OUString
lcl_FindColumnEntry(
const uno::Sequence<beans::PropertyValue>& rFields, std::u16string_view rColumnTitle)
1166 for(
const auto& rField : rFields)
1169 if(rField.Name == rColumnTitle &&
1170 (rField.Value >>= sRet))
1181 : m_rDialog(rDialog)
1182 , m_bNewEntry(bNewDlg)
1183 , m_bBibAccessInitialized(false)
1185 , m_xFromComponentRB(rBuilder.weld_radio_button(
"frombibliography"))
1186 , m_xFromDocContentRB(rBuilder.weld_radio_button(
"fromdocument"))
1187 , m_xAuthorFI(rBuilder.weld_label(
"author"))
1188 , m_xTitleFI(rBuilder.weld_label(
"title"))
1189 , m_xEntryED(rBuilder.weld_entry(
"entryed"))
1190 , m_xEntryLB(rBuilder.weld_combo_box(
"entrylb"))
1191 , m_xActionBT(rBuilder.weld_button(m_bNewEntry ? OUString(
"insert") : OUString(
"modify")))
1192 , m_xCloseBT(rBuilder.weld_button(
"close"))
1193 , m_xCreateEntryPB(rBuilder.weld_button(
"new"))
1194 , m_xEditEntryPB(rBuilder.weld_button(
"edit"))
1211 m_bNewEntry ? STR_AUTHMRK_INSERT : STR_AUTHMRK_EDIT));
1236 SfxCallMode::ASYNCHRON|SfxCallMode::RECORD);
1247 const OUString sEntry(rBox.get_active_text());
1248 if(s_bIsFromComponent)
1250 if(m_xBibAccess.is() && !sEntry.isEmpty())
1252 if(m_xBibAccess->hasByName(sEntry))
1254 uno::Any aEntry(m_xBibAccess->getByName(sEntry));
1255 uno::Sequence<beans::PropertyValue> aFieldProps;
1256 if(aEntry >>= aFieldProps)
1259 for(sal_Int32
i = 0;
i < nSize;
i++)
1269 if(!sEntry.isEmpty())
1275 m_sFields[
i] = pEntry ?
1279 if (rBox.get_active_text().isEmpty())
1281 for(OUString & s : m_sFields)
1293 bool bDifferent =
false;
1309 VclMessageType::Question, VclButtonsType::YesNo,
1310 SwResId(STR_QUERY_CHANGE_AUTH_ENTRY)));
1317 OUStringBuffer sFields;
1318 for(OUString & s : m_sFields)
1329 m_pSh->ChangeAuthorityData(xNewData.get());
1336 aMgr.
UpdateCurField(0, sFields.makeStringAndClear(), OUString());
1340 CloseHdl(*m_xCloseBT);
1345 bool bCreate = &rButton == m_xCreateEntryPB.get();
1346 OUString sOldId = m_sCreatedEntry[0];
1348 m_sCreatedEntry[
i] = bCreate ? OUString() : m_sFields[
i];
1349 SwCreateAuthEntryDlg_Impl aDlg(m_rDialog.getDialog(),
1350 bCreate ? m_sCreatedEntry : m_sFields,
1351 *m_pSh, m_bNewEntry, bCreate);
1359 if(bCreate && !sOldId.isEmpty())
1361 m_xEntryLB->remove_text(sOldId);
1366 m_sCreatedEntry[
i] = m_sFields[
i];
1368 if(m_bNewEntry && !m_xFromDocContentRB->get_active())
1370 m_xFromDocContentRB->set_active(
true);
1371 ChangeSourceHdl(*m_xFromDocContentRB);
1383 m_xActionBT->set_sensitive(
true);
1389 InsertHdl(*m_xActionBT);
1395 bool bFromComp = m_xFromComponentRB->get_active();
1396 s_bIsFromComponent = bFromComp;
1397 m_xCreateEntryPB->set_sensitive(!s_bIsFromComponent);
1398 m_xEntryLB->clear();
1399 if(s_bIsFromComponent)
1401 if(!m_bBibAccessInitialized)
1404 m_xBibAccess = frame::Bibliography::create( xContext );
1405 uno::Reference< beans::XPropertySet > xPropSet(m_xBibAccess, uno::UNO_QUERY);
1406 OUString uPropName(
"BibliographyDataFieldNames");
1407 if(xPropSet.is() && xPropSet->getPropertySetInfo()->hasPropertyByName(uPropName))
1409 uno::Any aNames = xPropSet->getPropertyValue(uPropName);
1410 uno::Sequence<beans::PropertyValue>
aSeq;
1411 if( aNames >>=
aSeq)
1413 for(
const beans::PropertyValue& rProp : std::as_const(
aSeq))
1415 sal_Int16 nField = 0;
1416 rProp.Value >>= nField;
1418 m_sColumnTitles[nField] = rProp.Name;
1422 m_bBibAccessInitialized =
true;
1424 if(m_xBibAccess.is())
1426 const uno::Sequence<OUString> aIdentifiers = m_xBibAccess->getElementNames();
1427 for(
const OUString& rName : aIdentifiers)
1428 m_xEntryLB->append_text(rName);
1437 std::vector<OUString> aIds;
1439 for(
const OUString &
i : aIds)
1440 m_xEntryLB->append_text(
i);
1445 m_xEntryLB->set_active(0);
1446 CompEntryHdl(*m_xEntryLB);
1452 bool bResult = aAllowed.
Call(rEdit);
1453 m_xActionBT->set_sensitive(bResult);
1456 OUString sEntry(rEdit.get_text());
1464 OUString sEntry = rEdit.get_text();
1465 bool bAllowed =
false;
1466 if(!sEntry.isEmpty())
1468 if (m_xEntryLB->find_text(sEntry) != -1)
1470 else if(s_bIsFromComponent)
1478 bAllowed = !m_xBibAccess.is() || !m_xBibAccess->hasByName(sEntry);
1486 OUString sEntry = rEdit.get_text();
1487 bool bAllowed =
false;
1488 if(!sEntry.isEmpty())
1490 if (m_xEntryLB->find_text(sEntry) != -1)
1492 else if(s_bIsFromComponent)
1500 bAllowed = !m_xBibAccess.is() || !m_xBibAccess->hasByName(sEntry);
1508 OSL_ENSURE(
m_pSh,
"no shell?");
1510 OSL_ENSURE(
m_bNewEntry || pField,
"no current marker");
1524 OSL_ENSURE(pEntry,
"No authority entry found");
1544 STR_AUTH_FIELD_IDENTIFIER,
1545 STR_AUTH_FIELD_AUTHORITY_TYPE,
1546 STR_AUTH_FIELD_ADDRESS,
1547 STR_AUTH_FIELD_ANNOTE,
1548 STR_AUTH_FIELD_AUTHOR,
1549 STR_AUTH_FIELD_BOOKTITLE,
1550 STR_AUTH_FIELD_CHAPTER,
1551 STR_AUTH_FIELD_EDITION,
1552 STR_AUTH_FIELD_EDITOR,
1553 STR_AUTH_FIELD_HOWPUBLISHED,
1554 STR_AUTH_FIELD_INSTITUTION,
1555 STR_AUTH_FIELD_JOURNAL,
1556 STR_AUTH_FIELD_MONTH,
1557 STR_AUTH_FIELD_NOTE,
1558 STR_AUTH_FIELD_NUMBER,
1559 STR_AUTH_FIELD_ORGANIZATIONS,
1560 STR_AUTH_FIELD_PAGES,
1561 STR_AUTH_FIELD_PUBLISHER,
1562 STR_AUTH_FIELD_SCHOOL,
1563 STR_AUTH_FIELD_SERIES,
1564 STR_AUTH_FIELD_TITLE,
1565 STR_AUTH_FIELD_TYPE,
1566 STR_AUTH_FIELD_VOLUME,
1567 STR_AUTH_FIELD_YEAR,
1569 STR_AUTH_FIELD_CUSTOM1,
1570 STR_AUTH_FIELD_CUSTOM2,
1571 STR_AUTH_FIELD_CUSTOM3,
1572 STR_AUTH_FIELD_CUSTOM4,
1573 STR_AUTH_FIELD_CUSTOM5,
1574 STR_AUTH_FIELD_ISBN,
1575 STR_AUTH_FIELD_LOCAL_URL,
1576 STR_AUTH_FIELD_TARGET_TYPE,
1577 STR_AUTH_FIELD_TARGET_URL,
1581SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(
weld::Window* pParent,
1582 const OUString pFields[],
1586 : GenericDialogController(pParent,
"modules/swriter/ui/createauthorentry.ui",
"CreateAuthorEntryDialog")
1588 , m_bNewEntryMode(bNewEntry)
1589 , m_bNameAllowed(true)
1590 , m_xOKBT(m_xBuilder->weld_button(
"ok"))
1591 , m_xBox(m_xBuilder->weld_container(
"box"))
1592 , m_xLeft(m_xBuilder->weld_container(
"leftgrid"))
1593 , m_xRight(m_xBuilder->weld_container(
"rightgrid"))
1594 , m_pTargetURLField(nullptr)
1597 sal_Int32 nLeftRow(0), nRightRow(0);
1604 m_aOrigContainers.emplace_back(m_aBuilders.back()->weld_container(
"biblioentry"));
1605 m_aFixedTexts.emplace_back(m_aBuilders.back()->weld_label(
"label"));
1607 m_aOrigContainers.back()->move(m_aFixedTexts.back().get(), m_xLeft.get());
1609 m_aOrigContainers.back()->move(m_aFixedTexts.back().get(), m_xRight.get());
1610 m_aFixedTexts.back()->set_grid_left_attach(0);
1611 m_aFixedTexts.back()->set_grid_top_attach(bLeft ? nLeftRow : nRightRow);
1612 m_aFixedTexts.back()->set_label(
SwResId(STR_AUTH_FIELD_ARY[aCurInfo.nToxField]));
1613 m_aFixedTexts.back()->show();
1616 m_xTypeListBox = m_aBuilders.back()->weld_combo_box(
"listbox");
1618 m_aOrigContainers.back()->move(m_xTypeListBox.get(), m_xLeft.get());
1620 m_aOrigContainers.back()->move(m_xTypeListBox.get(), m_xRight.get());
1624 m_xTypeListBox->append_text(
1627 if(!pFields[aCurInfo.nToxField].isEmpty())
1629 m_xTypeListBox->set_active(pFields[aCurInfo.nToxField].toInt32());
1631 m_xTypeListBox->set_grid_left_attach(1);
1632 m_xTypeListBox->set_grid_top_attach(bLeft ? nLeftRow : nRightRow);
1633 m_xTypeListBox->set_hexpand(
true);
1634 m_xTypeListBox->show();
1635 m_xTypeListBox->connect_changed(
LINK(
this, SwCreateAuthEntryDlg_Impl, EnableHdl));
1636 m_xTypeListBox->set_help_id(aCurInfo.pHelpId);
1637 m_aFixedTexts.back()->set_mnemonic_widget(m_xTypeListBox.get());
1641 m_xIdentifierBox = m_aBuilders.back()->weld_combo_box(
"combobox");
1643 m_aOrigContainers.back()->move(m_xIdentifierBox.get(), m_xLeft.get());
1645 m_aOrigContainers.back()->move(m_xIdentifierBox.get(), m_xRight.get());
1647 m_xIdentifierBox->connect_changed(
LINK(
this,
1648 SwCreateAuthEntryDlg_Impl, IdentifierHdl));
1654 std::vector<OUString> aIds;
1656 for (
const OUString& a : aIds)
1657 m_xIdentifierBox->append_text(a);
1659 m_xIdentifierBox->set_entry_text(pFields[aCurInfo.nToxField]);
1660 m_xIdentifierBox->set_grid_left_attach(1);
1661 m_xIdentifierBox->set_grid_top_attach(bLeft ? nLeftRow : nRightRow);
1662 m_xIdentifierBox->set_hexpand(
true);
1663 m_xIdentifierBox->show();
1664 m_xIdentifierBox->set_help_id(aCurInfo.pHelpId);
1665 m_aFixedTexts.back()->set_mnemonic_widget(m_xIdentifierBox.get());
1669 m_xTargetTypeListBox = m_aBuilders.back()->weld_combo_box(
"listbox-target-type");
1671 m_aOrigContainers.back()->move(m_xTargetTypeListBox.get(), m_xLeft.get());
1673 m_aOrigContainers.back()->move(m_xTargetTypeListBox.get(), m_xRight.get());
1675 if(!pFields[aCurInfo.nToxField].isEmpty())
1677 m_xTargetTypeListBox->set_active(pFields[aCurInfo.nToxField].toInt32());
1679 else if(m_bNewEntryMode)
1682 m_xTargetTypeListBox->set_active(SwAuthorityField::TargetType::BibliographyTableRow);
1684 m_xTargetTypeListBox->set_grid_left_attach(1);
1685 m_xTargetTypeListBox->set_grid_top_attach(bLeft ? nLeftRow : nRightRow);
1686 m_xTargetTypeListBox->set_hexpand(
true);
1687 m_xTargetTypeListBox->show();
1688 m_xTargetTypeListBox->connect_changed(
LINK(
this, SwCreateAuthEntryDlg_Impl, TargetTypeHdl));
1689 m_xTargetTypeListBox->set_help_id(aCurInfo.pHelpId);
1690 m_aFixedTexts.back()->set_mnemonic_widget(m_xTargetTypeListBox.get());
1694 m_pBoxes[
nIndex] = m_aBuilders.back()->weld_box(
"vbox");
1695 m_pEdits[
nIndex] = m_aBuilders.back()->weld_entry(
"entry");
1699 m_pTargetURLField = m_pEdits[
nIndex].get();
1700 assert(m_xTargetTypeListBox);
1701 m_pTargetURLField->set_sensitive(
1702 m_xTargetTypeListBox->get_active() == SwAuthorityField::TargetType::UseTargetURL);
1706 m_aOrigContainers.back()->move(m_pBoxes[nIndex].
get(), m_xLeft.get());
1708 m_aOrigContainers.back()->move(m_pBoxes[nIndex].
get(), m_xRight.get());
1710 m_pBoxes[
nIndex]->set_grid_left_attach(1);
1711 m_pBoxes[
nIndex]->set_grid_top_attach(bLeft ? nLeftRow : nRightRow);
1712 m_pBoxes[
nIndex]->set_hexpand(
true);
1715 m_xLocalBrowseButton = m_aBuilders.back()->weld_button(
"browse");
1716 m_xLocalBrowseButton->connect_clicked(
1717 LINK(
this, SwCreateAuthEntryDlg_Impl, BrowseHdl));
1718 m_xLocalPageCB = m_aBuilders.back()->weld_check_button(
"pagecb");
1720 m_xLocalPageCB->set_buildable_name(m_xLocalPageCB->get_buildable_name()
1721 +
"-local-visible");
1722 m_xLocalPageSB = m_aBuilders.back()->weld_spin_button(
"pagesb");
1726 OUString aText = pFields[aCurInfo.nToxField];
1731 if (SplitUrlAndPage(aText, aUrl, nPageNumber))
1733 m_pEdits[
nIndex]->set_text(aUrl);
1734 m_xLocalPageCB->set_active(
true);
1735 m_xLocalPageSB->set_sensitive(
true);
1736 m_xLocalPageSB->set_value(nPageNumber);
1740 m_pEdits[
nIndex]->set_text(aText);
1745 m_pEdits[
nIndex]->set_text(aText);
1747 m_pEdits[
nIndex]->show();
1748 m_pEdits[
nIndex]->set_help_id(aCurInfo.pHelpId);
1752 m_pEdits[
nIndex]->connect_changed(
LINK(
this, SwCreateAuthEntryDlg_Impl, ShortNameHdl));
1753 m_bNameAllowed = !pFields[
nIndex].isEmpty();
1756 m_aFixedTexts.back()->set_sensitive(
false);
1757 m_pEdits[
nIndex]->set_sensitive(
false);
1762 m_xLocalPageCB->show();
1763 m_xLocalPageCB->connect_toggled(
LINK(
this, SwCreateAuthEntryDlg_Impl, PageNumHdl));
1764 m_xLocalPageSB->show();
1767 m_aFixedTexts.back()->set_mnemonic_widget(m_pEdits[nIndex].
get());
1775 assert(m_xTypeListBox &&
"this will exist after the loop");
1776 EnableHdl(*m_xTypeListBox);
1783 assert(m_xTypeListBox &&
"No ListBox");
1784 return OUString::number(m_xTypeListBox->get_active());
1789 assert(m_xIdentifierBox &&
"No ComboBox");
1790 return m_xIdentifierBox->get_active_text();
1795 assert(m_xTargetTypeListBox &&
"No TargetType ListBox");
1796 return OUString::number(m_xTargetTypeListBox->get_active());
1802 if(aCurInfo.nToxField ==
eField)
1806 return MergeUrlAndPage(m_pEdits[nIndex]->get_text(), m_xLocalPageSB);
1810 return m_pEdits[
nIndex]->get_text();
1826 rBox.get_active_text());
1836 m_xTypeListBox->set_active_text(
1839 m_pEdits[
i]->set_text(
1846 if (m_aShortNameCheckLink.IsSet())
1848 bool bEnable = m_aShortNameCheckLink.Call(rEdit);
1849 m_bNameAllowed |= bEnable;
1850 m_xOKBT->set_sensitive(m_xTypeListBox->get_active() != -1 && bEnable);
1856 m_xOKBT->set_sensitive(m_bNameAllowed && rBox.get_active() != -1);
1857 m_xLocalBrowseButton->show();
1862 assert(m_pTargetURLField);
1863 m_pTargetURLField->set_sensitive(rBox.get_active() == SwAuthorityField::TargetType::UseTargetURL);
1869 FileDialogFlags::NONE, getDialog());
1871 if (&rButton == m_xLocalBrowseButton.get())
1875 if (!aPath.isEmpty())
1881 OUString aBaseURL = m_rWrtSh.GetDoc()->GetDocShell()->getDocumentBaseURL();
1882 if (!aBaseURL.isEmpty())
1900 m_pEdits[
nIndex]->set_text(aPath);
1908 if (rPageCB.get_active())
1910 m_xLocalPageSB->set_sensitive(
true);
1911 m_xLocalPageSB->set_value(1);
1915 m_xLocalPageSB->set_sensitive(
false);
1925 "modules/swriter/ui/bibliographyentry.ui",
"BibliographyEntryDialog")
1946 "BibliographyEntryDialog")
1954 short ret = SfxDialogController::run();
Reference< XExecutableDialog > m_xDialog
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void Initialize(SfxChildWinInfo const *pInfo)
virtual void Activate() override
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
OUString const & GetAuthorField(ToxAuthorityField ePos) const
SwAuthorMarkPane m_aContent
virtual void Activate() override
SwAuthMarkFloatDlg(SfxBindings *pBindings, SfxChildWindow *pChild, weld::Window *pParent, SfxChildWinInfo const *pInfo, bool bNew)
void ReInitDlg(SwWrtShell &rWrtShell)
virtual short int run() override
SwAuthorMarkPane m_aContent
SwAuthMarkModalDlg(weld::Window *pParent, SwWrtShell &rSh)
std::unique_ptr< weld::RadioButton > m_xFromDocContentRB
std::unique_ptr< weld::Button > m_xCreateEntryPB
std::unique_ptr< weld::Label > m_xAuthorFI
std::unique_ptr< weld::Button > m_xActionBT
static bool s_bIsFromComponent
std::unique_ptr< weld::ComboBox > m_xEntryLB
weld::DialogController & m_rDialog
OUString m_sFields[AUTH_FIELD_END]
std::unique_ptr< weld::RadioButton > m_xFromComponentRB
SwAuthorMarkPane(weld::DialogController &rDialog, weld::Builder &rBuilder, bool bNew)
std::unique_ptr< weld::Button > m_xEditEntryPB
OUString m_sCreatedEntry[AUTH_FIELD_END]
std::unique_ptr< weld::Label > m_xTitleFI
std::unique_ptr< weld::Entry > m_xEntryED
void ReInitDlg(SwWrtShell &rWrtShell)
std::unique_ptr< weld::Button > m_xCloseBT
static OUString const & GetAuthTypeName(ToxAuthorityType eType)
void GetAllEntryIdentifiers(std::vector< OUString > &rToFill) const
SwAuthEntry * GetEntryByIdentifier(std::u16string_view rIdentifier) const
Represents an inserted bibliography entry, created using Insert -> Table of Contents and Index -> Bib...
void Push()
store a copy of the current cursor on the cursor stack
sal_uInt16 GetCursorCnt(bool bAll=true) const
Get the number of elements in the ring of cursors.
const SwTOXMark & GotoTOXMark(const SwTOXMark &rStart, SwTOXSearch eDir)
traveling between marks
OUString GetSelText() const
get selected text of a node at current cursor
SwField * GetCurField(const bool bIncludeInputFieldAtStart=false) const
sal_Int32 Find_Text(const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, bool bReplace=false)
bool HasReadonlySel(bool isReplace=false) const
void EndCursorMove(const bool bIdleEnd=false)
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
void StartAllAction()
For all views of this document.
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const
Manage types of content tables.
SvtScriptType GetScriptType() const
returns the script type of the selection
SwFieldType * GetFieldType(size_t nField, SwFieldIds nResId=SwFieldIds::Unknown) const
get field types with a ResId, if 0 get all
void GetTOIKeys(SwTOIKeyType eTyp, std::vector< OUString > &rArr) const
Key for managing index.
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
const SwTOXType * GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
void UpdateCurField(sal_uInt32 nFormat, const OUString &rPar1, const OUString &rPar2, std::unique_ptr< SwField > _pField=nullptr)
bool InsertField(SwInsertField_Data &rData)
Base class of all fields.
SwFieldType * GetTyp() const
void ReInitDlg(SwWrtShell &rWrtShell)
virtual void Activate() override
SwIndexMarkFloatDlg(SfxBindings *pBindings, SfxChildWindow *pChild, weld::Window *pParent, SfxChildWinInfo const *pInfo, bool bNew)
SwIndexMarkPane m_aContent
SwIndexMarkPane m_aContent
virtual short int run() override
SwIndexMarkModalDlg(weld::Window *pParent, SwWrtShell &rSh, SwTOXMark const *pCurTOXMark)
virtual ~SwIndexMarkModalDlg() override
std::unique_ptr< weld::CheckButton > m_xSearchCaseSensitiveCB
std::unique_ptr< weld::CheckButton > m_xApplyToAllCB
std::unique_ptr< weld::Entry > m_xPhoneticED0
void UpdateLanguageDependenciesForPhoneticReading()
std::shared_ptr< weld::Dialog > m_xDialog
std::unique_ptr< weld::Label > m_xPhoneticFT0
std::unique_ptr< weld::Label > m_xPhoneticFT2
std::unique_ptr< weld::ComboBox > m_xKey2DCB
std::unique_ptr< weld::Button > m_xNewBT
LanguageType m_nLangForPhoneticReading
void ReInitDlg(SwWrtShell &rWrtShell, SwTOXMark const *pCurTOXMark=nullptr)
void ModifyHdl(const weld::Widget &rWidget)
std::unique_ptr< weld::Label > m_xTypeFT
std::unique_ptr< weld::Button > m_xNextBT
std::unique_ptr< weld::SpinButton > m_xLevelNF
std::unique_ptr< weld::Button > m_xNextSameBT
std::unique_ptr< weld::CheckButton > m_xSearchCaseWordOnlyCB
bool m_bIsPhoneticReadingEnabled
std::unique_ptr< weld::Button > m_xSyncED
std::unique_ptr< weld::Label > m_xKey2FT
std::unique_ptr< weld::ComboBox > m_xKey1DCB
std::unique_ptr< weld::Label > m_xLevelFT
bool m_bPhoneticED0_ChangedByUser
std::unique_ptr< weld::Entry > m_xPhoneticED2
std::unique_ptr< weld::Entry > m_xEntryED
std::unique_ptr< weld::Button > m_xOKBT
std::unique_ptr< weld::Label > m_xPhoneticFT1
OUString GetDefaultPhoneticReading(const OUString &rText)
std::unique_ptr< weld::Entry > m_xPhoneticED1
std::unique_ptr< weld::Button > m_xPrevBT
css::uno::Reference< css::i18n::XExtendedIndexEntrySupplier > m_xExtendedIndexEntrySupplier
std::unique_ptr< weld::ComboBox > m_xTypeDCB
SwIndexMarkPane(std::shared_ptr< weld::Dialog > xDialog, weld::Builder &rBuilder, bool bNewDlg, SwWrtShell *pWrtShell)
std::unique_ptr< weld::Button > m_xCloseBT
bool IsTOXType(const OUString &rName)
std::unique_ptr< weld::Button > m_xPrevSameBT
std::unique_ptr< weld::Label > m_xKey1FT
std::unique_ptr< SwTOXMgr > m_pTOXMgr
std::unique_ptr< weld::CheckButton > m_xMainEntryCB
std::unique_ptr< weld::Label > m_xForSelectedEntry
std::unique_ptr< weld::Button > m_xDelBT
void AddRule(SwUndoArg eWhat, const OUString &rWith)
void SetPhoneticReadingOfAltStr(const OUString &rSet)
void SetPrimKey(const OUString &rSet)
void SetSecKey(const OUString &rSet)
void SetTOUName(const OUString &rSet)
void SetPhoneticReadingOfPrimKey(const OUString &rSet)
void SetMainEntry(bool bSet)
void SetAltStr(const OUString &rSet)
void SetPhoneticReadingOfSecKey(const OUString &rSet)
const SwTextTOXMark * GetTextTOXMark() const
const SwTOXType * GetTOXType() const
sal_uInt16 GetLevel() const
OUString const & GetSecondaryKeyReading() const
OUString const & GetSecondaryKey() const
OUString GetText(SwRootFrame const *pLayout) const
OUString const & GetPrimaryKey() const
OUString const & GetTextReading() const
OUString const & GetPrimaryKeyReading() const
Built on top of SwWrtShell, provides functionality to insert, update or perform other actions on vari...
void InsertTOXMark(const SwTOXMarkDescription &rDesc)
const OUString & GetTypeName() const
sal_Int32 GetStart() const
SwTextNode is a paragraph in the document model.
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
const SwTextNode * GetpTextNd() const
static void SetCareDialog(const std::shared_ptr< weld::Window > &rNew)
SwRootFrame * GetLayout() const
const SfxItemPool & GetAttrPool() const
OUString GetSelectionTextParam(bool bCompleteWords, bool bEraseTrail)
Used by the UI to modify the document model.
bool HasSelection() const
tools::Long ResetSelect(const Point *, bool)
bool SelectTextAttr(sal_uInt16 nWhich, const SwTextAttr *pAttr=nullptr)
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
const SwView & GetView() const
void SetDisplayDirectory(const OUString &rPath)
void set_title(const OUString &rTitle)
#define FN_INSERT_IDX_ENTRY_DLG
#define FN_INSERT_AUTH_ENTRY_DLG
#define FN_EDIT_IDX_ENTRY_DLG
@ InBodyOnly
Find only in body - only in combination with FindRanges::InSelAll !!!
@ InSelAll
All (only in non-body and selections).
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
virtual OUString GetName() const override
virtual void SetCheckNameHdl(const Link< AbstractSvxNameDialog &, bool > &rLink, bool bCheckImmediately=false) override
FrameTypeFlags
values can be combined via logical or
constexpr OUStringLiteral HID_AUTH_FIELD_SERIES
constexpr OUStringLiteral HID_AUTH_FIELD_EDITOR
constexpr OUStringLiteral HID_AUTH_FIELD_NUMBER
constexpr OUStringLiteral HID_AUTH_FIELD_EDITION
constexpr OUStringLiteral HID_AUTH_FIELD_ADDRESS
constexpr OUStringLiteral HID_AUTH_FIELD_JOURNAL
constexpr OUStringLiteral HID_AUTH_FIELD_CUSTOM5
constexpr OUStringLiteral HID_AUTH_FIELD_ANNOTE
constexpr OUStringLiteral HID_AUTH_FIELD_PAGES
constexpr OUStringLiteral HID_AUTH_FIELD_REPORT_TYPE
constexpr OUStringLiteral HID_AUTH_FIELD_YEAR
constexpr OUStringLiteral HID_AUTH_FIELD_LOCAL_URL
constexpr OUStringLiteral HID_AUTH_FIELD_VOLUME
constexpr OUStringLiteral HID_AUTH_FIELD_BOOKTITLE
constexpr OUStringLiteral HID_AUTH_FIELD_URL
constexpr OUStringLiteral HID_AUTH_FIELD_IDENTIFIER
constexpr OUStringLiteral HID_AUTH_FIELD_ISBN
constexpr OUStringLiteral HID_AUTH_FIELD_NOTE
constexpr OUStringLiteral HID_AUTH_FIELD_TITLE
constexpr OUStringLiteral HID_AUTH_FIELD_PUBLISHER
constexpr OUStringLiteral HID_AUTH_FIELD_TARGET_URL
constexpr OUStringLiteral HID_AUTH_FIELD_HOWPUBLISHED
constexpr OUStringLiteral HID_AUTH_FIELD_AUTHOR
constexpr OUStringLiteral HID_AUTH_FIELD_INSTITUTION
constexpr OUStringLiteral HID_AUTH_FIELD_CUSTOM3
constexpr OUStringLiteral HID_AUTH_FIELD_AUTHORITY_TYPE
constexpr OUStringLiteral HID_AUTH_FIELD_CUSTOM2
constexpr OUStringLiteral HID_AUTH_FIELD_MONTH
constexpr OUStringLiteral HID_AUTH_FIELD_CUSTOM1
constexpr OUStringLiteral HID_AUTH_FIELD_TARGET_TYPE
constexpr OUStringLiteral HID_AUTH_FIELD_SCHOOL
constexpr OUStringLiteral HID_AUTH_FIELD_CUSTOM4
constexpr OUStringLiteral HID_AUTH_FIELD_CHAPTER
constexpr OUStringLiteral HID_AUTH_FIELD_ORGANIZATIONS
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
const LanguageTag & GetAppLanguageTag()
#define LANGUAGE_CHINESE_SIMPLIFIED
#define LINK(Instance, Class, Member)
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
constexpr OUStringLiteral aData
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
const LanguageTag & getLocale()
Reference< XComponentContext > getProcessComponentContext()
constexpr OUStringLiteral last
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwWrtShell * GetActiveWrtShell()
OUString SwResId(TranslateId aId)
constexpr sal_uInt8 MAXLEVEL
IMPL_LINK_NOARG(SwIndexMarkPane, SyncSelectionHdl, weld::Button &, void)
const TextInfo aTextInfoArr[]
static sal_uInt16 nKey1Pos
static sal_Int32 nTypePos
IMPL_LINK(SwNewUserIdxDlg, ModifyHdl, weld::Entry &, rEdit, void)
static void lcl_SelectSameStrings(SwWrtShell &rSh, bool bWordOnly, bool bCaseSensitive)
static OUString lcl_FindColumnEntry(const uno::Sequence< beans::PropertyValue > &rFields, std::u16string_view rColumnTitle)
static sal_uInt16 nKey2Pos
#define TOX_STYLE_DELIMITER
@ AUTH_FIELD_HOWPUBLISHED
@ AUTH_FIELD_AUTHORITY_TYPE
@ AUTH_FIELD_ORGANIZATIONS
::ucbhelper::Content m_aContent