summaryrefslogtreecommitdiff
path: root/patches/OOO_1_1/sw-template-fallback-to-english.diff
blob: 0dcc5a3bf7f6e22c325c4c06ca1b520fbf15bcb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- sw/source/ui/index/cnttab.cxx.english-fallback	2004-11-03 15:38:01.000000000 -0500
+++ sw/source/ui/index/cnttab.cxx	2004-11-03 16:34:52.128271440 -0500
@@ -677,17 +677,42 @@
 #endif
 
 			SvtPathOptions aOpt;
+
+			// Add fallback to english templates
+			String searchPath = aOpt.GetTemplatePath();
+			if (searchPath.SearchAscii("template/english;") == STRING_NOTFOUND)
+			{
+				xub_StrLen start = searchPath.SearchAscii("/template/");
+				if (start != STRING_NOTFOUND)
+				{
+					String sTmp (searchPath, 0, start);
+					sTmp.AppendAscii ("/template/english;");
+					searchPath.AppendAscii (";");
+					searchPath.Append (sTmp);
+					aOpt.SetTemplatePath (searchPath);
+				}
+			}
+
+
 			// 6.0 (extension .sxw)
 			BOOL bExist = aOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE );
 
 #ifndef MAC_WITHOUT_EXT
 			if( !bExist )
 			{
-				// 5.0 (extension .vor)
+				// 5.0 (extension .sdw)
 				sTemplate = sTemplateWithoutExt;
 				sTemplate.AppendAscii( RTL_CONSTASCII_STRINGPARAM(".sdw") );
 				bExist = aOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE );
 			}
+
+			if( !bExist )
+			{
+				// 5.0 (extension .vor)
+				sTemplate = sTemplateWithoutExt;
+				sTemplate.AppendAscii( RTL_CONSTASCII_STRINGPARAM(".vor") );
+				bExist = aOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE );
+			}
 #endif
 
 			if(!bExist)