summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-04-06 17:28:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-04-06 21:46:05 +0200
commitc2c5b1f7558004aa0d3541b7c4ffadc5d6bad331 (patch)
tree9e378ae5f69e27d354b01d1f63e23014493c6513 /editeng
parentb5b27f017b08ad4fbc67222a36f71933aa5a47dd (diff)
remove Application::GetDefDialogParent call in editeng
and pass in an explicit parent to use Change-Id: I1aa768ec5ac13b2097b78499f964a3590a0ac14e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113695 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/inc/edtspell.hxx2
-rw-r--r--editeng/source/editeng/editview.cxx13
-rw-r--r--editeng/source/editeng/edtspell.cxx2
-rw-r--r--editeng/source/editeng/impedit.hxx6
-rw-r--r--editeng/source/editeng/impedit4.cxx17
-rw-r--r--editeng/source/misc/splwrap.cxx4
-rw-r--r--editeng/source/outliner/outlvw.cxx12
7 files changed, 25 insertions, 31 deletions
diff --git a/editeng/inc/edtspell.hxx b/editeng/inc/edtspell.hxx
index eaf73b8908de..91e2218dad06 100644
--- a/editeng/inc/edtspell.hxx
+++ b/editeng/inc/edtspell.hxx
@@ -45,7 +45,7 @@ private:
virtual bool SpellMore() override;
public:
- EditSpellWrapper(weld::Window* pWin, bool bIsStart, EditView* pView);
+ EditSpellWrapper(weld::Widget* pWin, bool bIsStart, EditView* pView);
};
/**
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 7cc5e123db35..6320c1f8dfbd 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -837,30 +837,29 @@ void EditView::CompleteAutoCorrect( vcl::Window const * pFrameWin )
}
}
-EESpellState EditView::StartSpeller( bool bMultipleDoc )
+EESpellState EditView::StartSpeller(weld::Widget* pDialogParent, bool bMultipleDoc)
{
if ( !pImpEditView->pEditEngine->pImpEditEngine->GetSpeller().is() )
return EESpellState::NoSpeller;
- return pImpEditView->pEditEngine->pImpEditEngine->Spell( this, bMultipleDoc );
+ return pImpEditView->pEditEngine->pImpEditEngine->Spell(this, pDialogParent, bMultipleDoc);
}
-EESpellState EditView::StartThesaurus()
+EESpellState EditView::StartThesaurus(weld::Widget* pDialogParent)
{
if ( !pImpEditView->pEditEngine->pImpEditEngine->GetSpeller().is() )
return EESpellState::NoSpeller;
- return pImpEditView->pEditEngine->pImpEditEngine->StartThesaurus( this );
+ return pImpEditView->pEditEngine->pImpEditEngine->StartThesaurus(this, pDialogParent);
}
-void EditView::StartTextConversion(
+void EditView::StartTextConversion(weld::Widget* pDialogParent,
LanguageType nSrcLang, LanguageType nDestLang, const vcl::Font *pDestFont,
sal_Int32 nOptions, bool bIsInteractive, bool bMultipleDoc )
{
- pImpEditView->pEditEngine->pImpEditEngine->Convert( this, nSrcLang, nDestLang, pDestFont, nOptions, bIsInteractive, bMultipleDoc );
+ pImpEditView->pEditEngine->pImpEditEngine->Convert(this, pDialogParent, nSrcLang, nDestLang, pDestFont, nOptions, bIsInteractive, bMultipleDoc);
}
-
sal_Int32 EditView::StartSearchAndReplace( const SvxSearchItem& rSearchItem )
{
return pImpEditView->pEditEngine->pImpEditEngine->StartSearchAndReplace( this, rSearchItem );
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index 04658edad326..f3aa07e25c1e 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -36,7 +36,7 @@ using namespace com::sun::star::beans;
using namespace com::sun::star::linguistic2;
-EditSpellWrapper::EditSpellWrapper(weld::Window* pWindow,
+EditSpellWrapper::EditSpellWrapper(weld::Widget* pWindow,
bool bIsStart, EditView* pView )
: SvxSpellWrapper(pWindow, bIsStart, false/*bIsAllRight*/)
{
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index a9cacc93111e..39e52c9f7a4b 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -1001,15 +1001,15 @@ public:
css::lang::Locale GetLocale( const EditPaM& rPaM ) const;
void DoOnlineSpelling( ContentNode* pThisNodeOnly = nullptr, bool bSpellAtCursorPos = false, bool bInterruptible = true );
- EESpellState Spell( EditView* pEditView, bool bMultipleDoc );
+ EESpellState Spell(EditView* pEditView, weld::Widget* pDialogParent, bool bMultipleDoc);
EESpellState HasSpellErrors();
void ClearSpellErrors();
- EESpellState StartThesaurus( EditView* pEditView );
+ EESpellState StartThesaurus(EditView* pEditView, weld::Widget* pDialogParent);
css::uno::Reference< css::linguistic2::XSpellAlternatives >
ImpSpell( EditView* pEditView );
// text conversion functions
- void Convert( EditView* pEditView, LanguageType nSrcLang, LanguageType nDestLang, const vcl::Font *pDestFont, sal_Int32 nOptions, bool bIsInteractive, bool bMultipleDoc );
+ void Convert(EditView* pEditView, weld::Widget* pDialogParent, LanguageType nSrcLang, LanguageType nDestLang, const vcl::Font *pDestFont, sal_Int32 nOptions, bool bIsInteractive, bool bMultipleDoc);
void ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, EditView* pEditView, LanguageType nSrcLang, const ESelection &rConvRange,
bool bAllowImplicitChangesForNotConvertibleText, LanguageType nTargetLang, const vcl::Font *pTargetFont );
ConvInfo * GetConvInfo() const { return pConvInfo.get(); }
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index d3b24a16a120..fc4348764796 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1435,7 +1435,7 @@ void ImpEditEngine::CreateSpellInfo( bool bMultipleDocs )
}
-EESpellState ImpEditEngine::Spell( EditView* pEditView, bool bMultipleDoc )
+EESpellState ImpEditEngine::Spell(EditView* pEditView, weld::Widget* pDialogParent, bool bMultipleDoc)
{
SAL_WARN_IF( !xSpeller.is(), "editeng", "No Spell checker set!" );
@@ -1459,8 +1459,7 @@ EESpellState ImpEditEngine::Spell( EditView* pEditView, bool bMultipleDoc )
else if ( CreateEPaM( aEditDoc.GetStartPaM() ) == pSpellInfo->aSpellStart )
bIsStart = true;
- vcl::Window* pParent = Application::GetDefDialogParent();
- std::unique_ptr<EditSpellWrapper> pWrp(new EditSpellWrapper(pParent ? pParent->GetFrameWeld() : nullptr,
+ std::unique_ptr<EditSpellWrapper> pWrp(new EditSpellWrapper(pDialogParent,
bIsStart, pEditView ));
pWrp->SpellDocument();
pWrp.reset();
@@ -1515,8 +1514,7 @@ bool ImpEditEngine::HasConvertibleTextPortion( LanguageType nSrcLang )
return bHasConvTxt;
}
-
-void ImpEditEngine::Convert( EditView* pEditView,
+void ImpEditEngine::Convert( EditView* pEditView, weld::Widget* pDialogParent,
LanguageType nSrcLang, LanguageType nDestLang, const vcl::Font *pDestFont,
sal_Int32 nOptions, bool bIsInteractive, bool bMultipleDoc )
{
@@ -1562,9 +1560,7 @@ void ImpEditEngine::Convert( EditView* pEditView,
else if ( CreateEPaM( aEditDoc.GetStartPaM() ) == pConvInfo->aConvStart )
bIsStart = true;
- tools::Rectangle aDummy;
- pEditView->pImpEditView->DrawSelectionXOR();
- TextConvWrapper aWrp( pEditView->pImpEditView->GetPopupParent(aDummy),
+ TextConvWrapper aWrp( pDialogParent,
::comphelper::getProcessComponentContext(),
LanguageTag::convertToLocale( nSrcLang ),
LanguageTag::convertToLocale( nDestLang ),
@@ -2431,7 +2427,7 @@ void ImpEditEngine::ClearSpellErrors()
aEditDoc.ClearSpellErrors();
}
-EESpellState ImpEditEngine::StartThesaurus( EditView* pEditView )
+EESpellState ImpEditEngine::StartThesaurus(EditView* pEditView, weld::Widget* pDialogParent)
{
EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() );
if ( !aCurSel.HasRange() )
@@ -2443,8 +2439,7 @@ EESpellState ImpEditEngine::StartThesaurus( EditView* pEditView )
return EESpellState::ErrorFound;
EditAbstractDialogFactory* pFact = EditAbstractDialogFactory::Create();
- tools::Rectangle aDummy;
- ScopedVclPtr<AbstractThesaurusDialog> xDlg(pFact->CreateThesaurusDialog(pEditView->pImpEditView->GetPopupParent(aDummy), xThes,
+ ScopedVclPtr<AbstractThesaurusDialog> xDlg(pFact->CreateThesaurusDialog(pDialogParent, xThes,
aWord, GetLanguage( aCurSel.Max() ) ));
if (xDlg->Execute() == RET_OK)
{
diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx
index fe6704b9513f..b51c9c97b613 100644
--- a/editeng/source/misc/splwrap.cxx
+++ b/editeng/source/misc/splwrap.cxx
@@ -132,7 +132,7 @@ SvxSpellWrapper::~SvxSpellWrapper()
*
--------------------------------------------------------------------*/
-SvxSpellWrapper::SvxSpellWrapper( weld::Window* pWn,
+SvxSpellWrapper::SvxSpellWrapper( weld::Widget* pWn,
const bool bStart, const bool bIsAllRight ) :
pWin ( pWn ),
@@ -149,7 +149,7 @@ SvxSpellWrapper::SvxSpellWrapper( weld::Window* pWn,
}
-SvxSpellWrapper::SvxSpellWrapper( weld::Window* pWn,
+SvxSpellWrapper::SvxSpellWrapper( weld::Widget* pWn,
Reference< XHyphenator > const &xHyphenator,
const bool bStart, const bool bOther ) :
pWin ( pWn ),
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index 7201bf840f24..6423094e793b 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1223,17 +1223,17 @@ OUString OutlinerView::GetSelected() const
return pEditView->GetSelected();
}
-void OutlinerView::StartSpeller()
+void OutlinerView::StartSpeller(weld::Widget* pDialogParent)
{
- pEditView->StartSpeller();
+ pEditView->StartSpeller(pDialogParent);
}
-EESpellState OutlinerView::StartThesaurus()
+EESpellState OutlinerView::StartThesaurus(weld::Widget* pDialogParent)
{
- return pEditView->StartThesaurus();
+ return pEditView->StartThesaurus(pDialogParent);
}
-void OutlinerView::StartTextConversion(
+void OutlinerView::StartTextConversion(weld::Widget* pDialogParent,
LanguageType nSrcLang, LanguageType nDestLang, const vcl::Font *pDestFont,
sal_Int32 nOptions, bool bIsInteractive, bool bMultipleDoc )
{
@@ -1243,7 +1243,7 @@ void OutlinerView::StartTextConversion(
(LANGUAGE_CHINESE_TRADITIONAL == nSrcLang && LANGUAGE_CHINESE_SIMPLIFIED == nDestLang)
)
{
- pEditView->StartTextConversion( nSrcLang, nDestLang, pDestFont, nOptions, bIsInteractive, bMultipleDoc );
+ pEditView->StartTextConversion(pDialogParent, nSrcLang, nDestLang, pDestFont, nOptions, bIsInteractive, bMultipleDoc);
}
else
{