merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0098-win32-invalid-names.diff
blob019d4baca61b3021df79452ef09cac64be45a5ae
1 --- sal/osl/w32/file_url.h
2 +++ sal/osl/w32/file_url.h
3 @@ -175,6 +175,7 @@
4 #define VALIDATEPATH_ALLOW_ELLIPSE 0x0002
5 #define VALIDATEPATH_ALLOW_RELATIVE 0x0004
6 #define VALIDATEPATH_ALLOW_UNC 0x0008
7 +#define VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD 0x0010
9 DWORD IsValidFilePath (
10 rtl_uString * path,
11 --- sal/osl/w32/file_url.cxx
12 +++ sal/osl/w32/file_url.cxx
13 @@ -1108,9 +1109,10 @@
14 case '.':
15 if ( dwFlags & VALIDATEPATH_ALLOW_ELLIPSE )
17 - if ( 1 == lpCurrent - lpComponent )
18 + if ( (dwFlags & VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD) ||
19 + 1 == lpCurrent - lpComponent )
21 - /* Current directory is O.K. */
22 + /* Either do allow periods anywhere, or current directory */
23 lpComponentEnd = lpCurrent;
24 break;
26 @@ -1123,8 +1125,13 @@ namespace /* private */
28 case 0:
29 case ' ':
30 - lpComponentEnd = lpCurrent - 1;
31 - fValid = FALSE;
32 + if ( dwFlags & VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD )
33 + lpComponentEnd = lpCurrent;
34 + else
35 + {
36 + lpComponentEnd = lpCurrent - 1;
37 + fValid = FALSE;
38 + }
39 break;
40 default:
41 lpComponentEnd = lpCurrent;
42 @@ -1365,7 +1372,7 @@ namespace /* private */
43 lpComponent = lpszPath + i;
46 - fValid = IsValidFilePathComponent( lpComponent, &lpComponent, dwFlags );
47 + fValid = IsValidFilePathComponent( lpComponent, &lpComponent, dwFlags | VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD);
49 if ( fValid && lpComponent )