summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-13 10:43:34 +0200
committerNoel Grandin <noel@peralex.com>2013-05-14 08:08:25 +0200
commitef0af5032ad283ffb3b4521eb097a118d58f332a (patch)
tree823553af06bf42a914d38e19beb3e3fc25f3bc52 /editeng
parentbd27671c0ccc3505efb9fc493e0cfc63df449856 (diff)
fdo#46808, Convert linguistic2::LingProperties to new style
API-CHANGE: Removed the following interfaces from the IDL because no-one was using them: interface com::sun::star::beans::XFastPropertySet; interface com::sun::star::lang::XComponent; But the service still implements them, so old code should keep on working. Change-Id: Iab058fb42bd1a54e0b9632e99e564fdc0869fe6e
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/edtspell.cxx1
-rw-r--r--editeng/source/misc/splwrap.cxx19
-rw-r--r--editeng/source/misc/unolingu.cxx13
3 files changed, 11 insertions, 22 deletions
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index 5e9503e79813..3e1a3c9675f2 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -136,7 +136,6 @@ sal_Bool EditSpellWrapper::SpellMore()
{
// The text has been entered into the engine, when backwords then
// it must be behind the selection.
- Reference< XPropertySet > xProp( SvxGetLinguPropertySet() );
pEditView->GetImpEditView()->SetEditSelection(
pEE->GetEditDoc().GetStartPaM() );
}
diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx
index 6b810985e264..318998405c70 100644
--- a/editeng/source/misc/splwrap.cxx
+++ b/editeng/source/misc/splwrap.cxx
@@ -160,11 +160,8 @@ SvxSpellWrapper::SvxSpellWrapper( Window* pWn,
bRevAllowed ( bRevAllow ),
bAllRight ( bIsAllRight )
{
- Reference< beans::XPropertySet > xProp( SvxGetLinguPropertySet() );
- sal_Bool bWrapReverse = xProp.is() ?
- *(sal_Bool*)xProp->getPropertyValue(
- OUString(UPN_IS_WRAP_REVERSE) ).getValue()
- : sal_False;
+ Reference< linguistic2::XLinguProperties > xProp( SvxGetLinguPropertySet() );
+ sal_Bool bWrapReverse = xProp.is() ? xProp->getIsWrapReverse() : sal_False;
bReverse = bRevAllow && bWrapReverse;
bStartDone = bOther || ( !bReverse && bStart );
bEndDone = bReverse && bStart && !bOther;
@@ -399,11 +396,8 @@ void SvxSpellWrapper::SpellDocument( )
sal_Bool SvxSpellWrapper::SpellNext( )
{
- Reference< beans::XPropertySet > xProp( SvxGetLinguPropertySet() );
- sal_Bool bWrapReverse = xProp.is() ?
- *(sal_Bool*)xProp->getPropertyValue(
- OUString(UPN_IS_WRAP_REVERSE) ).getValue()
- : sal_False;
+ Reference< linguistic2::XLinguProperties > xProp( SvxGetLinguPropertySet() );
+ sal_Bool bWrapReverse = xProp.is() ? xProp->getIsWrapReverse() : sal_False;
sal_Bool bActRev = bRevAllowed && bWrapReverse;
// bActRev is the direction after Spell checking, bReverse is the one
@@ -447,10 +441,7 @@ sal_Bool SvxSpellWrapper::SpellNext( )
}
else if ( bStartDone && bEndDone )
{
- sal_Bool bIsSpellSpecial = xProp.is() ?
- *(sal_Bool*)xProp->getPropertyValue(
- OUString(UPN_IS_SPELL_SPECIAL) ).getValue()
- : sal_False;
+ sal_Bool bIsSpellSpecial = xProp.is() ? xProp->getIsSpellSpecial() : sal_False;
// Body area done, ask for special area
if( !IsHyphen() && bIsSpellSpecial && HasOtherCnt() )
{
diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx
index 4a0c2490c2bd..d4a72d68609f 100644
--- a/editeng/source/misc/unolingu.cxx
+++ b/editeng/source/misc/unolingu.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/linguistic2/DictionaryList.hpp>
#include <com/sun/star/linguistic2/XAvailableLocales.hpp>
#include <com/sun/star/linguistic2/LinguServiceManager.hpp>
+#include <com/sun/star/linguistic2/LinguProperties.hpp>
#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/ucb/XSortedDynamicResultSetFactory.hpp>
@@ -517,7 +518,7 @@ uno::Reference< XSpellChecker1 > LinguMgr::xSpell = 0;
uno::Reference< XHyphenator > LinguMgr::xHyph = 0;
uno::Reference< XThesaurus > LinguMgr::xThes = 0;
uno::Reference< XSearchableDictionaryList > LinguMgr::xDicList = 0;
-uno::Reference< XPropertySet > LinguMgr::xProp = 0;
+uno::Reference< XLinguProperties > LinguMgr::xProp = 0;
uno::Reference< XDictionary > LinguMgr::xIgnoreAll = 0;
uno::Reference< XDictionary > LinguMgr::xChangeAll = 0;
@@ -557,7 +558,7 @@ uno::Reference< XSearchableDictionaryList > LinguMgr::GetDictionaryList()
return xDicList.is() ? xDicList : GetDicList();
}
-uno::Reference< XPropertySet > LinguMgr::GetLinguPropertySet()
+uno::Reference< linguistic2::XLinguProperties > LinguMgr::GetLinguPropertySet()
{
return xProp.is() ? xProp : GetProp();
}
@@ -634,7 +635,7 @@ uno::Reference< XSearchableDictionaryList > LinguMgr::GetDicList()
return xDicList;
}
-uno::Reference< XPropertySet > LinguMgr::GetProp()
+uno::Reference< linguistic2::XLinguProperties > LinguMgr::GetProp()
{
if (bExiting)
return 0;
@@ -642,9 +643,7 @@ uno::Reference< XPropertySet > LinguMgr::GetProp()
if (!pExitLstnr)
pExitLstnr = new LinguMgrExitLstnr;
- uno::Reference< XMultiServiceFactory > xMgr( getProcessServiceFactory() );
- xProp = uno::Reference< XPropertySet > ( xMgr->createInstance(
- "com.sun.star.linguistic2.LinguProperties" ), UNO_QUERY );
+ xProp = linguistic2::LinguProperties::create( getProcessComponentContext() );
return xProp;
}
@@ -756,7 +755,7 @@ uno::Reference< XSearchableDictionaryList > SvxGetDictionaryList()
return LinguMgr::GetDictionaryList();
}
-uno::Reference< XPropertySet > SvxGetLinguPropertySet()
+uno::Reference< XLinguProperties > SvxGetLinguPropertySet()
{
return LinguMgr::GetLinguPropertySet();
}