summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-10-30 11:40:18 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-10-30 11:40:18 +0100
commitddcf2363bad1d84874dfe4e31e4783ffd761d5bb (patch)
treed4d70251223a43eaa91fd80760f7d95b35d43c29
parent43d9f35c2665e55cfb5ee911a554ef71933ad4d1 (diff)
fdo#46808: Improve previous commit
* Removing m_xLngMgr.is() check from SfxThesSubMenuHelper::GetThesImplName was unsound with SfxThesSubMenuHelper ctor swallowing Exception; best fix appears to be to remove the swallowing. * Prefer forward declarations over #includes. Change-Id: Ie4e7dcd6cdb14046516d119605bbf78e81359768
-rw-r--r--sfx2/source/menu/thessubmenu.cxx16
-rw-r--r--sw/inc/dlelstnr.hxx2
2 files changed, 6 insertions, 12 deletions
diff --git a/sfx2/source/menu/thessubmenu.cxx b/sfx2/source/menu/thessubmenu.cxx
index 1a645885adb1..f4c5f474efce 100644
--- a/sfx2/source/menu/thessubmenu.cxx
+++ b/sfx2/source/menu/thessubmenu.cxx
@@ -64,18 +64,12 @@ void SfxThesSubMenuHelper::GetLocale(
}
-SfxThesSubMenuHelper::SfxThesSubMenuHelper()
+SfxThesSubMenuHelper::SfxThesSubMenuHelper():
+ m_xLngMgr(
+ linguistic2::LinguServiceManager::create(
+ comphelper::getProcessComponentContext())),
+ m_xThesarus(m_xLngMgr->getThesaurus())
{
- try
- {
- uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
- m_xLngMgr = linguistic2::LinguServiceManager::create(xContext);
- m_xThesarus = m_xLngMgr->getThesaurus();
- }
- catch (const uno::Exception &)
- {
- DBG_ASSERT( 0, "failed to get thesaurus" );
- }
}
diff --git a/sw/inc/dlelstnr.hxx b/sw/inc/dlelstnr.hxx
index 918ebf71f324..88ee1ccaaba8 100644
--- a/sw/inc/dlelstnr.hxx
+++ b/sw/inc/dlelstnr.hxx
@@ -23,7 +23,6 @@
#include <cppuhelper/weak.hxx>
#include <com/sun/star/linguistic2/XDictionaryListEventListener.hpp>
#include <com/sun/star/linguistic2/XLinguServiceEventListener.hpp>
-#include <com/sun/star/linguistic2/XLinguServiceManager2.hpp>
#include <com/sun/star/frame/XTerminateListener.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <cppuhelper/implbase2.hxx> // helper for implementations
@@ -32,6 +31,7 @@
namespace com { namespace sun { namespace star {
namespace linguistic2 {
class XDictionaryList;
+ class XLinguServiceManager2;
class XProofreadingIterator;
}
namespace frame {