Kaydet (Commit) 1f64b659 authored tarafından Vladimir Glazunov's avatar Vladimir Glazunov

CWS-TOOLING: integrate CWS tl82

......@@ -76,6 +76,8 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::linguistic2;
using ::rtl::OUString;
#define C2U(cChar) ::rtl::OUString::createFromAscii(cChar)
// struct SpellDialog_Impl ---------------------------------------------
......@@ -930,7 +932,7 @@ void SpellDialog::SetTitle_Impl(LanguageType nLang)
-----------------------------------------------------------------------*/
void SpellDialog::InitUserDicts()
{
sal_uInt16 nLang = aLanguageLB.GetSelectLanguage();
const LanguageType nLang = aLanguageLB.GetSelectLanguage();
const Reference< XDictionary > *pDic = 0;
......@@ -948,51 +950,50 @@ void SpellDialog::InitUserDicts()
pImpl->aDics = xDicList->getDictionaries();
}
// Benutzerbuecher anzeigen
SvtLinguConfig aCfg;
const bool bHC = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
// list suitable dictionaries
bool bEnable = false;
const sal_Int32 nSize = pImpl->aDics.getLength();
pDic = pImpl->aDics.getConstArray();
sal_Int32 i;
delete aAddToDictMB.GetPopupMenu();
PopupMenu* pMenu = new PopupMenu;
for (i = 0; i < nSize; ++i )
pMenu->SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS);
USHORT nItemId = 1; // menu items should be enumerated from 1 and not 0
for (sal_Int32 i = 0; i < nSize; ++i)
{
Reference< XDictionary > xDic( pDic[i], UNO_QUERY );
if (!xDic.is() || SvxGetIgnoreAllList() == xDic)
uno::Reference< linguistic2::XDictionary > xDicTmp( pDic[i], uno::UNO_QUERY );
if (!xDicTmp.is() || SvxGetIgnoreAllList() == xDicTmp)
continue;
// add only active and not read-only dictionaries to list
// from which to choose from
Reference< frame::XStorable > xStor( xDic, UNO_QUERY );
if ( xDic->isActive() && (!xStor.is() || !xStor->isReadonly()) )
uno::Reference< frame::XStorable > xStor( xDicTmp, uno::UNO_QUERY );
LanguageType nActLanguage = SvxLocaleToLanguage( xDicTmp->getLocale() );
if( xDicTmp->isActive()
&& xDicTmp->getDictionaryType() != linguistic2::DictionaryType_NEGATIVE
&& (nLang == nActLanguage || LANGUAGE_NONE == nActLanguage )
&& (!xStor.is() || !xStor->isReadonly()) )
{
sal_Bool bNegativ = xDic->getDictionaryType() == DictionaryType_NEGATIVE;
pMenu->InsertItem( (USHORT)i + 1, ::GetDicInfoStr( xDic->getName(),
SvxLocaleToLanguage( xDic->getLocale() ), bNegativ ) );
}
}
aAddToDictMB.SetPopupMenu(pMenu);
aAddToDictMB.Disable();
pMenu->InsertItem( nItemId, xDicTmp->getName() );
bEnable = sal_True;
sal_uInt16 k;
for ( k = 0; k < pMenu->GetItemCount(); ++k )
{
sal_uInt16 nId = pMenu->GetItemId(k) - 1;
sal_Bool bFound = sal_False;
const sal_uInt16 nDicLang = SvxLocaleToLanguage( pDic[nId]->getLocale() );
const sal_Bool bDicNegativ =
pDic[nId]->getDictionaryType() == DictionaryType_NEGATIVE;
// Stimmt die Sprache "uberein, dann enable
if ((nDicLang == nLang || nDicLang == LANGUAGE_NONE) && !bDicNegativ)
bFound = sal_True;
uno::Reference< lang::XServiceInfo > xSvcInfo( xDicTmp, uno::UNO_QUERY );
if (xSvcInfo.is())
{
OUString aDictionaryImageUrl( aCfg.GetSpellAndGrammarContextDictionaryImage(
xSvcInfo->getImplementationName(), bHC) );
if (aDictionaryImageUrl.getLength() > 0)
{
Image aImage( lcl_GetImageFromPngUrl( aDictionaryImageUrl ) );
pMenu->SetItemImage( nItemId, aImage );
}
}
if (bFound)
{
aAddToDictMB.Enable();
break;
++nItemId;
}
}
aAddToDictMB.SetPopupMenu(pMenu);
aAddToDictMB.Enable( bEnable );
}
/*-- 20.10.2003 15:31:06---------------------------------------------------
......@@ -1000,31 +1001,39 @@ void SpellDialog::InitUserDicts()
IMPL_LINK(SpellDialog, AddToDictionaryHdl, MenuButton*, pButton )
{
aSentenceED.UndoActionStart( SPELLUNDO_CHANGE_GROUP );
USHORT nItem = pButton->GetCurItemId();
//GetErrorText() returns the current error even if the text is already
//manually changed
String sNewWord= aSentenceED.GetErrorText();
const String aNewWord= aSentenceED.GetErrorText();
USHORT nItemId = pButton->GetCurItemId();
PopupMenu *pMenu = pButton->GetPopupMenu();
String aDicName ( pMenu->GetItemText( nItemId ) );
uno::Reference< linguistic2::XDictionary > xDic;
uno::Reference< linguistic2::XDictionaryList > xDicList( SvxGetDictionaryList() );
if (xDicList.is())
xDic = xDicList->getDictionaryByName( aDicName );
Reference< XDictionary > xDic( pImpl->aDics.getConstArray()[ nItem - 1 ], UNO_QUERY );
sal_Int16 nAddRes = DIC_ERR_UNKNOWN;
if (xDic.is())
{
String sTmpTxt( sNewWord );
sal_Bool bNegEntry = xDic->getDictionaryType() == DictionaryType_NEGATIVE;
nAddRes = linguistic::AddEntryToDic( xDic, sTmpTxt, bNegEntry,
::rtl::OUString(), LANGUAGE_NONE );
nAddRes = linguistic::AddEntryToDic( xDic, aNewWord, FALSE, OUString(), LANGUAGE_NONE );
// save modified user-dictionary if it is persistent
uno::Reference< frame::XStorable > xSavDic( xDic, uno::UNO_QUERY );
if (xSavDic.is())
xSavDic->store();
if(nAddRes == DIC_ERR_NONE)
if (nAddRes == DIC_ERR_NONE)
{
SpellUndoAction_Impl* pAction = new SpellUndoAction_Impl(
SPELLUNDO_CHANGE_ADD_TO_DICTIONARY, aDialogUndoLink);
pAction->SetDictionary(xDic);
pAction->SetAddedWord(sTmpTxt);
aSentenceED.AddUndoAction(pAction);
pAction->SetDictionary( xDic );
pAction->SetAddedWord( aNewWord );
aSentenceED.AddUndoAction( pAction );
}
// failed because there is already an entry?
if (DIC_ERR_NONE != nAddRes && xDic->getEntry( sTmpTxt ).is())
if (DIC_ERR_NONE != nAddRes && xDic->getEntry( aNewWord ).is())
nAddRes = DIC_ERR_NONE;
}
if (DIC_ERR_NONE != nAddRes)
......@@ -1032,8 +1041,6 @@ IMPL_LINK(SpellDialog, AddToDictionaryHdl, MenuButton*, pButton )
SvxDicError( this, nAddRes );
return 0; // Nicht weitermachen
}
// nach dem Aufnehmen ggf. '='-Zeichen entfernen
sNewWord.EraseAllChars( sal_Unicode( '=' ) );
// go on
SpellContinue_Impl();
......
......@@ -57,6 +57,7 @@
#include <i18npool/mslangid.hxx>
#include <comphelper/processfactory.hxx>
#include <osl/file.hxx>
#include <svl/lngmisc.hxx>
#include <stack>
......@@ -73,36 +74,6 @@ using ::rtl::OUString;
#define A2S(x) String::CreateFromAscii( x )
// GetReplaceEditString -------------------------------
static void GetReplaceEditString( String &rText )
{
// The strings returned by the thesaurus saometimes have some
// explanation text put in between '(' and ')' or a trailing '*'.
// These parts should not be put in the ReplaceEdit Text that may get
// inserted into the document. Thus we strip them from the text.
xub_StrLen nPos = rText.Search( sal_Unicode('(') );
while (STRING_NOTFOUND != nPos)
{
xub_StrLen nEnd = rText.Search( sal_Unicode(')'), nPos );
if (STRING_NOTFOUND != nEnd)
rText.Erase( nPos, nEnd-nPos+1 );
else
break;
nPos = rText.Search( sal_Unicode('(') );
}
nPos = rText.Search( sal_Unicode('*') );
if (STRING_NOTFOUND != nPos)
rText.Erase( nPos );
// remove any possible remaining ' ' that may confuse the thesaurus
// when it gets called with the text
rText.EraseLeadingAndTrailingChars( sal_Unicode(' ') );
}
// class LookUpComboBox_Impl --------------------------------------------------
LookUpComboBox_Impl::LookUpComboBox_Impl(
......@@ -488,7 +459,7 @@ IMPL_LINK( SvxThesaurusDialog_Impl, WordSelectHdl_Impl, ComboBox *, pBox )
{
USHORT nPos = pBox->GetSelectEntryPos();
String aStr( pBox->GetEntry( nPos ) );
GetReplaceEditString( aStr );
aStr = linguistic::GetThesaurusReplaceText( aStr );
aWordCB.SetText( aStr );
LookUp_Impl();
}
......@@ -507,7 +478,7 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesSelectHdl_Impl, SvxCheckListBox
if (pData && !pData->IsHeader())
{
aStr = pData->GetText();
GetReplaceEditString( aStr );
aStr = linguistic::GetThesaurusReplaceText( aStr );
}
aReplaceEdit.SetText( aStr );
}
......@@ -525,7 +496,7 @@ IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesDoubleClickHdl_Impl, SvxCheckLis
if (pData && !pData->IsHeader())
{
aStr = pData->GetText();
GetReplaceEditString( aStr );
aStr = linguistic::GetThesaurusReplaceText( aStr );
}
aWordCB.SetText( aStr );
......
......@@ -311,10 +311,8 @@ IMPL_LINK( WebConnectionInfoDialog, ChangePasswordHdl, PushButton*, EMPTYARG )
::rtl::OUString aURL = m_aPasswordsLB.GetEntryText( pEntry, 0 );
::rtl::OUString aUserName = m_aPasswordsLB.GetEntryText( pEntry, 1 );
::comphelper::DocPasswordRequest* pPasswordRequest
= new ::comphelper::DocPasswordRequest(
::comphelper::DocPasswordRequestType_STANDARD,
task::PasswordRequestMode_PASSWORD_CREATE, aURL );
::comphelper::SimplePasswordRequest* pPasswordRequest
= new ::comphelper::SimplePasswordRequest( task::PasswordRequestMode_PASSWORD_CREATE );
uno::Reference< task::XInteractionRequest > rRequest( pPasswordRequest );
uno::Reference< task::XInteractionHandler > xInteractionHandler(
......
......@@ -65,7 +65,7 @@ struct HDInfo {
HyphenDict * aPtr;
OUString aName;
Locale aLoc;
rtl_TextEncoding aEnc;
rtl_TextEncoding eEnc;
CharClass * apCC;
};
......@@ -83,12 +83,12 @@ class Hyphenator :
>
{
Sequence< Locale > aSuppLocales;
HDInfo * aDicts;
sal_Int32 numdict;
HDInfo * aDicts;
sal_Int32 numdict;
::cppu::OInterfaceContainerHelper aEvtListeners;
Reference< XPropertyChangeListener > xPropHelper;
Reference< XMultiServiceFactory > rSMgr;
Reference< XMultiServiceFactory > rSMgr;
linguistic::PropertyHelper_Hyphen * pPropHelper;
BOOL bDisposing;
......@@ -108,88 +108,38 @@ public:
virtual ~Hyphenator();
// XSupportedLocales (for XHyphenator)
virtual Sequence< Locale > SAL_CALL getLocales()
throw(RuntimeException);
virtual sal_Bool SAL_CALL hasLocale( const Locale& rLocale )
throw(RuntimeException);
virtual Sequence< Locale > SAL_CALL getLocales() throw(RuntimeException);
virtual sal_Bool SAL_CALL hasLocale( const Locale& rLocale ) throw(RuntimeException);
// XHyphenator
virtual ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenatedWord > SAL_CALL
hyphenate( const ::rtl::OUString& aWord,
const ::com::sun::star::lang::Locale& aLocale,
sal_Int16 nMaxLeading,
const ::com::sun::star::beans::PropertyValues& aProperties )
throw(::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenatedWord > SAL_CALL
queryAlternativeSpelling( const ::rtl::OUString& aWord,
const ::com::sun::star::lang::Locale& aLocale,
sal_Int16 nIndex,
const ::com::sun::star::beans::PropertyValues& aProperties )
throw(::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XPossibleHyphens > SAL_CALL
createPossibleHyphens( const ::rtl::OUString& aWord,
const ::com::sun::star::lang::Locale& aLocale,
const ::com::sun::star::beans::PropertyValues& aProperties )
throw(::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenatedWord > SAL_CALL hyphenate( const ::rtl::OUString& aWord, const ::com::sun::star::lang::Locale& aLocale, sal_Int16 nMaxLeading, const ::com::sun::star::beans::PropertyValues& aProperties ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenatedWord > SAL_CALL queryAlternativeSpelling( const ::rtl::OUString& aWord, const ::com::sun::star::lang::Locale& aLocale, sal_Int16 nIndex, const ::com::sun::star::beans::PropertyValues& aProperties ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XPossibleHyphens > SAL_CALL createPossibleHyphens( const ::rtl::OUString& aWord, const ::com::sun::star::lang::Locale& aLocale, const ::com::sun::star::beans::PropertyValues& aProperties ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
// XLinguServiceEventBroadcaster
virtual sal_Bool SAL_CALL
addLinguServiceEventListener(
const Reference< XLinguServiceEventListener >& rxLstnr )
throw(RuntimeException);
virtual sal_Bool SAL_CALL
removeLinguServiceEventListener(
const Reference< XLinguServiceEventListener >& rxLstnr )
throw(RuntimeException);
virtual sal_Bool SAL_CALL addLinguServiceEventListener( const Reference< XLinguServiceEventListener >& rxLstnr ) throw(RuntimeException);
virtual sal_Bool SAL_CALL removeLinguServiceEventListener( const Reference< XLinguServiceEventListener >& rxLstnr ) throw(RuntimeException);
// XServiceDisplayName
virtual OUString SAL_CALL
getServiceDisplayName( const Locale& rLocale )
throw(RuntimeException);
virtual OUString SAL_CALL getServiceDisplayName( const Locale& rLocale ) throw(RuntimeException);
// XInitialization
virtual void SAL_CALL
initialize( const Sequence< Any >& rArguments )
throw(Exception, RuntimeException);
virtual void SAL_CALL initialize( const Sequence< Any >& rArguments ) throw(Exception, RuntimeException);
// XComponent
virtual void SAL_CALL
dispose()
throw(RuntimeException);
virtual void SAL_CALL
addEventListener( const Reference< XEventListener >& rxListener )
throw(RuntimeException);
virtual void SAL_CALL
removeEventListener( const Reference< XEventListener >& rxListener )
throw(RuntimeException);
////////////////////////////////////////////////////////////
// Service specific part
//
virtual void SAL_CALL dispose() throw(RuntimeException);
virtual void SAL_CALL addEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException);
virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException);
// XServiceInfo
virtual OUString SAL_CALL
getImplementationName()
throw(RuntimeException);
virtual sal_Bool SAL_CALL
supportsService( const OUString& rServiceName )
throw(RuntimeException);
virtual Sequence< OUString > SAL_CALL
getSupportedServiceNames()
throw(RuntimeException);
static inline OUString
getImplementationName_Static() throw();
static Sequence< OUString >
getSupportedServiceNames_Static() throw();
virtual OUString SAL_CALL getImplementationName() throw(RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw(RuntimeException);
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(RuntimeException);
static inline OUString getImplementationName_Static() throw();
static Sequence< OUString > getSupportedServiceNames_Static() throw();
private:
sal_uInt16 SAL_CALL capitalType(const OUString&, CharClass *);
......
......@@ -50,6 +50,7 @@
#include <unotools/pathoptions.hxx>
#include <rtl/ustring.hxx>
#include <rtl/string.hxx>
#include <rtl/tencinfo.h>
#include <linguistic/misc.hxx>
#include <set>
......@@ -268,5 +269,25 @@ void MergeNewStyleDicsAndOldStyleDics(
}
}
rtl_TextEncoding getTextEncodingFromCharset(const sal_Char* pCharset)
{
// default result: used to indicate that we failed to get the proper encoding
rtl_TextEncoding eRet = RTL_TEXTENCODING_DONTKNOW;
if (pCharset)
{
eRet = rtl_getTextEncodingFromMimeCharset(pCharset);
if (eRet == RTL_TEXTENCODING_DONTKNOW)
eRet = rtl_getTextEncodingFromUnixCharset(pCharset);
if (eRet == RTL_TEXTENCODING_DONTKNOW)
{
if (strcmp("ISCII-DEVANAGARI", pCharset) == 0)
eRet = RTL_TEXTENCODING_ISCII_DEVANAGARI;
}
}
return eRet;
}
//////////////////////////////////////////////////////////////////////
......@@ -101,5 +101,13 @@ void MergeNewStyleDicsAndOldStyleDics( std::list< SvtLinguConfigDictionaryEntry
///////////////////////////////////////////////////////////////////////////
//Find an encoding from a charset string, using
//rtl_getTextEncodingFromMimeCharset and falling back to
//rtl_getTextEncodingFromUnixCharset with the addition of
//ISCII-DEVANAGARI. On failure will return final fallback of
//RTL_TEXTENCODING_ISO_8859_1
rtl_TextEncoding getTextEncodingFromCharset(const sal_Char* pCharset);
#endif
......@@ -75,14 +75,14 @@ class MacSpellChecker :
XServiceDisplayName
>
{
Sequence< Locale > aSuppLocales;
Sequence< Locale > aSuppLocales;
// Hunspell ** aDicts;
rtl_TextEncoding * aDEncs;
Locale * aDLocs;
OUString * aDNames;
sal_Int32 numdict;
NSSpellChecker * macSpell;
int macTag; //unique tag for this doc
rtl_TextEncoding * aDEncs;
Locale * aDLocs;
OUString * aDNames;
sal_Int32 numdict;
NSSpellChecker * macSpell;
int macTag; //unique tag for this doc
::cppu::OInterfaceContainerHelper aEvtListeners;
Reference< XPropertyChangeListener > xPropHelper;
......@@ -100,84 +100,43 @@ class MacSpellChecker :
}
INT16 GetSpellFailure( const OUString &rWord, const Locale &rLocale );
Reference< XSpellAlternatives >
GetProposals( const OUString &rWord, const Locale &rLocale );
Reference< XSpellAlternatives > GetProposals( const OUString &rWord, const Locale &rLocale );
public:
MacSpellChecker();
virtual ~MacSpellChecker();
// XSupportedLocales (for XSpellChecker)
virtual Sequence< Locale > SAL_CALL
getLocales()
throw(RuntimeException);
virtual sal_Bool SAL_CALL
hasLocale( const Locale& rLocale )
throw(RuntimeException);
virtual Sequence< Locale > SAL_CALL getLocales() throw(RuntimeException);
virtual sal_Bool SAL_CALL hasLocale( const Locale& rLocale ) throw(RuntimeException);
// XSpellChecker
virtual sal_Bool SAL_CALL
isValid( const OUString& rWord, const Locale& rLocale,
const PropertyValues& rProperties )
throw(IllegalArgumentException,
RuntimeException);
virtual Reference< XSpellAlternatives > SAL_CALL
spell( const OUString& rWord, const Locale& rLocale,
const PropertyValues& rProperties )
throw(IllegalArgumentException,
RuntimeException);
virtual sal_Bool SAL_CALL isValid( const OUString& rWord, const Locale& rLocale, const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException);
virtual Reference< XSpellAlternatives > SAL_CALL spell( const OUString& rWord, const Locale& rLocale, const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException);
// XLinguServiceEventBroadcaster
virtual sal_Bool SAL_CALL
addLinguServiceEventListener(
const Reference< XLinguServiceEventListener >& rxLstnr )
throw(RuntimeException);
virtual sal_Bool SAL_CALL
removeLinguServiceEventListener(
const Reference< XLinguServiceEventListener >& rxLstnr )
throw(RuntimeException);
virtual sal_Bool SAL_CALL addLinguServiceEventListener( const Reference< XLinguServiceEventListener >& rxLstnr ) throw(RuntimeException);
virtual sal_Bool SAL_CALL removeLinguServiceEventListener( const Reference< XLinguServiceEventListener >& rxLstnr ) throw(RuntimeException);
// XServiceDisplayName
virtual OUString SAL_CALL
getServiceDisplayName( const Locale& rLocale )
throw(RuntimeException);
virtual OUString SAL_CALL getServiceDisplayName( const Locale& rLocale ) throw(RuntimeException);
// XInitialization
virtual void SAL_CALL
initialize( const Sequence< Any >& rArguments )
throw(Exception, RuntimeException);
virtual void SAL_CALL initialize( const Sequence< Any >& rArguments ) throw(Exception, RuntimeException);
// XComponent
virtual void SAL_CALL
dispose()
throw(RuntimeException);
virtual void SAL_CALL
addEventListener( const Reference< XEventListener >& rxListener )
throw(RuntimeException);
virtual void SAL_CALL
removeEventListener( const Reference< XEventListener >& rxListener )
throw(RuntimeException);
////////////////////////////////////////////////////////////
// Service specific part
//
virtual void SAL_CALL dispose() throw(RuntimeException);
virtual void SAL_CALL addEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException);
virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException);
// XServiceInfo
virtual OUString SAL_CALL
getImplementationName()
throw(RuntimeException);
virtual sal_Bool SAL_CALL
supportsService( const OUString& rServiceName )
throw(RuntimeException);
virtual Sequence< OUString > SAL_CALL
getSupportedServiceNames()
throw(RuntimeException);
static inline OUString
getImplementationName_Static() throw();
static Sequence< OUString >
getSupportedServiceNames_Static() throw();
virtual OUString SAL_CALL getImplementationName() throw(RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw(RuntimeException);
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(RuntimeException);
static inline OUString getImplementationName_Static() throw();
static Sequence< OUString > getSupportedServiceNames_Static() throw();
};
inline OUString MacSpellChecker::getImplementationName_Static() throw()
......
This diff is collapsed.
......@@ -69,11 +69,11 @@ class SpellChecker :
>
{
Sequence< Locale > aSuppLocales;
Hunspell ** aDicts;
rtl_TextEncoding * aDEncs;
Locale * aDLocs;
OUString * aDNames;
sal_Int32 numdict;
Hunspell ** aDicts;
rtl_TextEncoding * aDEncs;
Locale * aDLocs;
OUString * aDNames;
sal_Int32 numdict;
::cppu::OInterfaceContainerHelper aEvtListeners;
Reference< XPropertyChangeListener > xPropHelper;
......@@ -91,84 +91,43 @@ class SpellChecker :
}
INT16 GetSpellFailure( const OUString &rWord, const Locale &rLocale );
Reference< XSpellAlternatives >
GetProposals( const OUString &rWord, const Locale &rLocale );
Reference< XSpellAlternatives > GetProposals( const OUString &rWord, const Locale &rLocale );
public:
SpellChecker();
virtual ~SpellChecker();
// XSupportedLocales (for XSpellChecker)
virtual Sequence< Locale > SAL_CALL
getLocales()
throw(RuntimeException);
virtual sal_Bool SAL_CALL
hasLocale( const Locale& rLocale )
throw(RuntimeException);
virtual Sequence< Locale > SAL_CALL getLocales() throw(RuntimeException);
virtual sal_Bool SAL_CALL hasLocale( const Locale& rLocale ) throw(RuntimeException);
// XSpellChecker
virtual sal_Bool SAL_CALL
isValid( const OUString& rWord, const Locale& rLocale,
const PropertyValues& rProperties )
throw(IllegalArgumentException,
RuntimeException);
virtual Reference< XSpellAlternatives > SAL_CALL
spell( const OUString& rWord, const Locale& rLocale,
const PropertyValues& rProperties )
throw(IllegalArgumentException,
RuntimeException);
virtual sal_Bool SAL_CALL isValid( const OUString& rWord, const Locale& rLocale, const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException);
virtual Reference< XSpellAlternatives > SAL_CALL spell( const OUString& rWord, const Locale& rLocale, const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException);
// XLinguServiceEventBroadcaster
virtual sal_Bool SAL_CALL
addLinguServiceEventListener(
const Reference< XLinguServiceEventListener >& rxLstnr )
throw(RuntimeException);
virtual sal_Bool SAL_CALL
removeLinguServiceEventListener(
const Reference< XLinguServiceEventListener >& rxLstnr )
throw(RuntimeException);
virtual sal_Bool SAL_CALL addLinguServiceEventListener( const Reference< XLinguServiceEventListener >& rxLstnr ) throw(RuntimeException);
virtual sal_Bool SAL_CALL removeLinguServiceEventListener( const Reference< XLinguServiceEventListener >& rxLstnr ) throw(RuntimeException);
// XServiceDisplayName
virtual OUString SAL_CALL
getServiceDisplayName( const Locale& rLocale )
throw(RuntimeException);
virtual OUString SAL_CALL getServiceDisplayName( const Locale& rLocale ) throw(RuntimeException);
// XInitialization
virtual void SAL_CALL
initialize( const Sequence< Any >& rArguments )
throw(Exception, RuntimeException);
virtual void SAL_CALL initialize( const Sequence< Any >& rArguments ) throw(Exception, RuntimeException);
// XComponent
virtual void SAL_CALL
dispose()
throw(RuntimeException);
virtual void SAL_CALL
addEventListener( const Reference< XEventListener >& rxListener )
throw(RuntimeException);
virtual void SAL_CALL
removeEventListener( const Reference< XEventListener >& rxListener )
throw(RuntimeException);
////////////////////////////////////////////////////////////
// Service specific part
//
virtual void SAL_CALL dispose() throw(RuntimeException);
virtual void SAL_CALL addEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException);
virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException);
// XServiceInfo
virtual OUString SAL_CALL
getImplementationName()
throw(RuntimeException);
virtual sal_Bool SAL_CALL
supportsService( const OUString& rServiceName )
throw(RuntimeException);
virtual Sequence< OUString > SAL_CALL
getSupportedServiceNames()
throw(RuntimeException);
static inline OUString
getImplementationName_Static() throw();
static Sequence< OUString >
getSupportedServiceNames_Static() throw();
virtual OUString SAL_CALL getImplementationName() throw(RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw(RuntimeException);
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(RuntimeException);
static inline OUString getImplementationName_Static() throw();
static Sequence< OUString > getSupportedServiceNames_Static() throw();
};
inline OUString SpellChecker::getImplementationName_Static() throw()
......@@ -177,7 +136,6 @@ inline OUString SpellChecker::getImplementationName_Static() throw()
}
///////////////////////////////////////////////////////////////////////////
#endif
......
......@@ -48,11 +48,11 @@ class Meaning :
{
::com::sun::star::uno::Sequence< ::rtl::OUString > aSyn; // list of synonyms, may be empty.
::rtl::OUString aTerm;
INT16 nLanguage;
INT16 nLanguage;
#if 0
// this is for future use by a German thesaurus
BOOL bIsGermanPreReform;
BOOL bIsGermanPreReform;
#endif
// disallow copy-constructor and assignment-operator for now
......@@ -68,22 +68,12 @@ public:
virtual ~Meaning();
// XMeaning
virtual ::rtl::OUString SAL_CALL
getMeaning()
throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
querySynonyms()
throw(::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getMeaning() throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL querySynonyms() throw(::com::sun::star::uno::RuntimeException);
// non-interface specific functions
void SetSynonyms(
const ::com::sun::star::uno::Sequence< ::rtl::OUString >
&rSyn );
void SetMeaning(const ::rtl::OUString &rTerm );
void SetSynonyms( const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rSyn );
void SetMeaning( const ::rtl::OUString &rTerm );
};
......
This diff is collapsed.
......@@ -116,55 +116,27 @@ public:
virtual ~Thesaurus();
// XSupportedLocales (for XThesaurus)
virtual Sequence< Locale > SAL_CALL
getLocales()
throw(RuntimeException);
virtual sal_Bool SAL_CALL
hasLocale( const Locale& rLocale )
throw(RuntimeException);
virtual Sequence< Locale > SAL_CALL getLocales() throw(RuntimeException);
virtual sal_Bool SAL_CALL hasLocale( const Locale& rLocale ) throw(RuntimeException);
// XThesaurus
virtual Sequence< Reference < ::com::sun::star::linguistic2::XMeaning > > SAL_CALL
queryMeanings( const OUString& rTerm, const Locale& rLocale,
const PropertyValues& rProperties )
throw(IllegalArgumentException,
RuntimeException);
virtual Sequence< Reference < ::com::sun::star::linguistic2::XMeaning > > SAL_CALL queryMeanings( const OUString& rTerm, const Locale& rLocale, const PropertyValues& rProperties ) throw(IllegalArgumentException, RuntimeException);
// XServiceDisplayName
virtual OUString SAL_CALL
getServiceDisplayName( const Locale& rLocale )
throw(RuntimeException);
virtual OUString SAL_CALL getServiceDisplayName( const Locale& rLocale ) throw(RuntimeException);
// XInitialization
virtual void SAL_CALL
initialize( const Sequence< Any >& rArguments )
throw(Exception, RuntimeException);
virtual void SAL_CALL initialize( const Sequence< Any >& rArguments ) throw(Exception, RuntimeException);
// XComponent
virtual void SAL_CALL
dispose()
throw(RuntimeException);
virtual void SAL_CALL
addEventListener( const Reference< XEventListener >& rxListener )
throw(RuntimeException);
virtual void SAL_CALL
removeEventListener( const Reference< XEventListener >& rxListener )
throw(RuntimeException);
////////////////////////////////////////////////////////////
// Service specific part
//
virtual void SAL_CALL dispose() throw(RuntimeException);
virtual void SAL_CALL addEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException);
virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException);
// XServiceInfo
virtual OUString SAL_CALL
getImplementationName()
throw(RuntimeException);
virtual sal_Bool SAL_CALL
supportsService( const OUString& rServiceName )
throw(RuntimeException);
virtual Sequence< OUString > SAL_CALL
getSupportedServiceNames()
throw(RuntimeException);
virtual OUString SAL_CALL getImplementationName() throw(RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw(RuntimeException);
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(RuntimeException);
static inline OUString
......@@ -183,8 +155,7 @@ private:
static ::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
*/
static ::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XLinguServiceManager > GetLngSvcMgr();
static ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLinguServiceManager > GetLngSvcMgr();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment