diff options
Diffstat (limited to 'editeng/source/editeng/eertfpar.cxx')
-rw-r--r-- | editeng/source/editeng/eertfpar.cxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index 3006caf21594..557081f8496f 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -31,6 +31,7 @@ #include <svtools/rtftoken.h> #include <svtools/htmltokn.h> +#include <comphelper/configuration.hxx> using namespace com::sun::star; @@ -55,10 +56,6 @@ RtfImportInfo::RtfImportInfo( RtfImportState eSt, SvParser<int>* pPrsrs, const E nTokenValue = 0; } -RtfImportInfo::~RtfImportInfo() -{ -} - constexpr MapUnit gRTFMapUnit = MapUnit::MapTwip; EditRTFParser::EditRTFParser( @@ -206,7 +203,6 @@ void EditRTFParser::NextToken( int nToken ) SkipGroup(); } break; - case RTF_PGDSCTBL: // #i29453# ignore \*\pgdsctbl destination case RTF_LISTTEXT: { SkipGroup(); @@ -307,7 +303,6 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) EditPaM aEndPaM( pEndNode, rSet.GetEndCnt() ); // If possible adjust the Escapement-Item: - const SfxPoolItem* pItem; // #i66167# adapt font heights to destination MapUnit if necessary const MapUnit eDestUnit = mpEditEngine->GetEditDoc().GetItemPool().GetMetric(0); @@ -316,6 +311,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) sal_uInt16 const aFntHeightIems[3] = { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, EE_CHAR_FONTHEIGHT_CTL }; for (unsigned short aFntHeightIem : aFntHeightIems) { + const SfxPoolItem* pItem; if (SfxItemState::SET == rSet.GetAttrSet().GetItemState( aFntHeightIem, false, &pItem )) { sal_uInt32 nHeight = static_cast<const SvxFontHeightItem*>(pItem)->GetHeight(); @@ -331,23 +327,29 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) } } - if( SfxItemState::SET == rSet.GetAttrSet().GetItemState( EE_CHAR_ESCAPEMENT, false, &pItem )) + if( const SvxEscapementItem* pItem = rSet.GetAttrSet().GetItemIfSet( EE_CHAR_ESCAPEMENT, false ) ) { // the correct one - tools::Long nEsc = static_cast<const SvxEscapementItem*>(pItem)->GetEsc(); + tools::Long nEsc = pItem->GetEsc(); tools::Long nEscFontHeight = 0; if( ( DFLT_ESC_AUTO_SUPER != nEsc ) && ( DFLT_ESC_AUTO_SUB != nEsc ) ) { nEsc *= 10; //HalfPoints => Twips was embezzled in RTFITEM.CXX! SvxFont aFont; - mpEditEngine->SeekCursor(aStartPaM.GetNode(), aStartPaM.GetIndex()+1, aFont); + if (comphelper::IsFuzzing()) + { + // ofz#24932 detecting RTL vs LTR is slow + aFont = aStartPaM.GetNode()->GetCharAttribs().GetDefFont(); + } + else + mpEditEngine->SeekCursor(aStartPaM.GetNode(), aStartPaM.GetIndex()+1, aFont); nEscFontHeight = aFont.GetFontSize().Height(); } if (nEscFontHeight) { nEsc = nEsc * 100 / nEscFontHeight; - SvxEscapementItem aEscItem( static_cast<short>(nEsc), static_cast<const SvxEscapementItem*>(pItem)->GetProportionalHeight(), EE_CHAR_ESCAPEMENT ); + SvxEscapementItem aEscItem( static_cast<short>(nEsc), pItem->GetProportionalHeight(), EE_CHAR_ESCAPEMENT ); rSet.GetAttrSet().Put( aEscItem ); } } |