/src/libreoffice/svx/source/gallery2/gallerystoragelocations.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #include <gallerystoragelocations.hxx> |
21 | | #include <svx/galmisc.hxx> |
22 | | |
23 | | INetURLObject GalleryStorageLocations::ImplGetURLIgnoreCase(const INetURLObject& rURL) |
24 | 0 | { |
25 | 0 | INetURLObject aURL(rURL); |
26 | | |
27 | | // check original file name |
28 | 0 | if (!FileExists(aURL)) |
29 | 0 | { |
30 | | // check upper case file name |
31 | 0 | aURL.setName(aURL.getName().toAsciiUpperCase()); |
32 | |
|
33 | 0 | if (!FileExists(aURL)) |
34 | 0 | { |
35 | | // check lower case file name |
36 | 0 | aURL.setName(aURL.getName().toAsciiLowerCase()); |
37 | 0 | } |
38 | 0 | } |
39 | |
|
40 | 0 | return aURL; |
41 | 0 | } |
42 | | |
43 | | void GalleryStorageLocations::SetThmExtension(INetURLObject& aURL) |
44 | 0 | { |
45 | 0 | aURL.setExtension(u"thm"); |
46 | 0 | maThmURL = ImplGetURLIgnoreCase(aURL); |
47 | 0 | } |
48 | | |
49 | | void GalleryStorageLocations::SetSdgExtension(INetURLObject& aURL) |
50 | 0 | { |
51 | 0 | aURL.setExtension(u"sdg"); |
52 | 0 | maSdgURL = ImplGetURLIgnoreCase(aURL); |
53 | 0 | } |
54 | | |
55 | | void GalleryStorageLocations::SetSdvExtension(INetURLObject& aURL) |
56 | 0 | { |
57 | 0 | aURL.setExtension(u"sdv"); |
58 | 0 | maSdvURL = ImplGetURLIgnoreCase(aURL); |
59 | 0 | } |
60 | | |
61 | | void GalleryStorageLocations::SetStrExtension(INetURLObject& aURL) |
62 | 0 | { |
63 | 0 | aURL.setExtension(u"str"); |
64 | 0 | maStrURL = ImplGetURLIgnoreCase(aURL); |
65 | 0 | } |
66 | | |
67 | | void GalleryStorageLocations::SetStorageLocations(INetURLObject& rURL) |
68 | 0 | { |
69 | 0 | SetThmExtension(rURL); |
70 | 0 | SetSdgExtension(rURL); |
71 | 0 | SetSdvExtension(rURL); |
72 | 0 | SetStrExtension(rURL); |
73 | 0 | } |
74 | | |
75 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |