summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMalte Timmermann <mt@openoffice.org>2000-12-05 10:05:15 +0000
committerMalte Timmermann <mt@openoffice.org>2000-12-05 10:05:15 +0000
commitaae4d1edbfcfa866b4ca6227f394c7c699841fe1 (patch)
tree520ca3f2874c2c05aadba7cca27d013aa2910e94 /svx
parent5c2e363d6822476d01193f89b8c93b36e10260f3 (diff)
#81265# No more default language, use items
Diffstat (limited to 'svx')
-rw-r--r--svx/source/editeng/editeng.cxx30
-rw-r--r--svx/source/editeng/editview.cxx44
-rw-r--r--svx/source/editeng/edtspell.cxx11
-rw-r--r--svx/source/editeng/eehtml.cxx6
-rw-r--r--svx/source/editeng/impedit.cxx6
-rw-r--r--svx/source/editeng/impedit.hxx17
-rw-r--r--svx/source/editeng/impedit2.cxx5
-rw-r--r--svx/source/editeng/impedit4.cxx55
8 files changed, 86 insertions, 88 deletions
diff --git a/svx/source/editeng/editeng.cxx b/svx/source/editeng/editeng.cxx
index acb5896b8e2f..3322ffd09902 100644
--- a/svx/source/editeng/editeng.cxx
+++ b/svx/source/editeng/editeng.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: editeng.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: mt $ $Date: 2000-12-04 13:53:18 $
+ * last change: $Author: mt $ $Date: 2000-12-05 11:05:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -526,9 +526,9 @@ void EditEngine::SetPolygon( const XPolyPolygon& rPoly, const XPolyPolygon* pXor
{
// Handelt es sich um eine offene Kurve?
const XPolygon& rP = rPoly[0];
- sal_uInt32 nCnt = rP.GetPointCount();
+ USHORT nCnt = rP.GetPointCount();
- if( nCnt == 0 || ( rP[0] != rP[nCnt - 1] ) )
+ if( ( nCnt == 0 ) || ( rP[0] != rP[nCnt - 1] ) )
// Offene Kurve
bSimple = sal_True;
}
@@ -910,9 +910,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
{
String aComplete;
- International aInt( Application::GetAppInternational() );
- if (pImpEditEngine)
- aInt = International( pImpEditEngine->eDefaultLanguage );
+ International aInt = International( pImpEditEngine->GetLanguage( EditPaM( aStart.GetNode(), aStart.GetIndex()+1 ) ) );
for( int n = MONDAY; n <= SUNDAY; ++n )
{
const String& rDay = aInt.GetDayText( (DayOfWeek)n );
@@ -1724,12 +1722,17 @@ void EditEngine::SetHyphenator( Reference< XHyphenator > & xHyph )
void EditEngine::SetDefaultLanguage( LanguageType eLang )
{
- pImpEditEngine->SetLanguage( eLang );
+#if SUPD >= 615
+ DBG_ERROR( "DefaultLanguage not longer supported" );
+#endif
}
LanguageType EditEngine::GetDefaultLanguage() const
{
- return pImpEditEngine->GetLanguage();
+#if SUPD >= 615
+ DBG_ERROR( "DefaultLanguage not longer supported" );
+#endif
+ return pImpEditEngine->GetLanguage( EditPaM( pImpEditEngine->GetEditDoc().SaveGetObject( 0 ), 0 ) );
}
sal_Bool __EXPORT EditEngine::SpellNextDocument()
@@ -1740,6 +1743,14 @@ sal_Bool __EXPORT EditEngine::SpellNextDocument()
EESpellState EditEngine::HasSpellErrors( LanguageType eLang )
{
+#if SUPD >= 615
+ DBG_ERROR( "DefaultLanguage not longer supported" );
+#endif
+ return HasSpellErrors();
+}
+
+EESpellState EditEngine::HasSpellErrors()
+{
#ifdef SVX_LIGHT
return EE_SPELL_NOSPELLER;
#else
@@ -1747,7 +1758,6 @@ EESpellState EditEngine::HasSpellErrors( LanguageType eLang )
if ( !pImpEditEngine->GetSpeller().is() )
return EE_SPELL_NOSPELLER;
- pImpEditEngine->eDefaultLanguage = eLang;
return pImpEditEngine->HasSpellErrors();
#endif
}
diff --git a/svx/source/editeng/editview.cxx b/svx/source/editeng/editview.cxx
index f6d14cd1d858..3c0f3409fabe 100644
--- a/svx/source/editeng/editview.cxx
+++ b/svx/source/editeng/editview.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: editview.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: mt $ $Date: 2000-11-24 11:30:28 $
+ * last change: $Author: mt $ $Date: 2000-12-05 11:05:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -290,7 +290,10 @@ void EditView::SetVisArea( const Rectangle& rRec )
const Rectangle& EditView::GetVisArea() const
{
DBG_CHKTHIS( EditView, 0 );
- return pImpEditView->GetVisDocArea();
+ // Change return value to Rectangle in next incompatible build !!!
+ static Rectangle aRect;
+ aRect = pImpEditView->GetVisDocArea();
+ return aRect;
}
void EditView::SetOutputArea( const Rectangle& rRec )
@@ -878,6 +881,14 @@ void EditView::CompleteAutoCorrect()
EESpellState EditView::StartSpeller( LanguageType eLang, sal_Bool bMultipleDoc )
{
+#if SUPD >= 615
+ DBG_ERROR( "DefaultLanguage not longer supported" );
+#endif
+ return StartSpeller( bMultipleDoc );
+}
+
+EESpellState EditView::StartSpeller( sal_Bool bMultipleDoc )
+{
#ifdef SVX_LIGHT
return EE_SPELL_NOSPELLER;
#else
@@ -885,14 +896,21 @@ EESpellState EditView::StartSpeller( LanguageType eLang, sal_Bool bMultipleDoc )
DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 );
if ( !PIMPEE->GetSpeller().is() )
return EE_SPELL_NOSPELLER;
- PIMPEE->eDefaultLanguage = eLang;
- SvxSpellWrapper::CheckSpellLang( PIMPEE->GetSpeller(), eLang );
+ SvxSpellWrapper::CheckSpellLang( PIMPEE->GetSpeller(), PIMPEE->GetLanguage( EditPaM( PIMPEE->GetEditDoc().SaveGetObject( 0 ), 0 ) ) );
return PIMPEE->Spell( this, bMultipleDoc );
#endif
}
EESpellState EditView::StartThesaurus( LanguageType eLang )
{
+#if SUPD >= 615
+ DBG_ERROR( "DefaultLanguage not longer supported" );
+#endif
+ return StartThesaurus();
+}
+
+EESpellState EditView::StartThesaurus()
+{
#ifdef SVX_LIGHT
return EE_SPELL_NOSPELLER;
#else
@@ -900,7 +918,7 @@ EESpellState EditView::StartThesaurus( LanguageType eLang )
DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 );
if ( !PIMPEE->GetSpeller().is() )
return EE_SPELL_NOSPELLER;
- PIMPEE->eDefaultLanguage = eLang;
+
return PIMPEE->StartThesaurus( this );
#endif
}
@@ -951,16 +969,18 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
PopupMenu *pAutoMenu = aPopupMenu.GetPopupMenu( MN_AUTOCORR );
PopupMenu *pInsertMenu = aPopupMenu.GetPopupMenu( MN_INSERT );
+ EditPaM aPaM2( aPaM );
+ aPaM2.GetIndex()++;
+
// Gibt es Replace-Vorschlaege?
String aSelected( GetSelected() );
Reference< XSpellAlternatives > xSpellAlt =
- xSpeller->spell( aSelected, PIMPEE->GetLanguage(),
- Sequence< PropertyValue >() );
+ xSpeller->spell( aSelected, PIMPEE->GetLanguage( aPaM2 ), Sequence< PropertyValue >() );
Sequence< OUString > aAlt;
if (xSpellAlt.is())
aAlt = xSpellAlt->getAlternatives();
const OUString *pAlt = aAlt.getConstArray();
- sal_uInt16 nWords = aAlt.getLength();
+ sal_uInt16 nWords = (USHORT) aAlt.getLength();
if ( nWords )
{
for ( sal_uInt16 nW = 0; nW < nWords; nW++ )
@@ -980,8 +1000,8 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
if (xDicList.is())
aDics = xDicList->getDictionaries();
const Reference< XDictionary > *pDic = aDics.getConstArray();
- sal_uInt16 nLanguage = PIMPEE->eDefaultLanguage;
- sal_uInt16 nDicCount = aDics.getLength();
+ sal_uInt16 nLanguage = PIMPEE->GetLanguage( aPaM2 );
+ sal_uInt16 nDicCount = (USHORT)aDics.getLength();
for ( sal_uInt16 i = 0; i < nDicCount; i++ )
{
Reference< XDictionary1 > xDic( pDic[i], UNO_QUERY );
@@ -1045,7 +1065,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
String aWord = pAlt[nId - MN_AUTOSTART];
SvxAutoCorrect* pAutoCorrect = EE_DLL()->GetGlobalData()->GetAutoCorrect();
if ( pAutoCorrect )
- pAutoCorrect->PutText( aSelected, aWord, PIMPEE->GetLanguage() );
+ pAutoCorrect->PutText( aSelected, aWord, PIMPEE->GetLanguage( aPaM2 ) );
InsertText( aWord );
}
else if ( nId >= MN_ALTSTART ) // Replace
diff --git a/svx/source/editeng/edtspell.cxx b/svx/source/editeng/edtspell.cxx
index 18833353398b..0d15f229e42a 100644
--- a/svx/source/editeng/edtspell.cxx
+++ b/svx/source/editeng/edtspell.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: edtspell.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: tl $ $Date: 2000-11-19 11:29:36 $
+ * last change: $Author: mt $ $Date: 2000-12-05 11:05:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -739,9 +739,8 @@ sal_Bool EdtAutoCorrDoc::ChgAutoCorrWord( sal_uInt16& rSttPos,
if( !aShort.Len() )
return bRet;
- LanguageType eLang = pImpEE->GetLanguage();
- const SvxAutocorrWord* pFnd = rACorrect.SearchWordsInList( *pCurNode,
- rSttPos, nEndPos, *this, eLang );
+ LanguageType eLang = pImpEE->GetLanguage( EditPaM( pCurNode, rSttPos+1 ) );
+ const SvxAutocorrWord* pFnd = rACorrect.SearchWordsInList( *pCurNode, rSttPos, nEndPos, *this, eLang );
if( pFnd && pFnd->IsTextOnly() )
{
// dann mal ersetzen
@@ -762,7 +761,7 @@ sal_Bool EdtAutoCorrDoc::ChgAutoCorrWord( sal_uInt16& rSttPos,
LanguageType EdtAutoCorrDoc::GetLanguage( sal_uInt16 nPos, sal_Bool bPrevPara ) const
{
- return pImpEE->GetLanguage();
+ return pImpEE->GetLanguage( EditPaM( pCurNode, nPos+1 ) );
}
void EdtAutoCorrDoc::ImplStartUndoAction()
diff --git a/svx/source/editeng/eehtml.cxx b/svx/source/editeng/eehtml.cxx
index 387d6797c4d3..9758d6269743 100644
--- a/svx/source/editeng/eehtml.cxx
+++ b/svx/source/editeng/eehtml.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: eehtml.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:01:14 $
+ * last change: $Author: mt $ $Date: 2000-12-05 11:05:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -492,7 +492,7 @@ void EditHTMLParser::NextToken( int nToken )
{
ImportInfo aImportInfo( HTMLIMP_NEXTTOKEN, this, pImpEditEngine->CreateESel( aCurSel ) );
aImportInfo.nToken = nToken;
- aImportInfo.nTokenValue = nTokenValue;
+ aImportInfo.nTokenValue = (short)nTokenValue;
if ( nToken == HTML_TEXTTOKEN )
aImportInfo.aText = aToken;
pImpEditEngine->aImportHdl.Call( &aImportInfo );
diff --git a/svx/source/editeng/impedit.cxx b/svx/source/editeng/impedit.cxx
index e43a63a24ef6..4b30e11db5e7 100644
--- a/svx/source/editeng/impedit.cxx
+++ b/svx/source/editeng/impedit.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impedit.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: mt $ $Date: 2000-11-27 18:00:21 $
+ * last change: $Author: mt $ $Date: 2000-12-05 11:05:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -870,7 +870,7 @@ Pair ImpEditView::Scroll( long ndX, long ndY, BYTE nRangeCheck )
aNewVisArea.Left() -= ndY;
aNewVisArea.Right() -= ndY;
}
- if ( ( nRangeCheck == RGCHK_PAPERSZ1 ) && ( aNewVisArea.Right() > pEditEngine->pImpEditEngine->CalcTextWidth() ) )
+ if ( ( nRangeCheck == RGCHK_PAPERSZ1 ) && ( aNewVisArea.Right() > (long)pEditEngine->pImpEditEngine->CalcTextWidth() ) )
{
long nDiff = pEditEngine->pImpEditEngine->CalcTextWidth() - aNewVisArea.Right(); // negativ
aNewVisArea.Move( nDiff, 0 ); // koennte im neg. Bereich landen...
diff --git a/svx/source/editeng/impedit.hxx b/svx/source/editeng/impedit.hxx
index d129f60970f6..a2342132b0a9 100644
--- a/svx/source/editeng/impedit.hxx
+++ b/svx/source/editeng/impedit.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impedit.hxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: mt $ $Date: 2000-11-29 15:55:47 $
+ * last change: $Author: mt $ $Date: 2000-12-05 11:05:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -389,14 +389,10 @@ private:
sal_uInt16 nBigTextObjectStart;
::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XSpellChecker1 > xSpeller;
+ ::com::sun::star::linguistic2::XSpellChecker1 > xSpeller;
::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XHyphenator > xHyphenator;
+ ::com::sun::star::linguistic2::XHyphenator > xHyphenator;
SpellInfo* pSpellInfo;
- LanguageType eDefaultLanguage; // aktuelle Sprache (des Wortes) wird immer
- // zusammen mit dem Wort fuer die neuen
- // Lingu Interfaces benoetigt.
-// ::com::sun::star::lang::Locale aDefaultLocale;
::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > xBI;
XubString aAutoCompleteText;
@@ -773,9 +769,8 @@ public:
{ xHyphenator = xHyph; }
SpellInfo* GetSpellInfo() const { return pSpellInfo; }
- void SetLanguage( LanguageType eLang ) { eDefaultLanguage = eLang;}
- LanguageType GetLanguage() const { return eDefaultLanguage; }
- ::com::sun::star::lang::Locale GetLocale( const EditPaM& rPaM );
+ LanguageType GetLanguage( const EditPaM& rPaM ) const;
+ ::com::sun::star::lang::Locale GetLocale( const EditPaM& rPaM ) const;
void DoOnlineSpelling( ContentNode* pThisNodeOnly = 0, sal_Bool bSpellAtCursorPos = sal_False, sal_Bool bInteruptable = sal_True );
EESpellState Spell( EditView* pEditView, sal_Bool bMultipleDoc );
diff --git a/svx/source/editeng/impedit2.cxx b/svx/source/editeng/impedit2.cxx
index 38336af94ff4..30feaab5aa1d 100644
--- a/svx/source/editeng/impedit2.cxx
+++ b/svx/source/editeng/impedit2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impedit2.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: mt $ $Date: 2000-11-29 15:55:47 $
+ * last change: $Author: mt $ $Date: 2000-12-05 11:05:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -175,7 +175,6 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) :
pVirtDev = NULL;
pEmptyItemSet = NULL;
pActiveView = NULL;
- eDefaultLanguage = LANGUAGE_NONE;
pSpellInfo = NULL;
pTextObjectPool = NULL;
pDragAndDropInfo = NULL;
diff --git a/svx/source/editeng/impedit4.cxx b/svx/source/editeng/impedit4.cxx
index c07442f63ea0..441604838e03 100644
--- a/svx/source/editeng/impedit4.cxx
+++ b/svx/source/editeng/impedit4.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impedit4.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: mt $ $Date: 2000-11-30 12:42:14 $
+ * last change: $Author: mt $ $Date: 2000-12-05 11:05:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1455,7 +1455,7 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed
return aSel;
}
-::com::sun::star::lang::Locale ImpEditEngine::GetLocale( const EditPaM& rPaM )
+LanguageType ImpEditEngine::GetLanguage( const EditPaM& rPaM ) const
{
short nScriptType = GetScriptType( rPaM );
USHORT nLangId = GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType );
@@ -1464,28 +1464,13 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed
if ( pAttr )
pLangItem = (const SvxLanguageItem*)pAttr->GetItem();
- ::com::sun::star::lang::Locale aLocale;
- String aLanguage, aCountry;
- ConvertLanguageToIsoNames( pLangItem->GetLanguage(), aLanguage, aCountry );
- aLocale.Language = aLanguage;
- aLocale.Country = aCountry;
-
- return aLocale;
+ return pLangItem->GetLanguage();
}
-/*
-::com::sun::star::lang::Locale ImpEditEngine::GetLocale()
+::com::sun::star::lang::Locale ImpEditEngine::GetLocale( const EditPaM& rPaM ) const
{
- if ( !aDefaultLocale.Language.getLength() )
- {
- String aLanguage, aCountry;
- ConvertLanguageToIsoNames( GetLanguage(), aLanguage, aCountry );
- aDefaultLocale.Language = aLanguage;
- aDefaultLocale.Country = aCountry;
- }
- return aDefaultLocale;
+ return SvxCreateLocale( GetLanguage( rPaM ) );
}
-*/
Reference< XSpellChecker1 > ImpEditEngine::GetSpeller()
{
@@ -1506,8 +1491,6 @@ EESpellState ImpEditEngine::Spell( EditView* pEditView, sal_Bool bMultipleDoc )
if ( !xSpeller.is() )
return EE_SPELL_NOSPELLER;
- if ( eDefaultLanguage == LANGUAGE_NONE )
- return EE_SPELL_NOLANGUAGE;
aOnlineSpellTimer.Stop();
@@ -1577,7 +1560,8 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView )
aCurSel.Max() = aCurSel.Min();
String aWord;
- Reference< XSpellAlternatives > xSpellAlt;
+ Reference< XSpellAlternatives > xSpellAlt;
+ Sequence< PropertyValue > aEmptySeq;
while (!xSpellAlt.is())
{
@@ -1623,8 +1607,7 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView )
}
if ( aWord.Len() > 1 )
- xSpellAlt = xSpeller->spell( aWord, eDefaultLanguage,
- Sequence< PropertyValue >() );
+ xSpellAlt = xSpeller->spell( aWord, GetLanguage( aCurSel.Max() ), aEmptySeq );
if ( bForward && !xSpellAlt.is() )
aCurSel = WordRight( aCurSel.Min(), ::com::sun::star::i18n::WordType::DICTIONARY_WORD );
@@ -1669,6 +1652,7 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel
ContentNode* pLastNode = aEditDoc.SaveGetObject( aEditDoc.Count() - 1 );
sal_uInt16 nNodes = GetEditDoc().Count();
sal_uInt16 nInvalids = 0;
+ Sequence< PropertyValue > aEmptySeq;
for ( sal_uInt16 n = 0; n < nNodes; n++ )
{
ContentNode* pNode = GetEditDoc().GetObject( n );
@@ -1684,11 +1668,6 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel
sal_uInt16 nWrongs = 0; // Auch im Absatz mal die Kontrolle abgeben...
// sal_Bool bStop = sal_False;
- // Alle WrongRanges im Unguetigkeitsbereich loeschen
- // Zu Testzwecken erstmal plaetten:
-// pWrongList->ResetRanges();
-// nInvStart = 0; nInvEnd = pNode->Len();
-
sal_uInt16 nPaintFrom = 0xFFFF, nPaintTo;
sal_Bool bSimpleRepaint = sal_True;
@@ -1725,8 +1704,7 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel
{
sal_uInt16 nWStart = aSel.Min().GetIndex();
sal_uInt16 nWEnd= aSel.Max().GetIndex();
- if ( !xSpeller->isValid( aWord, eDefaultLanguage,
- Sequence< PropertyValue >() ) )
+ if ( !xSpeller->isValid( aWord, GetLanguage( EditPaM( aSel.Min().GetNode(), nWStart+1 ) ), aEmptySeq ) )
{
// Pruefen, ob schon richtig markiert...
nWrongs++;
@@ -1869,7 +1847,8 @@ EESpellState ImpEditEngine::HasSpellErrors()
EditSelection aCurSel( aEditDoc.GetStartPaM() );
String aWord;
- Reference< XSpellAlternatives > xSpellAlt;
+ Reference< XSpellAlternatives > xSpellAlt;
+ Sequence< PropertyValue > aEmptySeq;
while ( !xSpellAlt.is() )
{
if ( ( aCurSel.Max().GetNode() == pLastNode ) &&
@@ -1881,8 +1860,7 @@ EESpellState ImpEditEngine::HasSpellErrors()
aCurSel = SelectWord( aCurSel, ::com::sun::star::i18n::WordType::DICTIONARY_WORD );
aWord = GetSelected( aCurSel );
if ( aWord.Len() > 1 )
- xSpellAlt = xSpeller->spell( aWord, eDefaultLanguage,
- Sequence< PropertyValue >() );
+ xSpellAlt = xSpeller->spell( aWord, GetLanguage( aCurSel.Max() ), aEmptySeq );
aCurSel = WordRight( aCurSel.Max(), ::com::sun::star::i18n::WordType::DICTIONARY_WORD );
}
#endif
@@ -1893,9 +1871,6 @@ EESpellState ImpEditEngine::HasSpellErrors()
EESpellState ImpEditEngine::StartThesaurus( EditView* pEditView )
{
#ifndef SVX_LIGHT
- if ( eDefaultLanguage == LANGUAGE_NONE )
- return EE_SPELL_NOLANGUAGE;
-
EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() );
if ( !aCurSel.HasRange() )
aCurSel = SelectWord( aCurSel, ::com::sun::star::i18n::WordType::DICTIONARY_WORD );
@@ -1905,7 +1880,7 @@ EESpellState ImpEditEngine::StartThesaurus( EditView* pEditView )
if (!xThes.is())
return EE_SPELL_ERRORFOUND;
- SvxThesaurusDialog aDialog( pEditView->GetWindow(), xThes, aWord, eDefaultLanguage );
+ SvxThesaurusDialog aDialog( pEditView->GetWindow(), xThes, aWord, GetLanguage( aCurSel.Max() ) );
if ( aDialog.Execute() == RET_OK )
{