34#include <com/sun/star/beans/XPropertySet.hpp>
35#include <com/sun/star/chart2/XFormattedString.hpp>
64 return aCharacterPropertyMap;
69 const uno::Reference< beans::XPropertySet > & rPropertySet,
71 ItemConverter( rPropertySet, rItemPool )
74CharacterPropertyItemConverter::CharacterPropertyItemConverter(
75 const uno::Reference< beans::XPropertySet > & rPropertySet,
77 const awt::Size* pRefSize,
78 OUString aRefSizePropertyName,
79 const uno::Reference< beans::XPropertySet > & rRefSizePropSet ) :
80 ItemConverter( rPropertySet, rItemPool ),
81 m_aRefSizePropertyName(
std::move( aRefSizePropertyName )),
82 m_xRefSizePropSet( rRefSizePropSet.is() ? rRefSizePropSet : rPropertySet )
85 m_pRefSize = *pRefSize;
88CharacterPropertyItemConverter::~CharacterPropertyItemConverter()
99 ItemPropertyMapType::const_iterator aIt( rMap.find( nWhichId ));
101 if( aIt == rMap.end())
104 rOutProperty =(*aIt).second;
108void CharacterPropertyItemConverter::FillSpecialItem(
109 sal_uInt16 nWhichId,
SfxItemSet & rOutItemSet )
const
121 aPostfix =
"Complex";
136 rOutItemSet.
Put( aItem );
143 bool bModified =
false;
152 aValue = GetPropertySet()->getPropertyValue(
"CharUnderlineHasColor" );
153 if( aValue.
hasValue() && *o3tl::doAccess<bool>(aValue) )
159 aValue = GetPropertySet()->getPropertyValue(
"CharUnderlineColor" );
167 rOutItemSet.
Put( aItem );
174 bool bModified =
false;
183 aValue = GetPropertySet()->getPropertyValue(
"CharOverlineHasColor" );
184 if ( aValue.
hasValue() && *o3tl::doAccess<bool>(aValue) )
190 aValue = GetPropertySet()->getPropertyValue(
"CharOverlineColor" );
199 rOutItemSet.
Put( aItem );
212 aPostfix =
"Complex";
220 rOutItemSet.
Put( aItem );
233 aPostfix =
"Complex";
241 rOutItemSet.
Put( aItem );
254 aPostfix =
"Complex";
262 if( aValue >>= fHeight )
266 awt::Size aOldRefSize;
267 if( GetRefSizePropertySet()->
getPropertyValue( m_aRefSizePropertyName ) >>= aOldRefSize )
270 fHeight =
static_cast< float >(
271 RelativeSizeHelper::calculate( fHeight, aOldRefSize, *m_pRefSize ));
277 rOutItemSet.
Put( aItem );
280 catch(
const uno::Exception & )
287 case SID_CHAR_DLG_PREVIEW_STRING:
290 if( xFormattedString.is() )
292 OUString aString = xFormattedString->getString();
307bool CharacterPropertyItemConverter::ApplySpecialItem(
308 sal_uInt16 nWhichId,
const SfxItemSet & rItemSet )
310 bool bChanged =
false;
323 aPostfix =
"Complex";
327 rItemSet.
Get( nWhichId ));
331 if( aValue != GetPropertySet()->getPropertyValue(
"CharFontName" + aPostfix ))
333 GetPropertySet()->setPropertyValue(
"CharFontName" + aPostfix, aValue );
339 if( aValue != GetPropertySet()->
getPropertyValue(
"CharFontFamily" + aPostfix ))
341 GetPropertySet()->setPropertyValue(
"CharFontFamily" + aPostfix, aValue );
347 if( aValue != GetPropertySet()->
getPropertyValue(
"CharFontStyleName" + aPostfix ))
349 GetPropertySet()->setPropertyValue(
"CharFontStyleName" + aPostfix, aValue );
355 if( aValue != GetPropertySet()->
getPropertyValue(
"CharFontCharSet" + aPostfix ))
357 GetPropertySet()->setPropertyValue(
"CharFontCharSet" + aPostfix, aValue );
363 if( aValue != GetPropertySet()->
getPropertyValue(
"CharFontPitch" + aPostfix ))
365 GetPropertySet()->setPropertyValue(
"CharFontPitch" + aPostfix, aValue );
376 rItemSet.
Get( nWhichId ));
380 if( aValue != GetPropertySet()->getPropertyValue(
"CharUnderline" ))
382 GetPropertySet()->setPropertyValue(
"CharUnderline" , aValue );
391 GetPropertySet()->setPropertyValue(
"CharUnderlineColor" , aValue );
398 if( aValue != GetPropertySet()->
getPropertyValue(
"CharUnderlineHasColor" ))
400 GetPropertySet()->setPropertyValue(
"CharUnderlineHasColor" , aValue );
413 if ( aValue != GetPropertySet()->getPropertyValue(
"CharOverline" ) )
415 GetPropertySet()->setPropertyValue(
"CharOverline" , aValue );
424 GetPropertySet()->setPropertyValue(
"CharOverlineColor" , aValue );
431 if ( aValue != GetPropertySet()->
getPropertyValue(
"CharOverlineHasColor" ) )
433 GetPropertySet()->setPropertyValue(
"CharOverlineHasColor" , aValue );
448 aPostfix =
"Complex";
452 rItemSet.
Get( nWhichId ));
456 if( aValue != GetPropertySet()->getPropertyValue(
"CharPosture" + aPostfix))
458 GetPropertySet()->setPropertyValue(
"CharPosture" + aPostfix, aValue );
473 aPostfix =
"Complex";
477 rItemSet.
Get( nWhichId ));
481 if( aValue != GetPropertySet()->getPropertyValue(
"CharWeight" + aPostfix))
483 GetPropertySet()->setPropertyValue(
"CharWeight" + aPostfix, aValue );
498 aPostfix =
"Complex";
502 rItemSet.
Get( nWhichId ));
508 bool bSetValue =
false;
509 if( aValue != GetPropertySet()->getPropertyValue(
"CharHeight" + aPostfix ))
515 awt::Size aNewRefSize = *m_pRefSize;
516 awt::Size aOldRefSize;
517 if( GetRefSizePropertySet()->getPropertyValue( m_aRefSizePropertyName ) >>= aOldRefSize )
519 if( aNewRefSize.Width != aOldRefSize.Width
520 || aNewRefSize.Height != aOldRefSize.Height )
528 if (m_pRefSize && GetRefSizePropertySet()->getPropertyValue( m_aRefSizePropertyName ).hasValue())
530 GetRefSizePropertySet()->setPropertyValue(
531 m_aRefSizePropertyName,
uno::Any(*m_pRefSize));
534 GetPropertySet()->setPropertyValue(
"CharHeight" + aPostfix, aValue );
539 catch(
const uno::Exception & )
552 return m_xRefSizePropSet;
const WhichRangesContainer nCharacterPropertyWhichPairs(svl::Items< EE_ITEMS_START, EE_ITEMS_END, SID_CHAR_DLG_PREVIEW_STRING, SID_CHAR_DLG_PREVIEW_STRING >)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
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 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
CharacterPropertyItemConverter(const css::uno::Reference< css::beans::XPropertySet > &rPropertySet, SfxItemPool &rItemPool)
std::pair< tPropertyNameType, tMemberIdType > tPropertyNameWithMemberId
#define DBG_UNHANDLED_EXCEPTION(...)
constexpr TypedWhichId< SvxContourItem > EE_CHAR_OUTLINE(EE_CHAR_START+8)
constexpr TypedWhichId< SvxHangingPunctuationItem > EE_PARA_HANGINGPUNCTUATION(EE_PARA_START+2)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
constexpr TypedWhichId< SvxUnderlineItem > EE_CHAR_UNDERLINE(EE_CHAR_START+5)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxShadowedItem > EE_CHAR_SHADOW(EE_CHAR_START+9)
constexpr TypedWhichId< SvxOverlineItem > EE_CHAR_OVERLINE(EE_CHAR_START+29)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CTL(EE_CHAR_START+22)
constexpr TypedWhichId< SvxCrossedOutItem > EE_CHAR_STRIKEOUT(EE_CHAR_START+6)
constexpr TypedWhichId< SvxForbiddenRuleItem > EE_PARA_FORBIDDENRULES(EE_PARA_START+3)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC(EE_CHAR_START+7)
constexpr TypedWhichId< SvxEmphasisMarkItem > EE_CHAR_EMPHASISMARK(EE_CHAR_START+25)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CJK(EE_CHAR_START+21)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
constexpr TypedWhichId< SvxFrameDirectionItem > EE_PARA_WRITINGDIR(EE_PARA_START+0)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CJK(EE_CHAR_START+23)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CTL(EE_CHAR_START+18)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CTL(EE_CHAR_START+24)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
constexpr TypedWhichId< SvxScriptSpaceItem > EE_PARA_ASIANCJKSPACING(EE_PARA_START+4)
constexpr TypedWhichId< SvxWordLineModeItem > EE_CHAR_WLM(EE_CHAR_START+13)
constexpr TypedWhichId< SvxCharReliefItem > EE_CHAR_RELIEF(EE_CHAR_START+26)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
#define MID_FONT_CHAR_SET
#define MID_FONT_FAMILY_NAME
#define MID_FONT_STYLE_NAME
std::map< ItemConverter::tWhichIdType, std::pair< ItemConverter::tPropertyNameType, ItemConverter::tMemberIdType > > ItemPropertyMapType
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)