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