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