summaryrefslogtreecommitdiff
path: root/patches/OOO_1_1/sw-autopilot-fallback-to-vor.diff
blob: d68279b91da8eec3b5822a17e7d49ed354ece245 (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
--- sw/source/ui/wizard/wizgo2.cxx	2004-11-03 15:13:43.000000000 -0500
+++ sw/source/ui/wizard/wizgo2.cxx	2004-11-03 15:14:56.841265872 -0500
@@ -155,18 +155,35 @@
 {
 	SfxApplication *pSApp = SFX_APP();
 	BOOL bRet = FALSE;
+	BOOL success = FALSE;
 
 	String sTemplate( String::CreateFromAscii("wizard") );
 	sTemplate += INET_PATH_TOKEN;
 	sTemplate += rVorlage;
-#ifndef MAC_WITHOUT_EXT
-    sTemplate.AppendAscii(".stw");
-#endif
 
 	const SfxFilter* pFilter = (SfxFilter*)-1;
 	SvtPathOptions aOpt;
-    if( (aOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE ))
-        &&  0 != (pFilter = SwIoSystem::GetFileFilter(sTemplate, aEmptyStr)) )
+
+	// Try first with .stw extension, then with .vor
+	String sTmp (sTemplate);
+	sTmp.AppendAscii(".stw");
+	if(aOpt.SearchFile (sTmp, SvtPathOptions::PATH_TEMPLATE))
+	{
+		success = TRUE;
+		sTemplate = sTmp;
+	}
+	else
+	{
+		sTmp.Assign (sTemplate);
+		sTmp.AppendAscii(".vor");
+		if(aOpt.SearchFile (sTmp, SvtPathOptions::PATH_TEMPLATE))
+		{
+			success = TRUE;
+			sTemplate = sTmp;
+		}
+	}
+
+	if (success && (0 != (pFilter = SwIoSystem::GetFileFilter (sTemplate, aEmptyStr))))
 	{
         sTemplate = URIHelper::SmartRelToAbs( sTemplate );