LibreOffice Module sc (master) 1
nameuno.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 <o3tl/safeint.hxx>
21#include <svl/hint.hxx>
22#include <utility>
23#include <vcl/svapp.hxx>
24#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
25#include <com/sun/star/sheet/NamedRangeFlag.hpp>
26#include <com/sun/star/awt/XBitmap.hpp>
27#include <com/sun/star/beans/PropertyAttribute.hpp>
28
32
33using namespace ::com::sun::star;
34using ::com::sun::star::uno::Reference;
35using ::com::sun::star::uno::Any;
36
37#include <nameuno.hxx>
38#include <miscuno.hxx>
39#include <cellsuno.hxx>
40#include <convuno.hxx>
41#include <targuno.hxx>
42#include <tokenuno.hxx>
43#include <tokenarray.hxx>
44#include <docsh.hxx>
45#include <docfunc.hxx>
46#include <rangenam.hxx>
47#include <unonames.hxx>
48
49#include <scui_def.hxx>
50
52{
53 static const SfxItemPropertyMapEntry aNamedRangeMap_Impl[] =
54 {
55 { SC_UNO_LINKDISPBIT, 0, cppu::UnoType<awt::XBitmap>::get(), beans::PropertyAttribute::READONLY, 0 },
56 { SC_UNO_LINKDISPNAME, 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::READONLY, 0 },
57 { SC_UNONAME_TOKENINDEX, 0, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::READONLY, 0 },
59 };
60 return aNamedRangeMap_Impl;
61}
62
64{
65 static const SfxItemPropertyMapEntry aNamedRangesMap_Impl[] =
66 {
68 };
69 return aNamedRangesMap_Impl;
70}
71
72constexpr OUStringLiteral SCNAMEDRANGEOBJ_SERVICE = u"com.sun.star.sheet.NamedRange";
73
74SC_SIMPLE_SERVICE_INFO( ScLabelRangeObj, "ScLabelRangeObj", "com.sun.star.sheet.LabelRange" )
75SC_SIMPLE_SERVICE_INFO( ScLabelRangesObj, "ScLabelRangesObj", "com.sun.star.sheet.LabelRanges" )
76SC_SIMPLE_SERVICE_INFO( ScNamedRangesObj, "ScNamedRangesObj", "com.sun.star.sheet.NamedRanges" )
77
78static bool lcl_UserVisibleName(const ScRangeData& rData)
79{
81
82 return !rData.HasType(ScRangeData::Type::Database);
83}
84
85ScNamedRangeObj::ScNamedRangeObj( rtl::Reference< ScNamedRangesObj > xParent, ScDocShell* pDocSh, OUString aNm, Reference<container::XNamed> const & xSheet):
86 mxParent(std::move(xParent)),
87 pDocShell( pDocSh ),
88 aName(std::move( aNm )),
89 mxSheet( xSheet )
90{
92}
93
95{
97
98 if (pDocShell)
100}
101
103{
104 // reference update is of no interest
105
106 if ( rHint.GetId() == SfxHintId::Dying )
107 pDocShell = nullptr; // became invalid
108}
109
110// Helper functions
111
113{
114 ScRangeData* pRet = nullptr;
115 if (pDocShell)
116 {
117 ScRangeName* pNames;
118 SCTAB nTab = GetTab_Impl();
119 if (nTab >= 0)
120 pNames = pDocShell->GetDocument().GetRangeName(nTab);
121 else
122 pNames = pDocShell->GetDocument().GetRangeName();
123 if (pNames)
124 {
125 pRet = pNames->findByUpperName(ScGlobal::getCharClass().uppercase(aName));
126 if (pRet)
127 pRet->ValidateTabRefs(); // adjust relative tab refs to valid tables
128 }
129 }
130 return pRet;
131}
132
134{
135 if (mxSheet.is())
136 {
137 if (!pDocShell)
138 return -2;
140 SCTAB nTab;
141 OUString sName = mxSheet->getName();
142 bool bFound = rDoc.GetTable(sName, nTab);
143 assert(bFound); (void)bFound; // fouled up?
144 return nTab;
145 }
146 else
147 return -1;//global range name
148}
149
150// sheet::XNamedRange
151
152void ScNamedRangeObj::Modify_Impl( const OUString* pNewName, const ScTokenArray* pNewTokens, const OUString* pNewContent,
153 const ScAddress* pNewPos, const ScRangeData::Type* pNewType,
154 const formula::FormulaGrammar::Grammar eGrammar )
155{
156 if (!pDocShell)
157 return;
158
160 ScRangeName* pNames;
161 SCTAB nTab = GetTab_Impl();
162 if (nTab >= 0)
163 pNames = rDoc.GetRangeName(nTab);
164 else
165 pNames = rDoc.GetRangeName();
166 if (!pNames)
167 return;
168
169 const ScRangeData* pOld = pNames->findByUpperName(ScGlobal::getCharClass().uppercase(aName));
170 if (!pOld)
171 return;
172
173 std::unique_ptr<ScRangeName> pNewRanges(new ScRangeName(*pNames));
174
175 OUString aInsName = pOld->GetName();
176 if (pNewName)
177 aInsName = *pNewName;
178
179 // Content string based => no problems with changed positions and such.
180 OUString aContent = pOld->GetSymbol(eGrammar);
181 if (pNewContent)
182 aContent = *pNewContent;
183
184 ScAddress aPos = pOld->GetPos();
185 if (pNewPos)
186 aPos = *pNewPos;
187
189 if (pNewType)
190 nType = *pNewType;
191
192 ScRangeData* pNew = nullptr;
193 if (pNewTokens)
194 pNew = new ScRangeData( rDoc, aInsName, *pNewTokens, aPos, nType );
195 else
196 pNew = new ScRangeData( rDoc, aInsName, aContent, aPos, nType, eGrammar );
197
198 pNew->SetIndex( pOld->GetIndex() );
199
200 pNewRanges->erase(*pOld);
201 if (pNewRanges->insert(pNew))
202 {
203 pDocShell->GetDocFunc().SetNewRangeNames(std::move(pNewRanges), mxParent->IsModifyAndBroadcast(), nTab);
204
205 aName = aInsName;
206 }
207 else
208 {
209 pNew = nullptr;
210 }
211}
212
213OUString SAL_CALL ScNamedRangeObj::getName()
214{
215 SolarMutexGuard aGuard;
216 return aName;
217}
218
219void SAL_CALL ScNamedRangeObj::setName( const OUString& aNewName )
220{
221 SolarMutexGuard aGuard;
223
224 OUString aNewStr(aNewName);
225 // GRAM_API for API compatibility.
226 Modify_Impl( &aNewStr, nullptr, nullptr, nullptr, nullptr,formula::FormulaGrammar::GRAM_API );
227
228 if ( aName != aNewStr ) // some error occurred...
229 throw uno::RuntimeException(); // no other exceptions specified
230}
231
233{
234 SolarMutexGuard aGuard;
235 OUString aContent;
237 if (pData)
238 // GRAM_API for API compatibility.
239 aContent = pData->GetSymbol(formula::FormulaGrammar::GRAM_API);
240 return aContent;
241}
242
243void SAL_CALL ScNamedRangeObj::setContent( const OUString& aContent )
244{
245 SolarMutexGuard aGuard;
246 OUString aContStr(aContent);
247 // GRAM_API for API compatibility.
248 Modify_Impl( nullptr, nullptr, &aContStr, nullptr, nullptr,formula::FormulaGrammar::GRAM_API );
249}
250
251table::CellAddress SAL_CALL ScNamedRangeObj::getReferencePosition()
252{
253 SolarMutexGuard aGuard;
254 ScAddress aPos;
256 if (pData)
257 aPos = pData->GetPos();
258 table::CellAddress aAddress;
259 aAddress.Column = aPos.Col();
260 aAddress.Row = aPos.Row();
261 aAddress.Sheet = aPos.Tab();
262 if (pDocShell)
263 {
265 if ( aAddress.Sheet >= nDocTabs && nDocTabs > 0 )
266 {
267 // Even after ValidateTabRefs, the position can be invalid if
268 // the content points to preceding tables. The resulting string
269 // is invalid in any case, so the position is just shifted.
270 aAddress.Sheet = nDocTabs - 1;
271 }
272 }
273 return aAddress;
274}
275
276void SAL_CALL ScNamedRangeObj::setReferencePosition( const table::CellAddress& aReferencePosition )
277{
278 SolarMutexGuard aGuard;
279 ScAddress aPos( static_cast<SCCOL>(aReferencePosition.Column), static_cast<SCROW>(aReferencePosition.Row), aReferencePosition.Sheet );
280 // GRAM_API for API compatibility.
281 Modify_Impl( nullptr, nullptr, nullptr, &aPos, nullptr,formula::FormulaGrammar::GRAM_API );
282}
283
284sal_Int32 SAL_CALL ScNamedRangeObj::getType()
285{
286 SolarMutexGuard aGuard;
287 sal_Int32 nType=0;
289 if (pData)
290 {
291 // do not return internal ScRangeData::Type flags
292 if ( pData->HasType(ScRangeData::Type::Criteria) ) nType |= sheet::NamedRangeFlag::FILTER_CRITERIA;
293 if ( pData->HasType(ScRangeData::Type::PrintArea) ) nType |= sheet::NamedRangeFlag::PRINT_AREA;
296 }
297 return nType;
298}
299
300void SAL_CALL ScNamedRangeObj::setType( sal_Int32 nUnoType )
301{
302 SolarMutexGuard aGuard;
304 if ( nUnoType & sheet::NamedRangeFlag::FILTER_CRITERIA ) nNewType |= ScRangeData::Type::Criteria;
305 if ( nUnoType & sheet::NamedRangeFlag::PRINT_AREA ) nNewType |= ScRangeData::Type::PrintArea;
308
309 // GRAM_API for API compatibility.
310 Modify_Impl( nullptr, nullptr, nullptr, nullptr, &nNewType,formula::FormulaGrammar::GRAM_API );
311}
312
313// XFormulaTokens
314
315uno::Sequence<sheet::FormulaToken> SAL_CALL ScNamedRangeObj::getTokens()
316{
317 SolarMutexGuard aGuard;
318 uno::Sequence<sheet::FormulaToken> aSequence;
320 if (pData && pDocShell)
321 {
322 ScTokenArray* pTokenArray = pData->GetCode();
323 if ( pTokenArray )
325 }
326 return aSequence;
327}
328
329void SAL_CALL ScNamedRangeObj::setTokens( const uno::Sequence<sheet::FormulaToken>& rTokens )
330{
331 SolarMutexGuard aGuard;
332 if( pDocShell )
333 {
334 ScTokenArray aTokenArray(pDocShell->GetDocument());
335 (void)ScTokenConversion::ConvertToTokenArray( pDocShell->GetDocument(), aTokenArray, rTokens );
336 // GRAM_API for API compatibility.
337 Modify_Impl( nullptr, &aTokenArray, nullptr, nullptr, nullptr, formula::FormulaGrammar::GRAM_API );
338 }
339}
340
341// XCellRangeSource
342
343uno::Reference<table::XCellRange> SAL_CALL ScNamedRangeObj::getReferredCells()
344{
345 SolarMutexGuard aGuard;
346 ScRange aRange;
348 if ( pData && pData->IsValidReference( aRange ) )
349 {
351
352 if ( aRange.aStart == aRange.aEnd )
353 return new ScCellObj( pDocShell, aRange.aStart );
354 else
355 return new ScCellRangeObj( pDocShell, aRange );
356 }
357 return nullptr;
358}
359
360// beans::XPropertySet
361
362uno::Reference<beans::XPropertySetInfo> SAL_CALL ScNamedRangeObj::getPropertySetInfo()
363{
364 static uno::Reference< beans::XPropertySetInfo > aRef(new SfxItemPropertySetInfo( lcl_GetNamedRangeMap() ));
365 return aRef;
366}
367
369 const OUString& rPropertyName, const uno::Any& /*aValue*/ )
370{
371 if ( rPropertyName == SC_UNONAME_ISSHAREDFMLA )
372 {
373 // Ignore this.
374 }
375}
376
377uno::Any SAL_CALL ScNamedRangeObj::getPropertyValue( const OUString& rPropertyName )
378{
379 SolarMutexGuard aGuard;
380 uno::Any aRet;
381 if ( rPropertyName == SC_UNO_LINKDISPBIT )
382 {
383 // no target bitmaps for individual entries (would be all equal)
384 // ScLinkTargetTypeObj::SetLinkTargetBitmap( aRet, SC_LINKTARGETTYPE_RANGENAME );
385 }
386 else if ( rPropertyName == SC_UNO_LINKDISPNAME )
387 aRet <<= aName;
388 else if ( rPropertyName == SC_UNONAME_TOKENINDEX )
389 {
390 // get index for use in formula tokens (read-only)
392 if (pData)
393 aRet <<= static_cast<sal_Int32>(pData->GetIndex());
394 }
395 else if ( rPropertyName == SC_UNONAME_ISSHAREDFMLA )
396 {
397 if (GetRangeData_Impl())
398 aRet <<= false;
399 }
400 return aRet;
401}
402
404
405// lang::XServiceInfo
406
407OUString SAL_CALL ScNamedRangeObj::getImplementationName()
408{
409 return "ScNamedRangeObj";
410}
411
412sal_Bool SAL_CALL ScNamedRangeObj::supportsService( const OUString& rServiceName )
413{
414 return cppu::supportsService(this, rServiceName);
415}
416
417uno::Sequence<OUString> SAL_CALL ScNamedRangeObj::getSupportedServiceNames()
418{
420}
421
423 mbModifyAndBroadcast(true),
424 pDocShell( pDocSh )
425{
427}
428
430{
432
433 if (pDocShell)
435}
436
438{
439 // reference update is of no interest
440
441 if ( rHint.GetId() == SfxHintId::Dying )
442 {
443 pDocShell = nullptr; // became invalid
444 }
445}
446
447// sheet::XNamedRanges
448
449void SAL_CALL ScNamedRangesObj::addNewByName( const OUString& aName,
450 const OUString& aContent, const table::CellAddress& aPosition,
451 sal_Int32 nUnoType )
452{
453 SolarMutexGuard aGuard;
454 ScAddress aPos( static_cast<SCCOL>(aPosition.Column), static_cast<SCROW>(aPosition.Row), aPosition.Sheet );
455
457 if ( nUnoType & sheet::NamedRangeFlag::FILTER_CRITERIA ) nNewType |= ScRangeData::Type::Criteria;
458 if ( nUnoType & sheet::NamedRangeFlag::PRINT_AREA ) nNewType |= ScRangeData::Type::PrintArea;
461
462 bool bDone = false;
463 if (pDocShell)
464 {
466 // tdf#119457 - check for a valid range name and cell reference
467 switch (ScRangeData::IsNameValid(aName, rDoc))
468 {
470 throw uno::RuntimeException(
471 "Invalid name. Reference to a cell, or a range of cells not allowed",
472 getXWeak());
473 break;
475 throw uno::RuntimeException(
476 "Invalid name. Start with a letter, use only letters, numbers and underscore",
477 getXWeak());
478 break;
480 if (ScRangeName* pNames = GetRangeName_Impl();
481 pNames
482 && !pNames->findByUpperName(ScGlobal::getCharClass().uppercase(aName)))
483 {
484 std::unique_ptr<ScRangeName> pNewRanges(new ScRangeName( *pNames ));
485 // GRAM_API for API compatibility.
486 ScRangeData* pNew = new ScRangeData( rDoc, aName, aContent,
487 aPos, nNewType,formula::FormulaGrammar::GRAM_API );
488 if ( pNewRanges->insert(pNew) )
489 {
491 bDone = true;
492 }
493 else
494 {
495 pNew = nullptr;
496 }
497 }
498 }
499 }
500
501 if (!bDone)
502 throw uno::RuntimeException(); // no other exceptions specified
503}
504
505void SAL_CALL ScNamedRangesObj::addNewFromTitles( const table::CellRangeAddress& aSource,
506 sheet::Border aBorder )
507{
508 SolarMutexGuard aGuard;
510
511 bool bTop = ( aBorder == sheet::Border_TOP );
512 bool bLeft = ( aBorder == sheet::Border_LEFT );
513 bool bBottom = ( aBorder == sheet::Border_BOTTOM );
514 bool bRight = ( aBorder == sheet::Border_RIGHT );
515
516 ScRange aRange;
517 ScUnoConversion::FillScRange( aRange, aSource );
518
520 if (bTop) nFlags |= CreateNameFlags::Top;
521 if (bLeft) nFlags |= CreateNameFlags::Left;
522 if (bBottom) nFlags |= CreateNameFlags::Bottom;
523 if (bRight) nFlags |= CreateNameFlags::Right;
524
525 if (nFlags != CreateNameFlags::NONE)
526 pDocShell->GetDocFunc().CreateNames( aRange, nFlags, true, GetTab_Impl() );
527}
528
529void SAL_CALL ScNamedRangesObj::removeByName( const OUString& aName )
530{
531 SolarMutexGuard aGuard;
532 bool bDone = false;
533 if (pDocShell)
534 {
535 ScRangeName* pNames = GetRangeName_Impl();
536 if (pNames)
537 {
538 const ScRangeData* pData = pNames->findByUpperName(ScGlobal::getCharClass().uppercase(aName));
540 {
541 std::unique_ptr<ScRangeName> pNewRanges(new ScRangeName(*pNames));
542 pNewRanges->erase(*pData);
544 bDone = true;
545 }
546 }
547 }
548
549 if (!bDone)
550 throw uno::RuntimeException(); // no other exceptions specified
551}
552
553void SAL_CALL ScNamedRangesObj::outputList( const table::CellAddress& aOutputPosition )
554{
555 SolarMutexGuard aGuard;
556 ScAddress aPos( static_cast<SCCOL>(aOutputPosition.Column), static_cast<SCROW>(aOutputPosition.Row), aOutputPosition.Sheet );
557 if (pDocShell)
558 pDocShell->GetDocFunc().InsertNameList( aPos, true );
559}
560
561// container::XEnumerationAccess
562
563uno::Reference<container::XEnumeration> SAL_CALL ScNamedRangesObj::createEnumeration()
564{
565 SolarMutexGuard aGuard;
566 return new ScIndexEnumeration(this, "com.sun.star.sheet.NamedRangesEnumeration");
567}
568
569// container::XIndexAccess
570
571sal_Int32 SAL_CALL ScNamedRangesObj::getCount()
572{
573 SolarMutexGuard aGuard;
574 tools::Long nRet = 0;
575 if (pDocShell)
576 {
577 ScRangeName* pNames = GetRangeName_Impl();
578 if (pNames)
579 {
580 for (const auto& rName : *pNames)
581 if (lcl_UserVisibleName(*rName.second))
582 ++nRet;
583 }
584 }
585 return nRet;
586}
587
588uno::Any SAL_CALL ScNamedRangesObj::getByIndex( sal_Int32 nIndex )
589{
590 SolarMutexGuard aGuard;
591 uno::Reference< sheet::XNamedRange > xRange(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex)));
592 if ( !xRange.is() )
593 throw lang::IndexOutOfBoundsException();
594
595 return uno::Any(xRange);
596}
597
599{
600 return cppu::UnoType<sheet::XNamedRange>::get(); // must be suitable for getByIndex
601}
602
604{
605 SolarMutexGuard aGuard;
606 return ( getCount() != 0 );
607}
608
609Reference<beans::XPropertySetInfo> SAL_CALL ScNamedRangesObj::getPropertySetInfo()
610{
611 static Reference<beans::XPropertySetInfo> aRef(
613 return aRef;
614}
615
617 const OUString& rPropertyName, const uno::Any& aValue )
618{
619 if ( rPropertyName == SC_UNO_MODIFY_BROADCAST )
620 {
621 aValue >>= mbModifyAndBroadcast;
622 }
623}
624
625Any SAL_CALL ScNamedRangesObj::getPropertyValue( const OUString& rPropertyName )
626{
627 Any aRet;
628 if ( rPropertyName == SC_UNO_MODIFY_BROADCAST )
629 {
630 aRet <<= mbModifyAndBroadcast;
631 }
632
633 return aRet;
634}
635
637
638uno::Any SAL_CALL ScNamedRangesObj::getByName( const OUString& aName )
639{
640 SolarMutexGuard aGuard;
641 uno::Reference< sheet::XNamedRange > xRange(GetObjectByName_Impl(aName));
642 if ( !xRange.is() )
643 throw container::NoSuchElementException();
644
645 return uno::Any(xRange);
646}
647
648uno::Sequence<OUString> SAL_CALL ScNamedRangesObj::getElementNames()
649{
650 SolarMutexGuard aGuard;
651 if (pDocShell)
652 {
653 ScRangeName* pNames = GetRangeName_Impl();
654 if (pNames)
655 {
656 tools::Long nVisCount = getCount(); // names with lcl_UserVisibleName
657 uno::Sequence<OUString> aSeq(nVisCount);
658 OUString* pAry = aSeq.getArray();
659 sal_uInt16 nVisPos = 0;
660 for (const auto& rName : *pNames)
661 {
662 if (lcl_UserVisibleName(*rName.second))
663 pAry[nVisPos++] = rName.second->GetName();
664 }
665 return aSeq;
666 }
667 }
668 return {};
669}
670
671sal_Bool SAL_CALL ScNamedRangesObj::hasByName( const OUString& aName )
672{
673 SolarMutexGuard aGuard;
674 if (pDocShell)
675 {
676 ScRangeName* pNames = GetRangeName_Impl();
677 if (pNames)
678 {
679 const ScRangeData* pData = pNames->findByUpperName(ScGlobal::getCharClass().uppercase(aName));
681 return true;
682 }
683 }
684 return false;
685}
686
689{
691}
692
695{
697}
698
699// document::XActionLockable
700
702{
703 SolarMutexGuard aGuard;
705}
706
708{
709 SolarMutexGuard aGuard;
711 sal_Int16 nLockCount = rDoc.GetNamedRangesLockCount();
712 ++nLockCount;
713 if ( nLockCount == 1 )
714 {
715 lock();
716 }
717 rDoc.SetNamedRangesLockCount( nLockCount );
718}
719
721{
722 SolarMutexGuard aGuard;
724 sal_Int16 nLockCount = rDoc.GetNamedRangesLockCount();
725 if ( nLockCount > 0 )
726 {
727 --nLockCount;
728 if ( nLockCount == 0 )
729 {
730 unlock();
731 }
732 rDoc.SetNamedRangesLockCount( nLockCount );
733 }
734}
735
736void ScNamedRangesObj::setActionLocks( sal_Int16 nLock )
737{
738 SolarMutexGuard aGuard;
739 if ( nLock < 0 )
740 return;
741
743 sal_Int16 nLockCount = rDoc.GetNamedRangesLockCount();
744 if ( nLock == 0 && nLockCount > 0 )
745 {
746 unlock();
747 }
748 if ( nLock > 0 && nLockCount == 0 )
749 {
750 lock();
751 }
752 rDoc.SetNamedRangesLockCount( nLock );
753}
754
756{
757 SolarMutexGuard aGuard;
759 sal_Int16 nLockCount = rDoc.GetNamedRangesLockCount();
760 if ( nLockCount > 0 )
761 {
762 unlock();
763 }
764 rDoc.SetNamedRangesLockCount( 0 );
765 return nLockCount;
766}
767
769 : ScNamedRangesObj(pDocSh)
770{
771
772}
773
775{
776
777}
778
780{
781 if (!pDocShell)
782 return nullptr;
783
785 if (!pNames)
786 return nullptr;
787
788 sal_uInt16 nPos = 0;
789 for (const auto& rName : *pNames)
790 {
791 if (lcl_UserVisibleName(*rName.second))
792 {
793 if (nPos == nIndex)
794 return new ScNamedRangeObj(this, pDocShell, rName.second->GetName());
795 }
796 ++nPos;
797 }
798 return nullptr;
799}
800
802{
803 if ( pDocShell && hasByName(aName) )
804 return new ScNamedRangeObj(this, pDocShell, aName);
805 return nullptr;
806}
807
809{
811}
812
814{
815 return -1;
816}
817
818ScLocalNamedRangesObj::ScLocalNamedRangesObj( ScDocShell* pDocSh, uno::Reference<container::XNamed> xSheet )
819 : ScNamedRangesObj(pDocSh),
820 mxSheet(std::move(xSheet))
821{
822
823}
824
826{
827
828}
829
831{
832 if ( pDocShell && hasByName( aName ) )
833 return new ScNamedRangeObj( this, pDocShell, aName, mxSheet);
834 return nullptr;
835
836}
837
839{
840 if (!pDocShell)
841 return nullptr;
842
843 OUString aName = mxSheet->getName();
845 SCTAB nTab;
846 if (!rDoc.GetTable(aName, nTab))
847 return nullptr;
848
849 ScRangeName* pNames = rDoc.GetRangeName( nTab );
850 if (!pNames)
851 return nullptr;
852
853 sal_uInt16 nPos = 0;
854 for (const auto& rName : *pNames)
855 {
856 if (lcl_UserVisibleName(*rName.second))
857 {
858 if (nPos == nIndex)
859 return new ScNamedRangeObj(this, pDocShell, rName.second->GetName(), mxSheet);
860 }
861 ++nPos;
862 }
863 return nullptr;
864}
865
867{
868 SCTAB nTab = GetTab_Impl();
869 return pDocShell->GetDocument().GetRangeName( nTab );
870}
871
873{
874 SCTAB nTab;
875 (void)pDocShell->GetDocument().GetTable(mxSheet->getName(), nTab);
876 return nTab;
877}
878
880 pDocShell( pDocSh ),
881 bColumn( bCol ),
882 aRange( rR )
883{
885}
886
888{
890
891 if (pDocShell)
893}
894
896{
898
899 if ( rHint.GetId() == SfxHintId::Dying )
900 pDocShell = nullptr; // became invalid
901}
902
903// Helper functions
904
906{
907 ScRangePair* pRet = nullptr;
908 if (pDocShell)
909 {
911 ScRangePairList* pList = bColumn ? rDoc.GetColNameRanges() : rDoc.GetRowNameRanges();
912 if (pList)
913 pRet = pList->Find( aRange );
914 }
915 return pRet;
916}
917
918void ScLabelRangeObj::Modify_Impl( const ScRange* pLabel, const ScRange* pData )
919{
920 if (!pDocShell)
921 return;
922
924 ScRangePairList* pOldList = bColumn ? rDoc.GetColNameRanges() : rDoc.GetRowNameRanges();
925 if (!pOldList)
926 return;
927
928 ScRangePairListRef xNewList(pOldList->Clone());
929 ScRangePair* pEntry = xNewList->Find( aRange );
930 if (!pEntry)
931 return;
932
933 if ( pLabel )
934 pEntry->GetRange(0) = *pLabel;
935 if ( pData )
936 pEntry->GetRange(1) = *pData;
937
938 xNewList->Join( *pEntry, true );
939
940 if (bColumn)
941 rDoc.GetColNameRangesRef() = xNewList;
942 else
943 rDoc.GetRowNameRangesRef() = xNewList;
944
948
950
951 if ( pLabel )
952 aRange = *pLabel; // adapt object to find range again
953}
954
955// sheet::XLabelRange
956
957table::CellRangeAddress SAL_CALL ScLabelRangeObj::getLabelArea()
958{
959 SolarMutexGuard aGuard;
960 table::CellRangeAddress aRet;
962 if (pData)
963 ScUnoConversion::FillApiRange( aRet, pData->GetRange(0) );
964 return aRet;
965}
966
967void SAL_CALL ScLabelRangeObj::setLabelArea( const table::CellRangeAddress& aLabelArea )
968{
969 SolarMutexGuard aGuard;
970 ScRange aLabelRange;
971 ScUnoConversion::FillScRange( aLabelRange, aLabelArea );
972 Modify_Impl( &aLabelRange, nullptr );
973}
974
975table::CellRangeAddress SAL_CALL ScLabelRangeObj::getDataArea()
976{
977 SolarMutexGuard aGuard;
978 table::CellRangeAddress aRet;
980 if (pData)
981 ScUnoConversion::FillApiRange( aRet, pData->GetRange(1) );
982 return aRet;
983}
984
985void SAL_CALL ScLabelRangeObj::setDataArea( const table::CellRangeAddress& aDataArea )
986{
987 SolarMutexGuard aGuard;
988 ScRange aDataRange;
989 ScUnoConversion::FillScRange( aDataRange, aDataArea );
990 Modify_Impl( nullptr, &aDataRange );
991}
992
994 pDocShell( pDocSh ),
995 bColumn( bCol )
996{
998}
999
1001{
1003
1004 if (pDocShell)
1006}
1007
1009{
1010 // reference update is of no interest
1011
1012 if ( rHint.GetId() == SfxHintId::Dying )
1013 {
1014 pDocShell = nullptr; // became invalid
1015 }
1016}
1017
1018// sheet::XLabelRanges
1019
1021{
1022 if (pDocShell)
1023 {
1024 ScDocument& rDoc = pDocShell->GetDocument();
1025 ScRangePairList* pList = bColumn ? rDoc.GetColNameRanges() : rDoc.GetRowNameRanges();
1026 if ( pList && nIndex < pList->size() )
1027 {
1028 ScRangePair & rData = (*pList)[nIndex];
1029 return new ScLabelRangeObj( pDocShell, bColumn, rData.GetRange(0) );
1030 }
1031 }
1032 return nullptr;
1033}
1034
1035void SAL_CALL ScLabelRangesObj::addNew( const table::CellRangeAddress& aLabelArea,
1036 const table::CellRangeAddress& aDataArea )
1037{
1038 SolarMutexGuard aGuard;
1039 if (!pDocShell)
1040 return;
1041
1042 ScDocument& rDoc = pDocShell->GetDocument();
1043 ScRangePairList* pOldList = bColumn ? rDoc.GetColNameRanges() : rDoc.GetRowNameRanges();
1044 if (!pOldList)
1045 return;
1046
1047 ScRangePairListRef xNewList(pOldList->Clone());
1048
1049 ScRange aLabelRange;
1050 ScRange aDataRange;
1051 ScUnoConversion::FillScRange( aLabelRange, aLabelArea );
1052 ScUnoConversion::FillScRange( aDataRange, aDataArea );
1053 xNewList->Join( ScRangePair( aLabelRange, aDataRange ) );
1054
1055 if (bColumn)
1056 rDoc.GetColNameRangesRef() = xNewList;
1057 else
1058 rDoc.GetRowNameRangesRef() = xNewList;
1059
1061 pDocShell->PostPaint( 0,0,0, rDoc.MaxCol(),rDoc.MaxRow(),MAXTAB, PaintPartFlags::Grid );
1063
1065}
1066
1067void SAL_CALL ScLabelRangesObj::removeByIndex( sal_Int32 nIndex )
1068{
1069 SolarMutexGuard aGuard;
1070 bool bDone = false;
1071 if (pDocShell)
1072 {
1073 ScDocument& rDoc = pDocShell->GetDocument();
1074 ScRangePairList* pOldList = bColumn ? rDoc.GetColNameRanges() : rDoc.GetRowNameRanges();
1075
1076 if ( pOldList && nIndex >= 0 && o3tl::make_unsigned(nIndex) < pOldList->size() )
1077 {
1078 ScRangePairListRef xNewList(pOldList->Clone());
1079
1080 xNewList->Remove( nIndex );
1081
1082 if (bColumn)
1083 rDoc.GetColNameRangesRef() = xNewList;
1084 else
1085 rDoc.GetRowNameRangesRef() = xNewList;
1086
1088 pDocShell->PostPaint( 0,0,0, rDoc.MaxCol(),rDoc.MaxRow(),MAXTAB, PaintPartFlags::Grid );
1090 bDone = true;
1091
1093 }
1094 }
1095 if (!bDone)
1096 throw uno::RuntimeException(); // no other exceptions specified
1097}
1098
1099// container::XEnumerationAccess
1100
1101uno::Reference<container::XEnumeration> SAL_CALL ScLabelRangesObj::createEnumeration()
1102{
1103 SolarMutexGuard aGuard;
1104 return new ScIndexEnumeration(this, "com.sun.star.sheet.LabelRangesEnumeration");
1105}
1106
1107// container::XIndexAccess
1108
1109sal_Int32 SAL_CALL ScLabelRangesObj::getCount()
1110{
1111 SolarMutexGuard aGuard;
1112 if (pDocShell)
1113 {
1114 ScDocument& rDoc = pDocShell->GetDocument();
1115 ScRangePairList* pList = bColumn ? rDoc.GetColNameRanges() : rDoc.GetRowNameRanges();
1116 if (pList)
1117 return pList->size();
1118 }
1119 return 0;
1120}
1121
1122uno::Any SAL_CALL ScLabelRangesObj::getByIndex( sal_Int32 nIndex )
1123{
1124 SolarMutexGuard aGuard;
1125 uno::Reference< sheet::XLabelRange > xRange(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex)));
1126 if ( !xRange.is() )
1127 throw lang::IndexOutOfBoundsException();
1128
1129 return uno::Any(xRange);
1130}
1131
1133{
1134 return cppu::UnoType<sheet::XLabelRange>::get(); // must be suitable for getByIndex
1135}
1136
1138{
1139 SolarMutexGuard aGuard;
1140 return ( getCount() != 0 );
1141}
1142
1143/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SCTAB MAXTAB
Definition: address.hxx:70
unotools::WeakReference< AnimationNode > mxParent
SCTAB Tab() const
Definition: address.hxx:283
SCROW Row() const
Definition: address.hxx:274
SCCOL Col() const
Definition: address.hxx:279
really derive cell from range?
Definition: cellsuno.hxx:640
bool CreateNames(const ScRange &rRange, CreateNameFlags nFlags, bool bApi, SCTAB nTab=-1)
Definition: docfunc.cxx:5274
void SetNewRangeNames(std::unique_ptr< ScRangeName > pNewRanges, bool bModifyDoc, SCTAB nTab)
Definition: docfunc.cxx:5142
bool InsertNameList(const ScAddress &rStartPos, bool bApi)
Definition: docfunc.cxx:5363
void SetDocumentModified()
Definition: docsh.cxx:2982
const ScDocument & GetDocument() const
Definition: docsh.hxx:219
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
Definition: docsh3.cxx:101
ScDocFunc & GetDocFunc()
Definition: docsh.hxx:221
SC_DLLPUBLIC bool GetTable(const OUString &rName, SCTAB &rTab) const
Definition: document.cxx:244
SC_DLLPUBLIC void CompileHybridFormula()
Call this immediately after updating named ranges.
Definition: document10.cxx:319
ScRangePairList * GetRowNameRanges()
Definition: document.hxx:820
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:892
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:893
SC_DLLPUBLIC sal_Int16 GetNamedRangesLockCount() const
Definition: document.hxx:1608
SC_DLLPUBLIC void PreprocessRangeNameUpdate()
Definition: document10.cxx:295
ScRangePairListRef & GetRowNameRangesRef()
Definition: document.hxx:822
void AddUnoObject(SfxListener &rObject)
Definition: documen3.cxx:901
ScRangePairList * GetColNameRanges()
Definition: document.hxx:819
ScRangePairListRef & GetColNameRangesRef()
Definition: document.hxx:821
void SetNamedRangesLockCount(sal_Int16 nCount)
Definition: document.hxx:1609
SC_DLLPUBLIC ScRangeName * GetRangeName(SCTAB nTab) const
Definition: documen3.cxx:171
void RemoveUnoObject(SfxListener &rObject)
Definition: documen3.cxx:909
void CompileColRowNameFormula()
Definition: documen4.cxx:564
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:297
virtual ~ScGlobalNamedRangesObj() override
Definition: nameuno.cxx:774
virtual ScRangeName * GetRangeName_Impl() override
Definition: nameuno.cxx:808
virtual rtl::Reference< ScNamedRangeObj > GetObjectByName_Impl(const OUString &aName) override
Definition: nameuno.cxx:801
ScGlobalNamedRangesObj(ScDocShell *pDocSh)
Definition: nameuno.cxx:768
virtual SCTAB GetTab_Impl() override
Definition: nameuno.cxx:813
virtual rtl::Reference< ScNamedRangeObj > GetObjectByIndex_Impl(sal_uInt16 nIndex) override
Definition: nameuno.cxx:779
static SC_DLLPUBLIC const CharClass & getCharClass()
Definition: global.cxx:1064
ScRange aRange
criterion to find range
Definition: nameuno.hxx:249
virtual void SAL_CALL setDataArea(const css::table::CellRangeAddress &aDataArea) override
Definition: nameuno.cxx:985
virtual css::table::CellRangeAddress SAL_CALL getLabelArea() override
XLabelRange.
Definition: nameuno.cxx:957
virtual ~ScLabelRangeObj() override
Definition: nameuno.cxx:887
virtual css::table::CellRangeAddress SAL_CALL getDataArea() override
Definition: nameuno.cxx:975
ScLabelRangeObj(ScDocShell *pDocSh, bool bCol, const ScRange &rR)
Definition: nameuno.cxx:879
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: nameuno.cxx:895
ScDocShell * pDocShell
Definition: nameuno.hxx:247
virtual void SAL_CALL setLabelArea(const css::table::CellRangeAddress &aLabelArea) override
Definition: nameuno.cxx:967
void Modify_Impl(const ScRange *pLabel, const ScRange *pData)
Definition: nameuno.cxx:918
ScRangePair * GetData_Impl()
Definition: nameuno.cxx:905
rtl::Reference< ScLabelRangeObj > GetObjectByIndex_Impl(size_t nIndex)
Definition: nameuno.cxx:1020
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: nameuno.cxx:1008
virtual sal_Int32 SAL_CALL getCount() override
XIndexAccess.
Definition: nameuno.cxx:1109
ScLabelRangesObj(ScDocShell *pDocSh, bool bCol)
Definition: nameuno.cxx:993
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
XEnumerationAccess.
Definition: nameuno.cxx:1101
virtual sal_Bool SAL_CALL hasElements() override
Definition: nameuno.cxx:1137
virtual void SAL_CALL removeByIndex(sal_Int32 nIndex) override
Definition: nameuno.cxx:1067
virtual css::uno::Type SAL_CALL getElementType() override
XElementAccess.
Definition: nameuno.cxx:1132
virtual void SAL_CALL addNew(const css::table::CellRangeAddress &aLabelArea, const css::table::CellRangeAddress &aDataArea) override
XLabelRanges.
Definition: nameuno.cxx:1035
virtual ~ScLabelRangesObj() override
Definition: nameuno.cxx:1000
ScDocShell * pDocShell
Definition: nameuno.hxx:280
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: nameuno.cxx:1122
virtual ~ScLocalNamedRangesObj() override
Definition: nameuno.cxx:825
virtual rtl::Reference< ScNamedRangeObj > GetObjectByIndex_Impl(sal_uInt16 nIndex) override
Definition: nameuno.cxx:838
virtual SCTAB GetTab_Impl() override
Definition: nameuno.cxx:872
virtual ScRangeName * GetRangeName_Impl() override
Definition: nameuno.cxx:866
css::uno::Reference< css::container::XNamed > mxSheet
Definition: nameuno.hxx:235
ScLocalNamedRangesObj(ScDocShell *pDocSh, css::uno::Reference< css::container::XNamed > xNamed)
Definition: nameuno.cxx:818
virtual rtl::Reference< ScNamedRangeObj > GetObjectByName_Impl(const OUString &aName) override
Definition: nameuno.cxx:830
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
XPropertySet.
Definition: nameuno.cxx:362
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: nameuno.cxx:417
ScDocShell * pDocShell
Definition: nameuno.hxx:54
virtual void SAL_CALL setName(const OUString &aName) override
Definition: nameuno.cxx:219
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: nameuno.cxx:102
ScNamedRangeObj(rtl::Reference< ScNamedRangesObj > xParent, ScDocShell *pDocSh, OUString aNm, css::uno::Reference< css::container::XNamed > const &xSheet=css::uno::Reference< css::container::XNamed >())
Definition: nameuno.cxx:85
virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getReferredCells() override
XCellRangeReferrer.
Definition: nameuno.cxx:343
rtl::Reference< ScNamedRangesObj > mxParent
Definition: nameuno.hxx:53
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: nameuno.cxx:368
virtual void SAL_CALL setType(sal_Int32 nType) override
Definition: nameuno.cxx:300
void Modify_Impl(const OUString *pNewName, const ScTokenArray *pNewTokens, const OUString *pNewContent, const ScAddress *pNewPos, const ScRangeData::Type *pNewType, const formula::FormulaGrammar::Grammar eGrammar)
Definition: nameuno.cxx:152
virtual css::uno::Sequence< css::sheet::FormulaToken > SAL_CALL getTokens() override
XFormulaTokens.
Definition: nameuno.cxx:315
virtual void SAL_CALL setContent(const OUString &aContent) override
Definition: nameuno.cxx:243
virtual css::table::CellAddress SAL_CALL getReferencePosition() override
Definition: nameuno.cxx:251
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: nameuno.cxx:377
ScRangeData * GetRangeData_Impl()
Definition: nameuno.cxx:112
virtual OUString SAL_CALL getContent() override
XNamedRange.
Definition: nameuno.cxx:232
virtual ~ScNamedRangeObj() override
Definition: nameuno.cxx:94
virtual void SAL_CALL setTokens(const css::uno::Sequence< css::sheet::FormulaToken > &aTokens) override
Definition: nameuno.cxx:329
OUString aName
Definition: nameuno.hxx:55
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: nameuno.cxx:412
virtual sal_Int32 SAL_CALL getType() override
Definition: nameuno.cxx:284
css::uno::Reference< css::container::XNamed > mxSheet
Definition: nameuno.hxx:56
SCTAB GetTab_Impl()
Definition: nameuno.cxx:133
virtual OUString SAL_CALL getName() override
XNamed.
Definition: nameuno.cxx:213
virtual void SAL_CALL setReferencePosition(const css::table::CellAddress &aReferencePosition) override
Definition: nameuno.cxx:276
virtual ~ScNamedRangesObj() override
Definition: nameuno.cxx:429
virtual void SAL_CALL outputList(const css::table::CellAddress &aOutputPosition) override
Definition: nameuno.cxx:553
virtual void SAL_CALL addNewFromTitles(const css::table::CellRangeAddress &aSource, css::sheet::Border aBorder) override
Definition: nameuno.cxx:505
virtual void SAL_CALL setActionLocks(sal_Int16 nLock) override
Definition: nameuno.cxx:736
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: nameuno.cxx:437
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
Definition: nameuno.cxx:648
virtual ScRangeName * GetRangeName_Impl()=0
virtual sal_Bool SAL_CALL isActionLocked() override
XActionLockable.
Definition: nameuno.cxx:701
ScDocShell * pDocShell
Definition: nameuno.hxx:140
virtual void SAL_CALL removeActionLock() override
Definition: nameuno.cxx:720
virtual SCTAB GetTab_Impl()=0
virtual void SAL_CALL addNewByName(const OUString &aName, const OUString &aContent, const css::table::CellAddress &aPosition, sal_Int32 nType) override
XNamedRanges.
Definition: nameuno.cxx:449
virtual void SAL_CALL addActionLock() override
Definition: nameuno.cxx:707
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
XPropertySet.
Definition: nameuno.cxx:609
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
Definition: nameuno.cxx:671
virtual sal_Int16 SAL_CALL resetActionLocks() override
Definition: nameuno.cxx:755
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: nameuno.cxx:588
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: nameuno.cxx:625
virtual sal_Int32 SAL_CALL getCount() override
XIndexAccess.
Definition: nameuno.cxx:571
ScNamedRangesObj(ScDocShell *pDocSh)
Definition: nameuno.cxx:422
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: nameuno.cxx:616
virtual css::uno::Type SAL_CALL getElementType() override
XElementAccess.
Definition: nameuno.cxx:598
void unlock()
called from the XActionLockable interface methods on final unlock
Definition: nameuno.cxx:694
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
XEnumerationAccess.
Definition: nameuno.cxx:563
bool mbModifyAndBroadcast
if true, adding new name or modifying existing one will set the document 'modified' and broadcast the...
Definition: nameuno.hxx:130
virtual rtl::Reference< ScNamedRangeObj > GetObjectByIndex_Impl(sal_uInt16 nIndex)=0
virtual sal_Bool SAL_CALL hasElements() override
Definition: nameuno.cxx:603
void lock()
called from the XActionLockable interface methods on initial locking
Definition: nameuno.cxx:688
virtual void SAL_CALL removeByName(const OUString &aName) override
Definition: nameuno.cxx:529
void GetName(OUString &rName) const
Definition: rangenam.hxx:110
void SetIndex(sal_uInt16 nInd)
Definition: rangenam.hxx:115
const ScAddress & GetPos() const
Definition: rangenam.hxx:113
Type GetType() const
Definition: rangenam.hxx:125
sal_uInt16 GetIndex() const
Definition: rangenam.hxx:116
void ValidateTabRefs()
Definition: rangenam.cxx:535
static SC_DLLPUBLIC IsNameValidType IsNameValid(const OUString &rName, const ScDocument &rDoc)
Definition: rangenam.cxx:468
SC_DLLPUBLIC OUString GetSymbol(const formula::FormulaGrammar::Grammar eGrammar=formula::FormulaGrammar::GRAM_DEFAULT) const
Definition: rangenam.cxx:244
SC_DLLPUBLIC ScRangeData * findByUpperName(const OUString &rName)
Definition: rangenam.cxx:704
ScRangePair * Find(const ScAddress &)
Definition: rangelst.cxx:1279
ScRangePairList * Clone() const
Definition: rangelst.cxx:1299
size_t size() const
Definition: rangelst.cxx:1224
const ScRange & GetRange(sal_uInt16 n) const
Definition: address.hxx:810
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
static SC_DLLPUBLIC void ConvertToTokenSequence(const ScDocument &rDoc, css::uno::Sequence< css::sheet::FormulaToken > &rSequence, const ScTokenArray &rTokenArray)
Definition: tokenuno.cxx:380
static SC_DLLPUBLIC bool ConvertToTokenArray(ScDocument &rDoc, ScTokenArray &rTokenArray, const css::uno::Sequence< css::sheet::FormulaToken > &rSequence)
Definition: tokenuno.cxx:374
static void FillScRange(ScRange &rScRange, const css::table::CellRangeAddress &rApiRange)
Definition: convuno.hxx:79
static void FillApiRange(css::table::CellRangeAddress &rApiRange, const ScRange &rScRange)
Definition: convuno.hxx:87
SfxHintId GetId() const
const OUString & GetName() const
css::uno::Type const & get()
float u
OUString sName
sal_Int32 nIndex
OUString aName
sal_uInt16 nPos
Sequence< sal_Int8 > aSeq
std::unique_ptr< sal_Int32[]> pData
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
Definition: miscuno.hxx:63
#define SC_IMPL_DUMMY_PROPERTY_LISTENER(ClassName)
Definition: miscuno.hxx:72
size
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
long Long
static o3tl::span< const SfxItemPropertyMapEntry > lcl_GetNamedRangesMap()
Definition: nameuno.cxx:63
static o3tl::span< const SfxItemPropertyMapEntry > lcl_GetNamedRangeMap()
Definition: nameuno.cxx:51
static bool lcl_UserVisibleName(const ScRangeData &rData)
Definition: nameuno.cxx:78
constexpr OUStringLiteral SCNAMEDRANGEOBJ_SERVICE
Definition: nameuno.cxx:72
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:398
CreateNameFlags
Definition: scui_def.hxx:50
@ COLUMN_HEADER
Definition: tabview.hxx:59
@ ROW_HEADER
Definition: tabview.hxx:60
constexpr OUStringLiteral SCLINKTARGET_SERVICE
Definition: targuno.hxx:41
unsigned char sal_Bool
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
constexpr OUStringLiteral SC_UNONAME_TOKENINDEX
Definition: unonames.hxx:326
constexpr OUStringLiteral SC_UNO_LINKDISPBIT
Definition: unonames.hxx:197
constexpr OUStringLiteral SC_UNONAME_ISSHAREDFMLA
Definition: unonames.hxx:327
constexpr OUStringLiteral SC_UNO_MODIFY_BROADCAST
Definition: unonames.hxx:710
constexpr OUStringLiteral SC_UNO_LINKDISPNAME
Definition: unonames.hxx:198