diff options
author | Mikhail Voytenko <mav@openoffice.org> | 2011-01-06 14:57:12 +0100 |
---|---|---|
committer | Mikhail Voytenko <mav@openoffice.org> | 2011-01-06 14:57:12 +0100 |
commit | 305315337b472eeee344c3ee174dded67da8d1af (patch) | |
tree | ea57d289a315e6a4b3b1f2ba80e8062f72dd59e5 /unotools/source | |
parent | 3491b4ac4fe34cacea5f4d0a4594d4a88cbbe7b2 (diff) | |
parent | 7997ab5bac6fbdfe3b3427c322507a993d33acbc (diff) |
removetooltypes01: rebase to DEV300_m96
Diffstat (limited to 'unotools/source')
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 13 | ||||
-rw-r--r-- | unotools/source/config/viewoptions.cxx | 2 | ||||
-rw-r--r-- | unotools/source/ucbhelper/tempfile.cxx | 2 |
3 files changed, 15 insertions, 2 deletions
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 132245d828ea..b7622231e602 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -46,12 +46,14 @@ #include <unotools/ucbhelper.hxx> #include <vos/process.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/componentcontext.hxx> #include <com/sun/star/beans/XFastPropertySet.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/util/XStringSubstitution.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/util/XMacroExpander.hpp> #include <rtl/instance.hxx> #include <itemholder1.hxx> @@ -998,6 +1000,17 @@ sal_Bool SvtPathOptions::SearchFile( String& rIniFile, Pathes ePath ) if ( LocalFileHelper::ConvertPhysicalNameToURL( aPathToken, aURL ) ) aObj.SetURL( aURL ); } + if ( aObj.GetProtocol() == INET_PROT_VND_SUN_STAR_EXPAND ) + { + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + Reference< XMacroExpander > xMacroExpander( aContext.getSingleton( "com.sun.star.util.theMacroExpander" ), UNO_QUERY ); + OSL_ENSURE( xMacroExpander.is(), "SvtPathOptions::SearchFile: unable to access the MacroExpander singleton!" ); + if ( xMacroExpander.is() ) + { + const ::rtl::OUString sExpandedPath = xMacroExpander->expandMacros( aObj.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ) ); + aObj.SetURL( sExpandedPath ); + } + } xub_StrLen i, nCount = aIniFile.GetTokenCount( '/' ); for ( i = 0; i < nCount; ++i ) diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx index 7f2250c611fc..f76ce48eebdf 100644 --- a/unotools/source/config/viewoptions.cxx +++ b/unotools/source/config/viewoptions.cxx @@ -781,7 +781,7 @@ css::uno::Reference< css::uno::XInterface > SvtViewOptionsBase_Impl::impl_getSet xNode = ::comphelper::ConfigurationHelper::makeSureSetNodeExists(m_xRoot, m_sListName, sNode); else { - if (m_xSet.is()) + if (m_xSet.is() && m_xSet->hasByName(sNode) ) m_xSet->getByName(sNode) >>= xNode; } } diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index 87fddc0c65cd..26742151ee3d 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -237,7 +237,7 @@ void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_Tru /* RW permission for the user only! */ mode_t old_mode = umask(077); #endif - FileBase::RC err = aFile.open(osl_File_OpenFlag_Create); + FileBase::RC err = aFile.open( osl_File_OpenFlag_Create | osl_File_OpenFlag_NoLock ); #ifdef UNX umask(old_mode); #endif |