summaryrefslogtreecommitdiff
path: root/sw/source/uibase/app/swmodule.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/app/swmodule.cxx')
-rw-r--r--sw/source/uibase/app/swmodule.cxx53
1 files changed, 31 insertions, 22 deletions
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index 485bb7a52d41..e8bb17f37f79 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -19,7 +19,6 @@
#include <config_features.h>
-#include <hintids.hxx>
#include <svtools/ehdl.hxx>
#include <svtools/accessibilityoptions.hxx>
#include <unotools/resmgr.hxx>
@@ -82,6 +81,7 @@
#include <svx/zoomsliderctrl.hxx>
#include <zoomctrl.hxx>
#include <wordcountctrl.hxx>
+#include <AccessibilityStatusBarControl.hxx>
#include <workctrl.hxx>
#include <fldwrap.hxx>
#include <redlndlg.hxx>
@@ -98,7 +98,7 @@
#include <svx/rubydialog.hxx>
#include <svtools/colorcfg.hxx>
-#include <unotools/configmgr.hxx>
+#include <comphelper/configuration.hxx>
#include <unotools/moduleoptions.hxx>
#include <avmedia/mediaplayer.hxx>
@@ -128,7 +128,7 @@ using namespace ::com::sun::star::uno;
SwModule::SwModule( SfxObjectFactory* pWebFact,
SfxObjectFactory* pFact,
SfxObjectFactory* pGlobalFact )
- : SfxModule("sw", {pWebFact, pFact, pGlobalFact}),
+ : SfxModule("sw"_ostr, {pWebFact, pFact, pGlobalFact}),
m_pView(nullptr),
m_bAuthorInitialised(false),
m_bEmbeddedLoadSave( false ),
@@ -150,9 +150,12 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
m_pStdFontConfig.reset(new SwStdFontConfig);
- StartListening( *SfxGetpApp() );
+ {
+ SolarMutexGuard g;
+ StartListening( *SfxGetpApp() );
+ }
- if (!utl::ConfigManager::IsFuzzing())
+ if (!comphelper::IsFuzzing())
{
// init color configuration
// member <pColorConfig> is created and the color configuration is applied
@@ -162,22 +165,27 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
}
}
-OUString SwResId(const char* pId)
+OUString SwResId(TranslateId aId)
{
- return Translate::get(pId, SW_MOD()->GetResLocale());
+ return Translate::get(aId, SW_MOD()->GetResLocale());
}
-OUString SwResId(const char* pId, int nCardinality)
+OUString SwResId(TranslateNId aContextSingularPlural, int nCardinality)
{
- return Translate::nget(pId, nCardinality, SW_MOD()->GetResLocale());
+ return Translate::nget(aContextSingularPlural, nCardinality, SW_MOD()->GetResLocale());
}
uno::Reference< scanner::XScannerManager2 > const &
SwModule::GetScannerManager()
{
- if (!m_xScannerManager.is())
+ static bool bTestScannerManager = true;
+ if (bTestScannerManager && !m_xScannerManager.is())
{
- m_xScannerManager = scanner::ScannerManager::create( comphelper::getProcessComponentContext() );
+ try {
+ m_xScannerManager = scanner::ScannerManager::create( comphelper::getProcessComponentContext() );
+ }
+ catch (...) {}
+ bTestScannerManager = false;
}
return m_xScannerManager;
}
@@ -203,13 +211,13 @@ void SwDLL::RegisterFactories()
{
// These Id's must not be changed. Through these Id's the View (resume Documentview)
// is created by Sfx.
- if (utl::ConfigManager::IsFuzzing() || SvtModuleOptions().IsWriter())
+ if (comphelper::IsFuzzing() || SvtModuleOptions().IsWriter())
SwView::RegisterFactory ( SFX_INTERFACE_SFXDOCSH );
#if HAVE_FEATURE_DESKTOP
SwWebView::RegisterFactory ( SFX_INTERFACE_SFXMODULE );
- if (utl::ConfigManager::IsFuzzing() || SvtModuleOptions().IsWriter())
+ if (comphelper::IsFuzzing() || SvtModuleOptions().IsWriter())
{
SwSrcView::RegisterFactory ( SfxInterfaceId(6) );
SwPagePreview::RegisterFactory ( SfxInterfaceId(7) );
@@ -280,6 +288,7 @@ void SwDLL::RegisterControls()
SvxSelectionModeControl::RegisterControl(FN_STAT_SELMODE, pMod );
XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pMod );
SwWordCountStatusBarControl::RegisterControl(FN_STAT_WORDCOUNT, pMod);
+ sw::AccessibilityStatusBarControl::RegisterControl(FN_STAT_ACCESSIBILITY_CHECK, pMod);
SwBookmarkControl::RegisterControl(FN_STAT_PAGE, pMod );
SwTemplateControl::RegisterControl(FN_STAT_TEMPLATE, pMod );
@@ -341,41 +350,41 @@ void SwModule::RemoveAttrPool()
m_pAttrPool.clear();
}
-std::unique_ptr<SfxStyleFamilies> SwModule::CreateStyleFamilies()
+std::optional<SfxStyleFamilies> SwModule::CreateStyleFamilies()
{
- std::unique_ptr<SfxStyleFamilies> pStyleFamilies(new SfxStyleFamilies);
+ SfxStyleFamilies aStyleFamilies;
- pStyleFamilies->emplace_back(SfxStyleFamily::Para,
+ aStyleFamilies.emplace_back(SfxStyleFamily::Para,
SwResId(STR_PARAGRAPHSTYLEFAMILY),
BMP_STYLES_FAMILY_PARA,
RID_PARAGRAPHSTYLEFAMILY, GetResLocale());
- pStyleFamilies->emplace_back(SfxStyleFamily::Char,
+ aStyleFamilies.emplace_back(SfxStyleFamily::Char,
SwResId(STR_CHARACTERSTYLEFAMILY),
BMP_STYLES_FAMILY_CHAR,
RID_CHARACTERSTYLEFAMILY, GetResLocale());
- pStyleFamilies->emplace_back(SfxStyleFamily::Frame,
+ aStyleFamilies.emplace_back(SfxStyleFamily::Frame,
SwResId(STR_FRAMESTYLEFAMILY),
BMP_STYLES_FAMILY_FRAME,
RID_FRAMESTYLEFAMILY, GetResLocale());
- pStyleFamilies->emplace_back(SfxStyleFamily::Page,
+ aStyleFamilies.emplace_back(SfxStyleFamily::Page,
SwResId(STR_PAGESTYLEFAMILY),
BMP_STYLES_FAMILY_PAGE,
RID_PAGESTYLEFAMILY, GetResLocale());
- pStyleFamilies->emplace_back(SfxStyleFamily::Pseudo,
+ aStyleFamilies.emplace_back(SfxStyleFamily::Pseudo,
SwResId(STR_LISTSTYLEFAMILY),
BMP_STYLES_FAMILY_LIST,
RID_LISTSTYLEFAMILY, GetResLocale());
- pStyleFamilies->emplace_back(SfxStyleFamily::Table,
+ aStyleFamilies.emplace_back(SfxStyleFamily::Table,
SwResId(STR_TABLESTYLEFAMILY),
BMP_STYLES_FAMILY_TABLE,
RID_TABLESTYLEFAMILY, GetResLocale());
- return pStyleFamilies;
+ return aStyleFamilies;
}
void SwModule::RegisterAutomationApplicationEventsCaller(css::uno::Reference< ooo::vba::XSinkCaller > const& xCaller)