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 <j...@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 = &quot;Database.OutputTo&quot;
                If Not Utils._CheckArgument(UCase(pvOutputFormat), 3, vbString, 
Array( _
                                                        UCase(acFormatHTML), 
&quot;HTML&quot; _
                                                        , UCase(acFormatXLS), 
&quot;XLS&quot; _
-                                                       , UCase(acFormatCALC), 
&quot;ODS&quot; _
+                                                       , UCase(acFormatODS), 
&quot;ODS&quot; _
                                                        , UCase(acFormatTXT), 
&quot;TXT&quot;, &quot;CSV&quot; _
                                                        , &quot;&quot;)) _
                                Then Goto Exit_Function                         
&apos;  A 2nd time to allow case unsensitivity
@@ -640,7 +640,7 @@ Dim sOutputFormat As String, iTemplate As Integer, 
iOutputFile As Integer, bOutp
        
        &apos;Determine format and parameters
        If pvOutputFormat = &quot;&quot; Then
-               sOutputFormat = _PromptFormat()                 &apos;  Prompt 
user for format
+               sOutputFormat = _PromptFormat(Array(&quot;HTML&quot;, 
&quot;ODS&quot;, &quot;XLS&quot;, &quot;TXT&quot;))                       
&apos;  Prompt user for format
                If sOutputFormat = &quot;&quot; Then Goto Exit_Function
                If Not Utils._CheckArgument(UCase(sOutputFormat), 3, vbString, 
Array(UCase(acFormatHTML), &quot;HTML&quot;, &quot;&quot;)) _
                                Then Goto Exit_Function                 &apos;  
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
 &apos;Supported:       acFormatPDF, acFormatODT, acFormatDOC, acFormatHTML     
        for forms
-&apos;                 acFormatHTML, acFormatXLS, acFormatCALC, acFormatTXT    
for tables and queries
+&apos;                 acFormatHTML, acFormatXLS, acFormatODS, acFormatTXT     
for tables and queries
 
        If _ErrorHandler() Then On Local Error Goto Error_Function
 Const cstThisSub = &quot;OutputTo&quot;
@@ -1230,7 +1230,7 @@ Const cstThisSub = &quot;OutputTo&quot;
        If pvOutputFormat &lt;&gt; &quot;&quot; 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) _
                        , &quot;PDF&quot;, &quot;ODT&quot;, &quot;DOC&quot;, 
&quot;HTML&quot;, &quot;XLS&quot;, &quot;ODS&quot;, &quot;TXT&quot;, 
&quot;CSV&quot;, &quot;&quot; _
                        )) Then Goto Exit_Function                              
&apos;  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
        &apos;Determine format and parameters
 Dim sOutputFormat As String, sFilter As String, oFilterData As Object, oExport 
As Object, sSuffix As String
        If pvOutputFormat = &quot;&quot; Then
-               sOutputFormat = _PromptFormat()                 &apos;  Prompt 
user for format
+               sOutputFormat = _PromptFormat(Array(&quot;PDF&quot;, 
&quot;ODT&quot;, &quot;DOC&quot;, &quot;HTML&quot;))                       
&apos;  Prompt user for format
                If sOutputFormat = &quot;&quot; Then Goto Exit_Function
        Else
                sOutputFormat = UCase(pvOutputFormat)
@@ -1787,7 +1787,7 @@ Const cstSemiColon = &quot;;&quot;
                                sDirectory =  _getTempDirectoryURL()
                                If Right(sDirectory, 1) &lt;&gt; &quot;/&quot; 
Then sDirectory = sDirectory &amp; &quot;/&quot;
                                If pvOutputFormat = &quot;&quot; Then
-                                       sOutputFormat = _PromptFormat()         
        &apos;  Prompt user for format
+                                       sOutputFormat = 
_PromptFormat(Array(&quot;PDF&quot;, &quot;ODT&quot;, &quot;DOC&quot;, 
&quot;HTML&quot;))                       &apos;  Prompt user for format
                                        If sOutputFormat = &quot;&quot; Then 
Goto Exit_Function
                                Else
                                        sOutputFormat = UCase(pvOutputFormat)
@@ -2143,7 +2143,7 @@ Trace_NotFound:
 End Function           &apos;  _OpenObject     V0.8.9
 
 REM 
-----------------------------------------------------------------------------------------------------------------------
-Private Function _PromptFormat() As String
+Private Function _PromptFormat(ByVal pvList As Variant) As String
 &apos; 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(&quot;DLGFORMAT_CMDCANCEL_LABEL&quot;)
        oControl.HelpText = _GetLabel(&quot;DLGFORMAT_CMDCANCEL_HELP&quot;)
 
+       Set oControl = oDialog.Model.getByName(&quot;cboFormat&quot;)
+       If UBound(pvList) &gt;= 0 Then
+               oControl.Text = pvList(0)
+               oControl.StringItemList = pvList
+       Else
+               oControl.Text = &quot;&quot;
+               oControl.StringItemList = Array()
+       End If
+       
        iOKCancel = oDialog.Execute()
        Select Case iOKCancel
                Case 1                                  &apos;  OK
-                               _PromptFormat = 
oDialog.Model.getByName(&quot;cboFormat&quot;).Text
+                               _PromptFormat = oControl.Text
                Case 0                                  &apos;  Cancel
                                _PromptFormat = &quot;&quot;
                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 = &quot;writer8&quot;
 Global Const acFormatDOC = &quot;MS Word 97&quot;
 Global Const acFormatHTML = &quot;HTML&quot;
 Global Const acFormatXLS = &quot;MS Excel 97&quot;
-Global Const acFormatCALC = &quot;StarOffice XML (Calc)&quot;
+Global Const acFormatODS = &quot;StarOffice XML (Calc)&quot;
 Global Const acFormatTXT = &quot;Text - txt - csv (StarCalc)&quot;
 
 REM AcExportQuality
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to