LibreOffice Module sc (master)  1
styleuno.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 <svx/algitem.hxx>
23 #include <editeng/boxitem.hxx>
24 #include <editeng/langitem.hxx>
25 #include <editeng/numitem.hxx>
26 #include <svx/pageitem.hxx>
27 #include <editeng/pbinitem.hxx>
28 #include <svx/unomid.hxx>
29 #include <editeng/unonrule.hxx>
30 #include <sfx2/bindings.hxx>
31 #include <sfx2/printer.hxx>
32 #include <sfx2/sfxsids.hrc>
33 #include <vcl/virdev.hxx>
34 #include <vcl/svapp.hxx>
35 #include <svl/itempool.hxx>
36 #include <svl/itemset.hxx>
37 #include <svl/numformat.hxx>
38 #include <svl/intitem.hxx>
39 #include <svl/zformat.hxx>
40 #include <tools/fract.hxx>
41 #include <tools/UnitConversion.hxx>
42 #include <osl/diagnose.h>
43 
44 #include <com/sun/star/table/BorderLine.hpp>
45 #include <com/sun/star/table/TableBorder.hpp>
46 #include <com/sun/star/table/TableBorder2.hpp>
47 #include <com/sun/star/table/ShadowFormat.hpp>
48 #include <com/sun/star/table/CellHoriJustify.hpp>
49 #include <com/sun/star/table/CellOrientation.hpp>
50 #include <com/sun/star/style/PageStyleLayout.hpp>
51 #include <com/sun/star/style/GraphicLocation.hpp>
52 #include <com/sun/star/sheet/XHeaderFooterContent.hpp>
53 #include <com/sun/star/util/CellProtection.hpp>
54 #include <com/sun/star/awt/FontSlant.hpp>
55 #include <com/sun/star/awt/Size.hpp>
56 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
57 #include <com/sun/star/lang/Locale.hpp>
58 #include <com/sun/star/beans/PropertyAttribute.hpp>
59 #include <com/sun/star/graphic/XGraphic.hpp>
62 
63 #include <styleuno.hxx>
64 #include <docsh.hxx>
65 #include <attrib.hxx>
66 #include <stlpool.hxx>
67 #include <docpool.hxx>
68 #include <miscuno.hxx>
69 #include <tablink.hxx>
70 #include <unonames.hxx>
71 #include <unowids.hxx>
72 #include <globstr.hrc>
73 #include <scresid.hxx>
74 #include <cellsuno.hxx>
75 #include <stylehelper.hxx>
76 
77 using namespace ::com::sun::star;
78 
80 {
81  static const SfxItemPropertyMapEntry aCellStyleMap_Impl[] =
82  {
134  {u"" SC_UNONAME_DISPNAME, SC_WID_UNO_DISPNAME,::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::READONLY, 0 },
142 // {SC_UNONAME_NUMRULES, SC_WID_UNO_NUMRULES,cppu::UnoType<container::XIndexReplace>::get(), 0, 0 },
171  { u"", 0, css::uno::Type(), 0, 0 }
172  };
173  static SfxItemPropertySet aCellStyleSet_Impl( aCellStyleMap_Impl );
174  return &aCellStyleSet_Impl;
175 }
176 
177 // map with all site attributes including header and footer attributes
178 
180 {
181  static const SfxItemPropertyMapEntry aPageStyleMap_Impl[] =
182  {
196  {u"" SC_UNONAME_DISPNAME, SC_WID_UNO_DISPNAME,::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::READONLY, 0 },
202 
230 
258 
299  { u"", 0, css::uno::Type(), 0, 0 }
300  };
301  static SfxItemPropertySet aPageStyleSet_Impl( aPageStyleMap_Impl );
302  return &aPageStyleSet_Impl;
303 }
304 
305 // map with content of the Header-Item-Sets
306 
308 {
309  static const SfxItemPropertyMapEntry aHeaderStyleMap_Impl[] =
310  {
340  { u"", 0, css::uno::Type(), 0, 0 }
341  };
342  static SfxItemPropertyMap aHeaderStyleMap( aHeaderStyleMap_Impl );
343  return &aHeaderStyleMap;
344 }
345 
346 // map with content of the Footer-Item-Sets
347 
349 {
350  static const SfxItemPropertyMapEntry aFooterStyleMap_Impl[] =
351  {
381  { u"", 0, css::uno::Type(), 0, 0 }
382  };
383  static SfxItemPropertyMap aFooterStyleMap( aFooterStyleMap_Impl );
384  return &aFooterStyleMap;
385 }
386 
387 // access index on the style types: 0 = Cell, 1 = Page
388 
389 #define SC_STYLE_FAMILY_COUNT 2
390 
391 constexpr OUStringLiteral SC_FAMILYNAME_CELL = u"CellStyles";
392 constexpr OUStringLiteral SC_FAMILYNAME_PAGE = u"PageStyles";
393 
394 const SfxStyleFamily aStyleFamilyTypes[SC_STYLE_FAMILY_COUNT] = { SfxStyleFamily::Para, SfxStyleFamily::Page };
395 
396 constexpr OUStringLiteral SCSTYLE_SERVICE = u"com.sun.star.style.Style";
397 constexpr OUStringLiteral SCCELLSTYLE_SERVICE = u"com.sun.star.style.CellStyle";
398 constexpr OUStringLiteral SCPAGESTYLE_SERVICE = u"com.sun.star.style.PageStyle";
399 
400 SC_SIMPLE_SERVICE_INFO( ScStyleFamiliesObj, "ScStyleFamiliesObj", "com.sun.star.style.StyleFamilies" )
401 SC_SIMPLE_SERVICE_INFO( ScStyleFamilyObj, "ScStyleFamilyObj", "com.sun.star.style.StyleFamily" )
402 
403 constexpr OUStringLiteral SC_PAPERBIN_DEFAULTNAME = u"[From printer settings]";
404 
406 {
407  SCTAB nTabCount = rDoc.GetTableCount();
408  for (SCTAB i=0; i<nTabCount; i++)
409  if (rDoc.IsTabProtected(i))
410  return true;
411  return false;
412 }
413 
415  pDocShell( pDocSh )
416 {
418 }
419 
421 {
422  SolarMutexGuard g;
423 
424  if (pDocShell)
426 }
427 
429 {
430  // reference update does not matter here
431 
432  if ( rHint.GetId() == SfxHintId::Dying )
433  {
434  pDocShell = nullptr;
435  }
436 }
437 
438 // XStyleFamilies
439 
441 {
442  if ( pDocShell )
443  {
444  if ( nType == SfxStyleFamily::Para )
445  return new ScStyleFamilyObj( pDocShell, SfxStyleFamily::Para );
446  else if ( nType == SfxStyleFamily::Page )
447  return new ScStyleFamilyObj( pDocShell, SfxStyleFamily::Page );
448  }
449  OSL_FAIL("getStyleFamilyByType: no DocShell or wrong SfxStyleFamily");
450  return nullptr;
451 }
452 
454 {
455  if ( nIndex < SC_STYLE_FAMILY_COUNT )
456  return GetObjectByType_Impl(aStyleFamilyTypes[nIndex]);
457 
458  return nullptr; // invalid index
459 }
460 
462 {
463  if ( pDocShell )
464  {
465  if ( aName == SC_FAMILYNAME_CELL )
466  return new ScStyleFamilyObj( pDocShell, SfxStyleFamily::Para );
467  else if ( aName == SC_FAMILYNAME_PAGE )
468  return new ScStyleFamilyObj( pDocShell, SfxStyleFamily::Page );
469  }
470  // no assertion - called directly from getByName
471  return nullptr;
472 }
473 
474 // container::XIndexAccess
475 
476 sal_Int32 SAL_CALL ScStyleFamiliesObj::getCount()
477 {
478  return SC_STYLE_FAMILY_COUNT;
479 }
480 
481 uno::Any SAL_CALL ScStyleFamiliesObj::getByIndex( sal_Int32 nIndex )
482 {
483  SolarMutexGuard aGuard;
484  uno::Reference< container::XNameContainer > xFamily(GetObjectByIndex_Impl(nIndex));
485  if (!xFamily.is())
486  throw lang::IndexOutOfBoundsException();
487 
488  return uno::makeAny(xFamily);
489 }
490 
492 {
493  SolarMutexGuard aGuard;
494  return cppu::UnoType<container::XNameContainer>::get(); // has to fit to getByIndex
495 }
496 
498 {
499  SolarMutexGuard aGuard;
500  return ( getCount() != 0 );
501 }
502 
503 // container::XNameAccess
504 
505 uno::Any SAL_CALL ScStyleFamiliesObj::getByName( const OUString& aName )
506 {
507  SolarMutexGuard aGuard;
508  uno::Reference< container::XNameContainer > xFamily(GetObjectByName_Impl(aName));
509  if (!xFamily.is())
510  throw container::NoSuchElementException();
511 
512  return uno::makeAny(xFamily);
513 }
514 
515 uno::Sequence<OUString> SAL_CALL ScStyleFamiliesObj::getElementNames()
516 {
518 }
519 
520 sal_Bool SAL_CALL ScStyleFamiliesObj::hasByName( const OUString& aName )
521 {
522  return aName == SC_FAMILYNAME_CELL || aName == SC_FAMILYNAME_PAGE;
523 }
524 
525 // style::XStyleLoader
526 
527 void SAL_CALL ScStyleFamiliesObj::loadStylesFromURL( const OUString& aURL,
528  const uno::Sequence<beans::PropertyValue>& aOptions )
529 {
532 
533  OUString aFilter; // empty - detect
534  OUString aFiltOpt;
535  uno::Reference<io::XInputStream> xInputStream;
536  if (aURL == "private:stream")
537  {
538  for (const auto& rProp : aOptions)
539  {
540  if (rProp.Name == "InputStream")
541  {
542  rProp.Value >>= xInputStream;
543  if (!xInputStream.is())
544  {
545  throw lang::IllegalArgumentException(
546  "Parameter 'InputStream' could not be converted "
547  "to type 'com::sun::star::io::XInputStream'",
548  nullptr, 0);
549  }
550  break;
551  }
552  }
553  }
554 
555  ScDocumentLoader aLoader( aURL, aFilter, aFiltOpt, 0, nullptr, xInputStream );
556 
557  ScDocShell* pSource = aLoader.GetDocShell();
558 
559  loadStylesFromDocShell(pSource, aOptions);
560 }
561 
562 uno::Sequence<beans::PropertyValue> SAL_CALL ScStyleFamiliesObj::getStyleLoaderOptions()
563 {
564  // return defaults for options (?)
566  { SC_UNONAME_OVERWSTL, uno::Any(true) },
567  { SC_UNONAME_LOADCELL, uno::Any(true) },
568  { SC_UNONAME_LOADPAGE, uno::Any(true) }
569  });
570 }
571 
572 // style::XStyleLoader2
573 
574 void SAL_CALL ScStyleFamiliesObj::loadStylesFromDocument( const uno::Reference < lang::XComponent > & aSourceComponent,
575  const uno::Sequence<beans::PropertyValue>& aOptions )
576 {
577  // Source document docShell
578  if ( !aSourceComponent.is() )
579  throw uno::RuntimeException();
580 
581  ScDocShell* pDocShellSrc = dynamic_cast<ScDocShell*> (SfxObjectShell::GetShellFromComponent(aSourceComponent));
582 
583  loadStylesFromDocShell(pDocShellSrc, aOptions);
584 }
585 
586 // private
587 
589  const uno::Sequence<beans::PropertyValue>& aOptions )
590 {
591 
592  if ( !(pSource && pDocShell) )
593  return;
594 
595  // collect options
596 
597  bool bLoadReplace = true; // defaults
598  bool bLoadCellStyles = true;
599  bool bLoadPageStyles = true;
600 
601  for (const beans::PropertyValue& rProp : aOptions)
602  {
603  OUString aPropName(rProp.Name);
604 
605  if (aPropName == SC_UNONAME_OVERWSTL)
606  bLoadReplace = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
607  else if (aPropName == SC_UNONAME_LOADCELL)
608  bLoadCellStyles = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
609  else if (aPropName == SC_UNONAME_LOADPAGE)
610  bLoadPageStyles = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
611  }
612 
613  pDocShell->LoadStylesArgs( *pSource, bLoadReplace, bLoadCellStyles, bLoadPageStyles );
614  pDocShell->SetDocumentModified(); // paint is inside LoadStyles
615 }
616 
618  pDocShell( pDocSh ),
619  eFamily( eFam )
620 {
622 }
623 
625 {
626  SolarMutexGuard g;
627 
628  if (pDocShell)
630 }
631 
633 {
634  // reference update does not matter here
635 
636  if ( rHint.GetId() == SfxHintId::Dying )
637  {
638  pDocShell = nullptr; // has become invalid
639  }
640 }
641 
642 // XStyleFamily
643 
645 {
646  if ( pDocShell )
647  {
648  ScDocument& rDoc = pDocShell->GetDocument();
649  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
650 
651  SfxStyleSheetIterator aIter( pStylePool, eFamily );
652  if ( nIndex < aIter.Count() )
653  {
654  SfxStyleSheetBase* pStyle = aIter[nIndex];
655  if ( pStyle )
656  {
657  return new ScStyleObj( pDocShell, eFamily, pStyle->GetName() );
658  }
659  }
660  }
661  return nullptr;
662 }
663 
665 {
666  if ( pDocShell )
667  {
668  ScDocument& rDoc = pDocShell->GetDocument();
669  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
670  if ( pStylePool->Find( aName, eFamily ) )
671  return new ScStyleObj( pDocShell, eFamily, aName );
672  }
673  return nullptr;
674 }
675 
676 void SAL_CALL ScStyleFamilyObj::insertByName( const OUString& aName, const uno::Any& aElement )
677 {
678  SolarMutexGuard aGuard;
679  bool bDone = false;
680  // reflection does not need to be uno::XInterface, can be any interface...
681  uno::Reference< uno::XInterface > xInterface(aElement, uno::UNO_QUERY);
682  if ( xInterface.is() )
683  {
684  ScStyleObj* pStyleObj = comphelper::getFromUnoTunnel<ScStyleObj>( xInterface );
685  if ( pStyleObj && pStyleObj->GetFamily() == eFamily &&
686  !pStyleObj->IsInserted() ) // not yet inserted?
687  {
688  OUString aNameStr(ScStyleNameConversion::ProgrammaticToDisplayName( aName, eFamily ));
689 
690  ScDocument& rDoc = pDocShell->GetDocument();
691  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
692 
695 
696  if ( pStylePool->Find( aNameStr, eFamily ) ) // not available yet
697  throw container::ElementExistException();
698 
699  (void)pStylePool->Make( aNameStr, eFamily, SfxStyleSearchBits::UserDefined );
700 
701  if ( eFamily == SfxStyleFamily::Para && !rDoc.IsImportingXML() )
702  rDoc.GetPool()->CellStyleCreated( aNameStr, rDoc );
703 
704  pStyleObj->InitDoc( pDocShell, aNameStr ); // object can be used
705 
706  if (!rDoc.IsImportingXML())
707  pDocShell->SetDocumentModified(); // new style not used yet
708  bDone = true;
709 
710  }
711  }
712 
713  if (!bDone)
714  {
715  // other errors are handled above
716  throw lang::IllegalArgumentException();
717  }
718 }
719 
720 void SAL_CALL ScStyleFamilyObj::replaceByName( const OUString& aName, const uno::Any& aElement )
721 {
722  SolarMutexGuard aGuard;
724  removeByName( aName );
725  insertByName( aName, aElement );
726 }
727 
728 void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName )
729 {
730  SolarMutexGuard aGuard;
731  bool bFound = false;
732  if ( pDocShell )
733  {
734  OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, eFamily ));
735 
736  ScDocument& rDoc = pDocShell->GetDocument();
737  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
738 
741 
742  SfxStyleSheetBase* pStyle = pStylePool->Find( aString, eFamily );
743  if (pStyle)
744  {
745  bFound = true;
746  if ( eFamily == SfxStyleFamily::Para )
747  {
748  // like ScViewFunc::RemoveStyleSheetInUse
750  Point aLogic = pVDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip));
751  double nPPTX = aLogic.X() / 1000.0;
752  double nPPTY = aLogic.Y() / 1000.0;
753  Fraction aZoom(1,1);
754  rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
757 
758  pStylePool->Remove( pStyle );
759 
761  }
762  else
763  {
764  if ( rDoc.RemovePageStyleInUse( aString ) )
765  pDocShell->PageStyleModified( ScResId(STR_STYLENAME_STANDARD), true );
766 
767  pStylePool->Remove( pStyle );
768 
769  SfxBindings* pBindings = pDocShell->GetViewBindings();
770  if (pBindings)
771  pBindings->Invalidate( SID_STYLE_FAMILY4 );
773  }
774  }
775  }
776 
777  if (!bFound)
778  throw container::NoSuchElementException();
779 }
780 
781 // container::XIndexAccess
782 
783 sal_Int32 SAL_CALL ScStyleFamilyObj::getCount()
784 {
785  SolarMutexGuard aGuard;
786  if ( pDocShell )
787  {
788  ScDocument& rDoc = pDocShell->GetDocument();
789  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
790 
791  SfxStyleSheetIterator aIter( pStylePool, eFamily );
792  return aIter.Count();
793  }
794  return 0;
795 }
796 
797 uno::Any SAL_CALL ScStyleFamilyObj::getByIndex( sal_Int32 nIndex )
798 {
799  SolarMutexGuard aGuard;
800  uno::Reference< style::XStyle > xObj(GetObjectByIndex_Impl(nIndex));
801  if (!xObj.is())
802  throw lang::IndexOutOfBoundsException();
803 
804  return uno::makeAny(xObj);
805 }
806 
808 {
809  SolarMutexGuard aGuard;
810  return cppu::UnoType<style::XStyle>::get(); // has to fit to getByIndex
811 }
812 
814 {
815  SolarMutexGuard aGuard;
816  return ( getCount() != 0 );
817 }
818 
819 // container::XNameAccess
820 
821 uno::Any SAL_CALL ScStyleFamilyObj::getByName( const OUString& aName )
822 {
823  SolarMutexGuard aGuard;
824  uno::Reference< style::XStyle > xObj(
826  if (!xObj.is())
827  throw container::NoSuchElementException();
828 
829  return uno::makeAny(xObj);
830 }
831 
832 uno::Sequence<OUString> SAL_CALL ScStyleFamilyObj::getElementNames()
833 {
834  SolarMutexGuard aGuard;
835  if ( pDocShell )
836  {
837  ScDocument& rDoc = pDocShell->GetDocument();
838  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
839 
840  SfxStyleSheetIterator aIter( pStylePool, eFamily );
841  sal_uInt16 nCount = aIter.Count();
842 
843  uno::Sequence<OUString> aSeq(nCount);
844  OUString* pAry = aSeq.getArray();
845  SfxStyleSheetBase* pStyle = aIter.First();
846  sal_uInt16 nPos = 0;
847  while (pStyle)
848  {
849  OSL_ENSURE( nPos < nCount, "Count is wrong" );
850  if (nPos < nCount)
852  pStyle->GetName(), eFamily );
853  pStyle = aIter.Next();
854  }
855  return aSeq;
856  }
857  return uno::Sequence<OUString>();
858 }
859 
860 sal_Bool SAL_CALL ScStyleFamilyObj::hasByName( const OUString& aName )
861 {
862  SolarMutexGuard aGuard;
863  if ( pDocShell )
864  {
865  OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, eFamily ));
866 
867  ScDocument& rDoc = pDocShell->GetDocument();
868  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
869  if ( pStylePool->Find( aString, eFamily ) )
870  return true;
871  }
872  return false;
873 }
874 
875 // XPropertySet
876 
877 uno::Reference< beans::XPropertySetInfo > SAL_CALL ScStyleFamilyObj::getPropertySetInfo( )
878 {
879  OSL_FAIL( "###unexpected!" );
880  return uno::Reference< beans::XPropertySetInfo >();
881 }
882 
883 void SAL_CALL ScStyleFamilyObj::setPropertyValue( const OUString&, const uno::Any& )
884 {
885  OSL_FAIL( "###unexpected!" );
886 }
887 
888 uno::Any SAL_CALL ScStyleFamilyObj::getPropertyValue( const OUString& sPropertyName )
889 {
890  uno::Any aRet;
891 
892  if ( sPropertyName != "DisplayName" )
893  {
894  throw beans::UnknownPropertyException( "unknown property: " + sPropertyName, static_cast<OWeakObject *>(this) );
895  }
896 
897  SolarMutexGuard aGuard;
898  TranslateId pResId;
899  switch ( eFamily )
900  {
901  case SfxStyleFamily::Para:
902  pResId = STR_STYLE_FAMILY_CELL; break;
903  case SfxStyleFamily::Page:
904  pResId = STR_STYLE_FAMILY_PAGE; break;
905  default:
906  OSL_FAIL( "ScStyleFamilyObj::getPropertyValue(): invalid family" );
907  }
908  if (pResId)
909  {
910  OUString sDisplayName(ScResId(pResId));
911  aRet <<= sDisplayName;
912  }
913 
914  return aRet;
915 }
916 
917 void SAL_CALL ScStyleFamilyObj::addPropertyChangeListener( const OUString&, const uno::Reference< beans::XPropertyChangeListener >& )
918 {
919  OSL_FAIL( "###unexpected!" );
920 }
921 
922 void SAL_CALL ScStyleFamilyObj::removePropertyChangeListener( const OUString&, const uno::Reference< beans::XPropertyChangeListener >& )
923 {
924  OSL_FAIL( "###unexpected!" );
925 }
926 
927 void SAL_CALL ScStyleFamilyObj::addVetoableChangeListener( const OUString&, const uno::Reference< beans::XVetoableChangeListener >& )
928 {
929  OSL_FAIL( "###unexpected!" );
930 }
931 
932 void SAL_CALL ScStyleFamilyObj::removeVetoableChangeListener( const OUString&, const uno::Reference< beans::XVetoableChangeListener >& )
933 {
934  OSL_FAIL( "###unexpected!" );
935 }
936 
937 // default ctor is needed for reflection
938 
939 ScStyleObj::ScStyleObj(ScDocShell* pDocSh, SfxStyleFamily eFam, const OUString& rName)
940  : pPropSet( (eFam == SfxStyleFamily::Para) ? lcl_GetCellStyleSet() : lcl_GetPageStyleSet() )
941  , pDocShell(pDocSh)
942  , eFamily(eFam)
943  , aStyleName(rName)
944  , pStyle_cached(nullptr)
945 {
946  // if create by ServiceProvider then pDocShell is NULL
947 
948  if (pDocShell)
950 }
951 
952 void ScStyleObj::InitDoc( ScDocShell* pNewDocSh, const OUString& rNewName )
953 {
954  if ( pNewDocSh && !pDocShell )
955  {
956  aStyleName = rNewName;
957  pDocShell = pNewDocSh;
959  }
960 }
961 
963 {
964  SolarMutexGuard g;
965 
966  if (pDocShell)
968 }
969 
970 // XUnoTunnel
971 
973 
975 {
976  // reference update does not matter here
977 
978  if ( rHint.GetId() == SfxHintId::Dying )
979  {
980  pDocShell = nullptr; // has become invalid
981  }
982 }
983 
985 {
986  if ( bUseCachedValue )
987  return pStyle_cached;
988 
989  pStyle_cached = nullptr;
990  if ( pDocShell )
991  {
992  ScDocument& rDoc = pDocShell->GetDocument();
993  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
994  pStyle_cached = pStylePool->Find( aStyleName, eFamily );
995  }
996  return pStyle_cached;
997 }
998 
999 // style::XStyle
1000 
1002 {
1003  SolarMutexGuard aGuard;
1004  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1005  if (pStyle)
1006  return pStyle->IsUserDefined();
1007  return false;
1008 }
1009 
1011 {
1012  SolarMutexGuard aGuard;
1013  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1014  if (pStyle)
1015  return pStyle->IsUsed();
1016  return false;
1017 }
1018 
1019 OUString SAL_CALL ScStyleObj::getParentStyle()
1020 {
1021  SolarMutexGuard aGuard;
1022  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1023  if (pStyle)
1025  return OUString();
1026 }
1027 
1028 void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle )
1029 {
1030  SolarMutexGuard aGuard;
1031  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1032  if (!pStyle)
1033  return;
1034 
1035  // cell styles cannot be modified if any sheet is protected
1036  if ( eFamily == SfxStyleFamily::Para && lcl_AnyTabProtected( pDocShell->GetDocument() ) )
1037  return;
1038 
1041 
1042  OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( rParentStyle, eFamily ));
1043  bool bOk = pStyle->SetParent( aString );
1044  if (!bOk)
1045  return;
1046 
1047  // as by setPropertyValue
1048 
1049  ScDocument& rDoc = pDocShell->GetDocument();
1050  if ( eFamily == SfxStyleFamily::Para )
1051  {
1052  // update line height
1053 
1055  Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapMode(MapUnit::MapTwip));
1056  double nPPTX = aLogic.X() / 1000.0;
1057  double nPPTY = aLogic.Y() / 1000.0;
1058  Fraction aZoom(1,1);
1059  rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
1060 
1061  if (!rDoc.IsImportingXML())
1062  {
1065  }
1066  }
1067  else
1068  {
1070 
1072  }
1073 }
1074 
1075 // container::XNamed
1076 
1077 OUString SAL_CALL ScStyleObj::getName()
1078 {
1079  SolarMutexGuard aGuard;
1080  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1081  if (pStyle)
1083  return OUString();
1084 }
1085 
1086 void SAL_CALL ScStyleObj::setName( const OUString& aNewName )
1087 {
1088  SolarMutexGuard aGuard;
1089  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1090  if (!pStyle)
1091  return;
1092 
1093  // cell styles cannot be renamed if any sheet is protected
1094  if ( eFamily == SfxStyleFamily::Para && lcl_AnyTabProtected( pDocShell->GetDocument() ) )
1095  return;
1096 
1099 
1100  bool bOk = pStyle->SetName( aNewName );
1101  if (!bOk)
1102  return;
1103 
1104  aStyleName = aNewName;
1105 
1106  ScDocument& rDoc = pDocShell->GetDocument();
1107  if ( eFamily == SfxStyleFamily::Para && !rDoc.IsImportingXML() )
1108  rDoc.GetPool()->CellStyleCreated( aNewName, rDoc );
1109 
1110  // cell styles = 2, page styles = 4
1111  sal_uInt16 nId = ( eFamily == SfxStyleFamily::Para ) ?
1112  SID_STYLE_FAMILY2 : SID_STYLE_FAMILY4;
1113  SfxBindings* pBindings = pDocShell->GetViewBindings();
1114  if (pBindings)
1115  {
1116  pBindings->Invalidate( nId );
1117  pBindings->Invalidate( SID_STYLE_APPLY );
1118  }
1119 }
1120 
1121 uno::Reference<container::XIndexReplace> ScStyleObj::CreateEmptyNumberingRules()
1122 {
1123  SvxNumRule aRule( SvxNumRuleFlags::NONE, 0, true ); // nothing supported
1124  return SvxCreateNumRule( aRule );
1125 }
1126 
1127 // beans::XPropertyState
1128 
1129 const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( std::u16string_view rPropName,
1130  const SfxItemPropertyMapEntry*& rpResultEntry )
1131 {
1132  SfxStyleSheetBase* pStyle = GetStyle_Impl( true );
1133  if ( pStyle )
1134  {
1135  const SfxItemPropertyMapEntry* pEntry = nullptr;
1136  if ( eFamily == SfxStyleFamily::Page )
1137  {
1138  pEntry = lcl_GetHeaderStyleMap()->getByName( rPropName );
1139  if ( pEntry ) // only item-WIDs in header/footer map
1140  {
1141  rpResultEntry = pEntry;
1142  return &pStyle->GetItemSet().Get(ATTR_PAGE_HEADERSET).GetItemSet();
1143  }
1144  pEntry = lcl_GetFooterStyleMap()->getByName( rPropName );
1145  if ( pEntry ) // only item-WIDs in header/footer map
1146  {
1147  rpResultEntry = pEntry;
1148  return &pStyle->GetItemSet().Get(ATTR_PAGE_FOOTERSET).GetItemSet();
1149  }
1150  }
1151  pEntry = pPropSet->getPropertyMap().getByName( rPropName );
1152  if ( pEntry )
1153  {
1154  rpResultEntry = pEntry;
1155  return &pStyle->GetItemSet();
1156  }
1157  }
1158 
1159  rpResultEntry = nullptr;
1160  return nullptr;
1161 }
1162 
1163 beans::PropertyState ScStyleObj::getPropertyState_Impl( std::u16string_view aPropertyName )
1164 {
1165  beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE;
1166 
1167  const SfxItemPropertyMapEntry* pResultEntry = nullptr;
1168  const SfxItemSet* pItemSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry );
1169 
1170  if ( pItemSet && pResultEntry )
1171  {
1172  sal_uInt16 nWhich = pResultEntry->nWID;
1173  if ( nWhich == SC_WID_UNO_TBLBORD || nWhich == SC_WID_UNO_TBLBORD2 )
1174  {
1175  nWhich = ATTR_BORDER;
1176  }
1177  if ( IsScItemWid( nWhich ) )
1178  {
1179  SfxItemState eState = pItemSet->GetItemState( nWhich, false );
1180 
1181 // // if no rotate value is set, look at orientation
1182 // //! also for a fixed value of 0 (in case orientation is ambiguous)?
1183 // if ( nWhich == ATTR_ROTATE_VALUE && eState == SfxItemState::DEFAULT )
1184 // eState = pItemSet->GetItemState( ATTR_ORIENTATION, sal_False );
1185 
1186  if ( eState == SfxItemState::SET )
1187  eRet = beans::PropertyState_DIRECT_VALUE;
1188  else if ( eState == SfxItemState::DEFAULT )
1189  eRet = beans::PropertyState_DEFAULT_VALUE;
1190  else if ( eState == SfxItemState::DONTCARE )
1191  eRet = beans::PropertyState_AMBIGUOUS_VALUE; // should not happen
1192  else
1193  {
1194  OSL_FAIL("unknown ItemState");
1195  }
1196  }
1197  }
1198  return eRet;
1199 }
1200 
1201 beans::PropertyState SAL_CALL ScStyleObj::getPropertyState( const OUString& aPropertyName )
1202 {
1203  SolarMutexGuard aGuard;
1204  GetStyle_Impl();
1205 
1206  return getPropertyState_Impl( aPropertyName );
1207 }
1208 
1209 uno::Sequence<beans::PropertyState> SAL_CALL ScStyleObj::getPropertyStates( const uno::Sequence<OUString>& aPropertyNames )
1210 {
1211  SolarMutexGuard aGuard;
1212  GetStyle_Impl();
1213 
1214  uno::Sequence<beans::PropertyState> aRet( aPropertyNames.getLength() );
1215  std::transform(aPropertyNames.begin(), aPropertyNames.end(), aRet.begin(),
1216  [this](const OUString& rName) -> beans::PropertyState { return getPropertyState_Impl(rName); });
1217  return aRet;
1218 }
1219 
1220 void SAL_CALL ScStyleObj::setPropertyToDefault( const OUString& aPropertyName )
1221 {
1222  SolarMutexGuard aGuard;
1223  GetStyle_Impl();
1224 
1225  const SfxItemPropertyMapEntry* pEntry = pPropSet->getPropertyMap().getByName( aPropertyName );
1226  if ( !pEntry )
1227  throw beans::UnknownPropertyException(aPropertyName);
1228 
1229  setPropertyValue_Impl( aPropertyName, pEntry, nullptr );
1230 }
1231 
1232 uno::Any ScStyleObj::getPropertyDefault_Impl( std::u16string_view aPropertyName )
1233 {
1234  uno::Any aAny;
1235 
1236  const SfxItemPropertyMapEntry* pResultEntry = nullptr;
1237  const SfxItemSet* pStyleSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry );
1238 
1239  if ( pStyleSet && pResultEntry )
1240  {
1241  sal_uInt16 nWhich = pResultEntry->nWID;
1242 
1243  if ( IsScItemWid( nWhich ) )
1244  {
1245  // Default is default from ItemPool, not from Standard-Style,
1246  // so it is the same as in setPropertyToDefault
1247  SfxItemSet aEmptySet( *pStyleSet->GetPool(), pStyleSet->GetRanges() );
1248  // default items with wrong Slot-ID are not functional in SfxItemPropertySet3
1250  if ( aEmptySet.GetPool()->GetSlotId(nWhich) == nWhich &&
1251  aEmptySet.GetItemState(nWhich, false) == SfxItemState::DEFAULT )
1252  {
1253  aEmptySet.Put( aEmptySet.Get( nWhich ) );
1254  }
1255  const SfxItemSet* pItemSet = &aEmptySet;
1256 
1257  switch ( nWhich ) // special item handling
1258  {
1259  case ATTR_VALUE_FORMAT:
1260  // default has no language set
1261  aAny <<= sal_Int32( static_cast<const SfxUInt32Item&>(pItemSet->Get(nWhich)).GetValue() );
1262  break;
1263  case ATTR_INDENT:
1264  aAny <<= sal_Int16( convertTwipToMm100(static_cast<const ScIndentItem&>(
1265  pItemSet->Get(nWhich)).GetValue()) );
1266  break;
1267  case ATTR_PAGE_SCALE:
1269  case ATTR_PAGE_FIRSTPAGENO:
1270  aAny <<= sal_Int16( static_cast<const SfxUInt16Item&>(pItemSet->Get(nWhich)).GetValue() );
1271  break;
1272  case ATTR_PAGE_CHARTS:
1273  case ATTR_PAGE_OBJECTS:
1274  case ATTR_PAGE_DRAWINGS:
1276  aAny <<= static_cast<const ScViewObjectModeItem&>(pItemSet->Get(nWhich)).GetValue() == VOBJ_MODE_SHOW;
1277  break;
1278  case ATTR_PAGE_SCALETO:
1279  {
1280  const ScPageScaleToItem aItem(static_cast<const ScPageScaleToItem&>(pItemSet->Get(nWhich)));
1281  if ( aPropertyName == u"" SC_UNO_PAGE_SCALETOX )
1282  aAny <<= static_cast<sal_Int16>(aItem.GetWidth());
1283  else
1284  aAny <<= static_cast<sal_Int16>(aItem.GetHeight());
1285  }
1286  break;
1287  default:
1288  pPropSet->getPropertyValue( *pResultEntry, *pItemSet, aAny );
1289  }
1290  }
1291  else if ( IsScUnoWid( nWhich ) )
1292  {
1293  SfxItemSet aEmptySet( *pStyleSet->GetPool(), pStyleSet->GetRanges() );
1294  const SfxItemSet* pItemSet = &aEmptySet;
1295  switch ( nWhich )
1296  {
1297  case SC_WID_UNO_TBLBORD:
1298  case SC_WID_UNO_TBLBORD2:
1299  {
1300  const SfxPoolItem& rItem = pItemSet->Get(ATTR_BORDER);
1301  SvxBoxItem aOuter(static_cast<const SvxBoxItem&>(rItem));
1303  if (nWhich == SC_WID_UNO_TBLBORD2)
1304  ScHelperFunctions::AssignTableBorder2ToAny(aAny, aOuter, aInner, true);
1305  else
1306  ScHelperFunctions::AssignTableBorderToAny(aAny, aOuter, aInner, true);
1307  }
1308  break;
1309  }
1310  }
1311  }
1312  return aAny;
1313 }
1314 
1315 uno::Any SAL_CALL ScStyleObj::getPropertyDefault( const OUString& aPropertyName )
1316 {
1317  SolarMutexGuard aGuard;
1318  GetStyle_Impl();
1319 
1320  return getPropertyDefault_Impl( aPropertyName );
1321 }
1322 
1323 uno::Sequence<uno::Any> SAL_CALL ScStyleObj::getPropertyDefaults( const uno::Sequence<OUString>& aPropertyNames )
1324 {
1325  SolarMutexGuard aGuard;
1326  GetStyle_Impl();
1327 
1328  uno::Sequence<uno::Any> aSequence( aPropertyNames.getLength() );
1329  std::transform(aPropertyNames.begin(), aPropertyNames.end(), aSequence.begin(),
1330  [this](const OUString& rName) -> uno::Any { return getPropertyDefault_Impl(rName); });
1331  return aSequence;
1332 }
1333 
1334 // XMultiPropertySet
1335 
1336 void SAL_CALL ScStyleObj::setPropertyValues( const uno::Sequence< OUString >& aPropertyNames,
1337  const uno::Sequence< uno::Any >& aValues )
1338 {
1339  SolarMutexGuard aGuard;
1340  GetStyle_Impl();
1341 
1342  if ( aValues.getLength() != aPropertyNames.getLength() )
1343  throw lang::IllegalArgumentException();
1344 
1345  const OUString* pNames = aPropertyNames.getConstArray();
1346  const uno::Any* pValues = aValues.getConstArray();
1347  const SfxItemPropertyMap& rPropertyMap = pPropSet->getPropertyMap();
1348  for ( sal_Int32 i = 0; i < aPropertyNames.getLength(); i++ )
1349  {
1350  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( pNames[i] );
1351  setPropertyValue_Impl( pNames[i], pEntry, &pValues[i] );
1352  }
1353 }
1354 
1355 uno::Sequence<uno::Any> SAL_CALL ScStyleObj::getPropertyValues( const uno::Sequence< OUString >& aPropertyNames )
1356 {
1357  SolarMutexGuard aGuard;
1358  GetStyle_Impl();
1359 
1360  uno::Sequence<uno::Any> aSequence( aPropertyNames.getLength() );
1361  std::transform(aPropertyNames.begin(), aPropertyNames.end(), aSequence.begin(),
1362  [this](const OUString& rName) -> uno::Any { return getPropertyValue_Impl(rName); });
1363  return aSequence;
1364 }
1365 
1366 void SAL_CALL ScStyleObj::addPropertiesChangeListener( const uno::Sequence<OUString>& /* aPropertyNames */,
1367  const uno::Reference<beans::XPropertiesChangeListener>& /* xListener */ )
1368 {
1369  // no bound properties
1370 }
1371 
1373  const uno::Reference<beans::XPropertiesChangeListener>& /* xListener */ )
1374 {
1375  // no bound properties
1376 }
1377 
1378 void SAL_CALL ScStyleObj::firePropertiesChangeEvent( const uno::Sequence<OUString>& /* aPropertyNames */,
1379  const uno::Reference<beans::XPropertiesChangeListener>& /* xListener */ )
1380 {
1381  // no bound properties
1382 }
1383 
1384 // XMultiPropertyStates
1385 // getPropertyStates already defined for XPropertyState
1386 
1388 {
1389  SolarMutexGuard aGuard;
1390 
1391  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1392  if ( !pStyle )
1393  return;
1394 
1395  // cell styles cannot be modified if any sheet is protected
1396  if ( eFamily == SfxStyleFamily::Para && lcl_AnyTabProtected( pDocShell->GetDocument() ) )
1397  throw uno::RuntimeException();
1398 
1399  SfxItemSet& rSet = pStyle->GetItemSet();
1400  rSet.ClearItem(); // set all items to default
1401 
1403 
1404  ScDocument& rDoc = pDocShell->GetDocument();
1405  if ( eFamily == SfxStyleFamily::Para )
1406  {
1407  // row heights
1408 
1410  Point aLogic = pVDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip));
1411  double nPPTX = aLogic.X() / 1000.0;
1412  double nPPTY = aLogic.Y() / 1000.0;
1413  Fraction aZoom(1,1);
1414  rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
1415 
1416  if (!rDoc.IsImportingXML())
1417  {
1420  }
1421  }
1422  else
1423  {
1424  // #i22448# apply the default BoxInfoItem for page styles again
1425  // (same content as in ScStyleSheet::GetItemSet, to control the dialog)
1426  SvxBoxInfoItem aBoxInfoItem( ATTR_BORDER_INNER );
1427  aBoxInfoItem.SetTable( false );
1428  aBoxInfoItem.SetDist( true );
1429  aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::DISTANCE );
1430  rSet.Put( aBoxInfoItem );
1431 
1433  }
1434 }
1435 
1436 void SAL_CALL ScStyleObj::setPropertiesToDefault( const uno::Sequence<OUString>& aPropertyNames )
1437 {
1438  SolarMutexGuard aGuard;
1439  GetStyle_Impl();
1440 
1441  const SfxItemPropertyMap& rPropertyMap = pPropSet->getPropertyMap();
1442  for ( const OUString& rName : aPropertyNames )
1443  {
1444  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( rName );
1445  setPropertyValue_Impl( rName, pEntry, nullptr );
1446  }
1447 }
1448 
1449 // beans::XPropertySet
1450 
1451 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScStyleObj::getPropertySetInfo()
1452 {
1453  SolarMutexGuard aGuard;
1454  return pPropSet->getPropertySetInfo();
1455 }
1456 
1457 void SAL_CALL ScStyleObj::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
1458 {
1459  SolarMutexGuard aGuard;
1460  GetStyle_Impl();
1461 
1462  const SfxItemPropertyMapEntry* pEntry = pPropSet->getPropertyMap().getByName( aPropertyName );
1463  if ( !pEntry )
1464  throw beans::UnknownPropertyException(aPropertyName);
1465 
1466  setPropertyValue_Impl( aPropertyName, pEntry, &aValue );
1467 }
1468 
1469 void ScStyleObj::setPropertyValue_Impl( std::u16string_view rPropertyName, const SfxItemPropertyMapEntry* pEntry, const uno::Any* pValue )
1470 {
1471  SfxStyleSheetBase* pStyle = GetStyle_Impl( true );
1472  if ( !(pStyle && pEntry) )
1473  return;
1474 
1475  // cell styles cannot be modified if any sheet is protected
1476  if ( eFamily == SfxStyleFamily::Para && lcl_AnyTabProtected( pDocShell->GetDocument() ) )
1477  throw uno::RuntimeException();
1478 
1479  SfxItemSet& rSet = pStyle->GetItemSet(); // change directly in active Style
1480  bool bDone = false;
1481  if ( eFamily == SfxStyleFamily::Page )
1482  {
1483  if(pEntry->nWID == SC_WID_UNO_HEADERSET)
1484  {
1485  const SfxItemPropertyMapEntry* pHeaderEntry = lcl_GetHeaderStyleMap()->getByName( rPropertyName );
1486  if ( pHeaderEntry ) // only item-WIDs in header/footer map
1487  {
1488  SvxSetItem aNewHeader( rSet.Get(ATTR_PAGE_HEADERSET) );
1489  if (pValue)
1490  pPropSet->setPropertyValue( *pHeaderEntry, *pValue, aNewHeader.GetItemSet() );
1491  else
1492  aNewHeader.GetItemSet().ClearItem( pHeaderEntry->nWID );
1493  rSet.Put( aNewHeader );
1494  bDone = true;
1495  }
1496  }
1497  else if(pEntry->nWID == SC_WID_UNO_FOOTERSET)
1498  {
1499  const SfxItemPropertyMapEntry* pFooterEntry = lcl_GetFooterStyleMap()->getByName( rPropertyName );
1500  if ( pFooterEntry ) // only item-WIDs in header/footer map
1501  {
1502  SvxSetItem aNewFooter( rSet.Get(ATTR_PAGE_FOOTERSET) );
1503  if (pValue)
1504  pPropSet->setPropertyValue( *pFooterEntry, *pValue, aNewFooter.GetItemSet() );
1505  else
1506  aNewFooter.GetItemSet().ClearItem( pFooterEntry->nWID );
1507  rSet.Put( aNewFooter );
1508  bDone = true;
1509  }
1510  }
1511  }
1512  if (!bDone)
1513  {
1514  if (IsScItemWid(pEntry->nWID))
1515  {
1516  if (pValue)
1517  {
1518  switch (pEntry->nWID) // special item handling
1519  {
1520  case ATTR_VALUE_FORMAT:
1521  {
1522  // language for number formats
1523  SvNumberFormatter* pFormatter
1525  sal_uInt32 nOldFormat = rSet.Get(ATTR_VALUE_FORMAT).GetValue();
1526  LanguageType eOldLang
1527  = rSet.Get(ATTR_LANGUAGE_FORMAT).GetLanguage();
1528  pFormatter->GetFormatForLanguageIfBuiltIn(nOldFormat, eOldLang);
1529 
1530  sal_uInt32 nNewFormat = 0;
1531  *pValue >>= nNewFormat;
1532  rSet.Put(SfxUInt32Item(ATTR_VALUE_FORMAT, nNewFormat));
1533 
1534  const SvNumberformat* pNewEntry = pFormatter->GetEntry(nNewFormat);
1535  LanguageType eNewLang
1536  = pNewEntry ? pNewEntry->GetLanguage() : LANGUAGE_DONTKNOW;
1537  if (eNewLang != eOldLang && eNewLang != LANGUAGE_DONTKNOW)
1538  rSet.Put(SvxLanguageItem(eNewLang, ATTR_LANGUAGE_FORMAT));
1539 
1541  }
1542  break;
1543  case ATTR_INDENT:
1544  {
1545  sal_Int16 nVal = 0;
1546  *pValue >>= nVal;
1548  }
1549  break;
1550  case ATTR_ROTATE_VALUE:
1551  {
1552  sal_Int32 nRotVal = 0;
1553  if (*pValue >>= nRotVal)
1554  {
1555  // stored value is always between 0 and 360 deg.
1556  nRotVal %= 36000;
1557  if (nRotVal < 0)
1558  nRotVal += 36000;
1559  rSet.Put(ScRotateValueItem(Degree100(nRotVal)));
1560  }
1561  }
1562  break;
1563  case ATTR_STACKED:
1564  {
1565  table::CellOrientation eOrient;
1566  if (*pValue >>= eOrient)
1567  {
1568  switch (eOrient)
1569  {
1570  case table::CellOrientation_STANDARD:
1571  rSet.Put(ScVerticalStackCell(false));
1572  break;
1573  case table::CellOrientation_TOPBOTTOM:
1574  rSet.Put(ScVerticalStackCell(false));
1575  rSet.Put(ScRotateValueItem(27000_deg100));
1576  break;
1577  case table::CellOrientation_BOTTOMTOP:
1578  rSet.Put(ScVerticalStackCell(false));
1579  rSet.Put(ScRotateValueItem(9000_deg100));
1580  break;
1581  case table::CellOrientation_STACKED:
1582  rSet.Put(ScVerticalStackCell(true));
1583  break;
1584  default:
1585  {
1586  // added to avoid warnings
1587  }
1588  }
1589  }
1590  }
1591  break;
1592  case ATTR_PAGE_SCALE:
1594  {
1596  rSet.ClearItem(ATTR_PAGE_SCALE);
1598  sal_Int16 nVal = 0;
1599  *pValue >>= nVal;
1600  rSet.Put(SfxUInt16Item(pEntry->nWID, nVal));
1601  }
1602  break;
1603  case ATTR_PAGE_FIRSTPAGENO:
1604  {
1605  sal_Int16 nVal = 0;
1606  *pValue >>= nVal;
1608  }
1609  break;
1610  case ATTR_PAGE_CHARTS:
1611  case ATTR_PAGE_OBJECTS:
1612  case ATTR_PAGE_DRAWINGS:
1613  {
1614  bool bBool = false;
1615  *pValue >>= bBool;
1618  pEntry->nWID, bBool ? VOBJ_MODE_SHOW : VOBJ_MODE_HIDE));
1619  }
1620  break;
1621  case ATTR_PAGE_PAPERBIN:
1622  {
1624  bool bFound = false;
1625 
1626  OUString aName;
1627  if (*pValue >>= aName)
1628  {
1629  if (aName == SC_PAPERBIN_DEFAULTNAME)
1630  bFound = true;
1631  else
1632  {
1633  Printer* pPrinter = pDocShell->GetPrinter();
1634  if (pPrinter)
1635  {
1636  const sal_uInt16 nCount = pPrinter->GetPaperBinCount();
1637  for (sal_uInt16 i = 0; i < nCount; i++)
1638  if (aName == pPrinter->GetPaperBinName(i))
1639  {
1640  nTray = static_cast<sal_uInt8>(i);
1641  bFound = true;
1642  break;
1643  }
1644  }
1645  }
1646  }
1647  if (!bFound)
1648  throw lang::IllegalArgumentException();
1649 
1650  rSet.Put(SvxPaperBinItem(ATTR_PAGE_PAPERBIN, nTray));
1651 
1652  }
1653  break;
1654  case ATTR_PAGE_SCALETO:
1655  {
1656  sal_Int16 nPages = 0;
1657  if (*pValue >>= nPages)
1658  {
1659  ScPageScaleToItem aItem = rSet.Get(ATTR_PAGE_SCALETO);
1660  if (rPropertyName == u"" SC_UNO_PAGE_SCALETOX)
1661  aItem.SetWidth(static_cast<sal_uInt16>(nPages));
1662  else
1663  aItem.SetHeight(static_cast<sal_uInt16>(nPages));
1664  rSet.Put(aItem);
1666  rSet.ClearItem(ATTR_PAGE_SCALE);
1667  }
1668  }
1669  break;
1670  case ATTR_HIDDEN:
1671  {
1672  bool bHidden = false;
1673  if (*pValue >>= bHidden)
1674  pStyle->SetHidden(bHidden);
1675  }
1676  break;
1677  default:
1678  // default items with wrong Slot-ID are not working in SfxItemPropertySet3
1680  if (rSet.GetPool()->GetSlotId(pEntry->nWID) == pEntry->nWID
1681  && rSet.GetItemState(pEntry->nWID, false) == SfxItemState::DEFAULT)
1682  {
1683  rSet.Put(rSet.Get(pEntry->nWID));
1684  }
1685  pPropSet->setPropertyValue(*pEntry, *pValue, rSet);
1686  }
1687  }
1688  else
1689  {
1690  rSet.ClearItem(pEntry->nWID);
1691  // language for number formats
1692  if (pEntry->nWID == ATTR_VALUE_FORMAT)
1694 
1696  }
1697  }
1698  else if (IsScUnoWid(pEntry->nWID))
1699  {
1700  switch (pEntry->nWID)
1701  {
1702  case SC_WID_UNO_TBLBORD:
1703  {
1704  if (pValue)
1705  {
1706  table::TableBorder aBorder;
1707  if (*pValue >>= aBorder)
1708  {
1709  SvxBoxItem aOuter(ATTR_BORDER);
1711  ScHelperFunctions::FillBoxItems(aOuter, aInner, aBorder);
1712  rSet.Put(aOuter);
1713  }
1714  }
1715  else
1716  {
1717  rSet.ClearItem(ATTR_BORDER);
1718  }
1719  }
1720  break;
1721  case SC_WID_UNO_TBLBORD2:
1722  {
1723  if (pValue)
1724  {
1725  table::TableBorder2 aBorder2;
1726  if (*pValue >>= aBorder2)
1727  {
1728  SvxBoxItem aOuter(ATTR_BORDER);
1730  ScHelperFunctions::FillBoxItems(aOuter, aInner, aBorder2);
1731  rSet.Put(aOuter);
1732  }
1733  }
1734  else
1735  {
1736  rSet.ClearItem(ATTR_BORDER);
1737  }
1738  }
1739  break;
1740  }
1741  }
1742  }
1743 
1746 
1747  ScDocument& rDoc = pDocShell->GetDocument();
1748  if ( eFamily == SfxStyleFamily::Para )
1749  {
1750  // If we are loading, we can delay line height calculation, because we are going to re-calc all of those
1751  // after load.
1752  if (pDocShell && !pDocShell->IsLoading())
1753  {
1754  // update line height
1756  Point aLogic = pVDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip));
1757  double nPPTX = aLogic.X() / 1000.0;
1758  double nPPTY = aLogic.Y() / 1000.0;
1759  Fraction aZoom(1,1);
1760  rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
1761 
1762  if (!rDoc.IsImportingXML())
1763  {
1766  }
1767  }
1768  }
1769  else
1770  {
1772 
1774  }
1775 }
1776 
1777 uno::Any ScStyleObj::getPropertyValue_Impl( std::u16string_view aPropertyName )
1778 {
1779  uno::Any aAny;
1780  SfxStyleSheetBase* pStyle = GetStyle_Impl( true );
1781 
1782  if ( aPropertyName == u"" SC_UNONAME_DISPNAME ) // read-only
1783  {
1784  // core always has the display name
1785  if ( pStyle )
1786  aAny <<= pStyle->GetName();
1787  }
1788  else
1789  {
1790  const SfxItemPropertyMapEntry* pResultEntry = nullptr;
1791  const SfxItemSet* pItemSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry );
1792 
1793  if ( pItemSet && pResultEntry )
1794  {
1795  sal_uInt16 nWhich = pResultEntry->nWID;
1796 
1797  if ( IsScItemWid( nWhich ) )
1798  {
1799  switch ( nWhich ) // for special item handling
1800  {
1801  case ATTR_VALUE_FORMAT:
1802  if ( pDocShell )
1803  {
1804  sal_uInt32 nOldFormat =
1805  pItemSet->Get( ATTR_VALUE_FORMAT ).GetValue();
1806  LanguageType eOldLang =
1807  pItemSet->Get( ATTR_LANGUAGE_FORMAT ).GetLanguage();
1808  nOldFormat = pDocShell->GetDocument().GetFormatTable()->
1809  GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang );
1810  aAny <<= nOldFormat;
1811  }
1812  break;
1813  case ATTR_INDENT:
1814  aAny <<= sal_Int16( convertTwipToMm100(static_cast<const ScIndentItem&>(
1815  pItemSet->Get(nWhich)).GetValue()) );
1816  break;
1817  case ATTR_STACKED:
1818  {
1819  Degree100 nRot = pItemSet->Get(ATTR_ROTATE_VALUE).GetValue();
1820  bool bStacked = static_cast<const ScVerticalStackCell&>(pItemSet->Get(nWhich)).GetValue();
1821  SvxOrientationItem( nRot, bStacked, 0 ).QueryValue( aAny );
1822  }
1823  break;
1824  case ATTR_PAGE_SCALE:
1826  case ATTR_PAGE_FIRSTPAGENO:
1827  aAny <<= sal_Int16( static_cast<const SfxUInt16Item&>(pItemSet->Get(nWhich)).GetValue() );
1828  break;
1829  case ATTR_PAGE_CHARTS:
1830  case ATTR_PAGE_OBJECTS:
1831  case ATTR_PAGE_DRAWINGS:
1833  aAny <<= static_cast<const ScViewObjectModeItem&>(pItemSet->Get(nWhich)).GetValue() == VOBJ_MODE_SHOW;
1834  break;
1835  case ATTR_PAGE_PAPERBIN:
1836  {
1837  // property PrinterPaperTray is the name of the tray
1838 
1839  sal_uInt8 nValue = static_cast<const SvxPaperBinItem&>(pItemSet->Get(nWhich)).GetValue();
1840  OUString aName;
1841  if ( nValue == PAPERBIN_PRINTER_SETTINGS )
1842  aName = SC_PAPERBIN_DEFAULTNAME;
1843  else
1844  {
1845  Printer* pPrinter = pDocShell->GetPrinter();
1846  if (pPrinter)
1847  aName = pPrinter->GetPaperBinName( nValue );
1848  }
1849  aAny <<= aName;
1850  }
1851  break;
1852  case ATTR_PAGE_SCALETO:
1853  {
1854  const ScPageScaleToItem& aItem(pItemSet->Get(ATTR_PAGE_SCALETO));
1855  if ( aPropertyName == u"" SC_UNO_PAGE_SCALETOX )
1856  aAny <<= static_cast<sal_Int16>(aItem.GetWidth());
1857  else
1858  aAny <<= static_cast<sal_Int16>(aItem.GetHeight());
1859  }
1860  break;
1861  case ATTR_HIDDEN:
1862  {
1863  bool bHidden = pStyle && pStyle->IsHidden();
1864  aAny <<= bHidden;
1865  }
1866  break;
1867  default:
1868  // Default-Items with wrong Slot-ID don't work in SfxItemPropertySet3
1870  if ( pItemSet->GetPool()->GetSlotId(nWhich) == nWhich &&
1871  pItemSet->GetItemState(nWhich, false) == SfxItemState::DEFAULT )
1872  {
1873  SfxItemSet aNoEmptySet( *pItemSet );
1874  aNoEmptySet.Put( aNoEmptySet.Get( nWhich ) );
1875  pPropSet->getPropertyValue( *pResultEntry, aNoEmptySet, aAny );
1876  }
1877  else
1878  pPropSet->getPropertyValue( *pResultEntry, *pItemSet, aAny );
1879  }
1880  }
1881  else if ( IsScUnoWid( nWhich ) )
1882  {
1883  switch ( nWhich )
1884  {
1885  case SC_WID_UNO_TBLBORD:
1886  case SC_WID_UNO_TBLBORD2:
1887  {
1888  const SfxPoolItem& rItem = pItemSet->Get(ATTR_BORDER);
1889  SvxBoxItem aOuter(static_cast<const SvxBoxItem&>(rItem));
1891  if (nWhich == SC_WID_UNO_TBLBORD2)
1892  ScHelperFunctions::AssignTableBorder2ToAny(aAny, aOuter, aInner,
1893  true);
1894  else
1895  ScHelperFunctions::AssignTableBorderToAny(aAny, aOuter, aInner,
1896  true);
1897  }
1898  break;
1899  }
1900  }
1901  }
1902  }
1903 
1904  return aAny;
1905 }
1906 
1907 uno::Any SAL_CALL ScStyleObj::getPropertyValue( const OUString& aPropertyName )
1908 {
1909  SolarMutexGuard aGuard;
1910  GetStyle_Impl();
1911 
1912  return getPropertyValue_Impl( aPropertyName );
1913 }
1914 
1916 
1917 // lang::XServiceInfo
1918 
1919 OUString SAL_CALL ScStyleObj::getImplementationName()
1920 {
1921  return "ScStyleObj";
1922 }
1923 
1924 sal_Bool SAL_CALL ScStyleObj::supportsService( const OUString& rServiceName )
1925 {
1926  return cppu::supportsService(this, rServiceName);
1927 }
1928 
1929 uno::Sequence<OUString> SAL_CALL ScStyleObj::getSupportedServiceNames()
1930 {
1931  const bool bPage = ( eFamily == SfxStyleFamily::Page );
1932 
1933  return {SCSTYLE_SERVICE,
1934  (bPage ? OUString(SCPAGESTYLE_SERVICE)
1935  : OUString(SCCELLSTYLE_SERVICE))};
1936 }
1937 
1938 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScDocShell * pDocShell
Definition: styleuno.hxx:109
#define SC_UNO_PAGE_FTRLEFTMAR
Definition: unonames.hxx:493
#define SC_UNONAME_TBLBORD
Definition: unonames.hxx:108
#define OLD_UNO_PAGE_HDRBACKCOL
Definition: unonames.hxx:391
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERFIRST(183)
virtual void SAL_CALL setParentStyle(const OUString &aParentStyle) override
Definition: styleuno.cxx:1028
#define SC_UNO_CJK_CFSTYLE
Definition: unonames.hxx:76
constexpr OUStringLiteral SC_FAMILYNAME_PAGE
Definition: styleuno.cxx:392
#define SC_UNONAME_CPOST
Definition: unonames.hxx:59
#define SC_UNO_PAGE_HDRBOTTBDIS
Definition: unonames.hxx:466
constexpr TypedWhichId< SvxWeightItem > ATTR_CTL_FONT_WEIGHT(118)
sal_uInt32 GetFormatForLanguageIfBuiltIn(sal_uInt32 nFormat, LanguageType eLnge=LANGUAGE_DONTKNOW)
constexpr double nPPTY
sal_uInt16 GetHeight() const
Definition: attrib.hxx:241
#define SC_UNO_PAGE_PAPERTRAY
Definition: unonames.hxx:426
#define SC_UNO_PAGE_FIRSTFTRCONT
Definition: unonames.hxx:451
virtual bool IsUsed() const
#define OLD_UNO_PAGE_HDRBACKTRAN
Definition: unonames.hxx:392
constexpr TypedWhichId< SvxEmphasisMarkItem > ATTR_FONT_EMPHASISMARK(121)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
#define SC_UNO_PAGE_HDRRIGHTMAR
Definition: unonames.hxx:471
static OUString DisplayToProgrammaticName(const OUString &rDispName, SfxStyleFamily nType)
sal_uInt16 GetPaperBinCount() const
#define SC_UNONAME_PLMARGIN
Definition: unonames.hxx:114
bool IsInserted() const
Definition: styleuno.hxx:200
#define SC_UNO_CTL_CPOST
Definition: unonames.hxx:92
void setPropertyValue(const SfxItemPropertyMapEntry &rEntry, const css::uno::Any &aVal, SfxItemSet &rSet) const
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_DYNAMIC(165)
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
Definition: docsh3.cxx:451
constexpr TypedWhichId< ScViewObjectModeItem > ATTR_PAGE_DRAWINGS(173)
constexpr TypedWhichId< SvxLanguageItem > ATTR_LANGUAGE_FORMAT(147)
#define OLD_UNO_PAGE_FTRBACKTRAN
Definition: unonames.hxx:397
constexpr TypedWhichId< SvxSizeItem > ATTR_PAGE_SIZE(161)
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:89
void CellStyleCreated(std::u16string_view rName, const ScDocument &rDoc)
Definition: docpool.cxx:370
#define SC_UNO_PAGE_PRINTOBJS
Definition: unonames.hxx:436
#define SC_UNO_PAGE_HDRTOPBOR
Definition: unonames.hxx:463
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
constexpr auto toTwips(N number, Length from)
#define SC_UNO_PAGE_RIGHTMARGIN
Definition: unonames.hxx:420
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
Definition: styleuno.cxx:860
#define SC_UNO_PAGE_RIGHTFTRCON
Definition: unonames.hxx:449
constexpr TypedWhichId< SvxLanguageItem > ATTR_CJK_FONT_LANGUAGE(115)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_GRID(169)
#define SC_UNONAME_USERDEF
Definition: unonames.hxx:214
std::string GetValue
#define SC_UNO_PAGE_FTRGRFURL
Definition: unonames.hxx:482
virtual OUString SAL_CALL getParentStyle() override
Definition: styleuno.cxx:1019
SfxBindings * GetViewBindings()
Definition: docsh4.cxx:2613
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
Definition: styleuno.cxx:1209
constexpr TypedWhichId< SfxBoolItem > ATTR_VERTICAL_ASIAN(137)
#define SC_UNO_CTL_CFFAMIL
Definition: unonames.hxx:87
void loadStylesFromDocShell(ScDocShell *pSource, const css::uno::Sequence< css::beans::PropertyValue > &aOptions)
Definition: styleuno.cxx:588
virtual bool SetParent(const OUString &)
constexpr TypedWhichId< ScViewObjectModeItem > ATTR_PAGE_CHARTS(171)
virtual bool IsHidden() const
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERLEFT(178)
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALE(175)
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
Definition: styleuno.cxx:821
#define MID_CROSS_OUT
#define SC_UNONAME_PRMARGIN
Definition: unonames.hxx:115
virtual void SAL_CALL removePropertiesChangeListener(const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
Definition: styleuno.cxx:1372
constexpr TypedWhichId< SvxCrossedOutItem > ATTR_FONT_CROSSEDOUT(106)
#define SC_UNONAME_CUNDER
Definition: unonames.hxx:52
virtual void SAL_CALL setName(const OUString &aName) override
Definition: styleuno.cxx:1086
virtual ~ScStyleFamilyObj() override
Definition: styleuno.cxx:624
#define SC_WID_UNO_TBLBORD2
Definition: unowids.hxx:72
static const SfxItemPropertySet * lcl_GetPageStyleSet()
Definition: styleuno.cxx:179
constexpr TypedWhichId< SvxLanguageItem > ATTR_FONT_LANGUAGE(110)
void SetTable(bool bNew)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: styleuno.cxx:974
#define SC_UNO_PAGE_TOPMARGIN
Definition: unonames.hxx:421
#define SC_UNONAME_COVER
Definition: unonames.hxx:55
constexpr TypedWhichId< SvxRotateModeItem > ATTR_ROTATE_MODE(136)
#define SC_UNONAME_CEMPHAS
Definition: unonames.hxx:66
#define SC_UNO_PAGE_HDRGRF
Definition: unonames.hxx:458
#define SC_UNO_PAGE_FTRLEFTBOR
Definition: unonames.hxx:483
#define SC_UNO_PAGE_HDRGRFURL
Definition: unonames.hxx:459
const WhichRangesContainer & GetRanges() const
#define SC_UNO_PAGE_GRAPHICFILT
Definition: unonames.hxx:405
static const SfxItemPropertyMap * lcl_GetHeaderStyleMap()
Definition: styleuno.cxx:307
#define SC_UNO_PAGE_FTRRIGHTMAR
Definition: unonames.hxx:494
#define MID_GRAPHIC_TRANSPARENT
virtual const OUString & GetParent() const
#define RIGHT_BORDER_DISTANCE
const SfxStyleFamily aStyleFamilyTypes[SC_STYLE_FAMILY_COUNT]
Definition: styleuno.cxx:394
virtual bool SetName(const OUString &rNewName, bool bReindexNow=true)
#define SC_UNO_PAGE_HDRBRDDIST
Definition: unonames.hxx:468
void SetDocumentModified()
Definition: docsh.cxx:2941
#define MID_TL_STYLE
sal_Int16 nId
#define MID_MARGIN_LO_MARGIN
#define SC_UNO_PAGE_PRINTZERO
Definition: unonames.hxx:453
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: styleuno.cxx:428
#define SC_UNO_CJK_CFNAME
Definition: unonames.hxx:75
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: styleuno.cxx:1457
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
Definition: styleuno.cxx:1201
constexpr TypedWhichId< SvxBoxInfoItem > ATTR_BORDER_INNER(151)
static void FillBoxItems(SvxBoxItem &rOuter, SvxBoxInfoItem &rInner, const css::table::TableBorder &rBorder)
#define SC_UNONAME_CRELIEF
Definition: unonames.hxx:72
#define MID_BACK_COLOR
#define SC_UNONAME_PTMARGIN
Definition: unonames.hxx:112
constexpr OUStringLiteral SC_PAPERBIN_DEFAULTNAME
Definition: styleuno.cxx:403
#define SC_UNO_PAGE_FIRSTHDRSHARED
Definition: unonames.hxx:444
#define SC_WID_UNO_DISPNAME
Definition: unowids.hxx:54
constexpr TypedWhichId< SvxCharReliefItem > ATTR_FONT_RELIEF(124)
static OUString ProgrammaticToDisplayName(const OUString &rProgName, SfxStyleFamily nType)
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
virtual SfxItemSet & GetItemSet()
constexpr TypedWhichId< ScLineBreakCell > ATTR_LINEBREAK(139)
constexpr TypedWhichId< ScProtectionAttr > ATTR_PROTECTION(149)
#define SC_UNONAME_CCOLOR
Definition: unonames.hxx:50
const SfxItemSet * GetStyleItemSet_Impl(std::u16string_view rPropName, const SfxItemPropertyMapEntry *&rpEntry)
Definition: styleuno.cxx:1129
virtual void Remove(SfxStyleSheetBase *pStyle) override
Definition: stlpool.cxx:116
#define SC_UNO_PAGE_HDRBACKCOL
Definition: unonames.hxx:454
virtual OUString SAL_CALL getName() override
Definition: styleuno.cxx:1077
void Invalidate(sal_uInt16 nId)
virtual sal_Bool SAL_CALL hasElements() override
Definition: styleuno.cxx:497
#define SC_UNO_PAGE_HDRGRFFILT
Definition: unonames.hxx:456
void SetHeight(sal_uInt16 nHeight)
Definition: attrib.hxx:245
#define SC_UNO_PAGE_SCALETOPAG
Definition: unonames.hxx:440
const SfxItemPropertySet * pPropSet
Definition: styleuno.hxx:169
#define SC_UNONAME_LEFTBORDER2
Definition: unonames.hxx:128
#define SC_UNONAME_CWEIGHT
Definition: unonames.hxx:58
#define SC_UNO_PAGE_FTRBACKCOL
Definition: unonames.hxx:477
#define SC_UNONAME_CELLBACK
Definition: unonames.hxx:97
virtual sal_Int32 SAL_CALL getCount() override
Definition: styleuno.cxx:476
#define SC_UNO_PAGE_FIRSTHDRCONT
Definition: unonames.hxx:450
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
constexpr TypedWhichId< ScViewObjectModeItem > ATTR_PAGE_OBJECTS(172)
static void AssignTableBorder2ToAny(css::uno::Any &rAny, const SvxBoxItem &rOuter, const SvxBoxInfoItem &rInner, bool bInvalidateHorVerDist=false)
Definition: cellsuno.cxx:1025
#define SC_UNO_PAGE_PRINTCHARTS
Definition: unonames.hxx:435
SfxHintId GetId() const
#define LEFT_BORDER
#define SC_UNO_CJK_CLOCAL
Definition: unonames.hxx:83
static void AssignTableBorderToAny(css::uno::Any &rAny, const SvxBoxItem &rOuter, const SvxBoxInfoItem &rInner, bool bInvalidateHorVerDist=false)
Definition: cellsuno.cxx:1017
virtual void SAL_CALL firePropertiesChangeEvent(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
Definition: styleuno.cxx:1378
virtual void SAL_CALL insertByName(const OUString &aName, const css::uno::Any &aElement) override
Definition: styleuno.cxx:676
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
#define MID_EMPHASIS
#define OLD_UNO_PAGE_FTRON
Definition: unonames.hxx:400
#define SC_UNONAME_CUNDLHAS
Definition: unonames.hxx:54
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: styleuno.cxx:1907
virtual void SAL_CALL removeByName(const OUString &Name) override
Definition: styleuno.cxx:728
#define SC_UNO_PAGE_FTRBOTTBOR
Definition: unonames.hxx:485
constexpr TypedWhichId< SvxScriptSpaceItem > ATTR_SCRIPTSPACE(126)
#define MID_TL_COLOR
constexpr TypedWhichId< ScIndentItem > ATTR_INDENT(131)
#define SC_UNONAME_WRAP
Definition: unonames.hxx:110
SC_DLLPUBLIC ScDocumentPool * GetPool()
Definition: document.cxx:6087
#define SC_UNO_CJK_CFPITCH
Definition: unonames.hxx:79
#define SC_UNONAME_CFONT
Definition: unonames.hxx:64
SfxStyleFamily eFamily
Definition: styleuno.hxx:171
#define MID_MARGIN_R_MARGIN
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERRIGHT(180)
#define SC_UNO_PAGE_HDRSHADOW
Definition: unonames.hxx:469
ScStyleFamiliesObj(ScDocShell *pDocSh)
Definition: styleuno.cxx:414
#define PAPERBIN_PRINTER_SETTINGS
#define MID_FONT_FAMILY
#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
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: styleuno.cxx:877
#define SC_UNO_PAGE_FTRTOPBDIS
Definition: unonames.hxx:490
virtual void SetHidden(bool bValue)
SfxStyleSheetBase * GetStyle_Impl(bool bUseCachedValue=false)
Definition: styleuno.cxx:984
#define MID_FONT_FAMILY_NAME
#define SC_UNONAME_BOTTBORDER2
Definition: unonames.hxx:127
virtual void SAL_CALL setPropertiesToDefault(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: styleuno.cxx:1436
#define SC_UNO_CJK_CFFAMIL
Definition: unonames.hxx:77
#define SC_UNO_PAGE_TOPBORDER
Definition: unonames.hxx:412
#define SC_UNO_PAGE_HDRGRFLOC
Definition: unonames.hxx:457
css::uno::Reference< css::container::XIndexReplace > SvxCreateNumRule(SdrModel *pModel)
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: styleuno.cxx:932
const OUString & GetName() const
#define MID_LANG_LOCALE
#define SC_UNONAME_LEFTBORDER
Definition: unonames.hxx:123
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:872
virtual sal_Bool SAL_CALL isInUse() override
Definition: styleuno.cxx:1010
constexpr TypedWhichId< SvxShadowItem > ATTR_SHADOW(152)
#define SC_UNO_PAGE_PRINTDOWN
Definition: unonames.hxx:438
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: styleuno.cxx:1451
#define SC_UNO_PAGE_SYTLELAYOUT
Definition: unonames.hxx:425
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_TOPDOWN(174)
int nCount
ScStyleFamilyObj(ScDocShell *pDocSh, SfxStyleFamily eFam)
Definition: styleuno.cxx:617
#define SC_WID_UNO_FOOTERSET
Definition: unowids.hxx:56
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_VERCENTER(163)
#define SC_UNONAME_SHRINK_TO_FIT
Definition: unonames.hxx:138
void getPropertyValue(const SfxItemPropertyMapEntry &rEntry, const SfxItemSet &rSet, css::uno::Any &rAny) const
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual css::uno::Type SAL_CALL getElementType() override
Definition: styleuno.cxx:807
constexpr TypedWhichId< SvxJustifyMethodItem > ATTR_HOR_JUSTIFY_METHOD(130)
ScDocShell * GetDocShell()
Definition: tablink.hxx:90
#define SC_UNONAME_ASIANVERT
Definition: unonames.hxx:118
#define SC_UNONAME_WRITING
Definition: unonames.hxx:119
#define SC_UNONAME_ROTREF
Definition: unonames.hxx:117
#define SC_UNO_PAGE_HDRDYNAMIC
Definition: unonames.hxx:475
bool RemovePageStyleInUse(std::u16string_view rStrPageStyle)
Definition: documen8.cxx:327
virtual SfxStyleSheetBase * First()
constexpr TypedWhichId< ScShrinkToFitCell > ATTR_SHRINKTOFIT(140)
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
Definition: styleuno.cxx:505
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: styleuno.cxx:1929
SfxStyleFamily
#define SC_UNONAME_CWORDMOD
Definition: unonames.hxx:73
#define OLD_UNO_PAGE_FTRDYNAMIC
Definition: unonames.hxx:399
#define SC_UNO_PAGE_CENTERVER
Definition: unonames.hxx:431
#define SC_UNO_PAGE_FTRGRF
Definition: unonames.hxx:481
#define SC_UNO_PAGE_HDRLEFTMAR
Definition: unonames.hxx:470
#define SC_UNO_PAGE_LEFTHDRCONT
Definition: unonames.hxx:446
#define SC_UNO_CTL_CFNAME
Definition: unonames.hxx:85
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
#define SC_UNO_PAGE_HDRBOTTBOR
Definition: unonames.hxx:462
#define SC_UNONAME_CFNAME
Definition: unonames.hxx:67
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: styleuno.cxx:1315
ScDocShell * pDocShell
Definition: styleuno.hxx:56
#define SC_UNO_PAGE_PRINTGRID
Definition: unonames.hxx:433
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_SHARED_FIRST(167)
#define SC_UNO_CTL_CFSTYLE
Definition: unonames.hxx:86
#define SC_UNO_PAGE_HDRRIGHTBDIS
Definition: unonames.hxx:465
constexpr TypedWhichId< SvxPaperBinItem > ATTR_PAGE_PAPERBIN(160)
#define SC_UNONAME_CHEIGHT
Definition: unonames.hxx:51
constexpr TypedWhichId< SvxUnderlineItem > ATTR_FONT_UNDERLINE(104)
#define SC_UNO_PAGE_LEFTBORDER
Definition: unonames.hxx:409
#define MID_PAGE_LAYOUT
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERFIRST(182)
#define LEFT_BORDER_DISTANCE
#define MID_SIZE_HEIGHT
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: styleuno.cxx:1355
#define SC_UNO_PAGE_CENTERHOR
Definition: unonames.hxx:430
#define SC_UNO_PAGE_SIZE
Definition: unonames.hxx:427
#define MID_MARGIN_L_MARGIN
OUString GetPaperBinName(sal_uInt16 nPaperBin) const
css::beans::PropertyState getPropertyState_Impl(std::u16string_view PropertyName)
Definition: styleuno.cxx:1163
#define SC_UNO_PAGE_HDRON
Definition: unonames.hxx:474
#define SC_UNONAME_CFPITCH
Definition: unonames.hxx:71
#define SC_STYLE_FAMILY_COUNT
Definition: styleuno.cxx:389
#define SC_UNO_PAGE_HDRBODYDIST
Definition: unonames.hxx:472
constexpr TypedWhichId< SvxLineItem > ATTR_BORDER_TLBR(141)
#define SC_UNONAME_PINDENT
Definition: unonames.hxx:111
constexpr double nPPTX
#define MID_HORJUST_ADJUST
#define SC_UNO_PAGE_FTRHEIGHT
Definition: unonames.hxx:496
#define SC_UNONAME_CFCHARS
Definition: unonames.hxx:70
#define SC_UNONAME_CUNDLCOL
Definition: unonames.hxx:53
#define SC_UNONAME_PADJUST
Definition: unonames.hxx:144
#define SC_UNO_CTL_CWEIGHT
Definition: unonames.hxx:91
constexpr OUStringLiteral SCPAGESTYLE_SERVICE
Definition: styleuno.cxx:398
#define SC_UNONAME_TOPBORDER
Definition: unonames.hxx:125
rtl::Reference< ScStyleFamilyObj > GetObjectByName_Impl(std::u16string_view aName) const
Definition: styleuno.cxx:461
sal_uInt16 GetWidth() const
Definition: attrib.hxx:240
#define MID_L_MARGIN
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:871
constexpr TypedWhichId< SvxPostureItem > ATTR_FONT_POSTURE(103)
#define SC_UNO_PAGE_HDRHEIGHT
Definition: unonames.hxx:473
#define SC_UNO_CJK_CHEIGHT
Definition: unonames.hxx:80
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
Definition: documen2.cxx:441
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
constexpr TypedWhichId< SvxShadowedItem > ATTR_FONT_SHADOWED(108)
#define SC_UNO_PAGE_FTRDYNAMIC
Definition: unonames.hxx:498
bool IsImportingXML() const
Definition: document.hxx:2150
#define MID_PAGE_NUMTYPE
#define MID_HORJUST_HORJUST
#define SC_UNO_PAGE_BACKCOLOR
Definition: unonames.hxx:403
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CJK_FONT_HEIGHT(112)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define SC_UNO_PAGE_WIDTH
Definition: unonames.hxx:428
#define MID_CROSSED_OUT
int i
constexpr TypedWhichId< SvxSetItem > ATTR_PAGE_HEADERSET(184)
#define MID_SIZE_WIDTH
virtual sal_Bool SAL_CALL isUserDefined() override
Definition: styleuno.cxx:1001
#define SC_UNONAME_PLASTADJ
Definition: unonames.hxx:145
#define OLD_UNO_PAGE_HDRDYNAMIC
Definition: unonames.hxx:394
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyDefaults(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: styleuno.cxx:1323
static const SfxItemPropertySet * lcl_GetCellStyleSet()
Definition: styleuno.cxx:79
#define SC_UNONAME_CLOCAL
Definition: unonames.hxx:62
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getStyleLoaderOptions() override
Definition: styleuno.cxx:562
#define SC_UNONAME_CELLPRO
Definition: unonames.hxx:99
constexpr TypedWhichId< SvxVerJustifyItem > ATTR_VER_JUSTIFY(132)
#define SC_UNONAME_HIDDEN
Definition: unonames.hxx:120
#define SC_UNO_PAGE_FTRBRDDIST
Definition: unonames.hxx:491
#define TOP_BORDER
virtual sal_Bool SAL_CALL hasElements() override
Definition: styleuno.cxx:813
#define SC_WID_UNO_HEADERSET
Definition: unowids.hxx:55
void PageStyleModified(std::u16string_view rStyleName, bool bApi)
Definition: docsh4.cxx:1749
#define SC_UNO_PAGE_PRINTHEADER
Definition: unonames.hxx:434
#define OLD_UNO_PAGE_HDRSHARED
Definition: unonames.hxx:393
#define SC_UNONAME_CSHADD
Definition: unonames.hxx:63
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
Definition: styleuno.cxx:520
#define static
Definition: arraysum.hxx:27
constexpr OUStringLiteral SCCELLSTYLE_SERVICE
Definition: styleuno.cxx:397
#define SC_UNO_PAGE_NUMBERTYPE
Definition: unonames.hxx:424
#define SC_UNO_PAGE_HDRTOPBDIS
Definition: unonames.hxx:467
void setPropertyValue_Impl(std::u16string_view rPropertyName, const SfxItemPropertyMapEntry *pEntry, const css::uno::Any *pValue)
Definition: styleuno.cxx:1469
virtual sal_Int32 SAL_CALL getCount() override
Definition: styleuno.cxx:783
virtual void SAL_CALL addPropertiesChangeListener(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
Definition: styleuno.cxx:1366
#define MID_POSTURE
float u
unsigned char sal_Bool
#define BOTTOM_BORDER_DISTANCE
const SfxItemPropertyMap & getPropertyMap() const
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_HORCENTER(162)
bool IsScUnoWid(sal_uInt16 nWid)
Definition: unowids.hxx:79
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_FORMULAS(186)
#define LANGUAGE_DONTKNOW
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALUE_FORMAT(146)
OUString aPropName
#define SC_UNO_PAGE_FTRTOPBOR
Definition: unonames.hxx:486
#define SC_UNONAME_DIAGONAL_BLTR2
Definition: unonames.hxx:136
ScDocShell * pDocShell
Definition: styleuno.hxx:170
#define SC_UNONAME_CELLVJUS_METHOD
Definition: unonames.hxx:103
css::uno::Type const & get()
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
Definition: miscuno.hxx:63
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: styleuno.cxx:888
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
Definition: styleuno.cxx:832
constexpr TypedWhichId< ScVerticalStackCell > ATTR_STACKED(134)
sal_uInt16 GetSlotId(sal_uInt16 nWhich) const
#define MID_R_MARGIN
#define MID_GRAPHIC_POSITION
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_NOTES(168)
rtl::Reference< ScStyleFamilyObj > GetObjectByType_Impl(SfxStyleFamily nType) const
Definition: styleuno.cxx:440
const SCTAB MAXTAB
Definition: address.hxx:70
#define SC_UNO_PAGE_GRAPHICURL
Definition: unonames.hxx:407
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_FIRSTPAGENO(177)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CTL_FONT_HEIGHT(117)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_HEADERS(170)
rtl::Reference< ScStyleObj > GetObjectByIndex_Impl(sal_Int32 nIndex)
Definition: styleuno.cxx:644
constexpr TypedWhichId< SvxFontItem > ATTR_CTL_FONT(116)
#define SC_UNO_PAGE_LEFTFTRCONT
Definition: unonames.hxx:447
constexpr TypedWhichId< SvxLRSpaceItem > ATTR_LRSPACE(157)
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
Definition: docsh3.cxx:101
#define SC_UNONAME_PISFORBID
Definition: unonames.hxx:142
SfxItemPool * GetPool() const
#define SC_UNONAME_CELLHJUS
Definition: unonames.hxx:100
constexpr TypedWhichId< ScPageScaleToItem > ATTR_PAGE_SCALETO(188)
constexpr TypedWhichId< ScHyphenateCell > ATTR_HYPHENATE(125)
#define MID_FONT_PITCH
#define SC_IMPL_DUMMY_PROPERTY_LISTENER(ClassName)
Definition: miscuno.hxx:72
#define SC_UNO_PAGE_HEIGHT
Definition: unonames.hxx:429
UNO3_GETIMPLEMENTATION_IMPL(ScStyleObj)
#define SC_UNO_PAGE_FIRSTFTRSHARED
Definition: unonames.hxx:445
static css::uno::Reference< css::container::XIndexReplace > CreateEmptyNumberingRules()
Definition: styleuno.cxx:1121
#define SC_UNONAME_RIGHTBORDER2
Definition: unonames.hxx:129
#define MID_MARGIN_UP_MARGIN
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: styleuno.cxx:883
#define SC_UNO_PAGE_BOTTBORDER
Definition: unonames.hxx:411
#define SC_UNO_PAGE_TOPBRDDIST
Definition: unonames.hxx:416
void AddUnoObject(SfxListener &rObject)
Definition: documen3.cxx:898
#define SC_UNO_PAGE_BACKTRANS
Definition: unonames.hxx:404
#define SC_UNO_PAGE_PRINTDRAW
Definition: unonames.hxx:437
constexpr TypedWhichId< SvxFontItem > ATTR_CJK_FONT(111)
#define SC_UNO_PAGE_BOTTMARGIN
Definition: unonames.hxx:422
#define SC_UNONAME_CFSTYLE
Definition: unonames.hxx:68
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
constexpr TypedWhichId< SvxLanguageItem > ATTR_CTL_FONT_LANGUAGE(120)
constexpr TypedWhichId< SvxFrameDirectionItem > ATTR_WRITINGDIR(138)
rtl::Reference< ScStyleObj > GetObjectByName_Impl(const OUString &Name)
Definition: styleuno.cxx:664
#define SC_UNO_PAGE_FTRLEFTBDIS
Definition: unonames.hxx:487
#define OLD_UNO_PAGE_BACKTRANS
Definition: unonames.hxx:390
#define SC_WID_UNO_TBLBORD
Definition: unowids.hxx:35
#define MID_GRAPHIC_URL
const PropertyValue * pValues
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual SfxStyleSheetBase * Next()
virtual void SAL_CALL loadStylesFromDocument(const css::uno::Reference< css::lang::XComponent > &aSourceComponent, const css::uno::Sequence< css::beans::PropertyValue > &aOptions) override
Definition: styleuno.cxx:574
#define SC_UNO_PAGE_FTRBOTTBDIS
Definition: unonames.hxx:489
virtual ~ScStyleFamiliesObj() override
Definition: styleuno.cxx:420
#define MID_FONT_STYLE_NAME
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: styleuno.cxx:917
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERLEFT(179)
void StyleSheetChanged(const SfxStyleSheetBase *pStyleSheet, bool bRemoved, OutputDevice *pDev, double nPPTX, double nPPTY, const Fraction &rZoomX, const Fraction &rZoomY)
Definition: document.cxx:4987
#define SC_UNO_PAGE_FTRON
Definition: unonames.hxx:497
#define SC_UNONAME_DIAGONAL_BLTR
Definition: unonames.hxx:133
constexpr TypedWhichId< SvxJustifyMethodItem > ATTR_VER_JUSTIFY_METHOD(133)
constexpr TypedWhichId< SvxPostureItem > ATTR_CTL_FONT_POSTURE(119)
virtual css::uno::Type SAL_CALL getElementType() override
Definition: styleuno.cxx:491
#define MID_FONTHEIGHT
#define BOTTOM_BORDER
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: styleuno.cxx:1924
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: styleuno.cxx:1220
SfxItemState
#define SC_UNO_PAGE_PRINTANNOT
Definition: unonames.hxx:432
#define SC_UNO_PAGE_RIGHTBRDDIST
Definition: unonames.hxx:414
static bool lcl_AnyTabProtected(const ScDocument &rDoc)
Definition: styleuno.cxx:405
ScStyleObj()=delete
#define SC_UNO_PAGE_HDRBACKTRAN
Definition: unonames.hxx:455
Contains the "scale to width/height" attribute in page styles.
Definition: attrib.hxx:222
SfxStyleSheetBase * pStyle_cached
Definition: styleuno.hxx:173
bool IsScItemWid(sal_uInt16 nWid)
Definition: unowids.hxx:84
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
#define SC_UNONAME_OVERWSTL
Definition: unonames.hxx:153
#define MID_WEIGHT
#define OLD_UNO_PAGE_BACKCOLOR
Definition: unonames.hxx:389
constexpr TypedWhichId< SvxOverlineItem > ATTR_FONT_OVERLINE(105)
virtual ~ScStyleObj() override
Definition: styleuno.cxx:962
#define SC_UNO_PAGE_HDRRIGHTBOR
Definition: unonames.hxx:461
unsigned char sal_uInt8
const SvNumberformat * GetEntry(sal_uInt32 nKey) const
#define SC_UNO_CJK_CWEIGHT
Definition: unonames.hxx:81
#define SC_UNO_PAGE_FTRGRFFILT
Definition: unonames.hxx:479
#define SC_UNONAME_SHADOW
Definition: unonames.hxx:107
#define SC_UNO_PAGE_LEFTMARGIN
Definition: unonames.hxx:419
#define SC_UNONAME_BOTTBORDER
Definition: unonames.hxx:122
#define OLD_UNO_PAGE_FTRSHARED
Definition: unonames.hxx:398
#define SC_UNONAME_NUMFMT
Definition: unonames.hxx:105
#define SC_UNO_PAGE_SCALETOX
Definition: unonames.hxx:441
#define SC_UNO_PAGE_GRAPHIC
Definition: unonames.hxx:408
constexpr TypedWhichId< SvXMLAttrContainerItem > ATTR_USERDEF(122)
OUString aName
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All) override
Definition: stlpool.cxx:72
#define SC_UNO_PAGE_BORDERDIST
Definition: unonames.hxx:417
#define SC_UNONAME_LOADCELL
Definition: unonames.hxx:154
constexpr OUStringLiteral SCSTYLE_SERVICE
Definition: styleuno.cxx:396
#define SC_UNONAME_CFFAMIL
Definition: unonames.hxx:69
constexpr TypedWhichId< SvxPostureItem > ATTR_CJK_FONT_POSTURE(114)
#define SC_UNO_PAGE_HDRSHARED
Definition: unonames.hxx:476
#define SC_UNONAME_HYPERLINK
Definition: unonames.hxx:197
#define SC_UNONAME_ROTANG
Definition: unonames.hxx:116
#define SC_UNONAME_CELLORI
Definition: unonames.hxx:104
#define BORDER_DISTANCE
#define SC_UNONAME_CELLVJUS
Definition: unonames.hxx:101
#define SC_UNONAME_PBMARGIN
Definition: unonames.hxx:113
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: styleuno.cxx:632
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
Definition: styleuno.cxx:515
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
#define TOP_BORDER_DISTANCE
void RemoveUnoObject(SfxListener &rObject)
Definition: documen3.cxx:906
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
#define SC_UNO_PAGE_FTRGRFLOC
Definition: unonames.hxx:480
constexpr TypedWhichId< SvxULSpaceItem > ATTR_ULSPACE(158)
#define SC_UNONAME_COVRLCOL
Definition: unonames.hxx:56
constexpr OUStringLiteral SC_FAMILYNAME_CELL
Definition: styleuno.cxx:391
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:398
#define MID_LO_MARGIN
#define MID_GRAPHIC_FILTER
#define SC_UNO_PAGE_GRAPHICLOC
Definition: unonames.hxx:406
Sequence< sal_Int8 > aSeq
constexpr TypedWhichId< SvxPageItem > ATTR_PAGE(159)
#define SC_UNONAME_TOPBORDER2
Definition: unonames.hxx:130
const ScDocument & GetDocument() const
Definition: docsh.hxx:220
#define MID_PAGE_ORIENTATION
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
Definition: document.cxx:6092
css::uno::Any getPropertyDefault_Impl(std::u16string_view aPropertyName)
Definition: styleuno.cxx:1232
rtl::Reference< ScStyleFamilyObj > GetObjectByIndex_Impl(sal_uInt32 nIndex) const
Definition: styleuno.cxx:453
#define SC_UNONAME_DIAGONAL_TLBR2
Definition: unonames.hxx:135
constexpr TypedWhichId< SfxStringItem > ATTR_HYPERLINK(155)
#define SC_UNO_CTL_CHEIGHT
Definition: unonames.hxx:90
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALETOPAGES(176)
void InitDoc(ScDocShell *pNewDocSh, const OUString &rNewName)
Definition: styleuno.cxx:952
#define SC_UNO_CJK_CPOST
Definition: unonames.hxx:82
#define SC_UNO_PAGE_FIRSTPAGE
Definition: unonames.hxx:443
OUString aStyleName
Definition: styleuno.hxx:172
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: styleuno.cxx:797
#define SC_UNONAME_PISCHDIST
Definition: unonames.hxx:141
SfxStyleFamily GetFamily() const
Definition: styleuno.hxx:201
#define SC_UNO_PAGE_SCALEVAL
Definition: unonames.hxx:439
#define MID_TL_HASCOLOR
void SetValid(SvxBoxInfoItemValidFlags nValid, bool bValid=true)
#define SC_UNO_PAGE_LEFTBRDDIST
Definition: unonames.hxx:413
#define SC_UNO_PAGE_FTRSHARED
Definition: unonames.hxx:499
bool IsUserDefined() const
#define RIGHT_BORDER
#define SC_UNO_PAGE_FTRBODYDIST
Definition: unonames.hxx:495
#define SC_UNONAME_CSTRIKE
Definition: unonames.hxx:61
#define OLD_UNO_PAGE_HDRON
Definition: unonames.hxx:395
virtual void SAL_CALL setAllPropertiesToDefault() override
Definition: styleuno.cxx:1387
virtual void SAL_CALL replaceByName(const OUString &aName, const css::uno::Any &aElement) override
Definition: styleuno.cxx:720
#define MID_RELIEF
virtual sal_Int32 Count()
#define SC_UNONAME_CELLTRAN
Definition: unonames.hxx:98
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERRIGHT(181)
#define SC_UNONAME_DIAGONAL_TLBR
Definition: unonames.hxx:132
SfxStyleFamily eFamily
Definition: styleuno.hxx:110
constexpr TypedWhichId< SvxWordLineModeItem > ATTR_FONT_WORDLINE(123)
static bool GetBoolFromAny(const css::uno::Any &aAny)
Definition: miscuno.cxx:138
#define SC_UNO_PAGE_LANDSCAPE
Definition: unonames.hxx:423
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_ON(164)
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: styleuno.cxx:481
void SetWidth(sal_uInt16 nWidth)
Definition: attrib.hxx:244
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Sequence< css::uno::Any > &aValues) override
Definition: styleuno.cxx:1336
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_NULLVALS(187)
#define SC_UNO_PAGE_PRINTFORMUL
Definition: unonames.hxx:452
virtual void SAL_CALL loadStylesFromURL(const OUString &URL, const css::uno::Sequence< css::beans::PropertyValue > &aOptions) override
Definition: styleuno.cxx:527
#define SC_UNO_PAGE_BOTTBRDDIST
Definition: unonames.hxx:415
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
#define SC_UNONAME_PISHYPHEN
Definition: unonames.hxx:143
#define MID_GRAPHIC
constexpr TypedWhichId< SvxSetItem > ATTR_PAGE_FOOTERSET(185)
constexpr TypedWhichId< SvxColorItem > ATTR_FONT_COLOR(109)
#define SC_UNONAME_COUTL
Definition: unonames.hxx:65
bool IsLoading() const
#define SC_UNO_PAGE_HDRLEFTBOR
Definition: unonames.hxx:460
constexpr TypedWhichId< SvxWeightItem > ATTR_CJK_FONT_WEIGHT(113)
#define SC_UNO_PAGE_HDRLEFTBDIS
Definition: unonames.hxx:464
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: styleuno.cxx:922
#define SC_UNONAME_RIGHTBORDER
Definition: unonames.hxx:124
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: styleuno.cxx:927
constexpr TypedWhichId< SvxHangingPunctuationItem > ATTR_HANGPUNCTUATION(127)
#define SC_UNO_PAGE_RIGHTBORDER
Definition: unonames.hxx:410
constexpr TypedWhichId< SfxBoolItem > ATTR_HIDDEN(189)
#define SC_UNO_PAGE_FTRRIGHTBDIS
Definition: unonames.hxx:488
constexpr TypedWhichId< SvxLineItem > ATTR_BORDER_BLTR(142)
#define SC_UNO_CTL_CFPITCH
Definition: unonames.hxx:89
constexpr TypedWhichId< SvxContourItem > ATTR_FONT_CONTOUR(107)
#define OLD_UNO_PAGE_FTRBACKCOL
Definition: unonames.hxx:396
#define SC_UNO_PAGE_RIGHTHDRCON
Definition: unonames.hxx:448
#define SC_UNO_PAGE_FTRSHADOW
Definition: unonames.hxx:492
#define SC_UNO_PAGE_FTRBACKTRAN
Definition: unonames.hxx:478
#define SC_UNO_CJK_CFCHARS
Definition: unonames.hxx:78
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_SHARED(166)
LanguageType GetLanguage() const
sal_uInt16 nPos
sal_Int16 SCTAB
Definition: types.hxx:22
constexpr TypedWhichId< SvxMarginItem > ATTR_MARGIN(143)
static SfxObjectShell * GetShellFromComponent(const css::uno::Reference< css::uno::XInterface > &xComp)
#define MID_SIZE_SIZE
#define SC_UNONAME_PISHANG
Definition: unonames.hxx:140
sal_Int16 nValue
#define MID_FONT_CHAR_SET
void SetDist(bool bNew)
#define SC_UNO_PAGE_SHADOWFORM
Definition: unonames.hxx:418
void LoadStylesArgs(ScDocShell &rSource, bool bReplace, bool bCellStyles, bool bPageStyles)
Definition: docsh6.cxx:246
#define CONVERT_TWIPS
#define SC_UNONAME_COVRLHAS
Definition: unonames.hxx:57
OUString sDisplayName
#define SC_UNONAME_DISPNAME
Definition: unonames.hxx:150
#define SC_UNO_CTL_CLOCAL
Definition: unonames.hxx:93
#define SC_UNO_PAGE_FTRRIGHTBOR
Definition: unonames.hxx:484
#define SC_UNO_PAGE_SCALETOY
Definition: unonames.hxx:442
static const SfxItemPropertyMap * lcl_GetFooterStyleMap()
Definition: styleuno.cxx:348
#define SC_UNONAME_CCROSS
Definition: unonames.hxx:60
css::uno::Any getPropertyValue_Impl(std::u16string_view aPropertyName)
Definition: styleuno.cxx:1777
constexpr TypedWhichId< SvxForbiddenRuleItem > ATTR_FORBIDDEN_RULES(128)
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo
#define MID_UP_MARGIN
#define SC_UNONAME_LOADPAGE
Definition: unonames.hxx:155