LibreOffice Module unotools (master) 1
pathoptions.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 <sal/log.hxx>
25#include <tools/urlobj.hxx>
26#include <com/sun/star/uno/Any.hxx>
27#include <com/sun/star/uno/Sequence.hxx>
28#include <osl/mutex.hxx>
29#include <osl/file.hxx>
30
34#include <com/sun/star/beans/XFastPropertySet.hpp>
35#include <com/sun/star/beans/XPropertySetInfo.hpp>
36#include <com/sun/star/util/thePathSettings.hpp>
37#include <com/sun/star/util/PathSubstitution.hpp>
38#include <com/sun/star/util/XStringSubstitution.hpp>
39#include <com/sun/star/util/theMacroExpander.hpp>
40#include <o3tl/enumarray.hxx>
41#include <o3tl/string_view.hxx>
42
43#include "itemholder1.hxx"
44
45#include <set>
46#include <unordered_map>
47
48using namespace osl;
49using namespace utl;
50using namespace com::sun::star::uno;
51using namespace com::sun::star::beans;
52using namespace com::sun::star::util;
53using namespace com::sun::star::lang;
54
55#define SEARCHPATH_DELIMITER ';'
56#define SIGN_STARTVARIABLE "$("
57#define SIGN_ENDVARIABLE ")"
58
59// Supported variables by the old SvtPathOptions implementation
60#define SUBSTITUTE_INSTPATH "$(instpath)"
61#define SUBSTITUTE_PROGPATH "$(progpath)"
62#define SUBSTITUTE_USERPATH "$(userpath)"
63#define SUBSTITUTE_PATH "$(path)"
64
65#define STRPOS_NOTFOUND -1
66
67typedef std::unordered_map<OUString, sal_Int32> NameToHandleMap;
68
69typedef std::set<OUString> VarNameSet;
70
71// class SvtPathOptions_Impl ---------------------------------------------
73{
74 private:
75 // Local variables to return const references
80 mutable std::unordered_map<SvtPathOptions::Paths, sal_Int32>
83
86
87 public:
89
90 // get the paths, not const because of using a mutex
91 const OUString& GetPath( SvtPathOptions::Paths );
92 const OUString& GetAddinPath() { return GetPath( SvtPathOptions::Paths::AddIn ); }
95 const OUString& GetBackupPath() { return GetPath( SvtPathOptions::Paths::Backup ); }
96 const OUString& GetBasicPath() { return GetPath( SvtPathOptions::Paths::Basic ); }
97 const OUString& GetBitmapPath() { return GetPath( SvtPathOptions::Paths::Bitmap ); }
98 const OUString& GetConfigPath() { return GetPath( SvtPathOptions::Paths::Config ); }
101 const OUString& GetFilterPath() { return GetPath( SvtPathOptions::Paths::Filter ); }
104 const OUString& GetHelpPath() { return GetPath( SvtPathOptions::Paths::Help ); }
106 const OUString& GetModulePath() { return GetPath( SvtPathOptions::Paths::Module ); }
109 const OUString& GetPluginPath() { return GetPath( SvtPathOptions::Paths::Plugin ); }
111 const OUString& GetTempPath() { return GetPath( SvtPathOptions::Paths::Temp ); }
114 const OUString& GetWorkPath() { return GetPath( SvtPathOptions::Paths::Work ); }
119
120 // set the paths
121 void SetPath( SvtPathOptions::Paths, const OUString& rNewPath );
122 void SetAutoTextPath( const OUString& rPath ) { SetPath( SvtPathOptions::Paths::AutoText, rPath ); }
123 void SetBasicPath( const OUString& rPath ) { SetPath( SvtPathOptions::Paths::Basic, rPath ); }
124 void SetTempPath( const OUString& rPath ) { SetPath( SvtPathOptions::Paths::Temp, rPath ); }
125
126 OUString SubstVar( const OUString& rVar ) const;
127 OUString ExpandMacros( const OUString& rPath ) const;
128 OUString UsePathVariables( const OUString& rPath ) const;
129};
130
131// global ----------------------------------------------------------------
132
133static std::weak_ptr<SvtPathOptions_Impl> g_pOptions;
134
135namespace {
136
137// functions -------------------------------------------------------------
138struct PropertyStruct
139{
140 const char* pPropName; // The ascii name of the Office path
141 SvtPathOptions::Paths ePath; // The enum value used by SvtPathOptions
142};
143
144struct VarNameAttribute
145{
146 const char* pVarName; // The name of the path variable
147};
148
149}
150
151const PropertyStruct aPropNames[] =
152{
153 { "Addin", SvtPathOptions::Paths::AddIn },
154 { "AutoCorrect", SvtPathOptions::Paths::AutoCorrect },
155 { "AutoText", SvtPathOptions::Paths::AutoText },
156 { "Backup", SvtPathOptions::Paths::Backup },
157 { "Basic", SvtPathOptions::Paths::Basic },
158 { "Bitmap", SvtPathOptions::Paths::Bitmap },
159 { "Config", SvtPathOptions::Paths::Config },
160 { "Dictionary", SvtPathOptions::Paths::Dictionary },
161 { "Favorite", SvtPathOptions::Paths::Favorites },
162 { "Filter", SvtPathOptions::Paths::Filter },
163 { "Gallery", SvtPathOptions::Paths::Gallery },
164 { "Graphic", SvtPathOptions::Paths::Graphic },
165 { "Help", SvtPathOptions::Paths::Help },
166 { "Iconset", SvtPathOptions::Paths::IconSet },
167 { "Linguistic", SvtPathOptions::Paths::Linguistic },
168 { "Module", SvtPathOptions::Paths::Module },
169 { "Palette", SvtPathOptions::Paths::Palette },
170 { "Plugin", SvtPathOptions::Paths::Plugin },
171 { "Storage", SvtPathOptions::Paths::Storage },
172 { "Temp", SvtPathOptions::Paths::Temp },
173 { "Template", SvtPathOptions::Paths::Template },
174 { "UserConfig", SvtPathOptions::Paths::UserConfig },
175 { "Work", SvtPathOptions::Paths::Work },
176 { "UIConfig", SvtPathOptions::Paths::UIConfig },
177 { "Fingerprint", SvtPathOptions::Paths::Fingerprint },
178 { "Numbertext", SvtPathOptions::Paths::NumberText },
179 { "Classification", SvtPathOptions::Paths::Classification }
180};
181
182const VarNameAttribute aVarNameAttribute[] =
183{
184 { SUBSTITUTE_INSTPATH }, // $(instpath)
185 { SUBSTITUTE_PROGPATH }, // $(progpath)
186 { SUBSTITUTE_USERPATH }, // $(userpath)
187 { SUBSTITUTE_PATH }, // $(path)
188};
189
190// class SvtPathOptions_Impl ---------------------------------------------
191
193{
194 std::unique_lock aGuard( m_aMutex );
195
196 try
197 {
198 OUString aPathValue;
199 sal_Int32 nHandle = m_aMapEnumToPropHandle[ePath];
200
201 // Substitution is done by the service itself using the substitution service
202 Any a = m_xPathSettings->getFastPropertyValue( nHandle );
203 a >>= aPathValue;
204 if( ePath == SvtPathOptions::Paths::AddIn ||
210 )
211 {
212 // These office paths have to be converted to system pates
213 OUString aResult;
214 osl::FileBase::getSystemPathFromFileURL( aPathValue, aResult );
215 aPathValue = aResult;
216 }
217 else if (ePath == SvtPathOptions::Paths::Palette ||
219 {
221 OUStringBuffer buf(aPathValue.getLength()*2);
222 for (sal_Int32 i = 0;;)
223 {
224 buf.append(
226 ctx, aPathValue.getToken(0, ';', i)));
227 if (i == -1) {
228 break;
229 }
230 buf.append(';');
231 }
232 aPathValue = buf.makeStringAndClear();
233 }
234
235 m_aPathArray[ ePath ] = aPathValue;
236 return m_aPathArray[ ePath ];
237 }
238 catch (UnknownPropertyException &)
239 {
240 }
241
242 return m_aEmptyString;
243}
244
245void SvtPathOptions_Impl::SetPath( SvtPathOptions::Paths ePath, const OUString& rNewPath )
246{
247 std::unique_lock aGuard( m_aMutex );
248
249 OUString aResult;
250 OUString aNewValue;
251 Any a;
252
253 switch ( ePath )
254 {
261 {
262 // These office paths have to be convert back to UCB-URL's
263 osl::FileBase::getFileURLFromSystemPath( rNewPath, aResult );
264 aNewValue = aResult;
265 }
266 break;
267
268 default:
269 aNewValue = rNewPath;
270 }
271
272 // Resubstitution is done by the service itself using the substitution service
273 a <<= aNewValue;
274 try
275 {
276 m_xPathSettings->setFastPropertyValue( m_aMapEnumToPropHandle[ePath], a );
277 }
278 catch (const Exception&)
279 {
280 TOOLS_WARN_EXCEPTION("unotools.config", "SetPath");
281 }
282}
283
284OUString SvtPathOptions_Impl::ExpandMacros( const OUString& rPath ) const
285{
286 OUString sExpanded( rPath );
287
288 const INetURLObject aParser( rPath );
289 if ( aParser.GetProtocol() == INetProtocol::VndSunStarExpand )
290 sExpanded = m_xMacroExpander->expandMacros( aParser.GetURLPath( INetURLObject::DecodeMechanism::WithCharset ) );
291
292 return sExpanded;
293}
294
295OUString SvtPathOptions_Impl::UsePathVariables( const OUString& rPath ) const
296{
297 return m_xSubstVariables->reSubstituteVariables( rPath );
298}
299
300OUString SvtPathOptions_Impl::SubstVar( const OUString& rVar ) const
301{
302 // Don't work at parameter-string directly. Copy it.
303 OUString aWorkText = rVar;
304
305 // Convert the returned path to system path!
306 bool bConvertLocal = false;
307
308 // Search for first occurrence of "$(...".
309 sal_Int32 nPosition = aWorkText.indexOf( SIGN_STARTVARIABLE ); // = first position of "$(" in string
310 sal_Int32 nLength = 0; // = count of letters from "$(" to ")" in string
311
312 // Have we found any variable like "$(...)"?
313 if ( nPosition != STRPOS_NOTFOUND )
314 {
315 // Yes; Get length of found variable.
316 // If no ")" was found - nLength is set to 0 by default! see before.
317 sal_Int32 nEndPosition = aWorkText.indexOf( SIGN_ENDVARIABLE, nPosition );
318 if ( nEndPosition != STRPOS_NOTFOUND )
319 nLength = nEndPosition - nPosition + 1;
320 }
321
322 // Is there another path variable?
323 while ( ( nPosition != STRPOS_NOTFOUND ) && ( nLength > 0 ) )
324 {
325 // YES; Get the next variable for replace.
326 OUString aSubString = aWorkText.copy( nPosition, nLength );
327 aSubString = aSubString.toAsciiLowerCase();
328
329 // Look for special variable that needs a system path.
330 VarNameSet::const_iterator pIter = m_aSystemPathVarNames.find( aSubString );
331 if ( pIter != m_aSystemPathVarNames.end() )
332 bConvertLocal = true;
333
334 nPosition += nLength;
335
336 // We must control index in string before call something at OUString!
337 // The OUString-implementation don't do it for us :-( but the result is not defined otherwise.
338 if ( nPosition + 1 > aWorkText.getLength() )
339 {
340 // Position is out of range. Break loop!
341 nPosition = STRPOS_NOTFOUND;
342 nLength = 0;
343 }
344 else
345 {
346 // Else; Position is valid. Search for next variable.
347 nPosition = aWorkText.indexOf( SIGN_STARTVARIABLE, nPosition );
348 // Have we found any variable like "$(...)"?
349 if ( nPosition != STRPOS_NOTFOUND )
350 {
351 // Yes; Get length of found variable. If no ")" was found - nLength must set to 0!
352 nLength = 0;
353 sal_Int32 nEndPosition = aWorkText.indexOf( SIGN_ENDVARIABLE, nPosition );
354 if ( nEndPosition != STRPOS_NOTFOUND )
355 nLength = nEndPosition - nPosition + 1;
356 }
357 }
358 }
359
360 aWorkText = m_xSubstVariables->substituteVariables( rVar, false );
361
362 if ( bConvertLocal )
363 {
364 // Convert the URL to a system path for special path variables
365 OUString aReturn;
366 osl::FileBase::getSystemPathFromFileURL( aWorkText, aReturn );
367 return aReturn;
368 }
369
370 return aWorkText;
371}
372
374{
376
377 // Create necessary services
378 Reference< XPathSettings > xPathSettings = thePathSettings::get(xContext);
379 m_xPathSettings.set( xPathSettings, UNO_QUERY_THROW );
380 m_xSubstVariables.set( PathSubstitution::create(xContext) );
382
383 // Create temporary hash map to have a mapping between property names and property handles
384 Reference< XPropertySetInfo > xPropSetInfo = xPathSettings->getPropertySetInfo();
385 const Sequence< Property > aPathPropSeq = xPropSetInfo->getProperties();
386
387 NameToHandleMap aTempHashMap;
388 for ( const css::beans::Property& aProperty : aPathPropSeq )
389 {
390 aTempHashMap.emplace(aProperty.Name, aProperty.Handle);
391 }
392
393 // Create mapping between internal enum (SvtPathOptions::Paths) and property handle
394 for ( auto const & p : aPropNames )
395 {
396 NameToHandleMap::const_iterator pIter =
397 aTempHashMap.find( OUString::createFromAscii( p.pPropName ));
398
399 if ( pIter != aTempHashMap.end() )
400 {
401 sal_Int32 nHandle = pIter->second;
402 SvtPathOptions::Paths nEnum = p.ePath;
403 m_aMapEnumToPropHandle.emplace( nEnum, nHandle );
404 }
405 }
406
407 // Create hash map for path variables that need a system path as a return value!
408 for ( auto const & i : aVarNameAttribute )
409 {
410 m_aSystemPathVarNames.insert( OUString::createFromAscii( i.pVarName ) );
411 }
412}
413
414// class SvtPathOptions --------------------------------------------------
415
416namespace
417{
418 std::mutex& lclMutex()
419 {
420 static std::mutex SINGLETON;
421 return SINGLETON;
422 }
423}
424
426{
427 // Global access, must be guarded (multithreading)
428 std::unique_lock aGuard( lclMutex() );
429 pImpl = g_pOptions.lock();
430 if ( !pImpl )
431 {
432 pImpl = std::make_shared<SvtPathOptions_Impl>();
434 aGuard.unlock(); // because holdConfigItem will call this constructor
436 }
437}
438
440{
441 // Global access, must be guarded (multithreading)
442 std::unique_lock aGuard( lclMutex() );
443
444 pImpl.reset();
445}
446
447const OUString& SvtPathOptions::GetAddinPath() const
448{
449 return pImpl->GetAddinPath();
450}
451
453{
454 return pImpl->GetAutoCorrectPath();
455}
456
457const OUString& SvtPathOptions::GetAutoTextPath() const
458{
459 return pImpl->GetAutoTextPath();
460}
461
462const OUString& SvtPathOptions::GetBackupPath() const
463{
464 return pImpl->GetBackupPath();
465}
466
467const OUString& SvtPathOptions::GetBasicPath() const
468{
469 return pImpl->GetBasicPath();
470}
471
472const OUString& SvtPathOptions::GetBitmapPath() const
473{
474 return pImpl->GetBitmapPath();
475}
476
477const OUString& SvtPathOptions::GetConfigPath() const
478{
479 return pImpl->GetConfigPath();
480}
481
483{
484 return pImpl->GetDictionaryPath();
485}
486
487const OUString& SvtPathOptions::GetFavoritesPath() const
488{
489 return pImpl->GetFavoritesPath();
490}
491
492const OUString& SvtPathOptions::GetFilterPath() const
493{
494 return pImpl->GetFilterPath();
495}
496
497const OUString& SvtPathOptions::GetGalleryPath() const
498{
499 return pImpl->GetGalleryPath();
500}
501
502const OUString& SvtPathOptions::GetGraphicPath() const
503{
504 return pImpl->GetGraphicPath();
505}
506
507const OUString& SvtPathOptions::GetHelpPath() const
508{
509 return pImpl->GetHelpPath();
510}
511
513{
514 return pImpl->GetLinguisticPath();
515}
516
518{
519 return pImpl->GetFingerprintPath();
520}
521
523{
524 return pImpl->GetNumbertextPath();
525}
526
527const OUString& SvtPathOptions::GetModulePath() const
528{
529 return pImpl->GetModulePath();
530}
531
532const OUString& SvtPathOptions::GetPalettePath() const
533{
534 return pImpl->GetPalettePath();
535}
536
537const OUString& SvtPathOptions::GetIconsetPath() const
538{
539 return pImpl->GetIconsetPath();
540}
541
542const OUString& SvtPathOptions::GetPluginPath() const
543{
544 return pImpl->GetPluginPath();
545}
546
547const OUString& SvtPathOptions::GetStoragePath() const
548{
549 return pImpl->GetStoragePath();
550}
551
552const OUString& SvtPathOptions::GetTempPath() const
553{
554 return pImpl->GetTempPath();
555}
556
557const OUString& SvtPathOptions::GetTemplatePath() const
558{
559 return pImpl->GetTemplatePath();
560}
561
563{
564 return pImpl->GetUserConfigPath();
565}
566
567const OUString& SvtPathOptions::GetWorkPath() const
568{
569 return pImpl->GetWorkPath();
570}
571
573{
574 return pImpl->GetClassificationPath();
575}
576
577void SvtPathOptions::SetAutoTextPath( const OUString& rPath )
578{
579 pImpl->SetAutoTextPath( rPath );
580}
581
582void SvtPathOptions::SetBasicPath( const OUString& rPath )
583{
584 pImpl->SetBasicPath( rPath );
585}
586
587void SvtPathOptions::SetTempPath( const OUString& rPath )
588{
589 pImpl->SetTempPath( rPath );
590}
591
592OUString SvtPathOptions::SubstituteVariable( const OUString& rVar ) const
593{
594 return pImpl->SubstVar( rVar );
595}
596
597OUString SvtPathOptions::ExpandMacros( const OUString& rPath ) const
598{
599 return pImpl->ExpandMacros( rPath );
600}
601
602OUString SvtPathOptions::UseVariable( const OUString& rPath ) const
603{
604 return pImpl->UsePathVariables( rPath );
605}
606
607bool SvtPathOptions::SearchFile( OUString& rIniFile, SvtPathOptions::Paths ePath )
608{
609 // check parameter: empty inifile name?
610 if ( rIniFile.isEmpty() )
611 {
612 SAL_WARN( "unotools.config", "SvtPathOptions::SearchFile(): invalid parameter" );
613 return false;
614 }
615
616 OUString aIniFile = pImpl->SubstVar( rIniFile );
617 bool bRet = false;
618
619 switch ( ePath )
620 {
622 {
623 // path is a URL
624 bRet = true;
626
627 sal_Int32 nIniIndex = 0;
628 do
629 {
630 std::u16string_view aToken = o3tl::getToken(aIniFile, 0, '/', nIniIndex );
631 aObj.insertName(aToken);
632 }
633 while ( nIniIndex >= 0 );
634
636 {
637 aObj.SetSmartURL( GetConfigPath() );
638 aObj.insertName( aIniFile );
640 }
641
642 if ( bRet )
644
645 break;
646 }
647
648 default:
649 {
650 OUString aPath;
651 switch ( ePath )
652 {
653 case SvtPathOptions::Paths::AddIn: aPath = GetAddinPath(); break;
656 case SvtPathOptions::Paths::Backup: aPath = GetBackupPath(); break;
657 case SvtPathOptions::Paths::Basic: aPath = GetBasicPath(); break;
658 case SvtPathOptions::Paths::Bitmap: aPath = GetBitmapPath(); break;
659 case SvtPathOptions::Paths::Config: aPath = GetConfigPath(); break;
662 case SvtPathOptions::Paths::Filter: aPath = GetFilterPath(); break;
663 case SvtPathOptions::Paths::Gallery: aPath = GetGalleryPath(); break;
664 case SvtPathOptions::Paths::Graphic: aPath = GetGraphicPath(); break;
665 case SvtPathOptions::Paths::Help: aPath = GetHelpPath(); break;
667 case SvtPathOptions::Paths::Module: aPath = GetModulePath(); break;
668 case SvtPathOptions::Paths::Palette: aPath = GetPalettePath(); break;
669 case SvtPathOptions::Paths::IconSet: aPath = GetIconsetPath(); break;
670 case SvtPathOptions::Paths::Plugin: aPath = GetPluginPath(); break;
671 case SvtPathOptions::Paths::Storage: aPath = GetStoragePath(); break;
672 case SvtPathOptions::Paths::Temp: aPath = GetTempPath(); break;
674 case SvtPathOptions::Paths::Work: aPath = GetWorkPath(); break;
675 case SvtPathOptions::Paths::UIConfig: aPath = pImpl->GetUIConfigPath(); break;
679 // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
682 break;
683 }
684
685 sal_Int32 nPathIndex = 0;
686 do
687 {
688 bool bIsURL = true;
689 OUString aPathToken( aPath.getToken( 0, SEARCHPATH_DELIMITER, nPathIndex ) );
690 INetURLObject aObj( aPathToken );
691 if ( aObj.HasError() )
692 {
693 bIsURL = false;
694 OUString aURL;
695 if ( osl::FileBase::getFileURLFromSystemPath( aPathToken, aURL )
696 == osl::FileBase::E_None )
697 aObj.SetURL( aURL );
698 }
699 if ( aObj.GetProtocol() == INetProtocol::VndSunStarExpand )
700 {
701 Reference< XMacroExpander > xMacroExpander = theMacroExpander::get( ::comphelper::getProcessComponentContext() );
702 const OUString sExpandedPath = xMacroExpander->expandMacros( aObj.GetURLPath( INetURLObject::DecodeMechanism::WithCharset ) );
703 aObj.SetURL( sExpandedPath );
704 }
705
706 sal_Int32 nIniIndex = 0;
707 do
708 {
709 std::u16string_view aToken = o3tl::getToken(aIniFile, 0, '/', nIniIndex );
710 aObj.insertName(aToken);
711 }
712 while ( nIniIndex >= 0 );
713
715
716 if ( bRet )
717 {
718 if ( !bIsURL )
719 {
720 OUString sTmp;
721 osl::FileBase::getSystemPathFromFileURL(
723 rIniFile = sTmp;
724 }
725 else
727 break;
728 }
729 }
730 while ( nPathIndex >= 0 );
731 }
732 }
733
734 return bRet;
735}
736
737/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
bool HasError() const
bool SetSmartURL(std::u16string_view rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
OUString GetURLPath(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
bool insertName(std::u16string_view rTheName, bool bAppendFinalSlash=false, sal_Int32 nIndex=LAST_SEGMENT, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
INetProtocol GetProtocol() const
bool SetURL(std::u16string_view rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
static void holdConfigItem(EItem eItem)
Definition: itemholder1.cxx:68
const OUString & GetTempPath()
const OUString & GetDictionaryPath()
Definition: pathoptions.cxx:99
void SetBasicPath(const OUString &rPath)
const OUString & GetNumbertextPath()
VarNameSet m_aSystemPathVarNames
Definition: pathoptions.cxx:82
const OUString & GetGalleryPath()
void SetTempPath(const OUString &rPath)
OUString ExpandMacros(const OUString &rPath) const
const OUString & GetAutoCorrectPath()
Definition: pathoptions.cxx:93
const OUString & GetModulePath()
std::unordered_map< SvtPathOptions::Paths, sal_Int32 > m_aMapEnumToPropHandle
Definition: pathoptions.cxx:81
Reference< XMacroExpander > m_xMacroExpander
Definition: pathoptions.cxx:79
const OUString & GetBasicPath()
Definition: pathoptions.cxx:96
OUString SubstVar(const OUString &rVar) const
const OUString & GetPalettePath()
const OUString & GetLinguisticPath()
OUString UsePathVariables(const OUString &rPath) const
Reference< XFastPropertySet > m_xPathSettings
Definition: pathoptions.cxx:77
const OUString & GetIconsetPath()
const OUString & GetFingerprintPath()
const OUString & GetHelpPath()
void SetAutoTextPath(const OUString &rPath)
const OUString & GetGraphicPath()
const OUString & GetAddinPath()
Definition: pathoptions.cxx:92
const OUString & GetWorkPath()
Reference< XStringSubstitution > m_xSubstVariables
Definition: pathoptions.cxx:78
const OUString & GetPluginPath()
const OUString & GetPath(SvtPathOptions::Paths)
const OUString & GetUserConfigPath()
void SetPath(SvtPathOptions::Paths, const OUString &rNewPath)
const OUString & GetFavoritesPath()
const OUString & GetUIConfigPath()
const OUString & GetConfigPath()
Definition: pathoptions.cxx:98
const OUString & GetBackupPath()
Definition: pathoptions.cxx:95
const OUString & GetAutoTextPath()
Definition: pathoptions.cxx:94
const OUString & GetTemplatePath()
o3tl::enumarray< SvtPathOptions::Paths, OUString > m_aPathArray
Definition: pathoptions.cxx:76
const OUString & GetStoragePath()
const OUString & GetFilterPath()
const OUString & GetClassificationPath()
const OUString & GetBitmapPath()
Definition: pathoptions.cxx:97
const OUString & GetConfigPath() const
bool SearchFile(OUString &rIniFile, Paths ePath=Paths::UserConfig)
const OUString & GetGalleryPath() const
const OUString & GetDictionaryPath() const
const OUString & GetHelpPath() const
void SetBasicPath(const OUString &rPath)
const OUString & GetNumbertextPath() const
const OUString & GetPalettePath() const
const OUString & GetStoragePath() const
const OUString & GetFilterPath() const
const OUString & GetFingerprintPath() const
const OUString & GetAutoCorrectPath() const
OUString UseVariable(const OUString &rVar) const
const OUString & GetIconsetPath() const
const OUString & GetGraphicPath() const
OUString ExpandMacros(const OUString &rPath) const
OUString SubstituteVariable(const OUString &rVar) const
void SetTempPath(const OUString &rPath)
virtual ~SvtPathOptions() override
const OUString & GetTemplatePath() const
const OUString & GetClassificationPath() const
const OUString & GetLinguisticPath() const
const OUString & GetWorkPath() const
const OUString & GetFavoritesPath() const
std::shared_ptr< SvtPathOptions_Impl > pImpl
Definition: pathoptions.hxx:37
const OUString & GetModulePath() const
void SetAutoTextPath(const OUString &rPath)
const OUString & GetPluginPath() const
const OUString & GetAutoTextPath() const
const OUString & GetBitmapPath() const
const OUString & GetAddinPath() const
const OUString & GetBackupPath() const
const OUString & GetBasicPath() const
const OUString & GetTempPath() const
const OUString & GetUserConfigPath() const
#define TOOLS_WARN_EXCEPTION(area, stream)
URL aURL
@ PathOptions
void * p
uno_Any a
#define SAL_WARN(area, stream)
OUString get(TranslateId sContextAndId, const std::locale &loc)
Definition: resmgr.cxx:211
@ Exception
COMPHELPER_DLLPUBLIC OUString getExpandedUri(css::uno::Reference< css::uno::XComponentContext > const &context, OUString const &uri)
Reference< XComponentContext > getProcessComponentContext()
int i
ctx
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
UNOTOOLS_DLLPUBLIC bool Exists(OUString const &url)
Definition: ucbhelper.cxx:290
#define SIGN_STARTVARIABLE
Definition: pathoptions.cxx:56
#define STRPOS_NOTFOUND
Definition: pathoptions.cxx:65
const PropertyStruct aPropNames[]
#define SUBSTITUTE_INSTPATH
Definition: pathoptions.cxx:60
#define SEARCHPATH_DELIMITER
Definition: pathoptions.cxx:55
#define SUBSTITUTE_USERPATH
Definition: pathoptions.cxx:62
#define SIGN_ENDVARIABLE
Definition: pathoptions.cxx:57
static std::weak_ptr< SvtPathOptions_Impl > g_pOptions
const VarNameAttribute aVarNameAttribute[]
std::unordered_map< OUString, sal_Int32 > NameToHandleMap
Definition: pathoptions.cxx:67
#define SUBSTITUTE_PATH
Definition: pathoptions.cxx:63
std::set< OUString > VarNameSet
Definition: pathoptions.cxx:69
#define SUBSTITUTE_PROGPATH
Definition: pathoptions.cxx:61
sal_Int32 nHandle
std::mutex mutex
Definition: textsearch.cxx:94
sal_Int32 nLength