20 #include <com/sun/star/beans/PropertyAttribute.hpp>
23 #include <osl/diagnose.h>
69 throw UnknownPropertyException(
"Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
70 if ( pMap->
nFlags & PropertyAttribute::READONLY)
71 throw PropertyVetoException (
"Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
85 if(!(aValue >>= uStyle))
86 throw lang::IllegalArgumentException();
92 std::unique_ptr<SwFormatDrop> pDrop;
93 std::unique_ptr<SwFormatCharFormat> pCharFormat;
95 throw lang::IllegalArgumentException();
103 pDrop.reset(static_cast<SwFormatDrop*>(rItem.
Clone()));
104 pDrop->SetCharFormat(xStyle->GetCharFormat());
109 pCharFormat.reset(static_cast<SwFormatCharFormat*>(rItem.
Clone()));
110 pCharFormat->SetCharFormat(xStyle->GetCharFormat());
116 std::unique_ptr<SfxPoolItem> pNewItem(rItem.
Clone());
117 pNewItem->PutValue( aValue, pMap->
nMemberId);
129 throw UnknownPropertyException(
"Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
138 OSL_FAIL (
"not implemented" );
143 OSL_FAIL (
"not implemented" );
148 OSL_FAIL (
"not implemented" );
153 OSL_FAIL (
"not implemented" );
160 PropertyState eRet = PropertyState_DIRECT_VALUE;
165 throw UnknownPropertyException(
"Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
169 eRet = PropertyState_DEFAULT_VALUE;
175 const sal_Int32
nCount = rPropertyNames.getLength();
176 Sequence < PropertyState > aRet ( nCount );
178 std::transform(rPropertyNames.begin(), rPropertyNames.end(), aRet.begin(),
179 [
this](
const OUString& rName) -> PropertyState {
return getPropertyState(rName); });
190 throw UnknownPropertyException(
"Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
191 if ( pMap->
nFlags & PropertyAttribute::READONLY)
192 throw RuntimeException(
"setPropertyToDefault: property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
194 rSet.ResetPoolDefaultItem ( pMap->
nWID );
203 throw UnknownPropertyException(
"Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
216 return "SwXTextDefaults";
226 return {
"com.sun.star.text.Defaults",
227 "com.sun.star.style.CharacterProperties",
228 "com.sun.star.style.CharacterPropertiesAsian",
229 "com.sun.star.style.CharacterPropertiesComplex",
230 "com.sun.star.style.ParagraphProperties",
231 "com.sun.star.style.ParagraphPropertiesAsian",
232 "com.sun.star.style.ParagraphPropertiesComplex" };
const SfxItemPropertySimpleEntry * getByName(std::u16string_view rName) const
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
SwDocShell * GetDocShell()
virtual void SAL_CALL setPropertyToDefault(const OUString &rPropertyName) override
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
#define PROPERTY_MAP_TEXT_DEFAULT
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
#define MID_PAGEDESC_PAGEDESCNAME
#define MID_DROPCAP_CHAR_STYLE_NAME
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual ~SwXTextDefaults() override
const SwCharFormat * GetDfltCharFormat() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
constexpr TypedWhichId< SwFormatDrop > RES_PARATR_DROP(70)
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Get the default attribute in this document.
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &rPropertyName) override
bool IsStaticDefaultItem(const SfxPoolItem *pItem)
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
const SfxItemPropertyMap & getPropertyMap() const
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &rPropertyNames) override
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &aValue) override
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &rPropertyName) override
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in current document.
SwXTextDefaults(SwDoc *pNewDoc)
SwUnoPropertyMapProvider aSwMapProvider
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
bool SetPageDesc(const css::uno::Any &rValue, SwDoc &rDoc, SfxItemSet &rSet)
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
const SfxItemPropertySet * m_pPropSet
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
const SwAttrPool & GetAttrPool() const