diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-25 15:26:21 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-25 15:28:39 +0100 |
commit | 637bb5adf7593c26e17e83482e42ccb8fac845a8 (patch) | |
tree | cb6dde53b93d51bc5cb7bdcc6ae466e09a25552c /framework | |
parent | ddb73c61377ad44baaa83ea92b4445e31b6f58bb (diff) |
Resolves: fdo#79178 Crash when opening a form created with a previous version
A regression from c2c530da69152ff9192b9726aa95961803ce9b29 I think. Rework
this to follow the same ctor + init pattern as the others
move the fillCache out of the ctor to acquire the obj first, then
call the extra init before returning it
Change-Id: Ia0dc878654780294a4935f07ac70c4358ca51dfc
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/accelerators/documentacceleratorconfiguration.cxx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/framework/source/accelerators/documentacceleratorconfiguration.cxx b/framework/source/accelerators/documentacceleratorconfiguration.cxx index 9e72199bc460..d0564c5a625e 100644 --- a/framework/source/accelerators/documentacceleratorconfiguration.cxx +++ b/framework/source/accelerators/documentacceleratorconfiguration.cxx @@ -98,14 +98,14 @@ public: virtual sal_Bool SAL_CALL hasStorage() throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE; -private: - /** read all data into the cache. */ - void impl_ts_fillCache(); + void fillCache(); + +private: /** forget all currently cached data AND(!) forget all currently used storages. */ - void impl_ts_clearCache(); + void clearCache(); }; DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration( @@ -128,8 +128,6 @@ DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration( css::uno::Reference< css::embed::XStorage >()); } } - - impl_ts_fillCache(); } DocumentAcceleratorConfiguration::~DocumentAcceleratorConfiguration() @@ -150,10 +148,10 @@ void SAL_CALL DocumentAcceleratorConfiguration::setStorage(const css::uno::Refer } if (bForgetOldStorages) - impl_ts_clearCache(); + clearCache(); if (xStorage.is()) - impl_ts_fillCache(); + fillCache(); } sal_Bool SAL_CALL DocumentAcceleratorConfiguration::hasStorage() @@ -163,7 +161,7 @@ sal_Bool SAL_CALL DocumentAcceleratorConfiguration::hasStorage() return m_xDocumentRoot.is(); } -void DocumentAcceleratorConfiguration::impl_ts_fillCache() +void DocumentAcceleratorConfiguration::fillCache() { css::uno::Reference< css::embed::XStorage > xDocumentRoot; { @@ -203,7 +201,7 @@ void DocumentAcceleratorConfiguration::impl_ts_fillCache() {} } -void DocumentAcceleratorConfiguration::impl_ts_clearCache() +void DocumentAcceleratorConfiguration::clearCache() { m_aPresetHandler.forgetCachedStorages(); } @@ -215,7 +213,12 @@ com_sun_star_comp_framework_DocumentAcceleratorConfiguration_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence<css::uno::Any> const &arguments) { - return cppu::acquire(new DocumentAcceleratorConfiguration(context, arguments)); + DocumentAcceleratorConfiguration *inst = new DocumentAcceleratorConfiguration(context, arguments); + css::uno::XInterface *acquired_inst = cppu::acquire(inst); + + inst->fillCache(); + + return acquired_inst; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |