LibreOffice Module sc (master) 1
afmtuno.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 <scitems.hxx>
21#include <editeng/memberids.h>
22#include <osl/diagnose.h>
23#include <svl/poolitem.hxx>
24#include <vcl/svapp.hxx>
25#include <svx/algitem.hxx>
26#include <editeng/boxitem.hxx>
27#include <svx/unomid.hxx>
28#include <unowids.hxx>
29#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
30#include <com/sun/star/table/TableBorder.hpp>
31#include <com/sun/star/table/CellHoriJustify.hpp>
32#include <com/sun/star/table/CellOrientation.hpp>
33#include <com/sun/star/table/TableBorder2.hpp>
34#include <com/sun/star/awt/FontSlant.hpp>
35
36#include <attrib.hxx>
37#include <afmtuno.hxx>
38#include <miscuno.hxx>
39#include <autoform.hxx>
40#include <scdll.hxx>
41#include <unonames.hxx>
42#include <cellsuno.hxx>
43
44using namespace ::com::sun::star;
45
46// an AutoFormat has always 16 entries
47#define SC_AF_FIELD_COUNT 16
48
49// AutoFormat map only for PropertySetInfo without Which-IDs
50
52{
53 static const SfxItemPropertyMapEntry aAutoFormatMap_Impl[] =
54 {
61 };
62 return aAutoFormatMap_Impl;
63}
64
67
69{
70 static const SfxItemPropertyMapEntry aAutoFieldMap_Impl[] =
71 {
119 };
120 return aAutoFieldMap_Impl;
121}
122
123constexpr OUStringLiteral SCAUTOFORMATSOBJ_SERVICE = u"com.sun.star.sheet.TableAutoFormats";
124
125SC_SIMPLE_SERVICE_INFO( ScAutoFormatFieldObj, "ScAutoFormatFieldObj", "com.sun.star.sheet.TableAutoFormatField" )
126SC_SIMPLE_SERVICE_INFO( ScAutoFormatObj, "ScAutoFormatObj", "com.sun.star.sheet.TableAutoFormat" )
128
129static bool lcl_FindAutoFormatIndex( const ScAutoFormat& rFormats, std::u16string_view rName, sal_uInt16& rOutIndex )
130{
131 ScAutoFormat::const_iterator itBeg = rFormats.begin(), itEnd = rFormats.end();
132 for (ScAutoFormat::const_iterator it = itBeg; it != itEnd; ++it)
133 {
134 const ScAutoFormatData *const pEntry = it->second.get();
135 const OUString& aEntryName = pEntry->GetName();
136 if ( aEntryName == rName )
137 {
138 size_t nPos = std::distance(itBeg, it);
139 rOutIndex = nPos;
140 return true;
141 }
142 }
143 return false;
144}
145
147{
150}
151
153{
154}
155
156extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
157ScAutoFormatsObj_get_implementation(css::uno::XComponentContext*, css::uno::Sequence<css::uno::Any> const &)
158{
159 SolarMutexGuard aGuard;
160 ScDLL::Init();
161 return cppu::acquire(new ScAutoFormatsObj);
162}
163
164// XTableAutoFormats
165
167{
169 return new ScAutoFormatObj(nIndex);
170
171 return nullptr; // wrong index
172}
173
175{
176 sal_uInt16 nIndex;
180 return nullptr;
181}
182
183// container::XNameContainer
184
185void SAL_CALL ScAutoFormatsObj::insertByName( const OUString& aName, const uno::Any& aElement )
186{
187 SolarMutexGuard aGuard;
188 bool bDone = false;
189 // Reflection need not be uno::XInterface, can be any interface...
190 uno::Reference< uno::XInterface > xInterface(aElement, uno::UNO_QUERY);
191 if ( xInterface.is() )
192 {
193 ScAutoFormatObj* pFormatObj = comphelper::getFromUnoTunnel<ScAutoFormatObj>( xInterface );
194 if ( pFormatObj && !pFormatObj->IsInserted() )
195 {
197
198 sal_uInt16 nDummy;
199 if (lcl_FindAutoFormatIndex( *pFormats, aName, nDummy ))
200 {
201 throw container::ElementExistException();
202 }
203
204 std::unique_ptr<ScAutoFormatData> pNew(new ScAutoFormatData());
205 pNew->SetName( aName );
206
207 if (pFormats->insert(std::move(pNew)) != pFormats->end())
208 {
210 pFormats->Save();
211
212 sal_uInt16 nNewIndex;
213 if (lcl_FindAutoFormatIndex( *pFormats, aName, nNewIndex ))
214 {
215 pFormatObj->InitFormat( nNewIndex ); // can be used now
216 bDone = true;
217 }
218 }
219 else
220 {
221 OSL_FAIL("AutoFormat could not be inserted");
222 throw uno::RuntimeException();
223 }
224 }
225 }
226
227 if (!bDone)
228 {
229 // other errors are handled above
230 throw lang::IllegalArgumentException();
231 }
232}
233
234void SAL_CALL ScAutoFormatsObj::replaceByName( const OUString& aName, const uno::Any& aElement )
235{
236 SolarMutexGuard aGuard;
239 insertByName( aName, aElement );
240}
241
242void SAL_CALL ScAutoFormatsObj::removeByName( const OUString& aName )
243{
244 SolarMutexGuard aGuard;
246
247 ScAutoFormat::iterator it = pFormats->find(aName);
248 if (it == pFormats->end())
249 {
250 throw container::NoSuchElementException();
251 }
252 pFormats->erase(it);
253
255 pFormats->Save(); // save immediately
256
257}
258
259// container::XEnumerationAccess
260
261uno::Reference<container::XEnumeration> SAL_CALL ScAutoFormatsObj::createEnumeration()
262{
263 SolarMutexGuard aGuard;
264 return new ScIndexEnumeration(this, "com.sun.star.sheet.TableAutoFormatEnumeration");
265}
266
267// container::XIndexAccess
268
269sal_Int32 SAL_CALL ScAutoFormatsObj::getCount()
270{
271 SolarMutexGuard aGuard;
273}
274
275uno::Any SAL_CALL ScAutoFormatsObj::getByIndex( sal_Int32 nIndex )
276{
277 SolarMutexGuard aGuard;
278 uno::Reference< container::XNamed > xFormat(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex)));
279 if (!xFormat.is())
280 throw lang::IndexOutOfBoundsException();
281 return uno::Any(xFormat);
282}
283
285{
286 return cppu::UnoType<container::XNamed>::get(); // must match getByIndex
287}
288
290{
291 SolarMutexGuard aGuard;
292 return ( getCount() != 0 );
293}
294
295// container::XNameAccess
296
297uno::Any SAL_CALL ScAutoFormatsObj::getByName( const OUString& aName )
298{
299 SolarMutexGuard aGuard;
300 uno::Reference< container::XNamed > xFormat(GetObjectByName_Impl(aName));
301 if (!xFormat.is())
302 throw container::NoSuchElementException();
303 return uno::Any(xFormat);
304}
305
306uno::Sequence<OUString> SAL_CALL ScAutoFormatsObj::getElementNames()
307{
308 SolarMutexGuard aGuard;
310 uno::Sequence<OUString> aSeq(pFormats->size());
311 OUString* pAry = aSeq.getArray();
312 size_t i = 0;
313 for (const auto& rEntry : *pFormats)
314 {
315 pAry[i] = rEntry.second->GetName();
316 ++i;
317 }
318 return aSeq;
319}
320
321sal_Bool SAL_CALL ScAutoFormatsObj::hasByName( const OUString& aName )
322{
323 SolarMutexGuard aGuard;
324 sal_uInt16 nDummy;
327}
328
330 aPropSet( lcl_GetAutoFormatMap() ),
331 nFormatIndex( nIndex )
332{
333}
334
336{
337 // If an AutoFormat object is released, then eventually changes are saved
338 // so that they become visible in e.g Writer
339
340 if (IsInserted())
341 {
343 if ( pFormats && pFormats->IsSaveLater() )
344 pFormats->Save();
345
346 // Save() resets flag SaveLater
347 }
348}
349
350void ScAutoFormatObj::InitFormat( sal_uInt16 nNewIndex )
351{
352 OSL_ENSURE( nFormatIndex == SC_AFMTOBJ_INVALID, "ScAutoFormatObj::InitFormat is multiple" );
353 nFormatIndex = nNewIndex;
354}
355
356// XUnoTunnel
357
359
360// XTableAutoFormat
361
363{
366
367 return nullptr;
368}
369
370// container::XEnumerationAccess
371
372uno::Reference<container::XEnumeration> SAL_CALL ScAutoFormatObj::createEnumeration()
373{
374 SolarMutexGuard aGuard;
375 return new ScIndexEnumeration(this, "com.sun.star.sheet.TableAutoFormatEnumeration");
376}
377
378// container::XIndexAccess
379
380sal_Int32 SAL_CALL ScAutoFormatObj::getCount()
381{
382 SolarMutexGuard aGuard;
383 if (IsInserted())
384 return SC_AF_FIELD_COUNT; // always 16 elements
385 else
386 return 0;
387}
388
389uno::Any SAL_CALL ScAutoFormatObj::getByIndex( sal_Int32 nIndex )
390{
391 SolarMutexGuard aGuard;
392
393 if ( nIndex < 0 || nIndex >= getCount() )
394 throw lang::IndexOutOfBoundsException();
395
396 if (IsInserted())
397 return uno::Any(uno::Reference< beans::XPropertySet >(GetObjectByIndex_Impl(static_cast<sal_uInt16>(nIndex))));
398 return uno::Any();
399}
400
402{
403 return cppu::UnoType<beans::XPropertySet>::get(); // must match getByIndex
404}
405
407{
408 SolarMutexGuard aGuard;
409 return ( getCount() != 0 );
410}
411
412// container::XNamed
413
414OUString SAL_CALL ScAutoFormatObj::getName()
415{
416 SolarMutexGuard aGuard;
418 if (IsInserted() && nFormatIndex < pFormats->size())
419 return pFormats->findByIndex(nFormatIndex)->GetName();
420
421 return OUString();
422}
423
424void SAL_CALL ScAutoFormatObj::setName( const OUString& aNewName )
425{
426 SolarMutexGuard aGuard;
428
429 sal_uInt16 nDummy;
430 if (!IsInserted() || nFormatIndex >= pFormats->size() ||
431 lcl_FindAutoFormatIndex( *pFormats, aNewName, nDummy ))
432 {
433 // not inserted or name exists
434 throw uno::RuntimeException();
435 }
436
437 ScAutoFormat::iterator it = pFormats->begin();
438 std::advance(it, nFormatIndex);
439 ScAutoFormatData *const pData = it->second.get();
440 OSL_ENSURE(pData,"AutoFormat data not available");
441
442 std::unique_ptr<ScAutoFormatData> pNew(new ScAutoFormatData(*pData));
443 pNew->SetName( aNewName );
444
445 pFormats->erase(it);
446 it = pFormats->insert(std::move(pNew));
447 if (it != pFormats->end())
448 {
449 ScAutoFormat::iterator itBeg = pFormats->begin();
450 nFormatIndex = std::distance(itBeg, it);
451
453 pFormats->SetSaveLater(true);
454 }
455 else
456 {
457 OSL_FAIL("AutoFormat could not be inserted");
458 nFormatIndex = 0;
459 }
460}
461
462// beans::XPropertySet
463
464uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAutoFormatObj::getPropertySetInfo()
465{
466 SolarMutexGuard aGuard;
467 static uno::Reference< beans::XPropertySetInfo > aRef(new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
468 return aRef;
469}
470
472 const OUString& aPropertyName, const uno::Any& aValue )
473{
474 SolarMutexGuard aGuard;
476 if (!(IsInserted() && nFormatIndex < pFormats->size()))
477 return;
478
480 OSL_ENSURE(pData,"AutoFormat data not available");
481
482 bool bBool;
483 if (aPropertyName == SC_UNONAME_INCBACK && (aValue >>= bBool))
484 pData->SetIncludeBackground( bBool );
485 else if (aPropertyName == SC_UNONAME_INCBORD && (aValue >>= bBool))
486 pData->SetIncludeFrame( bBool );
487 else if (aPropertyName == SC_UNONAME_INCFONT && (aValue >>= bBool))
488 pData->SetIncludeFont( bBool );
489 else if (aPropertyName == SC_UNONAME_INCJUST && (aValue >>= bBool))
490 pData->SetIncludeJustify( bBool );
491 else if (aPropertyName == SC_UNONAME_INCNUM && (aValue >>= bBool))
492 pData->SetIncludeValueFormat( bBool );
493 else if (aPropertyName == SC_UNONAME_INCWIDTH && (aValue >>= bBool))
494 pData->SetIncludeWidthHeight( bBool );
495
496 // else error
497
499 pFormats->SetSaveLater(true);
500}
501
502uno::Any SAL_CALL ScAutoFormatObj::getPropertyValue( const OUString& aPropertyName )
503{
504 SolarMutexGuard aGuard;
505 uno::Any aAny;
506
508 if (IsInserted() && nFormatIndex < pFormats->size())
509 {
511 OSL_ENSURE(pData,"AutoFormat data not available");
512
513 bool bValue;
514 bool bError = false;
515
516 if (aPropertyName == SC_UNONAME_INCBACK)
517 bValue = pData->GetIncludeBackground();
518 else if (aPropertyName == SC_UNONAME_INCBORD)
519 bValue = pData->GetIncludeFrame();
520 else if (aPropertyName == SC_UNONAME_INCFONT)
521 bValue = pData->GetIncludeFont();
522 else if (aPropertyName == SC_UNONAME_INCJUST)
523 bValue = pData->GetIncludeJustify();
524 else if (aPropertyName == SC_UNONAME_INCNUM)
525 bValue = pData->GetIncludeValueFormat();
526 else if (aPropertyName == SC_UNONAME_INCWIDTH)
527 bValue = pData->GetIncludeWidthHeight();
528 else
529 bError = true; // unknown property
530
531 if (!bError)
532 aAny <<= bValue;
533 }
534
535 return aAny;
536}
537
539
540ScAutoFormatFieldObj::ScAutoFormatFieldObj(sal_uInt16 nFormat, sal_uInt16 nField) :
541 aPropSet( lcl_GetAutoFieldMap() ),
542 nFormatIndex( nFormat ),
543 nFieldIndex( nField )
544{
545}
546
548{
549}
550
551// beans::XPropertySet
552
553uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAutoFormatFieldObj::getPropertySetInfo()
554{
555 SolarMutexGuard aGuard;
556 static uno::Reference< beans::XPropertySetInfo > aRef(new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
557 return aRef;
558}
559
561 const OUString& aPropertyName, const uno::Any& aValue )
562{
563 SolarMutexGuard aGuard;
565 const SfxItemPropertyMapEntry* pEntry =
566 aPropSet.getPropertyMap().getByName( aPropertyName );
567
568 if ( !(pEntry && pEntry->nWID && nFormatIndex < pFormats->size()) )
569 return;
570
572
573 if ( IsScItemWid( pEntry->nWID ) )
574 {
575 if( const SfxPoolItem* pItem = pData->GetItem( nFieldIndex, pEntry->nWID ) )
576 {
577 bool bDone = false;
578
579 switch( pEntry->nWID )
580 {
581 case ATTR_STACKED:
582 {
583 table::CellOrientation eOrient;
584 if( aValue >>= eOrient )
585 {
586 switch( eOrient )
587 {
588 case table::CellOrientation_STANDARD:
589 pData->PutItem( nFieldIndex, ScVerticalStackCell( false ) );
590 break;
591 case table::CellOrientation_TOPBOTTOM:
592 pData->PutItem( nFieldIndex, ScVerticalStackCell( false ) );
593 pData->PutItem( nFieldIndex, ScRotateValueItem( 27000_deg100 ) );
594 break;
595 case table::CellOrientation_BOTTOMTOP:
596 pData->PutItem( nFieldIndex, ScVerticalStackCell( false ) );
597 pData->PutItem( nFieldIndex, ScRotateValueItem( 9000_deg100 ) );
598 break;
599 case table::CellOrientation_STACKED:
600 pData->PutItem( nFieldIndex, ScVerticalStackCell( true ) );
601 break;
602 default:
603 {
604 // added to avoid warnings
605 }
606 }
607 bDone = true;
608 }
609 }
610 break;
611 default:
612 std::unique_ptr<SfxPoolItem> pNewItem(pItem->Clone());
613 bDone = pNewItem->PutValue( aValue, pEntry->nMemberId );
614 if (bDone)
615 pData->PutItem( nFieldIndex, *pNewItem );
616 }
617
618 if (bDone)
620 pFormats->SetSaveLater(true);
621 }
622 }
623 else
624 {
625 switch (pEntry->nWID)
626 {
628 {
629 table::TableBorder aBorder;
630 if ( aValue >>= aBorder ) // empty = nothing to do
631 {
632 SvxBoxItem aOuter(ATTR_BORDER);
634 ScHelperFunctions::FillBoxItems( aOuter, aInner, aBorder );
635 pData->PutItem( nFieldIndex, aOuter );
636
638 pFormats->SetSaveLater(true);
639 }
640 }
641 break;
643 {
644 table::TableBorder2 aBorder2;
645 if ( aValue >>= aBorder2 ) // empty = nothing to do
646 {
647 SvxBoxItem aOuter(ATTR_BORDER);
649 ScHelperFunctions::FillBoxItems( aOuter, aInner, aBorder2 );
650 pData->PutItem( nFieldIndex, aOuter );
651
653 pFormats->SetSaveLater(true);
654 }
655 }
656 break;
657 }
658 }
659}
660
661uno::Any SAL_CALL ScAutoFormatFieldObj::getPropertyValue( const OUString& aPropertyName )
662{
663 SolarMutexGuard aGuard;
664 uno::Any aVal;
665
667 const SfxItemPropertyMapEntry* pEntry =
668 aPropSet.getPropertyMap().getByName( aPropertyName );
669
670 if ( pEntry && pEntry->nWID && nFormatIndex < pFormats->size() )
671 {
673
674 if ( IsScItemWid( pEntry->nWID ) )
675 {
676 if( const SfxPoolItem* pItem = pData->GetItem( nFieldIndex, pEntry->nWID ) )
677 {
678 switch( pEntry->nWID )
679 {
680 case ATTR_STACKED:
681 {
682 const ScRotateValueItem* pRotItem = pData->GetItem( nFieldIndex, ATTR_ROTATE_VALUE );
683 Degree100 nRot = pRotItem ? pRotItem->GetValue() : 0_deg100;
684 bool bStacked = static_cast<const ScVerticalStackCell*>(pItem)->GetValue();
686 }
687 break;
688 default:
689 pItem->QueryValue( aVal, pEntry->nMemberId );
690 }
691 }
692 }
693 else
694 {
695 switch (pEntry->nWID)
696 {
699 {
700 const SfxPoolItem* pItem = pData->GetItem(nFieldIndex, ATTR_BORDER);
701 if (pItem)
702 {
703 SvxBoxItem aOuter(*static_cast<const SvxBoxItem*>(pItem));
705
706 if (pEntry->nWID == SC_WID_UNO_TBLBORD2)
707 ScHelperFunctions::AssignTableBorder2ToAny( aVal, aOuter, aInner);
708 else
709 ScHelperFunctions::AssignTableBorderToAny( aVal, aOuter, aInner);
710 }
711 }
712 break;
713 }
714 }
715 }
716
717 return aVal;
718}
719
721
722/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static o3tl::span< const SfxItemPropertyMapEntry > lcl_GetAutoFieldMap()
number format (String/Language) ??? (in XNumberFormat only ReadOnly) table::TableBorder ?...
Definition: afmtuno.cxx:68
constexpr OUStringLiteral SCAUTOFORMATSOBJ_SERVICE
Definition: afmtuno.cxx:123
UNO3_GETIMPLEMENTATION_IMPL(ScAutoFormatObj)
#define SC_AF_FIELD_COUNT
Definition: afmtuno.cxx:47
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * ScAutoFormatsObj_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
Definition: afmtuno.cxx:157
static o3tl::span< const SfxItemPropertyMapEntry > lcl_GetAutoFormatMap()
Definition: afmtuno.cxx:51
static bool lcl_FindAutoFormatIndex(const ScAutoFormat &rFormats, std::u16string_view rName, sal_uInt16 &rOutIndex)
Definition: afmtuno.cxx:129
#define SC_AFMTOBJ_INVALID
Definition: afmtuno.hxx:39
const OUString & GetName() const
Definition: autoform.hxx:140
sal_uInt16 nFieldIndex
Definition: afmtuno.hxx:161
sal_uInt16 nFormatIndex
Definition: afmtuno.hxx:160
virtual ~ScAutoFormatFieldObj() override
Definition: afmtuno.cxx:547
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: afmtuno.cxx:661
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: afmtuno.cxx:560
SfxItemPropertySet aPropSet
Definition: afmtuno.hxx:159
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: afmtuno.cxx:553
rtl::Reference< ScAutoFormatFieldObj > GetObjectByIndex_Impl(sal_uInt16 nIndex)
Definition: afmtuno.cxx:362
ScAutoFormatObj(sal_uInt16 nIndex)
Definition: afmtuno.cxx:329
virtual ~ScAutoFormatObj() override
Definition: afmtuno.cxx:335
virtual sal_Int32 SAL_CALL getCount() override
Definition: afmtuno.cxx:380
virtual OUString SAL_CALL getName() override
Definition: afmtuno.cxx:414
bool IsInserted() const
Definition: afmtuno.hxx:106
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: afmtuno.cxx:372
virtual void SAL_CALL setName(const OUString &aName) override
Definition: afmtuno.cxx:424
virtual sal_Bool SAL_CALL hasElements() override
Definition: afmtuno.cxx:406
virtual css::uno::Type SAL_CALL getElementType() override
Definition: afmtuno.cxx:401
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: afmtuno.cxx:471
void InitFormat(sal_uInt16 nNewIndex)
Definition: afmtuno.cxx:350
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: afmtuno.cxx:502
SfxItemPropertySet aPropSet
Definition: afmtuno.hxx:96
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: afmtuno.cxx:389
sal_uInt16 nFormatIndex
Definition: afmtuno.hxx:97
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: afmtuno.cxx:464
bool Save()
Definition: autoform.cxx:889
void SetSaveLater(bool bSet)
Definition: autoform.cxx:757
MapType::const_iterator const_iterator
Definition: autoform.hxx:190
const_iterator begin() const
Definition: autoform.cxx:803
iterator insert(std::unique_ptr< ScAutoFormatData > pNew)
Definition: autoform.cxx:787
const ScAutoFormatData * findByIndex(size_t nIndex) const
Definition: autoform.cxx:762
void erase(const iterator &it)
Definition: autoform.cxx:793
const_iterator end() const
Definition: autoform.cxx:808
bool IsSaveLater() const
Definition: autoform.hxx:198
size_t size() const
Definition: autoform.cxx:798
MapType::iterator iterator
Definition: autoform.hxx:191
iterator find(const OUString &rName)
Definition: autoform.cxx:782
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: afmtuno.cxx:261
static rtl::Reference< ScAutoFormatObj > GetObjectByIndex_Impl(sal_uInt16 nIndex)
Definition: afmtuno.cxx:166
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: afmtuno.cxx:275
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
Definition: afmtuno.cxx:306
virtual css::uno::Type SAL_CALL getElementType() override
Definition: afmtuno.cxx:284
virtual sal_Bool SAL_CALL hasElements() override
Definition: afmtuno.cxx:289
virtual void SAL_CALL replaceByName(const OUString &aName, const css::uno::Any &aElement) override
Definition: afmtuno.cxx:234
virtual sal_Int32 SAL_CALL getCount() override
Definition: afmtuno.cxx:269
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
Definition: afmtuno.cxx:321
virtual ~ScAutoFormatsObj() override
Definition: afmtuno.cxx:152
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
Definition: afmtuno.cxx:297
virtual void SAL_CALL insertByName(const OUString &aName, const css::uno::Any &aElement) override
Definition: afmtuno.cxx:185
virtual void SAL_CALL removeByName(const OUString &Name) override
Definition: afmtuno.cxx:242
static rtl::Reference< ScAutoFormatObj > GetObjectByName_Impl(std::u16string_view aName)
Definition: afmtuno.cxx:174
static SC_DLLPUBLIC void Init()
DLL-init/exit-code must be linked to the DLL only.
Definition: scdll.cxx:100
static SC_DLLPUBLIC ScAutoFormat * GetOrCreateAutoFormat()
Definition: global.cxx:266
static SC_DLLPUBLIC ScAutoFormat * GetAutoFormat()
Definition: global.cxx:261
static void AssignTableBorder2ToAny(css::uno::Any &rAny, const SvxBoxItem &rOuter, const SvxBoxInfoItem &rInner, bool bInvalidateHorVerDist=false)
Definition: cellsuno.cxx:1019
static void FillBoxItems(SvxBoxItem &rOuter, SvxBoxInfoItem &rInner, const css::table::TableBorder &rBorder)
static void AssignTableBorderToAny(css::uno::Any &rAny, const SvxBoxItem &rOuter, const SvxBoxInfoItem &rInner, bool bInvalidateHorVerDist=false)
Definition: cellsuno.cxx:1011
Degree100 GetValue() const
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
const SfxItemPropertyMap & getPropertyMap() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
css::uno::Type const & get()
float u
sal_Int32 nIndex
OUString aName
sal_uInt16 nPos
Sequence< sal_Int8 > aSeq
#define MID_BACK_COLOR
#define MID_FONT_PITCH
#define MID_FONT_CHAR_SET
#define MID_POSTURE
#define MID_FONTHEIGHT
#define MID_FONT_FAMILY
#define MID_CROSSED_OUT
#define MID_WEIGHT
#define MID_TL_STYLE
#define MID_GRAPHIC_TRANSPARENT
#define MID_FONT_FAMILY_NAME
#define MID_FONT_STYLE_NAME
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
int i
const char GetValue[]
#define CONVERT_TWIPS
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
constexpr TypedWhichId< SvxFontItem > ATTR_CJK_FONT(111)
constexpr TypedWhichId< SvxPostureItem > ATTR_CTL_FONT_POSTURE(119)
constexpr TypedWhichId< SvxFontItem > ATTR_CTL_FONT(116)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CJK_FONT_HEIGHT(112)
constexpr TypedWhichId< SvxPostureItem > ATTR_FONT_POSTURE(103)
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
constexpr TypedWhichId< SvxColorItem > ATTR_FONT_COLOR(109)
constexpr TypedWhichId< SvxWeightItem > ATTR_CJK_FONT_WEIGHT(113)
constexpr TypedWhichId< SvxShadowedItem > ATTR_FONT_SHADOWED(108)
constexpr TypedWhichId< SvxContourItem > ATTR_FONT_CONTOUR(107)
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
constexpr TypedWhichId< SvxOverlineItem > ATTR_FONT_OVERLINE(105)
constexpr TypedWhichId< ScRotateValueItem > ATTR_ROTATE_VALUE(135)
constexpr TypedWhichId< SvxJustifyMethodItem > ATTR_VER_JUSTIFY_METHOD(133)
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
constexpr TypedWhichId< SvxBoxInfoItem > ATTR_BORDER_INNER(151)
constexpr TypedWhichId< SvxRotateModeItem > ATTR_ROTATE_MODE(136)
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
constexpr TypedWhichId< SvxJustifyMethodItem > ATTR_HOR_JUSTIFY_METHOD(130)
constexpr TypedWhichId< SvxCrossedOutItem > ATTR_FONT_CROSSEDOUT(106)
constexpr TypedWhichId< SvxMarginItem > ATTR_MARGIN(143)
constexpr TypedWhichId< ScVerticalStackCell > ATTR_STACKED(134)
constexpr TypedWhichId< SvxVerJustifyItem > ATTR_VER_JUSTIFY(132)
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
constexpr TypedWhichId< SvxWeightItem > ATTR_CTL_FONT_WEIGHT(118)
constexpr TypedWhichId< ScLineBreakCell > ATTR_LINEBREAK(139)
constexpr TypedWhichId< SvxPostureItem > ATTR_CJK_FONT_POSTURE(114)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CTL_FONT_HEIGHT(117)
constexpr TypedWhichId< SvxUnderlineItem > ATTR_FONT_UNDERLINE(104)
char aEntryName[20]
unsigned char sal_Bool
#define MID_MARGIN_LO_MARGIN
#define MID_MARGIN_R_MARGIN
#define MID_MARGIN_L_MARGIN
#define MID_MARGIN_UP_MARGIN
#define SC_UNO_CTL_CFNAME
Definition: unonames.hxx:87
#define SC_UNONAME_CUNDER
Definition: unonames.hxx:54
#define SC_UNONAME_ROTANG
Definition: unonames.hxx:118
#define SC_UNONAME_ROTREF
Definition: unonames.hxx:119
#define SC_UNONAME_INCNUM
Definition: unonames.hxx:224
#define SC_UNONAME_CELLVJUS
Definition: unonames.hxx:103
#define SC_UNONAME_CCOLOR
Definition: unonames.hxx:52
#define SC_UNO_CJK_CFPITCH
Definition: unonames.hxx:81
#define SC_UNONAME_TBLBORD
Definition: unonames.hxx:110
#define SC_UNO_CJK_CFSTYLE
Definition: unonames.hxx:78
#define SC_UNONAME_CPOST
Definition: unonames.hxx:61
#define SC_UNONAME_PBMARGIN
Definition: unonames.hxx:115
#define SC_UNONAME_COUTL
Definition: unonames.hxx:67
#define SC_UNONAME_INCJUST
Definition: unonames.hxx:223
#define SC_UNO_CJK_CFCHARS
Definition: unonames.hxx:80
#define SC_UNONAME_CCROSS
Definition: unonames.hxx:62
#define SC_UNONAME_CFSTYLE
Definition: unonames.hxx:70
#define SC_UNONAME_PTMARGIN
Definition: unonames.hxx:114
#define SC_UNONAME_INCFONT
Definition: unonames.hxx:222
#define SC_UNO_CJK_CHEIGHT
Definition: unonames.hxx:82
#define SC_UNO_CJK_CWEIGHT
Definition: unonames.hxx:83
#define SC_UNONAME_CFCHARS
Definition: unonames.hxx:72
#define SC_UNO_CTL_CFSTYLE
Definition: unonames.hxx:88
#define SC_UNO_CJK_CFFAMIL
Definition: unonames.hxx:79
#define SC_UNONAME_CELLHJUS
Definition: unonames.hxx:102
#define SC_UNO_CTL_CWEIGHT
Definition: unonames.hxx:93
#define SC_UNO_CJK_CFNAME
Definition: unonames.hxx:77
#define SC_UNO_CTL_CFFAMIL
Definition: unonames.hxx:89
#define SC_UNONAME_CWEIGHT
Definition: unonames.hxx:60
#define SC_UNONAME_WRAP
Definition: unonames.hxx:112
#define SC_UNONAME_CFONT
Definition: unonames.hxx:66
#define SC_UNONAME_CHEIGHT
Definition: unonames.hxx:53
#define SC_UNONAME_CELLHJUS_METHOD
Definition: unonames.hxx:104
#define SC_UNONAME_CFFAMIL
Definition: unonames.hxx:71
#define SC_UNO_CTL_CFCHARS
Definition: unonames.hxx:90
#define SC_UNONAME_CELLVJUS_METHOD
Definition: unonames.hxx:105
#define SC_UNONAME_CFNAME
Definition: unonames.hxx:69
#define SC_UNO_CJK_CPOST
Definition: unonames.hxx:84
#define SC_UNONAME_INCWIDTH
Definition: unonames.hxx:225
#define SC_UNONAME_CELLBACK
Definition: unonames.hxx:99
#define SC_UNONAME_CELLTRAN
Definition: unonames.hxx:100
#define SC_UNONAME_INCBACK
Definition: unonames.hxx:220
#define SC_UNONAME_PRMARGIN
Definition: unonames.hxx:117
#define SC_UNO_CTL_CHEIGHT
Definition: unonames.hxx:92
#define SC_UNONAME_CSHADD
Definition: unonames.hxx:65
#define SC_UNO_CTL_CFPITCH
Definition: unonames.hxx:91
#define SC_UNO_CTL_CPOST
Definition: unonames.hxx:94
#define SC_UNONAME_INCBORD
Definition: unonames.hxx:221
#define SC_UNONAME_COVER
Definition: unonames.hxx:57
#define SC_UNONAME_PLMARGIN
Definition: unonames.hxx:116
#define SC_UNONAME_CELLORI
Definition: unonames.hxx:106
#define SC_UNONAME_CFPITCH
Definition: unonames.hxx:73
#define SC_UNONAME_TBLBORD2
Definition: unonames.hxx:111
#define SC_WID_UNO_TBLBORD2
Definition: unowids.hxx:72
#define SC_WID_UNO_TBLBORD
Definition: unowids.hxx:35
bool IsScItemWid(sal_uInt16 nWid)
Definition: unowids.hxx:84