Avoid potential negative array index access to cached text.
[LibreOffice.git] / vcl / unx / gtk3_kde5 / gtk3_kde5_gtkinst.cxx
blobdd6aace5dc638e8b932d84f5a8a7cad253c17268
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 // make gtk3 plug advertise correctly as kde5 hybrid
21 #define GTK_TOOLKIT_NAME "gtk3_kde5"
22 #include "../gtk3/gtkinst.cxx"
24 #include "gtk3_kde5_filepicker.hxx"
25 #include "gtk3_kde5_folderpicker.hxx"
27 #include <system_error>
29 uno::Reference<ui::dialogs::XFilePicker2>
30 GtkInstance::createFilePicker(const uno::Reference<uno::XComponentContext>& xMSF)
32 try
34 return uno::Reference<ui::dialogs::XFilePicker2>(new Gtk3KDE5FilePicker(xMSF));
36 catch (const std::system_error& error)
38 OSL_FAIL(error.what());
39 return { nullptr };
43 uno::Reference<ui::dialogs::XFolderPicker2>
44 GtkInstance::createFolderPicker(const uno::Reference<uno::XComponentContext>& xMSF)
46 try
48 return uno::Reference<ui::dialogs::XFolderPicker2>(new Gtk3KDE5FolderPicker(xMSF));
50 catch (const std::system_error& error)
52 OSL_FAIL(error.what());
53 return { nullptr };
57 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */