Use officecfg instead of SvtFilterOptions wrapper in sc

Change-Id: I8f8ff35452147fe83a772d87eb94e86b8877cac8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161590
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
This commit is contained in:
Gabor Kelemen
2024-01-05 19:02:00 +01:00
committed by Thorsten Behrens
parent e6f77135b4
commit df1e72b853
4 changed files with 16 additions and 21 deletions
+4 -5
View File
@@ -24,7 +24,7 @@
#include <scitems.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
#include <unotools/fltrcfg.hxx>
#include <officecfg/Office/Calc.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/objsh.hxx>
@@ -323,7 +323,6 @@ void ImportExcel8::ReadBasic()
{
ScDocShell* pShell = GetDocShell();
tools::SvRef<SotStorage> xRootStrg = GetRootStorage();
const SvtFilterOptions& rFilterOpt = SvtFilterOptions::Get();
if( !pShell || !xRootStrg.is() )
return;
@@ -331,9 +330,9 @@ void ImportExcel8::ReadBasic()
{
// #FIXME need to get rid of this, we can also do this from within oox
// via the "ooo.vba.VBAGlobals" service
if( ( rFilterOpt.IsLoadExcelBasicCode() ||
rFilterOpt.IsLoadExcelBasicStorage() ) &&
rFilterOpt.IsLoadExcelBasicExecutable() )
if( ( officecfg::Office::Calc::Filter::Import::VBA::Load::get() ||
officecfg::Office::Calc::Filter::Import::VBA::Save::get() ) &&
officecfg::Office::Calc::Filter::Import::VBA::Executable::get() )
{
// see if we have the XCB stream
tools::SvRef<SotStorageStream> xXCB = xRootStrg->OpenSotStream( "XCB", StreamMode::STD_READ );
+3 -5
View File
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <unotools/fltrcfg.hxx>
#include <osl/diagnose.h>
#include <sfx2/objsh.hxx>
#include <sfx2/docinf.hxx>
@@ -35,6 +33,7 @@
#include <xehelper.hxx>
#include <officecfg/Office/Calc.hxx>
#include <officecfg/Office/Common.hxx>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/frame/XModel.hpp>
@@ -82,8 +81,7 @@ ErrCode ExportBiff5::Write()
eVbaExportMode = VBAExportMode::FULL_EXPORT;
else
{
const SvtFilterOptions& rFilterOpt = SvtFilterOptions::Get();
if (rFilterOpt.IsLoadExcelBasicStorage())
if ( officecfg::Office::Calc::Filter::Import::VBA::Save::get() )
eVbaExportMode = VBAExportMode::REEXPORT_STREAM;
}
}
@@ -115,7 +113,7 @@ ErrCode ExportBiff5::Write()
static_cast<cppu::OWeakObject*>(pDocShell->GetModel()), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps
= xDPS->getDocumentProperties();
if ( SvtFilterOptions::Get().IsEnableCalcPreview() )
if ( officecfg::Office::Common::Filter::Microsoft::Export::EnableExcelPreview::get() )
{
std::shared_ptr<GDIMetaFile> xMetaFile =
pDocShell->GetPreviewMetaFile();
+4 -5
View File
@@ -42,9 +42,9 @@
#include <com/sun/star/frame/XModel.hpp>
#include <sfx2/objsh.hxx>
#include <officecfg/Office/Common.hxx>
#include <unotools/moduleoptions.hxx>
#include <comphelper/configuration.hxx>
#include <unotools/fltrcfg.hxx>
#include <vcl/dibtools.hxx>
#include <vcl/gdimtf.hxx>
#include <vcl/outdev.hxx>
@@ -3349,12 +3349,11 @@ XclImpDffConverter::XclImpDffConverter( const XclImpRoot& rRoot, SvStream& rDffS
mnOleImpFlags( 0 ),
mbNotifyMacroEventRead(false)
{
const SvtFilterOptions& rFilterOpt = SvtFilterOptions::Get();
if( rFilterOpt.IsMathType2Math() )
if( officecfg::Office::Common::Filter::Microsoft::Import::MathTypeToMath::get() )
mnOleImpFlags |= OLE_MATHTYPE_2_STARMATH;
if( rFilterOpt.IsWinWord2Writer() )
if( officecfg::Office::Common::Filter::Microsoft::Import::WinWordToWriter::get() )
mnOleImpFlags |= OLE_WINWORD_2_STARWRITER;
if( rFilterOpt.IsPowerPoint2Impress() )
if( officecfg::Office::Common::Filter::Microsoft::Import::PowerPointToImpress::get() )
mnOleImpFlags |= OLE_POWERPOINT_2_STARIMPRESS;
// try to open the 'Ctls' storage stream containing OCX control properties
+5 -6
View File
@@ -43,7 +43,6 @@
#include <xelink.hxx>
#include <xlcontent.hxx>
#include <unotools/fltrcfg.hxx>
#include <editeng/adjustitem.hxx>
#include <editeng/eeitem.hxx>
#include <filter/msfilter/msoleexp.hxx>
@@ -64,6 +63,7 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <sax/fastattribs.hxx>
#include <officecfg/Office/Common.hxx>
#include <oox/token/tokens.hxx>
#include <oox/token/namespaces.hxx>
#include <oox/token/relationship.hxx>
@@ -1027,17 +1027,16 @@ void XclObjOle::WriteSubRecs( XclExpStream& rStrm )
// set version to "old" version, because it must be
// saved in MS notation.
sal_uInt32 nFl = 0;
const SvtFilterOptions& rFltOpts = SvtFilterOptions::Get();
if( rFltOpts.IsMath2MathType() )
if( officecfg::Office::Common::Filter::Microsoft::Export::MathToMathType::get() )
nFl |= OLE_STARMATH_2_MATHTYPE;
if( rFltOpts.IsWriter2WinWord() )
if( officecfg::Office::Common::Filter::Microsoft::Export::WriterToWinWord::get() )
nFl |= OLE_STARWRITER_2_WINWORD;
if( rFltOpts.IsCalc2Excel() )
if( officecfg::Office::Common::Filter::Microsoft::Export::CalcToExcel::get() )
nFl |= OLE_STARCALC_2_EXCEL;
if( rFltOpts.IsImpress2PowerPoint() )
if( officecfg::Office::Common::Filter::Microsoft::Export::ImpressToPowerPoint::get() )
nFl |= OLE_STARIMPRESS_2_POWERPOINT;
SvxMSExportOLEObjects aOLEExpFilt( nFl );