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