From 22c8cc4ed2d29421fe5fc8ab2ce4e90a4738c9d2 Mon Sep 17 00:00:00 2001 From: Behrend Cornelius Date: Wed, 6 Nov 2002 14:20:48 +0000 Subject: #104710# "GetWizardPaths" added --- wizards/source/webwizard/Common.xba | 3 +- wizards/source/webwizard/HtmlAutoPilotBasic.xba | 24 ++++++++++++--- wizards/source/webwizard/Language.xba | 40 +++++++++++++++++++------ 3 files changed, 53 insertions(+), 14 deletions(-) (limited to 'wizards') diff --git a/wizards/source/webwizard/Common.xba b/wizards/source/webwizard/Common.xba index d5dcab8bc3c3..806c49423b67 100644 --- a/wizards/source/webwizard/Common.xba +++ b/wizards/source/webwizard/Common.xba @@ -49,7 +49,8 @@ Dim StylesOptions(0) as New com.sun.star.beans.PropertyValue ErrorOcurred: If Err <> 0 Then MsgBox (WebWiz_gErrWhileLoadStyles$, 16, WebWiz_gWizardName$) -' CancelHTMLWizard() + RESUME EXITSUB +EXITSUB: End If End Function diff --git a/wizards/source/webwizard/HtmlAutoPilotBasic.xba b/wizards/source/webwizard/HtmlAutoPilotBasic.xba index e3448bc54bfe..d7882bff25a3 100644 --- a/wizards/source/webwizard/HtmlAutoPilotBasic.xba +++ b/wizards/source/webwizard/HtmlAutoPilotBasic.xba @@ -22,6 +22,7 @@ Public Style(MaxStyles, 8) as String Public Layout$(MaxLayouts, 2) Public TextureDir$, BulletDir$, GraphicsDir$, GalleryDir$, PhotosDir$ +Public SOBitmapPath as String Public CurrentBullet$, CurrentPrev$, CurrentNext$, CurrentHome$, CurrentTop$ Public FileStr as String @@ -59,9 +60,16 @@ On Local Error Goto GlobalErrorHandler SetProgressValue(2) oBaseDocument.LockControllers oViewSettings.ShowTableBoundaries = False + If Not GetWebWizardPaths() Then + oBaseDocument.dispose() + Exit Sub + End If LoadLanguage SetProgressValue(10) - GetPaths() + If Not GetWebWizardPaths() Then + oBaseDocument.dispose() + Exit Sub + End If Layout() = getListBoxArrays(oUcb, "/cnt") GetCurIndex(DialogModel, Layout(),2) SetProgressValue(30) @@ -88,7 +96,9 @@ On Local Error Goto GlobalErrorHandler GLOBALERRORHANDLER: If Err <> 0 Then MsgBox (WebWiz_gErrMsg$, 16, WebWiz_gWizardName$) -' CancelHTMLWizard() + oBaseDocument.dispose() + RESUME EXITWIZARD +EXITWIZARD: End If End Sub @@ -297,7 +307,13 @@ Dim sExtension as String oDocInfo = CreateUnoService("com.sun.star.document.DocumentProperties") FilterLen = Len(sFileFilter) bItemFound = False + ' It has to be made sure that the TemplatePath <> "" TemplatePath = GetOfficeSubPath("Template", "wizard/web/") + If TemplatePath = "" Then + Dim NullList() + getListBoxArrays() = NullList() + Exit Function + End If DirContent() = oUcb.GetFolderContents(TemplatePath,True) If sFileFilter = "/cnt" Then DimCount = 2 @@ -347,9 +363,9 @@ Dim sExtension as String End If Next i If sFileFilter = "/cnt" Then - ReDim PreServe List(a-1,2) as String + ReDim Preserve List(a-1,2) as String Else - ReDim PreServe List(a-1,8) as String + ReDim Preserve List(a-1,8) as String End If If Not bItemfound Then MsgBox(WebWiz_gErrContentNotFound$, 16, WebWiz_gWizardName$) diff --git a/wizards/source/webwizard/Language.xba b/wizards/source/webwizard/Language.xba index a3c8bc66fdb0..c1d5eadee5a0 100644 --- a/wizards/source/webwizard/Language.xba +++ b/wizards/source/webwizard/Language.xba @@ -3,6 +3,8 @@ Option Explicit + + Sub LoadLanguage() If InitResources("WebWizard","wwz") Then WebWiz_gErrContentNotFound = GetResText(1101) @@ -16,16 +18,38 @@ Sub LoadLanguage() End Sub -Sub GetPaths - TextureDir = GetOfficeSubPath("Gallery", "www-back/") - GraphicsDir = GetOfficeSubPath("Gallery", "www-graf/") - BulletDir = GetOfficeSubPath("Gallery", "bullets/") - PhotosDir = GetPathSettings("Gallery", False, 1) -End Sub +Function GetWebWizardPaths() as Boolean +Dim TemplatePath as String + TextureDir = GetOfficeSubPath("Gallery","www-back") + If TextureDir <> "" Then + GraphicsDir = GetOfficeSubPath("Gallery","www-graf/") + If GraphicsDir <> "" Then + BulletDir = GetOfficeSubPath("Gallery", "bullets/") + If BulletDir <> "" Then + PhotosDir = GetPathSettings("Gallery", False, 1) + If PhotosDir <> "" Then + TemplatePath = GetOfficeSubPath("Template", "wizard/web/") + If TemplatePath <> "" Then + SOBitmapPath = GetOfficeSubPath("Template", "wizard/bitmap") + If SOBitmapPath <> "" Then + GetWebwizardPaths() = True + Exit Function + End If + End If + End If + End If + End If + End If + If Not IsNull(oDocument) Then + oBaseDocument.dispose() + End If + GetWebWizardPaths() = False +End Function + Sub OpenWebDialog() - Dim SOBitmapPath,sBitmapPath as String + Dim sBitmapPath as String Dim BufferNames() as String Dim SelList(0) as Integer SelList(0) = 0 @@ -52,8 +76,6 @@ Sub OpenWebDialog() BufferNames() = ArrayfromMultiArray(Style, 1) DialogModel.lbStyles.StringItemList() = BufferNames() DialogModel.lbStyles.SelectedItems() = SelList() - - SOBitmapPath = GetOfficeSubPath("Template", "wizard/bitmap") sBitmapPath = SOBitmapPath & "webwizard.bmp" DialogModel.ImagePreview.ImageURL = sBitmapPath -- cgit