Kaydet (Commit) ddcf2363 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 43d9f35c
......@@ -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" );
}
}
......
......@@ -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 {
......
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