summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/options/optfltr.cxx47
-rw-r--r--sc/source/filter/excel/excimp8.cxx8
-rw-r--r--sc/source/filter/excel/expop2.cxx10
-rw-r--r--sc/source/filter/excel/xiescher.cxx16
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx21
-rw-r--r--sd/source/filter/ppt/pptin.cxx25
-rw-r--r--sd/source/filter/sdpptwrp.cxx29
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx12
-rw-r--r--sw/source/filter/ww8/ww8par.cxx32
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx12
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx4
-rw-r--r--sw/source/ui/app/docsh.cxx6
-rw-r--r--unotools/inc/unotools/fltrcfg.hxx5
-rw-r--r--unotools/source/config/fltrcfg.cxx17
14 files changed, 114 insertions, 130 deletions
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index d9ccea223ef7..b5f33837ae1f 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -92,56 +92,55 @@ SfxTabPage* OfaMSFilterTabPage::Create( Window* pParent,
sal_Bool OfaMSFilterTabPage::FillItemSet( SfxItemSet& )
{
- SvtFilterOptions* pOpt = SvtFilterOptions::Get();
+ SvtFilterOptions& rOpt = SvtFilterOptions::Get();
sal_Bool bFlag;
if( aWBasicCodeCB.GetSavedValue() != (bFlag = aWBasicCodeCB.IsChecked()))
- pOpt->SetLoadWordBasicCode( bFlag );
+ rOpt.SetLoadWordBasicCode( bFlag );
if( aWBasicWbctblCB.GetSavedValue() != (bFlag = aWBasicWbctblCB.IsChecked()))
- pOpt->SetLoadWordBasicExecutable( bFlag );
+ rOpt.SetLoadWordBasicExecutable( bFlag );
if( aWBasicStgCB.GetSavedValue() != (bFlag = aWBasicStgCB.IsChecked()))
- pOpt->SetLoadWordBasicStorage( bFlag );
+ rOpt.SetLoadWordBasicStorage( bFlag );
if( aEBasicCodeCB.GetSavedValue() != (bFlag = aEBasicCodeCB.IsChecked()))
- pOpt->SetLoadExcelBasicCode( bFlag );
+ rOpt.SetLoadExcelBasicCode( bFlag );
if( aEBasicExectblCB.GetSavedValue() != (bFlag = aEBasicExectblCB.IsChecked()))
- pOpt->SetLoadExcelBasicExecutable( bFlag );
+ rOpt.SetLoadExcelBasicExecutable( bFlag );
if( aEBasicStgCB.GetSavedValue() != (bFlag = aEBasicStgCB.IsChecked()))
- pOpt->SetLoadExcelBasicStorage( bFlag );
+ rOpt.SetLoadExcelBasicStorage( bFlag );
if( aPBasicCodeCB.GetSavedValue() != (bFlag = aPBasicCodeCB.IsChecked()))
- pOpt->SetLoadPPointBasicCode( bFlag );
+ rOpt.SetLoadPPointBasicCode( bFlag );
if( aPBasicStgCB.GetSavedValue() != (bFlag = aPBasicStgCB.IsChecked()))
- pOpt->SetLoadPPointBasicStorage( bFlag );
+ rOpt.SetLoadPPointBasicStorage( bFlag );
return sal_False;
}
void OfaMSFilterTabPage::Reset( const SfxItemSet& )
{
- SvtFilterOptions* pOpt = SvtFilterOptions::Get();
+ const SvtFilterOptions& rOpt = SvtFilterOptions::Get();
- aWBasicCodeCB.Check( pOpt->IsLoadWordBasicCode() );
+ aWBasicCodeCB.Check( rOpt.IsLoadWordBasicCode() );
aWBasicCodeCB.SaveValue();
- aWBasicWbctblCB.Check( pOpt->IsLoadWordBasicExecutable() );
+ aWBasicWbctblCB.Check( rOpt.IsLoadWordBasicExecutable() );
aWBasicWbctblCB.SaveValue();
- aWBasicStgCB.Check( pOpt->IsLoadWordBasicStorage() );
+ aWBasicStgCB.Check( rOpt.IsLoadWordBasicStorage() );
aWBasicStgCB.SaveValue();
LoadWordBasicCheckHdl_Impl( &aWBasicCodeCB );
- aEBasicCodeCB.Check( pOpt->IsLoadExcelBasicCode() );
+ aEBasicCodeCB.Check( rOpt.IsLoadExcelBasicCode() );
aEBasicCodeCB.SaveValue();
- aEBasicExectblCB.Check( pOpt->IsLoadExcelBasicExecutable() );
+ aEBasicExectblCB.Check( rOpt.IsLoadExcelBasicExecutable() );
aEBasicExectblCB.SaveValue();
- aEBasicStgCB.Check( pOpt->IsLoadExcelBasicStorage() );
+ aEBasicStgCB.Check( rOpt.IsLoadExcelBasicStorage() );
aEBasicStgCB.SaveValue();
LoadExcelBasicCheckHdl_Impl( &aEBasicCodeCB );
- aPBasicCodeCB.Check( pOpt->IsLoadPPointBasicCode() );
+ aPBasicCodeCB.Check( rOpt.IsLoadPPointBasicCode() );
aPBasicCodeCB.SaveValue();
- aPBasicStgCB.Check( pOpt->IsLoadPPointBasicStorage() );
+ aPBasicStgCB.Check( rOpt.IsLoadPPointBasicStorage() );
aPBasicStgCB.SaveValue();
-
}
OfaMSFilterTabPage2::OfaMSFilterTabPage2( Window* pParent,
@@ -186,7 +185,7 @@ SfxTabPage* OfaMSFilterTabPage2::Create( Window* pParent,
sal_Bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet& )
{
- SvtFilterOptions* pOpt = SvtFilterOptions::Get();
+ SvtFilterOptions& rOpt = SvtFilterOptions::Get();
static struct ChkCBoxEntries{
MSFltrPg2_CheckBoxEntries eType;
@@ -227,8 +226,8 @@ sal_Bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet& )
bCheck = SV_BUTTON_CHECKED ==
pCheckButtonData->ConvertToButtonState( nButtonFlags );
- if( bCheck != (pOpt->*pArr->FnIs)() )
- (pOpt->*pArr->FnSet)( bCheck );
+ if( bCheck != (rOpt.*pArr->FnIs)() )
+ (rOpt.*pArr->FnSet)( bCheck );
}
}
}
@@ -238,7 +237,7 @@ sal_Bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet& )
void OfaMSFilterTabPage2::Reset( const SfxItemSet& )
{
- SvtFilterOptions* pOpt = SvtFilterOptions::Get();
+ SvtFilterOptions& rOpt = SvtFilterOptions::Get();
aCheckLB.SetUpdateMode(sal_False);
aCheckLB.Clear();
@@ -281,7 +280,7 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet& )
SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem( nCol ));
if( pItem && ((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON )
{
- if( (pOpt->*pArr->FnIs)() )
+ if( (rOpt.*pArr->FnIs)() )
pItem->SetStateChecked();
else
pItem->SetStateUnchecked();
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 801cdc594f10..6ede078c076f 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -328,12 +328,12 @@ void ImportExcel8::ReadBasic( void )
{
SfxObjectShell* pShell = GetDocShell();
SotStorageRef xRootStrg = GetRootStorage();
- SvtFilterOptions* pFilterOpt = SvtFilterOptions::Get();
+ const SvtFilterOptions& rFilterOpt = SvtFilterOptions::Get();
if( pShell && xRootStrg.Is() ) try
{
- bool bLoadCode = pFilterOpt->IsLoadExcelBasicCode();
- bool bLoadExecutable = pFilterOpt->IsLoadExcelBasicExecutable();
- bool bLoadStrg = pFilterOpt->IsLoadExcelBasicStorage();
+ bool bLoadCode = rFilterOpt.IsLoadExcelBasicCode();
+ bool bLoadExecutable = rFilterOpt.IsLoadExcelBasicExecutable();
+ bool bLoadStrg = rFilterOpt.IsLoadExcelBasicStorage();
// #FIXME need to get rid of this, we can also do this from within oox
// via the "ooo.vba.VBAGlobals" service
if( bLoadCode || bLoadStrg )
diff --git a/sc/source/filter/excel/expop2.cxx b/sc/source/filter/excel/expop2.cxx
index 553ab2e28794..f0f4e265d8c8 100644
--- a/sc/source/filter/excel/expop2.cxx
+++ b/sc/source/filter/excel/expop2.cxx
@@ -88,11 +88,9 @@ FltError ExportBiff5::Write()
bool bWriteBasicStrg = false;
if( GetBiff() == EXC_BIFF8 )
{
- if( SvtFilterOptions* pFilterOpt = SvtFilterOptions::Get() )
- {
- bWriteBasicCode = pFilterOpt->IsLoadExcelBasicCode();
- bWriteBasicStrg = pFilterOpt->IsLoadExcelBasicStorage();
- }
+ const SvtFilterOptions& rFilterOpt = SvtFilterOptions::Get();
+ bWriteBasicCode = rFilterOpt.IsLoadExcelBasicCode();
+ bWriteBasicStrg = rFilterOpt.IsLoadExcelBasicStorage();
}
if( pDocShell && xRootStrg.Is() && bWriteBasicStrg )
@@ -116,7 +114,7 @@ FltError ExportBiff5::Write()
pDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps
= xDPS->getDocumentProperties();
- if ( SvtFilterOptions::Get()->IsEnableCalcPreview() )
+ if ( SvtFilterOptions::Get().IsEnableCalcPreview() )
{
::boost::shared_ptr<GDIMetaFile> pMetaFile =
pDocShell->GetPreviewMetaFile (false);
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index bc186e039116..396c171bc196 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -3161,15 +3161,13 @@ XclImpDffConverter::XclImpDffConverter( const XclImpRoot& rRoot, SvStream& rDffS
maFormCtrlHelper( GetMedium().GetInputStream(), lcl_getUnoCtx(), GetDocShell()->GetModel() ),
mnOleImpFlags( 0 )
{
- if( SvtFilterOptions* pFilterOpt = SvtFilterOptions::Get() )
- {
- if( pFilterOpt->IsMathType2Math() )
- mnOleImpFlags |= OLE_MATHTYPE_2_STARMATH;
- if( pFilterOpt->IsWinWord2Writer() )
- mnOleImpFlags |= OLE_WINWORD_2_STARWRITER;
- if( pFilterOpt->IsPowerPoint2Impress() )
- mnOleImpFlags |= OLE_POWERPOINT_2_STARIMPRESS;
- }
+ const SvtFilterOptions& rFilterOpt = SvtFilterOptions::Get();
+ if( rFilterOpt.IsMathType2Math() )
+ mnOleImpFlags |= OLE_MATHTYPE_2_STARMATH;
+ if( rFilterOpt.IsWinWord2Writer() )
+ mnOleImpFlags |= OLE_WINWORD_2_STARWRITER;
+ if( rFilterOpt.IsPowerPoint2Impress() )
+ mnOleImpFlags |= OLE_POWERPOINT_2_STARIMPRESS;
// try to open the 'Ctls' storage stream containing OCX control properties
mxCtlsStrm = OpenStream( EXC_STREAM_CTLS );
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 17b9946d60db..00f0b63fe273 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -853,21 +853,18 @@ void XclObjOle::WriteSubRecs( XclExpStream& rStrm )
// set version to "old" version, because it must be
// saved in MS notation.
sal_uInt32 nFl = 0;
- SvtFilterOptions* pFltOpts = SvtFilterOptions::Get();
- if( pFltOpts )
- {
- if( pFltOpts->IsMath2MathType() )
- nFl |= OLE_STARMATH_2_MATHTYPE;
+ const SvtFilterOptions& rFltOpts = SvtFilterOptions::Get();
+ if( rFltOpts.IsMath2MathType() )
+ nFl |= OLE_STARMATH_2_MATHTYPE;
- if( pFltOpts->IsWriter2WinWord() )
- nFl |= OLE_STARWRITER_2_WINWORD;
+ if( rFltOpts.IsWriter2WinWord() )
+ nFl |= OLE_STARWRITER_2_WINWORD;
- if( pFltOpts->IsCalc2Excel() )
- nFl |= OLE_STARCALC_2_EXCEL;
+ if( rFltOpts.IsCalc2Excel() )
+ nFl |= OLE_STARCALC_2_EXCEL;
- if( pFltOpts->IsImpress2PowerPoint() )
- nFl |= OLE_STARIMPRESS_2_POWERPOINT;
- }
+ if( rFltOpts.IsImpress2PowerPoint() )
+ nFl |= OLE_STARIMPRESS_2_POWERPOINT;
SvxMSExportOLEObjects aOLEExpFilt( nFl );
aOLEExpFilt.ExportOLEObject( xObj, *xOleStg );
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index c2a7ea4d4006..bae84f0f735b 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -217,20 +217,17 @@ ImplSdPPTImport::ImplSdPPTImport( SdDrawDocument* pDocument, SvStorage& rStorage
}
sal_uInt32 nSvxMSDffOLEConvFlags2 = 0;
- SvtFilterOptions* pBasOpt = SvtFilterOptions::Get();
- if ( pBasOpt )
- {
- if ( pBasOpt->IsLoadPPointBasicCode() )
- mnFilterOptions |= 1;
- if ( pBasOpt->IsMathType2Math() )
- nSvxMSDffOLEConvFlags2 |= OLE_MATHTYPE_2_STARMATH;
- if ( pBasOpt->IsWinWord2Writer() )
- nSvxMSDffOLEConvFlags2 |= OLE_WINWORD_2_STARWRITER;
- if ( pBasOpt->IsExcel2Calc() )
- nSvxMSDffOLEConvFlags2 |= OLE_EXCEL_2_STARCALC;
- if ( pBasOpt->IsPowerPoint2Impress() )
- nSvxMSDffOLEConvFlags2 |= OLE_POWERPOINT_2_STARIMPRESS;
- }
+ const SvtFilterOptions& rBasOpt = SvtFilterOptions::Get();
+ if ( rBasOpt.IsLoadPPointBasicCode() )
+ mnFilterOptions |= 1;
+ if ( rBasOpt.IsMathType2Math() )
+ nSvxMSDffOLEConvFlags2 |= OLE_MATHTYPE_2_STARMATH;
+ if ( rBasOpt.IsWinWord2Writer() )
+ nSvxMSDffOLEConvFlags2 |= OLE_WINWORD_2_STARWRITER;
+ if ( rBasOpt.IsExcel2Calc() )
+ nSvxMSDffOLEConvFlags2 |= OLE_EXCEL_2_STARCALC;
+ if ( rBasOpt.IsPowerPoint2Impress() )
+ nSvxMSDffOLEConvFlags2 |= OLE_POWERPOINT_2_STARIMPRESS;
InitSvxMSDffManager( nDggContainerOfs, pStData, nSvxMSDffOLEConvFlags2 );
SetSvxMSDffSettings( SVXMSDFF_SETTINGS_CROP_BITMAPS
diff --git a/sd/source/filter/sdpptwrp.cxx b/sd/source/filter/sdpptwrp.cxx
index c87de890363c..62ddab21eea7 100644
--- a/sd/source/filter/sdpptwrp.cxx
+++ b/sd/source/filter/sdpptwrp.cxx
@@ -149,20 +149,17 @@ sal_Bool SdPPTFilter::Export()
if( PPTExport && xStorRef.Is() )
{
sal_uInt32 nCnvrtFlags = 0;
- SvtFilterOptions* pFilterOptions = SvtFilterOptions::Get();
- if ( pFilterOptions )
- {
- if ( pFilterOptions->IsMath2MathType() )
- nCnvrtFlags |= OLE_STARMATH_2_MATHTYPE;
- if ( pFilterOptions->IsWriter2WinWord() )
- nCnvrtFlags |= OLE_STARWRITER_2_WINWORD;
- if ( pFilterOptions->IsCalc2Excel() )
- nCnvrtFlags |= OLE_STARCALC_2_EXCEL;
- if ( pFilterOptions->IsImpress2PowerPoint() )
- nCnvrtFlags |= OLE_STARIMPRESS_2_POWERPOINT;
- if ( pFilterOptions->IsEnablePPTPreview() )
- nCnvrtFlags |= 0x8000;
- }
+ const SvtFilterOptions& rFilterOptions = SvtFilterOptions::Get();
+ if ( rFilterOptions.IsMath2MathType() )
+ nCnvrtFlags |= OLE_STARMATH_2_MATHTYPE;
+ if ( rFilterOptions.IsWriter2WinWord() )
+ nCnvrtFlags |= OLE_STARWRITER_2_WINWORD;
+ if ( rFilterOptions.IsCalc2Excel() )
+ nCnvrtFlags |= OLE_STARCALC_2_EXCEL;
+ if ( rFilterOptions.IsImpress2PowerPoint() )
+ nCnvrtFlags |= OLE_STARIMPRESS_2_POWERPOINT;
+ if ( rFilterOptions.IsEnablePPTPreview() )
+ nCnvrtFlags |= 0x8000;
mrDocument.SetSwapGraphicsMode( SDR_SWAPGRAPHICSMODE_TEMP );
@@ -180,8 +177,8 @@ sal_Bool SdPPTFilter::Export()
void SdPPTFilter::PreSaveBasic()
{
- SvtFilterOptions* pFilterOptions = SvtFilterOptions::Get();
- if( pFilterOptions && pFilterOptions->IsLoadPPointBasicStorage() )
+ const SvtFilterOptions& rFilterOptions = SvtFilterOptions::Get();
+ if( rFilterOptions.IsLoadPPointBasicStorage() )
{
::osl::Module* pLibrary = OpenLibrary( mrMedium.GetFilter()->GetUserData() );
if( pLibrary )
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 8a4f4b86649c..9dac88544b93 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2907,14 +2907,14 @@ void MSWordExportBase::ExportDocument( bool bWriteAll )
if ( !pOLEExp )
{
sal_uInt32 nSvxMSDffOLEConvFlags = 0;
- const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
- if ( pOpt->IsMath2MathType() )
+ const SvtFilterOptions& rOpt = SvtFilterOptions::Get();
+ if ( rOpt.IsMath2MathType() )
nSvxMSDffOLEConvFlags |= OLE_STARMATH_2_MATHTYPE;
- if ( pOpt->IsWriter2WinWord() )
+ if ( rOpt.IsWriter2WinWord() )
nSvxMSDffOLEConvFlags |= OLE_STARWRITER_2_WINWORD;
- if ( pOpt->IsCalc2Excel() )
+ if ( rOpt.IsCalc2Excel() )
nSvxMSDffOLEConvFlags |= OLE_STARCALC_2_EXCEL;
- if ( pOpt->IsImpress2PowerPoint() )
+ if ( rOpt.IsImpress2PowerPoint() )
nSvxMSDffOLEConvFlags |= OLE_STARIMPRESS_2_POWERPOINT;
pOLEExp = new SvxMSExportOLEObjects( nSvxMSDffOLEConvFlags );
@@ -3276,7 +3276,7 @@ void WW8Export::PrepareStorage()
if (xDocProps.is())
{
- if ( SvtFilterOptions::Get()->IsEnableWordPreview() )
+ if ( SvtFilterOptions::Get().IsEnableWordPreview() )
{
::boost::shared_ptr<GDIMetaFile> pMetaFile =
pDocShell->GetPreviewMetaFile (sal_False);
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 2ce7503130ff..663d80b7d38d 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -349,17 +349,15 @@ SwMSDffManager::SwMSDffManager( SwWW8ImplReader& rRdr )
sal_uInt32 SwMSDffManager::GetFilterFlags()
{
sal_uInt32 nFlags(0);
- if (const SvtFilterOptions* pOpt = SvtFilterOptions::Get())
- {
- if (pOpt->IsMathType2Math())
- nFlags |= OLE_MATHTYPE_2_STARMATH;
- if (pOpt->IsExcel2Calc())
- nFlags |= OLE_EXCEL_2_STARCALC;
- if (pOpt->IsPowerPoint2Impress())
- nFlags |= OLE_POWERPOINT_2_STARIMPRESS;
- if (pOpt->IsWinWord2Writer())
- nFlags |= OLE_WINWORD_2_STARWRITER;
- }
+ const SvtFilterOptions& rOpt = SvtFilterOptions::Get();
+ if (rOpt.IsMathType2Math())
+ nFlags |= OLE_MATHTYPE_2_STARMATH;
+ if (rOpt.IsExcel2Calc())
+ nFlags |= OLE_EXCEL_2_STARCALC;
+ if (rOpt.IsPowerPoint2Impress())
+ nFlags |= OLE_POWERPOINT_2_STARIMPRESS;
+ if (rOpt.IsWinWord2Writer())
+ nFlags |= OLE_WINWORD_2_STARWRITER;
return nFlags;
}
@@ -1643,11 +1641,9 @@ void SwWW8ImplReader::ImportDop()
mpDocShell->SetModifyPasswordHash(pWDop->lKeyProtDoc);
- const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
- sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
- if (bUseEnhFields) {
- rDoc.set(IDocumentSettingAccess::PROTECT_FORM, pWDop->fProtEnabled );
- }
+ const SvtFilterOptions& rOpt = SvtFilterOptions::Get();
+ if (rOpt.IsUseEnhancedFields())
+ rDoc.set(IDocumentSettingAccess::PROTECT_FORM, pWDop->fProtEnabled );
maTracer.LeaveEnvironment(sw::log::eDocumentProperties);
}
@@ -3897,8 +3893,8 @@ bool wwSectionManager::IsNewDoc() const
void wwSectionManager::InsertSegments()
{
- const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
- sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
+ const SvtFilterOptions& rOpt = SvtFilterOptions::Get();
+ sal_Bool bUseEnhFields = rOpt.IsUseEnhancedFields();
mySegIter aEnd = maSegments.end();
mySegIter aStart = maSegments.begin();
for (mySegIter aIter = aStart; aIter != aEnd; ++aIter)
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 1f3be72f6047..cd278c5889d1 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -133,8 +133,8 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, String& rStr )
text.
*/
- const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
- sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
+ const SvtFilterOptions& rOpt = SvtFilterOptions::Get();
+ sal_Bool bUseEnhFields = rOpt.IsUseEnhancedFields();
if (!bUseEnhFields) {
aFormula.sDefault = GetFieldResult(pF);
@@ -188,8 +188,8 @@ eF_ResT SwWW8ImplReader::Read_F_FormCheckBox( WW8FieldDesc* pF, String& rStr )
if (0x01 == rStr.GetChar(writer_cast<xub_StrLen>(pF->nLCode-1)))
ImportFormulaControl(aFormula,pF->nSCode+pF->nLCode-1, WW8_CT_CHECKBOX);
- const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
- sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
+ const SvtFilterOptions& rOpt = SvtFilterOptions::Get();
+ sal_Bool bUseEnhFields = rOpt.IsUseEnhancedFields();
if (!bUseEnhFields) {
pFormImpl->InsertFormula(aFormula);
@@ -245,8 +245,8 @@ eF_ResT SwWW8ImplReader::Read_F_FormListBox( WW8FieldDesc* pF, String& rStr)
if (0x01 == rStr.GetChar(writer_cast<xub_StrLen>(pF->nLCode-1)))
ImportFormulaControl(aFormula,pF->nSCode+pF->nLCode-1, WW8_CT_DROPDOWN);
- const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
- sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
+ const SvtFilterOptions& rOpt = SvtFilterOptions::Get();
+ sal_Bool bUseEnhFields = rOpt.IsUseEnhancedFields();
if (!bUseEnhFields)
{
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 0b654ae2efdf..9c87f1a5268d 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -677,8 +677,8 @@ sal_uInt16 SwWW8ImplReader::End_Field()
if (!pF || !pF->EndPosIsFieldEnd())
return nRet;
- const SvtFilterOptions* pOpt = SvtFilterOptions::Get();
- sal_Bool bUseEnhFields=(pOpt && pOpt->IsUseEnhancedFields());
+ const SvtFilterOptions &rOpt = SvtFilterOptions::Get();
+ sal_Bool bUseEnhFields = rOpt.IsUseEnhancedFields();
OSL_ENSURE(!maFieldStack.empty(), "Empty field stack\n");
if (!maFieldStack.empty())
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index cd1b81d58c40..0b3bec5c2fb3 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -345,7 +345,7 @@ sal_Bool SwDocShell::Save()
{
if( pDoc->ContainsMSVBasic() )
{
- if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() )
+ if( SvtFilterOptions::Get().IsLoadWordBasicStorage() )
nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) (*this) );
pDoc->SetContainsMSVBasic( sal_False );
}
@@ -465,7 +465,7 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium )
if( pDoc->ContainsMSVBasic() )
{
- if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() )
+ if( SvtFilterOptions::Get().IsLoadWordBasicStorage() )
nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) *this );
pDoc->SetContainsMSVBasic( sal_False );
}
@@ -559,7 +559,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
if( pDoc->ContainsMSVBasic() )
{
sal_Bool bSave = pFlt->GetUserData().EqualsAscii( "CWW8" )
- && SvtFilterOptions::Get()->IsLoadWordBasicStorage();
+ && SvtFilterOptions::Get().IsLoadWordBasicStorage();
if ( bSave )
{
diff --git a/unotools/inc/unotools/fltrcfg.hxx b/unotools/inc/unotools/fltrcfg.hxx
index e601804e6c53..cd581e6544fd 100644
--- a/unotools/inc/unotools/fltrcfg.hxx
+++ b/unotools/inc/unotools/fltrcfg.hxx
@@ -93,12 +93,9 @@ public:
sal_Bool IsEnableCalcPreview() const;
sal_Bool IsEnableWordPreview() const;
- static SvtFilterOptions* Get();
+ static SvtFilterOptions& Get();
};
#endif
-
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx
index 805a38f98620..5434ea569e5e 100644
--- a/unotools/source/config/fltrcfg.cxx
+++ b/unotools/source/config/fltrcfg.cxx
@@ -65,8 +65,6 @@ using ::rtl::OUString;
#define FILTERCFG_USE_ENHANCED_FIELDS 0x100000
#define FILTERCFG_WORD_WBCTBL 0x200000
-static SvtFilterOptions* pOptions=0;
-
class SvtAppFilterOptions_Impl : public utl::ConfigItem
{
sal_Bool bLoadVBA;
@@ -321,6 +319,7 @@ SvtFilterOptions::SvtFilterOptions() :
EnableNotification(GetPropertyNames());
Load();
}
+
// -----------------------------------------------------------------------
SvtFilterOptions::~SvtFilterOptions()
{
@@ -621,11 +620,17 @@ void SvtFilterOptions::SetImpress2PowerPoint( sal_Bool bFlag )
SetModified();
}
-SvtFilterOptions* SvtFilterOptions::Get()
+namespace
+{
+ class theFilterOptions
+ : public rtl::Static<SvtFilterOptions, theFilterOptions>
+ {
+ };
+}
+
+SvtFilterOptions& SvtFilterOptions::Get()
{
- if ( !pOptions )
- pOptions = new SvtFilterOptions;
- return pOptions;
+ return theFilterOptions::get();
}
// -----------------------------------------------------------------------