From 674faa559a18e5a040b9ee608f16b0ed52c0716d Mon Sep 17 00:00:00 2001 From: Rachit Gupta Date: Wed, 2 Jul 2014 14:01:59 +0530 Subject: Added feature of clearing the registry in case something goes wrong. If the installed extension is removed, then the persona settings in the registry are cleared to avoid odd look in the UI. Change-Id: Iaa99f4c87ec6ce4a663e1a3cebb3f8ff45e02079 --- vcl/source/app/settings.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 730c80ff1ce9..1ded48526553 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -2168,6 +2168,16 @@ static void setupPersonaHeaderFooter( WhichPersona eWhich, OUString& rHeaderFoot if ( rHeaderFooterBitmap.IsEmpty() ) rHeaderFooterBitmap = readBitmapEx( "$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" + aName ); } + + // Something went wrong. Probably, the images are missing. Clear the persona properties in the registry. + + if( rHeaderFooterBitmap.IsEmpty() ) + { + boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() ); + officecfg::Office::Common::Misc::Persona::set( "no", batch ); + officecfg::Office::Common::Misc::PersonaSettings::set( "", batch ); + batch->commit(); + } } const BitmapEx StyleSettings::GetPersonaHeader() const -- cgit