Kaydet (Commit) 98530f4d authored tarafından Muhammet Kara's avatar Muhammet Kara

Ensure settings consistency for default personas

Change-Id: I7610e890a8b49c50bf23ed07daa5517c33edcb8d
Reviewed-on: https://gerrit.libreoffice.org/60897
Tested-by: Jenkins
Reviewed-by: 's avatarMuhammet Kara <muhammet.kara@pardus.org.tr>
üst 2a052cc9
......@@ -450,21 +450,25 @@ void SvxPersonalizationTabPage::LoadDefaultImages()
while( aStream.IsOpen() && !aStream.eof() && nIndex < MAX_DEFAULT_PERSONAS )
{
OString aLine;
OUString aPersonaSetting, aPreviewFile;
sal_Int32 nPreviewIndex = 0;
aStream.ReadLine( aLine );
OUString aPersonaSetting( OStringToOUString( aLine, RTL_TEXTENCODING_UTF8 ) );
OUString aPreviewFile;
sal_Int32 nNewIndex = aPersonaSetting.indexOf( ';' );
if( nNewIndex < 0 )
aPersonaSetting = OStringToOUString( aLine, RTL_TEXTENCODING_UTF8 );
aPreviewFile = aPersonaSetting.getToken( 2, ';', nPreviewIndex );
if (aPreviewFile.isEmpty())
break;
aPreviewFile = aPersonaSetting.copy( 0, nNewIndex );
aPersonaSetting = aPersonaSetting.copy( nNewIndex + 1 );
// There is no room for the preview file in the PersonaSettings currently
aPersonaSetting = aPersonaSetting.replaceFirst( aPreviewFile + ";", "" );
m_vDefaultPersonaSettings.push_back( aPersonaSetting );
INetURLObject aURLObj( gallery + aPreviewFile );
aFilter.ImportGraphic( aGraphic, aURLObj );
BitmapEx aBmp = aGraphic.GetBitmapEx();
m_vDefaultPersonaImages[nIndex]->Show();
m_vDefaultPersonaImages[nIndex++]->SetModeImage( Image( aBmp ) );
m_vDefaultPersonaImages[nIndex]->SetModeImage( Image( aBmp ) );
m_vDefaultPersonaImages[nIndex++]->Show();
foundOne = true;
}
......
......@@ -62,6 +62,19 @@ public:
void CheckAppliedTheme();
void ShowAppliedThemeLabel( const OUString& );
/*
* Loads the default personas from the shared personas directory
* which resides in the shared gallery.
* There needs to be a separate subdirectory for each default persona,
* which includes the preview, header, and footer images.
* And there needs to be a personas_list.txt file in the personas directory
* which keeps the index/info of the default personas, one persona per line.
* A line should look like this:
* persona_slug;Persona Name;subdir/preview.jpg;subdir/header.jpg;subdir/footer.jpg;#textcolor;#accentcolor
* (It is recommended to keep the subdir name the same as the slug)
* Example line:
* abstract;Abstract;abstract/preview.jpg;abstract/Header2.jpg;abstract/Footer2.jpg;#ffffff;#000000
*/
void LoadDefaultImages();
void LoadExtensionThemes();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment