Use specific SvtModuleOptions::Is*Installed for clarity

Change-Id: Ibe64b9fcccf33471d96bb0fb1aa896cb456657f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177069
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski
2024-11-23 09:45:38 +01:00
parent e777bda239
commit fec1501374
42 changed files with 143 additions and 189 deletions
+1 -1
View File
@@ -238,7 +238,7 @@ OUString ChooseMacro(weld::Window* pParent,
SbMethod* pMethod = nullptr;
MacroChooser aChooser(pParent, xDocFrame);
if ( bChooseOnly || !SvtModuleOptions::IsBasicIDE() )
if (bChooseOnly || !SvtModuleOptions::IsBasicIDEInstalled())
aChooser.SetMode(MacroChooser::ChooseOnly);
if ( !bChooseOnly && rxLimitToDocument.is() )
+1 -1
View File
@@ -375,7 +375,7 @@ tools::Long HandleBasicError( StarBASIC const * pBasic )
tools::Long nRet = 0;
Shell* pShell = nullptr;
if ( SvtModuleOptions::IsBasicIDE() )
if (SvtModuleOptions::IsBasicIDEInstalled())
{
BasicManager* pBasMgr = FindBasicManager( pBasic );
if ( pBasMgr )
+1 -2
View File
@@ -51,8 +51,7 @@ SvxHyperlinkMailTp::SvxHyperlinkMailTp(weld::Container* pParent, SvxHpLinkDlg* p
m_xBtAdrBook->connect_clicked( LINK ( this, SvxHyperlinkMailTp, ClickAdrBookHdl_Impl ) );
m_xCbbReceiver->connect_changed( LINK ( this, SvxHyperlinkMailTp, ModifiedReceiverHdl_Impl) );
if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) ||
comphelper::LibreOfficeKit::isActive() )
if (!SvtModuleOptions().IsDataBaseInstalled() || comphelper::LibreOfficeKit::isActive())
m_xBtAdrBook->hide();
}
+5 -5
View File
@@ -676,15 +676,15 @@ bool ColorConfigWindow_Impl::IsGroupVisible (Group eGroup) const
{
case Group_Writer:
case Group_Html:
return aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::WRITER);
return aModuleOptions.IsWriterInstalled();
case Group_Calc:
return aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::CALC);
return aModuleOptions.IsCalcInstalled();
case Group_Draw:
return
aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::DRAW) ||
aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::IMPRESS);
aModuleOptions.IsDrawInstalled() ||
aModuleOptions.IsImpressInstalled();
case Group_Sql:
return aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::DATABASE);
return aModuleOptions.IsDataBaseInstalled();
default:
return true;
}
+5 -5
View File
@@ -331,16 +331,16 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* )
SvtModuleOptions aModuleOpt;
// int the same sequence as the enums of MSFltrPg2_CheckBoxEntries
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::MATH ) )
if (aModuleOpt.IsMathInstalled())
InsertEntry( sChgToFromMath, MSFltrPg2_CheckBoxEntries::Math );
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
if (aModuleOpt.IsWriterInstalled())
InsertEntry( sChgToFromWriter, MSFltrPg2_CheckBoxEntries::Writer );
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
if (aModuleOpt.IsCalcInstalled())
InsertEntry( sChgToFromCalc, MSFltrPg2_CheckBoxEntries::Calc );
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
if (aModuleOpt.IsImpressInstalled())
InsertEntry( sChgToFromImpress, MSFltrPg2_CheckBoxEntries::Impress );
InsertEntry( sChgToFromSmartArt, MSFltrPg2_CheckBoxEntries::SmartArt, false );
if (aModuleOpt.IsModuleInstalled(SvtModuleOptions::EModule::DRAW))
if (aModuleOpt.IsDrawInstalled())
{
InsertEntry(sChgToFromVisio, MSFltrPg2_CheckBoxEntries::Visio, false);
InsertEntry(sChgToFromPDF, MSFltrPg2_CheckBoxEntries::PDF, false);
+1 -1
View File
@@ -247,7 +247,7 @@ void SvxPathTabPage::Reset( const SfxItemSet* )
{
// only writer uses autotext
if ( static_cast<SvtPathOptions::Paths>(i) == SvtPathOptions::Paths::AutoText
&& !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
&& !SvtModuleOptions().IsWriterInstalled())
continue;
TranslateId pId;
+5 -5
View File
@@ -140,7 +140,7 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, weld::DialogController* p
m_xBackupCB->connect_toggled(LINK(this, SvxSaveTabPage, BackupClickHdl_Impl));
SvtModuleOptions aModuleOpt;
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::MATH ) )
if (!aModuleOpt.IsMathInstalled())
{
m_xSaveAsLB->remove_id(OUString::number(APP_MATH));
m_xDocTypeLB->remove_id(OUString::number(APP_MATH));
@@ -151,7 +151,7 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, weld::DialogController* p
pImpl->aDefaultReadonlyArr[APP_MATH] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::EFactory::MATH);
}
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
if (!aModuleOpt.IsDrawInstalled())
{
m_xSaveAsLB->remove_id(OUString::number(APP_DRAW));
m_xDocTypeLB->remove_id(OUString::number(APP_DRAW));
@@ -162,7 +162,7 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, weld::DialogController* p
pImpl->aDefaultReadonlyArr[APP_DRAW] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::EFactory::DRAW);
}
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
if (!aModuleOpt.IsImpressInstalled())
{
m_xSaveAsLB->remove_id(OUString::number(APP_IMPRESS));
m_xDocTypeLB->remove_id(OUString::number(APP_IMPRESS));
@@ -173,7 +173,7 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, weld::DialogController* p
pImpl->aDefaultReadonlyArr[APP_IMPRESS] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::EFactory::IMPRESS);
}
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
if (!aModuleOpt.IsCalcInstalled())
{
m_xSaveAsLB->remove_id(OUString::number(APP_CALC));
m_xDocTypeLB->remove_id(OUString::number(APP_CALC));
@@ -184,7 +184,7 @@ SvxSaveTabPage::SvxSaveTabPage(weld::Container* pPage, weld::DialogController* p
pImpl->aDefaultReadonlyArr[APP_CALC] = aModuleOpt.IsDefaultFilterReadonly(SvtModuleOptions::EFactory::CALC);
}
if ( !aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
if (!aModuleOpt.IsWriterInstalled())
{
m_xSaveAsLB->remove_id(OUString::number(APP_WRITER));
m_xSaveAsLB->remove_id(OUString::number(APP_WRITER_WEB));
+9 -9
View File
@@ -1806,7 +1806,7 @@ void OfaTreeOptionsDialog::languageOptions(const std::vector<sal_uInt16>& vPageI
void OfaTreeOptionsDialog::writerOptions(const std::vector<sal_uInt16>& vPageId)
{
if (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::WRITER))
if (SvtModuleOptions().IsWriterInstalled())
{
// text document
OUString aFactory = getCurrentFactory_Impl(m_xFrame);
@@ -1861,7 +1861,7 @@ void OfaTreeOptionsDialog::writerOptions(const std::vector<sal_uInt16>& vPageId)
void OfaTreeOptionsDialog::writerWebOptions(const std::vector<sal_uInt16>& vPageId)
{
if (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::WRITER))
if (SvtModuleOptions().IsWriterInstalled())
{
// text document
OUString aFactory = getCurrentFactory_Impl(m_xFrame);
@@ -1910,7 +1910,7 @@ void OfaTreeOptionsDialog::writerWebOptions(const std::vector<sal_uInt16>& vPage
void OfaTreeOptionsDialog::calcOptions(const std::vector<sal_uInt16>& vPageId)
{
// Calc options
if (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::CALC))
if (SvtModuleOptions().IsCalcInstalled())
{
OUString aFactory = getCurrentFactory_Impl(m_xFrame);
DBG_ASSERT(GetModuleIdentifier(m_xFrame) == aFactory, "This should not happen");
@@ -1944,7 +1944,7 @@ void OfaTreeOptionsDialog::calcOptions(const std::vector<sal_uInt16>& vPageId)
void OfaTreeOptionsDialog::impressOptions(const std::vector<sal_uInt16>& vPageId)
{
// Impress options
if (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::IMPRESS))
if (SvtModuleOptions().IsImpressInstalled())
{
OUString aFactory = getCurrentFactory_Impl(m_xFrame);
DBG_ASSERT(GetModuleIdentifier(m_xFrame) == aFactory, "This should not happen");
@@ -1978,7 +1978,7 @@ void OfaTreeOptionsDialog::impressOptions(const std::vector<sal_uInt16>& vPageId
void OfaTreeOptionsDialog::drawOptions(const std::vector<sal_uInt16>& vPageId)
{
// Draw options
if (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::DRAW))
if (SvtModuleOptions().IsDrawInstalled())
{
OUString aFactory = getCurrentFactory_Impl(m_xFrame);
DBG_ASSERT(GetModuleIdentifier(m_xFrame) == aFactory, "This should not happen");
@@ -2013,7 +2013,7 @@ void OfaTreeOptionsDialog::drawOptions(const std::vector<sal_uInt16>& vPageId)
void OfaTreeOptionsDialog::mathOptions(const std::vector<sal_uInt16>& vPageId)
{
// Math options
if (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::MATH))
if (SvtModuleOptions().IsMathInstalled())
{
OUString aFactory = getCurrentFactory_Impl(m_xFrame);
DBG_ASSERT(GetModuleIdentifier(m_xFrame) == aFactory, "This should not happen");
@@ -2052,9 +2052,9 @@ void OfaTreeOptionsDialog::databaseOptions(const std::vector<sal_uInt16>& vPageI
// Database - needed only if there is an application which integrates with databases
if ( !lcl_isOptionHidden( SID_SB_STARBASEOPTIONS, aOptionsDlgOpt ) &&
( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::DATABASE )
|| aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER )
|| aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC )
( aModuleOpt.IsDataBaseInstalled()
|| aModuleOpt.IsWriterInstalled()
|| aModuleOpt.IsCalcInstalled()
) )
{
setGroupName( u"Base", CuiResId(SID_SB_STARBASEOPTIONS_RES[0].first) );
+3 -4
View File
@@ -598,11 +598,10 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
case SID_NEWDOC:
case SID_APP_NEW_FORM:
case ID_DOCUMENT_CREATE_REPWIZ:
aReturn.bEnabled = !isDataSourceReadOnly() && SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::WRITER);
aReturn.bEnabled = !isDataSourceReadOnly() && SvtModuleOptions().IsWriterInstalled();
break;
case SID_APP_NEW_REPORT:
aReturn.bEnabled = !isDataSourceReadOnly()
&& SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::WRITER);
aReturn.bEnabled = !isDataSourceReadOnly() && SvtModuleOptions().IsWriterInstalled();
if ( aReturn.bEnabled )
{
Reference< XContentEnumerationAccess > xEnumAccess(m_xContext->getServiceManager(), UNO_QUERY);
@@ -670,7 +669,7 @@ FeatureState OApplicationController::GetState(sal_uInt16 _nId) const
case SID_REPORT_CREATE_REPWIZ_PRE_SEL:
case SID_APP_NEW_REPORT_PRE_SEL:
aReturn.bEnabled = !isDataSourceReadOnly()
&& SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::WRITER)
&& SvtModuleOptions().IsWriterInstalled()
&& getContainer()->isALeafSelected();
if ( aReturn.bEnabled )
{
+17 -17
View File
@@ -2177,13 +2177,13 @@ void Desktop::OpenClients()
SvtModuleOptions aOpt;
// Support command line parameters to start a module (as preselection)
if ( rArgs.IsWriter() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
if (rArgs.IsWriter() && aOpt.IsWriterInstalled())
aRequest.aModule = aOpt.GetFactoryName( SvtModuleOptions::EFactory::WRITER );
else if ( rArgs.IsCalc() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
else if (rArgs.IsCalc() && aOpt.IsCalcInstalled())
aRequest.aModule = aOpt.GetFactoryName( SvtModuleOptions::EFactory::CALC );
else if ( rArgs.IsImpress() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
else if (rArgs.IsImpress() && aOpt.IsImpressInstalled())
aRequest.aModule= aOpt.GetFactoryName( SvtModuleOptions::EFactory::IMPRESS );
else if ( rArgs.IsDraw() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
else if (rArgs.IsDraw() && aOpt.IsDrawInstalled())
aRequest.aModule= aOpt.GetFactoryName( SvtModuleOptions::EFactory::DRAW );
}
@@ -2230,21 +2230,21 @@ void Desktop::OpenDefault()
if ( rArgs.HasModuleParam() )
{
// Support new command line parameters to start a module
if ( rArgs.IsWriter() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
if (rArgs.IsWriter() && aOpt.IsWriterInstalled())
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::WRITER );
else if ( rArgs.IsCalc() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
else if (rArgs.IsCalc() && aOpt.IsCalcInstalled())
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::CALC );
else if ( rArgs.IsImpress() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
else if (rArgs.IsImpress() && aOpt.IsImpressInstalled())
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::IMPRESS );
else if ( rArgs.IsBase() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
else if (rArgs.IsBase() && aOpt.IsDataBaseInstalled())
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::DATABASE );
else if ( rArgs.IsDraw() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
else if (rArgs.IsDraw() && aOpt.IsDrawInstalled())
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::DRAW );
else if ( rArgs.IsMath() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::MATH ) )
else if (rArgs.IsMath() && aOpt.IsMathInstalled())
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::MATH );
else if ( rArgs.IsGlobal() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
else if (rArgs.IsGlobal() && aOpt.IsModuleInstalled(SvtModuleOptions::EModule::GLOBAL))
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::WRITERGLOBAL );
else if ( rArgs.IsWeb() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
else if (rArgs.IsWeb() && aOpt.IsModuleInstalled(SvtModuleOptions::EModule::WEB))
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::WRITERWEB );
}
@@ -2257,15 +2257,15 @@ void Desktop::OpenDefault()
}
// Old way to create a default document
if ( aOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
if (aOpt.IsWriterInstalled())
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::WRITER );
else if ( aOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
else if (aOpt.IsCalcInstalled())
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::CALC );
else if ( aOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
else if (aOpt.IsImpressInstalled())
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::IMPRESS );
else if ( aOpt.IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
else if (aOpt.IsDataBaseInstalled())
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::DATABASE );
else if ( aOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
else if (aOpt.IsDrawInstalled())
aName = aOpt.GetFactoryEmptyDocumentURL( SvtModuleOptions::EFactory::DRAW );
else
return;
+4 -4
View File
@@ -1089,13 +1089,13 @@ bool IpcThread::process(OString const & arguments, bool * waitProcessed) {
SvtModuleOptions aOpt;
// Support command line parameters to start a module (as preselection)
if ( aCmdLineArgs->IsWriter() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
if (aCmdLineArgs->IsWriter() && aOpt.IsWriterInstalled())
pRequest->aModule = aOpt.GetFactoryName( SvtModuleOptions::EFactory::WRITER );
else if ( aCmdLineArgs->IsCalc() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
else if (aCmdLineArgs->IsCalc() && aOpt.IsCalcInstalled())
pRequest->aModule = aOpt.GetFactoryName( SvtModuleOptions::EFactory::CALC );
else if ( aCmdLineArgs->IsImpress() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
else if (aCmdLineArgs->IsImpress() && aOpt.IsImpressInstalled())
pRequest->aModule= aOpt.GetFactoryName( SvtModuleOptions::EFactory::IMPRESS );
else if ( aCmdLineArgs->IsDraw() && aOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
else if (aCmdLineArgs->IsDraw() && aOpt.IsDrawInstalled())
pRequest->aModule= aOpt.GetFactoryName( SvtModuleOptions::EFactory::DRAW );
}
@@ -853,13 +853,13 @@ namespace pcr
case PROPERTY_ID_LISTSOURCE:
// no cursor source if no Base is installed.
if ( SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
if (SvtModuleOptions().IsDataBaseInstalled())
const_cast< FormComponentPropertyHandler* >( this )->m_bHaveListSource = true;
break;
case PROPERTY_ID_COMMAND:
// no cursor source if no Base is installed.
if ( SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
if (SvtModuleOptions().IsDataBaseInstalled())
const_cast< FormComponentPropertyHandler* >( this )->m_bHaveCommand = true;
break;
} // switch ( nPropId )
@@ -2283,7 +2283,7 @@ namespace pcr
// no data properties if no Base is installed.
if ( ( nPropertyUIFlags & PROP_FLAG_DATA_PROPERTY ) != 0 )
if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
if (!SvtModuleOptions().IsDataBaseInstalled())
return true;
if ((nPropertyUIFlags & PROP_FLAG_REPORT_INVISIBLE) != 0 && isReportModel())
+8 -8
View File
@@ -155,14 +155,14 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtModuleOptions final : public utl::de
OUString GetDefaultModuleName() const;
bool IsMath () const;
bool IsChart () const;
bool IsCalc () const;
bool IsDraw () const;
bool IsWriter () const;
bool IsImpress () const;
static bool IsBasicIDE () { return true; }
bool IsDataBase () const;
bool IsMathInstalled() const { return IsModuleInstalled(EModule::MATH); }
bool IsChartInstalled() const { return IsModuleInstalled(EModule::CHART); }
bool IsCalcInstalled() const { return IsModuleInstalled(EModule::CALC); }
bool IsDrawInstalled() const { return IsModuleInstalled(EModule::DRAW); }
bool IsWriterInstalled() const { return IsModuleInstalled(EModule::WRITER); }
bool IsImpressInstalled() const { return IsModuleInstalled(EModule::IMPRESS); }
static bool IsBasicIDEInstalled() { return true; }
bool IsDataBaseInstalled() const { return IsModuleInstalled(EModule::DATABASE); }
css::uno::Sequence < OUString > GetAllServiceNames();
+1 -1
View File
@@ -1760,7 +1760,7 @@ rtl::Reference<SdrObject> XclImpChartObj::DoCreateSdrObj( XclImpDffConverter& rD
{
rtl::Reference<SdrObject> xSdrObj;
ScDocShell* pDocShell = GetDocShell();
if( rDffConv.SupportsOleObjects() && SvtModuleOptions().IsChart() && pDocShell && mxChart && !mxChart->IsPivotChart() )
if( rDffConv.SupportsOleObjects() && SvtModuleOptions().IsChartInstalled() && pDocShell && mxChart && !mxChart->IsPivotChart() )
{
// create embedded chart object
OUString aEmbObjName;
+3 -3
View File
@@ -243,7 +243,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView*
}
else if ( nSlot == SID_INSERT_SMATH )
{
if ( SvtModuleOptions().IsMath() )
if ( SvtModuleOptions().IsMathInstalled() )
{
xObj = rViewShell.GetViewFrame().GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SM_CLASSID_60 ).GetByteSequence(), aName );
rReq.AppendItem( SfxGlobalNameItem( SID_INSERT_OBJECT, SvGlobalName( SO3_SM_CLASSID_60 ) ) );
@@ -345,7 +345,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView*
}
// initialize chart ?
if ( SvtModuleOptions().IsChart() && SotExchange::IsChart( SvGlobalName( xObj->getClassID() ) ) )
if ( SvtModuleOptions().IsChartInstalled() && SotExchange::IsChart( SvGlobalName( xObj->getClassID() ) ) )
lcl_ChartInit(xObj, &rViewSh.GetViewData(), OUString(), false);
ScViewData& rData = rViewSh.GetViewData();
@@ -419,7 +419,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV
if( ! rReq.IsAPI() )
rReq.Done();
if (!SvtModuleOptions().IsChart())
if (!SvtModuleOptions().IsChartInstalled())
return;
// BM/IHA --
+1 -1
View File
@@ -94,7 +94,7 @@ void SAL_CALL TablePivotCharts::addNewByName(OUString const & rName,
uno::Reference<embed::XEmbeddedObject> xObject;
if (SvtModuleOptions().IsChart())
if (SvtModuleOptions().IsChartInstalled())
xObject = m_pDocShell->GetEmbeddedObjectContainer().CreateEmbeddedObject(SvGlobalName(SO3_SCH_CLASSID).GetByteSequence(), aName);
if (!xObject.is())
+1 -1
View File
@@ -172,7 +172,7 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName,
ScRangeListRef xNewRanges( pList );
uno::Reference < embed::XEmbeddedObject > xObj;
if ( SvtModuleOptions().IsChart() )
if ( SvtModuleOptions().IsChartInstalled() )
xObj = pDocShell->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SCH_CLASSID ).GetByteSequence(), aName );
if ( !xObj.is() )
return;
+1 -1
View File
@@ -1175,7 +1175,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
case SID_VIEW_DATA_SOURCE_BROWSER:
{
if (!SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::DATABASE))
if (!SvtModuleOptions().IsDataBaseInstalled())
rSet.Put(SfxVisibilityItem(nWhich, false));
else
// get state (BoolItem) from SfxViewFrame
+1 -1
View File
@@ -399,7 +399,7 @@ void ScTabViewShell::GetDrawState(SfxItemSet &rSet)
case SID_DRAW_CHART:
{
bool bOle = GetViewFrame().GetFrame().IsInPlace();
if ( bOle || !SvtModuleOptions().IsChart() )
if ( bOle || !SvtModuleOptions().IsChartInstalled() )
rSet.DisableItem( nWhich );
}
break;
+3 -3
View File
@@ -231,7 +231,7 @@ void ScTabViewShell::ActivateObject(SdrOle2Obj* pObj, sal_Int32 nVerb)
// attach listener to selection changes in chart that affect cell
// ranges, so those can be highlighted
// note: do that after DoVerb, so that the chart controller exists
if ( SvtModuleOptions().IsChart() )
if ( SvtModuleOptions().IsChartInstalled() )
{
SvGlobalName aObjClsId ( xObj->getClassID() );
if (SotExchange::IsChart( aObjClsId ))
@@ -603,12 +603,12 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet)
switch ( nWhich )
{
case SID_INSERT_DIAGRAM:
if ( bOle || bTabProt || !SvtModuleOptions().IsChart() || bShared )
if ( bOle || bTabProt || !SvtModuleOptions().IsChartInstalled() || bShared )
rSet.DisableItem( nWhich );
break;
case SID_INSERT_SMATH:
if ( bOle || bTabProt || !SvtModuleOptions().IsMath() || bShared )
if ( bOle || bTabProt || !SvtModuleOptions().IsMathInstalled() || bShared )
rSet.DisableItem( nWhich );
break;
+12 -6
View File
@@ -87,7 +87,10 @@ using namespace ::com::sun::star;
// Register all Factories
void SdDLL::RegisterFactorys()
{
if (comphelper::IsFuzzing() || SvtModuleOptions().IsImpress())
std::optional<SvtModuleOptions> oOpts;
if (!comphelper::IsFuzzing())
oOpts.emplace();
if (!oOpts || oOpts->IsImpressInstalled())
{
::sd::ImpressViewShellBase::RegisterFactory (
::sd::IMPRESS_FACTORY_ID);
@@ -110,7 +113,7 @@ void SdDLL::RegisterFactorys()
::sd::PRESENTATION_FACTORY_ID);
}
}
if (!comphelper::IsFuzzing() && SvtModuleOptions().IsDraw())
if (oOpts && oOpts->IsDrawInstalled())
{
::sd::GraphicViewShellBase::RegisterFactory (::sd::DRAW_FACTORY_ID);
}
@@ -224,24 +227,27 @@ void SdDLL::Init()
SfxObjectFactory* pDrawFact = nullptr;
SfxObjectFactory* pImpressFact = nullptr;
if (comphelper::IsFuzzing() || SvtModuleOptions().IsImpress())
std::optional<SvtModuleOptions> oOptions;
if (!comphelper::IsFuzzing())
oOptions.emplace();
if (!oOptions || oOptions->IsImpressInstalled())
pImpressFact = &::sd::DrawDocShell::Factory();
if (!comphelper::IsFuzzing() && SvtModuleOptions().IsDraw())
if (oOptions && oOptions->IsDrawInstalled())
pDrawFact = &::sd::GraphicDocShell::Factory();
auto pUniqueModule = std::make_unique<SdModule>(pImpressFact, pDrawFact);
SdModule* pModule = pUniqueModule.get();
SfxApplication::SetModule(SfxToolsModule::Draw, std::move(pUniqueModule));
if (!comphelper::IsFuzzing() && SvtModuleOptions().IsImpress())
if (oOptions && oOptions->IsImpressInstalled())
{
// Register the Impress shape types in order to make the shapes accessible.
::accessibility::RegisterImpressShapeTypes ();
::sd::DrawDocShell::Factory().SetDocumentServiceName( u"com.sun.star.presentation.PresentationDocument"_ustr );
}
if (!comphelper::IsFuzzing() && SvtModuleOptions().IsDraw())
if (oOptions && oOptions->IsDrawInstalled())
{
::sd::GraphicDocShell::Factory().SetDocumentServiceName( u"com.sun.star.drawing.DrawingDocument"_ustr );
}
+1 -1
View File
@@ -479,7 +479,7 @@ SfxFrame* SdModule::CreateFromTemplate(const OUString& rTemplatePath, const Refe
SfxFrame* SdModule::ExecuteNewDocument( SfxRequest const & rReq )
{
SfxFrame* pFrame = nullptr;
if ( SvtModuleOptions().IsImpress() )
if (SvtModuleOptions().IsImpressInstalled())
{
Reference< XFrame > xTargetFrame;
const SfxUnoFrameItem* pFrmItem = rReq.GetArg<SfxUnoFrameItem>(SID_FILLFRAME);
+3 -3
View File
@@ -1287,16 +1287,16 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
// are the modules available?
if (!SvtModuleOptions().IsCalc())
if (!SvtModuleOptions().IsCalcInstalled())
{
// remove menu entry if module is not available
rSet.Put( SfxVisibilityItem( SID_ATTR_TABLE, false ) );
}
if (!SvtModuleOptions().IsChart())
if (!SvtModuleOptions().IsChartInstalled())
{
rSet.DisableItem( SID_INSERT_DIAGRAM );
}
if (!SvtModuleOptions().IsMath())
if (!SvtModuleOptions().IsMathInstalled())
{
rSet.DisableItem( SID_INSERT_MATH );
}
+3 -3
View File
@@ -707,7 +707,7 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, sal_Int32 nVerb)
if( aName == "StarChart" || aName == "StarOrg" )
{
if( SvtModuleOptions().IsChart() )
if( SvtModuleOptions().IsChartInstalled() )
{
aClass = SvGlobalName( SO3_SCH_CLASSID );
bChangeDefaultsForChart = true;
@@ -715,12 +715,12 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, sal_Int32 nVerb)
}
else if( aName == "StarCalc" )
{
if( SvtModuleOptions().IsCalc() )
if( SvtModuleOptions().IsCalcInstalled() )
aClass = SvGlobalName( SO3_SC_CLASSID );
}
else if( aName == "StarMath" )
{
if( SvtModuleOptions().IsMath() )
if( SvtModuleOptions().IsMathInstalled() )
aClass = SvGlobalName( SO3_SM_CLASSID );
}
+3 -6
View File
@@ -1319,7 +1319,7 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
switch(nWhich)
{
case SID_TEMPLATE_ADDRESSBOOKSOURCE:
if ( !SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::DATABASE) )
if (!SvtModuleOptions().IsDataBaseInstalled())
rSet.Put(SfxVisibilityItem(nWhich, false));
break;
case SID_QUITAPP:
@@ -1930,8 +1930,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
case SID_NEWSD :
{
SvtModuleOptions aModuleOpt;
if ( !aModuleOpt.IsImpress() )
if (!SvtModuleOptions().IsImpressInstalled())
{
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(rReq.GetFrameWeld(),
VclMessageType::Warning, VclButtonsType::Ok,
@@ -1999,9 +1998,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
void SfxApplication::OfaState_Impl(SfxItemSet &rSet)
{
SvtModuleOptions aModuleOpt;
if( !aModuleOpt.IsWriter())
if (!SvtModuleOptions().IsWriterInstalled())
{
rSet.DisableItem( FN_LABEL );
rSet.DisableItem( FN_BUSINESS_CARD );
+8 -8
View File
@@ -358,21 +358,21 @@ static OUString getDefaultModule_Impl()
{
OUString sDefaultModule;
SvtModuleOptions aModOpt;
if ( aModOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
if (aModOpt.IsWriterInstalled())
sDefaultModule = "swriter";
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
else if (aModOpt.IsCalcInstalled())
sDefaultModule = "scalc";
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
else if (aModOpt.IsImpressInstalled())
sDefaultModule = "simpress";
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
else if (aModOpt.IsDrawInstalled())
sDefaultModule = "sdraw";
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::EModule::MATH ) )
else if (aModOpt.IsMathInstalled())
sDefaultModule = "smath";
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::EModule::CHART ) )
else if (aModOpt.IsChartInstalled())
sDefaultModule = "schart";
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::EModule::BASIC ) )
else if (SvtModuleOptions::IsBasicIDEInstalled())
sDefaultModule = "sbasic";
else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
else if (aModOpt.IsDataBaseInstalled())
sDefaultModule = "sdatabase";
else
{
+12 -12
View File
@@ -291,22 +291,22 @@ void BackingWindow::initControls()
// collect the URLs of the entries in the File/New menu
SvtModuleOptions aModuleOptions;
if (aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::WRITER))
if (aModuleOptions.IsWriterInstalled())
mxAllRecentThumbnails->mnFileTypes |= sfx2::ApplicationType::TYPE_WRITER;
if (aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::CALC))
if (aModuleOptions.IsCalcInstalled())
mxAllRecentThumbnails->mnFileTypes |= sfx2::ApplicationType::TYPE_CALC;
if (aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::IMPRESS))
if (aModuleOptions.IsImpressInstalled())
mxAllRecentThumbnails->mnFileTypes |= sfx2::ApplicationType::TYPE_IMPRESS;
if (aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::DRAW))
if (aModuleOptions.IsDrawInstalled())
mxAllRecentThumbnails->mnFileTypes |= sfx2::ApplicationType::TYPE_DRAW;
if (aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::DATABASE))
if (aModuleOptions.IsDataBaseInstalled())
mxAllRecentThumbnails->mnFileTypes |= sfx2::ApplicationType::TYPE_DATABASE;
if (aModuleOptions.IsModuleInstalled(SvtModuleOptions::EModule::MATH))
if (aModuleOptions.IsMathInstalled())
mxAllRecentThumbnails->mnFileTypes |= sfx2::ApplicationType::TYPE_MATH;
mxAllRecentThumbnails->mnFileTypes |= sfx2::ApplicationType::TYPE_OTHER;
@@ -433,12 +433,12 @@ void BackingWindow::checkInstalledModules()
{
SvtModuleOptions aModuleOpt;
mxWriterAllButton->set_sensitive( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ));
mxCalcAllButton->set_sensitive( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) );
mxImpressAllButton->set_sensitive( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) );
mxDrawAllButton->set_sensitive( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) );
mxMathAllButton->set_sensitive(aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::MATH ));
mxDBAllButton->set_sensitive(aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ));
mxWriterAllButton->set_sensitive(aModuleOpt.IsWriterInstalled());
mxCalcAllButton->set_sensitive(aModuleOpt.IsCalcInstalled());
mxImpressAllButton->set_sensitive(aModuleOpt.IsImpressInstalled());
mxDrawAllButton->set_sensitive(aModuleOpt.IsDrawInstalled());
mxMathAllButton->set_sensitive(aModuleOpt.IsMathInstalled());
mxDBAllButton->set_sensitive(aModuleOpt.IsDataBaseInstalled());
}
bool BackingWindow::PreNotify(NotifyEvent& rNEvt)
+2 -2
View File
@@ -817,7 +817,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
case SID_AUTOREDACTDOC:
{
// Actual redaction takes place on a newly generated Draw document
if (!SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::DRAW))
if (!SvtModuleOptions().IsDrawInstalled())
{
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(
pDialogParent, VclMessageType::Warning, VclButtonsType::Ok,
@@ -853,7 +853,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
uno::Reference< lang::XComponent > xSourceDoc( xModel );
// Actual redaction takes place on a newly generated Draw document
if (!SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::DRAW))
if (!SvtModuleOptions().IsDrawInstalled())
{
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(
pDialogParent, VclMessageType::Warning, VclButtonsType::Ok,
+4 -4
View File
@@ -911,10 +911,10 @@ void SfxTemplateManagerDlg::OnTemplateImportCategory(std::u16string_view sCatego
// add filters of modules which are installed
SvtModuleOptions aModuleOpt;
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::WRITER ) )
if (aModuleOpt.IsWriterInstalled())
sFilterExt += "*.ott;*.stw;*.oth;*.dotx;*.dot";
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::CALC ) )
if (aModuleOpt.IsCalcInstalled())
{
if ( !sFilterExt.isEmpty() )
sFilterExt += ";";
@@ -922,7 +922,7 @@ void SfxTemplateManagerDlg::OnTemplateImportCategory(std::u16string_view sCatego
sFilterExt += "*.ots;*.stc;*.xltx;*.xlt";
}
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::IMPRESS ) )
if (aModuleOpt.IsImpressInstalled())
{
if ( !sFilterExt.isEmpty() )
sFilterExt += ";";
@@ -930,7 +930,7 @@ void SfxTemplateManagerDlg::OnTemplateImportCategory(std::u16string_view sCatego
sFilterExt += "*.otp;*.sti;*.pot;*.potx";
}
if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::EModule::DRAW ) )
if (aModuleOpt.IsDrawInstalled())
{
if ( !sFilterExt.isEmpty() )
sFilterExt += ";";
+1 -1
View File
@@ -3513,7 +3513,7 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq )
const SfxBoolItem* pShowItem = rReq.GetArg<SfxBoolItem>(nSID);
if ( nSID == SID_VIEW_DATA_SOURCE_BROWSER )
{
if (!SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::DATABASE))
if (!SvtModuleOptions().IsDataBaseInstalled())
return;
Reference < XFrame > xFrame = GetFrame().GetFrameInterface();
Reference < XFrame > xBeamer( xFrame->findFrame( u"_beamer"_ustr, FrameSearchFlag::CHILDREN ) );
+2 -2
View File
@@ -797,7 +797,7 @@ void FmFormShell::GetState(SfxItemSet &rSet)
break;
case SID_FM_USE_WIZARDS:
if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
if (!SvtModuleOptions().IsDataBaseInstalled())
rSet.Put( SfxVisibilityItem( nWhich, false ) );
else if (!GetFormModel())
rSet.DisableItem( nWhich );
@@ -819,7 +819,7 @@ void FmFormShell::GetState(SfxItemSet &rSet)
case SID_FM_NAVIGATIONBAR:
case SID_FM_DBGRID:
if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
if (!SvtModuleOptions().IsDataBaseInstalled())
{
rSet.Put( SfxVisibilityItem( nWhich, false ) );
break;
+1 -1
View File
@@ -992,7 +992,7 @@ void FmXFormView::onCreatedFormObject( FmFormObj const & _rFormObject )
// #i46898# no wizards if there is no Base installed - currently, all wizards are
// database related
if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
if (!SvtModuleOptions().IsDataBaseInstalled())
return;
if ( m_nControlWizardEvent )
+1 -1
View File
@@ -34,7 +34,7 @@ using namespace ::com::sun::star;
static bool IsDocShellRegistered()
{
return SvtModuleOptions().IsWriter();
return SvtModuleOptions().IsWriterInstalled();
}
SwIoDetect aFilterDetect[] =
+1 -2
View File
@@ -497,8 +497,7 @@ SwDoc* Reader::GetTemplateDoc(SwDoc& rDoc)
// we cannot create a SwDocShell. We could create a
// SwWebDocShell however, because this exists always
// for the help.
SvtModuleOptions aModuleOptions;
if (aModuleOptions.IsWriter())
if (SvtModuleOptions().IsWriterInstalled())
{
rtl::Reference<SwDocShell> pDocSh = new SwDocShell(SfxObjectCreateMode::INTERNAL);
SfxObjectShellLock xDocSh = pDocSh.get();
+2 -5
View File
@@ -1040,11 +1040,8 @@ void SwDocShell::GetState(SfxItemSet& rSet)
case FN_ABSTRACT_STARIMPRESS:
case FN_OUTLINE_TO_IMPRESS:
{
SvtModuleOptions aMOpt;
if (!aMOpt.IsImpress() || GetObjectShell()->isExportLocked())
rSet.DisableItem( nWhich );
}
if (!SvtModuleOptions().IsImpressInstalled() || GetObjectShell()->isExportLocked())
rSet.DisableItem(nWhich);
[[fallthrough]];
case FN_ABSTRACT_NEWDOC:
case FN_OUTLINE_TO_CLIPBOARD:
+4 -4
View File
@@ -86,12 +86,12 @@ SwDLL::SwDLL()
if ( SfxApplication::GetModule(SfxToolsModule::Writer) ) // Module already active
return;
std::unique_ptr<SvtModuleOptions> xOpt;
std::optional<SvtModuleOptions> oOpt;
if (!comphelper::IsFuzzing())
xOpt.reset(new SvtModuleOptions);
oOpt.emplace();
SfxObjectFactory* pDocFact = nullptr;
SfxObjectFactory* pGlobDocFact = nullptr;
if (!xOpt || xOpt->IsWriter())
if (!oOpt || oOpt->IsWriterInstalled())
{
pDocFact = &SwDocShell::Factory();
pGlobDocFact = &SwGlobalDocShell::Factory();
@@ -105,7 +105,7 @@ SwDLL::SwDLL()
pWDocFact->SetDocumentServiceName(u"com.sun.star.text.WebDocument"_ustr);
if (!xOpt || xOpt->IsWriter())
if (!oOpt || oOpt->IsWriterInstalled())
{
pGlobDocFact->SetDocumentServiceName(u"com.sun.star.text.GlobalDocument"_ustr);
pDocFact->SetDocumentServiceName(u"com.sun.star.text.TextDocument"_ustr);
+3 -2
View File
@@ -212,13 +212,14 @@ void SwDLL::RegisterFactories()
{
// These Id's must not be changed. Through these Id's the View (resume Documentview)
// is created by Sfx.
if (comphelper::IsFuzzing() || SvtModuleOptions().IsWriter())
SvtModuleOptions aOptions;
if (comphelper::IsFuzzing() || aOptions.IsWriterInstalled())
SwView::RegisterFactory ( SFX_INTERFACE_SFXDOCSH );
#if HAVE_FEATURE_DESKTOP
SwWebView::RegisterFactory ( SFX_INTERFACE_SFXMODULE );
if (comphelper::IsFuzzing() || SvtModuleOptions().IsWriter())
if (comphelper::IsFuzzing() || aOptions.IsWriterInstalled())
{
SwSrcView::RegisterFactory ( SfxInterfaceId(6) );
SwPagePreview::RegisterFactory ( SfxInterfaceId(7) );
+1 -1
View File
@@ -1466,7 +1466,7 @@ void SwTableShell::GetState(SfxItemSet &rSet)
case SID_INSERT_DIAGRAM:
{
SvtModuleOptions aMOpt;
if ( !aMOpt.IsMath() || rSh.IsTableComplexForChart() )
if ( !aMOpt.IsMathInstalled() || rSh.IsTableComplexForChart() )
rSet.DisableItem(nSlot);
}
break;
+3 -5
View File
@@ -373,8 +373,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
break;
case SID_INSERT_DIAGRAM:
{
SvtModuleOptions aMOpt;
if ( !aMOpt.IsChart() )
if (!SvtModuleOptions().IsChartInstalled())
break;
if(!rReq.IsAPI())
{
@@ -621,7 +620,6 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
SfxWhichIter aIter( rSet );
SwWrtShell &rSh = GetShell();
sal_uInt16 nWhich = aIter.FirstWhich();
SvtModuleOptions aMOpt;
SfxObjectCreateMode eCreateMode =
GetView().GetDocShell()->GetCreateMode();
const bool bCursorInHidden = rSh.IsInHiddenRange(/*bSelect=*/false);
@@ -641,7 +639,7 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
break;
case SID_INSERT_DIAGRAM:
if( !aMOpt.IsChart()
if (!SvtModuleOptions().IsChartInstalled()
|| GetShell().CursorInsideInputField()
|| eCreateMode == SfxObjectCreateMode::EMBEDDED
|| bCursorInHidden )
@@ -651,7 +649,7 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
break;
case FN_INSERT_SMA:
if( !aMOpt.IsMath()
if (!SvtModuleOptions().IsMathInstalled()
|| eCreateMode == SfxObjectCreateMode::EMBEDDED
|| bCursorInHidden
|| rSh.CursorInsideInputField() )
+1 -1
View File
@@ -72,7 +72,7 @@ using namespace ::com::sun::star;
SFX_IMPL_NAMED_VIEWFACTORY(SwView, "Default")
{
if (comphelper::IsFuzzing() || SvtModuleOptions().IsWriter())
if (comphelper::IsFuzzing() || SvtModuleOptions().IsWriterInstalled())
{
SFX_VIEW_REGISTRATION(SwDocShell);
SFX_VIEW_REGISTRATION(SwGlobalDocShell);
+1 -1
View File
@@ -513,7 +513,7 @@ void SwView::GetState(SfxItemSet &rSet)
rSet.DisableItem(nWhich);
break;
case SID_VIEW_DATA_SOURCE_BROWSER:
if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
if (!SvtModuleOptions().IsDataBaseInstalled())
rSet.Put( SfxVisibilityItem( nWhich, false ) );
else
rSet.Put( SfxBoolItem( nWhich, GetViewFrame().HasChildWindow( SID_BROWSER ) ) );
-42
View File
@@ -875,48 +875,6 @@ void SvtModuleOptions::SetFactoryDefaultFilter( EFactory eFactory,
m_pImpl->SetFactoryDefaultFilter( eFactory, sFilter );
}
bool SvtModuleOptions::IsMath() const
{
// doesn't need mutex, never modified
return m_pImpl->IsModuleInstalled( EModule::MATH );
}
bool SvtModuleOptions::IsChart() const
{
// doesn't need mutex, never modified
return m_pImpl->IsModuleInstalled( EModule::CHART );
}
bool SvtModuleOptions::IsCalc() const
{
// doesn't need mutex, never modified
return m_pImpl->IsModuleInstalled( EModule::CALC );
}
bool SvtModuleOptions::IsDraw() const
{
// doesn't need mutex, never modified
return m_pImpl->IsModuleInstalled( EModule::DRAW );
}
bool SvtModuleOptions::IsWriter() const
{
std::unique_lock aGuard( impl_GetOwnStaticMutex() );
return m_pImpl->IsModuleInstalled( EModule::WRITER );
}
bool SvtModuleOptions::IsImpress() const
{
// doesn't need mutex, never modified
return m_pImpl->IsModuleInstalled( EModule::IMPRESS );
}
bool SvtModuleOptions::IsDataBase() const
{
// doesn't need mutex, never modified
return m_pImpl->IsModuleInstalled( EModule::DATABASE );
}
OUString SvtModuleOptions::GetModuleName( EModule eModule ) const
{
switch( eModule )