diff options
Diffstat (limited to 'editeng/source/editeng/textconv.cxx')
-rw-r--r-- | editeng/source/editeng/textconv.cxx | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx index 7c4ed9ddd89d..3d4c03e1ddeb 100644 --- a/editeng/source/editeng/textconv.cxx +++ b/editeng/source/editeng/textconv.cxx @@ -29,8 +29,6 @@ using namespace com::sun::star; using namespace com::sun::star::uno; -using namespace com::sun::star::beans; -using namespace com::sun::star::linguistic2; TextConvWrapper::TextConvWrapper( weld::Widget* pWindow, const Reference< XComponentContext >& rxContext, @@ -122,17 +120,17 @@ bool TextConvWrapper::ConvMore_impl() // modified version of SvxSpellWrapper::SpellMore bool bMore = false; - EditEngine* pEE = m_pEditView->GetEditEngine(); - ImpEditEngine* pImpEE = m_pEditView->GetImpEditEngine(); - ConvInfo* pConvInfo = pImpEE->GetConvInfo(); + EditEngine& rEditEngine = m_pEditView->getEditEngine(); + ImpEditEngine& rImpEditEngine = m_pEditView->getImpEditEngine(); + ConvInfo* pConvInfo = rImpEditEngine.GetConvInfo(); if ( pConvInfo->bMultipleDoc ) { - bMore = pEE->ConvertNextDocument(); + bMore = rEditEngine.ConvertNextDocument(); if ( bMore ) { // The text has been entered in this engine ... - m_pEditView->GetImpEditView()->SetEditSelection( - pEE->GetEditDoc().GetStartPaM() ); + m_pEditView->getImpl().SetEditSelection( + rEditEngine.GetEditDoc().GetStartPaM() ); } } return bMore; @@ -143,9 +141,9 @@ void TextConvWrapper::ConvStart_impl( SvxSpellArea eArea ) { // modified version of EditSpellWrapper::SpellStart - EditEngine* pEE = m_pEditView->GetEditEngine(); - ImpEditEngine* pImpEE = m_pEditView->GetImpEditEngine(); - ConvInfo* pConvInfo = pImpEE->GetConvInfo(); + EditEngine& rEditEngine = m_pEditView->getEditEngine(); + ImpEditEngine& rImpEditEngine = m_pEditView->getImpEditEngine(); + ConvInfo* pConvInfo = rImpEditEngine.GetConvInfo(); if ( eArea == SvxSpellArea::BodyStart ) { @@ -155,14 +153,13 @@ void TextConvWrapper::ConvStart_impl( SvxSpellArea eArea ) pConvInfo->bConvToEnd = false; pConvInfo->aConvTo = pConvInfo->aConvStart; pConvInfo->aConvContinue = EPaM( 0, 0 ); - m_pEditView->GetImpEditView()->SetEditSelection( - pEE->GetEditDoc().GetStartPaM() ); + m_pEditView->getImpl().SetEditSelection( + rEditEngine.GetEditDoc().GetStartPaM() ); } else { pConvInfo->bConvToEnd = true; - pConvInfo->aConvTo = pImpEE->CreateEPaM( - pEE->GetEditDoc().GetStartPaM() ); + pConvInfo->aConvTo = rImpEditEngine.CreateEPaM(rEditEngine.GetEditDoc().GetStartPaM() ); } } else if ( eArea == SvxSpellArea::BodyEnd ) @@ -179,16 +176,14 @@ void TextConvWrapper::ConvStart_impl( SvxSpellArea eArea ) else { // nothing selected: convert to end of document - pConvInfo->aConvTo = pImpEE->CreateEPaM( - pEE->GetEditDoc().GetEndPaM() ); + pConvInfo->aConvTo = rImpEditEngine.CreateEPaM(rEditEngine.GetEditDoc().GetEndPaM() ); } } else if ( eArea == SvxSpellArea::Body ) { // called by ConvNext_impl... pConvInfo->aConvContinue = pConvInfo->aConvStart; - pConvInfo->aConvTo = pImpEE->CreateEPaM( - pEE->GetEditDoc().GetEndPaM() ); + pConvInfo->aConvTo = rImpEditEngine.CreateEPaM(rEditEngine.GetEditDoc().GetEndPaM() ); } else { @@ -204,7 +199,7 @@ bool TextConvWrapper::ConvContinue_impl() // get next convertible text portion and its language m_aConvText.clear(); m_nConvTextLang = LANGUAGE_NONE; - m_pEditView->GetImpEditEngine()->ImpConvert( m_aConvText, m_nConvTextLang, + m_pEditView->getImpEditEngine().ImpConvert( m_aConvText, m_nConvTextLang, m_pEditView, GetSourceLanguage(), m_aConvSel, m_bAllowChange, GetTargetLanguage(), GetTargetFont() ); return !m_aConvText.isEmpty(); @@ -341,15 +336,15 @@ void TextConvWrapper::ReplaceUnit( m_nUnitOffset = m_nUnitOffset + nUnitStart + aNewTxt.getLength(); // remember current original language for later use - ImpEditEngine *pImpEditEng = m_pEditView->GetImpEditEngine(); + ImpEditEngine& rImpEditEngine = m_pEditView->getImpEditEngine(); ESelection aOldSel = m_pEditView->GetSelection(); - //EditSelection aOldEditSel = pEditView->GetImpEditView()->GetEditSelection(); + //EditSelection aOldEditSel = pEditView->getImpl().GetEditSelection(); #ifdef DBG_UTIL - LanguageType nOldLang = pImpEditEng->GetLanguage( pImpEditEng->CreateSel( aOldSel ).Min() ); + LanguageType nOldLang = rImpEditEngine.GetLanguage(rImpEditEngine.CreateSel( aOldSel ).Min() ).nLang; #endif - pImpEditEng->UndoActionStart( EDITUNDO_INSERT ); + rImpEditEngine.UndoActionStart( EDITUNDO_INSERT ); // according to FT we should currently not bother about keeping // attributes in Hangul/Hanja conversion and leave that untouched. @@ -380,11 +375,10 @@ void TextConvWrapper::ReplaceUnit( } } - pImpEditEng->UndoActionEnd(); + rImpEditEngine.UndoActionEnd(); // adjust ConvContinue / ConvTo if necessary - ImpEditEngine* pImpEE = m_pEditView->GetImpEditEngine(); - ConvInfo* pConvInfo = pImpEE->GetConvInfo(); + ConvInfo* pConvInfo = rImpEditEngine.GetConvInfo(); sal_Int32 nDelta = aNewTxt.getLength() - aOrigTxt.getLength(); if (nDelta != 0) { @@ -401,7 +395,7 @@ void TextConvWrapper::ReplaceUnit( void TextConvWrapper::ChangeText( const OUString &rNewText, - const OUString& rOrigText, + std::u16string_view rOrigText, const uno::Sequence< sal_Int32 > *pOffsets, ESelection *pESelection ) { @@ -443,7 +437,7 @@ void TextConvWrapper::ChangeText( const OUString &rNewText, else { nPos = nConvTextLen; - nIndex = rOrigText.getLength(); + nIndex = rOrigText.size(); } // end of string also terminates non-matching char sequence |