LibreOffice Module unotools (master) 1
defaultoptions.cxx
Go to the documentation of this file.
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 <sal/config.h>
21
22#include <osl/file.hxx>
25#include <com/sun/star/uno/Sequence.hxx>
26#include <rtl/ustrbuf.hxx>
27#include <officecfg/Office/Common.hxx>
28
30{
31
33{
34 SvtPathOptions aPathOpt;
35 auto seqToPath = [&aPathOpt] (const css::uno::Sequence<OUString> & rSeq)
36 {
37 // single paths
38 sal_Int32 nCount = rSeq.getLength();
39 OUStringBuffer aFullPathBuf(nCount * 40);
40 for ( sal_Int32 nPosition = 0; nPosition < nCount; ++nPosition )
41 {
42 aFullPathBuf.append(aPathOpt.SubstituteVariable( rSeq[ nPosition ] ));
43 if ( nPosition < nCount-1 )
44 aFullPathBuf.append(";");
45 }
46 return aFullPathBuf.makeStringAndClear();
47 };
48
49 OUString aRet;
50 switch (nId)
51 {
96 default:
97 assert(false);
98 }
99
100
106 {
107 OUString aTmp;
108 osl::FileBase::getFileURLFromSystemPath( aRet, aTmp );
109 aRet = aTmp;
110 }
111
112 return aRet;
113}
114
115} // namespace
116
117
118
119/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString SubstituteVariable(const OUString &rVar) const
int nCount
OUString GetDefaultPath(SvtPathOptions::Paths nId)
OUString get(TranslateId sContextAndId, const std::locale &loc)
Definition: resmgr.cxx:211
sal_Int16 nId