tdf#154546 skip dispatch when presenter controller is not set
[LibreOffice.git] / sal / osl / unx / file_error_transl.cxx
blob539d4ccfc93046e1bbee9b17cf8362b721ee0ab0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/config.h>
22 #include <cassert>
23 #include <cerrno>
25 #include "file_error_transl.hxx"
27 oslFileError oslTranslateFileError(int Errno)
29 switch (Errno)
31 case EPERM:
32 return osl_File_E_PERM;
34 case ENOENT:
35 return osl_File_E_NOENT;
37 case ESRCH:
38 return osl_File_E_SRCH;
40 case EINTR:
41 return osl_File_E_INTR;
43 case EIO:
44 return osl_File_E_IO;
46 case ENXIO:
47 return osl_File_E_IO;
49 case E2BIG:
50 return osl_File_E_2BIG;
52 case ENOEXEC:
53 return osl_File_E_NOEXEC;
55 case EBADF:
56 return osl_File_E_BADF;
58 case ECHILD:
59 return osl_File_E_CHILD;
61 case EAGAIN:
62 return osl_File_E_AGAIN;
64 case ENOMEM:
65 return osl_File_E_NOMEM;
67 case EACCES:
68 return osl_File_E_ACCES;
70 case EFAULT:
71 return osl_File_E_FAULT;
73 case EBUSY:
74 return osl_File_E_BUSY;
76 case EEXIST:
77 return osl_File_E_EXIST;
79 case EXDEV:
80 return osl_File_E_XDEV;
82 case ENODEV:
83 return osl_File_E_NODEV;
85 case ENOTDIR:
86 return osl_File_E_NOTDIR;
88 case EISDIR:
89 return osl_File_E_ISDIR;
91 case EINVAL:
92 return osl_File_E_INVAL;
94 case ENFILE:
95 return osl_File_E_NFILE;
97 case EMFILE:
98 return osl_File_E_MFILE;
100 case ENOTTY:
101 return osl_File_E_NOTTY;
103 case EFBIG:
104 return osl_File_E_FBIG;
106 case ENOSPC:
107 return osl_File_E_NOSPC;
109 case ESPIPE:
110 return osl_File_E_SPIPE;
112 case EROFS:
113 return osl_File_E_ROFS;
115 case EMLINK:
116 return osl_File_E_MLINK;
118 case EPIPE:
119 return osl_File_E_PIPE;
121 case EDOM:
122 return osl_File_E_DOM;
124 case ERANGE:
125 return osl_File_E_RANGE;
127 case EDEADLK:
128 return osl_File_E_DEADLK;
130 case ENAMETOOLONG:
131 return osl_File_E_NAMETOOLONG;
133 case ENOLCK:
134 return osl_File_E_NOLCK;
136 case ENOSYS:
137 case ENOTSUP:
138 #if EOPNOTSUPP != ENOTSUP
139 case EOPNOTSUPP:
140 #endif
141 return osl_File_E_NOSYS;
143 case ENOTEMPTY:
144 return osl_File_E_NOTEMPTY;
146 case ELOOP:
147 return osl_File_E_LOOP;
149 #if !(defined(MACOSX) || defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD) \
150 || defined(DRAGONFLY))
151 case EILSEQ:
152 return osl_File_E_ILSEQ;
154 case ENOLINK:
155 return osl_File_E_NOLINK;
157 case EMULTIHOP:
158 return osl_File_E_MULTIHOP;
159 #endif /* MACOSX */
161 #if !defined(HAIKU)
162 case EUSERS:
163 return osl_File_E_USERS;
164 #endif
166 case EOVERFLOW:
167 return osl_File_E_OVERFLOW;
169 case ETIMEDOUT:
170 return osl_File_E_TIMEDOUT;
172 default:
173 assert(Errno != 0);
174 /* FIXME translateFileError: is this alright? Or add a new one: osl_File_E_Unknown? */
175 return osl_File_E_invalidError;
179 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */