summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRachit Gupta <rachitgupta1792@gmail.com>2014-07-02 14:01:59 +0530
committerRachit Gupta <rachitgupta1792@gmail.com>2014-07-02 14:01:59 +0530
commit07fee9d02dfd96fb8719ce5b151f4c1199c90d8e (patch)
treea16aed8ff351ed1db491b7f44738194d49a38575
parenta848adedd0eb6adf46b7bb70734a4264bee53a87 (diff)
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
-rw-r--r--vcl/source/app/settings.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index fbcb7a667781..41a248404250 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -2163,6 +2163,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