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>
40 #include <osl/diagnose.h>
52 #include <strings.hrc>
76 bool SplitUrlAndPage(
const OUString& rText, OUString& rUrl,
int& nPageNumber)
78 uno::Reference<uri::XUriReferenceFactory> xUriReferenceFactory
80 uno::Reference<uri::XUriReference> xUriRef;
83 xUriRef = xUriReferenceFactory->parse(rText);
85 catch (
const uno::Exception& rException)
87 SAL_WARN(
"sw.ui",
"SplitUrlAndPage: failed to parse url: " << rException.Message);
91 OUString aPagePrefix(
"page=");
92 if (!xUriRef->getFragment().startsWith(aPagePrefix))
97 nPageNumber =
o3tl::toInt32(xUriRef->getFragment().subView(aPagePrefix.getLength()));
98 xUriRef->clearFragment();
99 rUrl = xUriRef->getUriReference();
103 OUString MergeUrlAndPage(
const OUString& rUrl,
const std::unique_ptr<weld::SpinButton>& xPageSB)
105 if (!xPageSB->get_sensitive())
110 uno::Reference<uri::XUriReferenceFactory> xUriReferenceFactory
112 uno::Reference<uri::XUriReference> xUriRef;
115 xUriRef = xUriReferenceFactory->parse(rUrl);
117 catch (
const uno::Exception& rException)
119 SAL_WARN(
"sw.ui",
"MergeUrlAndPage: failed to parse url: " << rException.Message);
123 OUString aFragment(
"page=" + OUString::number(xPageSB->get_value()));
124 xUriRef->setFragment(aFragment);
125 return xUriRef->getUriReference();
134 , m_bNewMark(bNewDlg)
136 , m_bPhoneticED0_ChangedByUser(
false)
137 , m_bPhoneticED1_ChangedByUser(
false)
138 , m_bPhoneticED2_ChangedByUser(
false)
140 , m_bIsPhoneticReadingEnabled(
false)
142 , m_xTypeFT(rBuilder.weld_label(
"typeft"))
143 , m_xTypeDCB(rBuilder.weld_combo_box(
"typecb"))
144 , m_xNewBT(rBuilder.weld_button(
"new"))
145 , m_xEntryED(rBuilder.weld_entry(
"entryed"))
146 , m_xSyncED(rBuilder.weld_button(
"sync"))
147 , m_xPhoneticFT0(rBuilder.weld_label(
"phonetic0ft"))
148 , m_xPhoneticED0(rBuilder.weld_entry(
"phonetic0ed"))
149 , m_xKey1FT(rBuilder.weld_label(
"key1ft"))
150 , m_xKey1DCB(rBuilder.weld_combo_box(
"key1cb"))
151 , m_xPhoneticFT1(rBuilder.weld_label(
"phonetic1ft"))
152 , m_xPhoneticED1(rBuilder.weld_entry(
"phonetic1ed"))
153 , m_xKey2FT(rBuilder.weld_label(
"key2ft"))
154 , m_xKey2DCB(rBuilder.weld_combo_box(
"key2cb"))
155 , m_xPhoneticFT2(rBuilder.weld_label(
"phonetic2ft"))
156 , m_xPhoneticED2(rBuilder.weld_entry(
"phonetic2ed"))
157 , m_xLevelFT(rBuilder.weld_label(
"levelft"))
158 , m_xLevelNF(rBuilder.weld_spin_button(
"levelnf"))
159 , m_xMainEntryCB(rBuilder.weld_check_button(
"mainentrycb"))
160 , m_xApplyToAllCB(rBuilder.weld_check_button(
"applytoallcb"))
161 , m_xSearchCaseSensitiveCB(rBuilder.weld_check_button(
"searchcasesensitivecb"))
162 , m_xSearchCaseWordOnlyCB(rBuilder.weld_check_button(
"searchcasewordonlycb"))
163 , m_xOKBT(bNewDlg ? rBuilder.weld_button(
"insert") : rBuilder.weld_button(
"ok"))
164 , m_xCloseBT(rBuilder.weld_button(
"close"))
165 , m_xDelBT(rBuilder.weld_button(
"delete"))
166 , m_xPrevSameBT(rBuilder.weld_button(
"first"))
167 , m_xNextSameBT(rBuilder.weld_button(
"last"))
168 , m_xPrevBT(rBuilder.weld_button(
"previous"))
169 , m_xNextBT(rBuilder.weld_button(
"next"))
235 assert(pType &&
"No directory type !!");
236 OUString sTmpTypeSelection;
238 sTmpTypeSelection =
m_xTypeDCB->get_active_text();
244 assert(pType &&
"No directory type !!");
249 for (sal_uInt16
i = 0;
i < nCount; ++
i)
254 std::vector<OUString>
aArr;
256 std::sort(aArr.begin(), aArr.end());
257 auto last = std::unique(aArr.begin(), aArr.end());
258 for (
auto it = aArr.begin(); it != last; ++it)
264 std::vector<OUString>
aArr;
266 std::sort(aArr.begin(), aArr.end());
267 auto last = std::unique(aArr.begin(), aArr.end());
268 for (
auto it = aArr.begin(); it != last; ++it)
288 if( pMoveMark != pMark )
293 m_xPrevBT->set_sensitive(pMoveMark != pMark);
295 if( pMoveMark != pMark )
300 m_xNextBT->set_sensitive(pMoveMark != pMark);
309 if( pMoveMark != pMark )
316 if( pMoveMark != pMark )
356 if (!sTmpTypeSelection.isEmpty() &&
m_xTypeDCB->find_text(sTmpTypeSelection) != -1)
357 m_xTypeDCB->set_active_text(sTmpTypeSelection);
381 OSL_ENSURE(pMark,
"need current SwTOXMark");
385 OSL_ENSURE(pTextTOXMark,
"need current SwTextTOXMark");
389 OSL_ENSURE(pTextNode,
"need current SwTextNode");
392 sal_Int32 nTextIndex = pTextTOXMark->
GetStart();
430 m_bSelected = !m_pSh->HasSelection();
431 m_aOrgStr = m_pSh->GetView().GetSelectionTextParam(
true,
false);
432 m_xEntryED->set_text(m_aOrgStr);
436 const FrameTypeFlags nFrameType = m_pSh->GetFrameType(
nullptr,
true);
437 m_xApplyToAllCB->show();
438 m_xSearchCaseSensitiveCB->show();
439 m_xSearchCaseWordOnlyCB->show();
440 m_xApplyToAllCB->set_sensitive(!m_aOrgStr.isEmpty() &&
442 SearchTypeHdl(*m_xApplyToAllCB);
443 ModifyHdl(*m_xEntryED);
498 SearchAlgorithms_ABSOLUTE,
499 ( bWordOnly ? SearchFlags::NORM_WORD_ONLY : 0 ),
504 ? TransliterationFlags::NONE
505 : TransliterationFlags::IGNORE_CASE),
506 SearchAlgorithms2::ABSOLUTE,
573 if(pAltText && pAltText->isEmpty())
590 OUString aPrim(
m_xKey1DCB->get_active_text());
612 if(nPos == -1 && !aKey.isEmpty())
620 if(nPos == -1 && !aKey.isEmpty())
632 std::unique_ptr<weld::Button> m_xOKPB;
633 std::unique_ptr<weld::Entry> m_xNameED;
639 : GenericDialogController(pParent,
"modules/swriter/ui/newuserindexdialog.ui",
"NewUserIndexDialog")
641 , m_xOKPB(m_xBuilder->weld_button(
"ok"))
642 , m_xNameED(m_xBuilder->weld_entry(
"entry"))
644 m_xNameED->connect_changed(
LINK(
this, SwNewUserIdxDlg, ModifyHdl));
645 m_xOKPB->set_sensitive(
false);
646 m_xNameED->grab_focus();
648 OUString
GetName()
const {
return m_xNameED->get_text(); }
660 SwNewUserIdxDlg aDlg(
this,
m_xDialog.get());
663 OUString sNewName(aDlg.GetName());
664 m_xTypeDCB->append_text(sNewName);
665 m_xTypeDCB->set_active_text(sNewName);
671 const bool bEnable = rBox.get_active() && rBox.get_sensitive();
672 m_xSearchCaseWordOnlyCB->set_sensitive(bEnable);
673 m_xSearchCaseSensitiveCB->set_sensitive(bEnable);
680 if(!m_bNewMark && !m_xPrevBT->get_visible() && !m_xNextBT->get_visible())
689 SfxCallMode::ASYNCHRON|SfxCallMode::RECORD);
714 bool bLevelEnable =
false,
718 bEntryHasText =
false,
719 bKey1HasText =
false,
720 bKey2HasText =
false;
724 bEntryHasText =
true;
732 bKey1HasText = bSetKey2 = bKey2Enable =
true;
766 bool bHasText = !
m_xEntryED->get_text().isEmpty();
785 m_pTOXMgr->NextTOXMark();
792 m_pTOXMgr->NextTOXMark(
true);
799 m_pTOXMgr->PrevTOXMark();
806 m_pTOXMgr->PrevTOXMark(
true);
816 if(m_pTOXMgr->GetCurTOXMark())
820 CloseHdl(*m_xCloseBT);
830 OSL_ENSURE(pMark,
"no current marker");
840 bool bLevelEnable =
true,
843 bEntryHasText =
false,
844 bKey1HasText =
false,
845 bKey2HasText =
false;
850 bLevelEnable =
false;
852 bKey1HasText = bKey2Enable = !pMark->
GetPrimaryKey().isEmpty();
891 if( pMoveMark != pMark )
893 m_xPrevBT->set_sensitive( pMoveMark != pMark );
895 if( pMoveMark != pMark )
897 m_xNextBT->set_sensitive( pMoveMark != pMark );
903 if( pMoveMark != pMark )
907 if( pMoveMark != pMark )
913 m_xOKBT->set_sensitive(bEnable);
930 if (m_xPhoneticED0.get() == &
rEdit)
934 else if (m_xPhoneticED1.get() == &
rEdit)
938 else if (m_xPhoneticED2.get() == &
rEdit)
947 if (m_xKey1DCB.get() == &rBox)
949 bool bEnable = !rBox.get_active_text().isEmpty();
952 m_xKey2DCB->set_entry_text(OUString());
953 m_xPhoneticED1->set_text(OUString());
954 m_xPhoneticED2->set_text(OUString());
955 m_bPhoneticED1_ChangedByUser =
false;
956 m_bPhoneticED2_ChangedByUser =
false;
960 if (rBox.get_popup_shown())
963 m_bPhoneticED1_ChangedByUser =
false;
965 if (!m_bPhoneticED1_ChangedByUser)
966 m_xPhoneticED1->set_text(GetDefaultPhoneticReading(rBox.get_active_text()));
968 m_xKey2DCB->set_sensitive(bEnable);
969 m_xKey2FT->set_sensitive(bEnable);
971 else if (m_xKey2DCB.get() == &rBox)
973 if (rBox.get_active_text().isEmpty())
975 m_xPhoneticED2->set_text(OUString());
976 m_bPhoneticED2_ChangedByUser =
false;
980 if (rBox.get_popup_shown())
983 m_bPhoneticED2_ChangedByUser =
false;
985 if(!m_bPhoneticED2_ChangedByUser)
986 m_xPhoneticED2->set_text(GetDefaultPhoneticReading(rBox.get_active_text()));
990 bool bKey1HasText = !m_xKey1DCB->get_active_text().isEmpty();
991 bool bKey2HasText = !m_xKey2DCB->get_active_text().isEmpty();
993 m_xPhoneticFT1->set_sensitive(bKey1HasText && m_bIsPhoneticReadingEnabled);
994 m_xPhoneticED1->set_sensitive(bKey1HasText && m_bIsPhoneticReadingEnabled);
995 m_xPhoneticFT2->set_sensitive(bKey2HasText && m_bIsPhoneticReadingEnabled);
996 m_xPhoneticED2->set_sensitive(bKey2HasText && m_bIsPhoneticReadingEnabled);
1009 for(sal_uInt16
i = 0;
i <
m_pTOXMgr->GetTOXMarkCount();
i++)
1023 "modules/swriter/ui/indexentry.ui",
"IndexEntryDialog")
1057 short nRet = SfxDialogController::run();
1067 std::vector<std::unique_ptr<weld::Builder>> m_aBuilders;
1073 bool m_bNewEntryMode;
1074 bool m_bNameAllowed;
1076 std::vector<std::unique_ptr<weld::Container>> m_aOrigContainers;
1077 std::vector<std::unique_ptr<weld::Label>> m_aFixedTexts;
1080 std::unique_ptr<weld::Button> m_xOKBT;
1081 std::unique_ptr<weld::Container> m_xBox;
1082 std::unique_ptr<weld::Container> m_xLeft;
1083 std::unique_ptr<weld::Container> m_xRight;
1084 std::unique_ptr<weld::ComboBox> m_xTypeListBox;
1085 std::unique_ptr<weld::ComboBox> m_xIdentifierBox;
1086 std::unique_ptr<weld::Button> m_xLocalBrowseButton;
1087 std::unique_ptr<weld::CheckButton> m_xLocalPageCB;
1088 std::unique_ptr<weld::SpinButton> m_xLocalPageSB;
1098 const OUString pFields[],
1112 const char* pHelpId;
1153 static OUString
lcl_FindColumnEntry(
const uno::Sequence<beans::PropertyValue>& rFields, std::u16string_view rColumnTitle)
1155 for(
const auto& rField : rFields)
1158 if(rField.Name == rColumnTitle &&
1159 (rField.Value >>= sRet))
1170 : m_rDialog(rDialog)
1171 , bNewEntry(bNewDlg)
1172 , bBibAccessInitialized(
false)
1174 , m_xFromComponentRB(rBuilder.weld_radio_button(
"frombibliography"))
1175 , m_xFromDocContentRB(rBuilder.weld_radio_button(
"fromdocument"))
1176 , m_xAuthorFI(rBuilder.weld_label(
"author"))
1177 , m_xTitleFI(rBuilder.weld_label(
"title"))
1178 , m_xEntryED(rBuilder.weld_entry(
"entryed"))
1179 , m_xEntryLB(rBuilder.weld_combo_box(
"entrylb"))
1180 , m_xActionBT(rBuilder.weld_button(bNewEntry ? OString(
"insert") : OString(
"modify")))
1181 , m_xCloseBT(rBuilder.weld_button(
"close"))
1182 , m_xCreateEntryPB(rBuilder.weld_button(
"new"))
1183 , m_xEditEntryPB(rBuilder.weld_button(
"edit"))
1200 bNewEntry ? STR_AUTHMRK_INSERT : STR_AUTHMRK_EDIT));
1221 SfxCallMode::ASYNCHRON|SfxCallMode::RECORD);
1231 const OUString sEntry(rBox.get_active_text());
1232 if(bIsFromComponent)
1234 if(xBibAccess.is() && !sEntry.isEmpty())
1236 if(xBibAccess->hasByName(sEntry))
1238 uno::Any aEntry(xBibAccess->getByName(sEntry));
1239 uno::Sequence<beans::PropertyValue> aFieldProps;
1240 if(aEntry >>= aFieldProps)
1243 for(sal_Int32
i = 0;
i < nSize;
i++)
1253 if(!sEntry.isEmpty())
1259 m_sFields[
i] = pEntry ?
1260 pEntry->
GetAuthorField(static_cast<ToxAuthorityField>(
i)) : OUString();
1263 if (rBox.get_active_text().isEmpty())
1265 for(OUString & s : m_sFields)
1277 bool bDifferent =
false;
1289 bDifferent |= m_sFields[
i] != pEntry->
GetAuthorField(static_cast<ToxAuthorityField>(
i));
1293 VclMessageType::Question, VclButtonsType::YesNo,
1294 SwResId(STR_QUERY_CHANGE_AUTH_ENTRY)));
1301 OUStringBuffer sFields;
1302 for(OUString & s : m_sFields)
1312 xNewData->SetAuthorField(static_cast<ToxAuthorityField>(
i), m_sFields[
i]);
1313 pSh->ChangeAuthorityData(xNewData.get());
1320 aMgr.
UpdateCurField(0, sFields.makeStringAndClear(), OUString());
1324 CloseHdl(*m_xCloseBT);
1329 bool bCreate = &rButton == m_xCreateEntryPB.get();
1330 OUString sOldId = m_sCreatedEntry[0];
1332 m_sCreatedEntry[
i] = bCreate ? OUString() : m_sFields[
i];
1333 SwCreateAuthEntryDlg_Impl aDlg(m_rDialog.getDialog(),
1334 bCreate ? m_sCreatedEntry : m_sFields,
1335 *pSh, bNewEntry, bCreate);
1343 if(bCreate && !sOldId.isEmpty())
1345 m_xEntryLB->remove_text(sOldId);
1349 m_sFields[
i] = aDlg.GetEntryText(static_cast<ToxAuthorityField>(
i));
1350 m_sCreatedEntry[
i] = m_sFields[
i];
1352 if(bNewEntry && !m_xFromDocContentRB->get_active())
1354 m_xFromDocContentRB->set_active(
true);
1355 ChangeSourceHdl(*m_xFromDocContentRB);
1361 m_xEntryLB->append_text(m_sFields[AUTH_FIELD_IDENTIFIER]);
1362 m_xEntryLB->set_active_text(m_sFields[AUTH_FIELD_IDENTIFIER]);
1367 m_xActionBT->set_sensitive(
true);
1373 InsertHdl(*m_xActionBT);
1379 bool bFromComp = m_xFromComponentRB->get_active();
1380 bIsFromComponent = bFromComp;
1381 m_xCreateEntryPB->set_sensitive(!bIsFromComponent);
1382 m_xEntryLB->clear();
1383 if(bIsFromComponent)
1385 if(!bBibAccessInitialized)
1388 xBibAccess = frame::Bibliography::create( xContext );
1389 uno::Reference< beans::XPropertySet > xPropSet(xBibAccess, uno::UNO_QUERY);
1390 OUString uPropName(
"BibliographyDataFieldNames");
1391 if(xPropSet.is() && xPropSet->getPropertySetInfo()->hasPropertyByName(uPropName))
1393 uno::Any aNames = xPropSet->getPropertyValue(uPropName);
1394 uno::Sequence<beans::PropertyValue>
aSeq;
1395 if( aNames >>= aSeq)
1397 for(
const beans::PropertyValue& rProp : std::as_const(aSeq))
1399 sal_Int16 nField = 0;
1400 rProp.Value >>= nField;
1402 m_sColumnTitles[nField] = rProp.Name;
1406 bBibAccessInitialized =
true;
1410 const uno::Sequence<OUString> aIdentifiers = xBibAccess->getElementNames();
1411 for(
const OUString& rName : aIdentifiers)
1412 m_xEntryLB->append_text(rName);
1421 std::vector<OUString> aIds;
1423 for(
const OUString &
i : aIds)
1424 m_xEntryLB->append_text(
i);
1429 m_xEntryLB->set_active(0);
1430 CompEntryHdl(*m_xEntryLB);
1436 bool bResult = aAllowed.Call(
rEdit);
1437 m_xActionBT->set_sensitive(bResult);
1449 bool bAllowed =
false;
1450 if(!sEntry.isEmpty())
1452 if (m_xEntryLB->find_text(sEntry) != -1)
1454 else if(bIsFromComponent)
1462 bAllowed = !xBibAccess.is() || !xBibAccess->hasByName(sEntry);
1471 bool bAllowed =
false;
1472 if(!sEntry.isEmpty())
1474 if (m_xEntryLB->find_text(sEntry) != -1)
1476 else if(bIsFromComponent)
1484 bAllowed = !xBibAccess.is() || !xBibAccess->hasByName(sEntry);
1492 OSL_ENSURE(
pSh,
"no shell?");
1494 OSL_ENSURE(
bNewEntry || pField,
"no current marker");
1508 OSL_ENSURE(pEntry,
"No authority entry found");
1528 STR_AUTH_FIELD_IDENTIFIER,
1529 STR_AUTH_FIELD_AUTHORITY_TYPE,
1530 STR_AUTH_FIELD_ADDRESS,
1531 STR_AUTH_FIELD_ANNOTE,
1532 STR_AUTH_FIELD_AUTHOR,
1533 STR_AUTH_FIELD_BOOKTITLE,
1534 STR_AUTH_FIELD_CHAPTER,
1535 STR_AUTH_FIELD_EDITION,
1536 STR_AUTH_FIELD_EDITOR,
1537 STR_AUTH_FIELD_HOWPUBLISHED,
1538 STR_AUTH_FIELD_INSTITUTION,
1539 STR_AUTH_FIELD_JOURNAL,
1540 STR_AUTH_FIELD_MONTH,
1541 STR_AUTH_FIELD_NOTE,
1542 STR_AUTH_FIELD_NUMBER,
1543 STR_AUTH_FIELD_ORGANIZATIONS,
1544 STR_AUTH_FIELD_PAGES,
1545 STR_AUTH_FIELD_PUBLISHER,
1546 STR_AUTH_FIELD_SCHOOL,
1547 STR_AUTH_FIELD_SERIES,
1548 STR_AUTH_FIELD_TITLE,
1549 STR_AUTH_FIELD_TYPE,
1550 STR_AUTH_FIELD_VOLUME,
1551 STR_AUTH_FIELD_YEAR,
1553 STR_AUTH_FIELD_CUSTOM1,
1554 STR_AUTH_FIELD_CUSTOM2,
1555 STR_AUTH_FIELD_CUSTOM3,
1556 STR_AUTH_FIELD_CUSTOM4,
1557 STR_AUTH_FIELD_CUSTOM5,
1558 STR_AUTH_FIELD_ISBN,
1559 STR_AUTH_FIELD_LOCAL_URL,
1563 SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(
weld::Window* pParent,
1564 const OUString pFields[],
1568 : GenericDialogController(pParent,
"modules/swriter/ui/createauthorentry.ui",
"CreateAuthorEntryDialog")
1570 , m_bNewEntryMode(bNewEntry)
1571 , m_bNameAllowed(true)
1572 , m_xOKBT(m_xBuilder->weld_button(
"ok"))
1573 , m_xBox(m_xBuilder->weld_container(
"box"))
1574 , m_xLeft(m_xBuilder->weld_container(
"leftgrid"))
1575 , m_xRight(m_xBuilder->weld_container(
"rightgrid"))
1578 sal_Int32 nLeftRow(0), nRightRow(0);
1583 const TextInfo aCurInfo = aTextInfoArr[
nIndex];
1585 m_aOrigContainers.emplace_back(m_aBuilders.back()->weld_container(
"biblioentry"));
1586 m_aFixedTexts.emplace_back(m_aBuilders.back()->weld_label(
"label"));
1588 m_aOrigContainers.back()->move(m_aFixedTexts.back().get(), m_xLeft.get());
1590 m_aOrigContainers.back()->move(m_aFixedTexts.back().get(), m_xRight.get());
1591 m_aFixedTexts.back()->set_grid_left_attach(0);
1592 m_aFixedTexts.back()->set_grid_top_attach(bLeft ? nLeftRow : nRightRow);
1593 m_aFixedTexts.back()->set_label(
SwResId(STR_AUTH_FIELD_ARY[aCurInfo.nToxField]));
1594 m_aFixedTexts.back()->show();
1597 m_xTypeListBox = m_aBuilders.back()->weld_combo_box(
"listbox");
1599 m_aOrigContainers.back()->move(m_xTypeListBox.get(), m_xLeft.get());
1601 m_aOrigContainers.back()->move(m_xTypeListBox.get(), m_xRight.get());
1605 m_xTypeListBox->append_text(
1608 if(!pFields[aCurInfo.nToxField].isEmpty())
1610 m_xTypeListBox->set_active(pFields[aCurInfo.nToxField].toInt32());
1612 m_xTypeListBox->set_grid_left_attach(1);
1613 m_xTypeListBox->set_grid_top_attach(bLeft ? nLeftRow : nRightRow);
1614 m_xTypeListBox->set_hexpand(
true);
1615 m_xTypeListBox->show();
1616 m_xTypeListBox->connect_changed(
LINK(
this, SwCreateAuthEntryDlg_Impl, EnableHdl));
1617 m_xTypeListBox->set_help_id(aCurInfo.pHelpId);
1618 m_aFixedTexts.back()->set_mnemonic_widget(m_xTypeListBox.get());
1622 m_xIdentifierBox = m_aBuilders.back()->weld_combo_box(
"combobox");
1624 m_aOrigContainers.back()->move(m_xIdentifierBox.get(), m_xLeft.get());
1626 m_aOrigContainers.back()->move(m_xIdentifierBox.get(), m_xRight.get());
1628 m_xIdentifierBox->connect_changed(
LINK(
this,
1629 SwCreateAuthEntryDlg_Impl, IdentifierHdl));
1635 std::vector<OUString> aIds;
1637 for (
const OUString& a : aIds)
1638 m_xIdentifierBox->append_text(a);
1640 m_xIdentifierBox->set_entry_text(pFields[aCurInfo.nToxField]);
1641 m_xIdentifierBox->set_grid_left_attach(1);
1642 m_xIdentifierBox->set_grid_top_attach(bLeft ? nLeftRow : nRightRow);
1643 m_xIdentifierBox->set_hexpand(
true);
1644 m_xIdentifierBox->show();
1645 m_xIdentifierBox->set_help_id(aCurInfo.pHelpId);
1646 m_aFixedTexts.back()->set_mnemonic_widget(m_xIdentifierBox.get());
1650 m_pBoxes[
nIndex] = m_aBuilders.back()->weld_box(
"vbox");
1651 pEdits[
nIndex] = m_aBuilders.back()->weld_entry(
"entry");
1653 m_aOrigContainers.back()->move(m_pBoxes[nIndex].
get(), m_xLeft.get());
1655 m_aOrigContainers.back()->move(m_pBoxes[nIndex].
get(), m_xRight.get());
1657 m_pBoxes[
nIndex]->set_grid_left_attach(1);
1658 m_pBoxes[
nIndex]->set_grid_top_attach(bLeft ? nLeftRow : nRightRow);
1659 m_pBoxes[
nIndex]->set_hexpand(
true);
1662 m_xLocalBrowseButton = m_aBuilders.back()->weld_button(
"browse");
1663 m_xLocalBrowseButton->connect_clicked(
1664 LINK(
this, SwCreateAuthEntryDlg_Impl, BrowseHdl));
1665 m_xLocalPageCB = m_aBuilders.back()->weld_check_button(
"pagecb");
1667 m_xLocalPageCB->set_buildable_name(m_xLocalPageCB->get_buildable_name()
1668 +
"-local-visible");
1669 m_xLocalPageSB = m_aBuilders.back()->weld_spin_button(
"pagesb");
1673 OUString aText = pFields[aCurInfo.nToxField];
1678 if (SplitUrlAndPage(aText, aUrl, nPageNumber))
1680 pEdits[
nIndex]->set_text(aUrl);
1681 m_xLocalPageCB->set_active(
true);
1682 m_xLocalPageSB->set_sensitive(
true);
1683 m_xLocalPageSB->set_value(nPageNumber);
1687 pEdits[
nIndex]->set_text(aText);
1692 pEdits[
nIndex]->set_text(aText);
1695 pEdits[
nIndex]->set_help_id(aCurInfo.pHelpId);
1699 pEdits[
nIndex]->connect_changed(
LINK(
this, SwCreateAuthEntryDlg_Impl, ShortNameHdl));
1700 m_bNameAllowed = !pFields[
nIndex].isEmpty();
1703 m_aFixedTexts.back()->set_sensitive(
false);
1704 pEdits[
nIndex]->set_sensitive(
false);
1709 m_xLocalPageCB->show();
1710 m_xLocalPageCB->connect_toggled(
LINK(
this, SwCreateAuthEntryDlg_Impl, PageNumHdl));
1711 m_xLocalPageSB->show();
1714 m_aFixedTexts.back()->set_mnemonic_widget(pEdits[nIndex].
get());
1722 assert(m_xTypeListBox &&
"this will exist after the loop");
1723 EnableHdl(*m_xTypeListBox);
1730 assert(m_xTypeListBox &&
"No ListBox");
1731 return OUString::number(m_xTypeListBox->get_active());
1736 assert(m_xIdentifierBox &&
"No ComboBox");
1737 return m_xIdentifierBox->get_active_text();
1742 const TextInfo aCurInfo = aTextInfoArr[
nIndex];
1743 if(aCurInfo.nToxField == eField)
1747 return MergeUrlAndPage(pEdits[nIndex]->get_text(), m_xLocalPageSB);
1751 return pEdits[
nIndex]->get_text();
1767 rBox.get_active_text());
1773 const TextInfo aCurInfo = aTextInfoArr[
i];
1777 m_xTypeListBox->set_active_text(
1780 pEdits[
i]->set_text(
1787 if (aShortNameCheckLink.IsSet())
1789 bool bEnable = aShortNameCheckLink.Call(
rEdit);
1790 m_bNameAllowed |= bEnable;
1791 m_xOKBT->set_sensitive(m_xTypeListBox->get_active() != -1 && bEnable);
1797 m_xOKBT->set_sensitive(m_bNameAllowed && rBox.get_active() != -1);
1798 m_xLocalBrowseButton->show();
1804 FileDialogFlags::NONE, getDialog());
1806 if (&rButton == m_xLocalBrowseButton.get())
1810 if (!aPath.isEmpty())
1816 OUString aBaseURL = rWrtSh.GetDoc()->GetDocShell()->getDocumentBaseURL();
1817 if (!aBaseURL.isEmpty())
1832 const TextInfo& rCurInfo = aTextInfoArr[
nIndex];
1835 pEdits[
nIndex]->set_text(aPath);
1843 if (rPageCB.get_active())
1845 m_xLocalPageSB->set_sensitive(
true);
1846 m_xLocalPageSB->set_value(1);
1850 m_xLocalPageSB->set_sensitive(
false);
1860 "modules/swriter/ui/bibliographyentry.ui",
"BibliographyEntryDialog")
1881 "BibliographyEntryDialog")
1889 short ret = SfxDialogController::run();
SwFieldType * GetFieldType(size_t nField, SwFieldIds nResId=SwFieldIds::Unknown) const
get field types with a ResId, if 0 get all
std::unique_ptr< weld::Label > m_xTypeFT
#define LINK(Instance, Class, Member)
std::unique_ptr< weld::RadioButton > m_xFromDocContentRB
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
OUString const & GetAuthorField(ToxAuthorityField ePos) const
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
#define HID_AUTH_FIELD_CUSTOM2
OUString const & GetSecondaryKeyReading() const
void SetPrimKey(const OUString &rSet)
sal_uLong Find_Text(const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, bool bReplace=false)
void set_title(const OUString &rTitle)
std::unique_ptr< weld::Label > m_xLevelFT
std::unique_ptr< weld::Label > m_xPhoneticFT0
#define HID_AUTH_FIELD_NOTE
void UpdateLanguageDependenciesForPhoneticReading()
bool IsTOXType(const OUString &rName)
void Initialize(SfxChildWinInfo const *pInfo)
#define HID_AUTH_FIELD_IDENTIFIER
std::unique_ptr< weld::Label > m_xTitleFI
OUString const & GetPrimaryKey() const
#define HID_AUTH_FIELD_EDITOR
std::unique_ptr< weld::Label > m_xAuthorFI
void ReInitDlg(SwWrtShell &rWrtShell)
std::unique_ptr< weld::SpinButton > m_xLevelNF
std::unique_ptr< weld::Entry > m_xEntryED
SfxDispatcher * GetDispatcher()
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr OUStringLiteral last
Base class of all fields.
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
#define TOX_STYLE_DELIMITER
SwWrtShell * GetActiveWrtShell()
void UpdateCurField(sal_uInt32 nFormat, const OUString &rPar1, const OUString &rPar2, std::unique_ptr< SwField > _pField=nullptr)
std::unique_ptr< weld::Label > m_xPhoneticFT1
SwAuthMarkFloatDlg(SfxBindings *pBindings, SfxChildWindow *pChild, weld::Window *pParent, SfxChildWinInfo const *pInfo, bool bNew)
constexpr sal_uInt8 MAXLEVEL
virtual short int run() override
#define FN_INSERT_AUTH_ENTRY_DLG
std::unique_ptr< weld::RadioButton > m_xFromComponentRB
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
#define HID_AUTH_FIELD_ANNOTE
const SwTOXType * GetTOXType() const
void Invalidate(sal_uInt16 nId)
void SetDisplayDirectory(const OUString &rPath)
bool InsertField(const SwInsertField_Data &rData)
#define HID_AUTH_FIELD_NUMBER
#define HID_AUTH_FIELD_ORGANIZATIONS
void ReInitDlg(SwWrtShell &rWrtShell)
static OUString const & GetAuthTypeName(ToxAuthorityType eType)
OUString m_sCreatedEntry[AUTH_FIELD_END]
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const
Manage types of content tables.
SwAuthorMarkPane m_aContent
Used by the UI to modify the document model.
OUString SwResId(TranslateId aId)
std::unique_ptr< SwTOXMgr > m_pTOXMgr
OUString m_sFields[AUTH_FIELD_END]
std::unique_ptr< weld::ComboBox > m_xKey2DCB
OUString const & GetPrimaryKeyReading() const
tools::Long ResetSelect(const Point *, bool)
void ReInitDlg(SwWrtShell &rWrtShell)
const SwView & GetView() const
std::unique_ptr< weld::Button > m_xNextSameBT
std::unique_ptr< weld::Button > m_xOKBT
invariant for SwAuthorityField is that it is always registered at its SwAuthorityFieldType via AddFie...
void SetPhoneticReadingOfSecKey(const OUString &rSet)
std::unique_ptr< weld::ComboBox > m_xEntryLB
std::unique_ptr< weld::CheckButton > m_xSearchCaseWordOnlyCB
#define HID_AUTH_FIELD_AUTHORITY_TYPE
std::unique_ptr< weld::Button > m_xPrevSameBT
#define HID_AUTH_FIELD_PAGES
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
#define FN_EDIT_IDX_ENTRY_DLG
SwField * GetCurField(const bool bIncludeInputFieldAtStart=false) const
static OUString lcl_FindColumnEntry(const uno::Sequence< beans::PropertyValue > &rFields, std::u16string_view rColumnTitle)
sal_Int32 GetStart() const
bool m_bPhoneticED0_ChangedByUser
#define HID_AUTH_FIELD_EDITION
virtual OUString GetName() const override
IMPL_LINK_NOARG(SwIndexMarkPane, SyncSelectionHdl, weld::Button &, void)
std::unique_ptr< weld::Label > m_xKey2FT
static void lcl_SelectSameStrings(SwWrtShell &rSh, bool bWordOnly, bool bCaseSensitive)
void SetPhoneticReadingOfPrimKey(const OUString &rSet)
SwIndexMarkModalDlg(weld::Window *pParent, SwWrtShell &rSh, SwTOXMark const *pCurTOXMark)
constexpr OUStringLiteral aData
SwAuthorMarkPane m_aContent
static bool bIsFromComponent
std::unique_ptr< weld::Button > m_xActionBT
void EndCursorMove(const bool bIdleEnd=false)
const SfxItemPool & GetAttrPool() const
weld::DialogController & m_rDialog
#define HID_AUTH_FIELD_CUSTOM3
virtual short int run() override
#define HID_AUTH_FIELD_ISBN
#define HID_AUTH_FIELD_BOOKTITLE
void GetTOIKeys(SwTOIKeyType eTyp, std::vector< OUString > &rArr) const
Key for managing index.
SvtScriptType GetScriptType() const
returns the script type of the selection
bool HasSelection() const
SwAuthEntry * GetEntryByIdentifier(std::u16string_view rIdentifier) const
#define FN_INSERT_IDX_ENTRY_DLG
#define HID_AUTH_FIELD_CHAPTER
void SetAltStr(const OUString &rSet)
void ReInitDlg(SwWrtShell &rWrtShell, SwTOXMark const *pCurTOXMark=nullptr)
void Push()
store a copy of the current cursor on the cursor stack
#define HID_AUTH_FIELD_YEAR
#define HID_AUTH_FIELD_CUSTOM1
SfxBindings & GetBindings()
std::unique_ptr< weld::CheckButton > m_xSearchCaseSensitiveCB
sal_uInt16 GetLevel() const
FrameTypeFlags
values can be combined via logical or
std::unique_ptr< weld::Button > m_xNewBT
#define HID_AUTH_FIELD_TITLE
bool SelectTextAttr(sal_uInt16 nWhich, const SwTextAttr *pAttr=nullptr)
LanguageType m_nLangForPhoneticReading
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
All (only in non-body and selections).
OUString GetText(SwRootFrame const *pLayout) const
void AddRule(SwUndoArg eWhat, const OUString &rWith)
std::unique_ptr< weld::CheckButton > m_xApplyToAllCB
static sal_uInt16 nKey2Pos
#define HID_AUTH_FIELD_VOLUME
const OUString & GetTypeName() const
const SwTextNode * GetpTextNd() const
#define LANGUAGE_CHINESE_SIMPLIFIED
sal_uInt16 GetCursorCnt(bool bAll=true) const
Get the number of elements in the ring of cursors.
std::unique_ptr< weld::Label > m_xKey1FT
std::shared_ptr< weld::Dialog > m_xDialog
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
#define HID_AUTH_FIELD_URL
static sal_Int32 nTypePos
bool HasReadonlySel() const
#define HID_AUTH_FIELD_AUTHOR
#define HID_AUTH_FIELD_ADDRESS
#define HID_AUTH_FIELD_REPORT_TYPE
OUString const & GetTextReading() const
#define HID_AUTH_FIELD_CUSTOM4
virtual OUString get_text() const =0
std::unique_ptr< weld::Button > m_xPrevBT
Find only in body - only in combination with FindRanges::InSelAll !!!
SwFieldType * GetTyp() const
const TextInfo aTextInfoArr[]
void GetAllEntryIdentifiers(std::vector< OUString > &rToFill) const
std::unique_ptr< weld::Button > m_xEditEntryPB
std::unique_ptr< weld::Entry > m_xPhoneticED1
std::unique_ptr< weld::ComboBox > m_xTypeDCB
const LanguageTag & GetAppLanguageTag()
#define HID_AUTH_FIELD_JOURNAL
std::unique_ptr< weld::Button > m_xDelBT
std::unique_ptr< weld::Button > m_xCloseBT
SwTextNode is a paragraph in the document model.
virtual void Activate() override
void SetPhoneticReadingOfAltStr(const OUString &rSet)
static SfxViewFrame * Current()
static void SetCareDialog(const std::shared_ptr< weld::Window > &rNew)
::ucbhelper::Content m_aContent
OUString const & GetSecondaryKey() const
std::unique_ptr< weld::Entry > m_xPhoneticED0
#define HID_AUTH_FIELD_PUBLISHER
virtual void Activate() override
OUString GetSelText() const
get selected text of a node at current cursor
void SetTOUName(const OUString &rSet)
std::unique_ptr< weld::Button > m_xSyncED
SwAuthMarkModalDlg(weld::Window *pParent, SwWrtShell &rSh)
static sal_uInt16 nKey1Pos
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
OUString GetSelectionTextParam(bool bCompleteWords, bool bEraseTrail)
Reference< XExecutableDialog > m_xDialog
SwIndexMarkFloatDlg(SfxBindings *pBindings, SfxChildWindow *pChild, weld::Window *pParent, SfxChildWinInfo const *pInfo, bool bNew)
virtual void SetCheckNameHdl(const Link< AbstractSvxNameDialog &, bool > &rLink, bool bCheckImmediately=false) override
Reference< XComponentContext > getProcessComponentContext()
std::unique_ptr< weld::ComboBox > m_xKey1DCB
SwAuthorMarkPane(weld::DialogController &rDialog, weld::Builder &rBuilder, bool bNew)
Sequence< sal_Int8 > aSeq
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
#define HID_AUTH_FIELD_SERIES
std::unique_ptr< weld::CheckButton > m_xMainEntryCB
#define HID_AUTH_FIELD_SCHOOL
const SwTOXType * GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
void SetSecKey(const OUString &rSet)
const SwTOXMark & GotoTOXMark(const SwTOXMark &rStart, SwTOXSearch eDir)
traveling between marks
std::unique_ptr< weld::Label > m_xPhoneticFT2
css::uno::Reference< css::i18n::XExtendedIndexEntrySupplier > m_xExtendedIndexEntrySupplier
#define HID_AUTH_FIELD_INSTITUTION
virtual void Activate() override
std::unique_ptr< weld::Button > m_xNextBT
#define SAL_WARN(area, stream)
void InsertTOXMark(const SwTOXMarkDescription &rDesc)
void SetMainEntry(bool bSet)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const SwTextTOXMark * GetTextTOXMark() const
SwIndexMarkPane m_aContent
SwIndexMarkPane(const std::shared_ptr< weld::Dialog > &rDialog, weld::Builder &rBuilder, bool bNewDlg, SwWrtShell *pWrtShell)
#define HID_AUTH_FIELD_MONTH
void StartAllAction()
For all views of this document.
SwRootFrame * GetLayout() const
virtual ~SwIndexMarkModalDlg() override
OUString GetDefaultPhoneticReading(const OUString &rText)
IMPL_LINK(SwNewUserIdxDlg, ModifyHdl, weld::Entry &, rEdit, void)
void ModifyHdl(const weld::Widget &rWidget)
std::unique_ptr< weld::Button > m_xCreateEntryPB
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Built on top of SwWrtShell, provides functionality to insert, update or perform other actions on vari...
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
std::unique_ptr< weld::Button > m_xCloseBT
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
#define HID_AUTH_FIELD_LOCAL_URL
std::unique_ptr< weld::Entry > m_xEntryED
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
bool m_bDetectedRangeSegmentation false
SwIndexMarkPane m_aContent
std::unique_ptr< weld::Entry > m_xPhoneticED2
#define HID_AUTH_FIELD_CUSTOM5
#define HID_AUTH_FIELD_HOWPUBLISHED
bool m_bIsPhoneticReadingEnabled