forms/source/component/Filter.cxx | 11 +++++---- forms/source/component/ListBox.cxx | 11 +++++---- forms/source/runtime/formoperations.cxx | 3 +- sfx2/source/doc/objxtor.cxx | 3 +- svx/source/form/fmobjfac.cxx | 3 +- sw/source/core/bastyp/calc.cxx | 6 ++--- sw/source/core/doc/DocumentFieldsManager.cxx | 31 +++++++++++++-------------- sw/source/core/doc/docfld.cxx | 23 ++++++++++---------- sw/source/core/doc/docnew.cxx | 5 ++-- sw/source/core/edit/edfld.cxx | 5 ++-- sw/source/core/fields/docufld.cxx | 5 ++-- sw/source/filter/ww8/ww8par5.cxx | 7 +++--- sw/source/ui/dialog/swdlgfact.cxx | 15 ++++++------- sw/source/ui/fldui/fldedt.cxx | 3 +- sw/source/ui/fldui/fldtdlg.cxx | 7 +++--- sw/source/uibase/app/apphdl.cxx | 5 ++-- sw/source/uibase/app/applab.cxx | 5 ++-- sw/source/uibase/fldui/fldmgr.cxx | 5 ++-- sw/source/uibase/shells/basesh.cxx | 3 +- sw/source/uibase/uiview/uivwimp.cxx | 3 +- sw/source/uibase/uiview/view2.cxx | 7 +++--- sw/source/uibase/uno/SwXDocumentSettings.cxx | 5 ++-- sw/source/uibase/uno/unodispatch.cxx | 3 +- sw/source/uibase/uno/unodoc.cxx | 3 +- 24 files changed, 100 insertions(+), 77 deletions(-)
New commits: commit 78cee244be863a14dfc76e4540b21dd08dba5e5a Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Sep 24 12:46:21 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Sep 24 15:26:21 2021 +0200 make it possible to build required database stuff for fuzzing The dbase filter requires dbaccess and connectivity but I don't want to pull in the rest of the stuff that --disable-database-connectivity currently disables that we still don't need for fuzzing if --disable-database-connectivity is removed Change-Id: Ia48d42295f9724b4dd2d3beb8e46ed23fc789f5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122579 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx index 0bf85648ddba..ce137f3bb1ca 100644 --- a/forms/source/component/Filter.cxx +++ b/forms/source/component/Filter.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <config_features.h> +#include <config_fuzzers.h> #include <string_view> @@ -90,7 +91,7 @@ namespace frm bool OFilterControl::ensureInitialized( ) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS if ( !m_xField.is() ) { OSL_FAIL( "OFilterControl::ensureInitialized: improperly initialized: no field!" ); @@ -271,7 +272,7 @@ namespace frm void SAL_CALL OFilterControl::itemStateChanged( const ItemEvent& rEvent ) { -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS (void) rEvent; #else OUStringBuffer aText; @@ -366,7 +367,7 @@ namespace frm void OFilterControl::implInitFilterList() { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS if ( !ensureInitialized( ) ) // already asserted in ensureInitialized return; @@ -491,7 +492,7 @@ namespace frm sal_Bool SAL_CALL OFilterControl::commit() { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS if ( !ensureInitialized( ) ) // already asserted in ensureInitialized return true; @@ -806,7 +807,7 @@ namespace frm void OFilterControl::initControlModel(Reference< XPropertySet > const & xControlModel) { -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS (void) xControlModel; #else if ( !xControlModel.is() ) diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index b58fb00cd8e9..f719ed3af040 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include "ListBox.hxx" #include <property.hxx> @@ -345,7 +346,7 @@ namespace frm } break; -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS case PROPERTY_ID_SELECT_VALUE : { ORowSetValue v; @@ -875,7 +876,7 @@ namespace frm switch (m_eListSourceType) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS case ListSourceType_SQL: case ListSourceType_SQLPASSTHROUGH: case ListSourceType_TABLE: @@ -1206,7 +1207,7 @@ namespace frm sal_Int32 nCount(0); -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS sal_Int16 *pIndex = aSelectionIndicies.getArray(); for ( auto const & value : i_aValues) { @@ -1241,7 +1242,7 @@ namespace frm Any OListBoxModel::translateDbColumnToControlValue() { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS Reference< XPropertySet > xBoundField( getField() ); if ( !xBoundField.is() ) { @@ -1360,7 +1361,7 @@ namespace frm break; case eValue: -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS { ORowSetValue v; v.fill(_rExternalValue); diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx index fa8e092ab5cb..2a87bb2bd2c9 100644 --- a/forms/source/runtime/formoperations.cxx +++ b/forms/source/runtime/formoperations.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include "formoperations.hxx" #include <frm_strings.hxx> @@ -1739,7 +1740,7 @@ namespace frm { f(); } -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS catch( const SQLException& ) { if (!pErrorResourceId) // no information to prepend diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 7418f9136d53..73ab44f1da9f 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <map> @@ -969,7 +970,7 @@ OUString SfxObjectShell::GetServiceNameFromFactory( const OUString& rFact ) aServiceName = "com.sun.star.script.BasicIDE"; } #endif -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS else if ( aFact == "sdatabase" ) { aServiceName = "com.sun.star.sdb.OfficeDatabaseDocument"; diff --git a/svx/source/form/fmobjfac.cxx b/svx/source/form/fmobjfac.cxx index 799106579ced..16bc622d7e31 100644 --- a/svx/source/form/fmobjfac.cxx +++ b/svx/source/form/fmobjfac.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <tools/diagnose_ex.h> #include <svx/svdobj.hxx> @@ -70,7 +71,7 @@ FmFormObjFactory::FmFormObjFactory() FmPropBrwMgr::RegisterChildWindow(); NavigatorFrameManager::RegisterChildWindow(); DataNavigatorManager::RegisterChildWindow(); -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS FmFilterNavigatorWinMgr::RegisterChildWindow(); #endif diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 4840e81497b2..983e4f6eb0fa 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <calc.hxx> #include <cfloat> @@ -499,9 +500,8 @@ SwCalcExp* SwCalc::VarLook( const OUString& rStr, bool bIns ) if( !bIns ) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS SwDBManager *pMgr = m_rDoc.GetDBManager(); - OUString sDBName(GetDBName( sTmpName )); OUString sSourceName(sDBName.getToken(0, DB_DELIM)); OUString sTableName(sDBName.getToken(0, ';').getToken(1, DB_DELIM)); @@ -560,7 +560,7 @@ SwCalcExp* SwCalc::VarLook( const OUString& rStr, bool bIns ) if( sColumnName.equalsIgnoreAsciiCase( SwFieldType::GetTypeStr( SwFieldTypesEnum::DatabaseSetNumber ) )) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS SwDBManager *pMgr = m_rDoc.GetDBManager(); OUString sDBName(GetDBName( sTmpName )); OUString sSourceName(sDBName.getToken(0, DB_DELIM)); diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index adf7e26e4e05..6a190e9fb21c 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -18,6 +18,7 @@ */ #include <DocumentFieldsManager.hxx> #include <config_features.h> +#include <config_fuzzers.h> #include <doc.hxx> #include <IDocumentUndoRedo.hxx> #include <IDocumentState.hxx> @@ -77,7 +78,7 @@ namespace sw namespace { - #if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS OUString lcl_GetDBVarName( SwDoc& rDoc, SwDBNameInfField& rDBField ) { @@ -95,7 +96,7 @@ namespace return sDBNumNm; } - #endif +#endif bool IsFieldDeleted(IDocumentRedlineAccess const& rIDRA, SwRootFrame const& rLayout, SwTextField const& rTextField) @@ -143,7 +144,7 @@ namespace } else if( pMgr ) { - #if !HAVE_FEATURE_DBCONNECTIVITY + #if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS (void) rDoc; #else switch( nFieldWhich ) @@ -429,7 +430,7 @@ void DocumentFieldsManager::UpdateFields( bool bCloseDB ) UpdateRefFields(); if( bCloseDB ) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS m_rDoc.GetDBManager()->CloseAll(); #endif } @@ -586,7 +587,7 @@ bool DocumentFieldsManager::UpdateField(SwTextField * pDstTextField, SwField & r break; case SwFieldIds::Database: -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS { // JP 10.02.96: call ChgValue, so that the style change sets the // ContentString correctly @@ -965,7 +966,7 @@ void DocumentFieldsManager::UpdateExpFieldsImpl( // The array is filled with all fields; start calculation. SwCalc aCalc( m_rDoc ); -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS OUString sDBNumNm( SwFieldType::GetTypeStr( SwFieldTypesEnum::DatabaseSetNumber ) ); // already set the current record number @@ -1093,7 +1094,7 @@ void DocumentFieldsManager::UpdateExpFieldsImpl( } break; case SwFieldIds::DbSetNumber: -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS { const_cast<SwDBSetNumberField*>(static_cast<const SwDBSetNumberField*>(pField))->Evaluate(m_rDoc); aCalc.VarChange( sDBNumNm, static_cast<const SwDBSetNumberField*>(pField)->GetSetNumber()); @@ -1103,7 +1104,7 @@ void DocumentFieldsManager::UpdateExpFieldsImpl( break; case SwFieldIds::DbNextSet: case SwFieldIds::DbNumSet: -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS { UpdateDBNumFields( *const_cast<SwDBNameInfField*>(static_cast<const SwDBNameInfField*>(pField)), aCalc ); if( bCanFill ) @@ -1113,7 +1114,7 @@ void DocumentFieldsManager::UpdateExpFieldsImpl( break; case SwFieldIds::Database: { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS // evaluate field const_cast<SwDBField*>(static_cast<const SwDBField*>(pField))->Evaluate(); @@ -1293,7 +1294,7 @@ void DocumentFieldsManager::UpdateExpFieldsImpl( } } -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS pMgr->CloseAll(false); #endif } @@ -1551,7 +1552,7 @@ void DocumentFieldsManager::FieldsToCalc(SwCalc& rCalc, mpUpdateFields->MakeFieldList( m_rDoc, mbNewFieldLst, GETFLD_CALC ); mbNewFieldLst = false; -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS SwDBManager* pMgr = NULL; #else SwDBManager* pMgr = m_rDoc.GetDBManager(); @@ -1568,7 +1569,7 @@ void DocumentFieldsManager::FieldsToCalc(SwCalc& rCalc, lcl_CalcField(m_rDoc, rCalc, **it, pMgr, pLayout); } } -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS pMgr->CloseAll(false); #endif } @@ -1580,7 +1581,7 @@ void DocumentFieldsManager::FieldsToCalc(SwCalc& rCalc, mpUpdateFields->MakeFieldList( m_rDoc, mbNewFieldLst, GETFLD_CALC ); mbNewFieldLst = false; -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS SwDBManager* pMgr = NULL; #else SwDBManager* pMgr = m_rDoc.GetDBManager(); @@ -1620,7 +1621,7 @@ void DocumentFieldsManager::FieldsToCalc(SwCalc& rCalc, } } -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS pMgr->CloseAll(false); #endif } @@ -1825,7 +1826,7 @@ void DocumentFieldsManager::ClearFieldTypes() void DocumentFieldsManager::UpdateDBNumFields( SwDBNameInfField& rDBField, SwCalc& rCalc ) { -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS (void) rDBField; (void) rCalc; #else diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index fa8d0d2e2484..dd4232885689 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <hintids.hxx> @@ -369,7 +370,7 @@ OUString LookString( SwHashTable<HashStr> const & rTable, std::u16string_view rN SwDBData const & SwDoc::GetDBData() { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS if(maDBData.sDataSource.isEmpty()) { // Similar to: SwEditShell::IsAnyDatabaseFieldInDoc @@ -409,14 +410,14 @@ SwDBData const & SwDoc::GetDBData() void SwDoc::SetInitDBFields( bool b ) { -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS (void) b; #else GetDBManager()->SetInitDBFields( b ); #endif } -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS /// Get all databases that are used by fields static OUString lcl_DBDataToString(const SwDBData& rData) @@ -431,7 +432,7 @@ static OUString lcl_DBDataToString(const SwDBData& rData) void SwDoc::GetAllUsedDB( std::vector<OUString>& rDBNameList, const std::vector<OUString>* pAllDBNames ) { -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS (void) rDBNameList; (void) pAllDBNames; #else @@ -509,7 +510,7 @@ void SwDoc::GetAllUsedDB( std::vector<OUString>& rDBNameList, void SwDoc::GetAllDBNames( std::vector<OUString>& rAllDBNames ) { -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS (void) rAllDBNames; #else SwDBManager* pMgr = GetDBManager(); @@ -561,7 +562,7 @@ void SwDoc::AddUsedDBToList( std::vector<OUString>& rDBNameList, void SwDoc::AddUsedDBToList( std::vector<OUString>& rDBNameList, const OUString& rDBName) { -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS (void) rDBNameList; (void) rDBName; #else @@ -592,7 +593,7 @@ void SwDoc::AddUsedDBToList( std::vector<OUString>& rDBNameList, const OUString& void SwDoc::ChangeDBFields( const std::vector<OUString>& rOldNames, const OUString& rNewName ) { -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS (void) rOldNames; (void) rNewName; #else @@ -628,7 +629,7 @@ void SwDoc::ChangeDBFields( const std::vector<OUString>& rOldNames, switch( pField->GetTyp()->Which() ) { case SwFieldIds::Database: -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS if (IsNameInArray(rOldNames, lcl_DBDataToString(static_cast<SwDBField*>(pField)->GetDBData()))) { SwDBFieldType* pOldTyp = static_cast<SwDBFieldType*>(pField->GetTyp()); @@ -904,7 +905,7 @@ void SwDocUpdateField::MakeFieldList_( SwDoc& rDoc, int eGetMode ) static const OUStringLiteral sTrue(u"TRUE"); static const OUStringLiteral sFalse(u"FALSE"); -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS bool bIsDBManager = nullptr != rDoc.GetDBManager(); #endif @@ -978,7 +979,7 @@ void SwDocUpdateField::MakeFieldList_( SwDoc& rDoc, int eGetMode ) } break; -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS case SwFieldIds::DbNumSet: { SwDBData aDBData(const_cast<SwDBNumSetField*>(static_cast<const SwDBNumSetField*>(pField))->GetDBData(&rDoc)); @@ -1063,7 +1064,7 @@ void SwDocUpdateField::GetBodyNode( const SwTextField& rTField, SwFieldIds nFiel SwGetExpField* pGetField = const_cast<SwGetExpField*>(static_cast<const SwGetExpField*>(rTField.GetFormatField().GetField())); pGetField->ChgBodyTextFlag( bIsInBody ); } -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS else if( SwFieldIds::Database == nFieldWhich ) { SwDBField* pDBField = const_cast<SwDBField*>(static_cast<const SwDBField*>(rTField.GetFormatField().GetField())); diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index d64c23f044d7..c8279d4164d5 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -23,6 +23,7 @@ #include <string_view> #include <config_features.h> +#include <config_fuzzers.h> #include <o3tl/sorted_vector.hxx> @@ -336,7 +337,7 @@ SwDoc::SwDoc() maOLEModifiedIdle.SetInvokeHandler( LINK( this, SwDoc, DoUpdateModifiedOLE )); maOLEModifiedIdle.SetDebugName( "sw::SwDoc maOLEModifiedIdle" ); -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS // Create DBManager m_pOwnDBManager.reset(new SwDBManager(this)); m_pDBManager = m_pOwnDBManager.get(); @@ -534,7 +535,7 @@ SwDoc::~SwDoc() */ mpFrameFormatTable->erase( mpFrameFormatTable->begin() ); -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS // On load, SwDBManager::setEmbeddedName() may register a data source. // If we have an embedded one, then sDataSource points to the registered name, so revoke it here. if (!m_pOwnDBManager->getEmbeddedName().isEmpty() && !maDBData.sDataSource.isEmpty()) diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index b6bb9055f23d..9fb2546b238c 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <osl/diagnose.h> #include <unotools/charclass.hxx> @@ -316,7 +317,7 @@ void SwEditShell::UpdateExpFields(bool bCloseDB) GetDoc()->getIDocumentFieldsAccess().UpdateExpFields(nullptr, true); if (bCloseDB) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS GetDoc()->GetDBManager()->CloseAll(); // close all database connections #endif } @@ -325,7 +326,7 @@ void SwEditShell::UpdateExpFields(bool bCloseDB) SwDBManager* SwEditShell::GetDBManager() const { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS return GetDoc()->GetDBManager(); #else return NULL; diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 41016a18b3ba..902a7bcea33a 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <textapi.hxx> @@ -1326,7 +1327,7 @@ void SwHiddenTextField::Evaluate(SwDoc& rDoc) if( SwFieldTypesEnum::ConditionalText != m_nSubType ) return; -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS (void) rDoc; #else SwDBManager* pMgr = rDoc.GetDBManager(); @@ -1352,7 +1353,7 @@ void SwHiddenTextField::Evaluate(SwDoc& rDoc) { // remove brackets sTmpName = sTmpName.copy(1, sTmpName.getLength() - 2); } -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS if( pMgr) { sal_Int32 nIdx{ 0 }; diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 19991a2ebc18..1e1619a6460a 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <sal/types.h> #include <tools/solar.h> @@ -2552,7 +2553,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludeText( WW8FieldDesc* /*pF*/, OUString& rSt // "SERIALPRINT" eF_ResT SwWW8ImplReader::Read_F_DBField( WW8FieldDesc* pF, OUString& rStr ) { -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS (void) pF; (void) rStr; #else @@ -2593,7 +2594,7 @@ eF_ResT SwWW8ImplReader::Read_F_DBField( WW8FieldDesc* pF, OUString& rStr ) // "NEXT" eF_ResT SwWW8ImplReader::Read_F_DBNext( WW8FieldDesc*, OUString& ) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS SwDBNextSetFieldType aN; SwFieldType* pFT = m_rDoc.getIDocumentFieldsAccess().InsertFieldType( aN ); SwDBNextSetField aField( static_cast<SwDBNextSetFieldType*>(pFT), OUString(), @@ -2606,7 +2607,7 @@ eF_ResT SwWW8ImplReader::Read_F_DBNext( WW8FieldDesc*, OUString& ) // "DATASET" eF_ResT SwWW8ImplReader::Read_F_DBNum( WW8FieldDesc*, OUString& ) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS SwDBSetNumberFieldType aN; SwFieldType* pFT = m_rDoc.getIDocumentFieldsAccess().InsertFieldType( aN ); SwDBSetNumberField aField( static_cast<SwDBSetNumberFieldType*>(pFT), diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 9c5567e0ae7e..2f28ef1b385d 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include "swdlgfact.hxx" #include <svl/style.hxx> @@ -396,7 +397,7 @@ void AbstractSwInsertDBColAutoPilot_Impl::DataToDoc( const uno::Sequence< uno::A uno::Reference< sdbc::XConnection> xConnection, uno::Reference< sdbc::XResultSet > xResultSet) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS m_xDlg->DataToDoc(rSelection, rxSource, xConnection, xResultSet); #else (void) rSelection; @@ -832,7 +833,7 @@ std::shared_ptr<AbstractSwBreakDlg> SwAbstractDialogFactory_Impl::CreateSwBreakD VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwView& rVw) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_shared<SwChangeDBDlg>(rVw)); #else (void) rVw; @@ -861,7 +862,7 @@ VclPtr<AbstractSwInsertDBColAutoPilot> SwAbstractDialogFactory_Impl::CreateSwIns uno::Reference<sdbcx::XColumnsSupplier> xColSupp, const SwDBData& rData) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS return VclPtr<AbstractSwInsertDBColAutoPilot_Impl>::Create(std::make_unique<SwInsertDBColAutoPilot>(rView, rxSource, xColSupp, rData)); #else (void) rView; @@ -1156,7 +1157,7 @@ VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg( VclPtr<AbstractMailMergeWizard> SwAbstractDialogFactory_Impl::CreateMailMergeWizard( SwView& rView, std::shared_ptr<SwMailMergeConfigItem>& rConfigItem) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS return VclPtr<AbstractMailMergeWizard_Impl>::Create(std::make_shared<SwMailMergeWizard>(rView, rConfigItem)); #else (void) rView; @@ -1235,7 +1236,7 @@ CreateTabPage SwAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nI void SwAbstractDialogFactory_Impl::ExecuteMMResultSaveDialog(weld::Window* pParent) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS SwMMResultSaveDialog aDialog(pParent); aDialog.run(); #else @@ -1245,7 +1246,7 @@ void SwAbstractDialogFactory_Impl::ExecuteMMResultSaveDialog(weld::Window* pPare void SwAbstractDialogFactory_Impl::ExecuteMMResultPrintDialog(weld::Window* pParent) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS SwMMResultPrintDialog aDialog(pParent); aDialog.run(); #else @@ -1255,7 +1256,7 @@ void SwAbstractDialogFactory_Impl::ExecuteMMResultPrintDialog(weld::Window* pPar void SwAbstractDialogFactory_Impl::ExecuteMMResultEmailDialog(weld::Window* pParent) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS SwMMResultEmailDialog aDialog(pParent); aDialog.run(); #else diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index 74d14dbdb296..7c3f976a6e1c 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <sfx2/basedlgs.hxx> #include <sfx2/viewfrm.hxx> @@ -201,7 +202,7 @@ SfxTabPage* SwFieldEditDlg::CreatePage(sal_uInt16 nGroup) xTabPage = SwFieldDokInfPage::Create(get_content_area(), this, pSet); break; } -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS case GRP_DB: xTabPage = SwFieldDBPage::Create(get_content_area(), this, nullptr); static_cast<SwFieldDBPage*>(xTabPage.get())->SetWrtShell(*pSh); diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx index 150304bd508c..946de356075e 100644 --- a/sw/source/ui/fldui/fldtdlg.cxx +++ b/sw/source/ui/fldui/fldtdlg.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <cmdid.h> #include <unotools/confignode.hxx> @@ -74,7 +75,7 @@ SwFieldDlg::SwFieldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, weld::Window *pP -1, utl::OConfigurationTreeRoot::CM_READONLY); -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS bool bDatabaseFields = true; aCfgRoot.getNodeValue( OUString("DatabaseFields")) >>= bDatabaseFields; @@ -244,7 +245,7 @@ void SwFieldDlg::InsertHdl() void SwFieldDlg::ActivateDatabasePage() { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS m_bDataBaseMode = true; ShowPage("database"); SfxTabPage* pDBPage = GetTabPage("database"); @@ -268,7 +269,7 @@ void SwFieldDlg::ShowReferencePage() void SwFieldDlg::PageCreated(const OString& rId, SfxTabPage& rPage) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS if (rId != "database") return; diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index 3074d96f7bab..dd2b943f476a 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <comphelper/propertysequence.hxx> #include <sfx2/dispatch.hxx> @@ -292,7 +293,7 @@ std::shared_ptr<SwMailMergeConfigItem> SwView::EnsureMailMergeConfigItem(const S return xMMConfig; } -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS namespace { @@ -733,7 +734,7 @@ void SwModule::ExecOther(SfxRequest& rReq) m_pModuleConfig->SetInsTableFormatNum( bWebView, bSet ); } break; -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS case FN_MAILMERGE_WIZARD: { // show the mailmerge wizard diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx index b2422fdd7bf4..74b5d03acccb 100644 --- a/sw/source/uibase/app/applab.cxx +++ b/sw/source/uibase/app/applab.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <hintids.hxx> @@ -139,7 +140,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel) static sal_uInt16 nLabelTitleNo = 0; static sal_uInt16 nBCTitleNo = 0; -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS // Create DB-Manager std::unique_ptr<SwDBManager, o3tl::default_delete<SwDBManager>> pDBManager(new SwDBManager(nullptr)); #endif @@ -154,7 +155,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel) SwAbstractDialogFactory* pDialogFactory = SwAbstractDialogFactory::Create(); ScopedVclPtr<AbstractSwLabDlg> pDlg(pDialogFactory->CreateSwLabDlg(rReq.GetFrameWeld(), aSet, -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS pDBManager.get(), #else NULL, diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index 4b7c1b0efde6..be64282036e6 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <cmdid.h> #include <hintids.hxx> @@ -1159,7 +1160,7 @@ bool SwFieldMgr::InsertField( case SwFieldTypesEnum::Database: { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS SwDBData aDBData; OUString sPar1; @@ -1215,7 +1216,7 @@ bool SwFieldMgr::InsertField( case SwFieldTypesEnum::DatabaseNextSet: case SwFieldTypesEnum::DatabaseName: { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS SwDBData aDBData; // extract DBName from rData.m_sPar1. Format: DBName.TableName.CommandType.ExpStrg diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 2b2af670ca6b..57b24745f97e 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <sal/config.h> @@ -3111,7 +3112,7 @@ void SwBaseShell::ExecField( SfxRequest const & rReq ) sal_uInt16 nSlot = rReq.GetSlot(); switch( nSlot ) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS case FN_CHANGE_DBFIELD: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx index 3cbccb21b834..b8eb61ea6c1a 100644 --- a/sw/source/uibase/uiview/uivwimp.cxx +++ b/sw/source/uibase/uiview/uivwimp.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <cmdid.h> @@ -73,7 +74,7 @@ SwView_Impl::~SwView_Impl() mxClipEvtLstnr->AddRemoveListener( false ); mxClipEvtLstnr->ViewDestroyed(); } -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS xConfigItem.reset(); #endif m_pDocInserter.reset(); diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index a38b6a8510d3..e867c27bd71f 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <com/sun/star/util/SearchAlgorithms2.hpp> #include <o3tl/any.hxx> @@ -1247,7 +1248,7 @@ void SwView::Execute(SfxRequest &rReq) GetViewFrame()->ToggleChildWindow(nSlot); //if fields have been successfully inserted call the "real" //mail merge dialog -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS SwWrtShell &rSh = GetWrtShell(); if(m_bInMailMerge && rSh.IsAnyDatabaseFieldInDoc()) { @@ -2547,7 +2548,7 @@ void SwView::EnableMailMerge() rBind.Update(FN_INSERT_FIELD_DATA_ONLY); } -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS namespace { @@ -2567,7 +2568,7 @@ namespace void SwView::GenerateFormLetter(bool bUseCurrentDocument) { -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS (void) bUseCurrentDocument; #else if(bUseCurrentDocument) diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index 8e5be528f6fa..db2019c99dba 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <sal/config.h> #include <sal/log.hxx> @@ -545,7 +546,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf break; case HANDLE_EMBEDDED_DATABASE_NAME: { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS OUString sEmbeddedName; if (rValue >>= sEmbeddedName) mpDoc->GetDBManager()->setEmbeddedName(sEmbeddedName, *mpDocSh); @@ -1171,7 +1172,7 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf break; case HANDLE_EMBEDDED_DATABASE_NAME: { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS rValue <<= mpDoc->GetDBManager()->getEmbeddedName(); #else rValue = uno::Any(); diff --git a/sw/source/uibase/uno/unodispatch.cxx b/sw/source/uibase/uno/unodispatch.cxx index 233b7a868885..d185f982ccfc 100644 --- a/sw/source/uibase/uno/unodispatch.cxx +++ b/sw/source/uibase/uno/unodispatch.cxx @@ -18,6 +18,7 @@ */ #include <config_features.h> +#include <config_fuzzers.h> #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> @@ -199,7 +200,7 @@ void SwXDispatch::dispatch(const util::URL& aURL, { if(!m_pView) throw uno::RuntimeException(); -#if !HAVE_FEATURE_DBCONNECTIVITY +#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS (void) aArgs; if (false) { diff --git a/sw/source/uibase/uno/unodoc.cxx b/sw/source/uibase/uno/unodoc.cxx index 0e47286f4bda..b525d2e366d3 100644 --- a/sw/source/uibase/uno/unodoc.cxx +++ b/sw/source/uibase/uno/unodoc.cxx @@ -19,6 +19,7 @@ #include <sal/config.h> #include <config_features.h> +#include <config_fuzzers.h> #include <sfx2/sfxmodelfactory.hxx> #include <swdll.hxx> @@ -78,7 +79,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SwXMailMerge_get_implementation(css::uno::XComponentContext*, css::uno::Sequence<css::uno::Any> const &) { -#if HAVE_FEATURE_DBCONNECTIVITY +#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS SolarMutexGuard aGuard; //the module may not be loaded