diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-07 16:21:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-08 11:26:11 +0200 |
commit | 674416a2f16dfa050a23f2b1f0b749214ea1f2a6 (patch) | |
tree | 068b1d4f3f247ab214151696e1deeed9eada448c | |
parent | 3ef76067bfa1f9f60ec3989bd6b40a5760137903 (diff) |
tdf#118731 delay on showing dialogs that create SdrModels
for their preview widgets. since...
commit 4be44a7a6f2f480e55255d7cdd119f3d6577d085
Date: Thu May 24 19:09:44 2018 +0200
SOSAW080: Cleanup of SdrModel
Change-Id: I102b64bdacc56a41091bbe60e932c2915f20323f
Reviewed-on: https://gerrit.libreoffice.org/58693
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
-rw-r--r-- | cui/source/tabpages/tpline.cxx | 4 | ||||
-rw-r--r-- | include/svx/svdmodel.hxx | 11 | ||||
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/graphctl.cxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/measctrl.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdmodel.cxx | 14 |
6 files changed, 22 insertions, 15 deletions
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index 5a633ac06dd1..f8c8a8b8fa8e 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -335,7 +335,7 @@ void SvxLineTabPage::InitSymbols(MenuButton const * pButton) ScopedVclPtrInstance< VirtualDevice > pVDev; pVDev->SetMapMode(MapMode(MapUnit::Map100thMM)); std::unique_ptr<SdrModel> pModel( - new SdrModel()); + new SdrModel(nullptr, nullptr, true)); pModel->GetItemPool().FreezeIdRanges(); // Page SdrPage* pPage = new SdrPage( *pModel, false ); @@ -1112,7 +1112,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) pVDev->SetMapMode(MapMode(MapUnit::Map100thMM)); std::unique_ptr<SdrModel> pModel( - new SdrModel()); + new SdrModel(nullptr, nullptr, true)); pModel->GetItemPool().FreezeIdRanges(); SdrPage* pPage = new SdrPage( *pModel, false ); pPage->SetSize(Size(1000,1000)); diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 127bf4ed985f..62bb9dd51533 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -270,11 +270,12 @@ private: SVX_DLLPRIVATE void ImpSetOutlinerDefaults( SdrOutliner* pOutliner, bool bInit = false ); SVX_DLLPRIVATE void ImpReformatAllTextObjects(); SVX_DLLPRIVATE void ImpReformatAllEdgeObjects(); - SVX_DLLPRIVATE void ImpCreateTables(); + SVX_DLLPRIVATE void ImpCreateTables(bool bDisablePropertyFiles); SVX_DLLPRIVATE void ImpCtor( SfxItemPool* pPool, - ::comphelper::IEmbeddedHelper* pPers); + ::comphelper::IEmbeddedHelper* pPers, + bool bDisablePropertyFiles); // this is a weak reference to a possible living api wrapper for this model css::uno::Reference< css::uno::XInterface > mxUnoModel; @@ -293,9 +294,13 @@ public: // if you want to use symbol objects inherited from SdrAttrObj. // If, however, you use objects inheriting from SdrObject you are free // to chose a pool of your liking. + // + // tdf#118731 a bDisablePropertyFiles of true will disable ability to load + // XPropertyFiles describing defaults. Useful for UI preview widgets explicit SdrModel( SfxItemPool* pPool = nullptr, - ::comphelper::IEmbeddedHelper* pPers = nullptr); + ::comphelper::IEmbeddedHelper* pPers = nullptr, + bool bDisablePropertyFiles = false); virtual ~SdrModel() override; void ClearModel(bool bCalledFromDestructor); diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index e482f1f0a494..6f757f1ec62b 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1786,7 +1786,7 @@ void SvxPreviewBase::InitSettings(bool bForeground, bool bBackground) SvxPreviewBase::SvxPreviewBase(vcl::Window* pParent) : Control(pParent, WB_BORDER) - , mpModel(new SdrModel()) + , mpModel(new SdrModel(nullptr, nullptr, true)) , mpBufferDevice(VclPtr<VirtualDevice>::Create(*this)) { // Draw the control's border as a flat thin black line. @@ -2189,7 +2189,7 @@ void PreviewBase::InitSettings() } PreviewBase::PreviewBase() - : mpModel(new SdrModel()) + : mpModel(new SdrModel(nullptr, nullptr, true)) { // init model mpModel->GetItemPool().FreezeIdRanges(); diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index 0f9325232f01..17d416d3ad94 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -120,7 +120,7 @@ void GraphCtrl::InitSdrModel() pModel.reset(); // Creating a Model - pModel.reset(new SdrModel()); + pModel.reset(new SdrModel(nullptr, nullptr, true)); pModel->GetItemPool().FreezeIdRanges(); pModel->SetScaleUnit( aMap100.GetMapUnit() ); pModel->SetScaleFraction( Fraction( 1, 1 ) ); diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx index 2aa183ecaa1a..578a49ceb6e3 100644 --- a/svx/source/dialog/measctrl.cxx +++ b/svx/source/dialog/measctrl.cxx @@ -41,7 +41,7 @@ SvxXMeasurePreview::SvxXMeasurePreview(vcl::Window* pParent, WinBits nStyle) Point aPt1 = Point(aSize.Width() / 5, static_cast<long>(aSize.Height() / 2)); Point aPt2 = Point(aSize.Width() * 4 / 5, static_cast<long>(aSize.Height() / 2)); - pModel.reset(new SdrModel()); + pModel.reset(new SdrModel(nullptr, nullptr, true)); pMeasureObj = new SdrMeasureObj( *pModel, aPt1, diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index a63401dc88e7..4889328cbf57 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -100,7 +100,8 @@ struct SdrModelImpl void SdrModel::ImpCtor( SfxItemPool* pPool, - ::comphelper::IEmbeddedHelper* _pEmbeddedHelper) + ::comphelper::IEmbeddedHelper* _pEmbeddedHelper, + bool bDisablePropertyFiles) { mpImpl.reset(new SdrModelImpl); mpImpl->mpUndoManager=nullptr; @@ -198,12 +199,13 @@ void SdrModel::ImpCtor( pTextChain.reset(new TextChain); /* End Text Chaining related code */ - ImpCreateTables(); + ImpCreateTables(bDisablePropertyFiles || utl::ConfigManager::IsFuzzing()); } SdrModel::SdrModel( SfxItemPool* pPool, - ::comphelper::IEmbeddedHelper* pPers) + ::comphelper::IEmbeddedHelper* pPers, + bool bDisablePropertyFiles) : #ifdef DBG_UTIL // SdrObjectLifetimeWatchDog: @@ -212,7 +214,7 @@ SdrModel::SdrModel( maMaPag(), maPages() { - ImpCtor(pPool,pPers); + ImpCtor(pPool,pPers,bDisablePropertyFiles); } SdrModel::~SdrModel() @@ -606,10 +608,10 @@ bool SdrModel::IsUndoEnabled() const } } -void SdrModel::ImpCreateTables() +void SdrModel::ImpCreateTables(bool bDisablePropertyFiles) { // use standard path for initial construction - const OUString aTablePath(!utl::ConfigManager::IsFuzzing() ? SvtPathOptions().GetPalettePath() : ""); + const OUString aTablePath(!bDisablePropertyFiles ? SvtPathOptions().GetPalettePath() : ""); for( auto i : o3tl::enumrange<XPropertyListType>() ) { |