69#include <unoprnms.hxx>
77#include <unoevent.hxx>
81#include <com/sun/star/frame/XModel.hpp>
82#include <com/sun/star/io/IOException.hpp>
83#include <com/sun/star/style/ParagraphStyleCategory.hpp>
84#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
85#include <com/sun/star/beans/PropertyAttribute.hpp>
86#include <com/sun/star/beans/NamedValue.hpp>
87#include <com/sun/star/drawing/BitmapMode.hpp>
88#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
89#include <com/sun/star/lang/IllegalArgumentException.hpp>
90#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
91#include <com/sun/star/document/XEventsSupplier.hpp>
92#include <com/sun/star/io/XInputStream.hpp>
119#include <uiitems.hxx>
124#include <string_view>
128using namespace css::io;
129using namespace css::lang;
130using namespace css::uno;
135 #define nPoolChrNormalRange (RES_POOLCHR_NORMAL_END - RES_POOLCHR_NORMAL_BEGIN)
136 #define nPoolChrHtmlRange (RES_POOLCHR_HTML_END - RES_POOLCHR_HTML_BEGIN)
137 #define nPoolCollTextRange ( RES_POOLCOLL_TEXT_END - RES_POOLCOLL_TEXT_BEGIN)
138 #define nPoolCollListsRange ( RES_POOLCOLL_LISTS_END - RES_POOLCOLL_LISTS_BEGIN)
139 #define nPoolCollExtraRange ( RES_POOLCOLL_EXTRA_END - RES_POOLCOLL_EXTRA_BEGIN)
140 #define nPoolCollRegisterRange ( RES_POOLCOLL_REGISTER_END - RES_POOLCOLL_REGISTER_BEGIN)
141 #define nPoolCollDocRange ( RES_POOLCOLL_DOC_END - RES_POOLCOLL_DOC_BEGIN)
142 #define nPoolCollHtmlRange ( RES_POOLCOLL_HTML_END - RES_POOLCOLL_HTML_BEGIN)
143 #define nPoolFrameRange ( RES_POOLFRM_END - RES_POOLFRM_BEGIN)
144 #define nPoolPageRange ( RES_POOLPAGE_END - RES_POOLPAGE_BEGIN)
145 #define nPoolNumRange ( RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN)
146 #define nPoolCollListsStackedStart ( nPoolCollTextRange)
147 #define nPoolCollExtraStackedStart ( nPoolCollListsStackedStart + nPoolCollListsRange)
148 #define nPoolCollRegisterStackedStart ( nPoolCollExtraStackedStart + nPoolCollExtraRange)
149 #define nPoolCollDocStackedStart ( nPoolCollRegisterStackedStart + nPoolCollRegisterRange)
150 #define nPoolCollHtmlStackedStart ( nPoolCollDocStackedStart + nPoolCollDocRange)
151 using paragraphstyle_t = std::remove_const<
decltype(style::ParagraphStyleCategory::TEXT)>::type;
152 using collectionbits_t = sal_uInt16;
153 struct ParagraphStyleCategoryEntry
155 paragraphstyle_t m_eCategory;
157 collectionbits_t m_nCollectionBits;
158 constexpr ParagraphStyleCategoryEntry(paragraphstyle_t eCategory,
SfxStyleSearchBits nSwStyleBits, collectionbits_t nCollectionBits)
159 : m_eCategory(eCategory)
160 , m_nSwStyleBits(nSwStyleBits)
161 , m_nCollectionBits(nCollectionBits)
165constexpr ParagraphStyleCategoryEntry sParagraphStyleCategoryEntries[]
167 { style::ParagraphStyleCategory::TEXT, SfxStyleSearchBits::SwText,
COLL_TEXT_BITS },
168 { style::ParagraphStyleCategory::CHAPTER, SfxStyleSearchBits::SwChapter,
COLL_DOC_BITS },
169 { style::ParagraphStyleCategory::LIST, SfxStyleSearchBits::SwList,
COLL_LISTS_BITS },
170 { style::ParagraphStyleCategory::INDEX, SfxStyleSearchBits::SwIndex,
COLL_REGISTER_BITS },
171 { style::ParagraphStyleCategory::EXTRA, SfxStyleSearchBits::SwExtra,
COLL_EXTRA_BITS },
172 { style::ParagraphStyleCategory::HTML, SfxStyleSearchBits::SwHtml,
COLL_HTML_BITS }
175class StyleFamilyEntry
180 return StyleFamilyEntry(f, nPropMapType, aPoolId, sName, pResId, GetCountOrName<f>, CreateStyle<f>, TranslateIndex<f>);
184 sal_uInt16 propMapType()
const {
return m_nPropMapType; }
185 const uno::Reference<beans::XPropertySetInfo>& xPSInfo()
const {
return m_xPSInfo; }
188 const TranslateId& resId()
const {
return m_pResId; }
190 sal_Int32 getCountOrName(
const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex)
const {
return m_fGetCountOrName(rDoc, pString, nIndex); }
191 css::uno::Reference<css::style::XStyle> createStyle(
SfxStyleSheetBasePool* pBasePool,
SwDocShell* pDocShell,
const OUString& sStyleName)
const {
return m_fCreateStyle(pBasePool, pDocShell, sStyleName); }
192 sal_uInt16 translateIndex(
const sal_uInt16 nIndex)
const {
return m_fTranslateIndex(nIndex); }
195 using GetCountOrName_t = sal_Int32 (*)(
const SwDoc&, OUString*, sal_Int32);
197 using TranslateIndex_t = sal_uInt16(*)(
const sal_uInt16);
199 sal_uInt16 m_nPropMapType;
200 uno::Reference<beans::XPropertySetInfo> m_xPSInfo;
204 GetCountOrName_t m_fGetCountOrName;
205 CreateStyle_t m_fCreateStyle;
206 TranslateIndex_t m_fTranslateIndex;
207 StyleFamilyEntry(
SfxStyleFamily eFamily, sal_uInt16 nPropMapType,
SwGetPoolIdFromName aPoolId, OUString sName,
TranslateId pResId, GetCountOrName_t fGetCountOrName, CreateStyle_t fCreateStyle, TranslateIndex_t fTranslateIndex)
209 , m_nPropMapType(nPropMapType)
210 , m_xPSInfo(
aSwMapProvider.GetPropertySet(nPropMapType)->getPropertySetInfo())
214 , m_fGetCountOrName(fGetCountOrName)
215 , m_fCreateStyle(fCreateStyle)
216 , m_fTranslateIndex(fTranslateIndex)
218 template<SfxStyleFamily>
static inline sal_Int32 GetCountOrName(
const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex);
219 template<SfxStyleFamily>
static inline css::uno::Reference<css::style::XStyle> CreateStyle(
SfxStyleSheetBasePool* pBasePool,
SwDocShell* pDocShell,
const OUString& sStyleName);
220 template<SfxStyleFamily>
static inline sal_uInt16 TranslateIndex(
const sal_uInt16 nIndex) {
return nIndex; }
224sal_Int32 StyleFamilyEntry::GetCountOrName<SfxStyleFamily::Char>(
const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex)
239 *pString =
SwResId(STR_POOLCHR_STANDARD);
241 *pString = pFormat->GetName();
246 return nCount + nBaseCount;
250sal_Int32 StyleFamilyEntry::GetCountOrName<SfxStyleFamily::Para>(
const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex)
257 if(pColl->IsDefault())
263 *pString = pColl->GetName();
268 return nCount + nBaseCount;
272sal_Int32 StyleFamilyEntry::GetCountOrName<SfxStyleFamily::Frame>(
const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex)
278 if(pFormat->IsDefault() || pFormat->IsAuto())
284 *pString = pFormat->GetName();
293sal_Int32 StyleFamilyEntry::GetCountOrName<SfxStyleFamily::Page>(
const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex)
298 for(
size_t i = 0;
i < nArrLen; ++
i)
315sal_Int32 StyleFamilyEntry::GetCountOrName<SfxStyleFamily::Pseudo>(
const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex)
321 if(pRule->IsAutoRule())
327 *pString = pRule->GetName();
336sal_Int32 StyleFamilyEntry::GetCountOrName<SfxStyleFamily::Table>(
const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex)
342 const sal_Int32
nCount = pAutoFormats->size();
343 if (0 <= nIndex && nIndex < nCount)
350sal_Int32 StyleFamilyEntry::GetCountOrName<SfxStyleFamily::Cell>(
const SwDoc& rDoc, OUString* pString, sal_Int32 nIndex)
354 const sal_Int32 nUsedCellStylesCount = rAutoFormats.size() * rTableTemplateMap.size();
356 if (0 <= nIndex && nIndex < nCount)
358 if (nUsedCellStylesCount > nIndex)
360 const sal_Int32 nAutoFormat =
nIndex / rTableTemplateMap.size();
361 const sal_Int32 nBoxFormat = rTableTemplateMap[
nIndex % rTableTemplateMap.size()];
373sal_uInt16 StyleFamilyEntry::TranslateIndex<SfxStyleFamily::Char>(
const sal_uInt16 nIndex)
380 throw lang::IndexOutOfBoundsException();
384sal_uInt16 StyleFamilyEntry::TranslateIndex<SfxStyleFamily::Para>(
const sal_uInt16 nIndex)
399 throw lang::IndexOutOfBoundsException();
403sal_uInt16 StyleFamilyEntry::TranslateIndex<SfxStyleFamily::Page>(
const sal_uInt16 nIndex)
407 throw lang::IndexOutOfBoundsException();
411sal_uInt16 StyleFamilyEntry::TranslateIndex<SfxStyleFamily::Frame>(
const sal_uInt16 nIndex)
415 throw lang::IndexOutOfBoundsException();
419sal_uInt16 StyleFamilyEntry::TranslateIndex<SfxStyleFamily::Pseudo>(
const sal_uInt16 nIndex)
423 throw lang::IndexOutOfBoundsException();
426const std::vector<StyleFamilyEntry>& lcl_GetStyleFamilyEntries()
428 static const std::vector<StyleFamilyEntry> our_pStyleFamilyEntries{
437 return our_pStyleFamilyEntries;
440class SwStyleBase_Impl
447 std::unique_ptr<SfxItemSet> m_pMyItemSet;
448 OUString m_rStyleName;
451 SwStyleBase_Impl(
SwDoc& rSwDoc, OUString aName,
const SwAttrSet* pParentStyle)
453 , m_pOldPageDesc(nullptr)
454 , m_pItemSet(nullptr)
456 , m_pParentStyle(pParentStyle)
469 bool HasItemSet()
const
471 return m_xNewBase.is();
476 assert(m_xNewBase.is());
479 m_pMyItemSet.reset(
new SfxItemSet(m_xNewBase->GetItemSet()));
480 m_pItemSet = m_pMyItemSet.get();
483 if(!m_pItemSet->
GetParent() && m_pParentStyle)
492 struct ItemSetOverrider
494 SwStyleBase_Impl& m_rStyleBase;
496 ItemSetOverrider(SwStyleBase_Impl& rStyleBase,
SfxItemSet* pTemp)
497 : m_rStyleBase(rStyleBase)
498 , m_pOldSet(m_rStyleBase.m_pItemSet)
499 { m_rStyleBase.m_pItemSet = pTemp; }
501 { m_rStyleBase.m_pItemSet = m_pOldSet; };
505class SwStyleProperties_Impl;
506class SwXStyle :
public cppu::WeakImplHelper
509 css::beans::XPropertySet,
510 css::beans::XMultiPropertySet,
511 css::lang::XServiceInfo,
512 css::lang::XUnoTunnel,
513 css::beans::XPropertyState,
514 css::beans::XMultiPropertyStates
520 OUString m_sStyleName;
521 const StyleFamilyEntry& m_rEntry;
522 bool m_bIsDescriptor;
523 bool m_bIsConditional;
524 OUString m_sParentStyleName;
528 std::unique_ptr<SwStyleProperties_Impl> m_pPropertiesImpl;
529 css::uno::Reference<css::container::XNameAccess> m_xStyleFamily;
530 css::uno::Reference<css::beans::XPropertySet> m_xStyleData;
534 void SetPropertyValues_Impl(
const css::uno::Sequence< OUString >& aPropertyNames,
const css::uno::Sequence< css::uno::Any >& aValues );
536 void PrepareStyleBase(SwStyleBase_Impl& rBase);
545 virtual ~SwXStyle()
override;
548 static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
551 virtual sal_Int64 SAL_CALL getSomething(
const css::uno::Sequence< sal_Int8 >& aIdentifier )
override;
554 virtual OUString SAL_CALL getName()
override;
555 virtual void SAL_CALL setName(
const OUString& Name_)
override;
558 virtual sal_Bool SAL_CALL isUserDefined()
override;
559 virtual sal_Bool SAL_CALL isInUse()
override;
560 virtual OUString SAL_CALL getParentStyle()
override;
561 virtual void SAL_CALL setParentStyle(
const OUString& aParentStyle)
override;
564 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( )
override;
565 virtual void SAL_CALL
setPropertyValue(
const OUString& aPropertyName,
const css::uno::Any& aValue )
override;
566 virtual css::uno::Any SAL_CALL
getPropertyValue(
const OUString& PropertyName )
override;
567 virtual void SAL_CALL addPropertyChangeListener(
const OUString&,
const css::uno::Reference< css::beans::XPropertyChangeListener >& )
override
568 { OSL_FAIL(
"not implemented"); };
569 virtual void SAL_CALL removePropertyChangeListener(
const OUString&,
const css::uno::Reference< css::beans::XPropertyChangeListener >& )
override
570 { OSL_FAIL(
"not implemented"); };
571 virtual void SAL_CALL addVetoableChangeListener(
const OUString&,
const css::uno::Reference< css::beans::XVetoableChangeListener >& )
override
572 { OSL_FAIL(
"not implemented"); };
573 virtual void SAL_CALL removeVetoableChangeListener(
const OUString&,
const css::uno::Reference< css::beans::XVetoableChangeListener >& )
override
574 { OSL_FAIL(
"not implemented"); };
577 virtual void SAL_CALL setPropertyValues(
const css::uno::Sequence< OUString >& aPropertyNames,
const css::uno::Sequence< css::uno::Any >& aValues )
override;
578 virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues(
const css::uno::Sequence< OUString >& aPropertyNames )
override;
579 virtual void SAL_CALL addPropertiesChangeListener(
const css::uno::Sequence< OUString >&,
const css::uno::Reference< css::beans::XPropertiesChangeListener >& )
override
581 virtual void SAL_CALL removePropertiesChangeListener(
const css::uno::Reference< css::beans::XPropertiesChangeListener >& )
override
583 virtual void SAL_CALL firePropertiesChangeEvent(
const css::uno::Sequence< OUString >&,
const css::uno::Reference< css::beans::XPropertiesChangeListener >& )
override
587 virtual css::beans::PropertyState SAL_CALL getPropertyState(
const OUString& PropertyName )
override;
588 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(
const css::uno::Sequence< OUString >& aPropertyName )
override;
589 virtual void SAL_CALL setPropertyToDefault(
const OUString& PropertyName )
override;
590 virtual css::uno::Any SAL_CALL getPropertyDefault(
const OUString& aPropertyName )
override;
593 virtual void SAL_CALL setAllPropertiesToDefault( )
override;
594 virtual void SAL_CALL setPropertiesToDefault(
const css::uno::Sequence< OUString >& aPropertyNames )
override;
595 virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyDefaults(
const css::uno::Sequence< OUString >& aPropertyNames )
override;
599 {
return {
"SwXStyle"}; };
608 const OUString& GetStyleName()
const {
return m_sStyleName;}
611 bool IsDescriptor()
const {
return m_bIsDescriptor;}
612 bool IsConditional()
const {
return m_bIsConditional;}
613 const OUString& GetParentStyleName()
const {
return m_sParentStyleName;}
616 m_bIsDescriptor =
false; m_pDoc = pDc;
620 SwDoc* GetDoc()
const {
return m_pDoc; }
622 void ApplyDescriptorProperties();
623 void SetStyleName(
const OUString& rSet){ m_sStyleName =
rSet;}
632typedef cppu::ImplInheritanceHelper< SwXStyle, css::document::XEventsSupplier> SwXFrameStyle_Base;
634 :
public SwXFrameStyle_Base
640 const OUString& rStyleName) :
642 explicit SwXFrameStyle(
SwDoc *pDoc);
644 virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents( )
override;
657 void SetPropertyValues_Impl(
const css::uno::Sequence< OUString >& aPropertyNames,
const css::uno::Sequence< css::uno::Any >& aValues );
658 css::uno::Sequence< css::uno::Any > GetPropertyValues_Impl(
const css::uno::Sequence< OUString >& aPropertyNames );
664 virtual void SAL_CALL
setPropertyValue(
const OUString& aPropertyName,
const css::uno::Any& aValue )
override;
665 virtual css::uno::Any SAL_CALL
getPropertyValue(
const OUString& PropertyName )
override;
667 virtual void SAL_CALL setPropertyValues(
const css::uno::Sequence< OUString >& aPropertyNames,
const css::uno::Sequence< css::uno::Any >& aValues )
override;
668 virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues(
const css::uno::Sequence< OUString >& aPropertyNames )
override;
671class SwStyleProperties_Impl
674 std::map<OUString, uno::Any> m_vPropertyValues;
680 bool AllowsKey(std::u16string_view rName)
684 bool SetProperty(
const OUString& rName,
const uno::Any& rValue)
686 if(!AllowsKey(rName))
688 m_vPropertyValues[rName] = rValue;
693 if(!AllowsKey(rName))
698 pAny = &m_vPropertyValues[rName];
701 bool ClearProperty(
const OUString& rName )
703 if(!AllowsKey(rName))
705 m_vPropertyValues[rName] =
uno::Any();
708 void ClearAllProperties( )
709 { m_vPropertyValues.clear(); }
710 void Apply(SwXStyle& rStyle)
712 for(
const auto& rPropertyPair : m_vPropertyValues)
714 if(rPropertyPair.second.hasValue())
715 rStyle.setPropertyValue(rPropertyPair.first, rPropertyPair.second);
720template<SfxStyleFamily eFamily>
721css::uno::Reference<css::style::XStyle> StyleFamilyEntry::CreateStyle(
SfxStyleSheetBasePool* pBasePool,
SwDocShell* pDocShell,
const OUString& sStyleName)
723 return pBasePool ?
new SwXStyle(pBasePool, eFamily, pDocShell->
GetDoc(), sStyleName) : new SwXStyle(pDocShell->GetDoc(), eFamily, false);
727css::uno::Reference<css::style::XStyle> StyleFamilyEntry::CreateStyle<SfxStyleFamily::Frame>(
SfxStyleSheetBasePool* pBasePool,
SwDocShell* pDocShell,
const OUString& sStyleName)
729 return pBasePool ?
new SwXFrameStyle(*pBasePool, pDocShell->
GetDoc(), sStyleName) : new SwXFrameStyle(pDocShell->GetDoc());
733css::uno::Reference<css::style::XStyle> StyleFamilyEntry::CreateStyle<SfxStyleFamily::Page>(
SfxStyleSheetBasePool* pBasePool,
SwDocShell* pDocShell,
const OUString& sStyleName)
735 return pBasePool ?
new SwXPageStyle(*pBasePool, pDocShell, sStyleName) : new SwXPageStyle(pDocShell);
739css::uno::Reference<css::style::XStyle> StyleFamilyEntry::CreateStyle<SfxStyleFamily::Table>(
SfxStyleSheetBasePool* ,
SwDocShell* pDocShell,
const OUString& sStyleName)
745css::uno::Reference<css::style::XStyle> StyleFamilyEntry::CreateStyle<SfxStyleFamily::Cell>(
SfxStyleSheetBasePool* ,
SwDocShell* pDocShell,
const OUString& sStyleName)
750class XStyleFamily :
public cppu::WeakImplHelper
752 container::XNameContainer,
754 container::XIndexAccess,
759 const StyleFamilyEntry& m_rEntry;
763 SwXStyle* FindStyle(std::u16string_view rStyleName)
const;
764 sal_Int32 GetCountOrName(OUString* pString, sal_Int32 nIndex = SAL_MAX_INT32)
765 {
return m_rEntry.getCountOrName(*m_pDocShell->
GetDoc(), pString, nIndex); };
768 auto& entries = lcl_GetStyleFamilyEntries();
769 const auto pEntry = std::find_if(entries.begin(), entries.end(),
770 [eFamily] (
const StyleFamilyEntry& e) { return e.family() == eFamily; });
771 assert(pEntry != entries.end());
776 : m_rEntry(InitEntry(eFamily))
777 , m_pBasePool(pDocShell->GetStyleSheetPool())
778 , m_pDocShell(pDocShell)
785 virtual sal_Int32 SAL_CALL getCount()
override
788 return GetCountOrName(
nullptr);
790 virtual uno::Any SAL_CALL getByIndex(sal_Int32 nIndex)
override;
793 virtual uno::Type SAL_CALL getElementType( )
override
795 virtual sal_Bool SAL_CALL hasElements( )
override
798 throw uno::RuntimeException();
803 virtual uno::Any SAL_CALL getByName(
const OUString& Name)
override;
804 virtual uno::Sequence< OUString > SAL_CALL getElementNames()
override;
805 virtual sal_Bool SAL_CALL hasByName(
const OUString& Name)
override;
808 virtual void SAL_CALL insertByName(
const OUString& Name,
const uno::Any& Element)
override;
809 virtual void SAL_CALL replaceByName(
const OUString& Name,
const uno::Any& Element)
override;
810 virtual void SAL_CALL removeByName(
const OUString& Name)
override;
813 virtual uno::Reference< beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( )
override
816 {
SAL_WARN(
"sw.uno",
"###unexpected!"); };
818 virtual void SAL_CALL addPropertyChangeListener(
const OUString&,
const uno::Reference<beans::XPropertyChangeListener>&)
override
819 {
SAL_WARN(
"sw.uno",
"###unexpected!"); };
820 virtual void SAL_CALL removePropertyChangeListener(
const OUString&,
const uno::Reference<beans::XPropertyChangeListener>&)
override
821 {
SAL_WARN(
"sw.uno",
"###unexpected!"); };
822 virtual void SAL_CALL addVetoableChangeListener(
const OUString&,
const uno::Reference<beans::XVetoableChangeListener>&)
override
823 {
SAL_WARN(
"sw.uno",
"###unexpected!"); };
824 virtual void SAL_CALL removeVetoableChangeListener(
const OUString&,
const uno::Reference<beans::XVetoableChangeListener>&)
override
825 {
SAL_WARN(
"sw.uno",
"###unexpected!"); };
830 if(rHint.
GetId() == SfxHintId::Dying)
832 m_pBasePool =
nullptr;
833 m_pDocShell =
nullptr;
840 {
return {
"XStyleFamily"}; };
844 {
return {
"com.sun.star.style.StyleFamily" }; }
849 {
return {
"SwXStyleFamilies"}; }
857 {
return {
"com.sun.star.style.StyleFamilies" }; }
861 m_pDocShell(&rDocShell)
871 throw uno::RuntimeException();
872 auto& entries(lcl_GetStyleFamilyEntries());
873 const auto pEntry = std::find_if(entries.begin(), entries.end(),
874 [&
Name] (
const StyleFamilyEntry& e) { return e.name() == Name; });
875 if(pEntry == entries.end())
876 throw container::NoSuchElementException();
882 auto& entries(lcl_GetStyleFamilyEntries());
883 uno::Sequence<OUString> aNames(entries.size());
884 std::transform(entries.begin(), entries.end(),
885 aNames.getArray(), [] (
const StyleFamilyEntry& e) { return e.name(); });
891 auto& entries(lcl_GetStyleFamilyEntries());
892 return std::any_of(entries.begin(), entries.end(),
893 [&
Name] (
const StyleFamilyEntry& e) { return e.name() == Name; });
898 return lcl_GetStyleFamilyEntries().size();
903 auto& entries(lcl_GetStyleFamilyEntries());
906 throw lang::IndexOutOfBoundsException();
908 throw uno::RuntimeException();
909 auto eFamily = entries[
nIndex].family();
910 assert(eFamily != SfxStyleFamily::All);
926 const uno::Sequence< beans::PropertyValue >& aOptions)
929 if(!
IsValid() || rURL.isEmpty())
930 throw uno::RuntimeException();
937 for(
const auto& rProperty: aOptions)
941 bValue = rProperty.Value.get<
bool>();
953 else if(rProperty.Name ==
"InputStream")
955 Reference<XInputStream> xInputStream;
956 if (!(rProperty.Value >>= xInputStream))
957 throw IllegalArgumentException(
"Parameter 'InputStream' could not be converted to "
958 "type 'com::sun::star::io::XInputStream'",
967 throw io::IOException();
983 SfxItemSet const& rSet, std::u16string_view rPropName,
bool const bFooter,
987 bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET,
993 (!bFooter) ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET,
1001 auto& entries(lcl_GetStyleFamilyEntries());
1002 const auto pEntry = std::find_if(entries.begin(), entries.end(),
1003 [eFamily] (
const StyleFamilyEntry& e) { return e.family() == eFamily; });
1004 return pEntry == entries.end() ? nullptr : pEntry->createStyle(
nullptr, rDoc.
GetDocShell(),
"");
1009 {
return new SwXStyle(&rDoc, SfxStyleFamily::Para,
true); };
1011uno::Any XStyleFamily::getByIndex(sal_Int32 nIndex)
1015 throw lang::IndexOutOfBoundsException();
1017 throw uno::RuntimeException();
1018 OUString sStyleName;
1023 if (sStyleName.isEmpty())
1024 GetCountOrName(&sStyleName, nIndex);
1025 if(sStyleName.isEmpty())
1026 throw lang::IndexOutOfBoundsException();
1027 return getByName(sStyleName);
1030uno::Any XStyleFamily::getByName(
const OUString& rName)
1033 OUString sStyleName;
1036 throw uno::RuntimeException();
1039 throw container::NoSuchElementException(rName);
1040 uno::Reference<style::XStyle> xStyle = FindStyle(sStyleName);
1042 xStyle = m_rEntry.createStyle(m_pBasePool, m_pDocShell, m_rEntry.family() == SfxStyleFamily::Frame ? pBase->
GetName() : sStyleName);
1046uno::Sequence<OUString> XStyleFamily::getElementNames()
1050 throw uno::RuntimeException();
1051 std::vector<OUString> vRet;
1052 std::unique_ptr<SfxStyleSheetIterator> pIt = m_pBasePool->
CreateIterator(m_rEntry.family());
1057 vRet.push_back(sName);
1062sal_Bool XStyleFamily::hasByName(
const OUString& rName)
1066 throw uno::RuntimeException();
1067 OUString sStyleName;
1070 return nullptr != pBase;
1073void XStyleFamily::insertByName(
const OUString& rName,
const uno::Any& rElement)
1077 throw uno::RuntimeException();
1078 OUString sStyleName;
1082 throw container::ElementExistException();
1083 if(rElement.getValueType().getTypeClass() != uno::TypeClass_INTERFACE)
1084 throw lang::IllegalArgumentException();
1088 uno::Reference<style::XStyle> xStyle = rElement.get<uno::Reference<style::XStyle>>();
1091 throw lang::IllegalArgumentException();
1093 pNewStyle->setName(sStyleName);
1095 pNewStyle->SetPhysical();
1100 uno::Reference<style::XStyle> xStyle = rElement.get<uno::Reference<style::XStyle>>();
1103 throw lang::IllegalArgumentException();
1105 pNewStyle->setName(sStyleName);
1107 pNewStyle->SetPhysical();
1111 uno::Reference<lang::XUnoTunnel> xStyleTunnel = rElement.get<uno::Reference<lang::XUnoTunnel>>();
1112 SwXStyle* pNewStyle = comphelper::getFromUnoTunnel<SwXStyle>(xStyleTunnel);
1113 if (!pNewStyle || !pNewStyle->IsDescriptor() || pNewStyle->GetFamily() != m_rEntry.family())
1114 throw lang::IllegalArgumentException();
1117 if(m_rEntry.family() == SfxStyleFamily::Para && !pNewStyle->IsConditional())
1119 auto pStyle = &m_pBasePool->
Make(sStyleName, m_rEntry.family(), nMask);
1120 pNewStyle->SetDoc(m_pDocShell->
GetDoc(), m_pBasePool);
1121 pNewStyle->SetStyleName(sStyleName);
1122 pStyle->
SetParent(pNewStyle->GetParentStyleName());
1124 pNewStyle->ApplyDescriptorProperties();
1128void XStyleFamily::replaceByName(
const OUString& rName,
const uno::Any& rElement)
1132 throw uno::RuntimeException();
1133 OUString sStyleName;
1138 throw container::NoSuchElementException();
1144 if (pBoxAutoFormat && sParent.isEmpty())
1146 uno::Reference<style::XStyle> xStyle = rElement.get<uno::Reference<style::XStyle>>();
1148 if (!pStyleToReplaceWith)
1149 throw lang::IllegalArgumentException();
1151 pStyleToReplaceWith->setName(sStyleName);
1152 *pBoxAutoFormat = *pStyleToReplaceWith->GetBoxFormat();
1153 pStyleToReplaceWith->SetPhysical();
1160 if (pTableAutoFormat)
1162 uno::Reference<style::XStyle> xStyle = rElement.get<uno::Reference<style::XStyle>>();
1164 if (!pStyleToReplaceWith)
1165 throw lang::IllegalArgumentException();
1167 pStyleToReplaceWith->setName(sStyleName);
1168 *pTableAutoFormat = *pStyleToReplaceWith->GetTableFormat();
1169 pStyleToReplaceWith->SetPhysical();
1175 throw lang::IllegalArgumentException();
1177 uno::Reference<style::XStyle> xStyle = FindStyle(pBase->
GetName());
1180 SwXStyle* pStyle = comphelper::getFromUnoTunnel<SwXStyle>(xStyle);
1182 pStyle->Invalidate();
1184 m_pBasePool->
Remove(pBase);
1185 insertByName(rName, rElement);
1189void XStyleFamily::removeByName(
const OUString& rName)
1193 throw uno::RuntimeException();
1198 throw container::NoSuchElementException();
1210 m_pBasePool->
Remove(pBase);
1213uno::Any SAL_CALL XStyleFamily::getPropertyValue(
const OUString& sPropertyName )
1215 if(sPropertyName !=
"DisplayName")
1216 throw beans::UnknownPropertyException(
"unknown property: " + sPropertyName,
static_cast<OWeakObject *
>(
this) );
1222SwXStyle* XStyleFamily::FindStyle(std::u16string_view rStyleName)
const
1224 SwXStyle* pFoundStyle =
nullptr;
1226 [
this, &pFoundStyle, &rStyleName] (
SfxListener* pListener)
1228 SwXStyle* pTempStyle =
dynamic_cast<SwXStyle*
>(pListener);
1229 if(pTempStyle && pTempStyle->GetFamily() == m_rEntry.family() && pTempStyle->GetStyleName() == rStyleName)
1231 pFoundStyle = pTempStyle;
1241 auto& entries(lcl_GetStyleFamilyEntries());
1242 const auto pEntry = std::find_if(entries.begin(), entries.end(),
1243 [eFamily] (
const StyleFamilyEntry& e) { return e.family() == eFamily; });
1244 if(pEntry != entries.end())
1245 return pEntry->poolId();
1246 SAL_WARN(
"sw.uno",
"someone asking for all styles in unostyle.cxx!" );
1250const uno::Sequence<sal_Int8>& SwXStyle::getUnoTunnelId()
1253 return theSwXStyleUnoTunnelId.
getSeq();
1256sal_Int64 SAL_CALL SwXStyle::getSomething(
const uno::Sequence<sal_Int8>& rId)
1262uno::Sequence< OUString > SwXStyle::getSupportedServiceNames()
1265 if(SfxStyleFamily::Para == m_rEntry.family())
1268 if(m_bIsConditional)
1271 else if(SfxStyleFamily::Char == m_rEntry.family())
1273 else if(SfxStyleFamily::Page == m_rEntry.family())
1275 uno::Sequence< OUString > aRet(nCount);
1276 OUString* pArray = aRet.getArray();
1277 pArray[0] =
"com.sun.star.style.Style";
1278 switch(m_rEntry.family())
1280 case SfxStyleFamily::Char:
1281 pArray[1] =
"com.sun.star.style.CharacterStyle";
1282 pArray[2] =
"com.sun.star.style.CharacterProperties";
1283 pArray[3] =
"com.sun.star.style.CharacterPropertiesAsian";
1284 pArray[4] =
"com.sun.star.style.CharacterPropertiesComplex";
1286 case SfxStyleFamily::Page:
1287 pArray[1] =
"com.sun.star.style.PageStyle";
1288 pArray[2] =
"com.sun.star.style.PageProperties";
1290 case SfxStyleFamily::Para:
1291 pArray[1] =
"com.sun.star.style.ParagraphStyle";
1292 pArray[2] =
"com.sun.star.style.ParagraphProperties";
1293 pArray[3] =
"com.sun.star.style.ParagraphPropertiesAsian";
1294 pArray[4] =
"com.sun.star.style.ParagraphPropertiesComplex";
1295 if(m_bIsConditional)
1296 pArray[5] =
"com.sun.star.style.ConditionalParagraphStyle";
1308 if(eFamily != SfxStyleFamily::Para && eFamily != SfxStyleFamily::Page)
1310 auto aResult(rxStyleFamily->getByName(
"Standard"));
1311 if(!aResult.has<return_t>())
1313 return aResult.get<return_t>();
1319 if(rEntry.family() != SfxStyleFamily::Char
1320 && rEntry.family() != SfxStyleFamily::Para
1321 && rEntry.family() != SfxStyleFamily::Page)
1324 uno::Reference<style::XStyleFamiliesSupplier> xFamilySupplier(
xModel, uno::UNO_QUERY);
1325 auto xFamilies = xFamilySupplier->getStyleFamilies();
1326 auto aResult(xFamilies->getByName(rEntry.name()));
1327 if(!aResult.has<return_t>())
1329 return aResult.get<return_t>();
1334 if(!pBasePool || eFamily != SfxStyleFamily::Para)
1337 SAL_WARN_IF(!pBase,
"sw.uno",
"where is the style?" );
1341 if(
nId != USHRT_MAX)
1348 auto& entries = lcl_GetStyleFamilyEntries();
1349 const auto pEntry = std::find_if(entries.begin(), entries.end(),
1350 [eFamily] (
const StyleFamilyEntry& e) { return e.family() == eFamily; });
1351 assert(pEntry != entries.end());
1358 , m_bIsDescriptor(true)
1359 , m_bIsConditional(bConditional)
1360 , m_pBasePool(nullptr)
1364 assert(!m_bIsConditional || m_rEntry.family() == SfxStyleFamily::Para);
1367 m_pPropertiesImpl = std::make_unique<SwStyleProperties_Impl>(
1373 , m_sStyleName(rStyleName)
1375 , m_bIsDescriptor(false)
1377 , m_pBasePool(pPool)
1380SwXStyle::~SwXStyle()
1385 m_pPropertiesImpl.reset();
1391 if(rHint.
GetId() == SfxHintId::Dying)
1394 m_xStyleData.clear();
1395 m_xStyleFamily.clear();
1399OUString SwXStyle::getName()
1403 return m_sStyleName;
1405 SAL_WARN_IF(!pBase,
"sw.uno",
"where is the style?");
1407 throw uno::RuntimeException();
1413void SwXStyle::setName(
const OUString& rName)
1418 m_sStyleName = rName;
1422 SAL_WARN_IF(!pBase,
"sw.uno",
"where is the style?");
1424 throw uno::RuntimeException();
1426 if(!xTmp->SetName(rName))
1427 throw uno::RuntimeException();
1428 m_sStyleName = rName;
1435 throw uno::RuntimeException();
1445 throw uno::RuntimeException();
1446 SfxStyleSheetBase* pBase = m_pBasePool->
Find(m_sStyleName, m_rEntry.family(), SfxStyleSearchBits::Used);
1447 return pBase && pBase->
IsUsed();
1450OUString SwXStyle::getParentStyle()
1455 if(!m_bIsDescriptor)
1456 throw uno::RuntimeException();
1457 return m_sParentStyleName;
1467void SwXStyle::setParentStyle(
const OUString& rParentStyle)
1470 OUString sParentStyle;
1474 if(!m_bIsDescriptor)
1475 throw uno::RuntimeException();
1476 m_sParentStyleName = sParentStyle;
1479 const auto aAny = m_xStyleFamily->getByName(sParentStyle);
1480 m_xStyleData = aAny.get<
decltype(m_xStyleData)>();
1488 throw uno::RuntimeException();
1491 xBase->GetItemSet();
1492 if(xBase->GetParent() != sParentStyle)
1494 if(!xBase->SetParent(sParentStyle))
1495 throw uno::RuntimeException();
1499uno::Reference<beans::XPropertySetInfo> SwXStyle::getPropertySetInfo()
1501 if(m_bIsConditional)
1503 assert(m_rEntry.family() == SfxStyleFamily::Para);
1505 return xCondParaRef;
1507 return m_rEntry.xPSInfo();
1510void SwXStyle::ApplyDescriptorProperties()
1512 m_bIsDescriptor =
false;
1513 m_xStyleData.clear();
1514 m_xStyleFamily.clear();
1515 m_pPropertiesImpl->Apply(*
this);
1522 STR_POOLPAGE_STANDARD,
1526 STR_POOLPAGE_ENVELOPE,
1527 STR_POOLPAGE_REGISTER,
1529 STR_POOLPAGE_FOOTNOTE,
1530 STR_POOLPAGE_ENDNOTE,
1531 STR_POOLPAGE_LANDSCAPE
1535const SwPageDesc* SwStyleBase_Impl::GetOldPageDesc()
1541 m_pOldPageDesc = pd;
1555 return m_pOldPageDesc;
1563 if(!(rEntry.
nMoreFlags & PropertyMoreFlags::METRIC_ITEM))
1568 && o_aValue.has<sal_Int32>()
1569 && o_aValue.get<sal_Int32>() < 0)
1576 if(eMapUnit != MapUnit::Map100thMM)
1584 SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet();
1586 aSet.SetParent(&rStyleSet);
1588 rStyleSet.
Put(aSet);
1593 bool bHidden =
false;
1594 if(rValue >>= bHidden)
1597 o_rStyleBase.getNewBase()->GetItemSet();
1598 o_rStyleBase.getNewBase()->SetHidden(bHidden);
1600 SetPropertyValue<HINT_BEGIN>(rEntry, rPropSet, rValue, o_rStyleBase);
1605 o_rStyleBase.getNewBase()->GetItemSet();
1606 o_rStyleBase.getNewBase()->SetGrabBagItem(rValue);
1607 SetPropertyValue<HINT_BEGIN>(rEntry, rPropSet, rValue, o_rStyleBase);
1614 if(MID_NAME == nMemberId)
1617 SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet();
1618 if(!aValue.has<OUString>())
1619 throw lang::IllegalArgumentException();
1622 else if(MID_BITMAP == nMemberId)
1624 if(sal_uInt16(XATTR_FILLBITMAP) == rEntry.
nWID)
1627 SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet();
1629 aXFillBitmapItem.PutValue(aValue, nMemberId);
1630 rStyleSet.
Put(aXFillBitmapItem);
1634 SetPropertyValue<HINT_BEGIN>(rEntry, rPropSet, aValue, o_rStyleBase);
1639 SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet();
1641 std::unique_ptr<SvxBrushItem> aChangedBrushItem(aOriginalBrushItem->Clone());
1645 aChangedBrushItem->PutValue(aValue, nMemberId);
1650 if(*aChangedBrushItem == *aOriginalBrushItem && (MID_GRAPHIC_TRANSPARENT != nMemberId || !aValue.has<
bool>() || !aValue.get<
bool>()))
1658 drawing::BitmapMode
eMode;
1659 if(!(rValue >>= eMode))
1661 if(!rValue.has<sal_Int32>())
1662 throw lang::IllegalArgumentException();
1663 eMode =
static_cast<drawing::BitmapMode
>(rValue.get<sal_Int32>());
1665 SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet();
1672 if(!rValue.has<OUString>())
1673 throw lang::IllegalArgumentException();
1675 OUString sValue(rValue.get<OUString>());
1676 using printeridx_t =
decltype(pPrinter->GetPaperBinCount());
1677 printeridx_t nBin = std::numeric_limits<printeridx_t>::max();
1678 if(sValue ==
"[From printer settings]")
1679 nBin = std::numeric_limits<printeridx_t>::max()-1;
1682 for(sal_uInt16 i=0, nEnd = pPrinter->GetPaperBinCount(); i < nEnd; ++i)
1684 if (sValue == pPrinter->GetPaperBinName(i))
1691 if(nBin == std::numeric_limits<printeridx_t>::max())
1692 throw lang::IllegalArgumentException();
1693 SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet();
1695 aSet.SetParent(&rStyleSet);
1697 rStyleSet.
Put(aSet);
1702 auto xNumberTunnel(rValue.get<uno::Reference<container::XIndexReplace>>());
1704 throw lang::IllegalArgumentException();
1711 const SwNumFormat* pFormat = aSetRule.GetNumFormat(i);
1716 if(!rCharName.isEmpty()
1721 [&rCharName] (
SwCharFormat* pF) { return pF->GetName() == rCharName; }));
1723 aFormat.SetCharFormat(*pCharFormatIt);
1724 else if(m_pBasePool)
1726 auto pBase(m_pBasePool->
Find(rCharName, SfxStyleFamily::Char));
1728 pBase = &m_pBasePool->
Make(rCharName, SfxStyleFamily::Char);
1729 aFormat.SetCharFormat(
static_cast<SwDocStyleSheet*
>(pBase)->GetCharFormat());
1732 aFormat.SetCharFormat(
nullptr);
1736 if(!rBulletName.isEmpty()
1741 const auto pList(pFontListItem->GetFontList());
1742 FontMetric aFontInfo(pList->Get(rBulletName, WEIGHT_NORMAL, ITALIC_NONE));
1744 aFormat.SetBulletFont(&aFont);
1746 aSetRule.Set(i, &aFormat);
1748 o_rStyleBase.getNewBase()->SetNumRule(aSetRule);
1753 if(!rValue.has<sal_Int16>())
1755 const auto nLevel(rValue.get<sal_Int16>());
1756 if(0 <= nLevel && nLevel <=
MAXLEVEL)
1757 o_rStyleBase.getNewBase()->GetCollection()->SetAttrOutlineLevel(nLevel);
1762 if(!rValue.has<OUString>())
1764 const auto sValue(rValue.get<OUString>());
1767 o_rStyleBase.getNewBase()->SetFollow(aString);
1774 SwStyleBase_Impl& o_rStyleBase)
1776 if (!rValue.has<OUString>())
1778 const auto sValue(rValue.get<OUString>());
1781 o_rStyleBase.getNewBase()->SetLink(aString);
1789 SetPropertyValue<HINT_BEGIN>(rEntry, rPropSet, rValue, o_rStyleBase);
1792 if(!rValue.has<OUString>())
1793 throw lang::IllegalArgumentException();
1795 SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet();
1796 std::unique_ptr<SwFormatPageDesc> pNewDesc;
1801 const auto sValue(rValue.get<OUString>());
1804 if(pNewDesc->GetPageDesc() && pNewDesc->GetPageDesc()->GetName() == sDescName)
1806 if(sDescName.isEmpty())
1815 throw lang::IllegalArgumentException();
1816 pNewDesc->RegisterToPageDesc(*pPageDesc);
1817 rStyleSet.
Put(std::move(pNewDesc));
1823 if(m_rEntry.family() != SfxStyleFamily::Page)
1825 SetPropertyValue<HINT_BEGIN>(rEntry, rPropSet, rValue, o_rStyleBase);
1828 if(!m_pDoc || !rValue.has<drawing::TextVerticalAdjust>() || !o_rStyleBase.GetOldPageDesc())
1837 if(!rValue.has<
bool>())
1838 throw lang::IllegalArgumentException();
1839 const bool bAuto(rValue.get<
bool>());
1840 if(SfxStyleFamily::Para == m_rEntry.family())
1841 o_rStyleBase.getNewBase()->GetCollection()->SetAutoUpdateOnDirectFormat(bAuto);
1842 else if(SfxStyleFamily::Frame == m_rEntry.family())
1843 o_rStyleBase.getNewBase()->GetFrameFormat()->SetAutoUpdateOnDirectFormat(bAuto);
1849 using expectedarg_t = uno::Sequence<beans::NamedValue>;
1850 if(!rValue.has<expectedarg_t>() || !m_pBasePool)
1851 throw lang::IllegalArgumentException();
1853 const auto aNamedValues = rValue.get<expectedarg_t>();
1854 for(
const auto& rNamedValue : aNamedValues)
1856 if(!rNamedValue.Value.has<OUString>())
1857 throw lang::IllegalArgumentException();
1859 const OUString sValue(rNamedValue.Value.get<OUString>());
1861 OUString aStyleName;
1867 throw lang::IllegalArgumentException();
1868 bool bStyleFound =
false;
1869 for(
auto pBase = m_pBasePool->
First(SfxStyleFamily::Para); pBase; pBase = m_pBasePool->
Next())
1871 bStyleFound = pBase->
GetName() == aStyleName;
1876 throw lang::IllegalArgumentException();
1877 aCondItem.
SetStyle(&aStyleName, nIdx);
1879 o_rStyleBase.GetItemSet().Put(aCondItem);
1884 if(!o_rStyleBase.getNewBase()->IsUserDefined() || !rValue.has<paragraphstyle_t>())
1885 throw lang::IllegalArgumentException();
1886 static const std::map<paragraphstyle_t, SfxStyleSearchBits> aUnoToCore = []{
1887 std::map<paragraphstyle_t, SfxStyleSearchBits>
map;
1888 std::transform(std::begin(sParagraphStyleCategoryEntries), std::end(sParagraphStyleCategoryEntries), std::inserter(map,
map.end()),
1889 [] (
const ParagraphStyleCategoryEntry& rEntry) { return std::make_pair(rEntry.m_eCategory, rEntry.m_nSwStyleBits); });
1892 const auto pUnoToCoreIt(aUnoToCore.find(rValue.get<paragraphstyle_t>()));
1893 if (pUnoToCoreIt == aUnoToCore.end())
1894 throw lang::IllegalArgumentException();
1895 o_rStyleBase.getNewBase()->SetMask( pUnoToCoreIt->second|SfxStyleSearchBits::UserDefined );
1903 aReg.SetWhich(SID_SWREGISTER_MODE);
1904 o_rStyleBase.GetItemSet().Put(aReg);
1907 o_rStyleBase.GetItemSet().Put(
SfxStringItem(SID_SWREGISTER_COLLECTION, aString ) );
1914 if(!rValue.has<OUString>())
1915 throw lang::IllegalArgumentException();
1916 const auto sValue(rValue.get<OUString>());
1917 SfxItemSet& rStyleSet(o_rStyleBase.GetItemSet());
1918 std::unique_ptr<SwFormatRuby> pRuby;
1925 pRuby->SetCharFormatName(sValue);
1926 pRuby->SetCharFormatId(0);
1927 if(!sValue.isEmpty())
1930 pRuby->SetCharFormatId(nId);
1932 rStyleSet.
Put(std::move(pRuby));
1933 SetPropertyValue<HINT_BEGIN>(rEntry, rPropSet, rValue, o_rStyleBase);
1940 SetPropertyValue<HINT_BEGIN>(rEntry, rPropSet, rValue, o_rStyleBase);
1943 if(!rValue.has<OUString>())
1944 throw lang::IllegalArgumentException();
1945 SfxItemSet& rStyleSet(o_rStyleBase.GetItemSet());
1946 std::unique_ptr<SwFormatDrop> pDrop;
1951 const auto sValue(rValue.get<OUString>());
1958 throw lang::IllegalArgumentException();
1960 pDrop->SetCharFormat(pStyle->GetCharFormat());
1961 rStyleSet.
Put(std::move(pDrop));
1968 SetPropertyValue<HINT_BEGIN>(rEntry, rPropSet, aValue, o_rStyleBase);
1970 if(SfxStyleFamily::Para == m_rEntry.family() &&
1971 o_rStyleBase.getNewBase().is() && o_rStyleBase.getNewBase()->GetCollection() &&
1973 o_rStyleBase.getNewBase()->GetCollection()->IsAssignedToListLevelOfOutlineStyle())
1975 OUString sNewNumberingRuleName;
1976 aValue >>= sNewNumberingRuleName;
1978 o_rStyleBase.getNewBase()->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle();
1984 using propertytype_t =
decltype(rEntry.
nWID);
1986 static const std::map<propertytype_t, coresetter_t> aUnoToCore{
1988 {
FN_UNO_HIDDEN, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_HIDDEN>) },
1997 {
FN_UNO_NUM_RULES, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_NUM_RULES>) },
2000 {
FN_UNO_LINK_STYLE, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_LINK_STYLE>) },
2005 {
FN_UNO_CATEGORY, std::mem_fn(&SwXStyle::SetPropertyValue<FN_UNO_CATEGORY>) },
2006 { SID_SWREGISTER_COLLECTION, std::mem_fn(&SwXStyle::SetPropertyValue<SID_SWREGISTER_COLLECTION>) },
2011 const auto pUnoToCoreIt(aUnoToCore.find(rEntry.
nWID));
2012 if(pUnoToCoreIt != aUnoToCore.end())
2013 pUnoToCoreIt->second(*
this, rEntry, rPropSet, rValue, rBase);
2020 SetPropertyValue<HINT_BEGIN>(rEntry, rPropSet, aValue, rBase);
2024void SwXStyle::SetPropertyValues_Impl(
const uno::Sequence<OUString>& rPropertyNames,
const uno::Sequence<uno::Any>& rValues)
2027 throw uno::RuntimeException();
2031 if(rPropertyNames.getLength() != rValues.getLength())
2032 throw lang::IllegalArgumentException();
2034 SwStyleBase_Impl aBaseImpl(*m_pDoc, m_sStyleName, &GetDoc()->GetDfltTextFormatColl()->GetAttrSet());
2038 SAL_WARN_IF(!pBase,
"sw.uno",
"where is the style?");
2040 throw uno::RuntimeException();
2043 if(!aBaseImpl.getNewBase().is() && !m_bIsDescriptor)
2044 throw uno::RuntimeException();
2046 const OUString* pNames = rPropertyNames.getConstArray();
2048 for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); ++nProp)
2052 throw beans::UnknownPropertyException(
"Unknown property: " + pNames[nProp],
static_cast<cppu::OWeakObject*
>(
this));
2053 if(pEntry->
nFlags & beans::PropertyAttribute::READONLY)
2054 throw beans::PropertyVetoException (
"Property is read-only: " + pNames[nProp],
static_cast<cppu::OWeakObject*
>(
this));
2055 if(aBaseImpl.getNewBase().is())
2056 SetStyleProperty(*pEntry, *pPropSet, pValues[nProp], aBaseImpl);
2057 else if(!m_pPropertiesImpl->SetProperty(pNames[nProp], pValues[nProp]))
2058 throw lang::IllegalArgumentException();
2061 if(aBaseImpl.HasItemSet())
2062 aBaseImpl.getNewBase()->SetItemSet(aBaseImpl.GetItemSet());
2065void SwXStyle::setPropertyValues(
const uno::Sequence<OUString>& rPropertyNames,
const uno::Sequence<uno::Any>& rValues)
2071 SetPropertyValues_Impl( rPropertyNames, rValues );
2073 catch (
const beans::UnknownPropertyException &rException)
2077 lang::WrappedTargetException aWExc;
2078 aWExc.TargetException <<= rException;
2090void SwXStyle::PrepareStyleBase(SwStyleBase_Impl& rBase)
2094 throw uno::RuntimeException();
2095 if(!rBase.getNewBase().is())
2109 if( bPhys && SfxStyleFamily::Char == GetFamily() &&
2122 return uno::Any(xBase->IsHidden());
2132 xBase->GetGrabBagItem(aRet);
2138 PrepareStyleBase(rBase);
2144 return uno::Any(OUString(
"[From printer settings]"));
2145 SfxPrinter* pPrinter = GetDoc()->getIDocumentDeviceAccess().getPrinter(
false);
2148 return uno::Any(pPrinter->GetPaperBinName(nBin));
2153 PrepareStyleBase(rBase);
2154 const SwNumRule* pRule = rBase.getNewBase()->GetNumRule();
2155 assert(pRule &&
"Where is the NumRule?");
2156 uno::Reference<container::XIndexReplace> xRules(
new SwXNumberingRules(*pRule, GetDoc()));
2162 PrepareStyleBase(rBase);
2163 SAL_WARN_IF(SfxStyleFamily::Para != GetFamily(),
"sw.uno",
"only paras");
2164 return uno::Any(sal_Int16(rBase.getNewBase()->GetCollection()->GetAttrOutlineLevel()));
2169 PrepareStyleBase(rBase);
2178 SwStyleBase_Impl& rBase)
2180 PrepareStyleBase(rBase);
2190 PrepareStyleBase(rBase);
2192 return GetStyleProperty<HINT_BEGIN>(rEntry, rPropSet, rBase);
2208 PrepareStyleBase(rBase);
2211 case SfxStyleFamily::Para :
return uno::Any(rBase.getNewBase()->GetCollection()->IsAutoUpdateOnDirectFormat());
2212 case SfxStyleFamily::Frame:
return uno::Any(rBase.getNewBase()->GetFrameFormat()->IsAutoUpdateOnDirectFormat());
2219 PrepareStyleBase(rBase);
2220 return uno::Any(rBase.getNewBase()->GetName());
2225 PrepareStyleBase(rBase);
2229 for(
auto& rNV : asNonConstRange(aSeq))
2232 rNV.Value <<= OUString();
2238 beans::NamedValue* pSeq =
aSeq.getArray();
2247 pSeq[
n].Value <<= aStyleName;
2255 PrepareStyleBase(rBase);
2256 static const std::map<collectionbits_t, paragraphstyle_t> aUnoToCore = []{
2257 std::map<collectionbits_t, paragraphstyle_t>
map;
2258 std::transform(std::begin(sParagraphStyleCategoryEntries), std::end(sParagraphStyleCategoryEntries), std::inserter(map,
map.end()),
2259 [] (
const ParagraphStyleCategoryEntry& rEntry) { return std::make_pair(rEntry.m_nCollectionBits, rEntry.m_eCategory); });
2262 const sal_uInt16 nPoolId = rBase.getNewBase()->GetCollection()->GetPoolFormatId();
2264 if(pUnoToCoreIt == aUnoToCore.end())
2266 return uno::Any(pUnoToCoreIt->second);
2271 PrepareStyleBase(rBase);
2272 const SwPageDesc *pPageDesc = rBase.getNewBase()->GetPageDesc();
2285 PrepareStyleBase(rBase);
2289 if(!aOriginalBrushItem->QueryValue(aResult, rEntry.
nMemberId))
2290 SAL_WARN(
"sw.uno",
"error getting attribute from RES_BACKGROUND.");
2296 PrepareStyleBase(rBase);
2298 if (
rSet.
Get(XATTR_FILLBMP_TILE).GetValue())
2299 return uno::Any(drawing::BitmapMode_REPEAT);
2300 if (
rSet.
Get(XATTR_FILLBMP_STRETCH).GetValue())
2301 return uno::Any(drawing::BitmapMode_STRETCH);
2302 return uno::Any(drawing::BitmapMode_NO_REPEAT);
2307 PrepareStyleBase(rBase);
2314 aResult <<= static_cast<sal_Int16>(aResult.get<sal_Int32>());
2316 if(rEntry.
nMoreFlags & PropertyMoreFlags::METRIC_ITEM && GetDoc())
2318 const SfxItemPool& rPool = GetDoc()->GetAttrPool();
2320 bool bAllowedConvert(
true);
2323 if(XATTR_FILLBMP_SIZEX == rEntry.
nWID || XATTR_FILLBMP_SIZEY == rEntry.
nWID)
2324 bAllowedConvert = !aResult.has<sal_Int32>() || aResult.get<sal_Int32>() > 0;
2325 if(eMapUnit != MapUnit::Map100thMM && bAllowedConvert)
2333 using propertytype_t =
decltype(rEntry.
nWID);
2335 static const std::map<propertytype_t, coresetter_t> aUnoToCore{
2337 {
FN_UNO_IS_PHYSICAL, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_IS_PHYSICAL>) },
2338 {
FN_UNO_HIDDEN, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_HIDDEN>) },
2341 {
FN_UNO_NUM_RULES, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_NUM_RULES>) },
2344 {
FN_UNO_LINK_STYLE, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_LINK_STYLE>) },
2349 {
FN_UNO_CATEGORY, std::mem_fn(&SwXStyle::GetStyleProperty<FN_UNO_CATEGORY>) },
2350 { SID_SWREGISTER_COLLECTION, std::mem_fn(&SwXStyle::GetStyleProperty<SID_SWREGISTER_COLLECTION>) },
2354 const auto pUnoToCoreIt(aUnoToCore.find(rEntry.
nWID));
2355 if(pUnoToCoreIt != aUnoToCore.end())
2356 return pUnoToCoreIt->second(*
this, rEntry, rPropSet, rBase);
2357 return GetStyleProperty<HINT_BEGIN>(rEntry, rPropSet, rBase);
2360uno::Any SwXStyle::GetPropertyValue_Impl(
const SfxItemPropertySet* pPropSet, SwStyleBase_Impl& rBase,
const OUString& rPropertyName)
2365 throw beans::UnknownPropertyException(
"Unknown property: " + rPropertyName,
static_cast<cppu::OWeakObject*
>(
this));
2367 return GetStyleProperty_Impl(*pEntry, *pPropSet, rBase);
2369 m_pPropertiesImpl->GetProperty(rPropertyName, pAny);
2373 switch(m_rEntry.family())
2375 case SfxStyleFamily::Pseudo:
2376 throw uno::RuntimeException(
"No default value for: " + rPropertyName);
2378 case SfxStyleFamily::Para:
2379 case SfxStyleFamily::Page:
2380 aValue = m_xStyleData->getPropertyValue(rPropertyName);
2382 case SfxStyleFamily::Char:
2383 case SfxStyleFamily::Frame:
2386 throw uno::RuntimeException(
"No default value for: " + rPropertyName);
2388 if(m_rEntry.family() == SfxStyleFamily::Char)
2403uno::Any SwXStyle::getPropertyValue(
const OUString& rPropertyName)
2407 throw uno::RuntimeException();
2408 if(!m_pBasePool && !m_bIsDescriptor)
2409 throw uno::RuntimeException();
2413 return GetPropertyValue_Impl(pPropSet, aBase, rPropertyName);
2416uno::Sequence<uno::Any> SwXStyle::getPropertyValues(
const uno::Sequence<OUString>& rPropertyNames)
2420 throw uno::RuntimeException();
2421 if(!m_pBasePool && !m_bIsDescriptor)
2422 throw uno::RuntimeException();
2426 uno::Sequence<uno::Any> aValues(rPropertyNames.getLength());
2427 auto aValuesRange = asNonConstRange(aValues);
2431 for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); ++nProp)
2432 aValuesRange[nProp] = GetPropertyValue_Impl(pPropSet, aBase, rPropertyNames[nProp]);
2434 catch(beans::UnknownPropertyException&)
2437 throw css::lang::WrappedTargetRuntimeException(
"Unknown property exception caught",
2440 catch(lang::WrappedTargetException&)
2443 throw lang::WrappedTargetRuntimeException(
"WrappedTargetException caught",
2449void SwXStyle::setPropertyValue(
const OUString& rPropertyName,
const uno::Any& rValue)
2452 const uno::Sequence<OUString>
aProperties(&rPropertyName, 1);
2453 const uno::Sequence<uno::Any> aValues(&rValue, 1);
2454 SetPropertyValues_Impl(aProperties, aValues);
2457beans::PropertyState SwXStyle::getPropertyState(
const OUString& rPropertyName)
2460 uno::Sequence<OUString> aNames{rPropertyName};
2461 uno::Sequence<beans::PropertyState> aStates = getPropertyStates(aNames);
2462 return aStates.getConstArray()[0];
2469 if(eFamily != SfxStyleFamily::Page)
2477 return &pSetItem->GetItemSet();
2479uno::Sequence<beans::PropertyState> SwXStyle::getPropertyStates(
const uno::Sequence<OUString>& rPropertyNames)
2482 uno::Sequence<beans::PropertyState> aRet(rPropertyNames.getLength());
2483 beans::PropertyState* pStates = aRet.getArray();
2486 throw uno::RuntimeException();
2489 SAL_WARN_IF(!pBase,
"sw.uno",
"where is the style?");
2491 throw uno::RuntimeException();
2493 const OUString* pNames = rPropertyNames.getConstArray();
2501 for(sal_Int32 i = 0;
i < rPropertyNames.getLength(); ++
i)
2503 const OUString sPropName = pNames[
i];
2507 throw beans::UnknownPropertyException(
"Unknown property: " + sPropName,
static_cast<cppu::OWeakObject*
>(
this));
2513 pStates[
i] = beans::PropertyState_DIRECT_VALUE;
2520 pStates[
i] = beans::PropertyState_AMBIGUOUS_VALUE;
2523 switch(pEntry->
nWID)
2527 if(SfxItemState::SET == pSourceSet->
GetItemState(XATTR_FILLBMP_STRETCH,
false)
2528 || SfxItemState::SET == pSourceSet->
GetItemState(XATTR_FILLBMP_TILE,
false))
2530 pStates[
i] = beans::PropertyState_DIRECT_VALUE;
2534 pStates[
i] = beans::PropertyState_AMBIGUOUS_VALUE;
2540 if (m_rEntry.family() == SfxStyleFamily::Frame
2541 && xStyle->GetFrameFormat()->DerivedFrom() == GetDoc()->GetDfltFrameFormat())
2545 pStates[
i] = beans::PropertyState_DIRECT_VALUE;
2561 pStates[
i] = beans::PropertyState_DIRECT_VALUE;
2565 pStates[
i] = beans::PropertyState_DEFAULT_VALUE;
2573 if(SfxStyleFamily::Page == m_rEntry.family() && SID_ATTR_PAGE_SIZE == pEntry->
nWID && beans::PropertyState_DIRECT_VALUE == pStates[i])
2578 if((LONG_MAX == rSize.
GetSize().
Width() && (MID_SIZE_WIDTH == nMemberId || MID_SIZE_SIZE == nMemberId)) ||
2579 (LONG_MAX == rSize.
GetSize().
Height() && MID_SIZE_HEIGHT == nMemberId))
2581 pStates[
i] = beans::PropertyState_DEFAULT_VALUE;
2590void SwXStyle::setPropertyToDefault(
const OUString& rPropertyName)
2592 const uno::Sequence<OUString> aSequence(&rPropertyName, 1);
2593 setPropertiesToDefault(aSequence);
2602 case SfxStyleFamily::Char:
return xStyle->GetCharFormat();
2603 case SfxStyleFamily::Para:
return xStyle->GetCollection();
2604 case SfxStyleFamily::Frame:
return xStyle->GetFrameFormat();
2605 case SfxStyleFamily::Page:
2617void SAL_CALL SwXStyle::setPropertiesToDefault(
const uno::Sequence<OUString>& aPropertyNames)
2624 if(!m_bIsDescriptor)
2626 for(
const auto& rName : aPropertyNames)
2627 m_pPropertiesImpl->ClearProperty(rName);
2633 for(
const auto& rName : aPropertyNames)
2637 throw beans::UnknownPropertyException(
"Unknown property: " + rName,
static_cast<cppu::OWeakObject*
>(
this));
2640 throw uno::RuntimeException(
"Cannot reset: " + rName,
static_cast<cppu::OWeakObject*
>(
this));
2641 if(pEntry->
nFlags & beans::PropertyAttribute::READONLY)
2642 throw uno::RuntimeException(
"setPropertiesToDefault: property is read-only: " + rName,
static_cast<cppu::OWeakObject*
>(
this));
2645 static_cast<SwTextFormatColl*
>(pTargetFormat)->DeleteAssignmentToListLevelOfOutlineStyle();
2654 aSet.SetParent(&pTargetFormat->
GetAttrSet());
2656 aSet.ClearItem(XATTR_FILLBMP_STRETCH);
2657 aSet.ClearItem(XATTR_FILLBMP_TILE);
2664void SAL_CALL SwXStyle::setAllPropertiesToDefault()
2669 if(!m_bIsDescriptor)
2670 throw uno::RuntimeException();
2671 m_pPropertiesImpl->ClearAllProperties();
2676 throw uno::RuntimeException();
2677 if(SfxStyleFamily::Page == m_rEntry.family())
2679 size_t nPgDscPos(0);
2692 pPageFormat->SetPageFormatToDefault();
2694 std::shared_ptr<SwFormatFrameSize> aFrameSz(std::make_shared<SwFormatFrameSize>(
SwFrameSize::Fixed));
2702 aFrameSz->SetSize(aPhysSize);
2717 SwTwips nTmp = aFrameSz->GetHeight();
2718 aFrameSz->SetHeight(aFrameSz->GetWidth());
2719 aFrameSz->SetWidth(nTmp);
2722 pPageFormat->SetFormatAttr(*aFrameSz);
2726 if(SfxStyleFamily::Para == m_rEntry.family())
2728 if(xStyle->GetCollection())
2729 xStyle->GetCollection()->DeleteAssignmentToListLevelOfOutlineStyle();
2737uno::Sequence<uno::Any> SAL_CALL SwXStyle::getPropertyDefaults(
const uno::Sequence<OUString>& aPropertyNames)
2740 sal_Int32
nCount = aPropertyNames.getLength();
2741 uno::Sequence<uno::Any> aRet(nCount);
2744 auto pRet = aRet.getArray();
2747 throw uno::RuntimeException();
2754 for(sal_Int32 i = 0;
i <
nCount; ++
i)
2759 throw beans::UnknownPropertyException(
"Unknown property: " + aPropertyNames[i],
static_cast < cppu::OWeakObject *
>(
this));
2778uno::Any SwXStyle::getPropertyDefault(
const OUString& rPropertyName)
2780 const uno::Sequence<OUString> aSequence(&rPropertyName, 1);
2781 return getPropertyDefaults(aSequence)[0];
2786 if((rHint.
GetId() == SfxHintId::Dying) || (rHint.
GetId() == SfxHintId::StyleSheetErased))
2788 m_pBasePool =
nullptr;
2791 else if(rHint.
GetId() == SfxHintId::StyleSheetChanged)
2803void SwXStyle::Invalidate()
2805 m_sStyleName.clear();
2806 m_pBasePool =
nullptr;
2808 m_xStyleData.clear();
2809 m_xStyleFamily.clear();
2816SwXPageStyle::SwXPageStyle(
SwDocShell* pDocSh)
2823 std::unique_ptr<SvxSetItem> pNewSetItem(pSetItem->
Clone());
2824 SfxItemSet& rSetSet = pNewSetItem->GetItemSet();
2832 SwStyleBase_Impl::ItemSetOverrider o(rBaseImpl, &rSetSet);
2833 SetStyleProperty(rEntry, rPropSet, rVal, rBaseImpl);
2840 rBaseImpl.GetItemSet().Put(std::move(pNewSetItem));
2843void SwXPageStyle::SetPropertyValues_Impl(
const uno::Sequence<OUString>& rPropertyNames,
const uno::Sequence<uno::Any>& rValues)
2846 throw uno::RuntimeException();
2848 if(rPropertyNames.getLength() != rValues.getLength())
2849 throw lang::IllegalArgumentException();
2853 SwStyleBase_Impl aBaseImpl(*GetDoc(), GetStyleName(), &GetDoc()->GetDfltFrameFormat()->GetAttrSet());
2857 throw uno::RuntimeException();
2858 for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); ++nProp)
2859 if(!m_pPropertiesImpl->SetProperty(rPropertyNames[nProp], rValues[nProp]))
2860 throw lang::IllegalArgumentException();
2865 throw uno::RuntimeException();
2867 for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); ++nProp)
2869 const OUString& rPropName = rPropertyNames[nProp];
2873 throw beans::UnknownPropertyException(
"Unknown property: " + rPropName,
static_cast<cppu::OWeakObject*
>(
this));
2874 if(pEntry->
nFlags & beans::PropertyAttribute::READONLY)
2875 throw beans::PropertyVetoException(
"Property is read-only: " + rPropName,
static_cast<cppu::OWeakObject*
>(
this));
2877 const bool bHeader(rPropName.startsWith(
"Header"));
2878 const bool bFooter(rPropName.startsWith(
"Footer"));
2880 if(bHeader || bFooter || bFirstIsShared)
2882 switch(pEntry->
nWID)
2884 case SID_ATTR_PAGE_ON:
2890 case SID_ATTR_PAGE_DYNAMIC:
2891 case SID_ATTR_PAGE_SHARED:
2892 case SID_ATTR_PAGE_SHARED_FIRST:
2893 case SID_ATTR_PAGE_SIZE:
2900 PutItemToSet(pSetItem, *pPropSet, *pEntry, rValues[nProp], aBaseImpl);
2902 if (pEntry->
nWID == SID_ATTR_PAGE_SHARED_FIRST)
2905 pSetItem = aBaseImpl.GetItemSet().GetItemIfSet(
2906 bFooter ? SID_ATTR_PAGE_HEADERSET : SID_ATTR_PAGE_FOOTERSET,
2910 PutItemToSet(pSetItem, *pPropSet, *pEntry, rValues[nProp], aBaseImpl);
2914 else if(pEntry->
nWID == SID_ATTR_PAGE_ON && rValues[nProp].get<
bool>())
2923 SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER,
2924 SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE,
2925 SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED,
2926 SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST>
2927 aTempSet(*aBaseImpl.GetItemSet().GetPool());
2930 aTempSet.SetParent(&GetDoc()->GetDfltFrameFormat()->GetAttrSet());
2932 aTempSet.Put(
SfxBoolItem(SID_ATTR_PAGE_ON,
true));
2937 aTempSet.Put(
SfxBoolItem(SID_ATTR_PAGE_SHARED,
true));
2938 aTempSet.Put(
SfxBoolItem(SID_ATTR_PAGE_SHARED_FIRST,
true));
2939 aTempSet.Put(
SfxBoolItem(SID_ATTR_PAGE_DYNAMIC,
true));
2941 SvxSetItem aNewSetItem(bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET, aTempSet);
2942 aBaseImpl.GetItemSet().Put(aNewSetItem);
2971 aBaseImpl.GetItemSet().GetItemIfSet(bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET,
false);
2976 std::unique_ptr<SvxSetItem> pNewSetItem(pSetItem->
Clone());
2977 SfxItemSet& rSetSet = pNewSetItem->GetItemSet();
2980 rSetSet.
SetParent(&GetDoc()->GetDfltFrameFormat()->GetAttrSet());
2985 SwStyleBase_Impl::ItemSetOverrider o(aBaseImpl, &rSetSet);
2986 SetStyleProperty(*pEntry, *pPropSet, rValues[nProp], aBaseImpl);
2993 aBaseImpl.GetItemSet().Put(std::move(pNewSetItem));
3000 switch(pEntry->
nWID)
3002 case SID_ATTR_PAGE_DYNAMIC:
3003 case SID_ATTR_PAGE_SHARED:
3004 case SID_ATTR_PAGE_SHARED_FIRST:
3005 case SID_ATTR_PAGE_ON:
3008 throw beans::UnknownPropertyException(
"Unknown property: " + rPropName,
static_cast<cppu::OWeakObject*
>(
this));
3017 throw lang::IllegalArgumentException();
3021 std::unique_ptr<SfxPoolItem> pNewFootnoteItem(rItem.
Clone());
3022 if(!pNewFootnoteItem->PutValue(rValues[nProp], pEntry->
nMemberId))
3023 throw lang::IllegalArgumentException();
3024 aBaseImpl.GetItemSet().Put(std::move(pNewFootnoteItem));
3029 SetStyleProperty(*pEntry, *pPropSet, rValues[nProp], aBaseImpl);
3035 if(aBaseImpl.HasItemSet())
3039 if (undoGuard.UndoWasEnabled())
3042 GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj();
3045 aBaseImpl.getNewBase()->SetItemSet(aBaseImpl.GetItemSet());
3049void SwXPageStyle::setPropertyValues(
const uno::Sequence<OUString>& rPropertyNames,
const uno::Sequence<uno::Any>& rValues)
3056 SetPropertyValues_Impl(rPropertyNames, rValues);
3058 catch (
const beans::UnknownPropertyException &rException)
3062 lang::WrappedTargetException aWExc;
3063 aWExc.TargetException <<= rException;
3079 if(!pHeadFootFormat)
3084uno::Sequence<uno::Any> SwXPageStyle::GetPropertyValues_Impl(
const uno::Sequence<OUString>& rPropertyNames)
3087 throw uno::RuntimeException();
3089 sal_Int32
nLength = rPropertyNames.getLength();
3090 uno::Sequence<uno::Any> aRet (nLength);
3091 auto aRetRange = asNonConstRange(aRet);
3095 throw uno::RuntimeException();
3096 for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); ++nProp)
3099 m_pPropertiesImpl->GetProperty(rPropertyNames[nProp], pAny);
3101 aRetRange[nProp] = m_xStyleData->getPropertyValue(rPropertyNames[nProp]);
3103 aRetRange[nProp] = *pAny;
3109 SwStyleBase_Impl aBase(*GetDoc(), GetStyleName(), &GetDoc()->GetDfltFrameFormat()->GetAttrSet());
3112 throw uno::RuntimeException();
3113 for(sal_Int32 nProp = 0; nProp <
nLength; ++nProp)
3115 const OUString& rPropName = rPropertyNames[nProp];
3119 throw beans::UnknownPropertyException(
"Unknown property: " + rPropName,
static_cast < cppu::OWeakObject *
> (
this ) );
3120 const bool bHeader(rPropName.startsWith(
"Header"));
3121 const bool bFooter(rPropName.startsWith(
"Footer"));
3123 if(bHeader || bFooter || bFirstIsShared)
3125 switch(pEntry->
nWID)
3127 case SID_ATTR_PAGE_ON:
3133 case SID_ATTR_PAGE_DYNAMIC:
3134 case SID_ATTR_PAGE_SHARED:
3135 case SID_ATTR_PAGE_SHARED_FIRST:
3136 case SID_ATTR_PAGE_SIZE:
3147 const SfxItemSet& rSetSet = pSetItem->GetItemSet();
3149 SwStyleBase_Impl::ItemSetOverrider o(aBase, &
const_cast< SfxItemSet&
>(rSetSet));
3150 aRetRange[nProp] = GetStyleProperty_Impl(*pEntry, *pPropSet, aBase);
3153 else if(pEntry->
nWID == SID_ATTR_PAGE_ON)
3156 aRetRange[nProp] <<=
false;
3187 rSet.
GetItemIfSet(bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET,
false);
3191 const SfxItemSet& rSetSet = pSetItem->GetItemSet();
3193 SwStyleBase_Impl::ItemSetOverrider o(aBase, &
const_cast<SfxItemSet&
>(rSetSet));
3194 aRetRange[nProp] = GetStyleProperty_Impl(*pEntry, *pPropSet, aBase);
3202 switch(pEntry->
nWID)
3205 case SID_ATTR_PAGE_DYNAMIC:
3206 case SID_ATTR_PAGE_SHARED:
3207 case SID_ATTR_PAGE_SHARED_FIRST:
3208 case SID_ATTR_PAGE_ON:
3210 throw beans::UnknownPropertyException(
"Unknown property: " + rPropName,
static_cast < cppu::OWeakObject *
> (
this ) );
3222 sal_uInt16 nRes = 0;
3223 switch(pEntry->
nWID)
3236 const SwPageDesc* pDesc = aBase.GetOldPageDesc();
3245 if(bLeft && !bShare)
3246 pFrameFormat = &pDesc->
GetLeft();
3247 else if(bFirst && !bShareFirst)
3257 aRetRange[nProp] <<= xRet;
3269 aRetRange[nProp] = GetStyleProperty_Impl(*pEntry, *pPropSet, aBase);
3275uno::Sequence<uno::Any> SwXPageStyle::getPropertyValues(
const uno::Sequence<OUString>& rPropertyNames)
3278 uno::Sequence<uno::Any> aValues;
3283 aValues = GetPropertyValues_Impl(rPropertyNames);
3285 catch(beans::UnknownPropertyException &)
3288 throw lang::WrappedTargetRuntimeException(
"Unknown property exception caught",
3291 catch(lang::WrappedTargetException &)
3294 throw lang::WrappedTargetRuntimeException(
"WrappedTargetException caught",
3301uno::Any SwXPageStyle::getPropertyValue(
const OUString& rPropertyName)
3304 const uno::Sequence<OUString>
aProperties(&rPropertyName, 1);
3305 return GetPropertyValues_Impl(aProperties)[0];
3308void SwXPageStyle::setPropertyValue(
const OUString& rPropertyName,
const uno::Any& rValue)
3311 const uno::Sequence<OUString>
aProperties(&rPropertyName, 1);
3312 const uno::Sequence<uno::Any> aValues(&rValue, 1);
3318 if ((bIsFooter || bIsHeader) && rValue ==
uno::Any(
true))
3321 for (
size_t i = 0;
i < GetDoc()->GetPageDescCnt();
i++)
3323 auto pPageDesc = &GetDoc()->GetPageDesc(i);
3325 if (pPageDesc->
GetName() == GetStyleName())
3328 if (bIsHeader && pLeftHeader)
3335 if (bIsFooter && pLeftFooter)
3345 SetPropertyValues_Impl(aProperties, aValues);
3348SwXFrameStyle::SwXFrameStyle(
SwDoc *pDoc)
3352void SwXFrameStyle::SetItem(sal_uInt16 eAtr,
const SfxPoolItem& rItem)
3359 SfxItemSet& rStyleSet = xStyle->GetItemSet();
3362 xStyle->SetItemSet(aSet);
3372 return &xStyle->GetItemSet().Get(eAtr);
3375uno::Reference<container::XNameReplace> SwXFrameStyle::getEvents()
3381#define AUTOSTYLE_FAMILY_COUNT 3
3392 std::vector<std::shared_ptr<SfxItemSet>>::iterator
m_aIter;
3422 throw lang::IndexOutOfBoundsException();
3424 throw uno::RuntimeException();
3426 uno::Reference< style::XAutoStyleFamily > aRef;
3473 if(
Name ==
"CharacterStyles")
3475 else if(
Name ==
"RubyStyles")
3477 else if(
Name ==
"ParagraphStyles")
3480 throw container::NoSuchElementException();
3487 OUString* pNames = aNames.getArray();
3488 pNames[0] =
"CharacterStyles";
3489 pNames[1] =
"RubyStyles";
3490 pNames[2] =
"ParagraphStyles";
3496 if(
Name ==
"CharacterStyles" ||
3497 Name ==
"RubyStyles" ||
3498 Name ==
"ParagraphStyles" )
3505 m_pDocShell( pDocSh ), m_eFamily(nFamily)
3517 if(rHint.
GetId() == SfxHintId::Dying)
3521std::shared_ptr<SfxItemSet>
3523 const uno::Sequence<beans::PropertyValue>& Values,
SwAttrSet& aSet)
3547 throw uno::RuntimeException();
3551 if(!bTakeCareOfDrawingLayerFillStyle)
3553 for(
const beans::PropertyValue& rValue :
Values )
3559 catch (
const beans::UnknownPropertyException &)
3561 OSL_FAIL(
"Unknown property" );
3563 catch (
const lang::IllegalArgumentException &)
3565 OSL_FAIL(
"Illegal argument" );
3581 for(
const beans::PropertyValue& rValue :
Values )
3583 const OUString& rPropName = rValue.Name;
3589 SAL_WARN(
"sw.core",
"SwXAutoStyleFamily::insertStyle: Unknown property: " << rPropName);
3597 if(pEntry->
nMoreFlags & PropertyMoreFlags::METRIC_ITEM)
3618 if(eMapUnit != MapUnit::Map100thMM)
3625 switch(pEntry->
nWID)
3641 if(!(aValue >>= aTempName))
3643 throw lang::IllegalArgumentException();
3656 aXFillBitmapItem.
PutValue(aValue, nMemberId);
3657 aSet.
Put(aXFillBitmapItem);
3667 std::unique_ptr<SvxBrushItem> aChangedBrushItem(aOriginalBrushItem->Clone());
3669 aChangedBrushItem->PutValue(aValue, nMemberId);
3671 if(*aChangedBrushItem != *aOriginalBrushItem)
3681 drawing::BitmapMode
eMode;
3683 if(!(aValue >>=
eMode))
3685 sal_Int32 nMode = 0;
3687 if(!(aValue >>= nMode))
3689 throw lang::IllegalArgumentException();
3692 eMode =
static_cast<drawing::BitmapMode
>(nMode);
3710 catch (
const beans::UnknownPropertyException &)
3712 OSL_FAIL(
"Unknown property" );
3714 catch (
const lang::IllegalArgumentException &)
3716 OSL_FAIL(
"Illegal argument" );
3735 const uno::Sequence< beans::PropertyValue >& Values )
3739 throw uno::RuntimeException();
3761 throw uno::RuntimeException();
3775 throw uno::RuntimeException();
3776 return uno::Reference< container::XEnumeration >
3791:
m_rDoc( rInitDoc ), m_eFamily( eFam )
3796 std::set< std::pair< sal_uInt16, text::RubyAdjust > > aRubyMap;
3800 std::vector<const SwFormatRuby*> vRubyItems;
3803 auto pRubyItem =
dynamic_cast<const SwFormatRuby*
>(pItem);
3804 if ( pRubyItem && pRubyItem->GetTextRuby() )
3805 vRubyItems.push_back(pRubyItem);
3809 std::pair< sal_uInt16, text::RubyAdjust > aPair( pRubyItem->GetPosition(), pRubyItem->GetAdjustment() );
3810 if ( aRubyMap.insert( aPair ).second )
3812 auto pItemSet = std::make_shared<SfxItemSetFixed<RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY>>( rAttrPool );
3813 pItemSet->Put( *pRubyItem );
3839 if(rHint.
GetId() == SfxHintId::Dying)
3846 throw uno::RuntimeException();
3847 return m_pImpl->hasMoreElements();
3853 throw uno::RuntimeException();
3855 if(
m_pImpl->hasMoreElements() )
3857 std::shared_ptr<SfxItemSet> pNextSet =
m_pImpl->nextElement();
3859 pNextSet,
m_pImpl->getFamily());
3860 aRet <<= xAutoStyle;
3874 std::shared_ptr<SfxItemSet> pInitSet,
3876: mpSet(
std::move(pInitSet)),
3890 if(rHint.
GetId() == SfxHintId::Dying)
3896 uno::Reference< beans::XPropertySetInfo > xRet;
3932 const uno::Sequence<OUString>
aProperties(&rPropertyName, 1);
3937 const uno::Reference< beans::XPropertyChangeListener >& )
3942 const uno::Reference< beans::XPropertyChangeListener >& )
3947 const uno::Reference< beans::XVetoableChangeListener >& )
3952 const uno::Reference< beans::XVetoableChangeListener >& )
3957 const uno::Sequence< OUString >& ,
3958 const uno::Sequence< uno::Any >& )
3963 const uno::Sequence< OUString > & rPropertyNames )
3967 throw uno::RuntimeException();
3982 const OUString* pNames = rPropertyNames.getConstArray();
3984 const sal_Int32 nLen(rPropertyNames.getLength());
3985 uno::Sequence< uno::Any > aRet( nLen );
3989 for( sal_Int32
i = 0;
i < nLen; ++
i )
3991 const OUString sPropName = pNames[
i];
3995 throw beans::UnknownPropertyException(
"Unknown property: " + sPropName,
static_cast < cppu::OWeakObject *
> (
this ) );
4007 else if(bTakeCareOfDrawingLayerFillStyle)
4010 switch(pEntry->
nWID)
4016 if(!aOriginalBrushItem->QueryValue(aTarget, pEntry->
nMemberId))
4018 OSL_ENSURE(
false,
"Error getting attribute from RES_BACKGROUND (!)");
4028 aTarget <<= drawing::BitmapMode_REPEAT;
4032 aTarget <<= drawing::BitmapMode_STRETCH;
4036 aTarget <<= drawing::BitmapMode_NO_REPEAT;
4050 if(bTakeCareOfDrawingLayerFillStyle)
4058 aTarget <<= static_cast<sal_Int16>(
nValue);
4063 if(pEntry->
nMoreFlags & PropertyMoreFlags::METRIC_ITEM)
4084 if(eMapUnit != MapUnit::Map100thMM)
4100 const uno::Sequence< OUString >& rPropertyNames )
4103 uno::Sequence< uno::Any > aValues;
4110 catch (beans::UnknownPropertyException &)
4113 throw lang::WrappedTargetRuntimeException(
"Unknown property exception caught",
static_cast < cppu::OWeakObject *
> (
this ), exc );
4115 catch (lang::WrappedTargetException &)
4118 throw lang::WrappedTargetRuntimeException(
"WrappedTargetException caught",
static_cast < cppu::OWeakObject *
> (
this ), exc );
4125 const uno::Sequence< OUString >& ,
4126 const uno::Reference< beans::XPropertiesChangeListener >& )
4131 const uno::Reference< beans::XPropertiesChangeListener >& )
4136 const uno::Sequence< OUString >& ,
4137 const uno::Reference< beans::XPropertiesChangeListener >& )
4145 uno::Sequence< OUString > aNames { rPropertyName };
4147 return aStates.getConstArray()[0];
4156 const uno::Sequence < OUString > aSequence ( &rPropertyName, 1 );
4161 const uno::Sequence< OUString >& rPropertyNames )
4165 throw uno::RuntimeException();
4169 uno::Sequence< beans::PropertyState > aRet(rPropertyNames.getLength());
4170 beans::PropertyState* pStates = aRet.getArray();
4171 const OUString* pNames = rPropertyNames.getConstArray();
4186 for(sal_Int32
i = 0;
i < rPropertyNames.getLength();
i++)
4188 const OUString sPropName = pNames[
i];
4192 throw beans::UnknownPropertyException(
"Unknown property: " + sPropName,
static_cast < cppu::OWeakObject *
> (
this ) );
4197 if(bTakeCareOfDrawingLayerFillStyle)
4200 switch(pEntry->
nWID)
4207 pStates[
i] = beans::PropertyState_DIRECT_VALUE;
4211 pStates[
i] = beans::PropertyState_AMBIGUOUS_VALUE;
4222 pStates[
i] = beans::PropertyState_DIRECT_VALUE;
4226 pStates[
i] = beans::PropertyState_DEFAULT_VALUE;
4249 const uno::Sequence< OUString >& )
4254 const uno::Sequence< OUString >& )
4262 throw uno::RuntimeException();
4264 std::vector< beans::PropertyValue > aPropertyVector;
4283 const sal_uInt16 nWID = pItem->
Which();
4289 if ( pEntry->
nWID == nWID )
4291 beans::PropertyValue aPropertyValue;
4292 aPropertyValue.Name = pEntry->
aName;
4294 aPropertyVector.push_back( aPropertyValue );
4299 const sal_Int32
nCount = aPropertyVector.size();
4300 uno::Sequence< beans::PropertyValue > aRet(
nCount );
4301 beans::PropertyValue* pProps = aRet.getArray();
4303 for (
int i = 0;
i <
nCount; ++
i, pProps++ )
4305 *pProps = aPropertyVector[
i];
4312 m_pDocShell(pDocShell), m_pTableAutoFormat(pTableAutoFormat), m_bPhysical(true)
4318 m_pDocShell(pDocShell), m_pTableAutoFormat_Impl(new
SwTableAutoFormat(rTableAutoFormatName)), m_bPhysical(false)
4329 if (pAutoFormat && pAutoFormat->
GetName() == rTableAutoFormatName)
4332 if (!xTextTableStyle.is())
4340 if (!xTextTableStyle.is())
4343 SAL_INFO(
"sw.uno",
"creating SwXTextTableStyle for non existing SwTableAutoFormat");
4346 return xTextTableStyle;
4352 assert(aTableTemplateMap.size() ==
STYLE_COUNT &&
"can not map SwTableAutoFormat to a SwXTextTableStyle");
4357 if (!xCellStyle.is())
4399 for(
size_t i=0;
i < nStyles; ++
i)
4417 if (pTableAutoFormat)
4422 for (
size_t i=0;
i<aTableTemplateMap.size(); ++
i)
4426 if (!xCellStyle.is())
4429 xCellStyle->SetBoxFormat(&rNewBoxFormat);
4437 SAL_WARN(
"sw.uno",
"setting style physical, but SwTableAutoFormat in document not found");
4440 SAL_WARN(
"sw.uno",
"calling SetPhysical on a physical SwXTextTableStyle");
4464 if (!pFormat->GetInfo(aGetHt))
4507 SAL_WARN(
"sw.uno",
"not implemented");
4513 bool bIsRow =
false;
4526 throw css::beans::UnknownPropertyException(rPropertyName);
4528 return uno::Any(bIsRow ? OUString(
"row") : OUString(
"column"));
4533 SAL_WARN(
"sw.uno",
"not implemented");
4538 SAL_WARN(
"sw.uno",
"not implemented");
4543 SAL_WARN(
"sw.uno",
"not implemented");
4548 SAL_WARN(
"sw.uno",
"not implemented");
4556 CellStyleNameMap::const_iterator iter = rMap.find(rName);
4557 if(iter == rMap.end())
4558 throw css::container::NoSuchElementException();
4560 auto nIdx = (*iter).second;
4572 CellStyleNameMap::const_iterator iter = rMap.find(rName);
4573 return iter != rMap.end();
4579 SAL_WARN(
"sw.uno",
"not implemented");
4586 CellStyleNameMap::const_iterator iter = rMap.find(rName);
4587 if(iter == rMap.end())
4588 throw container::NoSuchElementException();
4589 const sal_Int32 nCellStyle = iter->second;
4592 if (!xStyleToReplaceWith.is())
4593 throw lang::IllegalArgumentException();
4596 if (!xStyleToReplaceWith->IsPhysical())
4597 throw lang::IllegalArgumentException();
4600 const sal_Int32 nBoxFormat = rTableTemplateMap[nCellStyle];
4615 SAL_WARN(
"sw.uno",
"not implemented");
4632 return {
"SwXTextTableStyle"};
4642 return {
"com.sun.star.style.Style"};
4647 m_pDocShell(pDocShell),
4648 m_pBoxAutoFormat(pBoxAutoFormat),
4649 m_sParentStyle(
std::move(sParentStyle)),
4654 m_pDocShell(pDocShell),
4672 SAL_INFO(
"sw.uno",
"trying to call SwXTextCellStyle::SetBoxFormat on non physical style");
4688 SAL_WARN(
"sw.uno",
"setting style physical, but SwBoxAutoFormat in document not found");
4691 SAL_WARN(
"sw.uno",
"calling SetPhysical on a physical SwXTextCellStyle");
4705 if (!pBoxAutoFormat)
4707 sal_Int32 nTemplateIndex;
4708 OUString sParentName;
4709 std::u16string_view sCellSubName;
4711 size_t nSeparatorIndex =
sName.rfind(
'.');
4712 if (nSeparatorIndex == std::u16string_view::npos)
4715 sParentName =
sName.substr(0, nSeparatorIndex);
4716 sCellSubName =
sName.substr(nSeparatorIndex+1);
4718 if (0 > nTemplateIndex)
4727 if (!pTableAutoFormat)
4731 *pParentName = sParentName;
4732 sal_uInt32 nBoxIndex = rTableTemplateMap[nTemplateIndex];
4733 pBoxAutoFormat = &pTableAutoFormat->
GetBoxFormat(nBoxIndex);
4736 return pBoxAutoFormat;
4743 if (!
sName.isEmpty())
4745 OUString sParentName;
4753 pBoxFormat = &aDefaultBoxFormat;
4757 if (!xTextCellStyle.is())
4759 xTextCellStyle.set(
new SwXTextCellStyle(pDocShell, pBoxFormat, sParentName));
4766 return xTextCellStyle;
4783 uno::Reference<style::XStyleFamiliesSupplier> xFamiliesSupplier(
m_pDocShell->
GetModel(), uno::UNO_QUERY);
4784 if (!xFamiliesSupplier.is())
4787 uno::Reference<container::XNameAccess> xFamilies = xFamiliesSupplier->getStyleFamilies();
4788 if (!xFamilies.is())
4791 uno::Reference<container::XNameAccess> xTableStyles;
4792 xFamilies->getByName(
"TableStyles") >>= xTableStyles;
4793 if (!xTableStyles.is())
4796 uno::Reference<style::XStyle> xStyle;
4801 return xStyle->isInUse();
4813 SAL_INFO(
"sw.uno",
"Changing SwXTextCellStyle parent");
4833 OUString sParentStyle;
4867 switch(pEntry->
nWID)
4900 if (aValue >>= nKey)
4930 bool bValue =
false; aValue >>= bValue;
4931 rShadowedItem.SetValue(bValue);
4938 bool bValue =
false; aValue >>= bValue;
4939 rContourItem.SetValue(bValue);
5042 SAL_WARN(
"sw.uno",
"SwXTextCellStyle unknown nWID");
5043 throw css::uno::RuntimeException();
5047 throw css::beans::UnknownPropertyException(rPropertyName);
5057 switch(pEntry->
nWID)
5088 if(!sFormat.isEmpty())
5112 aRet <<= rShadowedItem.GetValue();
5118 aRet <<= rContourItem.GetValue();
5206 SAL_WARN(
"sw.uno",
"SwXTextCellStyle unknown nWID");
5207 throw css::uno::RuntimeException();
5211 throw css::beans::UnknownPropertyException(rPropertyName);
5216 SAL_WARN(
"sw.uno",
"not implemented");
5221 SAL_WARN(
"sw.uno",
"not implemented");
5226 SAL_WARN(
"sw.uno",
"not implemented");
5231 SAL_WARN(
"sw.uno",
"not implemented");
5238 uno::Sequence<OUString> aNames { rPropertyName };
5240 return aStates.getConstArray()[0];
5246 uno::Sequence<beans::PropertyState> aRet(aPropertyNames.getLength());
5247 beans::PropertyState* pStates = aRet.getArray();
5250 const OUString* pNames = aPropertyNames.getConstArray();
5251 for(sal_Int32
i=0;
i < aPropertyNames.getLength(); ++
i)
5253 const OUString sPropName = pNames[
i];
5258 switch(pEntry->
nWID)
5263 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5268 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5273 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5278 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5285 pStates[
i] = sFormat.isEmpty() ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5291 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5296 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5301 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5306 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5311 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5316 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5321 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5326 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5331 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5336 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5341 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5346 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5351 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5356 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5361 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5366 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5371 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5376 pStates[
i] = aAny1 == aAny2 ? beans::PropertyState_DEFAULT_VALUE : beans::PropertyState_DIRECT_VALUE;
5380 pStates[
i] = beans::PropertyState_DIRECT_VALUE;
5381 SAL_WARN(
"sw.uno",
"SwXTextCellStyle getPropertyStates unknown nWID");
5386 SAL_WARN(
"sw.uno",
"SwXTextCellStyle unknown property:" + sPropName);
5387 throw css::beans::UnknownPropertyException(sPropName);
5403 switch(pEntry->
nWID)
5465 rShadowedItem.PutValue(aAny, pEntry->
nMemberId);
5473 rContourItem.PutValue(aAny, pEntry->
nMemberId);
5590 SAL_WARN(
"sw.uno",
"SwXTextCellStyle setPropertyToDefault unknown nWID");
5596 SAL_WARN(
"sw.uno",
"not implemented");
5604 return {
"SwXTextCellStyle"};
5614 return {
"com.sun.star.style.Style"};
const PropertyValue * pValues
bool IsConditionalByPoolId(sal_uInt16 nId)
const TranslateId STR_POOLPAGE_ARY[]
PropertiesInfo aProperties
OUString GetCommandContextByIndex(sal_Int16 nIndex)
sal_Int16 GetCommandContextIndex(std::u16string_view rContextName)
#define COND_COMMAND_COUNT
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
virtual std::shared_ptr< SfxItemSet > cacheAutomaticStyle(const SfxItemSet &rSet, SwAutoStyleFamily eFamily)=0
insert the style to the pool and the cache (used during import)
virtual void getAllStyles(std::vector< std::shared_ptr< SfxItemSet > > &rStyles, SwAutoStyleFamily eFamily)=0
void ForAllListeners(std::function< bool(SfxListener *)> f) const
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
sal_uInt16 GetSlotId(sal_uInt16 nWhich) const
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
bool hasPropertyByName(std::u16string_view rName) const
const o3tl::sorted_vector< const SfxItemPropertyMapEntry *, SfxItemPropertyMapCompare > & getPropertyEntries() const
css::beans::PropertyState getPropertyState(const OUString &rName, const SfxItemSet &rSet) const
void setPropertyValue(const SfxItemPropertyMapEntry &rEntry, const css::uno::Any &aVal, SfxItemSet &rSet) const
const SfxItemPropertyMap & getPropertyMap() const
void getPropertyValue(const SfxItemPropertyMapEntry &rEntry, const SfxItemSet &rSet, css::uno::Any &rAny) const
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
SfxItemPool * GetPool() const
void SetParent(const SfxItemSet *pNew)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxItemSet * GetParent() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
css::uno::Reference< css::frame::XModel3 > GetModel() const
css::uno::Reference< css::frame::XModel3 > GetBaseModel() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
virtual std::unique_ptr< SfxStyleSheetIterator > CreateIterator(SfxStyleFamily, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
virtual void Remove(SfxStyleSheetBase *)
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
SfxStyleSheetBase * Next()
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
virtual const OUString & GetParent() const
const OUString & GetName() const
bool IsUserDefined() const
virtual bool SetParent(const OUString &)
virtual bool IsUsed() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static OUString nameOf(const std::shared_ptr< SfxItemSet > &pSet)
bool StartListening(SvtBroadcaster &rBroadcaster)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
static Size GetDefaultPaperSize(MapUnit eUnit=MapUnit::MapTwip)
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual SvxSetItem * Clone(SfxItemPool *pPool=nullptr) const override
static bool SetFillAttribute(sal_uInt16 nWID, const OUString &rName, SfxItemSet &rSet, SdrModel const *pModel)
const Size & GetSize() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
SwAttrPool * GetPool() const
std::shared_ptr< SfxItemSet > const & nextElement()
std::vector< std::shared_ptr< SfxItemSet > > mAutoStyles
std::vector< std::shared_ptr< SfxItemSet > >::iterator m_aIter
IStyleAccess::SwAutoStyleFamily getFamily() const
IStyleAccess::SwAutoStyleFamily m_eFamily
SwAutoStylesEnumImpl(SwDoc &rInitDoc, IStyleAccess::SwAutoStyleFamily eFam)
OUString GetBoxFormatName(const SwBoxAutoFormat &rBoxFormat) const
If found returns its name. If not found returns an empty OUString.
void ChangeBoxFormatName(std::u16string_view sFromName, const OUString &sToName)
void AddBoxFormat(const SwBoxAutoFormat &rBoxFormat, const OUString &sName)
Add a copy of rBoxFormat.
SwBoxAutoFormat * GetBoxFormat(std::u16string_view sName) const
If found returns a ptr to a BoxFormat. If not found returns nullptr.
void RemoveBoxFormat(const OUString &sName)
SwTextFormatColl * GetTextFormatColl() const
void SetStyle(const OUString *pStyle, sal_uInt16 nPos)
static const CommandStruct * GetCmds()
ErrCode LoadStylesFromFile(const OUString &rURL, SwgReaderOption &rOpt, bool bUnoCall)
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
SwDoc * GetDoc()
returns Doc. But be careful!
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
const sw::TableFrameFormats * GetTableFrameFormats() const
const SwCharFormat * GetDfltCharFormat() const
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
void CheckForUniqueItemForLineFillNameOrIndex(SfxItemSet &rSet)
const SwCellStyleTable & GetCellStyles() const
size_t GetPageDescCnt() const
const SwNumRuleTable & GetNumRuleTable() const
const sw::FrameFormats< SwFrameFormat * > * GetFrameFormats() const
SwNumRule * GetOutlineNumRule() const
const SwCharFormats * GetCharFormats() const
IStyleAccess & GetIStyleAccess()
bool IsInXMLImport() const
const SwTextFormatColls * GetTextFormatColls() const
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
const SwTextFormatColl * GetDfltTextFormatColl() const
void ChgPageDesc(const OUString &rName, const SwPageDesc &)
const SwAttrPool & GetAttrPool() const
const SwFrameFormat * GetDfltFrameFormat() const
SwTableAutoFormatTable & GetTableStyles()
Return the available table styles.
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
SwDocShell * GetDocShell()
const SwPageDesc & GetPageDesc(const size_t i) const
bool HasTableStyles() const
Counts table styles without triggering lazy-load of them.
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
SwPageDesc * GetPageDesc()
const OUString & GetName() const
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
void StashFrameFormat(const SwFrameFormat &rFormat, bool bHeader, bool bLeft, bool bFirst)
Remember original header/footer formats even when they are hidden by "sharing".
const OUString & GetName() const
void ResetAllMasterAttr()
Reset all attrs of the format but keep the ones a pagedesc cannot live without.
void SetVerticalAdjustment(const drawing::TextVerticalAdjust nVA)
SwFrameFormat & GetMaster()
bool IsHeaderShared() const
bool IsFirstShared() const
bool IsFooterShared() const
SwFrameFormat & GetFirstLeft()
SwFrameFormat & GetFirstMaster()
bool GetLandscape() const
SwFrameFormat & GetLeft()
static SwPageDesc * GetByName(SwDoc &rDoc, std::u16string_view rName)
void SetUseOn(UseOnPage eNew)
Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is not modified.
const SwTextFormatColl * GetRegisterFormatColl() const
retrieve the style for the grid alignment
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
static void FillProgName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
SwTable is one table in the document model, containing rows (which contain cells).
const OUString & GetTableStyleName() const
Return the table style name of this table.
static SwTable * FindTable(SwFrameFormat const *const pFormat)
Represents the style of a paragraph.
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
virtual css::uno::Type SAL_CALL getElementType() override
virtual void Notify(const SfxHint &) override
virtual ~SwXAutoStyleFamily() override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
IStyleAccess::SwAutoStyleFamily m_eFamily
virtual css::uno::Reference< css::style::XAutoStyle > SAL_CALL insertStyle(const css::uno::Sequence< css::beans::PropertyValue > &Values) override
virtual sal_Bool SAL_CALL hasElements() override
SwXAutoStyleFamily(SwDocShell *pDocShell, IStyleAccess::SwAutoStyleFamily eFamily)
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual void SAL_CALL setAllPropertiesToDefault() override
virtual void Notify(const SfxHint &) override
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
IStyleAccess::SwAutoStyleFamily meFamily
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL addPropertiesChangeListener(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
css::uno::Sequence< css::uno::Any > GetPropertyValues_Impl(const css::uno::Sequence< OUString > &aPropertyNames)
SwXAutoStyle(SwDoc *pDoc, std::shared_ptr< SfxItemSet > pInitSet, IStyleAccess::SwAutoStyleFamily eFam)
virtual void SAL_CALL removePropertiesChangeListener(const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyDefaults(const css::uno::Sequence< OUString > &aPropertyNames) override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getProperties() override
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues(const css::uno::Sequence< OUString > &aPropertyNames) override
virtual void SAL_CALL firePropertiesChangeEvent(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
std::shared_ptr< SfxItemSet > mpSet
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
virtual ~SwXAutoStyle() override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual void SAL_CALL setPropertiesToDefault(const css::uno::Sequence< OUString > &aPropertyNames) override
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Sequence< css::uno::Any > &aValues) override
virtual css::uno::Any SAL_CALL nextElement() override
SwXAutoStylesEnumerator(SwDoc &rDoc, IStyleAccess::SwAutoStyleFamily eFam)
virtual sal_Bool SAL_CALL hasMoreElements() override
virtual void Notify(const SfxHint &) override
std::unique_ptr< SwAutoStylesEnumImpl > m_pImpl
virtual ~SwXAutoStylesEnumerator() override
SwXAutoStyles(SwDocShell &rDocShell)
virtual css::uno::Any SAL_CALL getByName(const OUString &Name) override
virtual sal_Bool SAL_CALL hasByName(const OUString &Name) override
css::uno::Reference< css::style::XAutoStyleFamily > m_xAutoRubyStyles
css::uno::Reference< css::style::XAutoStyleFamily > m_xAutoCharStyles
virtual sal_Bool SAL_CALL hasElements() override
virtual sal_Int32 SAL_CALL getCount() override
css::uno::Reference< css::style::XAutoStyleFamily > m_xAutoParaStyles
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
virtual css::uno::Type SAL_CALL getElementType() override
virtual ~SwXAutoStyles() override
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
const OUString * GetBulletFontNames() const
const SwNumRule * GetNumRule() const
static bool isInvalidStyle(std::u16string_view rName)
const OUString * GetNewCharStyleNames() const
virtual sal_Bool SAL_CALL hasByName(const OUString &Name) override
virtual ~SwXStyleFamilies() override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
std::map< SfxStyleFamily, css::uno::Reference< css::container::XNameContainer > > m_vFamilies
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
virtual void SAL_CALL loadStylesFromURL(const OUString &rURL, const css::uno::Sequence< css::beans::PropertyValue > &aOptions) override
virtual css::uno::Type SAL_CALL getElementType() override
virtual sal_Int32 SAL_CALL getCount() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
static css::uno::Reference< css::style::XStyle > CreateStyle(SfxStyleFamily eFamily, SwDoc &rDoc)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL hasElements() override
virtual css::uno::Any SAL_CALL getByName(const OUString &Name) override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getStyleLoaderOptions() override
static css::uno::Reference< css::style::XStyle > CreateStyleCondParagraph(SwDoc &rDoc)
SwXStyleFamilies(SwDocShell &rDocShell)
A text cell style is a UNO API wrapper for a SwBoxAutoFormat core class.
virtual void SAL_CALL setParentStyle(const OUString &aParentStyle) override
bool m_bPhysical
If true, then it points to a core object, if false, then this is a created, but not-yet-inserted form...
virtual sal_Bool SAL_CALL isUserDefined() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
static css::uno::Reference< css::style::XStyle > CreateXTextCellStyle(SwDocShell *pDocShell, const OUString &sName)
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
void SetBoxFormat(SwBoxAutoFormat *pBoxFormat)
Sets the address of SwBoxAutoFormat this style is bound to. Usable only when style is physical.
SwBoxAutoFormat * GetBoxFormat()
returns box format assigned to this style
virtual sal_Bool SAL_CALL isInUse() override
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
virtual OUString SAL_CALL getName() override
SwBoxAutoFormat * m_pBoxAutoFormat
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual void SAL_CALL setName(const OUString &sName) override
SwXTextCellStyle(SwDocShell *pDocShell, SwBoxAutoFormat *pBoxAutoFormat, OUString sParentStyle)
std::shared_ptr< SwBoxAutoFormat > m_pBoxAutoFormat_Impl
Stores SwBoxAutoFormat when this is not a physical style.
virtual OUString SAL_CALL getParentStyle() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
static SwBoxAutoFormat * GetBoxAutoFormat(SwDocShell *pDocShell, std::u16string_view sName, OUString *pParentName)
This function looks for a SwBoxAutoFormat with given name.
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
A text table style is a UNO API wrapper for a SwTableAutoFormat.
SwTableAutoFormat * m_pTableAutoFormat
virtual void SAL_CALL setParentStyle(const OUString &aParentStyle) override
rtl::Reference< SwXTextCellStyle > m_aCellStyles[STYLE_COUNT]
virtual void SAL_CALL insertByName(const OUString &rName, const css::uno::Any &aElement) override
virtual void SAL_CALL setName(const OUString &rName) override
static const CellStyleNameMap & GetCellStyleNameMap()
virtual void SAL_CALL removeByName(const OUString &rName) override
virtual OUString SAL_CALL getParentStyle() override
virtual sal_Bool SAL_CALL hasElements() override
SwXTextTableStyle(SwDocShell *pDocShell, SwTableAutoFormat *pTableAutoFormat)
bool m_bPhysical
If true, then it points to a core object, if false, then this is a created, but not-yet-inserted form...
void UpdateCellStylesMapping()
Fills m_aCellStyles with SwXTextCellStyles pointing to children of this style.
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual OUString SAL_CALL getName() override
virtual css::uno::Type SAL_CALL getElementType() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual sal_Bool SAL_CALL isInUse() override
static css::uno::Reference< css::style::XStyle > CreateXTextTableStyle(SwDocShell *pDocShell, const OUString &rTableAutoFormatName)
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual void SAL_CALL replaceByName(const OUString &rName, const css::uno::Any &aElement) override
@ LAST_ROW_END_COLUMN_STYLE
@ FIRST_ROW_END_COLUMN_STYLE
@ LAST_ROW_START_COLUMN_STYLE
@ LAST_ROW_EVEN_COLUMN_STYLE
@ FIRST_ROW_START_COLUMN_STYLE
@ FIRST_ROW_EVEN_COLUMN_STYLE
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL isUserDefined() override
std::unique_ptr< SwTableAutoFormat > m_pTableAutoFormat_Impl
Stores SwTableAutoFormat when this is not a physical style.
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Any SAL_CALL getByName(const OUString &rName) override
virtual sal_Bool SAL_CALL hasByName(const OUString &rName) override
virtual OUString SAL_CALL getImplementationName() override
SwTableAutoFormat * GetTableFormat()
Returns box format assigned to this style.
static SwTableAutoFormat * GetTableAutoFormat(SwDocShell *pDocShell, std::u16string_view sName)
This function looks for a SwTableAutoFormat with given name. Returns nullptr if could not be found.
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
void SetNumRules(const bool bNew)
void SetTextFormats(const bool bNew)
void SetMerge(const bool bNew)
void SetPageDescs(const bool bNew)
void SetFrameFormats(const bool bNew)
void SetInputStream(const css::uno::Reference< css::io::XInputStream > &xInputStream)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
const css::uno::Sequence< sal_Int8 > & getSeq() const
css::uno::Type const & get()
virtual const SfxPoolItem * GetItem(sal_uInt16 eAtr)=0
virtual css::document::XEventsSupplier & GetEventsSupplier()=0
virtual void SetItem(sal_uInt16 eAtr, const SfxPoolItem &rItem)=0
#define FN_UNO_IS_AUTO_UPDATE
#define FN_UNO_PARA_STYLE_CONDITIONS
#define FN_UNO_HEADER_FIRST
#define FN_UNO_FOOTER_FIRST
#define FN_UNO_HEADER_LEFT
#define FN_UNO_STYLE_INTEROP_GRAB_BAG
#define FN_UNO_IS_PHYSICAL
#define FN_PARAM_FTN_INFO
#define FN_UNO_FOOTER_LEFT
#define FN_UNO_DISPLAY_NAME
#define FN_UNO_FOLLOW_STYLE
#define FN_UNO_LINK_STYLE
#define FN_UNO_HEADER_RIGHT
#define FN_UNO_FOOTER_RIGHT
virtual OUString GetName() const override
@ Fixed
Frame cannot be moved in Var-direction.
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr sal_uInt16 POOLATTR_BEGIN(HINT_BEGIN)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr sal_uInt16 RES_UNKNOWNATR_END(160)
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(166)
constexpr TypedWhichId< SvxShadowedItem > RES_CHRATR_SHADOWED(13)
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(102)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(113)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SwFormatAutoFormat > RES_TXTATR_AUTOFMT(50)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
constexpr TypedWhichId< SvxContourItem > RES_CHRATR_CONTOUR(4)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
constexpr TypedWhichId< SwHeaderAndFooterEatSpacingItem > RES_HEADER_FOOTER_EAT_SPACING(127)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(103)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SwTableBoxNumFormat > RES_BOXATR_FORMAT(RES_BOXATR_BEGIN)
constexpr TypedWhichId< SwFormatAutoFormat > RES_AUTO_STYLE(133)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(100)
constexpr TypedWhichId< SdrTextVertAdjustItem > RES_TEXT_VERT_ADJUST(137)
constexpr TypedWhichId< SwFormatDrop > RES_PARATR_DROP(70)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SfxUInt16Item > RES_PARATR_OUTLINELEVEL(79)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
constexpr TypedWhichId< SvxPaperBinItem > RES_PAPER_BIN(90)
constexpr TypedWhichId< SwFormatRuby > RES_TXTATR_CJK_RUBY(53)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
LanguageType GetAppLanguage()
WhichRangesContainer const aCharAutoFormatSetRange(svl::Items< RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1 >)
WhichRangesContainer const aTextNodeSetRange(svl::Items< RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1, RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, XATTR_FILL_FIRST, XATTR_FILL_LAST >)
Sequence< sal_Int8 > aSeq
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
#define SAL_N_ELEMENTS(arr)
bool needToMapFillItemsToSvxBrushItemTypes(const SfxItemSet &rSet, sal_uInt16 const nMID)
helper to check if fill style is set to color or bitmap and thus formerly used SvxBrushItem parts nee...
void SetPropertyValue(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const OUString &rPropertyName, const css::uno::Any &rValue, const SetAttrMode nAttrMode=SetAttrMode::DEFAULT)
css::uno::Sequence< typename M::key_type > mapKeysToSequence(M const &map)
sal_Int64 getSomethingImpl(const css::uno::Sequence< sal_Int8 > &rId, T *pThis, FallbackToGetSomethingOf< Base >={})
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Any SAL_CALL getCaughtException()
void Create(SvxOrientationItem &rItem, SvStream &rStrm, sal_uInt16)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
std::shared_ptr< T > make_shared(Args &&... args)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
constexpr auto toTwips(N number, Length from)
VBAHELPER_DLLPUBLIC bool setPropertyValue(css::uno::Sequence< css::beans::PropertyValue > &aProp, const OUString &aName, const css::uno::Any &aValue)
std::map< OUString, sal_Int32 > CellStyleNameMap
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
UNOTOOLS_DLLPUBLIC css::uno::Any GetProperty(OUString const &url, OUString const &property)
HashMap_OWString_Interface aMap
constexpr tools::Long constTwips_5mm
const sal_uInt16 COLL_DOC_BITS
@ RES_POOLCOLL_REGISTER_BEGIN
Group indices.
@ RES_POOLCOLL_HTML_BEGIN
Group HTML-styles.
@ RES_POOLCOLL_TEXT_BEGIN
@ RES_POOLCOLL_EXTRA_BEGIN
Special ranges.
@ RES_POOLCOLL_LISTS_BEGIN
Group lists.
@ RES_POOLCOLL_DOC_BEGIN
Group chapter / document.
@ RES_POOLPAGE_STANDARD
Standard page.
@ RES_POOLCHR_HTML_BEGIN
HTML-styles.
@ RES_POOLCHR_NORMAL_BEGIN
const sal_uInt16 COLL_GET_RANGE_BITS
const sal_uInt16 COLL_REGISTER_BITS
const sal_uInt16 COLL_TEXT_BITS
bool IsPoolUserFormat(sal_uInt16 nId)
const sal_uInt16 COLL_HTML_BITS
const sal_uInt16 COLL_LISTS_BITS
const sal_uInt16 COLL_EXTRA_BITS
std::map< OUString, rtl::Reference< Entity > > map
PropertyMoreFlags nMoreFlags
Reference< XModel > xModel
OUString SwResId(TranslateId aId)
constexpr sal_uInt8 MAXLEVEL
SVXCORE_DLLPUBLIC std::unique_ptr< SvxBrushItem > getSvxBrushItemFromSourceSet(const SfxItemSet &rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents=true, bool bXMLImportHack=false)
SVXCORE_DLLPUBLIC void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem &rBrush, SfxItemSet &rToSet)
void SvxUnoConvertToMM(const MapUnit eSourceMapUnit, uno::Any &rMetric) noexcept
void SvxUnoConvertFromMM(const MapUnit eDestinationMapUnit, uno::Any &rMetric) noexcept
SwUnoPropertyMapProvider aSwMapProvider
#define PROPERTY_MAP_PARA_AUTO_STYLE
#define OWN_ATTR_FILLBMP_MODE
#define PROPERTY_MAP_PAGE_STYLE
#define PROPERTY_MAP_CELL_STYLE
#define PROPERTY_MAP_NUM_STYLE
#define PROPERTY_MAP_CHAR_AUTO_STYLE
#define PROPERTY_MAP_PARA_STYLE
#define PROPERTY_MAP_TABLE_STYLE
#define PROPERTY_MAP_RUBY_AUTO_STYLE
#define PROPERTY_MAP_CHAR_STYLE
#define PROPERTY_MAP_FRAME_STYLE
#define PROPERTY_MAP_CONDITIONAL_PARA_STYLE
#define MID_PAGEDESC_PAGEDESCNAME
#define MID_DROPCAP_CHAR_STYLE_NAME
#define MID_RUBY_CHARSTYLE
constexpr OUStringLiteral UNO_NAME_TABLE_FIRST_ROW_START_COLUMN
constexpr OUStringLiteral UNO_NAME_LOAD_NUMBERING_STYLES
constexpr OUStringLiteral UNO_NAME_TABLE_FIRST_ROW_END_COLUMN
constexpr OUStringLiteral UNO_NAME_FOOTER_IS_SHARED
constexpr OUStringLiteral UNO_NAME_LOAD_FRAME_STYLES
constexpr OUStringLiteral UNO_NAME_HEADER_IS_SHARED
constexpr OUStringLiteral UNO_NAME_FIRST_IS_SHARED
constexpr OUStringLiteral UNO_NAME_TABLE_LAST_ROW_START_COLUMN
constexpr OUStringLiteral UNO_NAME_OVERWRITE_STYLES
constexpr OUStringLiteral UNO_NAME_LOAD_PAGE_STYLES
constexpr OUStringLiteral UNO_NAME_PARA_STYLE_CONDITIONS
constexpr OUStringLiteral UNO_NAME_TABLE_LAST_ROW_END_COLUMN
constexpr OUStringLiteral UNO_NAME_LOAD_TEXT_STYLES
constexpr OUStringLiteral UNO_NAME_DISPLAY_NAME
static SwGetPoolIdFromName lcl_GetSwEnumFromSfxEnum(SfxStyleFamily eFamily)
static const SfxItemSet * lcl_GetItemsetForProperty(const SfxItemSet &rSet, SfxStyleFamily eFamily, std::u16string_view rPropertyName)
#define nPoolCollDocRange
#define AUTOSTYLE_FAMILY_COUNT
#define nPoolCollHtmlRange
#define nPoolCollRegisterStackedStart
static uno::Reference< text::XText > lcl_makeHeaderFooter(const sal_uInt16 nRes, const bool bHeader, SwFrameFormat const *const pFrameFormat)
const IStyleAccess::SwAutoStyleFamily aAutoStyleByIndex[]
static bool lcl_InitConditional(SfxStyleSheetBasePool *pBasePool, const SfxStyleFamily eFamily, const OUString &rStyleName)
#define nPoolCollListsRange
#define nPoolCollRegisterRange
#define nPoolChrHtmlRange
#define nPoolChrNormalRange
#define nPoolCollExtraStackedStart
#define nPoolCollListsStackedStart
static const StyleFamilyEntry & lcl_GetStyleEntry(const SfxStyleFamily eFamily)
static bool lcl_GetHeaderFooterItem(SfxItemSet const &rSet, std::u16string_view rPropName, bool const bFooter, SvxSetItem const *&o_rpItem)
#define nPoolCollHtmlStackedStart
static uno::Reference< beans::XPropertySet > lcl_InitStandardStyle(const SfxStyleFamily eFamily, uno::Reference< container::XNameAccess > const &rxStyleFamily)
static sal_uInt8 lcl_TranslateMetric(const SfxItemPropertyMapEntry &rEntry, SwDoc *pDoc, uno::Any &o_aValue)
#define nPoolCollExtraRange
static uno::Reference< container::XNameAccess > lcl_InitStyleFamily(SwDoc *pDoc, const StyleFamilyEntry &rEntry)
static SwFormat * lcl_GetFormatForStyle(SwDoc const *pDoc, const rtl::Reference< SwDocStyleSheet > &xStyle, const SfxStyleFamily eFamily)
#define nPoolCollDocStackedStart
#define nPoolCollTextRange
std::shared_ptr< SfxItemSet > PropValuesToAutoStyleItemSet(SwDoc &rDoc, IStyleAccess::SwAutoStyleFamily eFamily, const uno::Sequence< beans::PropertyValue > &Values, SwAttrSet &aSet)
constexpr TypedWhichId< XFillBmpPosOffsetYItem > XATTR_FILLBMP_POSOFFSETY(XATTR_FILL_FIRST+18)
constexpr TypedWhichId< XGradientStepCountItem > XATTR_GRADIENTSTEPCOUNT(XATTR_FILL_FIRST+6)
constexpr TypedWhichId< XFillBmpPosItem > XATTR_FILLBMP_POS(XATTR_FILL_FIRST+8)
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr TypedWhichId< XFillBmpTileOffsetXItem > XATTR_FILLBMP_TILEOFFSETX(XATTR_FILL_FIRST+14)
constexpr TypedWhichId< XFillTransparenceItem > XATTR_FILLTRANSPARENCE(XATTR_FILL_FIRST+5)
constexpr TypedWhichId< XSecondaryFillColorItem > XATTR_SECONDARYFILLCOLOR(XATTR_FILL_FIRST+12)
constexpr TypedWhichId< SfxMetricItem > XATTR_FILLBMP_SIZEX(XATTR_FILL_FIRST+9)
constexpr TypedWhichId< XFillBmpPosOffsetXItem > XATTR_FILLBMP_POSOFFSETX(XATTR_FILL_FIRST+17)
constexpr TypedWhichId< XFillBmpTileOffsetYItem > XATTR_FILLBMP_TILEOFFSETY(XATTR_FILL_FIRST+15)
constexpr TypedWhichId< XFillBmpSizeYItem > XATTR_FILLBMP_SIZEY(XATTR_FILL_FIRST+10)
constexpr TypedWhichId< XFillBmpStretchItem > XATTR_FILLBMP_STRETCH(XATTR_FILL_FIRST+16)
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
constexpr TypedWhichId< XFillBmpSizeLogItem > XATTR_FILLBMP_SIZELOG(XATTR_FILL_FIRST+13)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)
constexpr TypedWhichId< XFillBmpTileItem > XATTR_FILLBMP_TILE(XATTR_FILL_FIRST+7)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XFillBackgroundItem > XATTR_FILLBACKGROUND(XATTR_FILL_FIRST+19)
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)