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/justifyitem.hxx>
25 #include <editeng/langitem.hxx>
26 #include <editeng/numitem.hxx>
27 #include <editeng/shaditem.hxx>
28 #include <svx/pageitem.hxx>
29 #include <editeng/pbinitem.hxx>
30 #include <svx/unomid.hxx>
31 #include <editeng/unonrule.hxx>
32 #include <sfx2/bindings.hxx>
33 #include <sfx2/printer.hxx>
34 #include <sfx2/sfxsids.hrc>
35 #include <vcl/virdev.hxx>
36 #include <vcl/svapp.hxx>
37 #include <svl/itempool.hxx>
38 #include <svl/itemset.hxx>
39 #include <svl/intitem.hxx>
40 #include <svl/zformat.hxx>
41 #include <tools/fract.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  {OUString(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  { OUString(), 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  {OUString(SC_UNONAME_DISPNAME), SC_WID_UNO_DISPNAME,::cppu::UnoType<OUString>::get(), beans::PropertyAttribute::READONLY, 0 },
198 
226 
254 
295  { OUString(), 0, css::uno::Type(), 0, 0 }
296  };
297  static SfxItemPropertySet aPageStyleSet_Impl( aPageStyleMap_Impl );
298  return &aPageStyleSet_Impl;
299 }
300 
301 // map with content of the Header-Item-Sets
302 
304 {
305  static const SfxItemPropertyMapEntry aHeaderStyleMap_Impl[] =
306  {
335  { OUString(), 0, css::uno::Type(), 0, 0 }
336  };
337  static SfxItemPropertyMap aHeaderStyleMap( aHeaderStyleMap_Impl );
338  return &aHeaderStyleMap;
339 }
340 
341 // map with content of the Footer-Item-Sets
342 
344 {
345  static const SfxItemPropertyMapEntry aFooterStyleMap_Impl[] =
346  {
375  { OUString(), 0, css::uno::Type(), 0, 0 }
376  };
377  static SfxItemPropertyMap aFooterStyleMap( aFooterStyleMap_Impl );
378  return &aFooterStyleMap;
379 }
380 
381 // access index on the style types: 0 = Cell, 1 = Page
382 
383 #define SC_STYLE_FAMILY_COUNT 2
384 
385 #define SC_FAMILYNAME_CELL "CellStyles"
386 #define SC_FAMILYNAME_PAGE "PageStyles"
387 
388 const SfxStyleFamily aStyleFamilyTypes[SC_STYLE_FAMILY_COUNT] = { SfxStyleFamily::Para, SfxStyleFamily::Page };
389 
390 using sc::HMMToTwips;
391 using sc::TwipsToHMM;
392 
393 #define SCSTYLE_SERVICE "com.sun.star.style.Style"
394 #define SCCELLSTYLE_SERVICE "com.sun.star.style.CellStyle"
395 #define SCPAGESTYLE_SERVICE "com.sun.star.style.PageStyle"
396 
397 SC_SIMPLE_SERVICE_INFO( ScStyleFamiliesObj, "ScStyleFamiliesObj", "com.sun.star.style.StyleFamilies" )
398 SC_SIMPLE_SERVICE_INFO( ScStyleFamilyObj, "ScStyleFamilyObj", "com.sun.star.style.StyleFamily" )
399 
400 #define SC_PAPERBIN_DEFAULTNAME "[From printer settings]"
401 
402 static bool lcl_AnyTabProtected( const ScDocument& rDoc )
403 {
404  SCTAB nTabCount = rDoc.GetTableCount();
405  for (SCTAB i=0; i<nTabCount; i++)
406  if (rDoc.IsTabProtected(i))
407  return true;
408  return false;
409 }
410 
412  pDocShell( pDocSh )
413 {
415 }
416 
418 {
419  SolarMutexGuard g;
420 
421  if (pDocShell)
423 }
424 
426 {
427  // reference update does not matter here
428 
429  if ( rHint.GetId() == SfxHintId::Dying )
430  {
431  pDocShell = nullptr;
432  }
433 }
434 
435 // XStyleFamilies
436 
438 {
439  if ( pDocShell )
440  {
441  if ( nType == SfxStyleFamily::Para )
442  return new ScStyleFamilyObj( pDocShell, SfxStyleFamily::Para );
443  else if ( nType == SfxStyleFamily::Page )
444  return new ScStyleFamilyObj( pDocShell, SfxStyleFamily::Page );
445  }
446  OSL_FAIL("getStyleFamilyByType: no DocShell or wrong SfxStyleFamily");
447  return nullptr;
448 }
449 
450 ScStyleFamilyObj* ScStyleFamiliesObj::GetObjectByIndex_Impl(sal_uInt32 nIndex) const
451 {
452  if ( nIndex < SC_STYLE_FAMILY_COUNT )
453  return GetObjectByType_Impl(aStyleFamilyTypes[nIndex]);
454 
455  return nullptr; // invalid index
456 }
457 
458 ScStyleFamilyObj* ScStyleFamiliesObj::GetObjectByName_Impl(const OUString& aName) const
459 {
460  if ( pDocShell )
461  {
462  if ( aName == SC_FAMILYNAME_CELL )
463  return new ScStyleFamilyObj( pDocShell, SfxStyleFamily::Para );
464  else if ( aName == SC_FAMILYNAME_PAGE )
465  return new ScStyleFamilyObj( pDocShell, SfxStyleFamily::Page );
466  }
467  // no assertion - called directly from getByName
468  return nullptr;
469 }
470 
471 // container::XIndexAccess
472 
473 sal_Int32 SAL_CALL ScStyleFamiliesObj::getCount()
474 {
475  return SC_STYLE_FAMILY_COUNT;
476 }
477 
478 uno::Any SAL_CALL ScStyleFamiliesObj::getByIndex( sal_Int32 nIndex )
479 {
480  SolarMutexGuard aGuard;
481  uno::Reference< container::XNameContainer > xFamily(GetObjectByIndex_Impl(nIndex));
482  if (!xFamily.is())
483  throw lang::IndexOutOfBoundsException();
484 
485  return uno::makeAny(xFamily);
486 }
487 
489 {
490  SolarMutexGuard aGuard;
491  return cppu::UnoType<container::XNameContainer>::get(); // has to fit to getByIndex
492 }
493 
495 {
496  SolarMutexGuard aGuard;
497  return ( getCount() != 0 );
498 }
499 
500 // container::XNameAccess
501 
502 uno::Any SAL_CALL ScStyleFamiliesObj::getByName( const OUString& aName )
503 {
504  SolarMutexGuard aGuard;
505  uno::Reference< container::XNameContainer > xFamily(GetObjectByName_Impl(aName));
506  if (!xFamily.is())
507  throw container::NoSuchElementException();
508 
509  return uno::makeAny(xFamily);
510 }
511 
512 uno::Sequence<OUString> SAL_CALL ScStyleFamiliesObj::getElementNames()
513 {
515 }
516 
517 sal_Bool SAL_CALL ScStyleFamiliesObj::hasByName( const OUString& aName )
518 {
519  return aName == SC_FAMILYNAME_CELL || aName == SC_FAMILYNAME_PAGE;
520 }
521 
522 // style::XStyleLoader
523 
524 void SAL_CALL ScStyleFamiliesObj::loadStylesFromURL( const OUString& aURL,
525  const uno::Sequence<beans::PropertyValue>& aOptions )
526 {
529 
530  OUString aFilter; // empty - detect
531  OUString aFiltOpt;
532  uno::Reference<io::XInputStream> xInputStream;
533  if (aURL == "private:stream")
534  {
535  for (const auto& rProp : aOptions)
536  {
537  if (rProp.Name == "InputStream")
538  {
539  rProp.Value >>= xInputStream;
540  if (!xInputStream.is())
541  {
542  throw lang::IllegalArgumentException(
543  "Parameter 'InputStream' could not be converted "
544  "to type 'com::sun::star::io::XInputStream'",
545  nullptr, 0);
546  }
547  break;
548  }
549  }
550  }
551 
552  ScDocumentLoader aLoader( aURL, aFilter, aFiltOpt, 0, nullptr, xInputStream );
553 
554  ScDocShell* pSource = aLoader.GetDocShell();
555 
556  loadStylesFromDocShell(pSource, aOptions);
557 }
558 
559 uno::Sequence<beans::PropertyValue> SAL_CALL ScStyleFamiliesObj::getStyleLoaderOptions()
560 {
561  // return defaults for options (?)
563  { SC_UNONAME_OVERWSTL, uno::Any(true) },
564  { SC_UNONAME_LOADCELL, uno::Any(true) },
565  { SC_UNONAME_LOADPAGE, uno::Any(true) }
566  });
567 }
568 
569 // style::XStyleLoader2
570 
571 void SAL_CALL ScStyleFamiliesObj::loadStylesFromDocument( const uno::Reference < lang::XComponent > & aSourceComponent,
572  const uno::Sequence<beans::PropertyValue>& aOptions )
573 {
574  // Source document docShell
575  if ( !aSourceComponent.is() )
576  throw uno::RuntimeException();
577 
578  ScDocShell* pDocShellSrc = dynamic_cast<ScDocShell*> (SfxObjectShell::GetShellFromComponent(aSourceComponent));
579 
580  loadStylesFromDocShell(pDocShellSrc, aOptions);
581 }
582 
583 // private
584 
586  const uno::Sequence<beans::PropertyValue>& aOptions )
587 {
588 
589  if ( pSource && pDocShell )
590  {
591  // collect options
592 
593  bool bLoadReplace = true; // defaults
594  bool bLoadCellStyles = true;
595  bool bLoadPageStyles = true;
596 
597  for (const beans::PropertyValue& rProp : aOptions)
598  {
599  OUString aPropName(rProp.Name);
600 
601  if (aPropName == SC_UNONAME_OVERWSTL)
602  bLoadReplace = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
603  else if (aPropName == SC_UNONAME_LOADCELL)
604  bLoadCellStyles = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
605  else if (aPropName == SC_UNONAME_LOADPAGE)
606  bLoadPageStyles = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
607  }
608 
609  pDocShell->LoadStylesArgs( *pSource, bLoadReplace, bLoadCellStyles, bLoadPageStyles );
610  pDocShell->SetDocumentModified(); // paint is inside LoadStyles
611  }
612 }
613 
615  pDocShell( pDocSh ),
616  eFamily( eFam )
617 {
619 }
620 
622 {
623  SolarMutexGuard g;
624 
625  if (pDocShell)
627 }
628 
630 {
631  // reference update does not matter here
632 
633  if ( rHint.GetId() == SfxHintId::Dying )
634  {
635  pDocShell = nullptr; // has become invalid
636  }
637 }
638 
639 // XStyleFamily
640 
642 {
643  if ( pDocShell )
644  {
645  ScDocument& rDoc = pDocShell->GetDocument();
646  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
647 
648  SfxStyleSheetIterator aIter( pStylePool, eFamily );
649  if ( nIndex < aIter.Count() )
650  {
651  SfxStyleSheetBase* pStyle = aIter[static_cast<sal_uInt16>(nIndex)];
652  if ( pStyle )
653  {
654  return new ScStyleObj( pDocShell, eFamily, pStyle->GetName() );
655  }
656  }
657  }
658  return nullptr;
659 }
660 
662 {
663  if ( pDocShell )
664  {
665  ScDocument& rDoc = pDocShell->GetDocument();
666  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
667  if ( pStylePool->Find( aName, eFamily ) )
668  return new ScStyleObj( pDocShell, eFamily, aName );
669  }
670  return nullptr;
671 }
672 
673 void SAL_CALL ScStyleFamilyObj::insertByName( const OUString& aName, const uno::Any& aElement )
674 {
675  SolarMutexGuard aGuard;
676  bool bDone = false;
677  // reflection does not need to be uno::XInterface, can be any interface...
678  uno::Reference< uno::XInterface > xInterface(aElement, uno::UNO_QUERY);
679  if ( xInterface.is() )
680  {
681  ScStyleObj* pStyleObj = comphelper::getUnoTunnelImplementation<ScStyleObj>( xInterface );
682  if ( pStyleObj && pStyleObj->GetFamily() == eFamily &&
683  !pStyleObj->IsInserted() ) // not yet inserted?
684  {
685  OUString aNameStr(ScStyleNameConversion::ProgrammaticToDisplayName( aName, eFamily ));
686 
687  ScDocument& rDoc = pDocShell->GetDocument();
688  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
689 
692 
693  if ( pStylePool->Find( aNameStr, eFamily ) ) // not available yet
694  throw container::ElementExistException();
695 
696  (void)pStylePool->Make( aNameStr, eFamily, SfxStyleSearchBits::UserDefined );
697 
698  if ( eFamily == SfxStyleFamily::Para && !rDoc.IsImportingXML() )
699  rDoc.GetPool()->CellStyleCreated( aNameStr, &rDoc );
700 
701  pStyleObj->InitDoc( pDocShell, aNameStr ); // object can be used
702 
703  if (!rDoc.IsImportingXML())
704  pDocShell->SetDocumentModified(); // new style not used yet
705  bDone = true;
706 
707  }
708  }
709 
710  if (!bDone)
711  {
712  // other errors are handled above
713  throw lang::IllegalArgumentException();
714  }
715 }
716 
717 void SAL_CALL ScStyleFamilyObj::replaceByName( const OUString& aName, const uno::Any& aElement )
718 {
719  SolarMutexGuard aGuard;
721  removeByName( aName );
722  insertByName( aName, aElement );
723 }
724 
725 void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName )
726 {
727  SolarMutexGuard aGuard;
728  bool bFound = false;
729  if ( pDocShell )
730  {
731  OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, eFamily ));
732 
733  ScDocument& rDoc = pDocShell->GetDocument();
734  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
735 
738 
739  SfxStyleSheetBase* pStyle = pStylePool->Find( aString, eFamily );
740  if (pStyle)
741  {
742  bFound = true;
743  if ( eFamily == SfxStyleFamily::Para )
744  {
745  // like ScViewFunc::RemoveStyleSheetInUse
747  Point aLogic = pVDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip));
748  double nPPTX = aLogic.X() / 1000.0;
749  double nPPTY = aLogic.Y() / 1000.0;
750  Fraction aZoom(1,1);
751  rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
754 
755  pStylePool->Remove( pStyle );
756 
758  }
759  else
760  {
761  if ( rDoc.RemovePageStyleInUse( aString ) )
762  pDocShell->PageStyleModified( ScResId(STR_STYLENAME_STANDARD_PAGE), true );
763 
764  pStylePool->Remove( pStyle );
765 
766  SfxBindings* pBindings = pDocShell->GetViewBindings();
767  if (pBindings)
768  pBindings->Invalidate( SID_STYLE_FAMILY4 );
770  }
771  }
772  }
773 
774  if (!bFound)
775  throw container::NoSuchElementException();
776 }
777 
778 // container::XIndexAccess
779 
780 sal_Int32 SAL_CALL ScStyleFamilyObj::getCount()
781 {
782  SolarMutexGuard aGuard;
783  if ( pDocShell )
784  {
785  ScDocument& rDoc = pDocShell->GetDocument();
786  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
787 
788  SfxStyleSheetIterator aIter( pStylePool, eFamily );
789  return aIter.Count();
790  }
791  return 0;
792 }
793 
794 uno::Any SAL_CALL ScStyleFamilyObj::getByIndex( sal_Int32 nIndex )
795 {
796  SolarMutexGuard aGuard;
797  uno::Reference< style::XStyle > xObj(GetObjectByIndex_Impl(nIndex));
798  if (!xObj.is())
799  throw lang::IndexOutOfBoundsException();
800 
801  return uno::makeAny(xObj);
802 }
803 
805 {
806  SolarMutexGuard aGuard;
807  return cppu::UnoType<style::XStyle>::get(); // has to fit to getByIndex
808 }
809 
811 {
812  SolarMutexGuard aGuard;
813  return ( getCount() != 0 );
814 }
815 
816 // container::XNameAccess
817 
818 uno::Any SAL_CALL ScStyleFamilyObj::getByName( const OUString& aName )
819 {
820  SolarMutexGuard aGuard;
821  uno::Reference< style::XStyle > xObj(
823  if (!xObj.is())
824  throw container::NoSuchElementException();
825 
826  return uno::makeAny(xObj);
827 }
828 
829 uno::Sequence<OUString> SAL_CALL ScStyleFamilyObj::getElementNames()
830 {
831  SolarMutexGuard aGuard;
832  if ( pDocShell )
833  {
834  ScDocument& rDoc = pDocShell->GetDocument();
835  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
836 
837  SfxStyleSheetIterator aIter( pStylePool, eFamily );
838  sal_uInt16 nCount = aIter.Count();
839 
840  uno::Sequence<OUString> aSeq(nCount);
841  OUString* pAry = aSeq.getArray();
842  SfxStyleSheetBase* pStyle = aIter.First();
843  sal_uInt16 nPos = 0;
844  while (pStyle)
845  {
846  OSL_ENSURE( nPos < nCount, "Count is wrong" );
847  if (nPos < nCount)
849  pStyle->GetName(), eFamily );
850  pStyle = aIter.Next();
851  }
852  return aSeq;
853  }
854  return uno::Sequence<OUString>();
855 }
856 
857 sal_Bool SAL_CALL ScStyleFamilyObj::hasByName( const OUString& aName )
858 {
859  SolarMutexGuard aGuard;
860  if ( pDocShell )
861  {
862  OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( aName, eFamily ));
863 
864  ScDocument& rDoc = pDocShell->GetDocument();
865  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
866  if ( pStylePool->Find( aString, eFamily ) )
867  return true;
868  }
869  return false;
870 }
871 
872 // XPropertySet
873 
874 uno::Reference< beans::XPropertySetInfo > SAL_CALL ScStyleFamilyObj::getPropertySetInfo( )
875 {
876  OSL_FAIL( "###unexpected!" );
877  return uno::Reference< beans::XPropertySetInfo >();
878 }
879 
880 void SAL_CALL ScStyleFamilyObj::setPropertyValue( const OUString&, const uno::Any& )
881 {
882  OSL_FAIL( "###unexpected!" );
883 }
884 
885 uno::Any SAL_CALL ScStyleFamilyObj::getPropertyValue( const OUString& sPropertyName )
886 {
887  uno::Any aRet;
888 
889  if ( sPropertyName != "DisplayName" )
890  {
891  throw beans::UnknownPropertyException( "unknown property: " + sPropertyName, static_cast<OWeakObject *>(this) );
892  }
893 
894  SolarMutexGuard aGuard;
895  const char* pResId = nullptr;
896  switch ( eFamily )
897  {
898  case SfxStyleFamily::Para:
899  pResId = STR_STYLE_FAMILY_CELL; break;
900  case SfxStyleFamily::Page:
901  pResId = STR_STYLE_FAMILY_PAGE; break;
902  default:
903  OSL_FAIL( "ScStyleFamilyObj::getPropertyValue(): invalid family" );
904  }
905  if (pResId)
906  {
907  OUString sDisplayName(ScResId(pResId));
908  aRet <<= sDisplayName;
909  }
910 
911  return aRet;
912 }
913 
914 void SAL_CALL ScStyleFamilyObj::addPropertyChangeListener( const OUString&, const uno::Reference< beans::XPropertyChangeListener >& )
915 {
916  OSL_FAIL( "###unexpected!" );
917 }
918 
919 void SAL_CALL ScStyleFamilyObj::removePropertyChangeListener( const OUString&, const uno::Reference< beans::XPropertyChangeListener >& )
920 {
921  OSL_FAIL( "###unexpected!" );
922 }
923 
924 void SAL_CALL ScStyleFamilyObj::addVetoableChangeListener( const OUString&, const uno::Reference< beans::XVetoableChangeListener >& )
925 {
926  OSL_FAIL( "###unexpected!" );
927 }
928 
929 void SAL_CALL ScStyleFamilyObj::removeVetoableChangeListener( const OUString&, const uno::Reference< beans::XVetoableChangeListener >& )
930 {
931  OSL_FAIL( "###unexpected!" );
932 }
933 
934 // default ctor is needed for reflection
935 
936 ScStyleObj::ScStyleObj(ScDocShell* pDocSh, SfxStyleFamily eFam, const OUString& rName)
937  : pPropSet( (eFam == SfxStyleFamily::Para) ? lcl_GetCellStyleSet() : lcl_GetPageStyleSet() )
938  , pDocShell(pDocSh)
939  , eFamily(eFam)
940  , aStyleName(rName)
941  , pStyle_cached(nullptr)
942 {
943  // if create by ServiceProvider then pDocShell is NULL
944 
945  if (pDocShell)
947 }
948 
949 void ScStyleObj::InitDoc( ScDocShell* pNewDocSh, const OUString& rNewName )
950 {
951  if ( pNewDocSh && !pDocShell )
952  {
953  aStyleName = rNewName;
954  pDocShell = pNewDocSh;
956  }
957 }
958 
960 {
961  SolarMutexGuard g;
962 
963  if (pDocShell)
965 }
966 
967 // XUnoTunnel
968 
970 
972 {
973  // reference update does not matter here
974 
975  if ( rHint.GetId() == SfxHintId::Dying )
976  {
977  pDocShell = nullptr; // has become invalid
978  }
979 }
980 
982 {
983  if ( bUseCachedValue )
984  return pStyle_cached;
985 
986  pStyle_cached = nullptr;
987  if ( pDocShell )
988  {
989  ScDocument& rDoc = pDocShell->GetDocument();
990  ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
991  pStyle_cached = pStylePool->Find( aStyleName, eFamily );
992  }
993  return pStyle_cached;
994 }
995 
996 // style::XStyle
997 
999 {
1000  SolarMutexGuard aGuard;
1001  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1002  if (pStyle)
1003  return pStyle->IsUserDefined();
1004  return false;
1005 }
1006 
1008 {
1009  SolarMutexGuard aGuard;
1010  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1011  if (pStyle)
1012  return pStyle->IsUsed();
1013  return false;
1014 }
1015 
1016 OUString SAL_CALL ScStyleObj::getParentStyle()
1017 {
1018  SolarMutexGuard aGuard;
1019  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1020  if (pStyle)
1022  return OUString();
1023 }
1024 
1025 void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle )
1026 {
1027  SolarMutexGuard aGuard;
1028  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1029  if (pStyle)
1030  {
1031  // cell styles cannot be modified if any sheet is protected
1032  if ( eFamily == SfxStyleFamily::Para && lcl_AnyTabProtected( pDocShell->GetDocument() ) )
1033  return;
1034 
1037 
1038  OUString aString(ScStyleNameConversion::ProgrammaticToDisplayName( rParentStyle, eFamily ));
1039  bool bOk = pStyle->SetParent( aString );
1040  if (bOk)
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 }
1071 
1072 // container::XNamed
1073 
1074 OUString SAL_CALL ScStyleObj::getName()
1075 {
1076  SolarMutexGuard aGuard;
1077  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1078  if (pStyle)
1080  return OUString();
1081 }
1082 
1083 void SAL_CALL ScStyleObj::setName( const OUString& aNewName )
1084 {
1085  SolarMutexGuard aGuard;
1086  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1087  if (pStyle)
1088  {
1089  // cell styles cannot be renamed if any sheet is protected
1090  if ( eFamily == SfxStyleFamily::Para && lcl_AnyTabProtected( pDocShell->GetDocument() ) )
1091  return;
1092 
1095 
1096  bool bOk = pStyle->SetName( aNewName );
1097  if (bOk)
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 }
1117 
1118 uno::Reference<container::XIndexReplace> ScStyleObj::CreateEmptyNumberingRules()
1119 {
1120  SvxNumRule aRule( SvxNumRuleFlags::NONE, 0, true ); // nothing supported
1121  return SvxCreateNumRule( &aRule );
1122 }
1123 
1124 // beans::XPropertyState
1125 
1126 const SfxItemSet* ScStyleObj::GetStyleItemSet_Impl( const OUString& rPropName,
1127  const SfxItemPropertySimpleEntry*& rpResultEntry )
1128 {
1129  SfxStyleSheetBase* pStyle = GetStyle_Impl( true );
1130  if ( pStyle )
1131  {
1132  const SfxItemPropertySimpleEntry* pEntry = nullptr;
1133  if ( eFamily == SfxStyleFamily::Page )
1134  {
1135  pEntry = lcl_GetHeaderStyleMap()->getByName( rPropName );
1136  if ( pEntry ) // only item-WIDs in header/footer map
1137  {
1138  rpResultEntry = pEntry;
1139  return &pStyle->GetItemSet().Get(ATTR_PAGE_HEADERSET).GetItemSet();
1140  }
1141  pEntry = lcl_GetFooterStyleMap()->getByName( rPropName );
1142  if ( pEntry ) // only item-WIDs in header/footer map
1143  {
1144  rpResultEntry = pEntry;
1145  return &pStyle->GetItemSet().Get(ATTR_PAGE_FOOTERSET).GetItemSet();
1146  }
1147  }
1148  pEntry = pPropSet->getPropertyMap().getByName( rPropName );
1149  if ( pEntry )
1150  {
1151  rpResultEntry = pEntry;
1152  return &pStyle->GetItemSet();
1153  }
1154  }
1155 
1156  rpResultEntry = nullptr;
1157  return nullptr;
1158 }
1159 
1160 beans::PropertyState ScStyleObj::getPropertyState_Impl( const OUString& aPropertyName )
1161 {
1162  beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE;
1163 
1164  const SfxItemPropertySimpleEntry* pResultEntry = nullptr;
1165  const SfxItemSet* pItemSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry );
1166 
1167  if ( pItemSet && pResultEntry )
1168  {
1169  sal_uInt16 nWhich = pResultEntry->nWID;
1170  if ( nWhich == SC_WID_UNO_TBLBORD || nWhich == SC_WID_UNO_TBLBORD2 )
1171  {
1172  nWhich = ATTR_BORDER;
1173  }
1174  if ( IsScItemWid( nWhich ) )
1175  {
1176  SfxItemState eState = pItemSet->GetItemState( nWhich, false );
1177 
1178 // // if no rotate value is set, look at orientation
1179 // //! also for a fixed value of 0 (in case orientation is ambiguous)?
1180 // if ( nWhich == ATTR_ROTATE_VALUE && eState == SfxItemState::DEFAULT )
1181 // eState = pItemSet->GetItemState( ATTR_ORIENTATION, sal_False );
1182 
1183  if ( eState == SfxItemState::SET )
1184  eRet = beans::PropertyState_DIRECT_VALUE;
1185  else if ( eState == SfxItemState::DEFAULT )
1186  eRet = beans::PropertyState_DEFAULT_VALUE;
1187  else if ( eState == SfxItemState::DONTCARE )
1188  eRet = beans::PropertyState_AMBIGUOUS_VALUE; // should not happen
1189  else
1190  {
1191  OSL_FAIL("unknown ItemState");
1192  }
1193  }
1194  }
1195  return eRet;
1196 }
1197 
1198 beans::PropertyState SAL_CALL ScStyleObj::getPropertyState( const OUString& aPropertyName )
1199 {
1200  SolarMutexGuard aGuard;
1201  GetStyle_Impl();
1202 
1203  return getPropertyState_Impl( aPropertyName );
1204 }
1205 
1206 uno::Sequence<beans::PropertyState> SAL_CALL ScStyleObj::getPropertyStates( const uno::Sequence<OUString>& aPropertyNames )
1207 {
1208  SolarMutexGuard aGuard;
1209  GetStyle_Impl();
1210 
1211  uno::Sequence<beans::PropertyState> aRet( aPropertyNames.getLength() );
1212  std::transform(aPropertyNames.begin(), aPropertyNames.end(), aRet.begin(),
1213  [this](const OUString& rName) -> beans::PropertyState { return getPropertyState_Impl(rName); });
1214  return aRet;
1215 }
1216 
1217 void SAL_CALL ScStyleObj::setPropertyToDefault( const OUString& aPropertyName )
1218 {
1219  SolarMutexGuard aGuard;
1220  GetStyle_Impl();
1221 
1222  const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap().getByName( aPropertyName );
1223  if ( !pEntry )
1224  throw beans::UnknownPropertyException(aPropertyName);
1225 
1226  setPropertyValue_Impl( aPropertyName, pEntry, nullptr );
1227 }
1228 
1229 uno::Any ScStyleObj::getPropertyDefault_Impl( const OUString& aPropertyName )
1230 {
1231  uno::Any aAny;
1232 
1233  const SfxItemPropertySimpleEntry* pResultEntry = nullptr;
1234  const SfxItemSet* pStyleSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry );
1235 
1236  if ( pStyleSet && pResultEntry )
1237  {
1238  sal_uInt16 nWhich = pResultEntry->nWID;
1239 
1240  if ( IsScItemWid( nWhich ) )
1241  {
1242  // Default is default from ItemPool, not from Standard-Style,
1243  // so it is the same as in setPropertyToDefault
1244  SfxItemSet aEmptySet( *pStyleSet->GetPool(), pStyleSet->GetRanges() );
1245  // default items with wrong Slot-ID are not functional in SfxItemPropertySet3
1247  if ( aEmptySet.GetPool()->GetSlotId(nWhich) == nWhich &&
1248  aEmptySet.GetItemState(nWhich, false) == SfxItemState::DEFAULT )
1249  {
1250  aEmptySet.Put( aEmptySet.Get( nWhich ) );
1251  }
1252  const SfxItemSet* pItemSet = &aEmptySet;
1253 
1254  switch ( nWhich ) // special item handling
1255  {
1256  case ATTR_VALUE_FORMAT:
1257  // default has no language set
1258  aAny <<= sal_Int32( static_cast<const SfxUInt32Item&>(pItemSet->Get(nWhich)).GetValue() );
1259  break;
1260  case ATTR_INDENT:
1261  aAny <<= sal_Int16( TwipsToHMM(static_cast<const ScIndentItem&>(
1262  pItemSet->Get(nWhich)).GetValue()) );
1263  break;
1264  case ATTR_PAGE_SCALE:
1266  case ATTR_PAGE_FIRSTPAGENO:
1267  aAny <<= sal_Int16( static_cast<const SfxUInt16Item&>(pItemSet->Get(nWhich)).GetValue() );
1268  break;
1269  case ATTR_PAGE_CHARTS:
1270  case ATTR_PAGE_OBJECTS:
1271  case ATTR_PAGE_DRAWINGS:
1273  aAny <<= static_cast<const ScViewObjectModeItem&>(pItemSet->Get(nWhich)).GetValue() == VOBJ_MODE_SHOW;
1274  break;
1275  case ATTR_PAGE_SCALETO:
1276  {
1277  const ScPageScaleToItem aItem(static_cast<const ScPageScaleToItem&>(pItemSet->Get(nWhich)));
1278  if ( aPropertyName == SC_UNO_PAGE_SCALETOX )
1279  aAny <<= static_cast<sal_Int16>(aItem.GetWidth());
1280  else
1281  aAny <<= static_cast<sal_Int16>(aItem.GetHeight());
1282  }
1283  break;
1284  default:
1285  pPropSet->getPropertyValue( *pResultEntry, *pItemSet, aAny );
1286  }
1287  }
1288  else if ( IsScUnoWid( nWhich ) )
1289  {
1290  SfxItemSet aEmptySet( *pStyleSet->GetPool(), pStyleSet->GetRanges() );
1291  const SfxItemSet* pItemSet = &aEmptySet;
1292  switch ( nWhich )
1293  {
1294  case SC_WID_UNO_TBLBORD:
1295  case SC_WID_UNO_TBLBORD2:
1296  {
1297  const SfxPoolItem& rItem = pItemSet->Get(ATTR_BORDER);
1298  SvxBoxItem aOuter(static_cast<const SvxBoxItem&>(rItem));
1300  if (nWhich == SC_WID_UNO_TBLBORD2)
1301  ScHelperFunctions::AssignTableBorder2ToAny(aAny, aOuter, aInner, true);
1302  else
1303  ScHelperFunctions::AssignTableBorderToAny(aAny, aOuter, aInner, true);
1304  }
1305  break;
1306  }
1307  }
1308  }
1309  return aAny;
1310 }
1311 
1312 uno::Any SAL_CALL ScStyleObj::getPropertyDefault( const OUString& aPropertyName )
1313 {
1314  SolarMutexGuard aGuard;
1315  GetStyle_Impl();
1316 
1317  return getPropertyDefault_Impl( aPropertyName );
1318 }
1319 
1320 uno::Sequence<uno::Any> SAL_CALL ScStyleObj::getPropertyDefaults( const uno::Sequence<OUString>& aPropertyNames )
1321 {
1322  SolarMutexGuard aGuard;
1323  GetStyle_Impl();
1324 
1325  uno::Sequence<uno::Any> aSequence( aPropertyNames.getLength() );
1326  std::transform(aPropertyNames.begin(), aPropertyNames.end(), aSequence.begin(),
1327  [this](const OUString& rName) -> uno::Any { return getPropertyDefault_Impl(rName); });
1328  return aSequence;
1329 }
1330 
1331 // XMultiPropertySet
1332 
1333 void SAL_CALL ScStyleObj::setPropertyValues( const uno::Sequence< OUString >& aPropertyNames,
1334  const uno::Sequence< uno::Any >& aValues )
1335 {
1336  SolarMutexGuard aGuard;
1337  GetStyle_Impl();
1338 
1339  if ( aValues.getLength() != aPropertyNames.getLength() )
1340  throw lang::IllegalArgumentException();
1341 
1342  const OUString* pNames = aPropertyNames.getConstArray();
1343  const uno::Any* pValues = aValues.getConstArray();
1344  const SfxItemPropertyMap& rPropertyMap = pPropSet->getPropertyMap();
1345  for ( sal_Int32 i = 0; i < aPropertyNames.getLength(); i++ )
1346  {
1347  const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( pNames[i] );
1348  setPropertyValue_Impl( pNames[i], pEntry, &pValues[i] );
1349  }
1350 }
1351 
1352 uno::Sequence<uno::Any> SAL_CALL ScStyleObj::getPropertyValues( const uno::Sequence< OUString >& aPropertyNames )
1353 {
1354  SolarMutexGuard aGuard;
1355  GetStyle_Impl();
1356 
1357  uno::Sequence<uno::Any> aSequence( aPropertyNames.getLength() );
1358  std::transform(aPropertyNames.begin(), aPropertyNames.end(), aSequence.begin(),
1359  [this](const OUString& rName) -> uno::Any { return getPropertyValue_Impl(rName); });
1360  return aSequence;
1361 }
1362 
1363 void SAL_CALL ScStyleObj::addPropertiesChangeListener( const uno::Sequence<OUString>& /* aPropertyNames */,
1364  const uno::Reference<beans::XPropertiesChangeListener>& /* xListener */ )
1365 {
1366  // no bound properties
1367 }
1368 
1370  const uno::Reference<beans::XPropertiesChangeListener>& /* xListener */ )
1371 {
1372  // no bound properties
1373 }
1374 
1375 void SAL_CALL ScStyleObj::firePropertiesChangeEvent( const uno::Sequence<OUString>& /* aPropertyNames */,
1376  const uno::Reference<beans::XPropertiesChangeListener>& /* xListener */ )
1377 {
1378  // no bound properties
1379 }
1380 
1381 // XMultiPropertyStates
1382 // getPropertyStates already defined for XPropertyState
1383 
1385 {
1386  SolarMutexGuard aGuard;
1387 
1388  SfxStyleSheetBase* pStyle = GetStyle_Impl();
1389  if ( pStyle )
1390  {
1391  // cell styles cannot be modified if any sheet is protected
1392  if ( eFamily == SfxStyleFamily::Para && lcl_AnyTabProtected( pDocShell->GetDocument() ) )
1393  throw uno::RuntimeException();
1394 
1395  SfxItemSet& rSet = pStyle->GetItemSet();
1396  rSet.ClearItem(); // set all items to default
1397 
1399 
1400  ScDocument& rDoc = pDocShell->GetDocument();
1401  if ( eFamily == SfxStyleFamily::Para )
1402  {
1403  // row heights
1404 
1406  Point aLogic = pVDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip));
1407  double nPPTX = aLogic.X() / 1000.0;
1408  double nPPTY = aLogic.Y() / 1000.0;
1409  Fraction aZoom(1,1);
1410  rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
1411 
1412  if (!rDoc.IsImportingXML())
1413  {
1416  }
1417  }
1418  else
1419  {
1420  // #i22448# apply the default BoxInfoItem for page styles again
1421  // (same content as in ScStyleSheet::GetItemSet, to control the dialog)
1422  SvxBoxInfoItem aBoxInfoItem( ATTR_BORDER_INNER );
1423  aBoxInfoItem.SetTable( false );
1424  aBoxInfoItem.SetDist( true );
1425  aBoxInfoItem.SetValid( SvxBoxInfoItemValidFlags::DISTANCE );
1426  rSet.Put( aBoxInfoItem );
1427 
1429  }
1430  }
1431 }
1432 
1433 void SAL_CALL ScStyleObj::setPropertiesToDefault( const uno::Sequence<OUString>& aPropertyNames )
1434 {
1435  SolarMutexGuard aGuard;
1436  GetStyle_Impl();
1437 
1438  const SfxItemPropertyMap& rPropertyMap = pPropSet->getPropertyMap();
1439  for ( const OUString& rName : aPropertyNames )
1440  {
1441  const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( rName );
1442  setPropertyValue_Impl( rName, pEntry, nullptr );
1443  }
1444 }
1445 
1446 // beans::XPropertySet
1447 
1448 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScStyleObj::getPropertySetInfo()
1449 {
1450  SolarMutexGuard aGuard;
1451  return pPropSet->getPropertySetInfo();
1452 }
1453 
1454 void SAL_CALL ScStyleObj::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
1455 {
1456  SolarMutexGuard aGuard;
1457  GetStyle_Impl();
1458 
1459  const SfxItemPropertySimpleEntry* pEntry = pPropSet->getPropertyMap().getByName( aPropertyName );
1460  if ( !pEntry )
1461  throw beans::UnknownPropertyException(aPropertyName);
1462 
1463  setPropertyValue_Impl( aPropertyName, pEntry, &aValue );
1464 }
1465 
1466 void ScStyleObj::setPropertyValue_Impl( const OUString& rPropertyName, const SfxItemPropertySimpleEntry* pEntry, const uno::Any* pValue )
1467 {
1468  SfxStyleSheetBase* pStyle = GetStyle_Impl( true );
1469  if ( pStyle && pEntry )
1470  {
1471  // cell styles cannot be modified if any sheet is protected
1472  if ( eFamily == SfxStyleFamily::Para && lcl_AnyTabProtected( pDocShell->GetDocument() ) )
1473  throw uno::RuntimeException();
1474 
1475  SfxItemSet& rSet = pStyle->GetItemSet(); // change directly in active Style
1476  bool bDone = false;
1477  if ( eFamily == SfxStyleFamily::Page )
1478  {
1479  if(pEntry->nWID == SC_WID_UNO_HEADERSET)
1480  {
1481  const SfxItemPropertySimpleEntry* pHeaderEntry = lcl_GetHeaderStyleMap()->getByName( rPropertyName );
1482  if ( pHeaderEntry ) // only item-WIDs in header/footer map
1483  {
1484  SvxSetItem aNewHeader( rSet.Get(ATTR_PAGE_HEADERSET) );
1485  if (pValue)
1486  pPropSet->setPropertyValue( *pHeaderEntry, *pValue, aNewHeader.GetItemSet() );
1487  else
1488  aNewHeader.GetItemSet().ClearItem( pHeaderEntry->nWID );
1489  rSet.Put( aNewHeader );
1490  bDone = true;
1491  }
1492  }
1493  else if(pEntry->nWID == SC_WID_UNO_FOOTERSET)
1494  {
1495  const SfxItemPropertySimpleEntry* pFooterEntry = lcl_GetFooterStyleMap()->getByName( rPropertyName );
1496  if ( pFooterEntry ) // only item-WIDs in header/footer map
1497  {
1498  SvxSetItem aNewFooter( rSet.Get(ATTR_PAGE_FOOTERSET) );
1499  if (pValue)
1500  pPropSet->setPropertyValue( *pFooterEntry, *pValue, aNewFooter.GetItemSet() );
1501  else
1502  aNewFooter.GetItemSet().ClearItem( pFooterEntry->nWID );
1503  rSet.Put( aNewFooter );
1504  bDone = true;
1505  }
1506  }
1507  }
1508  if (!bDone)
1509  {
1510  if (IsScItemWid(pEntry->nWID))
1511  {
1512  if (pValue)
1513  {
1514  switch (pEntry->nWID) // special item handling
1515  {
1516  case ATTR_VALUE_FORMAT:
1517  {
1518  // language for number formats
1519  SvNumberFormatter* pFormatter
1521  sal_uInt32 nOldFormat = rSet.Get(ATTR_VALUE_FORMAT).GetValue();
1522  LanguageType eOldLang
1523  = rSet.Get(ATTR_LANGUAGE_FORMAT).GetLanguage();
1524  pFormatter->GetFormatForLanguageIfBuiltIn(nOldFormat, eOldLang);
1525 
1526  sal_uInt32 nNewFormat = 0;
1527  *pValue >>= nNewFormat;
1528  rSet.Put(SfxUInt32Item(ATTR_VALUE_FORMAT, nNewFormat));
1529 
1530  const SvNumberformat* pNewEntry = pFormatter->GetEntry(nNewFormat);
1531  LanguageType eNewLang
1532  = pNewEntry ? pNewEntry->GetLanguage() : LANGUAGE_DONTKNOW;
1533  if (eNewLang != eOldLang && eNewLang != LANGUAGE_DONTKNOW)
1534  rSet.Put(SvxLanguageItem(eNewLang, ATTR_LANGUAGE_FORMAT));
1535 
1537  }
1538  break;
1539  case ATTR_INDENT:
1540  {
1541  sal_Int16 nVal = 0;
1542  *pValue >>= nVal;
1543  rSet.Put(ScIndentItem(static_cast<sal_uInt16>(HMMToTwips(nVal))));
1544  }
1545  break;
1546  case ATTR_ROTATE_VALUE:
1547  {
1548  sal_Int32 nRotVal = 0;
1549  if (*pValue >>= nRotVal)
1550  {
1551  // stored value is always between 0 and 360 deg.
1552  nRotVal %= 36000;
1553  if (nRotVal < 0)
1554  nRotVal += 36000;
1555  rSet.Put(ScRotateValueItem(nRotVal));
1556  }
1557  }
1558  break;
1559  case ATTR_STACKED:
1560  {
1561  table::CellOrientation eOrient;
1562  if (*pValue >>= eOrient)
1563  {
1564  switch (eOrient)
1565  {
1566  case table::CellOrientation_STANDARD:
1567  rSet.Put(ScVerticalStackCell(false));
1568  break;
1569  case table::CellOrientation_TOPBOTTOM:
1570  rSet.Put(ScVerticalStackCell(false));
1571  rSet.Put(ScRotateValueItem(27000));
1572  break;
1573  case table::CellOrientation_BOTTOMTOP:
1574  rSet.Put(ScVerticalStackCell(false));
1575  rSet.Put(ScRotateValueItem(9000));
1576  break;
1577  case table::CellOrientation_STACKED:
1578  rSet.Put(ScVerticalStackCell(true));
1579  break;
1580  default:
1581  {
1582  // added to avoid warnings
1583  }
1584  }
1585  }
1586  }
1587  break;
1588  case ATTR_PAGE_SCALE:
1590  {
1592  rSet.ClearItem(ATTR_PAGE_SCALE);
1594  sal_Int16 nVal = 0;
1595  *pValue >>= nVal;
1596  rSet.Put(SfxUInt16Item(pEntry->nWID, nVal));
1597  }
1598  break;
1599  case ATTR_PAGE_FIRSTPAGENO:
1600  {
1601  sal_Int16 nVal = 0;
1602  *pValue >>= nVal;
1604  }
1605  break;
1606  case ATTR_PAGE_CHARTS:
1607  case ATTR_PAGE_OBJECTS:
1608  case ATTR_PAGE_DRAWINGS:
1609  {
1610  bool bBool = false;
1611  *pValue >>= bBool;
1614  pEntry->nWID, bBool ? VOBJ_MODE_SHOW : VOBJ_MODE_HIDE));
1615  }
1616  break;
1617  case ATTR_PAGE_PAPERBIN:
1618  {
1620  bool bFound = false;
1621 
1622  OUString aName;
1623  if (*pValue >>= aName)
1624  {
1625  if (aName == SC_PAPERBIN_DEFAULTNAME)
1626  bFound = true;
1627  else
1628  {
1629  Printer* pPrinter = pDocShell->GetPrinter();
1630  if (pPrinter)
1631  {
1632  const sal_uInt16 nCount = pPrinter->GetPaperBinCount();
1633  for (sal_uInt16 i = 0; i < nCount; i++)
1634  if (aName == pPrinter->GetPaperBinName(i))
1635  {
1636  nTray = static_cast<sal_uInt8>(i);
1637  bFound = true;
1638  break;
1639  }
1640  }
1641  }
1642  }
1643  if (!bFound)
1644  throw lang::IllegalArgumentException();
1645 
1646  rSet.Put(SvxPaperBinItem(ATTR_PAGE_PAPERBIN, nTray));
1647 
1648  }
1649  break;
1650  case ATTR_PAGE_SCALETO:
1651  {
1652  sal_Int16 nPages = 0;
1653  if (*pValue >>= nPages)
1654  {
1655  ScPageScaleToItem aItem = rSet.Get(ATTR_PAGE_SCALETO);
1656  if (rPropertyName == SC_UNO_PAGE_SCALETOX)
1657  aItem.SetWidth(static_cast<sal_uInt16>(nPages));
1658  else
1659  aItem.SetHeight(static_cast<sal_uInt16>(nPages));
1660  rSet.Put(aItem);
1662  rSet.ClearItem(ATTR_PAGE_SCALE);
1663  }
1664  }
1665  break;
1666  case ATTR_HIDDEN:
1667  {
1668  bool bHidden = false;
1669  if (*pValue >>= bHidden)
1670  pStyle->SetHidden(bHidden);
1671  }
1672  break;
1673  default:
1674  // default items with wrong Slot-ID are not working in SfxItemPropertySet3
1676  if (rSet.GetPool()->GetSlotId(pEntry->nWID) == pEntry->nWID
1677  && rSet.GetItemState(pEntry->nWID, false) == SfxItemState::DEFAULT)
1678  {
1679  rSet.Put(rSet.Get(pEntry->nWID));
1680  }
1681  pPropSet->setPropertyValue(*pEntry, *pValue, rSet);
1682  }
1683  }
1684  else
1685  {
1686  rSet.ClearItem(pEntry->nWID);
1687  // language for number formats
1688  if (pEntry->nWID == ATTR_VALUE_FORMAT)
1690 
1692  }
1693  }
1694  else if (IsScUnoWid(pEntry->nWID))
1695  {
1696  switch (pEntry->nWID)
1697  {
1698  case SC_WID_UNO_TBLBORD:
1699  {
1700  if (pValue)
1701  {
1702  table::TableBorder aBorder;
1703  if (*pValue >>= aBorder)
1704  {
1705  SvxBoxItem aOuter(ATTR_BORDER);
1707  ScHelperFunctions::FillBoxItems(aOuter, aInner, aBorder);
1708  rSet.Put(aOuter);
1709  }
1710  }
1711  else
1712  {
1713  rSet.ClearItem(ATTR_BORDER);
1714  }
1715  }
1716  break;
1717  case SC_WID_UNO_TBLBORD2:
1718  {
1719  if (pValue)
1720  {
1721  table::TableBorder2 aBorder2;
1722  if (*pValue >>= aBorder2)
1723  {
1724  SvxBoxItem aOuter(ATTR_BORDER);
1726  ScHelperFunctions::FillBoxItems(aOuter, aInner, aBorder2);
1727  rSet.Put(aOuter);
1728  }
1729  }
1730  else
1731  {
1732  rSet.ClearItem(ATTR_BORDER);
1733  }
1734  }
1735  break;
1736  }
1737  }
1738  }
1739 
1742 
1743  ScDocument& rDoc = pDocShell->GetDocument();
1744  if ( eFamily == SfxStyleFamily::Para )
1745  {
1746  // If we are loading, we can delay line height calculcation, because we are going to re-calc all of those
1747  // after load.
1748  if (pDocShell && !pDocShell->IsLoading())
1749  {
1750  // update line height
1752  Point aLogic = pVDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip));
1753  double nPPTX = aLogic.X() / 1000.0;
1754  double nPPTY = aLogic.Y() / 1000.0;
1755  Fraction aZoom(1,1);
1756  rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
1757 
1758  if (!rDoc.IsImportingXML())
1759  {
1762  }
1763  }
1764  }
1765  else
1766  {
1768 
1770  }
1771  }
1772 }
1773 
1774 uno::Any ScStyleObj::getPropertyValue_Impl( const OUString& aPropertyName )
1775 {
1776  uno::Any aAny;
1777  SfxStyleSheetBase* pStyle = GetStyle_Impl( true );
1778 
1779  if ( aPropertyName == SC_UNONAME_DISPNAME ) // read-only
1780  {
1781  // core always has the display name
1782  if ( pStyle )
1783  aAny <<= pStyle->GetName();
1784  }
1785  else
1786  {
1787  const SfxItemPropertySimpleEntry* pResultEntry = nullptr;
1788  const SfxItemSet* pItemSet = GetStyleItemSet_Impl( aPropertyName, pResultEntry );
1789 
1790  if ( pItemSet && pResultEntry )
1791  {
1792  sal_uInt16 nWhich = pResultEntry->nWID;
1793 
1794  if ( IsScItemWid( nWhich ) )
1795  {
1796  switch ( nWhich ) // for special item handling
1797  {
1798  case ATTR_VALUE_FORMAT:
1799  if ( pDocShell )
1800  {
1801  sal_uInt32 nOldFormat =
1802  pItemSet->Get( ATTR_VALUE_FORMAT ).GetValue();
1803  LanguageType eOldLang =
1804  pItemSet->Get( ATTR_LANGUAGE_FORMAT ).GetLanguage();
1805  nOldFormat = pDocShell->GetDocument().GetFormatTable()->
1806  GetFormatForLanguageIfBuiltIn( nOldFormat, eOldLang );
1807  aAny <<= nOldFormat;
1808  }
1809  break;
1810  case ATTR_INDENT:
1811  aAny <<= sal_Int16( TwipsToHMM(static_cast<const ScIndentItem&>(
1812  pItemSet->Get(nWhich)).GetValue()) );
1813  break;
1814  case ATTR_STACKED:
1815  {
1816  sal_Int32 nRot = pItemSet->Get(ATTR_ROTATE_VALUE).GetValue();
1817  bool bStacked = static_cast<const ScVerticalStackCell&>(pItemSet->Get(nWhich)).GetValue();
1818  SvxOrientationItem( nRot, bStacked, 0 ).QueryValue( aAny );
1819  }
1820  break;
1821  case ATTR_PAGE_SCALE:
1823  case ATTR_PAGE_FIRSTPAGENO:
1824  aAny <<= sal_Int16( static_cast<const SfxUInt16Item&>(pItemSet->Get(nWhich)).GetValue() );
1825  break;
1826  case ATTR_PAGE_CHARTS:
1827  case ATTR_PAGE_OBJECTS:
1828  case ATTR_PAGE_DRAWINGS:
1830  aAny <<= static_cast<const ScViewObjectModeItem&>(pItemSet->Get(nWhich)).GetValue() == VOBJ_MODE_SHOW;
1831  break;
1832  case ATTR_PAGE_PAPERBIN:
1833  {
1834  // property PrinterPaperTray is the name of the tray
1835 
1836  sal_uInt8 nValue = static_cast<const SvxPaperBinItem&>(pItemSet->Get(nWhich)).GetValue();
1837  OUString aName;
1838  if ( nValue == PAPERBIN_PRINTER_SETTINGS )
1839  aName = SC_PAPERBIN_DEFAULTNAME;
1840  else
1841  {
1842  Printer* pPrinter = pDocShell->GetPrinter();
1843  if (pPrinter)
1844  aName = pPrinter->GetPaperBinName( nValue );
1845  }
1846  aAny <<= aName;
1847  }
1848  break;
1849  case ATTR_PAGE_SCALETO:
1850  {
1851  const ScPageScaleToItem& aItem(pItemSet->Get(ATTR_PAGE_SCALETO));
1852  if ( aPropertyName == SC_UNO_PAGE_SCALETOX )
1853  aAny <<= static_cast<sal_Int16>(aItem.GetWidth());
1854  else
1855  aAny <<= static_cast<sal_Int16>(aItem.GetHeight());
1856  }
1857  break;
1858  case ATTR_HIDDEN:
1859  {
1860  bool bHidden = pStyle && pStyle->IsHidden();
1861  aAny <<= bHidden;
1862  }
1863  break;
1864  default:
1865  // Default-Items with wrong Slot-ID don't work in SfxItemPropertySet3
1867  if ( pItemSet->GetPool()->GetSlotId(nWhich) == nWhich &&
1868  pItemSet->GetItemState(nWhich, false) == SfxItemState::DEFAULT )
1869  {
1870  SfxItemSet aNoEmptySet( *pItemSet );
1871  aNoEmptySet.Put( aNoEmptySet.Get( nWhich ) );
1872  pPropSet->getPropertyValue( *pResultEntry, aNoEmptySet, aAny );
1873  }
1874  else
1875  pPropSet->getPropertyValue( *pResultEntry, *pItemSet, aAny );
1876  }
1877  }
1878  else if ( IsScUnoWid( nWhich ) )
1879  {
1880  switch ( nWhich )
1881  {
1882  case SC_WID_UNO_TBLBORD:
1883  case SC_WID_UNO_TBLBORD2:
1884  {
1885  const SfxPoolItem& rItem = pItemSet->Get(ATTR_BORDER);
1886  SvxBoxItem aOuter(static_cast<const SvxBoxItem&>(rItem));
1888  if (nWhich == SC_WID_UNO_TBLBORD2)
1889  ScHelperFunctions::AssignTableBorder2ToAny(aAny, aOuter, aInner,
1890  true);
1891  else
1892  ScHelperFunctions::AssignTableBorderToAny(aAny, aOuter, aInner,
1893  true);
1894  }
1895  break;
1896  }
1897  }
1898  }
1899  }
1900 
1901  return aAny;
1902 }
1903 
1904 uno::Any SAL_CALL ScStyleObj::getPropertyValue( const OUString& aPropertyName )
1905 {
1906  SolarMutexGuard aGuard;
1907  GetStyle_Impl();
1908 
1909  return getPropertyValue_Impl( aPropertyName );
1910 }
1911 
1913 
1914 // lang::XServiceInfo
1915 
1916 OUString SAL_CALL ScStyleObj::getImplementationName()
1917 {
1918  return "ScStyleObj";
1919 }
1920 
1921 sal_Bool SAL_CALL ScStyleObj::supportsService( const OUString& rServiceName )
1922 {
1923  return cppu::supportsService(this, rServiceName);
1924 }
1925 
1926 uno::Sequence<OUString> SAL_CALL ScStyleObj::getSupportedServiceNames()
1927 {
1928  const bool bPage = ( eFamily == SfxStyleFamily::Page );
1929 
1930  return {SCSTYLE_SERVICE,
1931  (bPage ? OUString(SCPAGESTYLE_SERVICE)
1932  : OUString(SCCELLSTYLE_SERVICE))};
1933 }
1934 
1935 /* 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:1025
#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)
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:1871
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_DYNAMIC(165)
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
Definition: docsh3.cxx:450
constexpr TypedWhichId< SvxLanguageItem > ATTR_LANGUAGE_FORMAT(147)
#define OLD_UNO_PAGE_FTRBACKTRAN
Definition: unonames.hxx:398
constexpr TypedWhichId< SvxSizeItem > ATTR_PAGE_SIZE(161)
#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:857
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_GRID(168)
#define SC_UNO_PAGE_RIGHTFTRCON
Definition: unonames.hxx:448
css::uno::Any getPropertyValue_Impl(const OUString &aPropertyName)
Definition: styleuno.cxx:1774
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:1016
SfxBindings * GetViewBindings()
Definition: docsh4.cxx:2577
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
Definition: styleuno.cxx:1206
constexpr TypedWhichId< SfxBoolItem > ATTR_VERTICAL_ASIAN(137)
long TwipsToHMM(long nTwips)
Definition: global.hxx:108
#define SC_UNO_CTL_CFFAMIL
Definition: unonames.hxx:88
void loadStylesFromDocShell(ScDocShell *pSource, const css::uno::Sequence< css::beans::PropertyValue > &aOptions)
Definition: styleuno.cxx:585
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:818
#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:1369
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:1083
virtual ~ScStyleFamilyObj() override
Definition: styleuno.cxx:621
#define SC_WID_UNO_TBLBORD2
Definition: unowids.hxx:73
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:971
void PageStyleModified(const OUString &rStyleName, bool bApi)
Definition: docsh4.cxx:1713
#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
static const SfxItemPropertyMap * lcl_GetHeaderStyleMap()
Definition: styleuno.cxx:303
#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:388
virtual bool SetName(const OUString &rNewName, bool bReindexNow=true)
#define SC_UNO_PAGE_HDRBRDDIST
Definition: unonames.hxx:465
void SetDocumentModified()
Definition: docsh.cxx:2819
#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:394
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: styleuno.cxx:425
#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:1454
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
Definition: styleuno.cxx:1198
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
#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:114
#define SC_UNO_PAGE_HDRBACKCOL
Definition: unonames.hxx:451
virtual OUString SAL_CALL getName() override
Definition: styleuno.cxx:1074
void Invalidate(sal_uInt16 nId)
virtual sal_Bool SAL_CALL hasElements() override
Definition: styleuno.cxx:494
ScStyleFamilyObj * GetObjectByType_Impl(SfxStyleFamily nType) const
Definition: styleuno.cxx:437
#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:473
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:1045
#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:1037
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:1375
virtual void SAL_CALL insertByName(const OUString &aName, const css::uno::Any &aElement) override
Definition: styleuno.cxx:673
#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:1904
virtual void SAL_CALL removeByName(const OUString &Name) override
Definition: styleuno.cxx:725
#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:6063
#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
virtual sal_uInt16 Count()
#define SC_UNO_PAGE_HDRSHADOW
Definition: unonames.hxx:466
ScStyleFamiliesObj(ScDocShell *pDocSh)
Definition: styleuno.cxx:411
#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:874
#define SC_UNO_PAGE_FTRTOPBDIS
Definition: unonames.hxx:487
virtual void SetHidden(bool bValue)
SfxStyleSheetBase * GetStyle_Impl(bool bUseCachedValue=false)
Definition: styleuno.cxx:981
#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:1433
#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:929
const OUString & GetName() const
#define MID_LANG_LOCALE
#define SC_UNONAME_LEFTBORDER
Definition: unonames.hxx:124
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:876
virtual sal_Bool SAL_CALL isInUse() override
Definition: styleuno.cxx:1007
constexpr TypedWhichId< SvxShadowItem > ATTR_SHADOW(152)
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:313
#define SC_UNO_PAGE_PRINTDOWN
Definition: unonames.hxx:439
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: styleuno.cxx:1448
ScStyleFamilyObj * GetObjectByIndex_Impl(sal_uInt32 nIndex) const
Definition: styleuno.cxx:450
#define SC_UNO_PAGE_SYTLELAYOUT
Definition: unonames.hxx:426
int nCount
ScStyleFamilyObj(ScDocShell *pDocSh, SfxStyleFamily eFam)
Definition: styleuno.cxx:614
ScStyleFamilyObj * GetObjectByName_Impl(const OUString &aName) const
Definition: styleuno.cxx:458
#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:804
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
virtual SfxStyleSheetBase * First()
constexpr TypedWhichId< ScShrinkToFitCell > ATTR_SHRINKTOFIT(140)
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
Definition: styleuno.cxx:502
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: styleuno.cxx:1926
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:1312
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:1352
#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
#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:383
#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:875
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:2140
#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:998
#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:1320
constexpr TypedWhichId< SvxSetItem > ATTR_PAGE_FOOTERSET(182)
#define SCPAGESTYLE_SERVICE
Definition: styleuno.cxx:395
static const SfxItemPropertySet * lcl_GetCellStyleSet()
Definition: styleuno.cxx:79
#define SC_UNONAME_CLOCAL
Definition: unonames.hxx:63
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getStyleLoaderOptions() override
Definition: styleuno.cxx:559
#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:810
#define SC_WID_UNO_HEADERSET
Definition: unowids.hxx:56
#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:517
long HMMToTwips(long nHMM)
Definition: global.hxx:109
#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:780
virtual void SAL_CALL addPropertiesChangeListener(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
Definition: styleuno.cxx:1363
#define MID_POSTURE
unsigned char sal_Bool
#define BOTTOM_BORDER_DISTANCE
OUString ScResId(const char *pId)
Definition: scdll.cxx:95
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:393
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:885
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
Definition: styleuno.cxx:829
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 setPropertyValue_Impl(const OUString &rPropertyName, const SfxItemPropertySimpleEntry *pEntry, const css::uno::Any *pValue)
Definition: styleuno.cxx:1466
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
Definition: docsh3.cxx:99
#define SC_UNONAME_PISFORBID
Definition: unonames.hxx:143
SfxItemPool * GetPool() const
#define SC_UNONAME_CELLHJUS
Definition: unonames.hxx:101
const SfxItemPropertySimpleEntry * getByName(const OUString &rName) const
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:1118
#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:880
#define SC_UNO_PAGE_BOTTBORDER
Definition: unonames.hxx:412
#define SC_UNO_PAGE_TOPBRDDIST
Definition: unonames.hxx:417
const SfxItemSet * GetStyleItemSet_Impl(const OUString &rPropName, const SfxItemPropertySimpleEntry *&rpEntry)
Definition: styleuno.cxx:1126
void AddUnoObject(SfxListener &rObject)
Definition: documen3.cxx:879
#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:386
#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:571
void CellStyleCreated(const OUString &rName, const ScDocument *pDoc)
Definition: docpool.cxx:361
#define SC_UNO_PAGE_FTRBOTTBDIS
Definition: unonames.hxx:486
virtual ~ScStyleFamiliesObj() override
Definition: styleuno.cxx:417
#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:914
void StyleSheetChanged(const SfxStyleSheetBase *pStyleSheet, bool bRemoved, OutputDevice *pDev, double nPPTX, double nPPTY, const Fraction &rZoomX, const Fraction &rZoomY)
Definition: document.cxx:4958
#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:488
#define MID_FONTHEIGHT
#define BOTTOM_BORDER
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: styleuno.cxx:1921
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: styleuno.cxx:1217
SfxItemState
#define SC_PAPERBIN_DEFAULTNAME
Definition: styleuno.cxx:400
#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:402
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:959
#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:661
#define SC_UNONAME_BOTTBORDER
Definition: unonames.hxx:123
#define OLD_UNO_PAGE_FTRSHARED
Definition: unonames.hxx:399
#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:71
#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)
#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:629
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
Definition: styleuno.cxx:512
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
#define TOP_BORDER_DISTANCE
void RemoveUnoObject(SfxListener &rObject)
Definition: documen3.cxx:887
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:401
#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:216
#define MID_PAGE_ORIENTATION
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
Definition: document.cxx:6068
#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:949
#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:794
#define SC_UNONAME_PISCHDIST
Definition: unonames.hxx:142
SfxStyleFamily GetFamily() const
Definition: styleuno.hxx:202
css::uno::Any getPropertyDefault_Impl(const OUString &aPropertyName)
Definition: styleuno.cxx:1229
#define SC_UNO_PAGE_SCALEVAL
Definition: unonames.hxx:440
ScStyleObj * GetObjectByIndex_Impl(sal_uInt32 nIndex)
Definition: styleuno.cxx:641
#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
#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:1384
virtual void SAL_CALL replaceByName(const OUString &aName, const css::uno::Any &aElement) override
Definition: styleuno.cxx:717
#define MID_RELIEF
#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:385
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)
static SfxObjectShell * GetShellFromComponent(const css::uno::Reference< css::lang::XComponent > &xComp)
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: styleuno.cxx:478
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:1333
#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:524
#define SC_UNO_PAGE_BOTTBRDDIST
Definition: unonames.hxx:416
css::beans::PropertyState getPropertyState_Impl(const OUString &PropertyName)
Definition: styleuno.cxx:1160
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:919
#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:924
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)
#define MID_SIZE_SIZE
#define SC_UNONAME_PISHANG
Definition: unonames.hxx:141
sal_Int16 nValue
bool RemovePageStyleInUse(const OUString &rStrPageStyle)
Definition: documen8.cxx:325
#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:248
#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:343
#define SC_UNONAME_CCROSS
Definition: unonames.hxx:61
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