LibreOffice Module sw (master) 1
swuiidxmrk.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <swuiidxmrk.hxx>
21#include <hintids.hxx>
22#include <helpids.h>
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>
34#include <utility>
35#include <vcl/svapp.hxx>
36#include <vcl/weld.hxx>
37#include <sfx2/dispatch.hxx>
38#include <sfx2/viewfrm.hxx>
39#include <svl/itemset.hxx>
40#include <editeng/langitem.hxx>
41#include <osl/diagnose.h>
42#include <o3tl/string_view.hxx>
43#include <swtypes.hxx>
44#include <toxmgr.hxx>
45#include <txttxmrk.hxx>
46#include <wrtsh.hxx>
47#include <view.hxx>
48#include <swundo.hxx>
49#include <cmdid.h>
50#include <swmodule.hxx>
51#include <fldmgr.hxx>
52#include <fldbas.hxx>
53#include <strings.hrc>
54#include <svl/cjkoptions.hxx>
56#include <ndtxt.hxx>
57#include <SwRewriter.hxx>
58#include <doc.hxx>
59#include <docsh.hxx>
60
61#define POS_CONTENT 0
62#define POS_INDEX 1
63
64static sal_Int32 nTypePos = 1; // TOX_INDEX as standard
65static sal_uInt16 nKey1Pos = USHRT_MAX;
66
67static sal_uInt16 nKey2Pos = USHRT_MAX;
68
69using namespace com::sun::star;
70using namespace com::sun::star::i18n;
71using namespace com::sun::star::lang;
72using namespace com::sun::star::util;
73using namespace ::comphelper;
74
75namespace
76{
77bool SplitUrlAndPage(const OUString& rText, OUString& rUrl, int& nPageNumber)
78{
79 uno::Reference<uri::XUriReferenceFactory> xUriReferenceFactory
80 = uri::UriReferenceFactory::create(comphelper::getProcessComponentContext());
81 uno::Reference<uri::XUriReference> xUriRef;
82 try
83 {
84 xUriRef = xUriReferenceFactory->parse(rText);
85 }
86 catch (const uno::Exception& rException)
87 {
88 SAL_WARN("sw.ui", "SplitUrlAndPage: failed to parse url: " << rException.Message);
89 return false;
90 }
91
92 OUString aPagePrefix("page=");
93 if (!xUriRef->getFragment().startsWith(aPagePrefix))
94 {
95 return false;
96 }
97
98 nPageNumber = o3tl::toInt32(xUriRef->getFragment().subView(aPagePrefix.getLength()));
99 xUriRef->clearFragment();
100 rUrl = xUriRef->getUriReference();
101 return true;
102}
103
104OUString MergeUrlAndPage(const OUString& rUrl, const std::unique_ptr<weld::SpinButton>& xPageSB)
105{
106 if (!xPageSB->get_sensitive())
107 {
108 return rUrl;
109 }
110
111 uno::Reference<uri::XUriReferenceFactory> xUriReferenceFactory
112 = uri::UriReferenceFactory::create(comphelper::getProcessComponentContext());
113 uno::Reference<uri::XUriReference> xUriRef;
114 try
115 {
116 xUriRef = xUriReferenceFactory->parse(rUrl);
117 }
118 catch (const uno::Exception& rException)
119 {
120 SAL_WARN("sw.ui", "MergeUrlAndPage: failed to parse url: " << rException.Message);
121 return rUrl;
122 }
123
124 OUString aFragment("page=" + OUString::number(xPageSB->get_value()));
125 xUriRef->setFragment(aFragment);
126 return xUriRef->getUriReference();
127}
128}
129
130// dialog to insert a directory selection
131SwIndexMarkPane::SwIndexMarkPane(std::shared_ptr<weld::Dialog> xDialog, weld::Builder& rBuilder, bool bNewDlg,
132 SwWrtShell* pWrtShell)
133 : m_xDialog(std::move(xDialog))
134 , m_bDel(false)
135 , m_bNewMark(bNewDlg)
136 , m_bSelected(false)
137 , m_bPhoneticED0_ChangedByUser(false)
138 , m_bPhoneticED1_ChangedByUser(false)
139 , m_bPhoneticED2_ChangedByUser(false)
140 , m_nLangForPhoneticReading(LANGUAGE_CHINESE_SIMPLIFIED)
141 , m_bIsPhoneticReadingEnabled(false)
142 , m_pSh(pWrtShell)
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{
172 m_xSyncED->show();
173
175 {
176 uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext();
177
178 m_xExtendedIndexEntrySupplier = i18n::IndexEntrySupplier::create(xContext);
179
180 m_xPhoneticFT0->show();
181 m_xPhoneticED0->show();
182 m_xPhoneticFT1->show();
183 m_xPhoneticED1->show();
184 m_xPhoneticFT2->show();
185 m_xPhoneticED2->show();
186 }
187
188 // tdf#129726 there are two help pages for this dialog, one for each mode,
189 // where a widget/dialog appears in both, use -insert/-edit to disambiguate
190 if (m_bNewMark)
191 {
192 m_xDialog->set_title(SwResId(STR_IDXMRK_INSERT));
193 m_xDialog->set_help_id(m_xDialog->get_help_id() + "-insert");
194 m_xTypeDCB->set_help_id(m_xTypeDCB->get_help_id() + "-insert");
195 }
196 else
197 {
198 m_xDialog->set_title(SwResId(STR_IDXMRK_EDIT));
199 m_xDialog->set_help_id(m_xDialog->get_help_id() + "-edit");
200 m_xTypeDCB->set_help_id(m_xTypeDCB->get_help_id() + "-edit");
201 }
202
203 m_xDelBT->connect_clicked(LINK(this,SwIndexMarkPane, DelHdl));
204 m_xPrevBT->connect_clicked(LINK(this,SwIndexMarkPane, PrevHdl));
205 m_xPrevSameBT->connect_clicked(LINK(this,SwIndexMarkPane, PrevSameHdl));
206 m_xNextBT->connect_clicked(LINK(this,SwIndexMarkPane, NextHdl));
207 m_xNextSameBT->connect_clicked(LINK(this,SwIndexMarkPane, NextSameHdl));
208 m_xTypeDCB->connect_changed(LINK(this,SwIndexMarkPane, ModifyListBoxHdl));
209 m_xKey1DCB->connect_changed(LINK(this,SwIndexMarkPane, KeyDCBModifyHdl));
210 m_xKey2DCB->connect_changed(LINK(this,SwIndexMarkPane, KeyDCBModifyHdl));
211 m_xCloseBT->connect_clicked(LINK(this,SwIndexMarkPane, CloseHdl));
212 m_xEntryED->connect_changed(LINK(this,SwIndexMarkPane, ModifyEditHdl));
213 m_xNewBT->connect_clicked(LINK(this, SwIndexMarkPane, NewUserIdxHdl));
214 m_xApplyToAllCB->connect_toggled(LINK(this, SwIndexMarkPane, SearchTypeHdl));
215 m_xPhoneticED0->connect_changed(LINK(this,SwIndexMarkPane, PhoneticEDModifyHdl));
216 m_xPhoneticED1->connect_changed(LINK(this,SwIndexMarkPane, PhoneticEDModifyHdl));
217 m_xPhoneticED2->connect_changed(LINK(this,SwIndexMarkPane, PhoneticEDModifyHdl));
218 m_xSyncED->connect_clicked(LINK(this, SwIndexMarkPane, SyncSelectionHdl));
219
220 if (m_bNewMark)
221 m_xDelBT->hide();
222 else
223 m_xNewBT->hide();
224 m_xOKBT->show();
225 m_xOKBT->connect_clicked(LINK(this, SwIndexMarkPane, InsertHdl));
226
227 m_xEntryED->grab_focus();
228}
229
230// Newly initialise controls with the new selection
232{
233 assert(m_pSh && m_pTOXMgr && "no shell?");
234 // contents index
235 const SwTOXType* pType = m_pTOXMgr->GetTOXType(TOX_CONTENT);
236 assert(pType && "No directory type !!");
237 OUString sTmpTypeSelection;
238 if (m_xTypeDCB->get_active() != -1)
239 sTmpTypeSelection = m_xTypeDCB->get_active_text();
240 m_xTypeDCB->clear();
241 m_xTypeDCB->append_text(pType->GetTypeName());
242
243 // keyword index
244 pType = m_pTOXMgr->GetTOXType(TOX_INDEX);
245 assert(pType && "No directory type !!");
246 m_xTypeDCB->append_text(pType->GetTypeName());
247
248 // user index
249 sal_uInt16 nCount = m_pSh->GetTOXTypeCount(TOX_USER);
250 for (sal_uInt16 i = 0; i < nCount; ++i)
251 m_xTypeDCB->append_text(m_pSh->GetTOXType(TOX_USER, i)->GetTypeName());
252
253 // read keywords primary
254 {
255 std::vector<OUString> aArr;
257 std::sort(aArr.begin(), aArr.end());
258 auto last = std::unique(aArr.begin(), aArr.end());
259 for (auto it = aArr.begin(); it != last; ++it)
260 m_xKey1DCB->append_text(*it);
261 }
262
263 // read keywords secondary
264 {
265 std::vector<OUString> aArr;
267 std::sort(aArr.begin(), aArr.end());
268 auto last = std::unique(aArr.begin(), aArr.end());
269 for (auto it = aArr.begin(); it != last; ++it)
270 m_xKey2DCB->append_text(*it);
271 }
272
274
275 // current entry
276 const SwTOXMark* pMark = m_pTOXMgr->GetCurTOXMark();
277 if( pMark && !m_bNewMark)
278 {
279 // Controls-Handling
280
281 // only if there are more than one
282 // if equal it lands at the same entry
284
285 const SwTOXMark* pMoveMark;
286 bool bShow = false;
287
288 pMoveMark = &m_pSh->GotoTOXMark( *pMark, TOX_PRV );
289 if( pMoveMark != pMark )
290 {
291 m_pSh->GotoTOXMark( *pMoveMark, TOX_NXT );
292 bShow = true;
293 }
294 m_xPrevBT->set_sensitive(pMoveMark != pMark);
295 pMoveMark = &m_pSh->GotoTOXMark( *pMark, TOX_NXT );
296 if( pMoveMark != pMark )
297 {
298 m_pSh->GotoTOXMark( *pMoveMark, TOX_PRV );
299 bShow = true;
300 }
301 m_xNextBT->set_sensitive(pMoveMark != pMark);
302 if( bShow )
303 {
304 m_xPrevBT->show();
305 m_xNextBT->show();
306 bShow = false;
307 }
308
309 pMoveMark = &m_pSh->GotoTOXMark( *pMark, TOX_SAME_PRV );
310 if( pMoveMark != pMark )
311 {
312 m_pSh->GotoTOXMark( *pMoveMark, TOX_SAME_NXT );
313 bShow = true;
314 }
315 m_xPrevSameBT->set_sensitive(pMoveMark != pMark);
316 pMoveMark = &m_pSh->GotoTOXMark( *pMark, TOX_SAME_NXT );
317 if( pMoveMark != pMark )
318 {
319 m_pSh->GotoTOXMark( *pMoveMark, TOX_SAME_PRV );
320 bShow = true;
321 }
322 m_xNextSameBT->set_sensitive(pMoveMark != pMark);
323 if( bShow )
324 {
325 m_xNextSameBT->show();
326 m_xPrevSameBT->show();
327 }
329
330 m_xTypeFT->show();
331
332 m_xTypeDCB->set_sensitive(false);
333 m_xTypeFT->set_sensitive(false);
334
335 UpdateDialog();
336 }
337 else
338 { // display current selection (first element) ????
339 if (m_pSh->GetCursorCnt() < 2)
340 {
343 m_xEntryED->set_text(m_aOrgStr);
344
345 //to include all equal entries may only be allowed in the body and even there
346 //only when a simple selection exists
347 const FrameTypeFlags nFrameType = m_pSh->GetFrameType(nullptr,true);
348 m_xApplyToAllCB->show();
351 m_xApplyToAllCB->set_sensitive(!m_aOrgStr.isEmpty() &&
353 SearchTypeHdl(*m_xApplyToAllCB);
354 }
355
356 // index type is default
357 if (!sTmpTypeSelection.isEmpty() && m_xTypeDCB->find_text(sTmpTypeSelection) != -1)
358 m_xTypeDCB->set_active_text(sTmpTypeSelection);
359 else
360 m_xTypeDCB->set_active_text(m_xTypeDCB->get_text(nTypePos));
362 }
363}
364
366{
367 //no phonetic reading if no global cjk support
369 {
371 return;
372 }
374
375 //get the current language
376 if(!m_bNewMark) //if dialog is opened to iterate existing marks
377 {
378 OSL_ENSURE(m_pTOXMgr, "need TOXMgr");
379 if(!m_pTOXMgr)
380 return;
381 SwTOXMark* pMark = m_pTOXMgr->GetCurTOXMark();
382 OSL_ENSURE(pMark, "need current SwTOXMark");
383 if(!pMark)
384 return;
385 SwTextTOXMark* pTextTOXMark = pMark->GetTextTOXMark();
386 OSL_ENSURE(pTextTOXMark, "need current SwTextTOXMark");
387 if(!pTextTOXMark)
388 return;
389 const SwTextNode* pTextNode = pTextTOXMark->GetpTextNd();
390 OSL_ENSURE(pTextNode, "need current SwTextNode");
391 if(!pTextNode)
392 return;
393 sal_Int32 nTextIndex = pTextTOXMark->GetStart();
394 m_nLangForPhoneticReading = pTextNode->GetLang( nTextIndex );
395 }
396 else //if dialog is opened to create a new mark
397 {
398 sal_uInt16 nWhich;
399 switch(m_pSh->GetScriptType())
400 {
401 case SvtScriptType::ASIAN: nWhich = RES_CHRATR_CJK_LANGUAGE; break;
402 case SvtScriptType::COMPLEX:nWhich = RES_CHRATR_CTL_LANGUAGE; break;
403 default:nWhich = RES_CHRATR_LANGUAGE; break;
404 }
405 SfxItemSet aLangSet(m_pSh->GetAttrPool(), nWhich, nWhich);
406 m_pSh->GetCurAttr(aLangSet);
407 m_nLangForPhoneticReading = static_cast<const SvxLanguageItem&>(aLangSet.Get(nWhich)).GetLanguage();
408 }
409
410}
411
412OUString SwIndexMarkPane::GetDefaultPhoneticReading( const OUString& rText )
413{
415 return OUString();
416
418}
419
421{
422 // display current selection (first element) ????
423 if (m_bNewMark)
424 {
425 m_xSyncED->set_sensitive(m_pSh->GetCursorCnt() < 2);
426 }
427}
428
430{
431 m_bSelected = !m_pSh->HasSelection();
432 m_aOrgStr = m_pSh->GetView().GetSelectionTextParam(true, false);
433 m_xEntryED->set_text(m_aOrgStr);
434
435 //to include all equal entries may only be allowed in the body and even there
436 //only when a simple selection exists
437 const FrameTypeFlags nFrameType = m_pSh->GetFrameType(nullptr,true);
438 m_xApplyToAllCB->show();
439 m_xSearchCaseSensitiveCB->show();
440 m_xSearchCaseWordOnlyCB->show();
441 m_xApplyToAllCB->set_sensitive(!m_aOrgStr.isEmpty() &&
443 SearchTypeHdl(*m_xApplyToAllCB);
444 ModifyHdl(*m_xEntryED);
445}
446
447// evaluate Ok-Button
449{
450 InsertUpdate();
451 if(m_bSelected)
452 m_pSh->ResetSelect(nullptr, false);
453}
454
455// apply changes
457{
460 SwRewriter aRewriter;
461
462 if( m_bNewMark )
463 {
464 InsertMark();
465
466 if ( m_pTOXMgr->GetCurTOXMark())
467 aRewriter.AddRule(UndoArg1,
468 m_pTOXMgr->GetCurTOXMark()->GetText(m_pSh->GetLayout()));
469 }
470 else if( !m_pSh->HasReadonlySel() )
471 {
472 if ( m_pTOXMgr->GetCurTOXMark())
473 aRewriter.AddRule(UndoArg1,
474 m_pTOXMgr->GetCurTOXMark()->GetText(m_pSh->GetLayout()));
475
476 if( m_bDel )
477 m_pTOXMgr->DeleteTOXMark();
478 else if( m_pTOXMgr->GetCurTOXMark() )
479 UpdateMark();
480 }
481
484
485 nTypePos = m_xTypeDCB->find_text(m_xTypeDCB->get_active_text());
486 if(nTypePos == -1)
487 nTypePos = 0;
488
489 nKey1Pos = m_xKey1DCB->find_text(m_xKey1DCB->get_active_text());
490 nKey2Pos = m_xKey2DCB->find_text(m_xKey2DCB->get_active_text());
491}
492
493// insert mark
494static void lcl_SelectSameStrings(SwWrtShell& rSh, bool bWordOnly, bool bCaseSensitive)
495{
496 rSh.Push();
497
498 i18nutil::SearchOptions2 aSearchOpt(
499 SearchAlgorithms_ABSOLUTE,
500 ( bWordOnly ? SearchFlags::NORM_WORD_ONLY : 0 ),
501 rSh.GetSelText(), OUString(),
503 0, 0, 0,
504 (bCaseSensitive
505 ? TransliterationFlags::NONE
506 : TransliterationFlags::IGNORE_CASE),
507 SearchAlgorithms2::ABSOLUTE,
508 '\\' );
509
510 rSh.ClearMark();
511 bool bCancel;
512
513 //todo/mba: assuming that notes should not be searched
514 rSh.Find_Text(aSearchOpt, false/*bSearchInNotes*/, SwDocPositions::Start, SwDocPositions::End, bCancel,
516}
517
519{
520 auto nPos = m_xTypeDCB->find_text(m_xTypeDCB->get_active_text());
523
525
526 const int nLevel = m_xLevelNF->denormalize(m_xLevelNF->get_value());
527 switch( nPos)
528 {
529 case POS_CONTENT : break;
530 case POS_INDEX: // keyword index mark
531 {
533 aDesc.SetPrimKey(m_xKey1DCB->get_active_text());
534 aDesc.SetSecKey(m_xKey2DCB->get_active_text());
535 aDesc.SetMainEntry(m_xMainEntryCB->get_active());
539 }
540 break;
541 default: // Userdefined index mark
542 {
543 aDesc.SetTOUName(m_xTypeDCB->get_active_text());
544 }
545 }
546 if (m_aOrgStr != m_xEntryED->get_text())
547 aDesc.SetAltStr(m_xEntryED->get_text());
548 bool bApplyAll = m_xApplyToAllCB->get_active();
549 bool bWordOnly = m_xSearchCaseWordOnlyCB->get_active();
550 bool bCaseSensitive = m_xSearchCaseSensitiveCB->get_active();
551
553 // all equal strings have to be selected here so that the
554 // entry is applied to all equal strings
555 if(bApplyAll)
556 {
557 lcl_SelectSameStrings(*m_pSh, bWordOnly, bCaseSensitive);
558 }
559 aDesc.SetLevel(nLevel);
560 SwTOXMgr aMgr(m_pSh);
561 aMgr.InsertTOXMark(aDesc);
562 if(bApplyAll)
564
566}
567
568// update mark
570{
571 OUString aAltText(m_xEntryED->get_text());
572 OUString* pAltText = m_aOrgStr != m_xEntryED->get_text() ? &aAltText : nullptr;
573 //empty alternative texts are not allowed
574 if(pAltText && pAltText->isEmpty())
575 return;
576
578
579 auto nPos = m_xTypeDCB->find_text(m_xTypeDCB->get_active_text());
581 if(POS_CONTENT == nPos)
583 else if(POS_INDEX == nPos)
585
587 aDesc.SetLevel(m_xLevelNF->get_value());
588 if(pAltText)
589 aDesc.SetAltStr(*pAltText);
590
591 OUString aPrim(m_xKey1DCB->get_active_text());
592 if(!aPrim.isEmpty())
593 aDesc.SetPrimKey(aPrim);
594 OUString aSec(m_xKey2DCB->get_active_text());
595 if(!aSec.isEmpty())
596 aDesc.SetSecKey(aSec);
597
598 if(eType == TOX_INDEX)
599 {
603 }
604 aDesc.SetMainEntry(m_xMainEntryCB->get_visible() && m_xMainEntryCB->get_active());
605 m_pTOXMgr->UpdateTOXMark(aDesc);
606}
607
608// insert new keys
610{
611 OUString aKey(m_xKey1DCB->get_active_text());
612 auto nPos = m_xKey1DCB->find_text(aKey);
613 if(nPos == -1 && !aKey.isEmpty())
614 { // create new key
615 m_xKey1DCB->append_text(aKey);
616 }
617
618 aKey = m_xKey2DCB->get_active_text();
619 nPos = m_xKey2DCB->find_text(aKey);
620
621 if(nPos == -1 && !aKey.isEmpty())
622 { // create new key
623 m_xKey2DCB->append_text(aKey);
624 }
625}
626
627namespace {
628
629class SwNewUserIdxDlg : public weld::GenericDialogController
630{
631 SwIndexMarkPane* m_pDlg;
632
633 std::unique_ptr<weld::Button> m_xOKPB;
634 std::unique_ptr<weld::Entry> m_xNameED;
635
636 DECL_LINK(ModifyHdl, weld::Entry&, void);
637
638public:
639 explicit SwNewUserIdxDlg(SwIndexMarkPane* pPane, weld::Window* pParent)
640 : GenericDialogController(pParent, "modules/swriter/ui/newuserindexdialog.ui", "NewUserIndexDialog")
641 , m_pDlg(pPane)
642 , m_xOKPB(m_xBuilder->weld_button("ok"))
643 , m_xNameED(m_xBuilder->weld_entry("entry"))
644 {
645 m_xNameED->connect_changed(LINK(this, SwNewUserIdxDlg, ModifyHdl));
646 m_xOKPB->set_sensitive(false);
647 m_xNameED->grab_focus();
648 }
649 OUString GetName() const { return m_xNameED->get_text(); }
650};
651
652}
653
654IMPL_LINK( SwNewUserIdxDlg, ModifyHdl, weld::Entry&, rEdit, void)
655{
656 m_xOKPB->set_sensitive(!rEdit.get_text().isEmpty() && !m_pDlg->IsTOXType(rEdit.get_text()));
657}
658
660{
661 SwNewUserIdxDlg aDlg(this, m_xDialog.get());
662 if (aDlg.run() == RET_OK)
663 {
664 OUString sNewName(aDlg.GetName());
665 m_xTypeDCB->append_text(sNewName);
666 m_xTypeDCB->set_active_text(sNewName);
667 }
668}
669
670IMPL_LINK( SwIndexMarkPane, SearchTypeHdl, weld::Toggleable&, rBox, void)
671{
672 const bool bEnable = rBox.get_active() && rBox.get_sensitive();
673 m_xSearchCaseWordOnlyCB->set_sensitive(bEnable);
674 m_xSearchCaseSensitiveCB->set_sensitive(bEnable);
675}
676
677IMPL_LINK(SwIndexMarkPane, InsertHdl, weld::Button&, rButton, void)
678{
679 Apply();
680 //close the dialog if only one entry is available
681 if(!m_bNewMark && !m_xPrevBT->get_visible() && !m_xNextBT->get_visible())
682 CloseHdl(rButton);
683}
684
686{
687 if (m_bNewMark)
688 {
690 SfxCallMode::ASYNCHRON|SfxCallMode::RECORD);
691 }
692 else
693 {
694 m_xDialog->response(RET_CLOSE);
695 }
696}
697
698// select index type only when inserting
699IMPL_LINK(SwIndexMarkPane, ModifyListBoxHdl, weld::ComboBox&, rBox, void)
700{
701 ModifyHdl(rBox);
702}
703
704IMPL_LINK(SwIndexMarkPane, ModifyEditHdl, weld::Entry&, rEdit, void)
705{
706 ModifyHdl(rEdit);
707}
708
710{
711 if (m_xTypeDCB.get() == &rBox)
712 {
713 // set index type
714 auto nPos = m_xTypeDCB->find_text(m_xTypeDCB->get_active_text());
715 bool bLevelEnable = false,
716 bKeyEnable = false,
717 bSetKey2 = false,
718 bKey2Enable = false,
719 bEntryHasText = false,
720 bKey1HasText = false,
721 bKey2HasText = false;
722 if(nPos == POS_INDEX)
723 {
724 if (!m_xEntryED->get_text().isEmpty())
725 bEntryHasText = true;
727
728 bKeyEnable = true;
729 m_xKey1DCB->set_active_text(m_xKey1DCB->get_text(nKey1Pos));
730 m_xPhoneticED1->set_text(GetDefaultPhoneticReading(m_xKey1DCB->get_active_text()));
731 if (!m_xKey1DCB->get_active_text().isEmpty())
732 {
733 bKey1HasText = bSetKey2 = bKey2Enable = true;
734 m_xKey2DCB->set_active_text(m_xKey2DCB->get_text(nKey2Pos));
735 m_xPhoneticED2->set_text(GetDefaultPhoneticReading(m_xKey2DCB->get_active_text()));
736 if(!m_xKey2DCB->get_active_text().isEmpty())
737 bKey2HasText = true;
738 }
739 }
740 else
741 {
742 bLevelEnable = true;
743 m_xLevelNF->set_max(MAXLEVEL);
744 m_xLevelNF->set_value(m_xLevelNF->normalize(0));
745 bSetKey2 = true;
746 }
747 m_xLevelFT->set_visible(bLevelEnable);
748 m_xLevelNF->set_visible(bLevelEnable);
749 m_xMainEntryCB->set_visible(nPos == POS_INDEX);
750
751 m_xKey1FT->set_sensitive(bKeyEnable);
752 m_xKey1DCB->set_sensitive(bKeyEnable);
753 if ( bSetKey2 )
754 {
755 m_xKey2DCB->set_sensitive(bKey2Enable);
756 m_xKey2FT->set_sensitive(bKey2Enable);
757 }
758 m_xPhoneticFT0->set_sensitive(bKeyEnable&&bEntryHasText&&m_bIsPhoneticReadingEnabled);
759 m_xPhoneticED0->set_sensitive(bKeyEnable&&bEntryHasText&&m_bIsPhoneticReadingEnabled);
760 m_xPhoneticFT1->set_sensitive(bKeyEnable&&bKey1HasText&&m_bIsPhoneticReadingEnabled);
761 m_xPhoneticED1->set_sensitive(bKeyEnable&&bKey1HasText&&m_bIsPhoneticReadingEnabled);
762 m_xPhoneticFT2->set_sensitive(bKeyEnable&&bKey2HasText&&m_bIsPhoneticReadingEnabled);
763 m_xPhoneticED2->set_sensitive(bKeyEnable&&bKey2HasText&&m_bIsPhoneticReadingEnabled);
764 }
765 else //m_xEntryED !!m_xEntryED is not a ListBox but an Edit
766 {
767 bool bHasText = !m_xEntryED->get_text().isEmpty();
768 if(!bHasText)
769 {
770 m_xPhoneticED0->set_text(OUString());
772 }
775
776 m_xPhoneticFT0->set_sensitive(bHasText&&m_bIsPhoneticReadingEnabled);
777 m_xPhoneticED0->set_sensitive(bHasText&&m_bIsPhoneticReadingEnabled);
778 }
779 m_xOKBT->set_sensitive(!m_pSh->HasReadonlySel() &&
780 (!m_xEntryED->get_text().isEmpty() || m_pSh->GetCursorCnt(false)));
781}
782
784{
785 InsertUpdate();
786 m_pTOXMgr->NextTOXMark();
787 UpdateDialog();
788}
789
791{
792 InsertUpdate();
793 m_pTOXMgr->NextTOXMark(true);
794 UpdateDialog();
795}
796
798{
799 InsertUpdate();
800 m_pTOXMgr->PrevTOXMark();
801 UpdateDialog();
802}
803
805{
806 InsertUpdate();
807 m_pTOXMgr->PrevTOXMark(true);
808 UpdateDialog();
809}
810
812{
813 m_bDel = true;
814 InsertUpdate();
815 m_bDel = false;
816
817 if(m_pTOXMgr->GetCurTOXMark())
818 UpdateDialog();
819 else
820 {
821 CloseHdl(*m_xCloseBT);
823 }
824}
825
826// renew dialog view
828{
829 OSL_ENSURE(m_pSh && m_pTOXMgr, "no shell?");
830 SwTOXMark* pMark = m_pTOXMgr->GetCurTOXMark();
831 OSL_ENSURE(pMark, "no current marker");
832 if(!pMark)
833 return;
834
836
837 m_aOrgStr = pMark->GetText(m_pSh->GetLayout());
838 m_xEntryED->set_text(m_aOrgStr);
839
840 // set index type
841 bool bLevelEnable = true,
842 bKeyEnable = false,
843 bKey2Enable = false,
844 bEntryHasText = false,
845 bKey1HasText = false,
846 bKey2HasText = false;
847
848 TOXTypes eCurType = pMark->GetTOXType()->GetType();
849 if(TOX_INDEX == eCurType)
850 {
851 bLevelEnable = false;
852 bKeyEnable = true;
853 bKey1HasText = bKey2Enable = !pMark->GetPrimaryKey().isEmpty();
854 bKey2HasText = !pMark->GetSecondaryKey().isEmpty();
855 bEntryHasText = !pMark->GetText(m_pSh->GetLayout()).isEmpty();
856 m_xKey1DCB->set_entry_text( pMark->GetPrimaryKey() );
857 m_xKey2DCB->set_entry_text( pMark->GetSecondaryKey() );
858 m_xPhoneticED0->set_text( pMark->GetTextReading() );
859 m_xPhoneticED1->set_text( pMark->GetPrimaryKeyReading() );
860 m_xPhoneticED2->set_text( pMark->GetSecondaryKeyReading() );
861 m_xMainEntryCB->set_active(pMark->IsMainEntry());
862 }
863 else if(TOX_CONTENT == eCurType || TOX_USER == eCurType)
864 {
865 m_xLevelNF->set_value(m_xLevelNF->normalize(pMark->GetLevel()));
866 }
867 m_xKey1FT->set_sensitive(bKeyEnable);
868 m_xKey1DCB->set_sensitive(bKeyEnable);
869 m_xLevelNF->set_max(MAXLEVEL);
870 m_xLevelFT->set_visible(bLevelEnable);
871 m_xLevelNF->set_visible(bLevelEnable);
872 m_xMainEntryCB->set_visible(!bLevelEnable);
873 m_xKey2FT->set_sensitive(bKey2Enable);
874 m_xKey2DCB->set_sensitive(bKey2Enable);
875
877 m_xPhoneticFT0->set_sensitive(bKeyEnable&&bEntryHasText&&m_bIsPhoneticReadingEnabled);
878 m_xPhoneticED0->set_sensitive(bKeyEnable&&bEntryHasText&&m_bIsPhoneticReadingEnabled);
879 m_xPhoneticFT1->set_sensitive(bKeyEnable&&bKey1HasText&&m_bIsPhoneticReadingEnabled);
880 m_xPhoneticED1->set_sensitive(bKeyEnable&&bKey1HasText&&m_bIsPhoneticReadingEnabled);
881 m_xPhoneticFT2->set_sensitive(bKeyEnable&&bKey2HasText&&m_bIsPhoneticReadingEnabled);
882 m_xPhoneticED2->set_sensitive(bKeyEnable&&bKey2HasText&&m_bIsPhoneticReadingEnabled);
883
884 // set index type
885 m_xTypeDCB->set_active_text(pMark->GetTOXType()->GetTypeName());
886
887 // set Next - Prev - Buttons
889 if( m_xPrevBT->get_visible() )
890 {
891 const SwTOXMark* pMoveMark = &m_pSh->GotoTOXMark( *pMark, TOX_PRV );
892 if( pMoveMark != pMark )
893 m_pSh->GotoTOXMark( *pMoveMark, TOX_NXT );
894 m_xPrevBT->set_sensitive( pMoveMark != pMark );
895 pMoveMark = &m_pSh->GotoTOXMark( *pMark, TOX_NXT );
896 if( pMoveMark != pMark )
897 m_pSh->GotoTOXMark( *pMoveMark, TOX_PRV );
898 m_xNextBT->set_sensitive( pMoveMark != pMark );
899 }
900
901 if (m_xPrevSameBT->get_visible())
902 {
903 const SwTOXMark* pMoveMark = &m_pSh->GotoTOXMark( *pMark, TOX_SAME_PRV );
904 if( pMoveMark != pMark )
905 m_pSh->GotoTOXMark( *pMoveMark, TOX_SAME_NXT );
906 m_xPrevSameBT->set_sensitive( pMoveMark != pMark );
907 pMoveMark = &m_pSh->GotoTOXMark( *pMark, TOX_SAME_NXT );
908 if( pMoveMark != pMark )
909 m_pSh->GotoTOXMark( *pMoveMark, TOX_SAME_PRV );
910 m_xNextSameBT->set_sensitive( pMoveMark != pMark );
911 }
912
913 const bool bEnable = !m_pSh->HasReadonlySel();
914 m_xOKBT->set_sensitive(bEnable);
915 m_xDelBT->set_sensitive(bEnable);
916 m_xEntryED->set_sensitive(bEnable);
917 m_xLevelNF->set_sensitive(bEnable);
918 m_xKey1DCB->set_sensitive(bEnable);
919 m_xKey2DCB->set_sensitive(bEnable);
920
922 // we need the point at the start of the attribute
923 m_pSh->SwapPam();
924
926}
927
928// Remind whether the edit boxes for Phonetic reading are changed manually
929IMPL_LINK(SwIndexMarkPane, PhoneticEDModifyHdl, weld::Entry&, rEdit, void)
930{
931 if (m_xPhoneticED0.get() == &rEdit)
932 {
933 m_bPhoneticED0_ChangedByUser = !rEdit.get_text().isEmpty();
934 }
935 else if (m_xPhoneticED1.get() == &rEdit)
936 {
937 m_bPhoneticED1_ChangedByUser = !rEdit.get_text().isEmpty();
938 }
939 else if (m_xPhoneticED2.get() == &rEdit)
940 {
941 m_bPhoneticED2_ChangedByUser = !rEdit.get_text().isEmpty();
942 }
943}
944
945// Enable Disable of the 2nd key
946IMPL_LINK( SwIndexMarkPane, KeyDCBModifyHdl, weld::ComboBox&, rBox, void )
947{
948 if (m_xKey1DCB.get() == &rBox)
949 {
950 bool bEnable = !rBox.get_active_text().isEmpty();
951 if(!bEnable)
952 {
953 m_xKey2DCB->set_entry_text(OUString());
954 m_xPhoneticED1->set_text(OUString());
955 m_xPhoneticED2->set_text(OUString());
956 m_bPhoneticED1_ChangedByUser = false;
957 m_bPhoneticED2_ChangedByUser = false;
958 }
959 else
960 {
961 if (rBox.get_popup_shown())
962 {
963 //reset bPhoneticED1_ChangedByUser if a completely new string is selected
964 m_bPhoneticED1_ChangedByUser = false;
965 }
966 if (!m_bPhoneticED1_ChangedByUser)
967 m_xPhoneticED1->set_text(GetDefaultPhoneticReading(rBox.get_active_text()));
968 }
969 m_xKey2DCB->set_sensitive(bEnable);
970 m_xKey2FT->set_sensitive(bEnable);
971 }
972 else if (m_xKey2DCB.get() == &rBox)
973 {
974 if (rBox.get_active_text().isEmpty())
975 {
976 m_xPhoneticED2->set_text(OUString());
977 m_bPhoneticED2_ChangedByUser = false;
978 }
979 else
980 {
981 if (rBox.get_popup_shown())
982 {
983 //reset bPhoneticED1_ChangedByUser if a completely new string is selected
984 m_bPhoneticED2_ChangedByUser = false;
985 }
986 if(!m_bPhoneticED2_ChangedByUser)
987 m_xPhoneticED2->set_text(GetDefaultPhoneticReading(rBox.get_active_text()));
988 }
989 }
990
991 bool bKey1HasText = !m_xKey1DCB->get_active_text().isEmpty();
992 bool bKey2HasText = !m_xKey2DCB->get_active_text().isEmpty();
993
994 m_xPhoneticFT1->set_sensitive(bKey1HasText && m_bIsPhoneticReadingEnabled);
995 m_xPhoneticED1->set_sensitive(bKey1HasText && m_bIsPhoneticReadingEnabled);
996 m_xPhoneticFT2->set_sensitive(bKey2HasText && m_bIsPhoneticReadingEnabled);
997 m_xPhoneticED2->set_sensitive(bKey2HasText && m_bIsPhoneticReadingEnabled);
998}
999
1001{
1002}
1003
1004void SwIndexMarkPane::ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark const * pCurTOXMark)
1005{
1006 m_pSh = &rWrtShell;
1007 m_pTOXMgr.reset( new SwTOXMgr(m_pSh) );
1008 if(pCurTOXMark)
1009 {
1010 for(sal_uInt16 i = 0; i < m_pTOXMgr->GetTOXMarkCount(); i++)
1011 if(m_pTOXMgr->GetTOXMark(i) == pCurTOXMark)
1012 {
1013 m_pTOXMgr->SetCurTOXMark(i);
1014 break;
1015 }
1016 }
1017 InitControls();
1018}
1019
1021 SfxChildWindow* pChild, weld::Window *pParent,
1022 SfxChildWinInfo const * pInfo, bool bNew)
1023 : SfxModelessDialogController(_pBindings, pChild, pParent,
1024 "modules/swriter/ui/indexentry.ui", "IndexEntryDialog")
1025 , m_aContent(m_xDialog, *m_xBuilder, bNew, ::GetActiveWrtShell())
1026{
1027 if (SwWrtShell* pWrtShell = ::GetActiveWrtShell())
1028 m_aContent.ReInitDlg(*pWrtShell);
1029 Initialize(pInfo);
1030}
1031
1033{
1036}
1037
1039{
1040 m_aContent.ReInitDlg( rWrtShell );
1041}
1042
1044 : SfxDialogController(pParent, "modules/swriter/ui/indexentry.ui",
1045 "IndexEntryDialog")
1046 , m_aContent(m_xDialog, *m_xBuilder, false, &rSh)
1047{
1048 m_aContent.ReInitDlg(rSh, pCurTOXMark);
1049}
1050
1052{
1054}
1055
1057{
1058 short nRet = SfxDialogController::run();
1059 if (RET_OK == nRet)
1060 m_aContent.Apply();
1061 return nRet;
1062}
1063
1064namespace {
1065
1066class SwCreateAuthEntryDlg_Impl : public weld::GenericDialogController
1067{
1068 std::vector<std::unique_ptr<weld::Builder>> m_aBuilders;
1069
1070 Link<weld::Entry&,bool> m_aShortNameCheckLink;
1071
1072 SwWrtShell& m_rWrtSh;
1073
1074 bool m_bNewEntryMode;
1075 bool m_bNameAllowed;
1076
1077 std::vector<std::unique_ptr<weld::Container>> m_aOrigContainers;
1078 std::vector<std::unique_ptr<weld::Label>> m_aFixedTexts;
1079 std::unique_ptr<weld::Box> m_pBoxes[AUTH_FIELD_END];
1080 std::unique_ptr<weld::Entry> m_pEdits[AUTH_FIELD_END];
1081 std::unique_ptr<weld::Button> m_xOKBT;
1082 std::unique_ptr<weld::Container> m_xBox;
1083 std::unique_ptr<weld::Container> m_xLeft;
1084 std::unique_ptr<weld::Container> m_xRight;
1085 std::unique_ptr<weld::ComboBox> m_xTypeListBox;
1086 std::unique_ptr<weld::ComboBox> m_xIdentifierBox;
1087 std::unique_ptr<weld::Button> m_xLocalBrowseButton;
1088 std::unique_ptr<weld::CheckButton> m_xLocalPageCB;
1089 std::unique_ptr<weld::SpinButton> m_xLocalPageSB;
1090
1091 DECL_LINK(IdentifierHdl, weld::ComboBox&, void);
1092 DECL_LINK(ShortNameHdl, weld::Entry&, void);
1093 DECL_LINK(EnableHdl, weld::ComboBox&, void);
1094 DECL_LINK(BrowseHdl, weld::Button&, void);
1095 DECL_LINK(PageNumHdl, weld::Toggleable&, void);
1096
1097public:
1098 SwCreateAuthEntryDlg_Impl(weld::Window* pParent,
1099 const OUString pFields[],
1100 SwWrtShell& rSh,
1101 bool bNewEntry,
1102 bool bCreate);
1103
1104 OUString GetEntryText(ToxAuthorityField eField) const;
1105
1106 void SetCheckNameHdl(const Link<weld::Entry&,bool>& rLink) {m_aShortNameCheckLink = rLink;}
1107
1108};
1109
1110struct TextInfo
1111{
1112 ToxAuthorityField nToxField;
1113 const char* pHelpId;
1114};
1115
1116}
1117
1118const TextInfo aTextInfoArr[] =
1119{
1152};
1153
1154static OUString lcl_FindColumnEntry(const uno::Sequence<beans::PropertyValue>& rFields, std::u16string_view rColumnTitle)
1155{
1156 for(const auto& rField : rFields)
1157 {
1158 OUString sRet;
1159 if(rField.Name == rColumnTitle &&
1160 (rField.Value >>= sRet))
1161 {
1162 return sRet;
1163 }
1164 }
1165 return OUString();
1166}
1167
1169
1171 : m_rDialog(rDialog)
1172 , m_bNewEntry(bNewDlg)
1173 , m_bBibAccessInitialized(false)
1174 , m_pSh(nullptr)
1175 , m_xFromComponentRB(rBuilder.weld_radio_button("frombibliography"))
1176 , m_xFromDocContentRB(rBuilder.weld_radio_button("fromdocument"))
1177 , m_xAuthorFI(rBuilder.weld_label("author"))
1178 , m_xTitleFI(rBuilder.weld_label("title"))
1179 , m_xEntryED(rBuilder.weld_entry("entryed"))
1180 , m_xEntryLB(rBuilder.weld_combo_box("entrylb"))
1181 , m_xActionBT(rBuilder.weld_button(m_bNewEntry ? OString("insert") : OString("modify")))
1182 , m_xCloseBT(rBuilder.weld_button("close"))
1183 , m_xCreateEntryPB(rBuilder.weld_button("new"))
1184 , m_xEditEntryPB(rBuilder.weld_button("edit"))
1185{
1186 m_xActionBT->show();
1187 m_xFromComponentRB->set_visible(m_bNewEntry);
1188 m_xFromDocContentRB->set_visible(m_bNewEntry);
1191
1192 m_xActionBT->connect_clicked(LINK(this,SwAuthorMarkPane, InsertHdl));
1193 m_xCloseBT->connect_clicked(LINK(this,SwAuthorMarkPane, CloseHdl));
1194 m_xCreateEntryPB->connect_clicked(LINK(this,SwAuthorMarkPane, CreateEntryHdl));
1195 m_xEditEntryPB->connect_clicked(LINK(this,SwAuthorMarkPane, CreateEntryHdl));
1196 m_xFromComponentRB->connect_toggled(LINK(this,SwAuthorMarkPane, ChangeSourceHdl));
1197 m_xFromDocContentRB->connect_toggled(LINK(this,SwAuthorMarkPane, ChangeSourceHdl));
1198 m_xEntryED->connect_changed(LINK(this,SwAuthorMarkPane, EditModifyHdl));
1199
1201 m_bNewEntry ? STR_AUTHMRK_INSERT : STR_AUTHMRK_EDIT));
1202
1203 m_xEntryED->set_visible(!m_bNewEntry);
1204 m_xEntryLB->set_visible(m_bNewEntry);
1205 if (m_bNewEntry)
1206 {
1207 m_xEntryLB->connect_changed(LINK(this, SwAuthorMarkPane, CompEntryHdl));
1208 }
1209}
1210
1212{
1213 m_pSh = &rWrtShell;
1214 InitControls();
1215}
1216
1218{
1219 if(m_bNewEntry)
1220 {
1222 SfxCallMode::ASYNCHRON|SfxCallMode::RECORD);
1223 }
1224 else
1225 {
1226 m_rDialog.response(RET_CANCEL);
1227 }
1228}
1229
1230IMPL_LINK( SwAuthorMarkPane, CompEntryHdl, weld::ComboBox&, rBox, void)
1231{
1232 const OUString sEntry(rBox.get_active_text());
1233 if(bIsFromComponent)
1234 {
1235 if(m_xBibAccess.is() && !sEntry.isEmpty())
1236 {
1237 if(m_xBibAccess->hasByName(sEntry))
1238 {
1239 uno::Any aEntry(m_xBibAccess->getByName(sEntry));
1240 uno::Sequence<beans::PropertyValue> aFieldProps;
1241 if(aEntry >>= aFieldProps)
1242 {
1243 auto nSize = std::min(static_cast<sal_Int32>(AUTH_FIELD_END), aFieldProps.getLength());
1244 for(sal_Int32 i = 0; i < nSize; i++)
1245 {
1246 m_sFields[i] = lcl_FindColumnEntry(aFieldProps, m_sColumnTitles[i]);
1247 }
1248 }
1249 }
1250 }
1251 }
1252 else
1253 {
1254 if(!sEntry.isEmpty())
1255 {
1256 const SwAuthorityFieldType* pFType = static_cast<const SwAuthorityFieldType*>(
1257 m_pSh->GetFieldType(SwFieldIds::TableOfAuthorities, OUString()));
1258 const SwAuthEntry* pEntry = pFType ? pFType->GetEntryByIdentifier(sEntry) : nullptr;
1259 for(int i = 0; i < AUTH_FIELD_END; i++)
1260 m_sFields[i] = pEntry ?
1261 pEntry->GetAuthorField(static_cast<ToxAuthorityField>(i)) : OUString();
1262 }
1263 }
1264 if (rBox.get_active_text().isEmpty())
1265 {
1266 for(OUString & s : m_sFields)
1267 s.clear();
1268 }
1269 m_xAuthorFI->set_label(m_sFields[AUTH_FIELD_AUTHOR]);
1270 m_xTitleFI->set_label(m_sFields[AUTH_FIELD_TITLE]);
1271}
1272
1274{
1275 //insert or update the SwAuthorityField...
1276 if(m_pSh)
1277 {
1278 bool bDifferent = false;
1279 OSL_ENSURE(!m_sFields[AUTH_FIELD_IDENTIFIER].isEmpty() , "No Id is set!");
1280 OSL_ENSURE(!m_sFields[AUTH_FIELD_AUTHORITY_TYPE].isEmpty() , "No authority type is set!");
1281 //check if the entry already exists with different content
1282 const SwAuthorityFieldType* pFType = static_cast<const SwAuthorityFieldType*>(
1283 m_pSh->GetFieldType(SwFieldIds::TableOfAuthorities, OUString()));
1284 const SwAuthEntry* pEntry = pFType ?
1285 pFType->GetEntryByIdentifier( m_sFields[AUTH_FIELD_IDENTIFIER])
1286 : nullptr;
1287 if(pEntry)
1288 {
1289 for(int i = 0; i < AUTH_FIELD_END && !bDifferent; i++)
1290 bDifferent |= m_sFields[i] != pEntry->GetAuthorField(static_cast<ToxAuthorityField>(i));
1291 if(bDifferent)
1292 {
1293 std::unique_ptr<weld::MessageDialog> xQuery(Application::CreateMessageDialog(m_rDialog.getDialog(),
1294 VclMessageType::Question, VclButtonsType::YesNo,
1295 SwResId(STR_QUERY_CHANGE_AUTH_ENTRY)));
1296 if (RET_YES != xQuery->run())
1297 return;
1298 }
1299 }
1300
1301 SwFieldMgr aMgr(m_pSh);
1302 OUStringBuffer sFields;
1303 for(OUString & s : m_sFields)
1304 {
1305 sFields.append(s).append(TOX_STYLE_DELIMITER);
1306 }
1307 if(m_bNewEntry)
1308 {
1309 if(bDifferent)
1310 {
1312 for(int i = 0; i < AUTH_FIELD_END; i++)
1313 xNewData->SetAuthorField(static_cast<ToxAuthorityField>(i), m_sFields[i]);
1314 m_pSh->ChangeAuthorityData(xNewData.get());
1315 }
1316 SwInsertField_Data aData(SwFieldTypesEnum::Authority, 0, sFields.makeStringAndClear(), OUString(), 0 );
1317 aMgr.InsertField( aData );
1318 }
1319 else if(aMgr.GetCurField())
1320 {
1321 aMgr.UpdateCurField(0, sFields.makeStringAndClear(), OUString());
1322 }
1323 }
1324 if(!m_bNewEntry)
1325 CloseHdl(*m_xCloseBT);
1326}
1327
1328IMPL_LINK(SwAuthorMarkPane, CreateEntryHdl, weld::Button&, rButton, void)
1329{
1330 bool bCreate = &rButton == m_xCreateEntryPB.get();
1331 OUString sOldId = m_sCreatedEntry[0];
1332 for(int i = 0; i < AUTH_FIELD_END; i++)
1333 m_sCreatedEntry[i] = bCreate ? OUString() : m_sFields[i];
1334 SwCreateAuthEntryDlg_Impl aDlg(m_rDialog.getDialog(),
1335 bCreate ? m_sCreatedEntry : m_sFields,
1336 *m_pSh, m_bNewEntry, bCreate);
1337 if(m_bNewEntry)
1338 {
1339 aDlg.SetCheckNameHdl(LINK(this, SwAuthorMarkPane, IsEntryAllowedHdl));
1340 }
1341 if(RET_OK != aDlg.run())
1342 return;
1343
1344 if(bCreate && !sOldId.isEmpty())
1345 {
1346 m_xEntryLB->remove_text(sOldId);
1347 }
1348 for(int i = 0; i < AUTH_FIELD_END; i++)
1349 {
1350 m_sFields[i] = aDlg.GetEntryText(static_cast<ToxAuthorityField>(i));
1351 m_sCreatedEntry[i] = m_sFields[i];
1352 }
1353 if(m_bNewEntry && !m_xFromDocContentRB->get_active())
1354 {
1355 m_xFromDocContentRB->set_active(true);
1356 ChangeSourceHdl(*m_xFromDocContentRB);
1357 }
1358 if(bCreate)
1359 {
1360 OSL_ENSURE(m_xEntryLB->find_text(m_sFields[AUTH_FIELD_IDENTIFIER]) == -1,
1361 "entry exists!");
1362 m_xEntryLB->append_text(m_sFields[AUTH_FIELD_IDENTIFIER]);
1363 m_xEntryLB->set_active_text(m_sFields[AUTH_FIELD_IDENTIFIER]);
1364 }
1365 m_xEntryED->set_text(m_sFields[AUTH_FIELD_IDENTIFIER]);
1366 m_xAuthorFI->set_label(m_sFields[AUTH_FIELD_AUTHOR]);
1367 m_xTitleFI->set_label(m_sFields[AUTH_FIELD_TITLE]);
1368 m_xActionBT->set_sensitive(true);
1369
1370 if (!m_bNewEntry)
1371 {
1372 // When in edit mode, automatically apply the changed entry to update the field in the doc
1373 // model.
1374 InsertHdl(*m_xActionBT);
1375 }
1376}
1377
1379{
1380 bool bFromComp = m_xFromComponentRB->get_active();
1381 bIsFromComponent = bFromComp;
1382 m_xCreateEntryPB->set_sensitive(!bIsFromComponent);
1383 m_xEntryLB->clear();
1384 if(bIsFromComponent)
1385 {
1386 if(!m_bBibAccessInitialized)
1387 {
1388 uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext();
1389 m_xBibAccess = frame::Bibliography::create( xContext );
1390 uno::Reference< beans::XPropertySet > xPropSet(m_xBibAccess, uno::UNO_QUERY);
1391 OUString uPropName("BibliographyDataFieldNames");
1392 if(xPropSet.is() && xPropSet->getPropertySetInfo()->hasPropertyByName(uPropName))
1393 {
1394 uno::Any aNames = xPropSet->getPropertyValue(uPropName);
1395 uno::Sequence<beans::PropertyValue> aSeq;
1396 if( aNames >>= aSeq)
1397 {
1398 for(const beans::PropertyValue& rProp : std::as_const(aSeq))
1399 {
1400 sal_Int16 nField = 0;
1401 rProp.Value >>= nField;
1402 if(nField >= 0 && nField < AUTH_FIELD_END)
1403 m_sColumnTitles[nField] = rProp.Name;
1404 }
1405 }
1406 }
1407 m_bBibAccessInitialized = true;
1408 }
1409 if(m_xBibAccess.is())
1410 {
1411 const uno::Sequence<OUString> aIdentifiers = m_xBibAccess->getElementNames();
1412 for(const OUString& rName : aIdentifiers)
1413 m_xEntryLB->append_text(rName);
1414 }
1415 }
1416 else
1417 {
1418 const SwAuthorityFieldType* pFType = static_cast<const SwAuthorityFieldType*>(
1419 m_pSh->GetFieldType(SwFieldIds::TableOfAuthorities, OUString()));
1420 if(pFType)
1421 {
1422 std::vector<OUString> aIds;
1423 pFType->GetAllEntryIdentifiers( aIds );
1424 for(const OUString & i : aIds)
1425 m_xEntryLB->append_text(i);
1426 }
1427 if(!m_sCreatedEntry[AUTH_FIELD_IDENTIFIER].isEmpty())
1428 m_xEntryLB->append_text(m_sCreatedEntry[AUTH_FIELD_IDENTIFIER]);
1429 }
1430 m_xEntryLB->set_active(0);
1431 CompEntryHdl(*m_xEntryLB);
1432}
1433
1434IMPL_LINK(SwAuthorMarkPane, EditModifyHdl, weld::Entry&, rEdit, void)
1435{
1436 Link<weld::Entry&,bool> aAllowed = LINK(this, SwAuthorMarkPane, IsEditAllowedHdl);
1437 bool bResult = aAllowed.Call(rEdit);
1438 m_xActionBT->set_sensitive(bResult);
1439 if(bResult)
1440 {
1441 OUString sEntry(rEdit.get_text());
1442 m_sFields[AUTH_FIELD_IDENTIFIER] = sEntry;
1443 m_sCreatedEntry[AUTH_FIELD_IDENTIFIER] = sEntry;
1444 }
1445};
1446
1447IMPL_LINK(SwAuthorMarkPane, IsEntryAllowedHdl, weld::Entry&, rEdit, bool)
1448{
1449 OUString sEntry = rEdit.get_text();
1450 bool bAllowed = false;
1451 if(!sEntry.isEmpty())
1452 {
1453 if (m_xEntryLB->find_text(sEntry) != -1)
1454 return false;
1455 else if(bIsFromComponent)
1456 {
1457 const SwAuthorityFieldType* pFType = static_cast<const SwAuthorityFieldType*>(
1458 m_pSh->GetFieldType(SwFieldIds::TableOfAuthorities, OUString()));
1459 bAllowed = !pFType || !pFType->GetEntryByIdentifier(sEntry);
1460 }
1461 else
1462 {
1463 bAllowed = !m_xBibAccess.is() || !m_xBibAccess->hasByName(sEntry);
1464 }
1465 }
1466 return bAllowed;
1467}
1468
1469IMPL_LINK(SwAuthorMarkPane, IsEditAllowedHdl, weld::Entry&, rEdit, bool)
1470{
1471 OUString sEntry = rEdit.get_text();
1472 bool bAllowed = false;
1473 if(!sEntry.isEmpty())
1474 {
1475 if (m_xEntryLB->find_text(sEntry) != -1)
1476 return false;
1477 else if(bIsFromComponent)
1478 {
1479 const SwAuthorityFieldType* pFType = static_cast<const SwAuthorityFieldType*>(
1480 m_pSh->GetFieldType(SwFieldIds::TableOfAuthorities, OUString()));
1481 bAllowed = !pFType || !pFType->GetEntryByIdentifier(sEntry);
1482 }
1483 else
1484 {
1485 bAllowed = !m_xBibAccess.is() || !m_xBibAccess->hasByName(sEntry);
1486 }
1487 }
1488 return bAllowed;
1489}
1490
1492{
1493 OSL_ENSURE(m_pSh, "no shell?");
1494 SwField* pField = m_pSh->GetCurField();
1495 OSL_ENSURE(m_bNewEntry || pField, "no current marker");
1496 if(m_bNewEntry)
1497 {
1498 ChangeSourceHdl(m_xFromComponentRB->get_active() ? *m_xFromComponentRB : *m_xFromDocContentRB);
1499 m_xCreateEntryPB->set_sensitive(!m_xFromComponentRB->get_active());
1500 if(!m_xFromComponentRB->get_active() && !m_sCreatedEntry[0].isEmpty())
1501 for(int i = 0; i < AUTH_FIELD_END; i++)
1503 }
1504 if(m_bNewEntry || !pField || pField->GetTyp()->Which() != SwFieldIds::TableOfAuthorities)
1505 return;
1506
1507 const SwAuthEntry* pEntry = static_cast<SwAuthorityField*>(pField)->GetAuthEntry();
1508
1509 OSL_ENSURE(pEntry, "No authority entry found");
1510 if(!pEntry)
1511 return;
1512 for(int i = 0; i < AUTH_FIELD_END; i++)
1513 m_sFields[i] = pEntry->GetAuthorField(static_cast<ToxAuthorityField>(i));
1514
1516 m_xAuthorFI->set_label(pEntry->GetAuthorField(AUTH_FIELD_AUTHOR));
1517 m_xTitleFI->set_label(pEntry->GetAuthorField(AUTH_FIELD_TITLE));
1518}
1519
1521{
1522 m_xActionBT->set_sensitive(!m_pSh->HasReadonlySel());
1523}
1524
1525namespace
1526{
1527 const TranslateId STR_AUTH_FIELD_ARY[] =
1528 {
1529 STR_AUTH_FIELD_IDENTIFIER,
1530 STR_AUTH_FIELD_AUTHORITY_TYPE,
1531 STR_AUTH_FIELD_ADDRESS,
1532 STR_AUTH_FIELD_ANNOTE,
1533 STR_AUTH_FIELD_AUTHOR,
1534 STR_AUTH_FIELD_BOOKTITLE,
1535 STR_AUTH_FIELD_CHAPTER,
1536 STR_AUTH_FIELD_EDITION,
1537 STR_AUTH_FIELD_EDITOR,
1538 STR_AUTH_FIELD_HOWPUBLISHED,
1539 STR_AUTH_FIELD_INSTITUTION,
1540 STR_AUTH_FIELD_JOURNAL,
1541 STR_AUTH_FIELD_MONTH,
1542 STR_AUTH_FIELD_NOTE,
1543 STR_AUTH_FIELD_NUMBER,
1544 STR_AUTH_FIELD_ORGANIZATIONS,
1545 STR_AUTH_FIELD_PAGES,
1546 STR_AUTH_FIELD_PUBLISHER,
1547 STR_AUTH_FIELD_SCHOOL,
1548 STR_AUTH_FIELD_SERIES,
1549 STR_AUTH_FIELD_TITLE,
1550 STR_AUTH_FIELD_TYPE,
1551 STR_AUTH_FIELD_VOLUME,
1552 STR_AUTH_FIELD_YEAR,
1553 STR_AUTH_FIELD_URL,
1554 STR_AUTH_FIELD_CUSTOM1,
1555 STR_AUTH_FIELD_CUSTOM2,
1556 STR_AUTH_FIELD_CUSTOM3,
1557 STR_AUTH_FIELD_CUSTOM4,
1558 STR_AUTH_FIELD_CUSTOM5,
1559 STR_AUTH_FIELD_ISBN,
1560 STR_AUTH_FIELD_LOCAL_URL,
1561 };
1562}
1563
1564SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(weld::Window* pParent,
1565 const OUString pFields[],
1566 SwWrtShell& rSh,
1567 bool bNewEntry,
1568 bool bCreate)
1569 : GenericDialogController(pParent, "modules/swriter/ui/createauthorentry.ui", "CreateAuthorEntryDialog")
1570 , m_rWrtSh(rSh)
1571 , m_bNewEntryMode(bNewEntry)
1572 , m_bNameAllowed(true)
1573 , m_xOKBT(m_xBuilder->weld_button("ok"))
1574 , m_xBox(m_xBuilder->weld_container("box"))
1575 , m_xLeft(m_xBuilder->weld_container("leftgrid"))
1576 , m_xRight(m_xBuilder->weld_container("rightgrid"))
1577{
1578 bool bLeft = true;
1579 sal_Int32 nLeftRow(0), nRightRow(0);
1580 for(int nIndex = 0; nIndex < AUTH_FIELD_END; nIndex++)
1581 {
1582 //m_xBox parent just to have some parent during setup, added contents are not directly visible under m_xBox
1583 m_aBuilders.emplace_back(Application::CreateBuilder(m_xBox.get(), "modules/swriter/ui/bibliofragment.ui"));
1584 const TextInfo aCurInfo = aTextInfoArr[nIndex];
1585
1586 m_aOrigContainers.emplace_back(m_aBuilders.back()->weld_container("biblioentry"));
1587 m_aFixedTexts.emplace_back(m_aBuilders.back()->weld_label("label"));
1588 if (bLeft)
1589 m_aOrigContainers.back()->move(m_aFixedTexts.back().get(), m_xLeft.get());
1590 else
1591 m_aOrigContainers.back()->move(m_aFixedTexts.back().get(), m_xRight.get());
1592 m_aFixedTexts.back()->set_grid_left_attach(0);
1593 m_aFixedTexts.back()->set_grid_top_attach(bLeft ? nLeftRow : nRightRow);
1594 m_aFixedTexts.back()->set_label(SwResId(STR_AUTH_FIELD_ARY[aCurInfo.nToxField]));
1595 m_aFixedTexts.back()->show();
1596 if( AUTH_FIELD_AUTHORITY_TYPE == aCurInfo.nToxField )
1597 {
1598 m_xTypeListBox = m_aBuilders.back()->weld_combo_box("listbox");
1599 if (bLeft)
1600 m_aOrigContainers.back()->move(m_xTypeListBox.get(), m_xLeft.get());
1601 else
1602 m_aOrigContainers.back()->move(m_xTypeListBox.get(), m_xRight.get());
1603
1604 for (int j = 0; j < AUTH_TYPE_END; j++)
1605 {
1606 m_xTypeListBox->append_text(
1608 }
1609 if(!pFields[aCurInfo.nToxField].isEmpty())
1610 {
1611 m_xTypeListBox->set_active(pFields[aCurInfo.nToxField].toInt32());
1612 }
1613 m_xTypeListBox->set_grid_left_attach(1);
1614 m_xTypeListBox->set_grid_top_attach(bLeft ? nLeftRow : nRightRow);
1615 m_xTypeListBox->set_hexpand(true);
1616 m_xTypeListBox->show();
1617 m_xTypeListBox->connect_changed(LINK(this, SwCreateAuthEntryDlg_Impl, EnableHdl));
1618 m_xTypeListBox->set_help_id(aCurInfo.pHelpId);
1619 m_aFixedTexts.back()->set_mnemonic_widget(m_xTypeListBox.get());
1620 }
1621 else if(AUTH_FIELD_IDENTIFIER == aCurInfo.nToxField && !m_bNewEntryMode)
1622 {
1623 m_xIdentifierBox = m_aBuilders.back()->weld_combo_box("combobox");
1624 if (bLeft)
1625 m_aOrigContainers.back()->move(m_xIdentifierBox.get(), m_xLeft.get());
1626 else
1627 m_aOrigContainers.back()->move(m_xIdentifierBox.get(), m_xRight.get());
1628
1629 m_xIdentifierBox->connect_changed(LINK(this,
1630 SwCreateAuthEntryDlg_Impl, IdentifierHdl));
1631
1632 const SwAuthorityFieldType* pFType = static_cast<const SwAuthorityFieldType*>(
1634 if(pFType)
1635 {
1636 std::vector<OUString> aIds;
1637 pFType->GetAllEntryIdentifiers( aIds );
1638 for (const OUString& a : aIds)
1639 m_xIdentifierBox->append_text(a);
1640 }
1641 m_xIdentifierBox->set_entry_text(pFields[aCurInfo.nToxField]);
1642 m_xIdentifierBox->set_grid_left_attach(1);
1643 m_xIdentifierBox->set_grid_top_attach(bLeft ? nLeftRow : nRightRow);
1644 m_xIdentifierBox->set_hexpand(true);
1645 m_xIdentifierBox->show();
1646 m_xIdentifierBox->set_help_id(aCurInfo.pHelpId);
1647 m_aFixedTexts.back()->set_mnemonic_widget(m_xIdentifierBox.get());
1648 }
1649 else
1650 {
1651 m_pBoxes[nIndex] = m_aBuilders.back()->weld_box("vbox");
1652 m_pEdits[nIndex] = m_aBuilders.back()->weld_entry("entry");
1653 if (bLeft)
1654 m_aOrigContainers.back()->move(m_pBoxes[nIndex].get(), m_xLeft.get());
1655 else
1656 m_aOrigContainers.back()->move(m_pBoxes[nIndex].get(), m_xRight.get());
1657
1658 m_pBoxes[nIndex]->set_grid_left_attach(1);
1659 m_pBoxes[nIndex]->set_grid_top_attach(bLeft ? nLeftRow : nRightRow);
1660 m_pBoxes[nIndex]->set_hexpand(true);
1661 if (aCurInfo.nToxField == AUTH_FIELD_LOCAL_URL)
1662 {
1663 m_xLocalBrowseButton = m_aBuilders.back()->weld_button("browse");
1664 m_xLocalBrowseButton->connect_clicked(
1665 LINK(this, SwCreateAuthEntryDlg_Impl, BrowseHdl));
1666 m_xLocalPageCB = m_aBuilders.back()->weld_check_button("pagecb");
1667 // Distinguish different instances of this for ui-testing.
1668 m_xLocalPageCB->set_buildable_name(m_xLocalPageCB->get_buildable_name()
1669 + "-local-visible");
1670 m_xLocalPageSB = m_aBuilders.back()->weld_spin_button("pagesb");
1671 }
1672
1673 // Now that both pEdits[nIndex] and m_xPageSB is initialized, set their values.
1674 OUString aText = pFields[aCurInfo.nToxField];
1675 if (aCurInfo.nToxField == AUTH_FIELD_LOCAL_URL)
1676 {
1677 OUString aUrl;
1678 int nPageNumber;
1679 if (SplitUrlAndPage(aText, aUrl, nPageNumber))
1680 {
1681 m_pEdits[nIndex]->set_text(aUrl);
1682 m_xLocalPageCB->set_active(true);
1683 m_xLocalPageSB->set_sensitive(true);
1684 m_xLocalPageSB->set_value(nPageNumber);
1685 }
1686 else
1687 {
1688 m_pEdits[nIndex]->set_text(aText);
1689 }
1690 }
1691 else
1692 {
1693 m_pEdits[nIndex]->set_text(aText);
1694 }
1695 m_pEdits[nIndex]->show();
1696 m_pEdits[nIndex]->set_help_id(aCurInfo.pHelpId);
1697
1698 if(AUTH_FIELD_IDENTIFIER == aCurInfo.nToxField)
1699 {
1700 m_pEdits[nIndex]->connect_changed(LINK(this, SwCreateAuthEntryDlg_Impl, ShortNameHdl));
1701 m_bNameAllowed = !pFields[nIndex].isEmpty();
1702 if(!bCreate)
1703 {
1704 m_aFixedTexts.back()->set_sensitive(false);
1705 m_pEdits[nIndex]->set_sensitive(false);
1706 }
1707 }
1708 else if (aCurInfo.nToxField == AUTH_FIELD_LOCAL_URL)
1709 {
1710 m_xLocalPageCB->show();
1711 m_xLocalPageCB->connect_toggled(LINK(this, SwCreateAuthEntryDlg_Impl, PageNumHdl));
1712 m_xLocalPageSB->show();
1713 }
1714
1715 m_aFixedTexts.back()->set_mnemonic_widget(m_pEdits[nIndex].get());
1716 }
1717 if(bLeft)
1718 ++nLeftRow;
1719 else
1720 ++nRightRow;
1721 bLeft = !bLeft;
1722 }
1723 assert(m_xTypeListBox && "this will exist after the loop");
1724 EnableHdl(*m_xTypeListBox);
1725}
1726
1727OUString SwCreateAuthEntryDlg_Impl::GetEntryText(ToxAuthorityField eField) const
1728{
1730 {
1731 assert(m_xTypeListBox && "No ListBox");
1732 return OUString::number(m_xTypeListBox->get_active());
1733 }
1734
1735 if( AUTH_FIELD_IDENTIFIER == eField && !m_bNewEntryMode)
1736 {
1737 assert(m_xIdentifierBox && "No ComboBox");
1738 return m_xIdentifierBox->get_active_text();
1739 }
1740
1741 for(int nIndex = 0; nIndex < AUTH_FIELD_END; nIndex++)
1742 {
1743 const TextInfo aCurInfo = aTextInfoArr[nIndex];
1744 if(aCurInfo.nToxField == eField)
1745 {
1746 if (aCurInfo.nToxField == AUTH_FIELD_LOCAL_URL)
1747 {
1748 return MergeUrlAndPage(m_pEdits[nIndex]->get_text(), m_xLocalPageSB);
1749 }
1750 else
1751 {
1752 return m_pEdits[nIndex]->get_text();
1753 }
1754 }
1755 }
1756
1757 return OUString();
1758}
1759
1760IMPL_LINK(SwCreateAuthEntryDlg_Impl, IdentifierHdl, weld::ComboBox&, rBox, void)
1761{
1762 const SwAuthorityFieldType* pFType = static_cast<const SwAuthorityFieldType*>(
1763 m_rWrtSh.GetFieldType(SwFieldIds::TableOfAuthorities, OUString()));
1764 if(!pFType)
1765 return;
1766
1767 const SwAuthEntry* pEntry = pFType->GetEntryByIdentifier(
1768 rBox.get_active_text());
1769 if(!pEntry)
1770 return;
1771
1772 for(int i = 0; i < AUTH_FIELD_END; i++)
1773 {
1774 const TextInfo aCurInfo = aTextInfoArr[i];
1775 if(AUTH_FIELD_IDENTIFIER == aCurInfo.nToxField)
1776 continue;
1777 if(AUTH_FIELD_AUTHORITY_TYPE == aCurInfo.nToxField)
1778 m_xTypeListBox->set_active_text(
1779 pEntry->GetAuthorField(aCurInfo.nToxField));
1780 else
1781 m_pEdits[i]->set_text(
1782 pEntry->GetAuthorField(aCurInfo.nToxField));
1783 }
1784}
1785
1786IMPL_LINK(SwCreateAuthEntryDlg_Impl, ShortNameHdl, weld::Entry&, rEdit, void)
1787{
1788 if (m_aShortNameCheckLink.IsSet())
1789 {
1790 bool bEnable = m_aShortNameCheckLink.Call(rEdit);
1791 m_bNameAllowed |= bEnable;
1792 m_xOKBT->set_sensitive(m_xTypeListBox->get_active() != -1 && bEnable);
1793 }
1794}
1795
1796IMPL_LINK(SwCreateAuthEntryDlg_Impl, EnableHdl, weld::ComboBox&, rBox, void)
1797{
1798 m_xOKBT->set_sensitive(m_bNameAllowed && rBox.get_active() != -1);
1799 m_xLocalBrowseButton->show();
1800};
1801
1802IMPL_LINK(SwCreateAuthEntryDlg_Impl, BrowseHdl, weld::Button&, rButton, void)
1803{
1804 sfx2::FileDialogHelper aFileDlg(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
1805 FileDialogFlags::NONE, getDialog());
1806 OUString aPath;
1807 if (&rButton == m_xLocalBrowseButton.get())
1808 {
1809 aPath = GetEntryText(AUTH_FIELD_LOCAL_URL);
1810 }
1811 if (!aPath.isEmpty())
1812 {
1813 aFileDlg.SetDisplayDirectory(aPath);
1814 }
1815 else
1816 {
1817 OUString aBaseURL = m_rWrtSh.GetDoc()->GetDocShell()->getDocumentBaseURL();
1818 if (!aBaseURL.isEmpty())
1819 {
1820 aFileDlg.SetDisplayDirectory(aBaseURL);
1821 }
1822 }
1823
1824 if (aFileDlg.Execute() != ERRCODE_NONE)
1825 {
1826 return;
1827 }
1828
1829 aPath = aFileDlg.GetPath();
1830
1831 for (int nIndex = 0; nIndex < AUTH_FIELD_END; nIndex++)
1832 {
1833 const TextInfo& rCurInfo = aTextInfoArr[nIndex];
1834 if (rCurInfo.nToxField == AUTH_FIELD_LOCAL_URL && &rButton == m_xLocalBrowseButton.get())
1835 {
1836 m_pEdits[nIndex]->set_text(aPath);
1837 break;
1838 }
1839 }
1840};
1841
1842IMPL_LINK(SwCreateAuthEntryDlg_Impl, PageNumHdl, weld::Toggleable&, rPageCB, void)
1843{
1844 if (rPageCB.get_active())
1845 {
1846 m_xLocalPageSB->set_sensitive(true);
1847 m_xLocalPageSB->set_value(1);
1848 }
1849 else
1850 {
1851 m_xLocalPageSB->set_sensitive(false);
1852 }
1853}
1854
1856 SfxChildWindow* pChild,
1857 weld::Window *pParent,
1858 SfxChildWinInfo const * pInfo,
1859 bool bNew)
1860 : SfxModelessDialogController(_pBindings, pChild, pParent,
1861 "modules/swriter/ui/bibliographyentry.ui", "BibliographyEntryDialog")
1862 , m_aContent(*this, *m_xBuilder, bNew)
1863{
1864 Initialize(pInfo);
1865 if (SwWrtShell* pWrtShell = ::GetActiveWrtShell())
1866 m_aContent.ReInitDlg(*pWrtShell);
1867}
1868
1870{
1873}
1874
1876{
1877 m_aContent.ReInitDlg( rWrtShell );
1878}
1879
1881 : SfxDialogController(pParent, "modules/swriter/ui/bibliographyentry.ui",
1882 "BibliographyEntryDialog")
1883 , m_aContent(*this, *m_xBuilder, false)
1884{
1885 m_aContent.ReInitDlg(rSh);
1886}
1887
1889{
1890 short ret = SfxDialogController::run();
1891 if (ret == RET_OK)
1892 Apply();
1893 return ret;
1894}
1895
1897{
1898 m_aContent.InsertHdl(*m_aContent.m_xActionBT);
1899}
1900
1901/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ UndoArg1
Definition: SwRewriter.hxx:29
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, bool bMobile=false)
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void Initialize(SfxChildWinInfo const *pInfo)
virtual void Activate() override
static SfxViewFrame * Current()
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
OUString const & GetAuthorField(ToxAuthorityField ePos) const
Definition: authfld.hxx:195
SwAuthorMarkPane m_aContent
Definition: swuiidxmrk.hxx:212
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
Definition: swuiidxmrk.hxx:225
SwAuthMarkModalDlg(weld::Window *pParent, SwWrtShell &rSh)
std::unique_ptr< weld::RadioButton > m_xFromDocContentRB
Definition: swuiidxmrk.hxx:183
static bool bIsFromComponent
Definition: swuiidxmrk.hxx:165
std::unique_ptr< weld::Button > m_xCreateEntryPB
Definition: swuiidxmrk.hxx:190
std::unique_ptr< weld::Label > m_xAuthorFI
Definition: swuiidxmrk.hxx:184
std::unique_ptr< weld::Button > m_xActionBT
Definition: swuiidxmrk.hxx:188
std::unique_ptr< weld::ComboBox > m_xEntryLB
Definition: swuiidxmrk.hxx:187
weld::DialogController & m_rDialog
Definition: swuiidxmrk.hxx:163
OUString m_sFields[AUTH_FIELD_END]
Definition: swuiidxmrk.hxx:176
std::unique_ptr< weld::RadioButton > m_xFromComponentRB
Definition: swuiidxmrk.hxx:182
SwWrtShell * m_pSh
Definition: swuiidxmrk.hxx:173
SwAuthorMarkPane(weld::DialogController &rDialog, weld::Builder &rBuilder, bool bNew)
std::unique_ptr< weld::Button > m_xEditEntryPB
Definition: swuiidxmrk.hxx:191
OUString m_sCreatedEntry[AUTH_FIELD_END]
Definition: swuiidxmrk.hxx:178
std::unique_ptr< weld::Label > m_xTitleFI
Definition: swuiidxmrk.hxx:185
std::unique_ptr< weld::Entry > m_xEntryED
Definition: swuiidxmrk.hxx:186
void ReInitDlg(SwWrtShell &rWrtShell)
std::unique_ptr< weld::Button > m_xCloseBT
Definition: swuiidxmrk.hxx:189
static OUString const & GetAuthTypeName(ToxAuthorityType eType)
Definition: initui.cxx:280
void GetAllEntryIdentifiers(std::vector< OUString > &rToFill) const
Definition: authfld.cxx:131
SwAuthEntry * GetEntryByIdentifier(std::u16string_view rIdentifier) const
Definition: authfld.cxx:140
invariant for SwAuthorityField is that it is always registered at its SwAuthorityFieldType via AddFie...
Definition: authfld.hxx:155
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2251
void SttCursorMove()
Definition: crsrsh.cxx:301
void SwapPam()
Definition: crsrsh.cxx:976
sal_uInt16 GetCursorCnt(bool bAll=true) const
Get the number of elements in the ring of cursors.
Definition: crsrsh.cxx:2752
const SwTOXMark & GotoTOXMark(const SwTOXMark &rStart, SwTOXSearch eDir)
traveling between marks
Definition: crstrvl.cxx:583
OUString GetSelText() const
get selected text of a node at current cursor
Definition: crsrsh.cxx:2559
SwField * GetCurField(const bool bIncludeInputFieldAtStart=false) const
Definition: crstrvl.cxx:942
sal_Int32 Find_Text(const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, bool bReplace=false)
Definition: crsrsh.cxx:3472
void ClearMark()
Definition: crsrsh.cxx:939
bool HasReadonlySel(bool isReplace=false) const
Definition: crsrsh.cxx:3359
void EndCursorMove(const bool bIdleEnd=false)
Definition: crsrsh.cxx:310
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:171
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const
Manage types of content tables.
Definition: edws.cxx:190
SvtScriptType GetScriptType() const
returns the script type of the selection
Definition: edattr.cxx:662
SwFieldType * GetFieldType(size_t nField, SwFieldIds nResId=SwFieldIds::Unknown) const
get field types with a ResId, if 0 get all
Definition: edfld.cxx:64
void GetTOIKeys(SwTOIKeyType eTyp, std::vector< OUString > &rArr) const
Key for managing index.
Definition: edtox.cxx:210
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
const SwTOXType * GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
Definition: edtox.cxx:203
void EndAllAction()
Definition: edws.cxx:97
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Definition: fews.cxx:237
void UpdateCurField(sal_uInt32 nFormat, const OUString &rPar1, const OUString &rPar2, std::unique_ptr< SwField > _pField=nullptr)
Definition: fldmgr.cxx:1536
bool InsertField(SwInsertField_Data &rData)
Definition: fldmgr.cxx:895
SwField * GetCurField()
Definition: fldmgr.cxx:430
SwFieldIds Which() const
Definition: fldbas.hxx:273
Base class of all fields.
Definition: fldbas.hxx:292
SwFieldType * GetTyp() const
Definition: fldbas.hxx:398
void ReInitDlg(SwWrtShell &rWrtShell)
virtual void Activate() override
SwIndexMarkFloatDlg(SfxBindings *pBindings, SfxChildWindow *pChild, weld::Window *pParent, SfxChildWinInfo const *pInfo, bool bNew)
SwIndexMarkPane m_aContent
Definition: swuiidxmrk.hxx:138
SwIndexMarkPane m_aContent
Definition: swuiidxmrk.hxx:152
virtual short int run() override
SwIndexMarkModalDlg(weld::Window *pParent, SwWrtShell &rSh, SwTOXMark const *pCurTOXMark)
virtual ~SwIndexMarkModalDlg() override
std::unique_ptr< weld::CheckButton > m_xSearchCaseSensitiveCB
Definition: swuiidxmrk.hxx:81
std::unique_ptr< weld::CheckButton > m_xApplyToAllCB
Definition: swuiidxmrk.hxx:80
std::unique_ptr< weld::Entry > m_xPhoneticED0
Definition: swuiidxmrk.hxx:68
SwWrtShell * m_pSh
Definition: swuiidxmrk.hxx:60
void UpdateLanguageDependenciesForPhoneticReading()
Definition: swuiidxmrk.cxx:365
std::shared_ptr< weld::Dialog > m_xDialog
Definition: swuiidxmrk.hxx:40
std::unique_ptr< weld::Label > m_xPhoneticFT0
Definition: swuiidxmrk.hxx:67
std::unique_ptr< weld::Label > m_xPhoneticFT2
Definition: swuiidxmrk.hxx:75
std::unique_ptr< weld::ComboBox > m_xKey2DCB
Definition: swuiidxmrk.hxx:74
std::unique_ptr< weld::Button > m_xNewBT
Definition: swuiidxmrk.hxx:64
LanguageType m_nLangForPhoneticReading
Definition: swuiidxmrk.hxx:53
void ReInitDlg(SwWrtShell &rWrtShell, SwTOXMark const *pCurTOXMark=nullptr)
void ModifyHdl(const weld::Widget &rWidget)
Definition: swuiidxmrk.cxx:709
std::unique_ptr< weld::Label > m_xTypeFT
Definition: swuiidxmrk.hxx:62
std::unique_ptr< weld::Button > m_xNextBT
Definition: swuiidxmrk.hxx:89
std::unique_ptr< weld::SpinButton > m_xLevelNF
Definition: swuiidxmrk.hxx:78
std::unique_ptr< weld::Button > m_xNextSameBT
Definition: swuiidxmrk.hxx:87
std::unique_ptr< weld::CheckButton > m_xSearchCaseWordOnlyCB
Definition: swuiidxmrk.hxx:82
bool m_bIsPhoneticReadingEnabled
Definition: swuiidxmrk.hxx:54
void UpdateKeyBoxes()
Definition: swuiidxmrk.cxx:609
std::unique_ptr< weld::Button > m_xSyncED
Definition: swuiidxmrk.hxx:66
std::unique_ptr< weld::Label > m_xKey2FT
Definition: swuiidxmrk.hxx:73
std::unique_ptr< weld::ComboBox > m_xKey1DCB
Definition: swuiidxmrk.hxx:70
std::unique_ptr< weld::Label > m_xLevelFT
Definition: swuiidxmrk.hxx:77
bool m_bPhoneticED0_ChangedByUser
Definition: swuiidxmrk.hxx:50
std::unique_ptr< weld::Entry > m_xPhoneticED2
Definition: swuiidxmrk.hxx:76
std::unique_ptr< weld::Entry > m_xEntryED
Definition: swuiidxmrk.hxx:65
std::unique_ptr< weld::Button > m_xOKBT
Definition: swuiidxmrk.hxx:83
std::unique_ptr< weld::Label > m_xPhoneticFT1
Definition: swuiidxmrk.hxx:71
OUString GetDefaultPhoneticReading(const OUString &rText)
Definition: swuiidxmrk.cxx:412
std::unique_ptr< weld::Entry > m_xPhoneticED1
Definition: swuiidxmrk.hxx:72
std::unique_ptr< weld::Button > m_xPrevBT
Definition: swuiidxmrk.hxx:88
css::uno::Reference< css::i18n::XExtendedIndexEntrySupplier > m_xExtendedIndexEntrySupplier
Definition: swuiidxmrk.hxx:56
bool const m_bNewMark
Definition: swuiidxmrk.hxx:47
std::unique_ptr< weld::ComboBox > m_xTypeDCB
Definition: swuiidxmrk.hxx:63
SwIndexMarkPane(std::shared_ptr< weld::Dialog > xDialog, weld::Builder &rBuilder, bool bNewDlg, SwWrtShell *pWrtShell)
Definition: swuiidxmrk.cxx:131
std::unique_ptr< weld::Button > m_xCloseBT
Definition: swuiidxmrk.hxx:84
OUString m_aOrgStr
Definition: swuiidxmrk.hxx:45
bool IsTOXType(const OUString &rName)
Definition: swuiidxmrk.hxx:133
std::unique_ptr< weld::Button > m_xPrevSameBT
Definition: swuiidxmrk.hxx:86
std::unique_ptr< weld::Label > m_xKey1FT
Definition: swuiidxmrk.hxx:69
std::unique_ptr< SwTOXMgr > m_pTOXMgr
Definition: swuiidxmrk.hxx:59
std::unique_ptr< weld::CheckButton > m_xMainEntryCB
Definition: swuiidxmrk.hxx:79
std::unique_ptr< weld::Button > m_xDelBT
Definition: swuiidxmrk.hxx:85
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:25
void SetPhoneticReadingOfAltStr(const OUString &rSet)
Definition: toxmgr.hxx:216
void SetPrimKey(const OUString &rSet)
Definition: toxmgr.hxx:204
void SetSecKey(const OUString &rSet)
Definition: toxmgr.hxx:207
void SetTOUName(const OUString &rSet)
Definition: toxmgr.hxx:213
void SetPhoneticReadingOfPrimKey(const OUString &rSet)
Definition: toxmgr.hxx:219
void SetMainEntry(bool bSet)
Definition: toxmgr.hxx:201
void SetAltStr(const OUString &rSet)
Definition: toxmgr.hxx:210
void SetPhoneticReadingOfSecKey(const OUString &rSet)
Definition: toxmgr.hxx:222
void SetLevel(int nSet)
Definition: toxmgr.hxx:198
const SwTextTOXMark * GetTextTOXMark() const
Definition: tox.hxx:160
const SwTOXType * GetTOXType() const
Definition: tox.hxx:576
sal_uInt16 GetLevel() const
Definition: tox.hxx:628
OUString const & GetSecondaryKeyReading() const
Definition: tox.hxx:658
OUString const & GetSecondaryKey() const
Definition: tox.hxx:640
OUString GetText(SwRootFrame const *pLayout) const
Definition: tox.cxx:201
OUString const & GetPrimaryKey() const
Definition: tox.hxx:634
bool IsMainEntry() const
Definition: tox.hxx:155
OUString const & GetTextReading() const
Definition: tox.hxx:646
OUString const & GetPrimaryKeyReading() const
Definition: tox.hxx:652
Built on top of SwWrtShell, provides functionality to insert, update or perform other actions on vari...
Definition: toxmgr.hxx:231
void InsertTOXMark(const SwTOXMarkDescription &rDesc)
Definition: toxmgr.cxx:60
const OUString & GetTypeName() const
Definition: tox.hxx:690
TOXTypes GetType() const
Definition: tox.hxx:693
sal_Int32 GetStart() const
Definition: txatbase.hxx:88
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:111
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
Definition: thints.cxx:3462
const SwTextNode * GetpTextNd() const
Definition: txttxmrk.hxx:44
static void SetCareDialog(const std::shared_ptr< weld::Window > &rNew)
Definition: viewsh.cxx:2655
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2160
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:624
OUString GetSelectionTextParam(bool bCompleteWords, bool bEraseTrail)
Definition: view.cxx:1662
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
bool HasSelection() const
Definition: wrtsh.hxx:147
tools::Long ResetSelect(const Point *, bool)
Definition: select.cxx:333
bool SelectTextAttr(sal_uInt16 nWhich, const SwTextAttr *pAttr=nullptr)
Definition: move.cxx:725
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
Definition: wrtsh1.cxx:2030
const SwView & GetView() const
Definition: wrtsh.hxx:438
OUString GetPath() const
void SetDisplayDirectory(const OUString &rPath)
void set_title(const OUString &rTitle)
#define FN_INSERT_IDX_ENTRY_DLG
Definition: cmdid.h:234
#define FN_INSERT_AUTH_ENTRY_DLG
Definition: cmdid.h:297
#define FN_EDIT_IDX_ENTRY_DLG
Definition: cmdid.h:81
@ InBodyOnly
Find only in body - only in combination with FindRanges::InSelAll !!!
@ InSelAll
All (only in non-body and selections).
int nCount
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
virtual OUString GetName() const override
virtual void SetCheckNameHdl(const Link< AbstractSvxNameDialog &, bool > &rLink, bool bCheckImmediately=false) override
#define ERRCODE_NONE
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:63
@ TableOfAuthorities
DocumentType eType
#define HID_AUTH_FIELD_JOURNAL
Definition: helpids.h:58
#define HID_AUTH_FIELD_BOOKTITLE
Definition: helpids.h:52
#define HID_AUTH_FIELD_SERIES
Definition: helpids.h:66
#define HID_AUTH_FIELD_PUBLISHER
Definition: helpids.h:64
#define HID_AUTH_FIELD_EDITOR
Definition: helpids.h:55
#define HID_AUTH_FIELD_ORGANIZATIONS
Definition: helpids.h:62
#define HID_AUTH_FIELD_REPORT_TYPE
Definition: helpids.h:68
#define HID_AUTH_FIELD_VOLUME
Definition: helpids.h:69
#define HID_AUTH_FIELD_IDENTIFIER
Definition: helpids.h:47
#define HID_AUTH_FIELD_AUTHOR
Definition: helpids.h:51
#define HID_AUTH_FIELD_HOWPUBLISHED
Definition: helpids.h:56
#define HID_AUTH_FIELD_INSTITUTION
Definition: helpids.h:57
#define HID_AUTH_FIELD_SCHOOL
Definition: helpids.h:65
#define HID_AUTH_FIELD_TITLE
Definition: helpids.h:67
#define HID_AUTH_FIELD_CUSTOM1
Definition: helpids.h:72
#define HID_AUTH_FIELD_CHAPTER
Definition: helpids.h:53
#define HID_AUTH_FIELD_CUSTOM4
Definition: helpids.h:75
#define HID_AUTH_FIELD_AUTHORITY_TYPE
Definition: helpids.h:48
#define HID_AUTH_FIELD_CUSTOM5
Definition: helpids.h:76
#define HID_AUTH_FIELD_EDITION
Definition: helpids.h:54
#define HID_AUTH_FIELD_MONTH
Definition: helpids.h:59
#define HID_AUTH_FIELD_NOTE
Definition: helpids.h:60
#define HID_AUTH_FIELD_CUSTOM3
Definition: helpids.h:74
#define HID_AUTH_FIELD_YEAR
Definition: helpids.h:70
#define HID_AUTH_FIELD_ISBN
Definition: helpids.h:77
#define HID_AUTH_FIELD_URL
Definition: helpids.h:71
#define HID_AUTH_FIELD_ANNOTE
Definition: helpids.h:50
#define HID_AUTH_FIELD_CUSTOM2
Definition: helpids.h:73
#define HID_AUTH_FIELD_ADDRESS
Definition: helpids.h:49
#define HID_AUTH_FIELD_LOCAL_URL
Definition: helpids.h:78
#define HID_AUTH_FIELD_PAGES
Definition: helpids.h:63
#define HID_AUTH_FIELD_NUMBER
Definition: helpids.h:61
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()
Definition: init.cxx:732
sal_Int32 nIndex
#define LANGUAGE_CHINESE_SIMPLIFIED
sal_uInt16 nPos
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:48
bool IsCJKFontEnabled()
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
Definition: langhelper.cxx:390
const LanguageTag & getLocale()
Reference< XComponentContext > getProcessComponentContext()
int i
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)
const SvxPageUsage aArr[]
eField
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
SwWrtShell * GetActiveWrtShell()
Definition: swmodul1.cxx:108
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
IMPL_LINK_NOARG(SwIndexMarkPane, SyncSelectionHdl, weld::Button &, void)
Definition: swuiidxmrk.cxx:429
const TextInfo aTextInfoArr[]
static sal_uInt16 nKey1Pos
Definition: swuiidxmrk.cxx:65
static sal_Int32 nTypePos
Definition: swuiidxmrk.cxx:64
#define POS_CONTENT
Definition: swuiidxmrk.cxx:61
IMPL_LINK(SwNewUserIdxDlg, ModifyHdl, weld::Entry &, rEdit, void)
Definition: swuiidxmrk.cxx:654
#define POS_INDEX
Definition: swuiidxmrk.cxx:62
static void lcl_SelectSameStrings(SwWrtShell &rSh, bool bWordOnly, bool bCaseSensitive)
Definition: swuiidxmrk.cxx:494
static OUString lcl_FindColumnEntry(const uno::Sequence< beans::PropertyValue > &rFields, std::u16string_view rColumnTitle)
static sal_uInt16 nKey2Pos
Definition: swuiidxmrk.cxx:67
@ INDEX_ENTRY_INSERT
@ INDEX_ENTRY_DELETE
#define TOX_STYLE_DELIMITER
Definition: tox.hxx:422
@ TOI_SECONDARY
Definition: toxe.hxx:33
@ TOI_PRIMARY
Definition: toxe.hxx:32
ToxAuthorityField
Definition: toxe.hxx:83
@ AUTH_FIELD_SCHOOL
Definition: toxe.hxx:103
@ AUTH_FIELD_JOURNAL
Definition: toxe.hxx:96
@ AUTH_FIELD_CUSTOM4
Definition: toxe.hxx:114
@ AUTH_FIELD_CHAPTER
Definition: toxe.hxx:91
@ AUTH_FIELD_PAGES
Definition: toxe.hxx:101
@ AUTH_FIELD_SERIES
Definition: toxe.hxx:104
@ AUTH_FIELD_PUBLISHER
Definition: toxe.hxx:102
@ AUTH_FIELD_TITLE
Definition: toxe.hxx:105
@ AUTH_FIELD_CUSTOM5
Definition: toxe.hxx:115
@ AUTH_FIELD_IDENTIFIER
Definition: toxe.hxx:84
@ AUTH_FIELD_EDITOR
Definition: toxe.hxx:93
@ AUTH_FIELD_CUSTOM1
Definition: toxe.hxx:111
@ AUTH_FIELD_AUTHOR
Definition: toxe.hxx:89
@ AUTH_FIELD_HOWPUBLISHED
Definition: toxe.hxx:94
@ AUTH_FIELD_ISBN
Definition: toxe.hxx:116
@ AUTH_FIELD_CUSTOM2
Definition: toxe.hxx:112
@ AUTH_FIELD_LOCAL_URL
Definition: toxe.hxx:117
@ AUTH_FIELD_ADDRESS
Definition: toxe.hxx:87
@ AUTH_FIELD_INSTITUTION
Definition: toxe.hxx:95
@ AUTH_FIELD_NOTE
Definition: toxe.hxx:98
@ AUTH_FIELD_VOLUME
Definition: toxe.hxx:107
@ AUTH_FIELD_AUTHORITY_TYPE
Definition: toxe.hxx:85
@ AUTH_FIELD_ORGANIZATIONS
Definition: toxe.hxx:100
@ AUTH_FIELD_NUMBER
Definition: toxe.hxx:99
@ AUTH_FIELD_URL
Definition: toxe.hxx:110
@ AUTH_FIELD_ANNOTE
Definition: toxe.hxx:88
@ AUTH_FIELD_MONTH
Definition: toxe.hxx:97
@ AUTH_FIELD_BOOKTITLE
Definition: toxe.hxx:90
@ AUTH_FIELD_REPORT_TYPE
Definition: toxe.hxx:106
@ AUTH_FIELD_EDITION
Definition: toxe.hxx:92
@ AUTH_FIELD_END
Definition: toxe.hxx:118
@ AUTH_FIELD_CUSTOM3
Definition: toxe.hxx:113
@ AUTH_FIELD_YEAR
Definition: toxe.hxx:108
TOXTypes
Definition: toxe.hxx:40
@ TOX_USER
Definition: toxe.hxx:42
@ TOX_CONTENT
Definition: toxe.hxx:43
@ TOX_INDEX
Definition: toxe.hxx:41
ToxAuthorityType
Definition: toxe.hxx:53
@ AUTH_TYPE_END
Definition: toxe.hxx:78
@ TOX_SAME_PRV
Definition: toxe.hxx:27
@ TOX_PRV
Definition: toxe.hxx:25
@ TOX_SAME_NXT
Definition: toxe.hxx:26
@ TOX_NXT
Definition: toxe.hxx:24
::ucbhelper::Content m_aContent
RET_OK
RET_CLOSE
RET_CANCEL
RET_YES