diff options
Diffstat (limited to 'forms/source/richtext/rtattributehandler.cxx')
-rw-r--r-- | forms/source/richtext/rtattributehandler.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/forms/source/richtext/rtattributehandler.cxx b/forms/source/richtext/rtattributehandler.cxx index 653d42e46a5f..0075bd914119 100644 --- a/forms/source/richtext/rtattributehandler.cxx +++ b/forms/source/richtext/rtattributehandler.cxx @@ -108,7 +108,7 @@ namespace frm case SID_ATTR_CHAR_LATIN_WEIGHT: nWhich = EE_CHAR_WEIGHT; break; default: - nWhich = _rPool.GetWhich( static_cast<SfxSlotId>(_nAttributeId) ); + nWhich = _rPool.GetWhichIDFromSlotID( static_cast<SfxSlotId>(_nAttributeId) ); } return nWhich; } @@ -268,9 +268,9 @@ namespace frm :AttributeHandler( _nAttributeId, _nWhichId ) ,m_bScriptDependent( false ) { - m_bScriptDependent = ( SID_ATTR_CHAR_WEIGHT == _nAttributeId ) - || ( SID_ATTR_CHAR_POSTURE == _nAttributeId ) - || ( SID_ATTR_CHAR_FONT == _nAttributeId ); + m_bScriptDependent = ( sal_uInt16(SID_ATTR_CHAR_WEIGHT) == _nAttributeId ) + || ( sal_uInt16(SID_ATTR_CHAR_POSTURE) == _nAttributeId ) + || ( sal_uInt16(SID_ATTR_CHAR_FONT) == _nAttributeId ); } @@ -304,8 +304,8 @@ namespace frm FontSizeHandler::FontSizeHandler( AttributeId _nAttributeId, WhichId _nWhichId ) :AttributeHandler( _nAttributeId, _nWhichId ) { - OSL_ENSURE( ( _nAttributeId == SID_ATTR_CHAR_FONTHEIGHT ) || ( _nAttributeId == SID_ATTR_CHAR_CTL_FONTHEIGHT ) - || ( _nAttributeId == SID_ATTR_CHAR_CJK_FONTHEIGHT ) || ( _nAttributeId == SID_ATTR_CHAR_LATIN_FONTHEIGHT ), + OSL_ENSURE( ( _nAttributeId == sal_uInt16(SID_ATTR_CHAR_FONTHEIGHT) ) || ( _nAttributeId == sal_uInt16(SID_ATTR_CHAR_CTL_FONTHEIGHT) ) + || ( _nAttributeId == sal_uInt16(SID_ATTR_CHAR_CJK_FONTHEIGHT) ) || ( _nAttributeId == sal_uInt16(SID_ATTR_CHAR_LATIN_FONTHEIGHT) ), "FontSizeHandler::FontSizeHandler: invalid attribute id!" ); } @@ -320,7 +320,7 @@ namespace frm if ( pFontHeightItem ) { // by definition, the item should have the unit twip - sal_uLong nHeight = pFontHeightItem->GetHeight(); + sal_uInt32 nHeight = pFontHeightItem->GetHeight(); if ( _rAttribs.GetPool()->GetMetric( getWhich() ) != MapUnit::MapTwip ) { nHeight = OutputDevice::LogicToLogic( @@ -347,7 +347,7 @@ namespace frm if ( !pFontHeightItem ) return; - sal_uLong nHeight = pFontHeightItem->GetHeight(); + sal_uInt32 nHeight = pFontHeightItem->GetHeight(); if ( _rNewAttribs.GetPool()->GetMetric( getWhich() ) != MapUnit::MapTwip ) { nHeight = OutputDevice::LogicToLogic( @@ -360,7 +360,7 @@ namespace frm SvxFontHeightItem aNewItem( nHeight, 100, getWhich() ); aNewItem.SetProp( pFontHeightItem->GetProp(), pFontHeightItem->GetPropUnit() ); - if ( ( getAttributeId() == SID_ATTR_CHAR_FONTHEIGHT ) && _nForScriptType != SvtScriptType::NONE) + if ( ( getAttributeId() == sal_uInt16(SID_ATTR_CHAR_FONTHEIGHT) ) && _nForScriptType != SvtScriptType::NONE) putItemForScript( _rNewAttribs, aNewItem, _nForScriptType ); else _rNewAttribs.Put( aNewItem ); @@ -402,9 +402,8 @@ namespace frm // if the current adjustment of the was the default adjustment for the *previous* text direction, // then we toggle the adjustment, too SvxAdjust eCurrentAdjustment = SvxAdjust::Left; - const SfxPoolItem* pCurrentAdjustment = nullptr; - if ( SfxItemState::SET == _rCurrentAttribs.GetItemState( EE_PARA_JUST, true, &pCurrentAdjustment ) ) - eCurrentAdjustment = static_cast< const SvxAdjustItem* >( pCurrentAdjustment )->GetAdjust(); + if ( const SvxAdjustItem* pCurrentAdjustment = _rCurrentAttribs.GetItemIfSet( EE_PARA_JUST ) ) + eCurrentAdjustment = pCurrentAdjustment->GetAdjust(); if ( eCurrentAdjustment == m_eOppositeDefaultAdjustment ) _rNewAttribs.Put( SvxAdjustItem( m_eDefaultAdjustment, EE_PARA_JUST ) ); |