Kaydet (Commit) e0deec25 authored tarafından Michael Meeks's avatar Michael Meeks

gengal: theme creation fix.

Change-Id: I72544e2bea45cf3f83e944aee9ca95676f1879c1
üst 8a3eab7b
...@@ -63,8 +63,8 @@ void disposeGallery( Gallery* pGallery ) ...@@ -63,8 +63,8 @@ void disposeGallery( Gallery* pGallery )
} }
static void createTheme( OUString aThemeName, OUString aGalleryURL, static void createTheme( OUString aThemeName, OUString aGalleryURL,
OUString aDestDir, sal_uInt32 nNumFrom, OUString aDestDir, FileNameList &rFiles,
FileNameList &rFiles, bool bRelativeURLs ) bool bRelativeURLs )
{ {
Gallery* pGallery; Gallery* pGallery;
...@@ -82,7 +82,7 @@ static void createTheme( OUString aThemeName, OUString aGalleryURL, ...@@ -82,7 +82,7 @@ static void createTheme( OUString aThemeName, OUString aGalleryURL,
GalleryTheme *pGalTheme; GalleryTheme *pGalTheme;
if( !pGallery->HasTheme( aThemeName) ) { if( !pGallery->HasTheme( aThemeName) ) {
if( !pGallery->CreateTheme( aThemeName, nNumFrom ) ) { if( !pGallery->CreateTheme( aThemeName ) ) {
fprintf( stderr, "Failed to create theme\n" ); fprintf( stderr, "Failed to create theme\n" );
exit( 1 ); exit( 1 );
} }
...@@ -131,7 +131,7 @@ static int PrintHelp() ...@@ -131,7 +131,7 @@ static int PrintHelp()
fprintf( stdout, "Utility to generate LibreOffice gallery files\n\n" ); fprintf( stdout, "Utility to generate LibreOffice gallery files\n\n" );
fprintf( stdout, "using: gengal --name <name> --path <dir> [ --destdir <path> ]\n"); fprintf( stdout, "using: gengal --name <name> --path <dir> [ --destdir <path> ]\n");
fprintf( stdout, " [ --number-from <num> ] [ files ... ]\n\n" ); fprintf( stdout, " [ files ... ]\n\n" );
fprintf( stdout, "options:\n"); fprintf( stdout, "options:\n");
fprintf( stdout, " --name <theme>\t\tdefines the user visible name of the created or updated theme.\n"); fprintf( stdout, " --name <theme>\t\tdefines the user visible name of the created or updated theme.\n");
...@@ -145,7 +145,6 @@ static int PrintHelp() ...@@ -145,7 +145,6 @@ static int PrintHelp()
fprintf( stdout, " --relative-urls\t\tflags that after removing the destdir, the URL should be a path relative to the gallery folder in the install\n"); fprintf( stdout, " --relative-urls\t\tflags that after removing the destdir, the URL should be a path relative to the gallery folder in the install\n");
fprintf( stdout, "\t\t\tprimarily used for internal gallery generation at compile time.\n"); fprintf( stdout, "\t\t\tprimarily used for internal gallery generation at compile time.\n");
fprintf( stdout, " --number-from <num>\tdefines minimal number for the newly created gallery\n");
fprintf( stdout, "\t\t\ttheme files.\n"); fprintf( stdout, "\t\t\ttheme files.\n");
fprintf( stdout, " files\t\t\tlists files to be added to the gallery. Absolute paths\n"); fprintf( stdout, " files\t\t\tlists files to be added to the gallery. Absolute paths\n");
fprintf( stdout, "\t\t\tare required.\n"); fprintf( stdout, "\t\t\tare required.\n");
...@@ -206,7 +205,6 @@ int GalApp::Main() ...@@ -206,7 +205,6 @@ int GalApp::Main()
{ {
OUString aPath, aDestDir; OUString aPath, aDestDir;
OUString aName( "Default name" ); OUString aName( "Default name" );
sal_uInt32 nNumFrom = 0;
FileNameList aFiles; FileNameList aFiles;
for( sal_uInt32 i = 0; i < GetCommandLineParamCount(); i++ ) for( sal_uInt32 i = 0; i < GetCommandLineParamCount(); i++ )
...@@ -231,7 +229,8 @@ int GalApp::Main() ...@@ -231,7 +229,8 @@ int GalApp::Main()
else if ( aParam == "--relative-urls" ) else if ( aParam == "--relative-urls" )
mbRelativeURLs = true; mbRelativeURLs = true;
else if ( aParam == "--number-from" ) else if ( aParam == "--number-from" )
nNumFrom = GetCommandLineParam( ++i ).ToInt32(); fprintf ( stderr, "--number-from is deprecated, themes now "
"have filenames based on their names\n" );
else else
aFiles.push_back( Smartify( aParam ) ); aFiles.push_back( Smartify( aParam ) );
} }
...@@ -239,7 +238,7 @@ int GalApp::Main() ...@@ -239,7 +238,7 @@ int GalApp::Main()
if( aFiles.size() < 1 ) if( aFiles.size() < 1 )
return PrintHelp(); return PrintHelp();
createTheme( aName, aPath, aDestDir, nNumFrom, aFiles, mbRelativeURLs ); createTheme( aName, aPath, aDestDir, aFiles, mbRelativeURLs );
// Without this we get extraordinary crashes from the // Without this we get extraordinary crashes from the
// drawinglayer VirtualDevice cache when importing svg // drawinglayer VirtualDevice cache when importing svg
......
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