LibreOffice Module sc (master) 1
tpusrlst.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#undef SC_DLLIMPLEMENTATION
21
22#include <comphelper/string.hxx>
23#include <tools/lineend.hxx>
24#include <vcl/svapp.hxx>
25#include <vcl/weld.hxx>
26#include <osl/diagnose.h>
27#include <o3tl/string_view.hxx>
28
29#include <document.hxx>
30#include <tabvwsh.hxx>
31#include <viewdata.hxx>
32#include <uiitems.hxx>
33#include <userlist.hxx>
34#include <rangeutl.hxx>
35#include <crdlg.hxx>
36#include <sc.hrc>
37#include <globstr.hrc>
38#include <scresid.hxx>
39#include <tpusrlst.hxx>
40#include <scui_def.hxx>
41
42#define CR u'\x000D'
43#define LF u'\x000A'
44
46
47// Benutzerdefinierte Listen:
48
50 const SfxItemSet& rCoreAttrs )
51 : SfxTabPage(pPage, pController, "modules/scalc/ui/optsortlists.ui", "OptSortLists",
52 &rCoreAttrs )
53 , mxFtLists(m_xBuilder->weld_label("listslabel"))
54 , mxLbLists(m_xBuilder->weld_tree_view("lists"))
55 , mxFtEntries(m_xBuilder->weld_label("entrieslabel"))
56 , mxEdEntries(m_xBuilder->weld_text_view("entries"))
57 , mxFtCopyFrom(m_xBuilder->weld_label("copyfromlabel"))
58 , mxEdCopyFrom(m_xBuilder->weld_entry("copyfrom"))
59 , mxBtnNew(m_xBuilder->weld_button("new"))
60 , mxBtnDiscard(m_xBuilder->weld_button("discard"))
61 , mxBtnAdd(m_xBuilder->weld_button("add"))
62 , mxBtnModify(m_xBuilder->weld_button("modify"))
63 , mxBtnRemove(m_xBuilder->weld_button("delete"))
64 , mxBtnCopy(m_xBuilder->weld_button("copy"))
65 , aStrQueryRemove ( ScResId( STR_QUERYREMOVE ) )
66 , aStrCopyList ( ScResId( STR_COPYLIST ) )
67 , aStrCopyFrom ( ScResId( STR_COPYFROM ) )
68 , aStrCopyErr ( ScResId( STR_COPYERR ) )
69 , nWhichUserLists ( GetWhich( SID_SCUSERLISTS ) )
70 , pDoc ( nullptr )
71 , pViewData ( nullptr )
72 , bModifyMode ( false )
73 , bCancelMode ( false )
74 , bCopyDone ( false )
75 , nCancelPos ( 0 )
76{
78 Init();
79 Reset(&rCoreAttrs);
80}
81
83{
84}
85
87{
89 ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( pSh );
90
91 mxLbLists->connect_changed ( LINK( this, ScTpUserLists, LbSelectHdl ) );
92 mxBtnNew->connect_clicked ( LINK( this, ScTpUserLists, BtnClickHdl ) );
93 mxBtnDiscard->connect_clicked ( LINK( this, ScTpUserLists, BtnClickHdl ) );
94 mxBtnAdd->connect_clicked ( LINK( this, ScTpUserLists, BtnClickHdl ) );
95 mxBtnModify->connect_clicked ( LINK( this, ScTpUserLists, BtnClickHdl ) );
96 mxBtnRemove->connect_clicked ( LINK( this, ScTpUserLists, BtnClickHdl ) );
97 mxEdEntries->connect_changed ( LINK( this, ScTpUserLists, EdEntriesModHdl ) );
98
99 if ( pViewSh )
100 {
101 SCTAB nStartTab = 0;
102 SCTAB nEndTab = 0;
103 SCCOL nStartCol = 0;
104 SCROW nStartRow = 0;
105 SCCOL nEndCol = 0;
106 SCROW nEndRow = 0;
107
108 pViewData = &pViewSh->GetViewData();
110
111 pViewData->GetSimpleArea( nStartCol, nStartRow, nStartTab,
112 nEndCol, nEndRow, nEndTab );
113
114 PutInOrder( nStartCol, nEndCol );
115 PutInOrder( nStartRow, nEndRow );
116 PutInOrder( nStartTab, nEndTab );
117
118 aStrSelectedArea = ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab
120
121 mxBtnCopy->connect_clicked ( LINK( this, ScTpUserLists, BtnClickHdl ) );
122 mxBtnCopy->set_sensitive(true);
123 }
124 else
125 {
126 mxBtnCopy->set_sensitive(false);
127 mxFtCopyFrom->set_sensitive(false);
128 mxEdCopyFrom->set_sensitive(false);
129 }
130
131}
132
133std::unique_ptr<SfxTabPage> ScTpUserLists::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet )
134{
135 return std::make_unique<ScTpUserLists>(pPage, pController, *rAttrSet);
136}
137
138void ScTpUserLists::Reset( const SfxItemSet* rCoreAttrs )
139{
140 const ScUserListItem& rUserListItem = static_cast<const ScUserListItem&>(
141 rCoreAttrs->Get( nWhichUserLists ));
142 const ScUserList* pCoreList = rUserListItem.GetUserList();
143
144 OSL_ENSURE( pCoreList, "UserList not found :-/" );
145
146 if ( pCoreList )
147 {
148 if ( !pUserLists )
149 pUserLists.reset( new ScUserList( *pCoreList ) );
150 else
151 *pUserLists = *pCoreList;
152
153 if ( UpdateUserListBox() > 0 )
154 {
155 mxLbLists->select( 0 );
156 UpdateEntries( 0 );
157 }
158 }
159 else if ( !pUserLists )
160 pUserLists.reset( new ScUserList );
161
162 mxEdCopyFrom->set_text( aStrSelectedArea );
163
164 if ( mxLbLists->n_children() == 0 )
165 {
166 mxFtLists->set_sensitive(false);
167 mxLbLists->set_sensitive(false);
168 mxFtEntries->set_sensitive(false);
169 mxEdEntries->set_sensitive(false);
170 mxBtnRemove->set_sensitive(false);
171 }
172
173 mxBtnNew->show();
174 mxBtnDiscard->hide();
175 mxBtnAdd->show();
176 mxBtnModify->hide();
177 mxBtnAdd->set_sensitive(false);
178 mxBtnModify->set_sensitive(false);
179
180 if ( !bCopyDone && pViewData )
181 {
182 mxFtCopyFrom->set_sensitive(true);
183 mxEdCopyFrom->set_sensitive(true);
184 mxBtnCopy->set_sensitive(true);
185 }
186}
187
189{
190 // Changes aren't saved?
191 // -> simulate click of Add-Button
192
193 if ( bModifyMode || bCancelMode )
194 BtnClickHdl(*mxBtnAdd);
195
196 const ScUserListItem& rUserListItem = static_cast<const ScUserListItem&>(
198
199 ScUserList* pCoreList = rUserListItem.GetUserList();
200 bool bDataModified = false;
201
202 if ( (pUserLists == nullptr) && (pCoreList == nullptr) )
203 {
204 bDataModified = false;
205 }
206 else if ( pUserLists != nullptr )
207 {
208 if ( pCoreList != nullptr )
209 bDataModified = (*pUserLists != *pCoreList);
210 else
211 bDataModified = true;
212 }
213
214 if ( bDataModified )
215 {
217
218 if ( pUserLists )
219 aULItem.SetUserList( *pUserLists );
220
221 rCoreAttrs->Put( aULItem );
222 }
223
224 return bDataModified;
225}
226
228{
229 if ( pSetP )
230 FillItemSet( pSetP );
231
232 return DeactivateRC::LeavePage;
233}
234
236{
237 mxLbLists->clear();
238
239 if ( !pUserLists ) return 0;
240
241 size_t nCount = pUserLists->size();
242 OUString aEntry;
243
244 for ( size_t i=0; i<nCount; ++i )
245 {
246 aEntry = (*pUserLists)[i].GetString();
247 OSL_ENSURE( !aEntry.isEmpty(), "Empty UserList-entry :-/" );
248 mxLbLists->append_text( aEntry );
249 }
250
251 return nCount;
252}
253
255{
256 if ( !pUserLists ) return;
257
258 if ( nList < pUserLists->size() )
259 {
260 const ScUserListData& rList = (*pUserLists)[nList];
261 std::size_t nSubCount = rList.GetSubCount();
262 OUStringBuffer aEntryListStr;
263
264 for ( size_t i=0; i<nSubCount; i++ )
265 {
266 if ( i!=0 )
267 aEntryListStr.append(CR);
268 aEntryListStr.append(rList.GetSubStr(i));
269 }
270
271 mxEdEntries->set_text(convertLineEnd(aEntryListStr.makeStringAndClear(), GetSystemLineEnd()));
272 }
273 else
274 {
275 OSL_FAIL( "Invalid ListIndex :-/" );
276 }
277}
278
279void ScTpUserLists::MakeListStr( OUString& rListStr )
280{
281 if (rListStr.isEmpty())
282 return;
283
284 OUStringBuffer aStr;
285
286 for(sal_Int32 nIdx=0; nIdx>=0;)
287 {
288 aStr.append(comphelper::string::strip(o3tl::getToken(rListStr, 0, LF, nIdx), ' '));
289 aStr.append(cDelimiter);
290 }
291
292 aStr.strip(cDelimiter);
293 sal_Int32 nLen = aStr.getLength();
294
295 rListStr.clear();
296
297 // delete all duplicates of cDelimiter
298 sal_Int32 c = 0;
299 while ( c < nLen )
300 {
301 rListStr += OUStringChar(aStr[c]);
302 ++c;
303
304 if ((c < nLen) && (aStr[c] == cDelimiter))
305 {
306 rListStr += OUStringChar(aStr[c]);
307
308 while ((c < nLen) && (aStr[c] == cDelimiter))
309 ++c;
310 }
311 }
312
313}
314
315void ScTpUserLists::AddNewList( const OUString& rEntriesStr )
316{
317 OUString theEntriesStr( rEntriesStr );
318
319 if ( !pUserLists )
320 pUserLists.reset( new ScUserList );
321
322 MakeListStr( theEntriesStr );
323
324 pUserLists->emplace_back(theEntriesStr);
325}
326
328 const ScRefAddress& rEndPos )
329{
330 if ( bCopyDone ) return;
331
332 SCTAB nTab = rStartPos.Tab();
333 SCCOL nStartCol = rStartPos.Col();
334 SCROW nStartRow = rStartPos.Row();
335 SCCOL nEndCol = rEndPos.Col();
336 SCROW nEndRow = rEndPos.Row();
337 sal_uInt16 nCellDir = SCRET_COLS;
338
339 if ( (nStartCol != nEndCol) && (nStartRow != nEndRow) )
340 {
342 nCellDir = aDialog.run();
343 }
344 else if ( nStartCol != nEndCol )
345 nCellDir = SCRET_ROWS;
346 else
347 nCellDir = SCRET_COLS;
348
349 if ( nCellDir != RET_CANCEL )
350 {
351 bool bValueIgnored = false;
352
353 if ( nCellDir == SCRET_COLS )
354 {
355 for ( SCCOL col=nStartCol; col<=nEndCol; col++ )
356 {
357 OUStringBuffer aStrList;
358 for ( SCROW row=nStartRow; row<=nEndRow; row++ )
359 {
360 if ( pDoc->HasStringData( col, row, nTab ) )
361 {
362 OUString aStrField = pDoc->GetString(col, row, nTab);
363
364 if ( !aStrField.isEmpty() )
365 {
366 aStrList.append(aStrField + "\n");
367 }
368 }
369 else
370 bValueIgnored = true;
371 }
372 if ( !aStrList.isEmpty() )
373 AddNewList( aStrList.makeStringAndClear() );
374 }
375 }
376 else
377 {
378 for ( SCROW row=nStartRow; row<=nEndRow; row++ )
379 {
380 OUStringBuffer aStrList;
381 for ( SCCOL col=nStartCol; col<=nEndCol; col++ )
382 {
383 if ( pDoc->HasStringData( col, row, nTab ) )
384 {
385 OUString aStrField = pDoc->GetString(col, row, nTab);
386
387 if ( !aStrField.isEmpty() )
388 {
389 aStrList.append(aStrField + "\n");
390 }
391 }
392 else
393 bValueIgnored = true;
394 }
395 if ( !aStrList.isEmpty() )
396 AddNewList( aStrList.makeStringAndClear() );
397 }
398 }
399
400 if ( bValueIgnored )
401 {
402 std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(),
403 VclMessageType::Info, VclButtonsType::Ok,
404 aStrCopyErr));
405 xInfoBox->run();
406 }
407 }
408
409 bCopyDone = true;
410
411}
412
413void ScTpUserLists::ModifyList( size_t nSelList,
414 const OUString& rEntriesStr )
415{
416 if ( !pUserLists ) return;
417
418 OUString theEntriesStr( rEntriesStr );
419
420 MakeListStr( theEntriesStr );
421
422 (*pUserLists)[nSelList].SetString( theEntriesStr );
423}
424
425void ScTpUserLists::RemoveList( size_t nList )
426{
427 if (pUserLists && nList < pUserLists->size())
428 pUserLists->EraseData(nList);
429}
430
431// Handler:
432
433IMPL_LINK( ScTpUserLists, LbSelectHdl, weld::TreeView&, rLb, void )
434{
435 if ( &rLb != mxLbLists.get() )
436 return;
437
438 sal_Int32 nSelPos = mxLbLists->get_selected_index();
439 if ( nSelPos == -1 )
440 return;
441
442 if ( !mxFtEntries->get_sensitive() ) mxFtEntries->set_sensitive(true);
443 if ( !mxEdEntries->get_sensitive() ) mxEdEntries->set_sensitive(true);
444 if ( !mxBtnRemove->get_sensitive() ) mxBtnRemove->set_sensitive(true);
445 if ( mxBtnAdd->get_sensitive() )
446 {
447 mxBtnAdd->set_sensitive(false);
448 mxBtnModify->set_sensitive(false);
449 }
450
451 UpdateEntries( nSelPos );
452}
453
454IMPL_LINK( ScTpUserLists, BtnClickHdl, weld::Button&, rBtn, void )
455{
456 if (&rBtn == mxBtnNew.get() || &rBtn == mxBtnDiscard.get())
457 {
458 if ( !bCancelMode )
459 {
460 nCancelPos = ( mxLbLists->n_children() > 0 )
461 ? mxLbLists->get_selected_index()
462 : 0;
463 mxLbLists->unselect_all();
464 mxFtLists->set_sensitive(false);
465 mxLbLists->set_sensitive(false);
466 mxFtEntries->set_sensitive(true);
467 mxEdEntries->set_sensitive(true);
468 mxEdEntries->set_text( OUString() );
469 mxEdEntries->grab_focus();
470 mxBtnAdd->set_sensitive(false);
471 mxBtnModify->set_sensitive(false);
472 mxBtnRemove->set_sensitive(false);
473
474 if ( mxBtnCopy->get_sensitive() )
475 {
476 mxBtnCopy->set_sensitive(false);
477 mxFtCopyFrom->set_sensitive(false);
478 mxEdCopyFrom->set_sensitive(false);
479 }
480 mxBtnNew->hide();
481 mxBtnDiscard->show();
482 bCancelMode = true;
483 }
484 else // if ( bCancelMode )
485 {
486 if ( mxLbLists->n_children() > 0 )
487 {
488 mxLbLists->select( nCancelPos );
489 LbSelectHdl( *mxLbLists );
490 mxFtLists->set_sensitive(true);
491 mxLbLists->set_sensitive(true);
492 }
493 else
494 {
495 mxFtEntries->set_sensitive(false);
496 mxEdEntries->set_sensitive(false);
497 mxEdEntries->set_text( OUString() );
498 mxBtnRemove->set_sensitive(false);
499 }
500 mxBtnAdd->set_sensitive(false);
501 mxBtnModify->set_sensitive(false);
502
503 if ( pViewData && !bCopyDone )
504 {
505 mxBtnCopy->set_sensitive(true);
506 mxFtCopyFrom->set_sensitive(true);
507 mxEdCopyFrom->set_sensitive(true);
508 }
509 mxBtnNew->show();
510 mxBtnDiscard->hide();
511 bCancelMode = false;
512 bModifyMode = false;
513 }
514 }
515 else if (&rBtn == mxBtnAdd.get() || &rBtn == mxBtnModify.get())
516 {
517 OUString theEntriesStr( mxEdEntries->get_text() );
518
519 if ( !bModifyMode )
520 {
521 if ( !theEntriesStr.isEmpty() )
522 {
523 AddNewList( theEntriesStr );
524 UpdateUserListBox();
525 mxLbLists->select( mxLbLists->n_children()-1 );
526 LbSelectHdl( *mxLbLists );
527 mxFtLists->set_sensitive(true);
528 mxLbLists->set_sensitive(true);
529 }
530 else
531 {
532 if ( mxLbLists->n_children() > 0 )
533 {
534 mxLbLists->select( nCancelPos );
535 LbSelectHdl( *mxLbLists );
536 mxLbLists->set_sensitive(true);
537 mxLbLists->set_sensitive(true);
538 }
539 }
540
541 mxBtnAdd->set_sensitive(false);
542 mxBtnModify->set_sensitive(false);
543 mxBtnRemove->set_sensitive(true);
544 mxBtnNew->show();
545 mxBtnDiscard->hide();
546 bCancelMode = false;
547 }
548 else // if ( bModifyMode )
549 {
550 sal_Int32 nSelList = mxLbLists->get_selected_index();
551
552 OSL_ENSURE( nSelList != -1 , "Modify without List :-/" );
553
554 if ( !theEntriesStr.isEmpty() )
555 {
556 ModifyList( nSelList, theEntriesStr );
557 UpdateUserListBox();
558 mxLbLists->select( nSelList );
559 }
560 else
561 {
562 mxLbLists->select( 0 );
563 LbSelectHdl( *mxLbLists );
564 }
565
566 mxBtnNew->show();
567 mxBtnDiscard->hide();
568 bCancelMode = false;
569 mxBtnAdd->show();
570 mxBtnModify->show();
571 mxBtnAdd->set_sensitive(false);
572 mxBtnModify->set_sensitive(false);
573 bModifyMode = false;
574 mxBtnRemove->set_sensitive(true);
575 mxFtLists->set_sensitive(true);
576 mxLbLists->set_sensitive(true);
577 }
578
579 if ( pViewData && !bCopyDone )
580 {
581 mxBtnCopy->set_sensitive(true);
582 mxFtCopyFrom->set_sensitive(true);
583 mxEdCopyFrom->set_sensitive(true);
584 }
585 }
586 else if ( &rBtn == mxBtnRemove.get() )
587 {
588 if ( mxLbLists->n_children() > 0 )
589 {
590 sal_Int32 nRemovePos = mxLbLists->get_selected_index();
591 OUString aMsg = o3tl::getToken(aStrQueryRemove, 0, '#' )
592 + mxLbLists->get_text( nRemovePos )
593 + o3tl::getToken(aStrQueryRemove, 1, '#' );
594
595 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
596 VclMessageType::Question, VclButtonsType::YesNo,
597 aMsg));
598 xQueryBox->set_default_response(RET_YES);
599
600 if (RET_YES == xQueryBox->run())
601 {
602 RemoveList( nRemovePos );
603 UpdateUserListBox();
604
605 if ( mxLbLists->n_children() > 0 )
606 {
607 mxLbLists->select(
608 ( nRemovePos >= mxLbLists->n_children() )
609 ? mxLbLists->n_children()-1
610 : nRemovePos );
611 LbSelectHdl( *mxLbLists );
612 }
613 else
614 {
615 mxFtLists->set_sensitive(false);
616 mxLbLists->set_sensitive(false);
617 mxFtEntries->set_sensitive(false);
618 mxEdEntries->set_sensitive(false);
619 mxEdEntries->set_text( OUString() );
620 mxBtnRemove->set_sensitive(false);
621 }
622 }
623
624 if ( pViewData && !bCopyDone && !mxBtnCopy->get_sensitive() )
625 {
626 mxBtnCopy->set_sensitive(true);
627 mxFtCopyFrom->set_sensitive(true);
628 mxEdCopyFrom->set_sensitive(true);
629 }
630 }
631 }
632 else if ( pViewData && (&rBtn == mxBtnCopy.get()) )
633 {
634 if ( bCopyDone )
635 return;
636
637 ScRefAddress theStartPos;
638 ScRefAddress theEndPos;
639 OUString theAreaStr( mxEdCopyFrom->get_text() );
640 bool bAreaOk = false;
641
642 if ( !theAreaStr.isEmpty() )
643 {
644 bAreaOk = ScRangeUtil::IsAbsArea( theAreaStr,
645 *pDoc,
646 pViewData->GetTabNo(),
647 &theAreaStr,
648 &theStartPos,
649 &theEndPos,
650 pDoc->GetAddressConvention() );
651 if ( !bAreaOk )
652 {
653 bAreaOk = ScRangeUtil::IsAbsPos( theAreaStr,
654 *pDoc,
655 pViewData->GetTabNo(),
656 &theAreaStr,
657 &theStartPos,
658 pDoc->GetAddressConvention() );
659 theEndPos = theStartPos;
660 }
661 }
662
663 if ( bAreaOk )
664 {
665 CopyListFromArea( theStartPos, theEndPos );
666 UpdateUserListBox();
667 mxLbLists->select( mxLbLists->n_children()-1 );
668 LbSelectHdl( *mxLbLists );
669 mxEdCopyFrom->set_text( theAreaStr );
670 mxEdCopyFrom->set_sensitive(false);
671 mxBtnCopy->set_sensitive(false);
672 mxFtCopyFrom->set_sensitive(false);
673 }
674 else
675 {
676 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
677 VclMessageType::Warning, VclButtonsType::Ok,
678 ScResId(STR_INVALID_TABREF)));
679
680 xBox->run();
681 mxEdCopyFrom->grab_focus();
682 mxEdCopyFrom->select_region(0, -1);
683 }
684 }
685}
686
687IMPL_LINK( ScTpUserLists, EdEntriesModHdl, weld::TextView&, rEd, void )
688{
689 if ( &rEd != mxEdEntries.get() )
690 return;
691
692 if ( mxBtnCopy->get_sensitive() )
693 {
694 mxBtnCopy->set_sensitive(false);
695 mxFtCopyFrom->set_sensitive(false);
696 mxEdCopyFrom->set_sensitive(false);
697 }
698
699 if ( !mxEdEntries->get_text().isEmpty() )
700 {
701 if ( !bCancelMode && !bModifyMode )
702 {
703 mxBtnNew->hide();
704 mxBtnDiscard->show();
705 bCancelMode = true;
706 mxBtnAdd->hide();
707 mxBtnAdd->set_sensitive(true);
708 mxBtnModify->show();
709 mxBtnModify->set_sensitive(true);
710 bModifyMode = true;
711 mxBtnRemove->set_sensitive(false);
712 mxFtLists->set_sensitive(false);
713 mxLbLists->set_sensitive(false);
714 }
715 else // if ( bCancelMode || bModifyMode )
716 {
717 if ( !mxBtnAdd->get_sensitive() )
718 {
719 mxBtnAdd->set_sensitive(true);
720 mxBtnModify->set_sensitive(true);
721 }
722 }
723 }
724 else
725 {
726 if ( mxBtnAdd->get_sensitive() )
727 {
728 mxBtnAdd->set_sensitive(false);
729 mxBtnModify->set_sensitive(false);
730 }
731 }
732}
733
734/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void PutInOrder(T &nStart, T &nEnd)
Definition: address.hxx:150
#define GetWhich(nSlot)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
SC_DLLPUBLIC bool HasStringData(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:3743
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
Definition: document.cxx:3505
static bool IsAbsArea(const OUString &rAreaStr, const ScDocument &rDoc, SCTAB nTab, OUString *pCompleteStr, ScRefAddress *pStartPos=nullptr, ScRefAddress *pEndPos=nullptr, ScAddress::Details const &rDetails=ScAddress::detailsOOOa1)
Definition: rangeutl.cxx:169
static bool IsAbsPos(const OUString &rPosStr, const ScDocument &rDoc, SCTAB nTab, OUString *pCompleteStr, ScRefAddress *pPosTripel=nullptr, ScAddress::Details const &rDetails=ScAddress::detailsOOOa1)
Definition: rangeutl.cxx:208
OUString Format(const ScDocument &rDocument, ScRefFlags nFlags=ScRefFlags::ZERO, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, bool bFullAddressNotation=false) const
Returns string with formatted cell range from aStart to aEnd, according to provided address conventio...
Definition: address.cxx:2170
SCCOL Col() const
Definition: address.hxx:886
SCTAB Tab() const
Definition: address.hxx:894
SCROW Row() const
Definition: address.hxx:890
ScViewData & GetViewData()
Definition: tabview.hxx:344
virtual ~ScTpUserLists() override
Definition: tpusrlst.cxx:82
ScTpUserLists(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpusrlst.cxx:49
bool bCopyDone
Definition: tpusrlst.hxx:68
std::unique_ptr< weld::TextView > mxEdEntries
Definition: tpusrlst.hxx:44
virtual bool FillItemSet(SfxItemSet *rCoreAttrs) override
Definition: tpusrlst.cxx:188
const sal_uInt16 nWhichUserLists
Definition: tpusrlst.hxx:59
std::unique_ptr< weld::Button > mxBtnDiscard
Definition: tpusrlst.hxx:48
std::unique_ptr< ScUserList > pUserLists
Definition: tpusrlst.hxx:60
const OUString aStrCopyErr
Definition: tpusrlst.hxx:57
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tpusrlst.cxx:133
ScDocument * pDoc
Definition: tpusrlst.hxx:62
std::unique_ptr< weld::Label > mxFtCopyFrom
Definition: tpusrlst.hxx:45
void UpdateEntries(size_t nList)
Definition: tpusrlst.cxx:254
bool bCancelMode
Definition: tpusrlst.hxx:67
std::unique_ptr< weld::Label > mxFtLists
Definition: tpusrlst.hxx:41
const OUString aStrCopyFrom
Definition: tpusrlst.hxx:56
OUString aStrSelectedArea
Definition: tpusrlst.hxx:64
std::unique_ptr< weld::Button > mxBtnModify
Definition: tpusrlst.hxx:50
const OUString aStrCopyList
Definition: tpusrlst.hxx:55
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tpusrlst.cxx:227
std::unique_ptr< weld::Button > mxBtnNew
Definition: tpusrlst.hxx:47
std::unique_ptr< weld::Button > mxBtnAdd
Definition: tpusrlst.hxx:49
virtual void Reset(const SfxItemSet *rCoreAttrs) override
Definition: tpusrlst.cxx:138
ScViewData * pViewData
Definition: tpusrlst.hxx:63
void AddNewList(const OUString &rEntriesStr)
Definition: tpusrlst.cxx:315
bool bModifyMode
Definition: tpusrlst.hxx:66
std::unique_ptr< weld::Label > mxFtEntries
Definition: tpusrlst.hxx:43
void CopyListFromArea(const ScRefAddress &rStartPos, const ScRefAddress &rEndPos)
Definition: tpusrlst.cxx:327
void RemoveList(size_t nList)
Definition: tpusrlst.cxx:425
std::unique_ptr< weld::Button > mxBtnCopy
Definition: tpusrlst.hxx:52
std::unique_ptr< weld::Entry > mxEdCopyFrom
Definition: tpusrlst.hxx:46
static void MakeListStr(OUString &rListStr)
Definition: tpusrlst.cxx:279
void Init()
Definition: tpusrlst.cxx:86
std::unique_ptr< weld::Button > mxBtnRemove
Definition: tpusrlst.hxx:51
void ModifyList(size_t nSelList, const OUString &rEntriesStr)
Definition: tpusrlst.cxx:413
std::unique_ptr< weld::TreeView > mxLbLists
Definition: tpusrlst.hxx:42
size_t UpdateUserListBox()
Definition: tpusrlst.cxx:235
Stores individual user-defined sort list.
Definition: userlist.hxx:32
OUString GetSubStr(sal_uInt16 nIndex) const
Definition: userlist.cxx:85
size_t GetSubCount() const
Definition: userlist.hxx:51
ScUserList * GetUserList() const
Definition: uiitems.hxx:205
void SetUserList(const ScUserList &rUserList)
Definition: uiitems.cxx:316
Collection of user-defined sort lists.
Definition: userlist.hxx:62
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
Definition: viewdata.cxx:1182
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const SfxItemSet & GetItemSet() const
void SetExchangeSupport()
weld::Window * GetFrameWeld() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
virtual short run()
int nCount
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
LineEnd GetSystemLineEnd()
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
aStr
RttiCompleteObjectLocator col
size
OString strip(const OString &rIn, char c)
int i
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
#define SCRET_ROWS
Definition: scui_def.hxx:25
#define SCRET_COLS
Definition: scui_def.hxx:24
DeactivateRC
#define LF
Definition: tpusrlst.cxx:43
#define CR
Definition: tpusrlst.cxx:42
const sal_Unicode cDelimiter
Definition: tpusrlst.cxx:45
IMPL_LINK(ScTpUserLists, LbSelectHdl, weld::TreeView &, rLb, void)
Definition: tpusrlst.cxx:433
sal_uInt16 sal_Unicode
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
RET_CANCEL
RET_YES