[Libreoffice-commits] core.git: wizards/source

Jean-Pierre Ledure jp at ledure.be
Tue Dec 8 01:33:31 PST 2015


 wizards/source/access2base/Database.xba    |    4 ++--
 wizards/source/access2base/DoCmd.xba       |   21 +++++++++++++++------
 wizards/source/access2base/acConstants.xba |    2 +-
 3 files changed, 18 insertions(+), 9 deletions(-)

New commits:
commit 7bc56a95aa1cbe37d50e693dbd420dcbcecae740
Author: Jean-Pierre Ledure <jp at ledure.be>
Date:   Tue Dec 8 10:29:55 2015 +0100

    Access2Base - Dynamic combo list in PromptFormat()
    
    to refelect various list of output formats in DoCmd.OutputTo() action
    
    Change-Id: Ibb95020efa2995cde168efbd516f9b1e49d832a3

diff --git a/wizards/source/access2base/Database.xba b/wizards/source/access2base/Database.xba
index c4a674c..8d524b6 100644
--- a/wizards/source/access2base/Database.xba
+++ b/wizards/source/access2base/Database.xba
@@ -608,7 +608,7 @@ Const cstThisSub = "Database.OutputTo"
 		If Not Utils._CheckArgument(UCase(pvOutputFormat), 3, vbString, Array( _
 							UCase(acFormatHTML), "HTML" _
 							, UCase(acFormatXLS), "XLS" _
-							, UCase(acFormatCALC), "ODS" _
+							, UCase(acFormatODS), "ODS" _
 							, UCase(acFormatTXT), "TXT", "CSV" _
 							, "")) _
 				Then Goto Exit_Function				'	A 2nd time to allow case unsensitivity
@@ -640,7 +640,7 @@ Dim sOutputFormat As String, iTemplate As Integer, iOutputFile As Integer, bOutp
 	
 	'Determine format and parameters
 	If pvOutputFormat = "" Then
-		sOutputFormat = _PromptFormat()			'	Prompt user for format
+		sOutputFormat = _PromptFormat(Array("HTML", "ODS", "XLS", "TXT"))			'	Prompt user for format
 		If sOutputFormat = "" Then Goto Exit_Function
 		If Not Utils._CheckArgument(UCase(sOutputFormat), 3, vbString, Array(UCase(acFormatHTML), "HTML", "")) _
 				Then Goto Exit_Function			'	Today only value, later maybe Calc ?
diff --git a/wizards/source/access2base/DoCmd.xba b/wizards/source/access2base/DoCmd.xba
index 4af47fe..d4f5706 100644
--- a/wizards/source/access2base/DoCmd.xba
+++ b/wizards/source/access2base/DoCmd.xba
@@ -1214,7 +1214,7 @@ Public Function OutputTo(ByVal pvObjectType As Variant _
 							) As Boolean
 REM https://wiki.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options
 'Supported:	acFormatPDF, acFormatODT, acFormatDOC, acFormatHTML		for forms
-'			acFormatHTML, acFormatXLS, acFormatCALC, acFormatTXT	for tables and queries
+'			acFormatHTML, acFormatXLS, acFormatODS, acFormatTXT	for tables and queries
 
 	If _ErrorHandler() Then On Local Error Goto Error_Function
 Const cstThisSub = "OutputTo"
@@ -1230,7 +1230,7 @@ Const cstThisSub = "OutputTo"
 	If pvOutputFormat <> "" Then
 		If Not Utils._CheckArgument(UCase(pvOutputFormat), 3, vbString, Array( _
 			UCase(acFormatPDF), UCase(acFormatODT), UCase(acFormatDOC), UCase(acFormatHTML) _
-			, UCase(acFormatXLS), UCase(acFormatCALC), UCase(acFormatTXT) _
+			, UCase(acFormatXLS), UCase(acFormatODS), UCase(acFormatTXT) _
 			, "PDF", "ODT", "DOC", "HTML", "XLS", "ODS", "TXT", "CSV", "" _
 			)) Then Goto Exit_Function				'	A 2nd time to allow case unsensitivity
 	End If
@@ -1280,7 +1280,7 @@ Dim vWindow As Variant, sOutputFile As String, ofForm As Object, i As Integer, b
 	'Determine format and parameters
 Dim sOutputFormat As String, sFilter As String, oFilterData As Object, oExport As Object, sSuffix As String
 	If pvOutputFormat = "" Then
-		sOutputFormat = _PromptFormat()			'	Prompt user for format
+		sOutputFormat = _PromptFormat(Array("PDF", "ODT", "DOC", "HTML"))			'	Prompt user for format
 		If sOutputFormat = "" Then Goto Exit_Function
 	Else
 		sOutputFormat = UCase(pvOutputFormat)
@@ -1787,7 +1787,7 @@ Const cstSemiColon = ";"
 				sDirectory =  _getTempDirectoryURL()
 				If Right(sDirectory, 1) <> "/" Then sDirectory = sDirectory & "/"
 				If pvOutputFormat = "" Then
-					sOutputFormat = _PromptFormat()			'	Prompt user for format
+					sOutputFormat = _PromptFormat(Array("PDF", "ODT", "DOC", "HTML"))			'	Prompt user for format
 					If sOutputFormat = "" Then Goto Exit_Function
 				Else
 					sOutputFormat = UCase(pvOutputFormat)
@@ -2143,7 +2143,7 @@ Trace_NotFound:
 End Function		'	_OpenObject	V0.8.9
 
 REM -----------------------------------------------------------------------------------------------------------------------
-Private Function _PromptFormat() As String
+Private Function _PromptFormat(ByVal pvList As Variant) As String
 '	Return user selection in Format dialog
 
 Dim oDialog As Object, oDialogLib As Object, iOKCancel As Integer, oControl As Object
@@ -2172,10 +2172,19 @@ Dim oDialog As Object, oDialogLib As Object, iOKCancel As Integer, oControl As O
 	oControl.Label = _GetLabel("DLGFORMAT_CMDCANCEL_LABEL")
 	oControl.HelpText = _GetLabel("DLGFORMAT_CMDCANCEL_HELP")
 
+	Set oControl = oDialog.Model.getByName("cboFormat")
+	If UBound(pvList) >= 0 Then
+		oControl.Text = pvList(0)
+		oControl.StringItemList = pvList
+	Else
+		oControl.Text = ""
+		oControl.StringItemList = Array()
+	End If
+	
 	iOKCancel = oDialog.Execute()
 	Select Case iOKCancel
 		Case 1					'	OK
-				_PromptFormat = oDialog.Model.getByName("cboFormat").Text
+				_PromptFormat = oControl.Text
 		Case 0					'	Cancel
 				_PromptFormat = ""
 		Case Else
diff --git a/wizards/source/access2base/acConstants.xba b/wizards/source/access2base/acConstants.xba
index 89ac72b..08e442a 100644
--- a/wizards/source/access2base/acConstants.xba
+++ b/wizards/source/access2base/acConstants.xba
@@ -288,7 +288,7 @@ Global Const acFormatODT = "writer8"
 Global Const acFormatDOC = "MS Word 97"
 Global Const acFormatHTML = "HTML"
 Global Const acFormatXLS = "MS Excel 97"
-Global Const acFormatCALC = "StarOffice XML (Calc)"
+Global Const acFormatODS = "StarOffice XML (Calc)"
 Global Const acFormatTXT = "Text - txt - csv (StarCalc)"
 
 REM AcExportQuality


More information about the Libreoffice-commits mailing list