include/unotools/fltrcfg.hxx | 3 - unotools/source/config/fltrcfg.cxx | 93 ++++++++++++++++++------------------- 2 files changed, 48 insertions(+), 48 deletions(-)
New commits: commit 5251a7c39c7c2ee6bc16965484913002d662d44d Author: Xisco Fauli <aniste...@gmail.com> Date: Sun May 29 20:42:46 2016 +0200 tdf#89329: use unique_ptr for pImpl in fltrcfg Change-Id: Icbb7d122d7f553215de562a98b0127764b30faa1 Reviewed-on: https://gerrit.libreoffice.org/25628 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/include/unotools/fltrcfg.hxx b/include/unotools/fltrcfg.hxx index ceb4d97..a6954ff 100644 --- a/include/unotools/fltrcfg.hxx +++ b/include/unotools/fltrcfg.hxx @@ -21,12 +21,13 @@ #include <unotools/unotoolsdllapi.h> #include <unotools/configitem.hxx> +#include <memory> struct SvtFilterOptions_Impl; class UNOTOOLS_DLLPUBLIC SvtFilterOptions : public utl::ConfigItem { private: - SvtFilterOptions_Impl* pImp; + std::unique_ptr<SvtFilterOptions_Impl> pImpl; const css::uno::Sequence<OUString>& GetPropertyNames(); diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx index 95fd797..6033578 100644 --- a/unotools/source/config/fltrcfg.cxx +++ b/unotools/source/config/fltrcfg.cxx @@ -293,7 +293,7 @@ bool SvtFilterOptions_Impl::IsFlag( sal_uLong nFlag ) const SvtFilterOptions::SvtFilterOptions() : ConfigItem( "Office.Common/Filter/Microsoft" ), - pImp(new SvtFilterOptions_Impl) + pImpl(new SvtFilterOptions_Impl) { EnableNotification(GetPropertyNames()); Load(); @@ -301,7 +301,6 @@ SvtFilterOptions::SvtFilterOptions() : SvtFilterOptions::~SvtFilterOptions() { - delete pImp; } const Sequence<OUString>& SvtFilterOptions::GetPropertyNames() @@ -374,7 +373,7 @@ void SvtFilterOptions::ImplCommit() for(int nProp = 0; nProp < aNames.getLength(); nProp++) { sal_uLong nFlag = lcl_GetFlag(nProp); - pValues[nProp] <<= pImp->IsFlag(nFlag); + pValues[nProp] <<= pImpl->IsFlag(nFlag); } PutProperties(aNames, aValues); @@ -382,7 +381,7 @@ void SvtFilterOptions::ImplCommit() void SvtFilterOptions::Load() { - pImp->Load(); + pImpl->Load(); const Sequence<OUString>& rNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(rNames); const Any* pValues = aValues.getConstArray(); @@ -395,7 +394,7 @@ void SvtFilterOptions::Load() { bool bVal = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); sal_uLong nFlag = lcl_GetFlag(nProp); - pImp->SetFlag( nFlag, bVal); + pImpl->SetFlag( nFlag, bVal); } } } @@ -403,193 +402,193 @@ void SvtFilterOptions::Load() void SvtFilterOptions::SetLoadWordBasicCode( bool bFlag ) { - pImp->SetFlag( FILTERCFG_WORD_CODE, bFlag ); + pImpl->SetFlag( FILTERCFG_WORD_CODE, bFlag ); SetModified(); } bool SvtFilterOptions::IsLoadWordBasicCode() const { - return pImp->IsFlag( FILTERCFG_WORD_CODE ); + return pImpl->IsFlag( FILTERCFG_WORD_CODE ); } void SvtFilterOptions::SetLoadWordBasicExecutable( bool bFlag ) { - pImp->SetFlag( FILTERCFG_WORD_WBCTBL, bFlag ); + pImpl->SetFlag( FILTERCFG_WORD_WBCTBL, bFlag ); SetModified(); } bool SvtFilterOptions::IsLoadWordBasicExecutable() const { - return pImp->IsFlag( FILTERCFG_WORD_WBCTBL ); + return pImpl->IsFlag( FILTERCFG_WORD_WBCTBL ); } void SvtFilterOptions::SetLoadWordBasicStorage( bool bFlag ) { - pImp->SetFlag( FILTERCFG_WORD_STORAGE, bFlag ); + pImpl->SetFlag( FILTERCFG_WORD_STORAGE, bFlag ); SetModified(); } bool SvtFilterOptions::IsLoadWordBasicStorage() const { - return pImp->IsFlag( FILTERCFG_WORD_STORAGE ); + return pImpl->IsFlag( FILTERCFG_WORD_STORAGE ); } void SvtFilterOptions::SetLoadExcelBasicCode( bool bFlag ) { - pImp->SetFlag( FILTERCFG_EXCEL_CODE, bFlag ); + pImpl->SetFlag( FILTERCFG_EXCEL_CODE, bFlag ); SetModified(); } bool SvtFilterOptions::IsLoadExcelBasicCode() const { - return pImp->IsFlag( FILTERCFG_EXCEL_CODE ); + return pImpl->IsFlag( FILTERCFG_EXCEL_CODE ); } void SvtFilterOptions::SetLoadExcelBasicExecutable( bool bFlag ) { - pImp->SetFlag( FILTERCFG_EXCEL_EXECTBL, bFlag ); + pImpl->SetFlag( FILTERCFG_EXCEL_EXECTBL, bFlag ); SetModified(); } bool SvtFilterOptions::IsLoadExcelBasicExecutable() const { - return pImp->IsFlag( FILTERCFG_EXCEL_EXECTBL ); + return pImpl->IsFlag( FILTERCFG_EXCEL_EXECTBL ); } void SvtFilterOptions::SetLoadExcelBasicStorage( bool bFlag ) { - pImp->SetFlag( FILTERCFG_EXCEL_STORAGE, bFlag ); + pImpl->SetFlag( FILTERCFG_EXCEL_STORAGE, bFlag ); SetModified(); } bool SvtFilterOptions::IsLoadExcelBasicStorage() const { - return pImp->IsFlag( FILTERCFG_EXCEL_STORAGE ); + return pImpl->IsFlag( FILTERCFG_EXCEL_STORAGE ); } void SvtFilterOptions::SetLoadPPointBasicCode( bool bFlag ) { - pImp->SetFlag( FILTERCFG_PPOINT_CODE, bFlag ); + pImpl->SetFlag( FILTERCFG_PPOINT_CODE, bFlag ); SetModified(); } bool SvtFilterOptions::IsLoadPPointBasicCode() const { - return pImp->IsFlag( FILTERCFG_PPOINT_CODE ); + return pImpl->IsFlag( FILTERCFG_PPOINT_CODE ); } void SvtFilterOptions::SetLoadPPointBasicStorage( bool bFlag ) { - pImp->SetFlag( FILTERCFG_PPOINT_STORAGE, bFlag ); + pImpl->SetFlag( FILTERCFG_PPOINT_STORAGE, bFlag ); SetModified(); } bool SvtFilterOptions::IsLoadPPointBasicStorage() const { - return pImp->IsFlag( FILTERCFG_PPOINT_STORAGE ); + return pImpl->IsFlag( FILTERCFG_PPOINT_STORAGE ); } bool SvtFilterOptions::IsMathType2Math() const { - return pImp->IsFlag( FILTERCFG_MATH_LOAD ); + return pImpl->IsFlag( FILTERCFG_MATH_LOAD ); } void SvtFilterOptions::SetMathType2Math( bool bFlag ) { - pImp->SetFlag( FILTERCFG_MATH_LOAD, bFlag ); + pImpl->SetFlag( FILTERCFG_MATH_LOAD, bFlag ); SetModified(); } bool SvtFilterOptions::IsMath2MathType() const { - return pImp->IsFlag( FILTERCFG_MATH_SAVE ); + return pImpl->IsFlag( FILTERCFG_MATH_SAVE ); } void SvtFilterOptions::SetMath2MathType( bool bFlag ) { - pImp->SetFlag( FILTERCFG_MATH_SAVE, bFlag ); + pImpl->SetFlag( FILTERCFG_MATH_SAVE, bFlag ); SetModified(); } bool SvtFilterOptions::IsWinWord2Writer() const { - return pImp->IsFlag( FILTERCFG_WRITER_LOAD ); + return pImpl->IsFlag( FILTERCFG_WRITER_LOAD ); } void SvtFilterOptions::SetWinWord2Writer( bool bFlag ) { - pImp->SetFlag( FILTERCFG_WRITER_LOAD, bFlag ); + pImpl->SetFlag( FILTERCFG_WRITER_LOAD, bFlag ); SetModified(); } bool SvtFilterOptions::IsWriter2WinWord() const { - return pImp->IsFlag( FILTERCFG_WRITER_SAVE ); + return pImpl->IsFlag( FILTERCFG_WRITER_SAVE ); } void SvtFilterOptions::SetWriter2WinWord( bool bFlag ) { - pImp->SetFlag( FILTERCFG_WRITER_SAVE, bFlag ); + pImpl->SetFlag( FILTERCFG_WRITER_SAVE, bFlag ); SetModified(); } bool SvtFilterOptions::IsUseEnhancedFields() const { - return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS ); + return pImpl->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS ); } bool SvtFilterOptions::IsExcel2Calc() const { - return pImp->IsFlag( FILTERCFG_CALC_LOAD ); + return pImpl->IsFlag( FILTERCFG_CALC_LOAD ); } void SvtFilterOptions::SetExcel2Calc( bool bFlag ) { - pImp->SetFlag( FILTERCFG_CALC_LOAD, bFlag ); + pImpl->SetFlag( FILTERCFG_CALC_LOAD, bFlag ); SetModified(); } bool SvtFilterOptions::IsCalc2Excel() const { - return pImp->IsFlag( FILTERCFG_CALC_SAVE ); + return pImpl->IsFlag( FILTERCFG_CALC_SAVE ); } void SvtFilterOptions::SetCalc2Excel( bool bFlag ) { - pImp->SetFlag( FILTERCFG_CALC_SAVE, bFlag ); + pImpl->SetFlag( FILTERCFG_CALC_SAVE, bFlag ); SetModified(); } bool SvtFilterOptions::IsPowerPoint2Impress() const { - return pImp->IsFlag( FILTERCFG_IMPRESS_LOAD ); + return pImpl->IsFlag( FILTERCFG_IMPRESS_LOAD ); } void SvtFilterOptions::SetPowerPoint2Impress( bool bFlag ) { - pImp->SetFlag( FILTERCFG_IMPRESS_LOAD, bFlag ); + pImpl->SetFlag( FILTERCFG_IMPRESS_LOAD, bFlag ); SetModified(); } bool SvtFilterOptions::IsImpress2PowerPoint() const { - return pImp->IsFlag( FILTERCFG_IMPRESS_SAVE ); + return pImpl->IsFlag( FILTERCFG_IMPRESS_SAVE ); } void SvtFilterOptions::SetImpress2PowerPoint( bool bFlag ) { - pImp->SetFlag( FILTERCFG_IMPRESS_SAVE, bFlag ); + pImpl->SetFlag( FILTERCFG_IMPRESS_SAVE, bFlag ); SetModified(); } bool SvtFilterOptions::IsSmartArt2Shape() const { - return pImp->IsFlag( FILTERCFG_SMARTART_SHAPE_LOAD ); + return pImpl->IsFlag( FILTERCFG_SMARTART_SHAPE_LOAD ); } void SvtFilterOptions::SetSmartArt2Shape( bool bFlag ) { - pImp->SetFlag( FILTERCFG_SMARTART_SHAPE_LOAD, bFlag ); + pImpl->SetFlag( FILTERCFG_SMARTART_SHAPE_LOAD, bFlag ); SetModified(); } @@ -608,39 +607,39 @@ SvtFilterOptions& SvtFilterOptions::Get() bool SvtFilterOptions::IsEnablePPTPreview() const { - return pImp->IsFlag( FILTERCFG_ENABLE_PPT_PREVIEW ); + return pImpl->IsFlag( FILTERCFG_ENABLE_PPT_PREVIEW ); } bool SvtFilterOptions::IsEnableCalcPreview() const { - return pImp->IsFlag( FILTERCFG_ENABLE_EXCEL_PREVIEW ); + return pImpl->IsFlag( FILTERCFG_ENABLE_EXCEL_PREVIEW ); } bool SvtFilterOptions::IsEnableWordPreview() const { - return pImp->IsFlag( FILTERCFG_ENABLE_WORD_PREVIEW ); + return pImpl->IsFlag( FILTERCFG_ENABLE_WORD_PREVIEW ); } bool SvtFilterOptions::IsCharBackground2Highlighting() const { - return pImp->IsFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING ); + return pImpl->IsFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING ); } bool SvtFilterOptions::IsCharBackground2Shading() const { - return !pImp->IsFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING ); + return !pImpl->IsFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING ); } void SvtFilterOptions::SetCharBackground2Highlighting() { - pImp->SetFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING, true ); + pImpl->SetFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING, true ); SetModified(); } void SvtFilterOptions::SetCharBackground2Shading() { - pImp->SetFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING, false ); + pImpl->SetFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING, false ); SetModified(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits