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