summaryrefslogtreecommitdiff
path: root/cui/source/options/treeopt.cxx
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 /cui/source/options/treeopt.cxx
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 'cui/source/options/treeopt.cxx')
-rw-r--r--cui/source/options/treeopt.cxx25
1 files changed, 6 insertions, 19 deletions
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 8f5c20f3d5d4..78e127b2b383 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -58,6 +58,7 @@
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/loader/CannotActivateFactoryException.hpp>
+#include <com/sun/star/linguistic2/LinguProperties.hpp>
#include <com/sun/star/util/theMacroExpander.hpp>
#include <comphelper/processfactory.hxx>
#include <editeng/langitem.hxx>
@@ -1436,23 +1437,14 @@ void OfaTreeOptionsDialog::ApplyLanguageOptions(const SfxItemSet& rSet)
{
bSaveSpellCheck = ( (const SfxBoolItem*)pItem )->GetValue();
}
- Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
- Reference< XPropertySet > xProp(
- xMgr->createInstance( OUString( "com.sun.star.linguistic2.LinguProperties" ) ),
- UNO_QUERY );
+ Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+ Reference< XLinguProperties > xProp = LinguProperties::create( xContext );
if ( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_HYPHENREGION, sal_False, &pItem ) )
{
const SfxHyphenRegionItem* pHyphenItem = (const SfxHyphenRegionItem*)pItem;
- if (xProp.is())
- {
- xProp->setPropertyValue(
- OUString(UPN_HYPH_MIN_LEADING),
- makeAny((sal_Int16) pHyphenItem->GetMinLead()) );
- xProp->setPropertyValue(
- OUString(UPN_HYPH_MIN_TRAILING),
- makeAny((sal_Int16) pHyphenItem->GetMinTrail()) );
- }
+ xProp->setHyphMinLeading( (sal_Int16) pHyphenItem->GetMinLead() );
+ xProp->setHyphMinTrailing( (sal_Int16) pHyphenItem->GetMinTrail() );
bSaveSpellCheck = sal_True;
}
@@ -1483,12 +1475,7 @@ void OfaTreeOptionsDialog::ApplyLanguageOptions(const SfxItemSet& rSet)
pDispatch->Execute(SID_AUTOSPELL_CHECK,
SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD, pItem, 0L);
- if (xProp.is())
- {
- xProp->setPropertyValue(
- OUString(UPN_IS_SPELL_AUTO),
- makeAny(bOnlineSpelling) );
- }
+ xProp->setIsSpellAuto( bOnlineSpelling );
}
if( bSaveSpellCheck )