This patch must be used together with sd-export-html-translations.diff.

Index: inc/resltn.hxx
===================================================================
RCS file: /cvs/graphics/sd/inc/resltn.hxx,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 resltn.hxx
--- sd/inc/resltn.hxx	18 Sep 2000 16:48:28 -0000	1.1.1.1
+++ sd/inc/resltn.hxx	9 Jun 2004 04:36:03 -0000
@@ -71,8 +71,8 @@
 
 enum PublishingFormat
 {
-	FORMAT_GIF,
-	FORMAT_JPG
+	FORMAT_JPG = 1,
+	FORMAT_PNG = 2
 };
 
 enum PublishingScript
Index: source/filter/html/htmlex.cxx
===================================================================
RCS file: /cvs/graphics/sd/source/filter/html/htmlex.cxx,v
retrieving revision 1.10
diff -u -r1.10 htmlex.cxx
--- sd/source/filter/html/htmlex.cxx	4 Jun 2003 11:02:23 -0000	1.10
+++ sd/source/filter/html/htmlex.cxx	9 Jun 2004 04:36:06 -0000
@@ -222,6 +222,7 @@
 #include "imapinfo.hxx"
 #include "sdresid.hxx"
 #include "htmlex.hxx"
+#include "htmltheme.hxx"
 
 using namespace ::rtl;
 using namespace ::com::sun::star;
@@ -1077,7 +1078,7 @@
 		Sequence< PropertyValue > aDescriptor( 3 );
 		aDescriptor[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("URL") );
 		aDescriptor[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("FilterName") );
-		aDescriptor[1].Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM(m_eFormat==FORMAT_GIF ? "GIF" : "JPG") );
+		aDescriptor[1].Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM(m_eFormat==FORMAT_JPG ? "JPG" : "PNG") );
 		aDescriptor[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("FilterData") );
 		aDescriptor[2].Value <<= aFilterData;
 
@@ -2116,10 +2117,10 @@
 
 		pName = new String( RTL_CONSTASCII_USTRINGPARAM("img") );
 		*pName += String::CreateFromInt32(nSdPage);
-		if( m_eFormat==FORMAT_GIF )
-            pName->AppendAscii( ".gif" );
+		if( m_eFormat!=FORMAT_JPG )
+			pName->AppendAscii( ".png" );
 		else
-            pName->AppendAscii( ".jpg" );
+			pName->AppendAscii( ".jpg" );
 
 		m_pImageFiles[nSdPage] = pName;
 
@@ -2679,10 +2680,7 @@
 
     if(m_nButtonThema != -1)
     {
-        if( GalleryExplorer::BeginLocking( GALLERY_THEME_HTMLBUTTONS ) )
-        {
             Graphic aButton;
-            INT16 nButtons = m_nButtonThema * NUM_BUTTONS;
             for( INT16 nButton = 0; nButton < NUM_BUTTONS && nErr == 0; nButton++ )
             {
                 if(!m_bFrames && (nButton == BTN_MORE || nButton == BTN_LESS))
@@ -2691,11 +2689,8 @@
                 if(!m_bImpress && (nButton == BTN_TEXT || nButton == BTN_MORE || nButton == BTN_LESS ))
                     continue;
 
-                nErr = CreateBitmap(GALLERY_THEME_HTMLBUTTONS, nButtons + nButton, GetButtonName(nButton));
+                nErr = CreateBitmap(m_nButtonThema, nButton, GetButtonName(nButton));
             }
-
-            GalleryExplorer::EndLocking( GALLERY_THEME_HTMLBUTTONS );
-        }
     }
 
 	if( nErr != 0 )
@@ -2709,28 +2704,31 @@
 // ====================================================================
 ULONG HtmlExport::CreateBitmap( ULONG nThemeId, INT16 nImage, const String& aName ) const
 {
+	SdHtmlTheme aTheme = SdHtmlTheme::getTheme();
+
 	String aFull(m_aExportPath);
 	aFull += aName;
 
-	Graphic aGraphic;
 	EasyFile aFile;
 	String aJPG;
 	SvStream* pStrm;
 	ULONG nErr = aFile.createStream(aFull, pStrm);
 	if(nErr == 0)
 	{
-		nErr = GalleryExplorer::GetGraphicObj( nThemeId, nImage, &aGraphic )?0:1;
-		if( nErr == 0 )
+		BitmapEx aBitmap;
+
+		nErr = aTheme.getBitmap( nThemeId, nImage, aBitmap );
+
+		if (nErr == 0)
 		{
 			if( m_bUserAttr || m_bDocColors )
 			{
-				BitmapEx aBitmap( aGraphic.GetBitmapEx() );
-
-				if( aBitmap.GetTransparentType() != TRANSPARENT_NONE )
+				if( aBitmap.GetTransparentType() != TRANSPARENT_NONE &&
+				   m_eFormat != FORMAT_PNG )
 					SmoothBitmap( aBitmap, m_bUserAttr?m_aBackColor:m_aFirstPageColor );
-				aGraphic = Graphic( aBitmap );
 			}
-			nErr = GraphicConverter::Export( *pStrm, aGraphic, CVT_GIF );
+			Graphic aGraphic = aBitmap;
+			nErr = GraphicConverter::Export( *pStrm, aGraphic, m_eFormat==FORMAT_JPG?CVT_JPG:CVT_PNG );
 		}
 
 		if( nErr == 0 )
@@ -3455,6 +3453,16 @@
 {
 	String aName;
 	aName.AssignAscii( pButtonNames[nButton] );
+	
+	xub_StrLen nExtnOffset;
+	if ( ( nExtnOffset = aName.SearchBackward( '.' ) ) > 0 ) {
+		aName.Erase( nExtnOffset );
+		if (m_eFormat != FORMAT_PNG)
+			aName += String::CreateFromAscii( ".jpg" );
+		else
+			aName += String::CreateFromAscii( ".png" );
+	}
+
 	return aName;
 }
 
Index: source/filter/html/pubdlg.cxx
===================================================================
RCS file: /cvs/graphics/sd/source/filter/html/pubdlg.cxx,v
retrieving revision 1.3
diff -u -r1.3 pubdlg.cxx
--- sd/source/filter/html/pubdlg.cxx	16 Jul 2002 08:13:01 -0000	1.3
+++ sd/source/filter/html/pubdlg.cxx	9 Jun 2004 04:36:07 -0000
@@ -149,6 +149,7 @@
 #include "htmlattr.hxx"
 #include "htmlex.hxx"
 #include "helpids.h"
+#include "htmltheme.hxx"
 
 using namespace std;
 using namespace rtl;
@@ -509,7 +510,7 @@
 	pPage2_Index->SetText(aText);
 	pPage2_CGI->SetText( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "/cgi-bin/" ) ) );
 
-	pPage3_Gif->SetClickHdl(LINK(this,SdPublishingDlg, GfxFormatHdl));
+	pPage3_Png->SetClickHdl(LINK(this,SdPublishingDlg, GfxFormatHdl));
 	pPage3_Jpg->SetClickHdl(LINK(this,SdPublishingDlg, GfxFormatHdl));
 
 	pPage3_Resolution_1->SetClickHdl(LINK(this,SdPublishingDlg, ResolutionHdl ));
@@ -663,7 +664,7 @@
 	aAssistentFunc.InsertControl(3,
 		pPage3_Titel1 = new FixedLine(this,SdResId(PAGE3_TITEL_1)));
 	aAssistentFunc.InsertControl(3,
-		pPage3_Gif = new RadioButton(this,SdResId(PAGE3_GIF)));
+		pPage3_Png = new RadioButton(this,SdResId(PAGE3_PNG)));
 	aAssistentFunc.InsertControl(3,
 		pPage3_Jpg = new RadioButton(this,SdResId(PAGE3_JPG)));
 	aAssistentFunc.InsertControl(3,
@@ -721,6 +722,7 @@
 		pPage5_TextOnly = new CheckBox(this, SdResId(PAGE5_TEXTONLY)));
 	aAssistentFunc.InsertControl(5,
 		pPage5_Buttons = new ValueSet(this,SdResId(PAGE5_BUTTONS)));
+	pPage5_Buttons->SetStyle(pPage5_Buttons->GetStyle() | WB_VSCROLL);
 
 	// Seite 6
 	aAssistentFunc.InsertControl(6,
@@ -814,7 +816,7 @@
 
 	delete pPage3_Bmp;
 	delete pPage3_Titel1;
-	delete pPage3_Gif;
+	delete pPage3_Png;
 	delete pPage3_Jpg;
 	delete pPage3_Quality_txt;
 	delete pPage3_Quality;
@@ -944,7 +946,7 @@
 	aProps.push_back( aValue );
 
 	aValue.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Format" ) );
-	aValue.Value <<= (sal_Int32)(pPage3_Gif->IsChecked()?FORMAT_GIF:FORMAT_JPG);
+	aValue.Value <<= (sal_Int32)(pPage3_Png->IsChecked()?FORMAT_PNG:FORMAT_JPG);
 	aProps.push_back( aValue );
 
 	// Page 4
@@ -980,7 +982,7 @@
 	if( !pPage5_TextOnly->IsChecked() )
 	{
 		aValue.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UseButtonSet" ) );
-		aValue.Value <<= (sal_Int32)(pPage5_Buttons->GetSelectItemId() - 1);
+		aValue.Value <<= (sal_Int32)(pPage5_Buttons->GetSelectItemId());
 		aProps.push_back( aValue );
 	}
 
@@ -1128,10 +1130,10 @@
 // =====================================================================
 IMPL_LINK( SdPublishingDlg, GfxFormatHdl, RadioButton *, pButton )
 {
-	if(pButton == pPage3_Gif)
+	if(pButton == pPage3_Png)
 		pPage3_Jpg->Check(FALSE);
 	else
-		pPage3_Gif->Check(FALSE);
+		pPage3_Png->Check(FALSE);
 
 	pPage3_Quality->Enable(pButton == pPage3_Jpg);
 	return 0;
@@ -1334,8 +1336,6 @@
 	return 0;
 }
 
-static UINT16 nPreviewBitmapOffests[] = { 0,2,4,6,7,8,9,10 };
-
 // =====================================================================
 // Refresh des Dialogs beim wechsel der Seite
 // =====================================================================
@@ -1466,42 +1466,13 @@
  */
 void SdPublishingDlg::LoadPreviewButtons()
 {
-	if( GalleryExplorer::BeginLocking( GALLERY_THEME_HTMLBUTTONS ) )
-	{
-		UINT16 nFavCount = (UINT16) GalleryExplorer::GetObjCount( GALLERY_THEME_HTMLBUTTONS );
-
-		USHORT nItem = 1;
-		Graphic	aThumb;
-		Size aSize( (8*40) - 8, 32 );
-		Point aOrigin( 0,0 );
-		Size aDestSize( 32, 32 );
-
-		for( UINT16 nModelPos = 1; nModelPos < nFavCount; nModelPos+= NUM_BUTTONS )
-		{
-			VirtualDevice aVDev;
-			aVDev.SetMapMode(MapMode(MAP_PIXEL));
-			aVDev.SetOutputSizePixel( aSize );
-
-			for( UINT16 nImage = 0; nImage < 8; nImage++ )
-			{
-				if(!GalleryExplorer::GetGraphicObj( GALLERY_THEME_HTMLBUTTONS, nModelPos + nPreviewBitmapOffests[nImage], &aThumb ) )
-					continue;
+	SdHtmlTheme aTheme = SdHtmlTheme::getTheme();
 
-				// ValueSet fuellen
-				Bitmap aBitmap( aThumb.GetBitmap() );
-
-				Point aDestPt( nImage * 40, 0 );
-				aVDev.DrawBitmap( aDestPt, aDestSize, aBitmap );
-			}
-
-			String aStr = UniString::CreateFromInt32( nItem );
-			Bitmap aBitmap( aVDev.GetBitmap( aOrigin, aSize ) );
-
-			pPage5_Buttons->InsertItem( (USHORT)nItem++, aBitmap, aStr );
-		}
+	for (int nThemeId = 0; nThemeId < aTheme.getThemeCount (); nThemeId++)
+	{
+		String aStr = UniString::CreateFromInt32( nThemeId );
+		pPage5_Buttons->InsertItem( (USHORT)nThemeId, aTheme.getThumbnail( nThemeId ), aStr );
 		m_bButtonsDirty = FALSE;
-
-		GalleryExplorer::EndLocking( GALLERY_THEME_HTMLBUTTONS );
 	}
 }
 
@@ -1551,7 +1522,7 @@
 
 	pPage2_Endless->Check( pDesign->m_bEndless );
 
-	pPage3_Gif->Check(pDesign->m_eFormat == FORMAT_GIF);
+	pPage3_Png->Check(pDesign->m_eFormat != FORMAT_JPG);
 	pPage3_Jpg->Check(pDesign->m_eFormat == FORMAT_JPG);
 
 	pPage3_Quality->SetText(pDesign->m_aCompression);
@@ -1611,7 +1582,7 @@
 	pDesign->m_bContentPage = pPage2_Content->IsChecked();
 	if(m_bImpress)
 		pDesign->m_bNotes = pPage2_Notes->IsChecked();
-	pDesign->m_eFormat = pPage3_Gif->IsChecked()?FORMAT_GIF:FORMAT_JPG;
+	pDesign->m_eFormat = pPage3_Png->IsChecked()?FORMAT_PNG:FORMAT_JPG;
 	pDesign->m_aCompression = pPage3_Quality->GetText();
 
 	pDesign->m_nResolution = pPage3_Resolution_1->IsChecked()?PUB_LOWRES_WIDTH:
@@ -1629,7 +1600,7 @@
 	if(pPage5_TextOnly->IsChecked())
 		pDesign->m_nButtonThema = -1;
 	else
-		pDesign->m_nButtonThema = pPage5_Buttons->GetSelectItemId() - 1;
+		pDesign->m_nButtonThema = pPage5_Buttons->GetSelectItemId();
 
 	pDesign->m_bUserAttr = pPage6_User->IsChecked();
 	pDesign->m_aBackColor = m_aBackColor;
Index: source/ui/inc/pubdlg.hrc
===================================================================
RCS file: /cvs/graphics/sd/source/ui/inc/pubdlg.hrc,v
retrieving revision 1.1
diff -u -r1.1 pubdlg.hrc
--- sd/source/ui/inc/pubdlg.hrc	18 Apr 2002 15:04:35 -0000	1.1
+++ sd/source/ui/inc/pubdlg.hrc	9 Jun 2004 04:36:08 -0000
@@ -108,7 +108,7 @@
 
 #define PAGE3_BMP			50
 #define PAGE3_TITEL_1		51
-#define PAGE3_GIF			52
+#define PAGE3_PNG			52
 #define PAGE3_JPG			53
 #define PAGE3_QUALITY_TXT	54
 #define PAGE3_QUALITY		55
Index: /source/ui/inc/pubdlg.hxx
===================================================================
RCS file: /cvs/graphics/sd/source/ui/inc/pubdlg.hxx,v
retrieving revision 1.2
diff -u -r1.2 pubdlg.hxx
--- sd/source/ui/inc/pubdlg.hxx	16 Jul 2002 08:13:01 -0000	1.2
+++ sd/source/ui/inc/pubdlg.hxx	9 Jun 2004 04:36:08 -0000
@@ -163,7 +163,7 @@
 	// page 3 controls
 	FixedBitmap*	pPage3_Bmp;
 	FixedLine*		pPage3_Titel1;
-	RadioButton*	pPage3_Gif;
+	RadioButton*	pPage3_Png;
 	RadioButton*	pPage3_Jpg;
 	FixedText*		pPage3_Quality_txt;
 	ComboBox*		pPage3_Quality;

Index: source/filter/html/makefile.mk
===================================================================
RCS file: /cvs/graphics/sd/source/filter/html/makefile.mk,v
retrieving revision 1.4
diff -u -r1.4 makefile.mk
--- sd/source/filter/html/makefile.mk	2 Aug 2002 12:13:59 -0000	1.4
+++ sd/source/filter/html/makefile.mk	9 Jun 2004 04:36:06 -0000
@@ -78,10 +78,12 @@
                        $(SLO)$/sdhtmlfilter.obj        \
                        $(SLO)$/htmlex.obj                      \
                        $(SLO)$/htmlattr.obj            \
+                       $(SLO)$/htmltheme.obj           \
                        $(SLO)$/pubdlg.obj
  
 EXCEPTIONSFILES = $(SLO)$/HtmlOptionsDialog.obj \
-                                 $(SLO)$/htmlex.obj
+                                 $(SLO)$/htmlex.obj    \
+                                 $(SLO)$/htmltheme.obj
  
 SRS1NAME=$(TARGET)
 SRC1FILES =    pubdlg.src
@@ -90,11 +92,12 @@
 LIB1OBJFILES = \
                        $(SLO)$/HtmlOptionsDialog.obj\
                        $(SLO)$/sdhtmlfilter.obj        \
-                       $(SLO)$/htmlex.obj
+                       $(SLO)$/htmlex.obj              \
+                                 $(SLO)$/htmltheme.obj
  
 LIB2TARGET= $(SLB)$/$(TARGET)_ui.lib
 LIB2OBJFILES = \
                        $(SLO)$/htmlattr.obj \
-                       $(SLO)$/pubdlg.obj
+                       $(SLO)$/pubdlg.obj
  
 # --- Targets --------------------------------------------------------------
