diff options
Diffstat (limited to 'editeng/source/uno/unoedprx.cxx')
-rw-r--r-- | editeng/source/uno/unoedprx.cxx | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx index a0eb64a93224..20d5df281bce 100644 --- a/editeng/source/uno/unoedprx.cxx +++ b/editeng/source/uno/unoedprx.cxx @@ -530,6 +530,20 @@ void SvxAccessibleTextAdapter::GetPortions( sal_Int32 nPara, std::vector<sal_Int mpTextForwarder->GetPortions( nPara, rList ); } +OUString SvxAccessibleTextAdapter::GetStyleSheet(sal_Int32 nPara) const +{ + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); + + return mpTextForwarder->GetStyleSheet(nPara); +} + +void SvxAccessibleTextAdapter::SetStyleSheet(sal_Int32 nPara, const OUString& rStyleName) +{ + assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); + + mpTextForwarder->SetStyleSheet(nPara, rStyleName); +} + SfxItemState SvxAccessibleTextAdapter::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const { assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); @@ -613,11 +627,11 @@ SfxItemPool* SvxAccessibleTextAdapter::GetPool() const return mpTextForwarder->GetPool(); } -OUString SvxAccessibleTextAdapter::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, std::optional<Color>& rpTxtColor, std::optional<Color>& rpFldColor ) +OUString SvxAccessibleTextAdapter::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, std::optional<Color>& rpTxtColor, std::optional<Color>& rpFldColor, std::optional<FontLineStyle>& rpFldLineStyle ) { assert(mpTextForwarder && "SvxAccessibleTextAdapter: no forwarder"); - return mpTextForwarder->CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor ); + return mpTextForwarder->CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor, rpFldLineStyle ); } void SvxAccessibleTextAdapter::FieldClicked( const SvxFieldItem& rField ) @@ -815,32 +829,30 @@ bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, sal_Int32& } } - if( aIndex.InField() ) - { - OutputDevice* pOutDev = GetRefDevice(); + if( !aIndex.InField() ) + return true; - DBG_ASSERT(pOutDev!=nullptr, "SvxAccessibleTextAdapter::GetIndexAtPoint: No ref device"); + OutputDevice* pOutDev = GetRefDevice(); - if( !pOutDev ) - return false; + DBG_ASSERT(pOutDev!=nullptr, "SvxAccessibleTextAdapter::GetIndexAtPoint: No ref device"); - ESelection aSelection = MakeEESelection( aIndex ); - SvxFont aFont = EditEngine::CreateSvxFontFromItemSet( mpTextForwarder->GetAttribs( aSelection ) ); - AccessibleStringWrap aStringWrap( *pOutDev, - aFont, - mpTextForwarder->GetText( aSelection ) ); + if( !pOutDev ) + return false; - tools::Rectangle aRect = mpTextForwarder->GetCharBounds( nPara, aIndex.GetEEIndex() ); - Point aPoint = rPoint; - aPoint.Move( -aRect.Left(), -aRect.Top() ); + ESelection aSelection = MakeEESelection( aIndex ); + SvxFont aFont = EditEngine::CreateSvxFontFromItemSet( mpTextForwarder->GetAttribs( aSelection ) ); + AccessibleStringWrap aStringWrap( *pOutDev, + aFont, + mpTextForwarder->GetText( aSelection ) ); - DBG_ASSERT(aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( rPoint ) >= 0, - "SvxAccessibleTextIndex::SetIndex: index value overflow"); + tools::Rectangle aRect = mpTextForwarder->GetCharBounds( nPara, aIndex.GetEEIndex() ); + Point aPoint = rPoint; + aPoint.Move( -aRect.Left(), -aRect.Top() ); - nIndex = (aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( aPoint )); - return true; - } + DBG_ASSERT(aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( rPoint ) >= 0, + "SvxAccessibleTextIndex::SetIndex: index value overflow"); + nIndex = (aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( aPoint )); return true; } |