f0633d
From 29439609d6023c8c7e14cafa5171b2bedc600ab4 Mon Sep 17 00:00:00 2001
f0633d
From: Eike Rathke <erack@redhat.com>
f0633d
Date: Fri, 3 Jan 2014 00:34:06 +0100
f0633d
Subject: [PATCH 097/109] die binfilter die die die
f0633d
f0633d
Euro Converter tried to obtain filters for names of binary filters that
f0633d
don't exist anymore and can't be resolved hence the TypeDetection
f0633d
GetByName() bailed out with an exception when calling the file picker
f0633d
(e.g. when attempting to select a document), stopping in Basic
f0633d
environment and effectively rendering the wizard useless.
f0633d
f0633d
Change-Id: Ifdef6f59abdc16bedd0f54ec317dc44af8f1e628
f0633d
(cherry picked from commit e625d00439f725b01f3818859e95e431e6173d57)
f0633d
Reviewed-on: https://gerrit.libreoffice.org/7264
f0633d
Reviewed-by: Andras Timar <andras.timar@collabora.com>
f0633d
Tested-by: Andras Timar <andras.timar@collabora.com>
f0633d
---
f0633d
 wizards/source/euro/AutoPilotRun.xba | 60 +++++++++++++-----------------------
f0633d
 1 file changed, 22 insertions(+), 38 deletions(-)
f0633d
f0633d
diff --git a/wizards/source/euro/AutoPilotRun.xba b/wizards/source/euro/AutoPilotRun.xba
f0633d
index 47d7959..fe2bed7 100644
f0633d
--- a/wizards/source/euro/AutoPilotRun.xba
f0633d
+++ b/wizards/source/euro/AutoPilotRun.xba
f0633d
@@ -28,7 +28,7 @@ Public Source as String
f0633d
 Public SubstFile as String
f0633d
 Public SubstDir as String
f0633d
 Public NoArgs()
f0633d
-Public TypeList(14) as String
f0633d
+Public TypeList(6) as String
f0633d
 Public GoOn as Boolean
f0633d
 Public DoUnprotect as Integer
f0633d
 Public Password as String
f0633d
@@ -74,21 +74,13 @@ Dim bDisposable as Boolean
f0633d
 			TargetStemDir = TargetDir
f0633d
 			TypeList(0) = "calc8"
f0633d
 			TypeList(1) = "calc_StarOffice_XML_Calc"
f0633d
-			TypeList(2) = "calc_StarCalc_30"
f0633d
-			TypeList(3) = "calc_StarCalc_40"
f0633d
-			TypeList(4) = "calc_StarCalc_50"
f0633d
 			If DialogModel.chkTextDocuments.State = 1 Then
f0633d
-				ReDim Preserve TypeList(13) as String
f0633d
-
f0633d
-				TypeList(5) = "writer8"
f0633d
-				TypeList(6) = "writerglobal8"
f0633d
-				TypeList(7) = "writer_StarOffice_XML_Writer"
f0633d
-				TypeList(8) = "writer_globaldocument_StarOffice_XML_Writer_GlobalDocument"
f0633d
-				TypeList(9) = "writer_StarWriter_30"
f0633d
-				TypeList(10) = "writer_StarWriter_40"
f0633d
-				TypeList(11) = "writer_globaldocument_StarWriter_40GlobalDocument"
f0633d
-				TypeList(12) = "writer_StarWriter_50"
f0633d
-				TypeList(13) = "writer_globaldocument_StarWriter_50GlobalDocument"
f0633d
+				ReDim Preserve TypeList(5) as String
f0633d
+
f0633d
+				TypeList(2) = "writer8"
f0633d
+				TypeList(3) = "writerglobal8"
f0633d
+				TypeList(4) = "writer_StarOffice_XML_Writer"
f0633d
+				TypeList(5) = "writer_globaldocument_StarOffice_XML_Writer_GlobalDocument"
f0633d
 			End If
f0633d
 			FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, TypeList())
f0633d
 			TotDocCount = Ubound(FilesList(),1) + 1
f0633d
@@ -387,34 +379,26 @@ Sub CallFilePicker()
f0633d
 		oTypes() = oMasterKey.Types
f0633d
 		oUIKey = GetRegistryKeyContent("org.openoffice.Office.UI/FilterClassification/LocalFilters")
f0633d
 		If DialogModel.chkTextDocuments.State = 1 Then
f0633d
-			Dim FilterNames(11,1) as String
f0633d
-			FilterNames(6,0) = oTypes.GetByName("writer_StarOffice_XML_Writer").UIName
f0633d
-			FilterNames(6,1) = "*.sxw"
f0633d
-			FilterNames(7,0) = oTypes.GetByName("writer_StarOffice_XML_Writer_Template").UIName
f0633d
-			FilterNames(7,1) = "*.stw"
f0633d
-			FilterNames(8,0) = oUIKey.Classes.GetByName("sw3to5").DisplayName
f0633d
-			FilterNames(8,1) = "*.sdw"
f0633d
-			FilterNames(9,0) = oUIKey.Classes.GetByName("sw3to5templ").DisplayName
f0633d
-			Filternames(9,1) = "*.vor"
f0633d
-			FilterNames(10,0) = oTypes.GetByName("writer8").UIName
f0633d
-			FilterNames(10,1) = "*.odt"
f0633d
-			FilterNames(11,0) = oTypes.GetByName("writer8_template").UIName
f0633d
-			FilterNames(11,1) = "*.ott"
f0633d
+			Dim FilterNames(7,1) as String
f0633d
+			FilterNames(4,0) = oTypes.GetByName("writer_StarOffice_XML_Writer").UIName
f0633d
+			FilterNames(4,1) = "*.sxw"
f0633d
+			FilterNames(5,0) = oTypes.GetByName("writer_StarOffice_XML_Writer_Template").UIName
f0633d
+			FilterNames(5,1) = "*.stw"
f0633d
+			FilterNames(6,0) = oTypes.GetByName("writer8").UIName
f0633d
+			FilterNames(6,1) = "*.odt"
f0633d
+			FilterNames(7,0) = oTypes.GetByName("writer8_template").UIName
f0633d
+			FilterNames(7,1) = "*.ott"
f0633d
 		Else
f0633d
-			ReDim FilterNames(5,1) as String
f0633d
+			ReDim FilterNames(3,1) as String
f0633d
 		End If
f0633d
-		FilterNames(0,0) = oTypes.GetByName("calc_StarOffice_XML_Calc").UIName	
f0633d
+		FilterNames(0,0) = oTypes.GetByName("calc_StarOffice_XML_Calc").UIName
f0633d
 		Filternames(0,1) = "*.sxc"
f0633d
 		FilterNames(1,0) = oTypes.GetByName("calc_StarOffice_XML_Calc_Template").UIName
f0633d
 		Filternames(1,1) = "*.stc"
f0633d
-		FilterNames(2,0) = oUIKey.Classes.GetByName("sc345").DisplayName
f0633d
-		FilterNames(2,1) = "*.sdc"
f0633d
-		FilterNames(3,0) = oUIKey.Classes.GetByName("sc345templ").DisplayName
f0633d
-		Filternames(3,1) = "*.vor"
f0633d
-		FilterNames(4,0) = oTypes.GetByName("calc8").UIName	
f0633d
-		Filternames(4,1) = "*.ods"
f0633d
-		FilterNames(5,0) = oTypes.GetByName("calc8_template").UIName	
f0633d
-		Filternames(5,1) = "*.ots"
f0633d
+		FilterNames(2,0) = oTypes.GetByName("calc8").UIName
f0633d
+		Filternames(2,1) = "*.ods"
f0633d
+		FilterNames(3,0) = oTypes.GetByName("calc8_template").UIName
f0633d
+		Filternames(3,1) = "*.ots"
f0633d
 		GetFileName(DialogModel.txtSource, Filternames())
f0633d
 	Else
f0633d
 		GetFolderName(DialogModel.txtSource)
f0633d
-- 
f0633d
1.8.4.2
f0633d